@embedpdf/plugin-history 3.1.0 → 3.3.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.
@@ -0,0 +1,30 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_contract = require("./contract-DHipVkAd.cjs");
3
+ //#region src/commands.ts
4
+ const historyOf = (context) => context.tryGet(require_contract.HistoryToken);
5
+ /** The history plugin's commands: `history:undo` and `history:redo`. */
6
+ function createHistoryCommands() {
7
+ return [{
8
+ id: "history:undo",
9
+ labelKey: "commands.history.undo",
10
+ label: "Undo",
11
+ icon: "undo",
12
+ shortcut: "Mod+Z",
13
+ categories: ["history"],
14
+ run: (context) => historyOf(context)?.undo(),
15
+ enabled: (context) => historyOf(context)?.canUndo() ?? false
16
+ }, {
17
+ id: "history:redo",
18
+ labelKey: "commands.history.redo",
19
+ label: "Redo",
20
+ icon: "redo",
21
+ shortcut: ["Mod+Shift+Z", "Mod+Y"],
22
+ categories: ["history"],
23
+ run: (context) => historyOf(context)?.redo(),
24
+ enabled: (context) => historyOf(context)?.canRedo() ?? false
25
+ }];
26
+ }
27
+ //#endregion
28
+ exports.createHistoryCommands = createHistoryCommands;
29
+
30
+ //# sourceMappingURL=commands.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.cjs","names":["HistoryToken"],"sources":["../src/commands.ts"],"sourcesContent":["/**\n * @embedpdf/plugin-history/commands — undo and redo. Without the history\n * plugin, both stay disabled. Focus in a text field keeps its own undo:\n * shortcuts skip text fields. Each framework's `/history` has the list ready\n * as `historyCommands`. The i18n plugin has their labels.\n */\nimport type { CommandContext, CommandDefinition } from '@embedpdf/core';\n\nimport { HistoryToken } from './contract';\n\nconst historyOf = (context: CommandContext) => context.tryGet(HistoryToken);\n\n/** The history plugin's commands: `history:undo` and `history:redo`. */\nexport function createHistoryCommands(): readonly CommandDefinition[] {\n return [\n {\n id: 'history:undo',\n labelKey: 'commands.history.undo',\n label: 'Undo',\n icon: 'undo',\n shortcut: 'Mod+Z',\n categories: ['history'],\n run: (context) => historyOf(context)?.undo(),\n enabled: (context) => historyOf(context)?.canUndo() ?? false,\n },\n {\n id: 'history:redo',\n labelKey: 'commands.history.redo',\n label: 'Redo',\n icon: 'redo',\n shortcut: ['Mod+Shift+Z', 'Mod+Y'],\n categories: ['history'],\n run: (context) => historyOf(context)?.redo(),\n enabled: (context) => historyOf(context)?.canRedo() ?? false,\n },\n ];\n}\n"],"mappings":";;;AAUA,MAAM,aAAa,YAA4B,QAAQ,OAAOA,iBAAAA,YAAY;;AAG1E,SAAgB,wBAAsD;CACpE,OAAO,CACL;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,MAAM;EACN,UAAU;EACV,YAAY,CAAC,SAAS;EACtB,MAAM,YAAY,UAAU,OAAO,CAAC,EAAE,KAAK;EAC3C,UAAU,YAAY,UAAU,OAAO,CAAC,EAAE,QAAQ,KAAK;CACzD,GACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe,OAAO;EACjC,YAAY,CAAC,SAAS;EACtB,MAAM,YAAY,UAAU,OAAO,CAAC,EAAE,KAAK;EAC3C,UAAU,YAAY,UAAU,OAAO,CAAC,EAAE,QAAQ,KAAK;CACzD,CACF;AACF"}
@@ -0,0 +1,7 @@
1
+ import { CommandDefinition } from "@embedpdf/core";
2
+ //#region src/commands.d.ts
3
+ /** The history plugin's commands: `history:undo` and `history:redo`. */
4
+ declare function createHistoryCommands(): readonly CommandDefinition[];
5
+ //#endregion
6
+ export { createHistoryCommands };
7
+ //# sourceMappingURL=commands.d.cts.map
@@ -0,0 +1,7 @@
1
+ import { CommandDefinition } from "@embedpdf/core";
2
+ //#region src/commands.d.ts
3
+ /** The history plugin's commands: `history:undo` and `history:redo`. */
4
+ declare function createHistoryCommands(): readonly CommandDefinition[];
5
+ //#endregion
6
+ export { createHistoryCommands };
7
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { n as HistoryToken } from "./contract-B7QL_Q3D.js";
2
+ //#region src/commands.ts
3
+ const historyOf = (context) => context.tryGet(HistoryToken);
4
+ /** The history plugin's commands: `history:undo` and `history:redo`. */
5
+ function createHistoryCommands() {
6
+ return [{
7
+ id: "history:undo",
8
+ labelKey: "commands.history.undo",
9
+ label: "Undo",
10
+ icon: "undo",
11
+ shortcut: "Mod+Z",
12
+ categories: ["history"],
13
+ run: (context) => historyOf(context)?.undo(),
14
+ enabled: (context) => historyOf(context)?.canUndo() ?? false
15
+ }, {
16
+ id: "history:redo",
17
+ labelKey: "commands.history.redo",
18
+ label: "Redo",
19
+ icon: "redo",
20
+ shortcut: ["Mod+Shift+Z", "Mod+Y"],
21
+ categories: ["history"],
22
+ run: (context) => historyOf(context)?.redo(),
23
+ enabled: (context) => historyOf(context)?.canRedo() ?? false
24
+ }];
25
+ }
26
+ //#endregion
27
+ export { createHistoryCommands };
28
+
29
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","names":[],"sources":["../src/commands.ts"],"sourcesContent":["/**\n * @embedpdf/plugin-history/commands — undo and redo. Without the history\n * plugin, both stay disabled. Focus in a text field keeps its own undo:\n * shortcuts skip text fields. Each framework's `/history` has the list ready\n * as `historyCommands`. The i18n plugin has their labels.\n */\nimport type { CommandContext, CommandDefinition } from '@embedpdf/core';\n\nimport { HistoryToken } from './contract';\n\nconst historyOf = (context: CommandContext) => context.tryGet(HistoryToken);\n\n/** The history plugin's commands: `history:undo` and `history:redo`. */\nexport function createHistoryCommands(): readonly CommandDefinition[] {\n return [\n {\n id: 'history:undo',\n labelKey: 'commands.history.undo',\n label: 'Undo',\n icon: 'undo',\n shortcut: 'Mod+Z',\n categories: ['history'],\n run: (context) => historyOf(context)?.undo(),\n enabled: (context) => historyOf(context)?.canUndo() ?? false,\n },\n {\n id: 'history:redo',\n labelKey: 'commands.history.redo',\n label: 'Redo',\n icon: 'redo',\n shortcut: ['Mod+Shift+Z', 'Mod+Y'],\n categories: ['history'],\n run: (context) => historyOf(context)?.redo(),\n enabled: (context) => historyOf(context)?.canRedo() ?? false,\n },\n ];\n}\n"],"mappings":";;AAUA,MAAM,aAAa,YAA4B,QAAQ,OAAO,YAAY;;AAG1E,SAAgB,wBAAsD;CACpE,OAAO,CACL;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,MAAM;EACN,UAAU;EACV,YAAY,CAAC,SAAS;EACtB,MAAM,YAAY,UAAU,OAAO,CAAC,EAAE,KAAK;EAC3C,UAAU,YAAY,UAAU,OAAO,CAAC,EAAE,QAAQ,KAAK;CACzD,GACA;EACE,IAAI;EACJ,UAAU;EACV,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe,OAAO;EACjC,YAAY,CAAC,SAAS;EACtB,MAAM,YAAY,UAAU,OAAO,CAAC,EAAE,KAAK;EAC3C,UAAU,YAAY,UAAU,OAAO,CAAC,EAAE,QAAQ,KAAK;CACzD,CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-history",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "private": false,
5
5
  "description": "Undo and redo per open document, built on the document's change queue: every change the viewer's plugins stage is a step, undone by reference while still pending.",
