@embedpdf/plugin-commands 2.14.4 → 3.0.0-next.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/LICENSE +192 -21
- package/dist/index.cjs +196 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -0
- package/dist/index.d.ts +150 -1
- package/dist/index.js +189 -379
- package/dist/index.js.map +1 -1
- package/package.json +21 -59
- package/dist/lib/actions.d.ts +0 -8
- package/dist/lib/commands-plugin.d.ts +0 -40
- package/dist/lib/index.d.ts +0 -8
- package/dist/lib/manifest.d.ts +0 -4
- package/dist/lib/reducer.d.ts +0 -5
- package/dist/lib/types.d.ts +0 -116
- package/dist/preact/adapter.d.ts +0 -5
- package/dist/preact/core.d.ts +0 -1
- package/dist/preact/index.cjs +0 -2
- package/dist/preact/index.cjs.map +0 -1
- package/dist/preact/index.d.ts +0 -1
- package/dist/preact/index.js +0 -91
- package/dist/preact/index.js.map +0 -1
- package/dist/react/adapter.d.ts +0 -2
- package/dist/react/core.d.ts +0 -1
- package/dist/react/index.cjs +0 -2
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -90
- package/dist/react/index.js.map +0 -1
- package/dist/shared/components/index.d.ts +0 -1
- package/dist/shared/components/keyboard-shortcuts.d.ts +0 -6
- package/dist/shared/hooks/index.d.ts +0 -1
- package/dist/shared/hooks/use-commands.d.ts +0 -23
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/utils/index.d.ts +0 -1
- package/dist/shared/utils/keyboard-handler.d.ts +0 -10
- package/dist/shared-preact/components/index.d.ts +0 -1
- package/dist/shared-preact/components/keyboard-shortcuts.d.ts +0 -6
- package/dist/shared-preact/hooks/index.d.ts +0 -1
- package/dist/shared-preact/hooks/use-commands.d.ts +0 -23
- package/dist/shared-preact/index.d.ts +0 -4
- package/dist/shared-preact/utils/index.d.ts +0 -1
- package/dist/shared-preact/utils/keyboard-handler.d.ts +0 -10
- package/dist/shared-react/components/index.d.ts +0 -1
- package/dist/shared-react/components/keyboard-shortcuts.d.ts +0 -6
- package/dist/shared-react/hooks/index.d.ts +0 -1
- package/dist/shared-react/hooks/use-commands.d.ts +0 -23
- package/dist/shared-react/index.d.ts +0 -4
- package/dist/shared-react/utils/index.d.ts +0 -1
- package/dist/shared-react/utils/keyboard-handler.d.ts +0 -10
- package/dist/shared-vue/utils/index.d.ts +0 -1
- package/dist/shared-vue/utils/keyboard-handler.d.ts +0 -10
- package/dist/svelte/components/KeyboardShortcuts.svelte.d.ts +0 -18
- package/dist/svelte/components/index.d.ts +0 -1
- package/dist/svelte/hooks/index.d.ts +0 -1
- package/dist/svelte/hooks/use-commands.svelte.d.ts +0 -21
- package/dist/svelte/index.cjs +0 -2
- package/dist/svelte/index.cjs.map +0 -1
- package/dist/svelte/index.d.ts +0 -4
- package/dist/svelte/index.js +0 -92
- package/dist/svelte/index.js.map +0 -1
- package/dist/vue/components/index.d.ts +0 -1
- package/dist/vue/components/keyboard-shortcuts.vue.d.ts +0 -3
- package/dist/vue/hooks/index.d.ts +0 -1
- package/dist/vue/hooks/use-commands.d.ts +0 -46
- package/dist/vue/index.cjs +0 -2
- package/dist/vue/index.cjs.map +0 -1
- package/dist/vue/index.d.ts +0 -4
- package/dist/vue/index.js +0 -92
- package/dist/vue/index.js.map +0 -1
package/dist/react/index.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { CommandsPlugin, CommandsPluginPackage as CommandsPluginPackage$1 } from "@embedpdf/plugin-commands";
|
|
3
|
-
export * from "@embedpdf/plugin-commands";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
import { useCapability, usePlugin } from "@embedpdf/core/react";
|
|
6
|
-
const useCommandsCapability = () => useCapability(CommandsPlugin.id);
|
|
7
|
-
const useCommandsPlugin = () => usePlugin(CommandsPlugin.id);
|
|
8
|
-
const useCommand = (commandId, documentId) => {
|
|
9
|
-
const { provides } = useCommandsCapability();
|
|
10
|
-
const [command, setCommand] = useState(
|
|
11
|
-
() => provides ? provides.resolve(commandId, documentId) : null
|
|
12
|
-
);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (!provides) {
|
|
15
|
-
setCommand(null);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
setCommand(provides.resolve(commandId, documentId));
|
|
19
|
-
const unsubscribe = provides.onCommandStateChanged((event) => {
|
|
20
|
-
if (event.commandId === commandId && event.documentId === documentId) {
|
|
21
|
-
setCommand(provides.resolve(commandId, documentId));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return unsubscribe;
|
|
25
|
-
}, [provides, commandId, documentId]);
|
|
26
|
-
return command;
|
|
27
|
-
};
|
|
28
|
-
const useCommandExecutor = (documentId) => {
|
|
29
|
-
const { provides } = useCommandsCapability();
|
|
30
|
-
return (commandId) => {
|
|
31
|
-
if (provides) {
|
|
32
|
-
provides.execute(commandId, documentId, "ui");
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
function buildShortcutString(event) {
|
|
37
|
-
const modifiers = [];
|
|
38
|
-
if (event.ctrlKey) modifiers.push("ctrl");
|
|
39
|
-
if (event.shiftKey) modifiers.push("shift");
|
|
40
|
-
if (event.altKey) modifiers.push("alt");
|
|
41
|
-
if (event.metaKey) modifiers.push("meta");
|
|
42
|
-
let key = event.key.toLowerCase();
|
|
43
|
-
if (key === " ") key = "space";
|
|
44
|
-
const isModifier = ["control", "shift", "alt", "meta"].includes(key);
|
|
45
|
-
if (isModifier) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
const parts = [...modifiers, key];
|
|
49
|
-
return parts.sort().join("+");
|
|
50
|
-
}
|
|
51
|
-
function createKeyDownHandler(commands) {
|
|
52
|
-
return (event) => {
|
|
53
|
-
const composedPath = event.composedPath();
|
|
54
|
-
const target = composedPath[0] || event.target;
|
|
55
|
-
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
|
56
|
-
if (event.key !== "Tab") return;
|
|
57
|
-
}
|
|
58
|
-
const shortcut = buildShortcutString(event);
|
|
59
|
-
if (!shortcut) return;
|
|
60
|
-
const command = commands.getCommandByShortcut(shortcut);
|
|
61
|
-
if (!command) return;
|
|
62
|
-
const resolved = commands.resolve(command.id);
|
|
63
|
-
if (resolved.disabled || !resolved.visible) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
event.stopPropagation();
|
|
68
|
-
commands.execute(command.id, void 0, "keyboard");
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function KeyboardShortcuts() {
|
|
72
|
-
const { provides: commands } = useCommandsCapability();
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (!commands) return;
|
|
75
|
-
const handleKeyDown = createKeyDownHandler(commands);
|
|
76
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
77
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
78
|
-
}, [commands]);
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
const CommandsPluginPackage = createPluginPackage(CommandsPluginPackage$1).addUtility(KeyboardShortcuts).build();
|
|
82
|
-
export {
|
|
83
|
-
CommandsPluginPackage,
|
|
84
|
-
KeyboardShortcuts,
|
|
85
|
-
useCommand,
|
|
86
|
-
useCommandExecutor,
|
|
87
|
-
useCommandsCapability,
|
|
88
|
-
useCommandsPlugin
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=index.js.map
|
package/dist/react/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-commands.ts","../../src/shared/utils/keyboard-handler.ts","../../src/shared/components/keyboard-shortcuts.tsx","../../src/shared/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { CommandsPlugin, ResolvedCommand } from '@embedpdf/plugin-commands';\nimport { useState, useEffect } from '@framework';\n\nexport const useCommandsCapability = () => useCapability<CommandsPlugin>(CommandsPlugin.id);\nexport const useCommandsPlugin = () => usePlugin<CommandsPlugin>(CommandsPlugin.id);\n\n/**\n * Hook to get a reactive command for a specific document\n * Automatically updates when command state changes\n * @param commandId Command ID\n * @param documentId Document ID\n * @returns ResolvedCommand or null if not available\n */\nexport const useCommand = (commandId: string, documentId: string): ResolvedCommand | null => {\n const { provides } = useCommandsCapability();\n const [command, setCommand] = useState<ResolvedCommand | null>(() =>\n provides ? provides.resolve(commandId, documentId) : null,\n );\n\n useEffect(() => {\n if (!provides) {\n setCommand(null);\n return;\n }\n\n // Initial resolve\n setCommand(provides.resolve(commandId, documentId));\n\n // Subscribe to state changes for this command + document\n const unsubscribe = provides.onCommandStateChanged((event) => {\n if (event.commandId === commandId && event.documentId === documentId) {\n setCommand(provides.resolve(commandId, documentId));\n }\n });\n\n return unsubscribe;\n }, [provides, commandId, documentId]);\n\n return command;\n};\n\n/**\n * Hook to execute a command\n */\nexport const useCommandExecutor = (documentId: string) => {\n const { provides } = useCommandsCapability();\n\n return (commandId: string) => {\n if (provides) {\n provides.execute(commandId, documentId, 'ui');\n }\n };\n};\n","import { CommandsCapability } from '../../lib/types';\n\n/**\n * Build a shortcut string from a keyboard event\n * @example Ctrl+Shift+A -> \"ctrl+shift+a\"\n */\nexport function buildShortcutString(event: KeyboardEvent): string | null {\n const modifiers: string[] = [];\n\n if (event.ctrlKey) modifiers.push('ctrl');\n if (event.shiftKey) modifiers.push('shift');\n if (event.altKey) modifiers.push('alt');\n if (event.metaKey) modifiers.push('meta');\n\n // Only add non-modifier keys\n let key = event.key.toLowerCase();\n if (key === ' ') key = 'space';\n const isModifier = ['control', 'shift', 'alt', 'meta'].includes(key);\n\n if (isModifier) {\n return null; // Just a modifier, no command\n }\n\n const parts = [...modifiers, key];\n return parts.sort().join('+');\n}\n\n/**\n * Handle keyboard events and execute commands based on shortcuts\n */\nexport function createKeyDownHandler(commands: CommandsCapability) {\n return (event: KeyboardEvent) => {\n // Use composedPath to get the actual target element, even inside Shadow DOM\n const composedPath = event.composedPath();\n const target = (composedPath[0] || event.target) as HTMLElement;\n\n // Don't handle shortcuts if target is an input, textarea, or contentEditable\n // Exception: allow Tab/Shift+Tab through for form field navigation\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n if (event.key !== 'Tab') return;\n }\n\n const shortcut = buildShortcutString(event);\n if (!shortcut) return;\n\n const command = commands.getCommandByShortcut(shortcut);\n if (!command) return;\n\n // Resolve without document ID - will use active document\n const resolved = commands.resolve(command.id);\n\n if (resolved.disabled || !resolved.visible) {\n return;\n }\n\n // Execute and prevent default (documentId is optional now)\n event.preventDefault();\n event.stopPropagation();\n commands.execute(command.id, undefined, 'keyboard');\n };\n}\n","import { useEffect } from '@framework';\nimport { useCommandsCapability } from '../hooks';\nimport { createKeyDownHandler } from '../utils';\n\n/**\n * Utility component that listens to keyboard events\n * and executes commands based on shortcuts.\n * This component doesn't render anything, it just sets up keyboard shortcuts.\n */\nexport function KeyboardShortcuts() {\n const { provides: commands } = useCommandsCapability();\n\n useEffect(() => {\n if (!commands) return;\n\n const handleKeyDown = createKeyDownHandler(commands);\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [commands]);\n\n // This component is only used to set up keyboard shortcuts when the plugin is initialized.\n return null;\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { CommandsPluginPackage as BaseCommandsPackage } from '@embedpdf/plugin-commands';\n\nimport { KeyboardShortcuts } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-commands';\n\nexport const CommandsPluginPackage = createPluginPackage(BaseCommandsPackage)\n .addUtility(KeyboardShortcuts)\n .build();\n"],"names":["BaseCommandsPackage"],"mappings":";;;;;AAIO,MAAM,wBAAwB,MAAM,cAA8B,eAAe,EAAE;AACnF,MAAM,oBAAoB,MAAM,UAA0B,eAAe,EAAE;AAS3E,MAAM,aAAa,CAAC,WAAmB,eAA+C;AAC3F,QAAM,EAAE,SAAA,IAAa,sBAAA;AACrB,QAAM,CAAC,SAAS,UAAU,IAAI;AAAA,IAAiC,MAC7D,WAAW,SAAS,QAAQ,WAAW,UAAU,IAAI;AAAA,EAAA;AAGvD,YAAU,MAAM;AACd,QAAI,CAAC,UAAU;AACb,iBAAW,IAAI;AACf;AAAA,IACF;AAGA,eAAW,SAAS,QAAQ,WAAW,UAAU,CAAC;AAGlD,UAAM,cAAc,SAAS,sBAAsB,CAAC,UAAU;AAC5D,UAAI,MAAM,cAAc,aAAa,MAAM,eAAe,YAAY;AACpE,mBAAW,SAAS,QAAQ,WAAW,UAAU,CAAC;AAAA,MACpD;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,UAAU,WAAW,UAAU,CAAC;AAEpC,SAAO;AACT;AAKO,MAAM,qBAAqB,CAAC,eAAuB;AACxD,QAAM,EAAE,SAAA,IAAa,sBAAA;AAErB,SAAO,CAAC,cAAsB;AAC5B,QAAI,UAAU;AACZ,eAAS,QAAQ,WAAW,YAAY,IAAI;AAAA,IAC9C;AAAA,EACF;AACF;AC/CO,SAAS,oBAAoB,OAAqC;AACvE,QAAM,YAAsB,CAAA;AAE5B,MAAI,MAAM,QAAS,WAAU,KAAK,MAAM;AACxC,MAAI,MAAM,SAAU,WAAU,KAAK,OAAO;AAC1C,MAAI,MAAM,OAAQ,WAAU,KAAK,KAAK;AACtC,MAAI,MAAM,QAAS,WAAU,KAAK,MAAM;AAGxC,MAAI,MAAM,MAAM,IAAI,YAAA;AACpB,MAAI,QAAQ,IAAK,OAAM;AACvB,QAAM,aAAa,CAAC,WAAW,SAAS,OAAO,MAAM,EAAE,SAAS,GAAG;AAEnE,MAAI,YAAY;AACd,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,CAAC,GAAG,WAAW,GAAG;AAChC,SAAO,MAAM,OAAO,KAAK,GAAG;AAC9B;AAKO,SAAS,qBAAqB,UAA8B;AACjE,SAAO,CAAC,UAAyB;AAE/B,UAAM,eAAe,MAAM,aAAA;AAC3B,UAAM,SAAU,aAAa,CAAC,KAAK,MAAM;AAIzC,QAAI,OAAO,YAAY,WAAW,OAAO,YAAY,cAAc,OAAO,mBAAmB;AAC3F,UAAI,MAAM,QAAQ,MAAO;AAAA,IAC3B;AAEA,UAAM,WAAW,oBAAoB,KAAK;AAC1C,QAAI,CAAC,SAAU;AAEf,UAAM,UAAU,SAAS,qBAAqB,QAAQ;AACtD,QAAI,CAAC,QAAS;AAGd,UAAM,WAAW,SAAS,QAAQ,QAAQ,EAAE;AAE5C,QAAI,SAAS,YAAY,CAAC,SAAS,SAAS;AAC1C;AAAA,IACF;AAGA,UAAM,eAAA;AACN,UAAM,gBAAA;AACN,aAAS,QAAQ,QAAQ,IAAI,QAAW,UAAU;AAAA,EACpD;AACF;ACnDO,SAAS,oBAAoB;AAClC,QAAM,EAAE,UAAU,SAAA,IAAa,sBAAA;AAE/B,YAAU,MAAM;AACd,QAAI,CAAC,SAAU;AAEf,UAAM,gBAAgB,qBAAqB,QAAQ;AAEnD,aAAS,iBAAiB,WAAW,aAAa;AAClD,WAAO,MAAM,SAAS,oBAAoB,WAAW,aAAa;AAAA,EACpE,GAAG,CAAC,QAAQ,CAAC;AAGb,SAAO;AACT;ACdO,MAAM,wBAAwB,oBAAoBA,uBAAmB,EACzE,WAAW,iBAAiB,EAC5B,MAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { KeyboardShortcuts } from './keyboard-shortcuts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-commands';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CommandsPlugin, ResolvedCommand } from '../../index.ts';
|
|
2
|
-
export declare const useCommandsCapability: () => {
|
|
3
|
-
provides: Readonly<import('../../index.ts').CommandsCapability> | null;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
ready: Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export declare const useCommandsPlugin: () => {
|
|
8
|
-
plugin: CommandsPlugin | null;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
ready: Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Hook to get a reactive command for a specific document
|
|
14
|
-
* Automatically updates when command state changes
|
|
15
|
-
* @param commandId Command ID
|
|
16
|
-
* @param documentId Document ID
|
|
17
|
-
* @returns ResolvedCommand or null if not available
|
|
18
|
-
*/
|
|
19
|
-
export declare const useCommand: (commandId: string, documentId: string) => ResolvedCommand | null;
|
|
20
|
-
/**
|
|
21
|
-
* Hook to execute a command
|
|
22
|
-
*/
|
|
23
|
-
export declare const useCommandExecutor: (documentId: string) => (commandId: string) => void;
|
package/dist/shared/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from '../index.ts';
|
|
4
|
-
export declare const CommandsPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../index.ts').CommandsPlugin, import('../index.ts').CommandsPluginConfig, import('../index.ts').CommandsState, import('../lib/actions').SetDisabledCategoriesAction>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keyboard-handler';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommandsCapability } from '../../lib/types';
|
|
2
|
-
/**
|
|
3
|
-
* Build a shortcut string from a keyboard event
|
|
4
|
-
* @example Ctrl+Shift+A -> "ctrl+shift+a"
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildShortcutString(event: KeyboardEvent): string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Handle keyboard events and execute commands based on shortcuts
|
|
9
|
-
*/
|
|
10
|
-
export declare function createKeyDownHandler(commands: CommandsCapability): (event: KeyboardEvent) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { KeyboardShortcuts } from './keyboard-shortcuts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-commands';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CommandsPlugin, ResolvedCommand } from '../../lib/index.ts';
|
|
2
|
-
export declare const useCommandsCapability: () => {
|
|
3
|
-
provides: Readonly<import('../../lib/index.ts').CommandsCapability> | null;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
ready: Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export declare const useCommandsPlugin: () => {
|
|
8
|
-
plugin: CommandsPlugin | null;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
ready: Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Hook to get a reactive command for a specific document
|
|
14
|
-
* Automatically updates when command state changes
|
|
15
|
-
* @param commandId Command ID
|
|
16
|
-
* @param documentId Document ID
|
|
17
|
-
* @returns ResolvedCommand or null if not available
|
|
18
|
-
*/
|
|
19
|
-
export declare const useCommand: (commandId: string, documentId: string) => ResolvedCommand | null;
|
|
20
|
-
/**
|
|
21
|
-
* Hook to execute a command
|
|
22
|
-
*/
|
|
23
|
-
export declare const useCommandExecutor: (documentId: string) => (commandId: string) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from '../lib/index.ts';
|
|
4
|
-
export declare const CommandsPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').CommandsPlugin, import('../lib/index.ts').CommandsPluginConfig, import('../lib/index.ts').CommandsState, import('../lib/actions').SetDisabledCategoriesAction>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keyboard-handler';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommandsCapability } from '../../lib/types';
|
|
2
|
-
/**
|
|
3
|
-
* Build a shortcut string from a keyboard event
|
|
4
|
-
* @example Ctrl+Shift+A -> "ctrl+shift+a"
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildShortcutString(event: KeyboardEvent): string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Handle keyboard events and execute commands based on shortcuts
|
|
9
|
-
*/
|
|
10
|
-
export declare function createKeyDownHandler(commands: CommandsCapability): (event: KeyboardEvent) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { KeyboardShortcuts } from './keyboard-shortcuts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-commands';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CommandsPlugin, ResolvedCommand } from '../../lib/index.ts';
|
|
2
|
-
export declare const useCommandsCapability: () => {
|
|
3
|
-
provides: Readonly<import('../../lib/index.ts').CommandsCapability> | null;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
ready: Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export declare const useCommandsPlugin: () => {
|
|
8
|
-
plugin: CommandsPlugin | null;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
ready: Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Hook to get a reactive command for a specific document
|
|
14
|
-
* Automatically updates when command state changes
|
|
15
|
-
* @param commandId Command ID
|
|
16
|
-
* @param documentId Document ID
|
|
17
|
-
* @returns ResolvedCommand or null if not available
|
|
18
|
-
*/
|
|
19
|
-
export declare const useCommand: (commandId: string, documentId: string) => ResolvedCommand | null;
|
|
20
|
-
/**
|
|
21
|
-
* Hook to execute a command
|
|
22
|
-
*/
|
|
23
|
-
export declare const useCommandExecutor: (documentId: string) => (commandId: string) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from '../lib/index.ts';
|
|
4
|
-
export declare const CommandsPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').CommandsPlugin, import('../lib/index.ts').CommandsPluginConfig, import('../lib/index.ts').CommandsState, import('../lib/actions').SetDisabledCategoriesAction>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keyboard-handler';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommandsCapability } from '../../lib/types';
|
|
2
|
-
/**
|
|
3
|
-
* Build a shortcut string from a keyboard event
|
|
4
|
-
* @example Ctrl+Shift+A -> "ctrl+shift+a"
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildShortcutString(event: KeyboardEvent): string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Handle keyboard events and execute commands based on shortcuts
|
|
9
|
-
*/
|
|
10
|
-
export declare function createKeyDownHandler(commands: CommandsCapability): (event: KeyboardEvent) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './keyboard-handler';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommandsCapability } from '../../lib/types';
|
|
2
|
-
/**
|
|
3
|
-
* Build a shortcut string from a keyboard event
|
|
4
|
-
* @example Ctrl+Shift+A -> "ctrl+shift+a"
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildShortcutString(event: KeyboardEvent): string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Handle keyboard events and execute commands based on shortcuts
|
|
9
|
-
*/
|
|
10
|
-
export declare function createKeyDownHandler(commands: CommandsCapability): (event: KeyboardEvent) => void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const KeyboardShortcuts: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type KeyboardShortcuts = InstanceType<typeof KeyboardShortcuts>;
|
|
18
|
-
export default KeyboardShortcuts;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as KeyboardShortcuts } from './KeyboardShortcuts.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-commands.svelte';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CommandsPlugin, ResolvedCommand } from '../../lib/index.ts';
|
|
2
|
-
export declare const useCommandsCapability: () => {
|
|
3
|
-
provides: Readonly<import('../../lib/index.ts').CommandsCapability> | null;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
ready: Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export declare const useCommandsPlugin: () => {
|
|
8
|
-
plugin: CommandsPlugin | null;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
ready: Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
interface UseCommandReturn {
|
|
13
|
-
current: ResolvedCommand | null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Hook to get a reactive command for a specific document
|
|
17
|
-
* @param getCommandId Function that returns the command ID
|
|
18
|
-
* @param getDocumentId Function that returns the document ID
|
|
19
|
-
*/
|
|
20
|
-
export declare const useCommand: (getCommandId: () => string, getDocumentId: () => string) => UseCommandReturn;
|
|
21
|
-
export {};
|
package/dist/svelte/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-commands");require("svelte/internal/disclose-version"),require("svelte/internal/flags/legacy");const r=require("svelte/internal/client"),n=require("svelte"),o=require("@embedpdf/core/svelte");function s(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const i=s(r),a=()=>o.useCapability(t.CommandsPlugin.id);function u(e,t){i.push(t,!1);const r=a();n.onMount(()=>{if(!r.provides)return;const e=(t=r.provides,e=>{const r=e.composedPath()[0]||e.target;if(("INPUT"===r.tagName||"TEXTAREA"===r.tagName||r.isContentEditable)&&"Tab"!==e.key)return;const n=function(e){const t=[];e.ctrlKey&&t.push("ctrl"),e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.metaKey&&t.push("meta");let r=e.key.toLowerCase();return" "===r&&(r="space"),["control","shift","alt","meta"].includes(r)?null:[...t,r].sort().join("+")}(e);if(!n)return;const o=t.getCommandByShortcut(n);if(!o)return;const s=t.resolve(o.id);!s.disabled&&s.visible&&(e.preventDefault(),e.stopPropagation(),t.execute(o.id,void 0,"keyboard"))});var t;return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),i.init(),i.pop()}const l=e.createPluginPackage(t.CommandsPluginPackage).addUtility(u).build();exports.CommandsPluginPackage=l,exports.KeyboardShortcuts=u,exports.useCommand=(e,t)=>{const r=a();let n=i.state(null);const o=i.derived(e),s=i.derived(t);return i.user_effect(()=>{const e=r.provides,t=i.get(o),a=i.get(s);if(e&&t&&a)return i.set(n,e.resolve(t,a),!0),e.onCommandStateChanged(r=>{r.commandId===t&&r.documentId===a&&i.set(n,e.resolve(t,a),!0)});i.set(n,null)}),{get current(){return i.get(n)}}},exports.useCommandsCapability=a,exports.useCommandsPlugin=()=>o.usePlugin(t.CommandsPlugin.id),Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-commands.svelte.ts","../../src/svelte/components/KeyboardShortcuts.svelte","../../src/shared/utils/keyboard-handler.ts","../../src/svelte/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { CommandsPlugin, ResolvedCommand } from '@embedpdf/plugin-commands';\n\nexport const useCommandsCapability = () => useCapability<CommandsPlugin>(CommandsPlugin.id);\nexport const useCommandsPlugin = () => usePlugin<CommandsPlugin>(CommandsPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseCommandReturn {\n current: ResolvedCommand | null;\n}\n\n/**\n * Hook to get a reactive command for a specific document\n * @param getCommandId Function that returns the command ID\n * @param getDocumentId Function that returns the document ID\n */\nexport const useCommand = (\n getCommandId: () => string,\n getDocumentId: () => string,\n): UseCommandReturn => {\n const capability = useCommandsCapability();\n\n let command = $state<ResolvedCommand | null>(null);\n\n // Reactive commandId and documentId\n const commandId = $derived(getCommandId());\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n const provides = capability.provides;\n const cmdId = commandId;\n const docId = documentId;\n\n if (!provides || !cmdId || !docId) {\n command = null;\n return;\n }\n\n command = provides.resolve(cmdId, docId);\n\n return provides.onCommandStateChanged((event) => {\n if (event.commandId === cmdId && event.documentId === docId) {\n command = provides.resolve(cmdId, docId);\n }\n });\n });\n\n return {\n get current() {\n return command;\n },\n };\n};\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { useCommandsCapability } from '../hooks';\n import { createKeyDownHandler } from '../../shared/utils';\n\n const commandsCapability = useCommandsCapability();\n\n onMount(() => {\n if (!commandsCapability.provides) return;\n\n const handleKeyDown = createKeyDownHandler(commandsCapability.provides);\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n });\n</script>\n\n<!-- This component is only used to set up keyboard shortcuts when the plugin is initialized. -->\n","import { CommandsCapability } from '../../lib/types';\n\n/**\n * Build a shortcut string from a keyboard event\n * @example Ctrl+Shift+A -> \"ctrl+shift+a\"\n */\nexport function buildShortcutString(event: KeyboardEvent): string | null {\n const modifiers: string[] = [];\n\n if (event.ctrlKey) modifiers.push('ctrl');\n if (event.shiftKey) modifiers.push('shift');\n if (event.altKey) modifiers.push('alt');\n if (event.metaKey) modifiers.push('meta');\n\n // Only add non-modifier keys\n let key = event.key.toLowerCase();\n if (key === ' ') key = 'space';\n const isModifier = ['control', 'shift', 'alt', 'meta'].includes(key);\n\n if (isModifier) {\n return null; // Just a modifier, no command\n }\n\n const parts = [...modifiers, key];\n return parts.sort().join('+');\n}\n\n/**\n * Handle keyboard events and execute commands based on shortcuts\n */\nexport function createKeyDownHandler(commands: CommandsCapability) {\n return (event: KeyboardEvent) => {\n // Use composedPath to get the actual target element, even inside Shadow DOM\n const composedPath = event.composedPath();\n const target = (composedPath[0] || event.target) as HTMLElement;\n\n // Don't handle shortcuts if target is an input, textarea, or contentEditable\n // Exception: allow Tab/Shift+Tab through for form field navigation\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n if (event.key !== 'Tab') return;\n }\n\n const shortcut = buildShortcutString(event);\n if (!shortcut) return;\n\n const command = commands.getCommandByShortcut(shortcut);\n if (!command) return;\n\n // Resolve without document ID - will use active document\n const resolved = commands.resolve(command.id);\n\n if (resolved.disabled || !resolved.visible) {\n return;\n }\n\n // Execute and prevent default (documentId is optional now)\n event.preventDefault();\n event.stopPropagation();\n commands.execute(command.id, undefined, 'keyboard');\n };\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { CommandsPluginPackage as BaseCommandsPackage } from '@embedpdf/plugin-commands';\n\nimport { KeyboardShortcuts } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-commands';\n\nexport const CommandsPluginPackage = createPluginPackage(BaseCommandsPackage)\n .addUtility(KeyboardShortcuts)\n .build();\n"],"names":["useCommandsCapability","useCapability","CommandsPlugin","id","commandsCapability","onMount","provides","handleKeyDown","commands","event","target","composedPath","tagName","isContentEditable","key","shortcut","modifiers","ctrlKey","push","shiftKey","altKey","metaKey","toLowerCase","includes","sort","join","buildShortcutString","command","getCommandByShortcut","resolved","resolve","disabled","visible","preventDefault","stopPropagation","execute","document","addEventListener","removeEventListener","CommandsPluginPackage","createPluginPackage","BaseCommandsPackage","addUtility","KeyboardShortcuts","build","getCommandId","getDocumentId","capability","$","state","commandId","documentId","user_effect","cmdId","docId","set","onCommandStateChanged","current","usePlugin"],"mappings":"smBAGaA,EAAA,IAA8BC,gBAA8BC,EAAAA,eAAeC,iCCEhF,MAAAC,EAAqBJ,IAE3BK,EAAAA,QAAO,KACA,IAAAD,EAAmBE,SAAQ,OAE1B,MAAAC,GCoB2BC,EDpBUJ,EAAmBE,SCqBxDG,IAEN,MACMC,EADeD,EAAME,eACE,IAAMF,EAAMC,OAIzC,IAAuB,UAAnBA,EAAOE,SAA0C,aAAnBF,EAAOE,SAA0BF,EAAOG,oBACtD,QAAdJ,EAAMK,IAAe,OAG3B,MAAMC,EApCH,SAA6BN,GAClC,MAAMO,EAAsB,GAExBP,EAAMQ,SAASD,EAAUE,KAAK,QAC9BT,EAAMU,UAAUH,EAAUE,KAAK,SAC/BT,EAAMW,QAAQJ,EAAUE,KAAK,OAC7BT,EAAMY,SAASL,EAAUE,KAAK,QAGlC,IAAIJ,EAAML,EAAMK,IAAIQ,cAIpB,MAHY,MAARR,IAAaA,EAAM,SACJ,CAAC,UAAW,QAAS,MAAO,QAAQS,SAAST,GAGvD,KAGK,IAAIE,EAAWF,GAChBU,OAAOC,KAAK,IAC3B,CAiBqBC,CAAoBjB,GACrC,IAAKM,EAAU,OAEf,MAAMY,EAAUnB,EAASoB,qBAAqBb,GAC9C,IAAKY,EAAS,OAGd,MAAME,EAAWrB,EAASsB,QAAQH,EAAQxB,KAEtC0B,EAASE,UAAaF,EAASG,UAKnCvB,EAAMwB,iBACNxB,EAAMyB,kBACN1B,EAAS2B,QAAQR,EAAQxB,QAAI,EAAW,eA5BrC,IAA8BK,EDjBpB,OADb4B,SAASC,iBAAiB,UAAW9B,GACxB,IAAA6B,SAASE,oBAAoB,UAAW/B,qBAEjD,CEND,MAAMgC,EAAwBC,EAAAA,oBAAoBC,EAAAA,uBACtDC,WAAWC,GACXC,uFHKU,CACXC,EACAC,KAEM,MAAAC,EAAa/C,QAEf2B,EAAUqB,EAAAC,MAA+B,MAGvC,MAAAC,YAAqBL,GACrBM,YAAsBL,UAE5BE,EAAAI,uBACQ9C,EAAWyC,EAAWzC,SACtB+C,QAAQH,GACRI,QAAQH,GAET,GAAA7C,GAAa+C,GAAUC,EAOrB,OAFPN,EAAAO,IAAA5B,EAAUrB,EAASwB,QAAQuB,EAAOC,IAAK,GAEhChD,EAASkD,sBAAuB/C,IACjCA,EAAMyC,YAAcG,GAAS5C,EAAM0C,aAAeG,GACpDN,EAAAO,IAAA5B,EAAUrB,EAASwB,QAAQuB,EAAOC,IAAK,KARzCN,EAAAO,IAAA5B,EAAU,SAcR,WAAA8B,gBACK9B,EACT,8DA9CS,IAA0B+B,YAA0BxD,EAAAA,eAAeC"}
|
package/dist/svelte/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from '../lib/index.ts';
|
|
4
|
-
export declare const CommandsPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').CommandsPlugin, import('../lib/index.ts').CommandsPluginConfig, import('../lib/index.ts').CommandsState, import('src/lib/actions').SetDisabledCategoriesAction>>;
|
package/dist/svelte/index.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { CommandsPlugin, CommandsPluginPackage as CommandsPluginPackage$1 } from "@embedpdf/plugin-commands";
|
|
3
|
-
export * from "@embedpdf/plugin-commands";
|
|
4
|
-
import "svelte/internal/disclose-version";
|
|
5
|
-
import "svelte/internal/flags/legacy";
|
|
6
|
-
import * as $ from "svelte/internal/client";
|
|
7
|
-
import { onMount } from "svelte";
|
|
8
|
-
import { useCapability, usePlugin } from "@embedpdf/core/svelte";
|
|
9
|
-
const useCommandsCapability = () => useCapability(CommandsPlugin.id);
|
|
10
|
-
const useCommandsPlugin = () => usePlugin(CommandsPlugin.id);
|
|
11
|
-
const useCommand = (getCommandId, getDocumentId) => {
|
|
12
|
-
const capability = useCommandsCapability();
|
|
13
|
-
let command = $.state(null);
|
|
14
|
-
const commandId = $.derived(getCommandId);
|
|
15
|
-
const documentId = $.derived(getDocumentId);
|
|
16
|
-
$.user_effect(() => {
|
|
17
|
-
const provides = capability.provides;
|
|
18
|
-
const cmdId = $.get(commandId);
|
|
19
|
-
const docId = $.get(documentId);
|
|
20
|
-
if (!provides || !cmdId || !docId) {
|
|
21
|
-
$.set(command, null);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
$.set(command, provides.resolve(cmdId, docId), true);
|
|
25
|
-
return provides.onCommandStateChanged((event) => {
|
|
26
|
-
if (event.commandId === cmdId && event.documentId === docId) {
|
|
27
|
-
$.set(command, provides.resolve(cmdId, docId), true);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
get current() {
|
|
33
|
-
return $.get(command);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
function buildShortcutString(event) {
|
|
38
|
-
const modifiers = [];
|
|
39
|
-
if (event.ctrlKey) modifiers.push("ctrl");
|
|
40
|
-
if (event.shiftKey) modifiers.push("shift");
|
|
41
|
-
if (event.altKey) modifiers.push("alt");
|
|
42
|
-
if (event.metaKey) modifiers.push("meta");
|
|
43
|
-
let key = event.key.toLowerCase();
|
|
44
|
-
if (key === " ") key = "space";
|
|
45
|
-
const isModifier = ["control", "shift", "alt", "meta"].includes(key);
|
|
46
|
-
if (isModifier) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
const parts = [...modifiers, key];
|
|
50
|
-
return parts.sort().join("+");
|
|
51
|
-
}
|
|
52
|
-
function createKeyDownHandler(commands) {
|
|
53
|
-
return (event) => {
|
|
54
|
-
const composedPath = event.composedPath();
|
|
55
|
-
const target = composedPath[0] || event.target;
|
|
56
|
-
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
|
57
|
-
if (event.key !== "Tab") return;
|
|
58
|
-
}
|
|
59
|
-
const shortcut = buildShortcutString(event);
|
|
60
|
-
if (!shortcut) return;
|
|
61
|
-
const command = commands.getCommandByShortcut(shortcut);
|
|
62
|
-
if (!command) return;
|
|
63
|
-
const resolved = commands.resolve(command.id);
|
|
64
|
-
if (resolved.disabled || !resolved.visible) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
commands.execute(command.id, void 0, "keyboard");
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function KeyboardShortcuts($$anchor, $$props) {
|
|
73
|
-
$.push($$props, false);
|
|
74
|
-
const commandsCapability = useCommandsCapability();
|
|
75
|
-
onMount(() => {
|
|
76
|
-
if (!commandsCapability.provides) return;
|
|
77
|
-
const handleKeyDown = createKeyDownHandler(commandsCapability.provides);
|
|
78
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
79
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
80
|
-
});
|
|
81
|
-
$.init();
|
|
82
|
-
$.pop();
|
|
83
|
-
}
|
|
84
|
-
const CommandsPluginPackage = createPluginPackage(CommandsPluginPackage$1).addUtility(KeyboardShortcuts).build();
|
|
85
|
-
export {
|
|
86
|
-
CommandsPluginPackage,
|
|
87
|
-
KeyboardShortcuts,
|
|
88
|
-
useCommand,
|
|
89
|
-
useCommandsCapability,
|
|
90
|
-
useCommandsPlugin
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=index.js.map
|
package/dist/svelte/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-commands.svelte.ts","../../src/shared/utils/keyboard-handler.ts","../../src/svelte/components/KeyboardShortcuts.svelte","../../src/svelte/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { CommandsPlugin, ResolvedCommand } from '@embedpdf/plugin-commands';\n\nexport const useCommandsCapability = () => useCapability<CommandsPlugin>(CommandsPlugin.id);\nexport const useCommandsPlugin = () => usePlugin<CommandsPlugin>(CommandsPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseCommandReturn {\n current: ResolvedCommand | null;\n}\n\n/**\n * Hook to get a reactive command for a specific document\n * @param getCommandId Function that returns the command ID\n * @param getDocumentId Function that returns the document ID\n */\nexport const useCommand = (\n getCommandId: () => string,\n getDocumentId: () => string,\n): UseCommandReturn => {\n const capability = useCommandsCapability();\n\n let command = $state<ResolvedCommand | null>(null);\n\n // Reactive commandId and documentId\n const commandId = $derived(getCommandId());\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n const provides = capability.provides;\n const cmdId = commandId;\n const docId = documentId;\n\n if (!provides || !cmdId || !docId) {\n command = null;\n return;\n }\n\n command = provides.resolve(cmdId, docId);\n\n return provides.onCommandStateChanged((event) => {\n if (event.commandId === cmdId && event.documentId === docId) {\n command = provides.resolve(cmdId, docId);\n }\n });\n });\n\n return {\n get current() {\n return command;\n },\n };\n};\n","import { CommandsCapability } from '../../lib/types';\n\n/**\n * Build a shortcut string from a keyboard event\n * @example Ctrl+Shift+A -> \"ctrl+shift+a\"\n */\nexport function buildShortcutString(event: KeyboardEvent): string | null {\n const modifiers: string[] = [];\n\n if (event.ctrlKey) modifiers.push('ctrl');\n if (event.shiftKey) modifiers.push('shift');\n if (event.altKey) modifiers.push('alt');\n if (event.metaKey) modifiers.push('meta');\n\n // Only add non-modifier keys\n let key = event.key.toLowerCase();\n if (key === ' ') key = 'space';\n const isModifier = ['control', 'shift', 'alt', 'meta'].includes(key);\n\n if (isModifier) {\n return null; // Just a modifier, no command\n }\n\n const parts = [...modifiers, key];\n return parts.sort().join('+');\n}\n\n/**\n * Handle keyboard events and execute commands based on shortcuts\n */\nexport function createKeyDownHandler(commands: CommandsCapability) {\n return (event: KeyboardEvent) => {\n // Use composedPath to get the actual target element, even inside Shadow DOM\n const composedPath = event.composedPath();\n const target = (composedPath[0] || event.target) as HTMLElement;\n\n // Don't handle shortcuts if target is an input, textarea, or contentEditable\n // Exception: allow Tab/Shift+Tab through for form field navigation\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n if (event.key !== 'Tab') return;\n }\n\n const shortcut = buildShortcutString(event);\n if (!shortcut) return;\n\n const command = commands.getCommandByShortcut(shortcut);\n if (!command) return;\n\n // Resolve without document ID - will use active document\n const resolved = commands.resolve(command.id);\n\n if (resolved.disabled || !resolved.visible) {\n return;\n }\n\n // Execute and prevent default (documentId is optional now)\n event.preventDefault();\n event.stopPropagation();\n commands.execute(command.id, undefined, 'keyboard');\n };\n}\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { useCommandsCapability } from '../hooks';\n import { createKeyDownHandler } from '../../shared/utils';\n\n const commandsCapability = useCommandsCapability();\n\n onMount(() => {\n if (!commandsCapability.provides) return;\n\n const handleKeyDown = createKeyDownHandler(commandsCapability.provides);\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n });\n</script>\n\n<!-- This component is only used to set up keyboard shortcuts when the plugin is initialized. -->\n","import { createPluginPackage } from '@embedpdf/core';\nimport { CommandsPluginPackage as BaseCommandsPackage } from '@embedpdf/plugin-commands';\n\nimport { KeyboardShortcuts } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-commands';\n\nexport const CommandsPluginPackage = createPluginPackage(BaseCommandsPackage)\n .addUtility(KeyboardShortcuts)\n .build();\n"],"names":["BaseCommandsPackage"],"mappings":";;;;;;;;AAGa,MAAA,wBAAA,MAA8B,cAA8B,eAAe,EAAE;AAC7E,MAAA,oBAAA,MAA0B,UAA0B,eAAe,EAAE;AAYrE,MAAA,aAAA,CACX,cACA,kBACqB;AACf,QAAA,aAAa,sBAAA;MAEf,UAAU,EAAA,MAA+B,IAAI;AAG3C,QAAA,sBAAqB,YAAA;AACrB,QAAA,uBAAsB,aAAA;AAE5B,IAAA,kBAAc;UACN,WAAW,WAAW;AACtB,UAAA,cAAQ,SAAA;AACR,UAAA,cAAQ,UAAA;AAET,QAAA,CAAA,YAAA,CAAa,SAAA,CAAU,OAAO;AACjC,QAAA,IAAA,SAAU,IAAA;;IAEZ;AAEA,MAAA,IAAA,SAAU,SAAS,QAAQ,OAAO,KAAK,GAAA,IAAA;AAEhC,WAAA,SAAS,sBAAA,CAAuB,UAAU;UAC3C,MAAM,cAAc,SAAS,MAAM,eAAe,OAAO;AAC3D,UAAA,IAAA,SAAU,SAAS,QAAQ,OAAO,KAAK,GAAA,IAAA;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH,CAAC;;IAGK,IAAA,UAAU;mBACL,OAAA;AAAA,IACT;AAAA;AAEJ;AC9CO,SAAS,oBAAoB,OAAqC;AACvE,QAAM,YAAsB,CAAA;AAE5B,MAAI,MAAM,QAAS,WAAU,KAAK,MAAM;AACxC,MAAI,MAAM,SAAU,WAAU,KAAK,OAAO;AAC1C,MAAI,MAAM,OAAQ,WAAU,KAAK,KAAK;AACtC,MAAI,MAAM,QAAS,WAAU,KAAK,MAAM;AAGxC,MAAI,MAAM,MAAM,IAAI,YAAA;AACpB,MAAI,QAAQ,IAAK,OAAM;AACvB,QAAM,aAAa,CAAC,WAAW,SAAS,OAAO,MAAM,EAAE,SAAS,GAAG;AAEnE,MAAI,YAAY;AACd,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,CAAC,GAAG,WAAW,GAAG;AAChC,SAAO,MAAM,OAAO,KAAK,GAAG;AAC9B;AAKO,SAAS,qBAAqB,UAA8B;AACjE,SAAO,CAAC,UAAyB;AAE/B,UAAM,eAAe,MAAM,aAAA;AAC3B,UAAM,SAAU,aAAa,CAAC,KAAK,MAAM;AAIzC,QAAI,OAAO,YAAY,WAAW,OAAO,YAAY,cAAc,OAAO,mBAAmB;AAC3F,UAAI,MAAM,QAAQ,MAAO;AAAA,IAC3B;AAEA,UAAM,WAAW,oBAAoB,KAAK;AAC1C,QAAI,CAAC,SAAU;AAEf,UAAM,UAAU,SAAS,qBAAqB,QAAQ;AACtD,QAAI,CAAC,QAAS;AAGd,UAAM,WAAW,SAAS,QAAQ,QAAQ,EAAE;AAE5C,QAAI,SAAS,YAAY,CAAC,SAAS,SAAS;AAC1C;AAAA,IACF;AAGA,UAAM,eAAA;AACN,UAAM,gBAAA;AACN,aAAS,QAAQ,QAAQ,IAAI,QAAW,UAAU;AAAA,EACpD;AACF;8CC5DA;;AAKQ,QAAA,qBAAqB,sBAAqB;AAEhD,UAAO,MAAO;AACP,QAAA,CAAA,mBAAmB,SAAQ;AAE1B,UAAA,gBAAgB,qBAAqB,mBAAmB,QAAQ;AAEtE,aAAS,iBAAiB,WAAW,aAAa;AACrC,WAAA,MAAA,SAAS,oBAAoB,WAAW,aAAa;AAAA,EACpE,CAAC;;;AACK;ACND,MAAM,wBAAwB,oBAAoBA,uBAAmB,EACzE,WAAW,iBAAiB,EAC5B,MAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as KeyboardShortcuts } from './keyboard-shortcuts.vue';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-commands';
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { CommandsPlugin } from '../../lib/index.ts';
|
|
3
|
-
export declare const useCommandsCapability: () => import('@embedpdf/core/vue').CapabilityState<Readonly<import('../../lib/index.ts').CommandsCapability>>;
|
|
4
|
-
export declare const useCommandsPlugin: () => import('@embedpdf/core/vue').PluginState<CommandsPlugin>;
|
|
5
|
-
/**
|
|
6
|
-
* Hook to get a reactive command for a specific document
|
|
7
|
-
* @param commandId Command ID (can be ref, computed, getter, or plain value)
|
|
8
|
-
* @param documentId Document ID (can be ref, computed, getter, or plain value)
|
|
9
|
-
*/
|
|
10
|
-
export declare const useCommand: (commandId: MaybeRefOrGetter<string>, documentId: MaybeRefOrGetter<string>) => Readonly<import('vue').Ref<{
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly label: string;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
readonly iconProps?: {
|
|
15
|
-
readonly primaryColor?: string | undefined;
|
|
16
|
-
readonly secondaryColor?: string | undefined;
|
|
17
|
-
readonly className?: string | undefined;
|
|
18
|
-
readonly title?: string | undefined;
|
|
19
|
-
} | undefined;
|
|
20
|
-
readonly active: boolean;
|
|
21
|
-
readonly disabled: boolean;
|
|
22
|
-
readonly visible: boolean;
|
|
23
|
-
readonly shortcuts?: readonly string[] | undefined;
|
|
24
|
-
readonly shortcutLabel?: string | undefined;
|
|
25
|
-
readonly categories?: readonly string[] | undefined;
|
|
26
|
-
readonly description?: string | undefined;
|
|
27
|
-
readonly execute: () => void;
|
|
28
|
-
} | null, {
|
|
29
|
-
readonly id: string;
|
|
30
|
-
readonly label: string;
|
|
31
|
-
readonly icon?: string | undefined;
|
|
32
|
-
readonly iconProps?: {
|
|
33
|
-
readonly primaryColor?: string | undefined;
|
|
34
|
-
readonly secondaryColor?: string | undefined;
|
|
35
|
-
readonly className?: string | undefined;
|
|
36
|
-
readonly title?: string | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
readonly active: boolean;
|
|
39
|
-
readonly disabled: boolean;
|
|
40
|
-
readonly visible: boolean;
|
|
41
|
-
readonly shortcuts?: readonly string[] | undefined;
|
|
42
|
-
readonly shortcutLabel?: string | undefined;
|
|
43
|
-
readonly categories?: readonly string[] | undefined;
|
|
44
|
-
readonly description?: string | undefined;
|
|
45
|
-
readonly execute: () => void;
|
|
46
|
-
} | null>>;
|
package/dist/vue/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-commands"),o=require("vue"),n=require("@embedpdf/core/vue"),r=()=>n.useCapability(t.CommandsPlugin.id);const a=o.defineComponent({__name:"keyboard-shortcuts",setup(e){const{provides:t}=r();let n=null;return o.onMounted(()=>{if(!t.value)return;const e=function(e){return t=>{const o=t.composedPath()[0]||t.target;if(("INPUT"===o.tagName||"TEXTAREA"===o.tagName||o.isContentEditable)&&"Tab"!==t.key)return;const n=function(e){const t=[];e.ctrlKey&&t.push("ctrl"),e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.metaKey&&t.push("meta");let o=e.key.toLowerCase();return" "===o&&(o="space"),["control","shift","alt","meta"].includes(o)?null:[...t,o].sort().join("+")}(t);if(!n)return;const r=e.getCommandByShortcut(n);if(!r)return;const a=e.resolve(r.id);!a.disabled&&a.visible&&(t.preventDefault(),t.stopPropagation(),e.execute(r.id,void 0,"keyboard"))}}(t.value);document.addEventListener("keydown",e),n=()=>document.removeEventListener("keydown",e)}),o.onUnmounted(()=>{null==n||n()}),(e,t)=>null}}),u=e.createPluginPackage(t.CommandsPluginPackage).addUtility(a).build();exports.CommandsPluginPackage=u,exports.KeyboardShortcuts=a,exports.useCommand=(e,t)=>{const{provides:n}=r(),a=o.ref(null);return o.watch([n,()=>o.toValue(e),()=>o.toValue(t)],([e,t,o],n,r)=>{if(!e)return void(a.value=null);a.value=e.resolve(t,o);r(e.onCommandStateChanged(n=>{n.commandId===t&&n.documentId===o&&(a.value=e.resolve(t,o))}))},{immediate:!0}),o.readonly(a)},exports.useCommandsCapability=r,exports.useCommandsPlugin=()=>n.usePlugin(t.CommandsPlugin.id),Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/vue/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/vue/hooks/use-commands.ts","../../src/vue/components/keyboard-shortcuts.vue","../../src/shared/utils/keyboard-handler.ts","../../src/vue/index.ts"],"sourcesContent":["import { ref, watch, readonly, toValue, type MaybeRefOrGetter } from 'vue';\nimport { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { CommandsPlugin, ResolvedCommand } from '@embedpdf/plugin-commands';\n\nexport const useCommandsCapability = () => useCapability<CommandsPlugin>(CommandsPlugin.id);\nexport const useCommandsPlugin = () => usePlugin<CommandsPlugin>(CommandsPlugin.id);\n\n/**\n * Hook to get a reactive command for a specific document\n * @param commandId Command ID (can be ref, computed, getter, or plain value)\n * @param documentId Document ID (can be ref, computed, getter, or plain value)\n */\nexport const useCommand = (\n commandId: MaybeRefOrGetter<string>,\n documentId: MaybeRefOrGetter<string>,\n) => {\n const { provides } = useCommandsCapability();\n const command = ref<ResolvedCommand | null>(null);\n\n watch(\n [provides, () => toValue(commandId), () => toValue(documentId)],\n ([providesValue, cmdId, docId], _, onCleanup) => {\n if (!providesValue) {\n command.value = null;\n return;\n }\n\n command.value = providesValue.resolve(cmdId, docId);\n\n const unsubscribe = providesValue.onCommandStateChanged((event) => {\n if (event.commandId === cmdId && event.documentId === docId) {\n command.value = providesValue.resolve(cmdId, docId);\n }\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n return readonly(command);\n};\n","<template>\n <!-- This component is only used to set up keyboard shortcuts when the plugin is initialized -->\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue';\nimport { useCommandsCapability } from '../hooks';\nimport { createKeyDownHandler } from '../../shared/utils';\n\nconst { provides: commands } = useCommandsCapability();\n\nlet cleanup: (() => void) | null = null;\n\nonMounted(() => {\n if (!commands.value) return;\n\n const handleKeyDown = createKeyDownHandler(commands.value);\n\n document.addEventListener('keydown', handleKeyDown);\n cleanup = () => document.removeEventListener('keydown', handleKeyDown);\n});\n\nonUnmounted(() => {\n cleanup?.();\n});\n</script>\n","import { CommandsCapability } from '../../lib/types';\n\n/**\n * Build a shortcut string from a keyboard event\n * @example Ctrl+Shift+A -> \"ctrl+shift+a\"\n */\nexport function buildShortcutString(event: KeyboardEvent): string | null {\n const modifiers: string[] = [];\n\n if (event.ctrlKey) modifiers.push('ctrl');\n if (event.shiftKey) modifiers.push('shift');\n if (event.altKey) modifiers.push('alt');\n if (event.metaKey) modifiers.push('meta');\n\n // Only add non-modifier keys\n let key = event.key.toLowerCase();\n if (key === ' ') key = 'space';\n const isModifier = ['control', 'shift', 'alt', 'meta'].includes(key);\n\n if (isModifier) {\n return null; // Just a modifier, no command\n }\n\n const parts = [...modifiers, key];\n return parts.sort().join('+');\n}\n\n/**\n * Handle keyboard events and execute commands based on shortcuts\n */\nexport function createKeyDownHandler(commands: CommandsCapability) {\n return (event: KeyboardEvent) => {\n // Use composedPath to get the actual target element, even inside Shadow DOM\n const composedPath = event.composedPath();\n const target = (composedPath[0] || event.target) as HTMLElement;\n\n // Don't handle shortcuts if target is an input, textarea, or contentEditable\n // Exception: allow Tab/Shift+Tab through for form field navigation\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n if (event.key !== 'Tab') return;\n }\n\n const shortcut = buildShortcutString(event);\n if (!shortcut) return;\n\n const command = commands.getCommandByShortcut(shortcut);\n if (!command) return;\n\n // Resolve without document ID - will use active document\n const resolved = commands.resolve(command.id);\n\n if (resolved.disabled || !resolved.visible) {\n return;\n }\n\n // Execute and prevent default (documentId is optional now)\n event.preventDefault();\n event.stopPropagation();\n commands.execute(command.id, undefined, 'keyboard');\n };\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { CommandsPluginPackage as BaseCommandsPackage } from '@embedpdf/plugin-commands';\n\nimport { KeyboardShortcuts } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-commands';\n\nexport const CommandsPluginPackage = createPluginPackage(BaseCommandsPackage)\n .addUtility(KeyboardShortcuts)\n .build();\n"],"names":["useCommandsCapability","useCapability","CommandsPlugin","id","provides","commands","cleanup","onMounted","value","handleKeyDown","event","target","composedPath","tagName","isContentEditable","key","shortcut","modifiers","ctrlKey","push","shiftKey","altKey","metaKey","toLowerCase","includes","sort","join","buildShortcutString","command","getCommandByShortcut","resolved","resolve","disabled","visible","preventDefault","stopPropagation","execute","createKeyDownHandler","document","addEventListener","removeEventListener","onUnmounted","CommandsPluginPackage","createPluginPackage","BaseCommandsPackage","addUtility","KeyboardShortcuts","build","commandId","documentId","ref","watch","toValue","providesValue","cmdId","docId","_","onCleanup","onCommandStateChanged","immediate","readonly","usePlugin"],"mappings":"0MAIaA,EAAwB,IAAMC,gBAA8BC,EAAAA,eAAeC,oECKxF,MAAQC,SAAUC,GAAaL,IAE/B,IAAIM,EAA+B,YAEnCC,EAAAA,UAAU,KACR,IAAKF,EAASG,MAAO,OAErB,MAAMC,ECcD,SAA8BJ,GACnC,OAAQK,IAEN,MACMC,EADeD,EAAME,eACE,IAAMF,EAAMC,OAIzC,IAAuB,UAAnBA,EAAOE,SAA0C,aAAnBF,EAAOE,SAA0BF,EAAOG,oBACtD,QAAdJ,EAAMK,IAAe,OAG3B,MAAMC,EApCH,SAA6BN,GAClC,MAAMO,EAAsB,GAExBP,EAAMQ,SAASD,EAAUE,KAAK,QAC9BT,EAAMU,UAAUH,EAAUE,KAAK,SAC/BT,EAAMW,QAAQJ,EAAUE,KAAK,OAC7BT,EAAMY,SAASL,EAAUE,KAAK,QAGlC,IAAIJ,EAAML,EAAMK,IAAIQ,cAIpB,MAHY,MAARR,IAAaA,EAAM,SACJ,CAAC,UAAW,QAAS,MAAO,QAAQS,SAAST,GAGvD,KAGK,IAAIE,EAAWF,GAChBU,OAAOC,KAAK,IAC3B,CAiBqBC,CAAoBjB,GACrC,IAAKM,EAAU,OAEf,MAAMY,EAAUvB,EAASwB,qBAAqBb,GAC9C,IAAKY,EAAS,OAGd,MAAME,EAAWzB,EAAS0B,QAAQH,EAAQzB,KAEtC2B,EAASE,UAAaF,EAASG,UAKnCvB,EAAMwB,iBACNxB,EAAMyB,kBACN9B,EAAS+B,QAAQR,EAAQzB,QAAI,EAAW,aAE5C,CD5CwBkC,CAAqBhC,EAASG,OAEpD8B,SAASC,iBAAiB,UAAW9B,GACrCH,EAAU,IAAMgC,SAASE,oBAAoB,UAAW/B,KAG1DgC,EAAAA,YAAY,KACV,MAAAnC,GAAAA,qBEdWoC,EAAwBC,EAAAA,oBAAoBC,EAAAA,uBACtDC,WAAWC,GACXC,uFHCuB,CACxBC,EACAC,KAEA,MAAM7C,SAAEA,GAAaJ,IACf4B,EAAUsB,EAAAA,IAA4B,MAuB5C,OArBAC,EAAAA,MACE,CAAC/C,EAAU,IAAMgD,UAAQJ,GAAY,IAAMI,EAAAA,QAAQH,IACnD,EAAEI,EAAeC,EAAOC,GAAQC,EAAGC,KACjC,IAAKJ,EAEH,YADAzB,EAAQpB,MAAQ,MAIlBoB,EAAQpB,MAAQ6C,EAActB,QAAQuB,EAAOC,GAQ7CE,EANoBJ,EAAcK,sBAAuBhD,IACnDA,EAAMsC,YAAcM,GAAS5C,EAAMuC,aAAeM,IACpD3B,EAAQpB,MAAQ6C,EAActB,QAAQuB,EAAOC,QAMnD,CAAEI,WAAW,IAGRC,EAAAA,SAAShC,8DAnCe,IAAMiC,YAA0B3D,EAAAA,eAAeC"}
|
package/dist/vue/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from '../lib/index.ts';
|
|
4
|
-
export declare const CommandsPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').CommandsPlugin, import('../lib/index.ts').CommandsPluginConfig, import('../lib/index.ts').CommandsState, import('src/lib/actions').SetDisabledCategoriesAction>>;
|