Skip to content

Commit

Permalink
update: ztoolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Oct 3, 2024
1 parent b356590 commit 08adac1
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"unist-util-visit": "^5.0.0",
"unist-util-visit-parents": "^6.0.1",
"yamljs": "^0.3.0",
"zotero-plugin-toolkit": "^3.0.3"
"zotero-plugin-toolkit": "^4.0.3"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
Expand Down
13 changes: 4 additions & 9 deletions src/addon.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { Prompt } from "zotero-plugin-toolkit/dist/managers/prompt";
import {
ColumnOptions,
VirtualizedTableHelper,
} from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
import { LargePrefHelper } from "zotero-plugin-toolkit/dist/helpers/largePref";
import ToolkitGlobal from "zotero-plugin-toolkit/dist/managers/toolkitGlobal";
import { Prompt, PromptManager } from "zotero-plugin-toolkit";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit";
import { LargePrefHelper } from "zotero-plugin-toolkit";

import { getPref, setPref } from "./utils/prefs";
import { SyncDataType } from "./modules/sync/managerWindow";
import hooks from "./hooks";
import api from "./api";
Expand Down Expand Up @@ -126,7 +121,7 @@ class Addon {
relation: {},
imageCache: {},
get prompt() {
return ToolkitGlobal.getInstance().prompt.instance;
return new PromptManager().prompt;
},
hint: {
silent: false,
Expand Down
2 changes: 1 addition & 1 deletion src/elements/linkCreator/notePicker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from "../../../package.json";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit";
import { PluginCEBase } from "../base";
import {
getPref,
Expand Down
2 changes: 1 addition & 1 deletion src/elements/linkCreator/notePreview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from "../../../package.json";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit";
import { PluginCEBase } from "../base";
import TreeModel = require("tree-model");
import { waitUtilAsync } from "../../utils/wait";
Expand Down
2 changes: 1 addition & 1 deletion src/elements/linkCreator/outlinePicker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from "../../../package.json";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit";
import { PluginCEBase } from "../base";
import TreeModel = require("tree-model");

Expand Down
2 changes: 1 addition & 1 deletion src/elements/workspace/outlinePane.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FilePickerHelper } from "zotero-plugin-toolkit/dist/helpers/filePicker";
import { FilePickerHelper } from "zotero-plugin-toolkit";
import { config } from "../../../package.json";
import { formatPath } from "../../utils/str";
import { waitUtilAsync } from "../../utils/wait";
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicTool } from "zotero-plugin-toolkit/dist/basic";
import { BasicTool } from "zotero-plugin-toolkit";
import Addon from "./addon";
import { config } from "../package.json";

Expand Down
2 changes: 1 addition & 1 deletion src/modules/template/picker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prompt } from "zotero-plugin-toolkit/dist/managers/prompt";
import { Prompt } from "zotero-plugin-toolkit";
import { addLineToNote } from "../../utils/note";
import { getString } from "../../utils/locale";

Expand Down
2 changes: 1 addition & 1 deletion src/modules/viewItems.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PatchHelper } from "zotero-plugin-toolkit/dist/helpers/patch";
import { PatchHelper } from "zotero-plugin-toolkit";
import { getPref } from "../utils/prefs";

export function patchViewItems(win: Window) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/hint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config } from "../../package.json";
import { ProgressWindowHelper } from "zotero-plugin-toolkit/dist/helpers/progressWindow";
import { ProgressWindowHelper } from "zotero-plugin-toolkit";
import { PROGRESS_TITLE } from "./config";
import { waitUtilAsync } from "./wait";

Expand Down
26 changes: 14 additions & 12 deletions src/utils/ztoolkit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
import {
BasicTool,
UITool,
PromptManager,
MenuManager,
ClipboardHelper,
FilePickerHelper,
ProgressWindowHelper,
VirtualizedTableHelper,
DialogHelper,
LargePrefHelper,
GuideHelper,
unregister,
} from "zotero-plugin-toolkit";
import { config } from "../../package.json";

export { createZToolkit };
Expand Down Expand Up @@ -27,18 +41,6 @@ function initZToolkit(_ztoolkit: ReturnType<typeof createZToolkit>) {
);
}

import { BasicTool, unregister } from "zotero-plugin-toolkit/dist/basic";
import { UITool } from "zotero-plugin-toolkit/dist/tools/ui";
import { ClipboardHelper } from "zotero-plugin-toolkit/dist/helpers/clipboard";
import { DialogHelper } from "zotero-plugin-toolkit/dist/helpers/dialog";
import { FilePickerHelper } from "zotero-plugin-toolkit/dist/helpers/filePicker";
import { ProgressWindowHelper } from "zotero-plugin-toolkit/dist/helpers/progressWindow";
import { VirtualizedTableHelper } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable";
import { MenuManager } from "zotero-plugin-toolkit/dist/managers/menu";
import { PromptManager } from "zotero-plugin-toolkit/dist/managers/prompt";
import { LargePrefHelper } from "zotero-plugin-toolkit/dist/helpers/largePref";
import { GuideHelper } from "zotero-plugin-toolkit/dist/helpers/guide";

class MyToolkit extends BasicTool {
UI: UITool;
Prompt: PromptManager;
Expand Down

0 comments on commit 08adac1

Please sign in to comment.