Skip to content

Commit 296f039

Browse files
committed
update: toolkit 2.0.0
1 parent e211299 commit 296f039

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.vscode/launch.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
"request": "launch",
1010
"name": "Restart",
1111
"runtimeExecutable": "npm",
12-
"runtimeArgs": ["run", "restart"],
12+
"runtimeArgs": [
13+
"run",
14+
"restart"
15+
],
1316
},
1417
{
1518
"type": "node",
1619
"request": "launch",
1720
"name": "Restart in Prod Mode",
1821
"runtimeExecutable": "npm",
19-
"runtimeArgs": ["run", "restart-prod"],
22+
"runtimeArgs": [
23+
"run",
24+
"restart-prod"
25+
],
2026
}
2127
]
2228
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"homepage": "https://github.com/windingwind/zotero-addon-template#readme",
3939
"dependencies": {
40-
"zotero-plugin-toolkit": "^1.1.1"
40+
"zotero-plugin-toolkit": "^2.0.0"
4141
},
4242
"devDependencies": {
4343
"@types/node": "^18.11.17",
@@ -51,4 +51,4 @@
5151
"typescript": "^4.9.4",
5252
"zotero-types": "^1.0.6"
5353
}
54-
}
54+
}

src/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function onShortcuts(type: string) {
130130
KeyExampleFactory.exampleShortcutSmallerCallback();
131131
break;
132132
case "confliction":
133-
KeyExampleFactory.exampleShortcutConflictionCallback();
133+
KeyExampleFactory.exampleShortcutConflictingCallback();
134134
break;
135135
default:
136136
break;

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ if (!basicTool.getGlobal("Zotero")[config.addonInstance]) {
1717
ztoolkit.basicOptions.log.disableConsole = addon.data.env === "production";
1818
ztoolkit.UI.basicOptions.ui.enableElementJSONLog =
1919
addon.data.env === "development";
20+
ztoolkit.UI.basicOptions.ui.enableElementDOMLog =
21+
addon.data.env === "development";
22+
ztoolkit.basicOptions.debug.disableDebugBridgePassword =
23+
addon.data.env === "development";
2024
Zotero[config.addonInstance] = addon;
2125
// Trigger addon hook for initialization
2226
addon.hooks.onStartup();

src/modules/examples.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ export class KeyExampleFactory {
165165
}
166166

167167
@example
168-
static exampleShortcutConflictionCallback() {
169-
const conflictionGroups = ztoolkit.Shortcut.checkAllKeyConfliction();
170-
new ztoolkit.ProgressWindow("Check Key Confliction")
168+
static exampleShortcutConflictingCallback() {
169+
const conflictingGroups = ztoolkit.Shortcut.checkAllKeyConflicting();
170+
new ztoolkit.ProgressWindow("Check Key Conflicting")
171171
.createLine({
172-
text: `${conflictionGroups.length} groups of confliction keys found. Details are in the debug output/console.`,
172+
text: `${conflictingGroups.length} groups of conflicting keys found. Details are in the debug output/console.`,
173173
})
174174
.show(-1);
175175
ztoolkit.log(
176-
"Conflictions:",
177-
conflictionGroups,
176+
"Conflicting:",
177+
conflictingGroups,
178178
"All keys:",
179179
ztoolkit.Shortcut.getAll()
180180
);
@@ -667,7 +667,7 @@ export class HelperExampleFactory {
667667

668668
@example
669669
static clipboardExample() {
670-
new ztoolkit.Clibpoard()
670+
new ztoolkit.Clipboard()
671671
.addText(
672672
"![Plugin Template](https://github.com/windingwind/zotero-plugin-template)",
673673
"text/unicode"

src/modules/preferenceScript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function updatePrefsUI() {
4646
// with addon.data.prefs.window.document
4747
// Or bind some events to the elements
4848
const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
49-
const tableHelper = new ztoolkit.VirtualizedTabel(addon.data.prefs?.window!)
49+
const tableHelper = new ztoolkit.VirtualizedTable(addon.data.prefs?.window!)
5050
.setContainerId(`${config.addonRef}-table-container`)
5151
.setProp({
5252
id: `${config.addonRef}-prefs-table`,

0 commit comments

Comments
 (0)