6
6
  "type": "module",
@@ -12,6 +12,10 @@
12
12
  "import": "./dist/index.js",
13
13
  "require": "./dist/index.cjs"
14
14
  },
15
+ "./commands": {
16
+ "import": "./dist/commands.js",
17
+ "require": "./dist/commands.cjs"
18
+ },
15
19
  "./contract": {
16
20
  "import": "./dist/contract.js",
17
21
  "require": "./dist/contract.cjs"
@@ -22,16 +26,16 @@
22
26
  "dist"
23
27
  ],
24
28
  "dependencies": {
25
- "@embedpdf/core": "3.1.0",
26
- "@embedpdf/engine-core": "3.1.0"
29
+ "@embedpdf/core": "3.3.0",
30
+ "@embedpdf/engine-core": "3.3.0"
27
31
  },
28
32
  "devDependencies": {
29
33
  "typescript": "^5.0.0",
30
34
  "vitest": "^2.1.9",
31
35
  "@embedpdf/tooling-build": "0.0.0",
32
- "@embedpdf/plugin-annotation": "3.1.0",
33
- "@embedpdf/engine": "3.1.0",
34
- "@embedpdf/plugin-interaction": "3.1.0"
36
+ "@embedpdf/engine": "3.3.0",
37
+ "@embedpdf/plugin-interaction": "3.3.0",
38
+ "@embedpdf/plugin-annotation": "3.3.0"
35
39
  },
36
40
  "license": "Apache-2.0",
37
41
  "sideEffects": false,