@embedpdf/plugin-document-manager 2.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.
Files changed (68) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.cjs +2 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +466 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/document-manager-plugin.d.ts +45 -0
  8. package/dist/lib/index.d.ts +7 -0
  9. package/dist/lib/manifest.d.ts +4 -0
  10. package/dist/lib/types.d.ts +80 -0
  11. package/dist/preact/adapter.d.ts +5 -0
  12. package/dist/preact/core.d.ts +1 -0
  13. package/dist/preact/index.cjs +2 -0
  14. package/dist/preact/index.cjs.map +1 -0
  15. package/dist/preact/index.d.ts +1 -0
  16. package/dist/preact/index.js +136 -0
  17. package/dist/preact/index.js.map +1 -0
  18. package/dist/react/adapter.d.ts +2 -0
  19. package/dist/react/core.d.ts +1 -0
  20. package/dist/react/index.cjs +2 -0
  21. package/dist/react/index.cjs.map +1 -0
  22. package/dist/react/index.d.ts +1 -0
  23. package/dist/react/index.js +135 -0
  24. package/dist/react/index.js.map +1 -0
  25. package/dist/shared/components/document-content.d.ts +27 -0
  26. package/dist/shared/components/document-context.d.ts +42 -0
  27. package/dist/shared/components/file-picker.d.ts +1 -0
  28. package/dist/shared/components/index.d.ts +3 -0
  29. package/dist/shared/hooks/index.d.ts +1 -0
  30. package/dist/shared/hooks/use-document-manager.d.ts +23 -0
  31. package/dist/shared/index.d.ts +4 -0
  32. package/dist/shared-preact/components/document-content.d.ts +27 -0
  33. package/dist/shared-preact/components/document-context.d.ts +42 -0
  34. package/dist/shared-preact/components/file-picker.d.ts +1 -0
  35. package/dist/shared-preact/components/index.d.ts +3 -0
  36. package/dist/shared-preact/hooks/index.d.ts +1 -0
  37. package/dist/shared-preact/hooks/use-document-manager.d.ts +23 -0
  38. package/dist/shared-preact/index.d.ts +4 -0
  39. package/dist/shared-react/components/document-content.d.ts +27 -0
  40. package/dist/shared-react/components/document-context.d.ts +42 -0
  41. package/dist/shared-react/components/file-picker.d.ts +1 -0
  42. package/dist/shared-react/components/index.d.ts +3 -0
  43. package/dist/shared-react/hooks/index.d.ts +1 -0
  44. package/dist/shared-react/hooks/use-document-manager.d.ts +23 -0
  45. package/dist/shared-react/index.d.ts +4 -0
  46. package/dist/svelte/components/DocumentContent.svelte.d.ts +15 -0
  47. package/dist/svelte/components/DocumentContext.svelte.d.ts +18 -0
  48. package/dist/svelte/components/FilePicker.svelte.d.ts +3 -0
  49. package/dist/svelte/components/index.d.ts +3 -0
  50. package/dist/svelte/hooks/index.d.ts +1 -0
  51. package/dist/svelte/hooks/use-document-manager.svelte.d.ts +26 -0
  52. package/dist/svelte/index.cjs +2 -0
  53. package/dist/svelte/index.cjs.map +1 -0
  54. package/dist/svelte/index.d.ts +4 -0
  55. package/dist/svelte/index.js +175 -0
  56. package/dist/svelte/index.js.map +1 -0
  57. package/dist/vue/components/document-content.vue.d.ts +29 -0
  58. package/dist/vue/components/document-context.vue.d.ts +28 -0
  59. package/dist/vue/components/file-picker.vue.d.ts +3 -0
  60. package/dist/vue/components/index.d.ts +3 -0
  61. package/dist/vue/hooks/index.d.ts +1 -0
  62. package/dist/vue/hooks/use-document-manager.d.ts +17 -0
  63. package/dist/vue/index.cjs +2 -0
  64. package/dist/vue/index.cjs.map +1 -0
  65. package/dist/vue/index.d.ts +4 -0
  66. package/dist/vue/index.js +169 -0
  67. package/dist/vue/index.js.map +1 -0
  68. package/package.json +80 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/shared/components/document-content.tsx","../../src/shared/hooks/use-document-manager.ts","../../src/shared/components/document-context.tsx","../../src/shared/components/file-picker.tsx","../../src/shared/index.ts"],"sourcesContent":["import { ReactNode } from '@framework';\nimport { useDocumentState } from '@embedpdf/core/@framework';\nimport { DocumentState } from '@embedpdf/core';\n\nexport interface DocumentContentRenderProps {\n documentState: DocumentState;\n isLoading: boolean;\n isError: boolean;\n isLoaded: boolean;\n}\n\ninterface DocumentContentProps {\n documentId: string | null;\n children: (props: DocumentContentRenderProps) => ReactNode;\n}\n\n/**\n * Headless component for rendering document content with loading/error states\n *\n * @example\n * <DocumentContent documentId={activeDocumentId}>\n * {({ document, isLoading, isError, isLoaded }) => {\n * if (isLoading) return <LoadingSpinner />;\n * if (isError) return <ErrorMessage />;\n * if (isLoaded) return <PDFViewer document={document} />;\n * return null;\n * }}\n * </DocumentContent>\n */\nexport function DocumentContent({ documentId, children }: DocumentContentProps) {\n const documentState = useDocumentState(documentId);\n\n if (!documentState) return null;\n\n const isLoading = documentState.status === 'loading';\n const isError = documentState.status === 'error';\n const isLoaded = documentState.status === 'loaded';\n\n return <>{children({ documentState, isLoading, isError, isLoaded })}</>;\n}\n","import { useMemo } from '@framework';\nimport { useCapability, useCoreState, usePlugin } from '@embedpdf/core/@framework';\nimport { DocumentManagerPlugin } from '@embedpdf/plugin-document-manager';\nimport { DocumentState } from '@embedpdf/core';\n\nexport const useDocumentManagerPlugin = () =>\n usePlugin<DocumentManagerPlugin>(DocumentManagerPlugin.id);\nexport const useDocumentManagerCapability = () =>\n useCapability<DocumentManagerPlugin>(DocumentManagerPlugin.id);\n\n/**\n * Hook for active document state\n */\nexport const useActiveDocument = () => {\n const coreState = useCoreState();\n\n return useMemo(() => {\n if (!coreState) {\n return {\n activeDocumentId: null,\n activeDocument: null,\n };\n }\n\n const activeDocumentId = coreState.activeDocumentId;\n const activeDocument = activeDocumentId\n ? (coreState.documents[activeDocumentId] ?? null)\n : null;\n\n return {\n activeDocumentId,\n activeDocument,\n };\n }, [coreState]);\n};\n\n/**\n * Hook for all open documents (in order)\n */\nexport const useOpenDocuments = (documentIds?: string[]) => {\n const coreState = useCoreState();\n\n return useMemo(() => {\n if (!coreState) return [];\n\n // If specific documentIds are provided, use THEIR order\n if (documentIds && documentIds.length > 0) {\n return documentIds\n .map((docId) => coreState.documents[docId])\n .filter((doc): doc is DocumentState => doc !== null && doc !== undefined);\n }\n\n // Otherwise use the global document order\n return coreState.documentOrder\n .map((docId) => coreState.documents[docId])\n .filter((doc): doc is DocumentState => doc !== null && doc !== undefined);\n }, [coreState, documentIds]);\n};\n","import { ReactNode, useCallback } from '@framework';\nimport { useOpenDocuments, useActiveDocument, useDocumentManagerCapability } from '../hooks';\nimport { DocumentState } from '@embedpdf/core';\n\nexport interface TabActions {\n select: (documentId: string) => void;\n close: (documentId: string) => void;\n move: (documentId: string, toIndex: number) => void;\n}\n\nexport interface DocumentContextRenderProps {\n documentStates: DocumentState[];\n activeDocumentId: string | null;\n actions: TabActions;\n}\n\ninterface DocumentContextProps {\n children: (props: DocumentContextRenderProps) => ReactNode;\n}\n\n/**\n * Headless component for managing document tabs\n * Provides all state and actions, completely UI-agnostic\n *\n * @example\n * <DocumentContext>\n * {({ documents, activeDocumentId, actions }) => (\n * <div className=\"tabs\">\n * {documents.map((doc) => (\n * <button\n * key={doc.id}\n * onClick={() => actions.select(doc.id)}\n * className={doc.id === activeDocumentId ? 'active' : ''}\n * >\n * {doc.name}\n * <button onClick={(e) => {\n * e.stopPropagation();\n * actions.close(doc.id);\n * }}>×</button>\n * </button>\n * ))}\n * </div>\n * )}\n * </DocumentContext>\n */\nexport function DocumentContext({ children }: DocumentContextProps) {\n const documentStates = useOpenDocuments();\n const { activeDocumentId } = useActiveDocument();\n const { provides } = useDocumentManagerCapability();\n\n const select = useCallback(\n (documentId: string) => {\n provides?.setActiveDocument(documentId);\n },\n [provides],\n );\n\n const close = useCallback(\n (documentId: string) => {\n provides?.closeDocument(documentId);\n },\n [provides],\n );\n\n const move = useCallback(\n (documentId: string, toIndex: number) => {\n provides?.moveDocument(documentId, toIndex);\n },\n [provides],\n );\n\n const actions: TabActions = {\n select,\n close,\n move,\n };\n\n return <>{children({ documentStates, activeDocumentId, actions })}</>;\n}\n","import { ChangeEvent, useEffect, useRef } from '@framework';\nimport { useDocumentManagerCapability, useDocumentManagerPlugin } from '../hooks';\nimport { PdfErrorReason, Task } from '@embedpdf/models';\nimport { OpenDocumentResponse, OpenFileDialogOptions } from '@embedpdf/plugin-document-manager';\n\nexport function FilePicker() {\n const { plugin } = useDocumentManagerPlugin();\n const { provides } = useDocumentManagerCapability();\n const inputRef = useRef<HTMLInputElement>(null);\n const taskRef = useRef<Task<OpenDocumentResponse, PdfErrorReason> | null>(null);\n const optionsRef = useRef<OpenFileDialogOptions | undefined>(undefined);\n\n useEffect(() => {\n if (!plugin?.onOpenFileRequest) return;\n const unsub = plugin.onOpenFileRequest(({ task, options }) => {\n taskRef.current = task;\n optionsRef.current = options;\n inputRef.current?.click();\n });\n return unsub;\n }, [plugin]);\n\n const onChange = async (e: ChangeEvent<HTMLInputElement>) => {\n const file = (e.currentTarget as HTMLInputElement).files?.[0];\n if (!file || !provides) return;\n const buffer = await file.arrayBuffer();\n const openTask = provides.openDocumentBuffer({\n name: file.name,\n buffer,\n documentId: optionsRef.current?.documentId,\n scale: optionsRef.current?.scale,\n rotation: optionsRef.current?.rotation,\n autoActivate: optionsRef.current?.autoActivate,\n });\n openTask.wait(\n (result) => {\n taskRef.current?.resolve(result);\n },\n (error) => {\n taskRef.current?.fail(error);\n },\n );\n };\n\n return (\n <input\n ref={inputRef}\n type=\"file\"\n accept=\"application/pdf\"\n style={{ display: 'none' }}\n onChange={onChange}\n />\n );\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { DocumentManagerPluginPackage as BaseDocumentManagerPackage } from '@embedpdf/plugin-document-manager';\nimport { FilePicker } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-document-manager';\n\n// A convenience package that auto-registers our utilities\nexport const DocumentManagerPluginPackage = createPluginPackage(BaseDocumentManagerPackage)\n .addUtility(FilePicker) // headless utility consumers can mount once and call cap.openFileDialog()\n .build();\n"],"names":["_a","BaseDocumentManagerPackage"],"mappings":";;;;;;AA6BO,SAAS,gBAAgB,EAAE,YAAY,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aAAY,gBAAW,YAAX,mBAAoB;AAAA,MAChC,QAAO,gBAAW,YAAX,mBAAoB;AAAA,MAC3B,WAAU,gBAAW,YAAX,mBAAoB;AAAA,MAC9B,eAAc,gBAAW,YAAX,mBAAoB;AAAA,IAAA,CACnC;AACD,aAAS;AAAA,MACP,CAAC,WAAW;;AACV,SAAAA,MAAA,QAAQ,YAAR,gBAAAA,IAAiB,QAAQ;AAAA,MAC3B;AAAA,MACA,CAAC,UAAU;;AACT,SAAAA,MAAA,QAAQ,YAAR,gBAAAA,IAAiB,KAAK;AAAA,MACxB;AAAA,IAAA;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAK;AAAA,MACL,QAAO;AAAA,MACP,OAAO,EAAE,SAAS,OAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAAA;AAGN;AC5CO,MAAM,+BAA+B,oBAAoBC,8BAA0B,EACvF,WAAW,UAAU,EACrB,MAAA;"}
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from '../../react/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface DocumentContentRenderProps {
4
+ documentState: DocumentState;
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ isLoaded: boolean;
8
+ }
9
+ interface DocumentContentProps {
10
+ documentId: string | null;
11
+ children: (props: DocumentContentRenderProps) => ReactNode;
12
+ }
13
+ /**
14
+ * Headless component for rendering document content with loading/error states
15
+ *
16
+ * @example
17
+ * <DocumentContent documentId={activeDocumentId}>
18
+ * {({ document, isLoading, isError, isLoaded }) => {
19
+ * if (isLoading) return <LoadingSpinner />;
20
+ * if (isError) return <ErrorMessage />;
21
+ * if (isLoaded) return <PDFViewer document={document} />;
22
+ * return null;
23
+ * }}
24
+ * </DocumentContent>
25
+ */
26
+ export declare function DocumentContent({ documentId, children }: DocumentContentProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export {};
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from '../../react/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface TabActions {
4
+ select: (documentId: string) => void;
5
+ close: (documentId: string) => void;
6
+ move: (documentId: string, toIndex: number) => void;
7
+ }
8
+ export interface DocumentContextRenderProps {
9
+ documentStates: DocumentState[];
10
+ activeDocumentId: string | null;
11
+ actions: TabActions;
12
+ }
13
+ interface DocumentContextProps {
14
+ children: (props: DocumentContextRenderProps) => ReactNode;
15
+ }
16
+ /**
17
+ * Headless component for managing document tabs
18
+ * Provides all state and actions, completely UI-agnostic
19
+ *
20
+ * @example
21
+ * <DocumentContext>
22
+ * {({ documents, activeDocumentId, actions }) => (
23
+ * <div className="tabs">
24
+ * {documents.map((doc) => (
25
+ * <button
26
+ * key={doc.id}
27
+ * onClick={() => actions.select(doc.id)}
28
+ * className={doc.id === activeDocumentId ? 'active' : ''}
29
+ * >
30
+ * {doc.name}
31
+ * <button onClick={(e) => {
32
+ * e.stopPropagation();
33
+ * actions.close(doc.id);
34
+ * }}>×</button>
35
+ * </button>
36
+ * ))}
37
+ * </div>
38
+ * )}
39
+ * </DocumentContext>
40
+ */
41
+ export declare function DocumentContext({ children }: DocumentContextProps): import("react/jsx-runtime").JSX.Element;
42
+ export {};
@@ -0,0 +1 @@
1
+ export declare function FilePicker(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './document-content';
2
+ export * from './document-context';
3
+ export * from './file-picker';
@@ -0,0 +1 @@
1
+ export * from './use-document-manager';
@@ -0,0 +1,23 @@
1
+ import { DocumentManagerPlugin } from '../../index.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export declare const useDocumentManagerPlugin: () => {
4
+ plugin: DocumentManagerPlugin | null;
5
+ isLoading: boolean;
6
+ ready: Promise<void>;
7
+ };
8
+ export declare const useDocumentManagerCapability: () => {
9
+ provides: Readonly<import('../../index.ts').DocumentManagerCapability> | null;
10
+ isLoading: boolean;
11
+ ready: Promise<void>;
12
+ };
13
+ /**
14
+ * Hook for active document state
15
+ */
16
+ export declare const useActiveDocument: () => {
17
+ activeDocumentId: string | null;
18
+ activeDocument: DocumentState | null;
19
+ };
20
+ /**
21
+ * Hook for all open documents (in order)
22
+ */
23
+ export declare const useOpenDocuments: (documentIds?: string[]) => DocumentState[];
@@ -0,0 +1,4 @@
1
+ export * from './hooks';
2
+ export * from './components';
3
+ export * from '../index.ts';
4
+ export declare const DocumentManagerPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../index.ts').DocumentManagerPlugin, import('../index.ts').DocumentManagerPluginConfig, unknown, import('@embedpdf/core').Action>>;
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from '../../preact/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface DocumentContentRenderProps {
4
+ documentState: DocumentState;
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ isLoaded: boolean;
8
+ }
9
+ interface DocumentContentProps {
10
+ documentId: string | null;
11
+ children: (props: DocumentContentRenderProps) => ReactNode;
12
+ }
13
+ /**
14
+ * Headless component for rendering document content with loading/error states
15
+ *
16
+ * @example
17
+ * <DocumentContent documentId={activeDocumentId}>
18
+ * {({ document, isLoading, isError, isLoaded }) => {
19
+ * if (isLoading) return <LoadingSpinner />;
20
+ * if (isError) return <ErrorMessage />;
21
+ * if (isLoaded) return <PDFViewer document={document} />;
22
+ * return null;
23
+ * }}
24
+ * </DocumentContent>
25
+ */
26
+ export declare function DocumentContent({ documentId, children }: DocumentContentProps): import("preact").JSX.Element | null;
27
+ export {};
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from '../../preact/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface TabActions {
4
+ select: (documentId: string) => void;
5
+ close: (documentId: string) => void;
6
+ move: (documentId: string, toIndex: number) => void;
7
+ }
8
+ export interface DocumentContextRenderProps {
9
+ documentStates: DocumentState[];
10
+ activeDocumentId: string | null;
11
+ actions: TabActions;
12
+ }
13
+ interface DocumentContextProps {
14
+ children: (props: DocumentContextRenderProps) => ReactNode;
15
+ }
16
+ /**
17
+ * Headless component for managing document tabs
18
+ * Provides all state and actions, completely UI-agnostic
19
+ *
20
+ * @example
21
+ * <DocumentContext>
22
+ * {({ documents, activeDocumentId, actions }) => (
23
+ * <div className="tabs">
24
+ * {documents.map((doc) => (
25
+ * <button
26
+ * key={doc.id}
27
+ * onClick={() => actions.select(doc.id)}
28
+ * className={doc.id === activeDocumentId ? 'active' : ''}
29
+ * >
30
+ * {doc.name}
31
+ * <button onClick={(e) => {
32
+ * e.stopPropagation();
33
+ * actions.close(doc.id);
34
+ * }}>×</button>
35
+ * </button>
36
+ * ))}
37
+ * </div>
38
+ * )}
39
+ * </DocumentContext>
40
+ */
41
+ export declare function DocumentContext({ children }: DocumentContextProps): import("preact").JSX.Element;
42
+ export {};
@@ -0,0 +1 @@
1
+ export declare function FilePicker(): import("preact").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './document-content';
2
+ export * from './document-context';
3
+ export * from './file-picker';
@@ -0,0 +1 @@
1
+ export * from './use-document-manager';
@@ -0,0 +1,23 @@
1
+ import { DocumentManagerPlugin } from '../../lib/index.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export declare const useDocumentManagerPlugin: () => {
4
+ plugin: DocumentManagerPlugin | null;
5
+ isLoading: boolean;
6
+ ready: Promise<void>;
7
+ };
8
+ export declare const useDocumentManagerCapability: () => {
9
+ provides: Readonly<import('../../lib/index.ts').DocumentManagerCapability> | null;
10
+ isLoading: boolean;
11
+ ready: Promise<void>;
12
+ };
13
+ /**
14
+ * Hook for active document state
15
+ */
16
+ export declare const useActiveDocument: () => {
17
+ activeDocumentId: string | null;
18
+ activeDocument: DocumentState | null;
19
+ };
20
+ /**
21
+ * Hook for all open documents (in order)
22
+ */
23
+ export declare const useOpenDocuments: (documentIds?: string[]) => DocumentState[];
@@ -0,0 +1,4 @@
1
+ export * from './hooks';
2
+ export * from './components';
3
+ export * from '../lib/index.ts';
4
+ export declare const DocumentManagerPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').DocumentManagerPlugin, import('../lib/index.ts').DocumentManagerPluginConfig, unknown, import('@embedpdf/core').Action>>;
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from '../../react/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface DocumentContentRenderProps {
4
+ documentState: DocumentState;
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ isLoaded: boolean;
8
+ }
9
+ interface DocumentContentProps {
10
+ documentId: string | null;
11
+ children: (props: DocumentContentRenderProps) => ReactNode;
12
+ }
13
+ /**
14
+ * Headless component for rendering document content with loading/error states
15
+ *
16
+ * @example
17
+ * <DocumentContent documentId={activeDocumentId}>
18
+ * {({ document, isLoading, isError, isLoaded }) => {
19
+ * if (isLoading) return <LoadingSpinner />;
20
+ * if (isError) return <ErrorMessage />;
21
+ * if (isLoaded) return <PDFViewer document={document} />;
22
+ * return null;
23
+ * }}
24
+ * </DocumentContent>
25
+ */
26
+ export declare function DocumentContent({ documentId, children }: DocumentContentProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export {};
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from '../../react/adapter.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface TabActions {
4
+ select: (documentId: string) => void;
5
+ close: (documentId: string) => void;
6
+ move: (documentId: string, toIndex: number) => void;
7
+ }
8
+ export interface DocumentContextRenderProps {
9
+ documentStates: DocumentState[];
10
+ activeDocumentId: string | null;
11
+ actions: TabActions;
12
+ }
13
+ interface DocumentContextProps {
14
+ children: (props: DocumentContextRenderProps) => ReactNode;
15
+ }
16
+ /**
17
+ * Headless component for managing document tabs
18
+ * Provides all state and actions, completely UI-agnostic
19
+ *
20
+ * @example
21
+ * <DocumentContext>
22
+ * {({ documents, activeDocumentId, actions }) => (
23
+ * <div className="tabs">
24
+ * {documents.map((doc) => (
25
+ * <button
26
+ * key={doc.id}
27
+ * onClick={() => actions.select(doc.id)}
28
+ * className={doc.id === activeDocumentId ? 'active' : ''}
29
+ * >
30
+ * {doc.name}
31
+ * <button onClick={(e) => {
32
+ * e.stopPropagation();
33
+ * actions.close(doc.id);
34
+ * }}>×</button>
35
+ * </button>
36
+ * ))}
37
+ * </div>
38
+ * )}
39
+ * </DocumentContext>
40
+ */
41
+ export declare function DocumentContext({ children }: DocumentContextProps): import("react/jsx-runtime").JSX.Element;
42
+ export {};
@@ -0,0 +1 @@
1
+ export declare function FilePicker(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './document-content';
2
+ export * from './document-context';
3
+ export * from './file-picker';
@@ -0,0 +1 @@
1
+ export * from './use-document-manager';
@@ -0,0 +1,23 @@
1
+ import { DocumentManagerPlugin } from '../../lib/index.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export declare const useDocumentManagerPlugin: () => {
4
+ plugin: DocumentManagerPlugin | null;
5
+ isLoading: boolean;
6
+ ready: Promise<void>;
7
+ };
8
+ export declare const useDocumentManagerCapability: () => {
9
+ provides: Readonly<import('../../lib/index.ts').DocumentManagerCapability> | null;
10
+ isLoading: boolean;
11
+ ready: Promise<void>;
12
+ };
13
+ /**
14
+ * Hook for active document state
15
+ */
16
+ export declare const useActiveDocument: () => {
17
+ activeDocumentId: string | null;
18
+ activeDocument: DocumentState | null;
19
+ };
20
+ /**
21
+ * Hook for all open documents (in order)
22
+ */
23
+ export declare const useOpenDocuments: (documentIds?: string[]) => DocumentState[];
@@ -0,0 +1,4 @@
1
+ export * from './hooks';
2
+ export * from './components';
3
+ export * from '../lib/index.ts';
4
+ export declare const DocumentManagerPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').DocumentManagerPlugin, import('../lib/index.ts').DocumentManagerPluginConfig, unknown, import('@embedpdf/core').Action>>;
@@ -0,0 +1,15 @@
1
+ import { Snippet } from 'svelte';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface DocumentContentRenderProps {
4
+ documentState: DocumentState;
5
+ isLoading: boolean;
6
+ isError: boolean;
7
+ isLoaded: boolean;
8
+ }
9
+ interface DocumentContentProps {
10
+ documentId: string | null;
11
+ children: Snippet<[DocumentContentRenderProps]>;
12
+ }
13
+ declare const DocumentContent: import('svelte', { with: { "resolution-mode": "import" } }).Component<DocumentContentProps, {}, "">;
14
+ type DocumentContent = ReturnType<typeof DocumentContent>;
15
+ export default DocumentContent;
@@ -0,0 +1,18 @@
1
+ import { Snippet } from 'svelte';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export interface TabActions {
4
+ select: (documentId: string) => void;
5
+ close: (documentId: string) => void;
6
+ move: (documentId: string, toIndex: number) => void;
7
+ }
8
+ export interface DocumentContextRenderProps {
9
+ documentStates: DocumentState[];
10
+ activeDocumentId: string | null;
11
+ actions: TabActions;
12
+ }
13
+ interface DocumentContextProps {
14
+ children: Snippet<[DocumentContextRenderProps]>;
15
+ }
16
+ declare const DocumentContext: import('svelte', { with: { "resolution-mode": "import" } }).Component<DocumentContextProps, {}, "">;
17
+ type DocumentContext = ReturnType<typeof DocumentContext>;
18
+ export default DocumentContext;
@@ -0,0 +1,3 @@
1
+ declare const FilePicker: import('svelte', { with: { "resolution-mode": "import" } }).Component<Record<string, never>, {}, "">;
2
+ type FilePicker = ReturnType<typeof FilePicker>;
3
+ export default FilePicker;
@@ -0,0 +1,3 @@
1
+ export { default as FilePicker } from './FilePicker.svelte';
2
+ export { default as DocumentContext } from './DocumentContext.svelte';
3
+ export { default as DocumentContent } from './DocumentContent.svelte';
@@ -0,0 +1 @@
1
+ export * from './use-document-manager.svelte';
@@ -0,0 +1,26 @@
1
+ import { DocumentManagerPlugin } from '../../lib/index.ts';
2
+ import { DocumentState } from '@embedpdf/core';
3
+ export declare const useDocumentManagerPlugin: () => {
4
+ plugin: DocumentManagerPlugin | null;
5
+ isLoading: boolean;
6
+ ready: Promise<void>;
7
+ };
8
+ export declare const useDocumentManagerCapability: () => {
9
+ provides: Readonly<import('../../lib/index.ts').DocumentManagerCapability> | null;
10
+ isLoading: boolean;
11
+ ready: Promise<void>;
12
+ };
13
+ /**
14
+ * Hook for active document state
15
+ */
16
+ export declare function useActiveDocument(): {
17
+ readonly activeDocumentId: string | null;
18
+ readonly activeDocument: DocumentState | null;
19
+ };
20
+ /**
21
+ * Hook for all open documents (in order)
22
+ * @param getDocumentIds Optional getter function for specific document IDs to filter/order by
23
+ */
24
+ export declare function useOpenDocuments(getDocumentIds?: () => string[] | undefined): {
25
+ readonly current: DocumentState[];
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-document-manager");require("svelte/internal/disclose-version");const n=require("svelte/internal/client"),r=require("@embedpdf/core/svelte");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const u=o(n),i=()=>r.usePlugin(t.DocumentManagerPlugin.id),c=()=>r.useCapability(t.DocumentManagerPlugin.id);function l(){const e=r.useCoreState(),t=u.derived(()=>{var t;return(null==(t=e.current)?void 0:t.activeDocumentId)??null}),n=u.derived(()=>{const t=e.current;if(!t)return null;const n=t.activeDocumentId;return n?t.documents[n]??null:null});return{get activeDocumentId(){return u.get(t)},get activeDocument(){return u.get(n)}}}function a(e){const t=r.useCoreState(),n=u.derived(()=>e?e():void 0),o=u.derived(()=>{const e=t.current;return e?u.get(n)&&u.get(n).length>0?u.get(n).map(t=>e.documents[t]).filter(e=>null!=e):e.documentOrder.map(t=>e.documents[t]).filter(e=>null!=e):[]});return{get current(){return u.get(o)}}}var s=u.from_html('<input type="file" accept="application/pdf"/>');function d(e,t){u.push(t,!0);const n=i(),r=c();let o=u.state(null),l=u.state(null),a=u.state(void 0);u.user_effect(()=>{var e;if(!(null==(e=n.plugin)?void 0:e.onOpenFileRequest))return;return n.plugin.onOpenFileRequest(({task:e,options:t})=>{var n;u.set(l,e,!0),u.set(a,t,!0),null==(n=u.get(o))||n.click()})});var d=s();d.__change=async e=>{var t,n,o,i,c;const s=null==(t=e.target.files)?void 0:t[0];if(!s||!r.provides)return;const d=await s.arrayBuffer();r.provides.openDocumentBuffer({name:s.name,buffer:d,documentId:null==(n=u.get(a))?void 0:n.documentId,scale:null==(o=u.get(a))?void 0:o.scale,rotation:null==(i=u.get(a))?void 0:i.rotation,autoActivate:null==(c=u.get(a))?void 0:c.autoActivate}).wait(e=>{var t;null==(t=u.get(l))||t.resolve(e)},e=>{var t;null==(t=u.get(l))||t.fail(e)})},u.set_style(d,"",{},{display:"none"}),u.bind_this(d,e=>u.set(o,e),()=>u.get(o)),u.append(e,d),u.pop()}u.delegate(["change"]);const p=e.createPluginPackage(t.DocumentManagerPluginPackage).addUtility(d).build();exports.DocumentContent=function(e,t){u.push(t,!0);const n=r.useDocumentState(()=>t.documentId),o=u.derived(()=>{var e;return"loading"===(null==(e=n.current)?void 0:e.status)}),i=u.derived(()=>{var e;return"error"===(null==(e=n.current)?void 0:e.status)}),c=u.derived(()=>{var e;return"loaded"===(null==(e=n.current)?void 0:e.status)});var l=u.comment(),a=u.first_child(l),s=e=>{var r=u.comment(),l=u.first_child(r);u.snippet(l,()=>t.children,()=>({documentState:n.current,isLoading:u.get(o),isError:u.get(i),isLoaded:u.get(c)})),u.append(e,r)};u.if(a,e=>{n.current&&e(s)}),u.append(e,l),u.pop()},exports.DocumentContext=function(e,t){u.push(t,!0);const n=a(),r=l(),o=c(),i={select:e=>{var t;null==(t=o.provides)||t.setActiveDocument(e)},close:e=>{var t;null==(t=o.provides)||t.closeDocument(e)},move:(e,t)=>{var n;null==(n=o.provides)||n.moveDocument(e,t)}};var s=u.comment(),d=u.first_child(s);u.snippet(d,()=>t.children,()=>({documentStates:n.current,activeDocumentId:r.activeDocumentId,actions:i})),u.append(e,s),u.pop()},exports.DocumentManagerPluginPackage=p,exports.FilePicker=d,exports.useActiveDocument=l,exports.useDocumentManagerCapability=c,exports.useDocumentManagerPlugin=i,exports.useOpenDocuments=a,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-document-manager.svelte.ts","../../src/svelte/components/FilePicker.svelte","../../src/svelte/index.ts","../../src/svelte/components/DocumentContent.svelte","../../src/svelte/components/DocumentContext.svelte"],"sourcesContent":["import { useCapability, usePlugin, useCoreState } from '@embedpdf/core/svelte';\nimport { DocumentManagerPlugin } from '@embedpdf/plugin-document-manager';\nimport type { DocumentState } from '@embedpdf/core';\n\nexport const useDocumentManagerPlugin = () =>\n usePlugin<DocumentManagerPlugin>(DocumentManagerPlugin.id);\nexport const useDocumentManagerCapability = () =>\n useCapability<DocumentManagerPlugin>(DocumentManagerPlugin.id);\n\n/**\n * Hook for active document state\n */\nexport function useActiveDocument() {\n // Keep reference to avoid destructuring - maintains reactivity\n const coreStateRef = useCoreState();\n\n // Use $derived.by for computed values that depend on the reactive coreState\n const activeDocumentId = $derived.by(() => {\n return coreStateRef.current?.activeDocumentId ?? null;\n });\n\n const activeDocument = $derived.by(() => {\n const core = coreStateRef.current;\n if (!core) return null;\n\n const docId = core.activeDocumentId;\n return docId ? (core.documents[docId] ?? null) : null;\n });\n\n return {\n get activeDocumentId() {\n return activeDocumentId;\n },\n get activeDocument() {\n return activeDocument;\n },\n };\n}\n\n/**\n * Hook for all open documents (in order)\n * @param getDocumentIds Optional getter function for specific document IDs to filter/order by\n */\nexport function useOpenDocuments(getDocumentIds?: () => string[] | undefined) {\n // Keep reference to avoid destructuring - maintains reactivity\n const coreStateRef = useCoreState();\n\n // Derive documentIds reactively if getter is provided\n const documentIds = $derived(getDocumentIds ? getDocumentIds() : undefined);\n\n // Use $derived.by for computed array of documents\n const documents = $derived.by(() => {\n const core = coreStateRef.current;\n if (!core) return [];\n\n // If specific documentIds are provided, use THEIR order\n if (documentIds && documentIds.length > 0) {\n return documentIds\n .map((docId) => core.documents[docId])\n .filter((doc): doc is DocumentState => doc !== null && doc !== undefined);\n }\n\n // Otherwise use the global document order\n return core.documentOrder\n .map((docId) => core.documents[docId])\n .filter((doc): doc is DocumentState => doc !== null && doc !== undefined);\n });\n\n return {\n get current() {\n return documents;\n },\n };\n}\n","<script lang=\"ts\">\n import { useDocumentManagerCapability, useDocumentManagerPlugin } from '../hooks';\n import type { Task } from '@embedpdf/models';\n import type { PdfErrorReason } from '@embedpdf/models';\n import type {\n OpenDocumentResponse,\n OpenFileDialogOptions,\n } from '@embedpdf/plugin-document-manager';\n\n const documentManagerPlugin = useDocumentManagerPlugin();\n const documentManagerCapability = useDocumentManagerCapability();\n\n let inputRef = $state<HTMLInputElement | null>(null);\n let taskRef = $state<Task<OpenDocumentResponse, PdfErrorReason> | null>(null);\n let optionsRef = $state<OpenFileDialogOptions | undefined>(undefined);\n\n $effect(() => {\n if (!documentManagerPlugin.plugin?.onOpenFileRequest) return;\n\n const unsubscribe = documentManagerPlugin.plugin.onOpenFileRequest(({ task, options }) => {\n taskRef = task;\n optionsRef = options;\n inputRef?.click();\n });\n\n return unsubscribe;\n });\n\n const onChange = async (event: Event) => {\n const target = event.target as HTMLInputElement;\n const file = target.files?.[0];\n if (!file || !documentManagerCapability.provides) return;\n\n const buffer = await file.arrayBuffer();\n const openTask = documentManagerCapability.provides.openDocumentBuffer({\n name: file.name,\n buffer,\n documentId: optionsRef?.documentId,\n scale: optionsRef?.scale,\n rotation: optionsRef?.rotation,\n autoActivate: optionsRef?.autoActivate,\n });\n\n openTask.wait(\n (result) => {\n taskRef?.resolve(result);\n },\n (error) => {\n taskRef?.fail(error);\n },\n );\n };\n</script>\n\n<input\n bind:this={inputRef}\n type=\"file\"\n accept=\"application/pdf\"\n style:display=\"none\"\n onchange={onChange}\n/>\n","import { createPluginPackage } from '@embedpdf/core';\nimport { DocumentManagerPluginPackage as BaseDocumentManagerPackage } from '@embedpdf/plugin-document-manager';\n\nimport { FilePicker, DocumentContext, DocumentContent } from './components';\n\nexport * from './hooks';\nexport * from './components';\n\nexport * from '@embedpdf/plugin-document-manager';\n\nexport const DocumentManagerPluginPackage = createPluginPackage(BaseDocumentManagerPackage)\n .addUtility(FilePicker)\n .build();\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { DocumentState } from '@embedpdf/core';\n\n export interface DocumentContentRenderProps {\n documentState: DocumentState;\n isLoading: boolean;\n isError: boolean;\n isLoaded: boolean;\n }\n\n interface DocumentContentProps {\n documentId: string | null;\n children: Snippet<[DocumentContentRenderProps]>;\n }\n\n let { documentId, children }: DocumentContentProps = $props();\n\n const docState = useDocumentState(() => documentId);\n\n const isLoading = $derived(docState.current?.status === 'loading');\n const isError = $derived(docState.current?.status === 'error');\n const isLoaded = $derived(docState.current?.status === 'loaded');\n</script>\n\n<!--\n Headless component for rendering document content with loading/error states\n \n @example\n <DocumentContent {documentId}>\n {#snippet children({ documentState, isLoading, isError, isLoaded })}\n {#if isLoading}\n <LoadingSpinner />\n {:else if isError}\n <ErrorMessage />\n {:else if isLoaded}\n <PDFViewer {documentState} />\n {/if}\n {/snippet}\n </DocumentContent>\n-->\n{#if docState.current}\n {@render children({\n documentState: docState.current,\n isLoading,\n isError,\n isLoaded,\n })}\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useOpenDocuments, useActiveDocument, useDocumentManagerCapability } from '../hooks';\n import type { DocumentState } from '@embedpdf/core';\n\n export interface TabActions {\n select: (documentId: string) => void;\n close: (documentId: string) => void;\n move: (documentId: string, toIndex: number) => void;\n }\n\n export interface DocumentContextRenderProps {\n documentStates: DocumentState[];\n activeDocumentId: string | null;\n actions: TabActions;\n }\n\n interface DocumentContextProps {\n children: Snippet<[DocumentContextRenderProps]>;\n }\n\n let { children }: DocumentContextProps = $props();\n\n const openDocuments = useOpenDocuments();\n const activeDoc = useActiveDocument();\n const capability = useDocumentManagerCapability();\n\n const actions: TabActions = {\n select: (documentId: string) => {\n capability.provides?.setActiveDocument(documentId);\n },\n close: (documentId: string) => {\n capability.provides?.closeDocument(documentId);\n },\n move: (documentId: string, toIndex: number) => {\n capability.provides?.moveDocument(documentId, toIndex);\n },\n };\n</script>\n\n<!--\n Headless component for managing document tabs\n Provides all state and actions, completely UI-agnostic\n \n @example\n <DocumentContext>\n {#snippet children({ documentStates, activeDocumentId, actions })}\n <div class=\"tabs\">\n {#each documentStates as doc (doc.id)}\n <button\n onclick={() => actions.select(doc.id)}\n class:active={doc.id === activeDocumentId}\n >\n {doc.name}\n <button onclick={(e) => { e.stopPropagation(); actions.close(doc.id); }}>×</button>\n </button>\n {/each}\n </div>\n {/snippet}\n </DocumentContext>\n-->\n{@render children({\n documentStates: openDocuments.current,\n activeDocumentId: activeDoc.activeDocumentId,\n actions,\n})}\n"],"names":["useDocumentManagerPlugin","usePlugin","DocumentManagerPlugin","id","useDocumentManagerCapability","useCapability","useActiveDocument","coreStateRef","useCoreState","activeDocumentId","_a","current","activeDocument","core","docId","documents","useOpenDocuments","getDocumentIds","documentIds","$","derived","get","length","map","filter","doc","documentOrder","documentManagerPlugin","documentManagerCapability","inputRef","taskRef","optionsRef","user_effect","plugin","onOpenFileRequest","task","options","set","click","async","event","file","target","files","provides","buffer","arrayBuffer","openDocumentBuffer","name","documentId","scale","rotation","autoActivate","wait","result","resolve","error","fail","bind_this","input","$$value","DocumentManagerPluginPackage","createPluginPackage","BaseDocumentManagerPackage","addUtility","FilePicker","build","docState","useDocumentState","$$props","isLoading","status","isError","isLoaded","documentState","$$render","consequent","openDocuments","activeDoc","capability","actions","select","setActiveDocument","close","closeDocument","move","toIndex","moveD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clE,QAC9BF,iBAAkBqE,EAAUrE,iBAC5BuE,kCA1BF"}
@@ -0,0 +1,4 @@
1
+ export * from './hooks';
2
+ export * from './components';
3
+ export * from '../lib/index.ts';
4
+ export declare const DocumentManagerPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib/index.ts').DocumentManagerPlugin, import('../lib/index.ts').DocumentManagerPluginConfig, unknown, import('@embedpdf/core').Action>>;