update: toolkit 2.0.0
This commit is contained in:
		
							parent
							
								
									e2112995ad
								
							
						
					
					
						commit
						296f03944a
					
				
							
								
								
									
										10
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							@ -9,14 +9,20 @@
 | 
				
			|||||||
            "request": "launch",
 | 
					            "request": "launch",
 | 
				
			||||||
            "name": "Restart",
 | 
					            "name": "Restart",
 | 
				
			||||||
            "runtimeExecutable": "npm",
 | 
					            "runtimeExecutable": "npm",
 | 
				
			||||||
            "runtimeArgs": ["run", "restart"],
 | 
					            "runtimeArgs": [
 | 
				
			||||||
 | 
					                "run",
 | 
				
			||||||
 | 
					                "restart"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            "type": "node",
 | 
					            "type": "node",
 | 
				
			||||||
            "request": "launch",
 | 
					            "request": "launch",
 | 
				
			||||||
            "name": "Restart in Prod Mode",
 | 
					            "name": "Restart in Prod Mode",
 | 
				
			||||||
            "runtimeExecutable": "npm",
 | 
					            "runtimeExecutable": "npm",
 | 
				
			||||||
            "runtimeArgs": ["run", "restart-prod"],
 | 
					            "runtimeArgs": [
 | 
				
			||||||
 | 
					                "run",
 | 
				
			||||||
 | 
					                "restart-prod"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -37,7 +37,7 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://github.com/windingwind/zotero-addon-template#readme",
 | 
					  "homepage": "https://github.com/windingwind/zotero-addon-template#readme",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "zotero-plugin-toolkit": "^1.1.1"
 | 
					    "zotero-plugin-toolkit": "^2.0.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@types/node": "^18.11.17",
 | 
					    "@types/node": "^18.11.17",
 | 
				
			||||||
@ -51,4 +51,4 @@
 | 
				
			|||||||
    "typescript": "^4.9.4",
 | 
					    "typescript": "^4.9.4",
 | 
				
			||||||
    "zotero-types": "^1.0.6"
 | 
					    "zotero-types": "^1.0.6"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -130,7 +130,7 @@ function onShortcuts(type: string) {
 | 
				
			|||||||
      KeyExampleFactory.exampleShortcutSmallerCallback();
 | 
					      KeyExampleFactory.exampleShortcutSmallerCallback();
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    case "confliction":
 | 
					    case "confliction":
 | 
				
			||||||
      KeyExampleFactory.exampleShortcutConflictionCallback();
 | 
					      KeyExampleFactory.exampleShortcutConflictingCallback();
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
 | 
				
			|||||||
@ -17,6 +17,10 @@ if (!basicTool.getGlobal("Zotero")[config.addonInstance]) {
 | 
				
			|||||||
  ztoolkit.basicOptions.log.disableConsole = addon.data.env === "production";
 | 
					  ztoolkit.basicOptions.log.disableConsole = addon.data.env === "production";
 | 
				
			||||||
  ztoolkit.UI.basicOptions.ui.enableElementJSONLog =
 | 
					  ztoolkit.UI.basicOptions.ui.enableElementJSONLog =
 | 
				
			||||||
    addon.data.env === "development";
 | 
					    addon.data.env === "development";
 | 
				
			||||||
 | 
					  ztoolkit.UI.basicOptions.ui.enableElementDOMLog =
 | 
				
			||||||
 | 
					    addon.data.env === "development";
 | 
				
			||||||
 | 
					  ztoolkit.basicOptions.debug.disableDebugBridgePassword =
 | 
				
			||||||
 | 
					    addon.data.env === "development";
 | 
				
			||||||
  Zotero[config.addonInstance] = addon;
 | 
					  Zotero[config.addonInstance] = addon;
 | 
				
			||||||
  // Trigger addon hook for initialization
 | 
					  // Trigger addon hook for initialization
 | 
				
			||||||
  addon.hooks.onStartup();
 | 
					  addon.hooks.onStartup();
 | 
				
			||||||
 | 
				
			|||||||
@ -165,16 +165,16 @@ export class KeyExampleFactory {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @example
 | 
					  @example
 | 
				
			||||||
  static exampleShortcutConflictionCallback() {
 | 
					  static exampleShortcutConflictingCallback() {
 | 
				
			||||||
    const conflictionGroups = ztoolkit.Shortcut.checkAllKeyConfliction();
 | 
					    const conflictingGroups = ztoolkit.Shortcut.checkAllKeyConflicting();
 | 
				
			||||||
    new ztoolkit.ProgressWindow("Check Key Confliction")
 | 
					    new ztoolkit.ProgressWindow("Check Key Conflicting")
 | 
				
			||||||
      .createLine({
 | 
					      .createLine({
 | 
				
			||||||
        text: `${conflictionGroups.length} groups of confliction keys found. Details are in the debug output/console.`,
 | 
					        text: `${conflictingGroups.length} groups of conflicting keys found. Details are in the debug output/console.`,
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      .show(-1);
 | 
					      .show(-1);
 | 
				
			||||||
    ztoolkit.log(
 | 
					    ztoolkit.log(
 | 
				
			||||||
      "Conflictions:",
 | 
					      "Conflicting:",
 | 
				
			||||||
      conflictionGroups,
 | 
					      conflictingGroups,
 | 
				
			||||||
      "All keys:",
 | 
					      "All keys:",
 | 
				
			||||||
      ztoolkit.Shortcut.getAll()
 | 
					      ztoolkit.Shortcut.getAll()
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
@ -667,7 +667,7 @@ export class HelperExampleFactory {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @example
 | 
					  @example
 | 
				
			||||||
  static clipboardExample() {
 | 
					  static clipboardExample() {
 | 
				
			||||||
    new ztoolkit.Clibpoard()
 | 
					    new ztoolkit.Clipboard()
 | 
				
			||||||
      .addText(
 | 
					      .addText(
 | 
				
			||||||
        "",
 | 
					        "",
 | 
				
			||||||
        "text/unicode"
 | 
					        "text/unicode"
 | 
				
			||||||
 | 
				
			|||||||
@ -46,7 +46,7 @@ async function updatePrefsUI() {
 | 
				
			|||||||
  // with addon.data.prefs.window.document
 | 
					  // with addon.data.prefs.window.document
 | 
				
			||||||
  // Or bind some events to the elements
 | 
					  // Or bind some events to the elements
 | 
				
			||||||
  const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
 | 
					  const renderLock = ztoolkit.getGlobal("Zotero").Promise.defer();
 | 
				
			||||||
  const tableHelper = new ztoolkit.VirtualizedTabel(addon.data.prefs?.window!)
 | 
					  const tableHelper = new ztoolkit.VirtualizedTable(addon.data.prefs?.window!)
 | 
				
			||||||
    .setContainerId(`${config.addonRef}-table-container`)
 | 
					    .setContainerId(`${config.addonRef}-table-container`)
 | 
				
			||||||
    .setProp({
 | 
					    .setProp({
 | 
				
			||||||
      id: `${config.addonRef}-prefs-table`,
 | 
					      id: `${config.addonRef}-prefs-table`,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user