@paged-media/plugin-sdk 0.2.1-canary.0 → 0.2.2-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -52
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -460,63 +460,13 @@ async function commitAndSelect(paged, mutation, label) {
|
|
|
460
460
|
}
|
|
461
461
|
|
|
462
462
|
// src/tools.ts
|
|
463
|
-
function contentSelectionInactive(state) {
|
|
464
|
-
const editor = state;
|
|
465
|
-
return editor?.contentSelection?.contentSelection == null;
|
|
466
|
-
}
|
|
467
463
|
function contributeTool(host, tool) {
|
|
468
|
-
|
|
469
|
-
store.add(host.contribute.tool(tool));
|
|
470
|
-
const commandId = `${tool.id}.activate`;
|
|
471
|
-
store.add(
|
|
472
|
-
host.contribute.command({
|
|
473
|
-
id: commandId,
|
|
474
|
-
title: `Tool: ${tool.title}`,
|
|
475
|
-
category: "Tools",
|
|
476
|
-
icon: tool.icon,
|
|
477
|
-
handler: (paged) => {
|
|
478
|
-
paged.tool.setBaseTool(tool.id);
|
|
479
|
-
}
|
|
480
|
-
})
|
|
481
|
-
);
|
|
482
|
-
if (tool.shortcut) {
|
|
483
|
-
store.add(
|
|
484
|
-
host.contribute.keybinding({
|
|
485
|
-
key: tool.shortcut,
|
|
486
|
-
command: commandId,
|
|
487
|
-
when: contentSelectionInactive
|
|
488
|
-
})
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
return store;
|
|
464
|
+
return host.contribute.tool(tool);
|
|
492
465
|
}
|
|
493
466
|
|
|
494
467
|
// src/panels.ts
|
|
495
468
|
function contributePanel(host, panel) {
|
|
496
|
-
|
|
497
|
-
store.add(host.contribute.panel(panel));
|
|
498
|
-
store.add(
|
|
499
|
-
host.contribute.command({
|
|
500
|
-
id: `${panel.id}.show`,
|
|
501
|
-
title: `Show: ${panel.title}`,
|
|
502
|
-
category: "View",
|
|
503
|
-
icon: panel.icon,
|
|
504
|
-
handler: () => {
|
|
505
|
-
host.shell.openPanel(panel.id);
|
|
506
|
-
}
|
|
507
|
-
})
|
|
508
|
-
);
|
|
509
|
-
store.add(
|
|
510
|
-
host.contribute.command({
|
|
511
|
-
id: `${panel.id}.hide`,
|
|
512
|
-
title: `Hide: ${panel.title}`,
|
|
513
|
-
category: "View",
|
|
514
|
-
handler: () => {
|
|
515
|
-
host.shell.closePanel(panel.id);
|
|
516
|
-
}
|
|
517
|
-
})
|
|
518
|
-
);
|
|
519
|
-
return store;
|
|
469
|
+
return host.contribute.panel(panel);
|
|
520
470
|
}
|
|
521
471
|
export {
|
|
522
472
|
API_VERSION,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paged-media/plugin-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2-canary.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@paged-media/plugin-api": "0.2.
|
|
14
|
+
"@paged-media/plugin-api": "0.2.2-canary.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"typescript": "^5.6.3",
|