@embedpdf/core 1.5.0 → 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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +680 -113
- package/dist/index.js.map +1 -1
- package/dist/lib/base/base-plugin.d.ts +52 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/registry/plugin-registry.d.ts +6 -2
- package/dist/lib/store/actions.d.ts +122 -31
- package/dist/lib/store/initial-state.d.ts +22 -6
- package/dist/lib/store/reducer-helpers.d.ts +11 -0
- package/dist/lib/store/selectors.d.ts +21 -3
- package/dist/lib/types/plugin.d.ts +2 -2
- package/dist/lib/utils/event-control.d.ts +37 -2
- package/dist/lib/utils/eventing.d.ts +1 -1
- package/dist/lib/utils/scoped-eventing.d.ts +71 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +53 -18
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +53 -18
- package/dist/react/index.js.map +1 -1
- package/dist/shared/context.d.ts +6 -1
- package/dist/shared/hooks/index.d.ts +1 -0
- package/dist/shared/hooks/use-core-state.d.ts +4 -2
- package/dist/shared/hooks/use-document-state.d.ts +8 -0
- package/dist/shared-preact/context.d.ts +6 -1
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-core-state.d.ts +4 -2
- package/dist/shared-preact/hooks/use-document-state.d.ts +8 -0
- package/dist/shared-react/context.d.ts +6 -1
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-core-state.d.ts +4 -2
- package/dist/shared-react/hooks/use-document-state.d.ts +8 -0
- package/dist/svelte/hooks/index.d.ts +1 -0
- package/dist/svelte/hooks/use-core-state.svelte.d.ts +5 -4
- package/dist/svelte/hooks/use-document-state.svelte.d.ts +9 -0
- package/dist/svelte/hooks/use-registry.svelte.d.ts +6 -1
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +55 -17
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/auto-mount.vue.d.ts +3 -2
- package/dist/vue/components/embed-pdf.vue.d.ts +13 -2
- package/dist/vue/components/nested-wrapper.vue.d.ts +3 -2
- package/dist/vue/composables/index.d.ts +1 -0
- package/dist/vue/composables/use-core-state.d.ts +8 -1
- package/dist/vue/composables/use-document-state.d.ts +8 -0
- package/dist/vue/context.d.ts +6 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +88 -27
- package/dist/vue/index.js.map +1 -1
- package/package.json +3 -3
package/dist/vue/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { inject,
|
|
2
|
-
import {
|
|
1
|
+
import { inject, computed, toValue, shallowRef, ref, onMounted, watch, onBeforeUnmount, defineComponent, resolveComponent, createBlock, openBlock, resolveDynamicComponent, withCtx, renderSlot, createElementBlock, Fragment, renderList, provide } from "vue";
|
|
2
|
+
import { hasAutoMountElements, PluginRegistry } from "@embedpdf/core";
|
|
3
3
|
const pdfKey = Symbol("pdfKey");
|
|
4
4
|
function useRegistry() {
|
|
5
5
|
const ctx = inject(pdfKey);
|
|
@@ -7,19 +7,18 @@ function useRegistry() {
|
|
|
7
7
|
return ctx;
|
|
8
8
|
}
|
|
9
9
|
function useCoreState() {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
onBeforeUnmount(unsub);
|
|
10
|
+
const { coreState } = useRegistry();
|
|
11
|
+
return coreState;
|
|
12
|
+
}
|
|
13
|
+
function useDocumentState(documentId) {
|
|
14
|
+
const coreState = useCoreState();
|
|
15
|
+
const documentState = computed(() => {
|
|
16
|
+
const core = coreState.value;
|
|
17
|
+
const docId = toValue(documentId);
|
|
18
|
+
if (!core || !docId) return null;
|
|
19
|
+
return core.documents[docId] ?? null;
|
|
21
20
|
});
|
|
22
|
-
return
|
|
21
|
+
return documentState;
|
|
23
22
|
}
|
|
24
23
|
function usePlugin(pluginId) {
|
|
25
24
|
const { registry } = useRegistry();
|
|
@@ -76,11 +75,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
76
75
|
setup(__props) {
|
|
77
76
|
return (_ctx, _cache) => {
|
|
78
77
|
const _component_NestedWrapper = resolveComponent("NestedWrapper", true);
|
|
79
|
-
return openBlock(), createBlock(resolveDynamicComponent(
|
|
78
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.wrappers[0]), null, {
|
|
80
79
|
default: withCtx(() => [
|
|
81
|
-
|
|
80
|
+
__props.wrappers.length > 1 ? (openBlock(), createBlock(_component_NestedWrapper, {
|
|
82
81
|
key: 0,
|
|
83
|
-
wrappers:
|
|
82
|
+
wrappers: __props.wrappers.slice(1)
|
|
84
83
|
}, {
|
|
85
84
|
default: withCtx(() => [
|
|
86
85
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -150,41 +149,102 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
149
|
setup(__props) {
|
|
151
150
|
const props = __props;
|
|
152
151
|
const registry = shallowRef(null);
|
|
152
|
+
const coreState = ref(null);
|
|
153
153
|
const isInit = ref(true);
|
|
154
154
|
const pluginsOk = ref(false);
|
|
155
|
-
|
|
155
|
+
const activeDocumentId = computed(() => {
|
|
156
|
+
var _a;
|
|
157
|
+
return ((_a = coreState.value) == null ? void 0 : _a.activeDocumentId) ?? null;
|
|
158
|
+
});
|
|
159
|
+
const documents = computed(() => {
|
|
160
|
+
var _a;
|
|
161
|
+
return ((_a = coreState.value) == null ? void 0 : _a.documents) ?? {};
|
|
162
|
+
});
|
|
163
|
+
const documentOrder = computed(() => {
|
|
164
|
+
var _a;
|
|
165
|
+
return ((_a = coreState.value) == null ? void 0 : _a.documentOrder) ?? [];
|
|
166
|
+
});
|
|
167
|
+
const activeDocument = computed(() => {
|
|
168
|
+
const docId = activeDocumentId.value;
|
|
169
|
+
const docs = documents.value;
|
|
170
|
+
return docId && docs[docId] ? docs[docId] : null;
|
|
171
|
+
});
|
|
172
|
+
const documentStates = computed(() => {
|
|
173
|
+
const docs = documents.value;
|
|
174
|
+
const order = documentOrder.value;
|
|
175
|
+
return order.map((docId) => docs[docId]).filter((doc) => doc !== null && doc !== void 0);
|
|
176
|
+
});
|
|
177
|
+
provide(pdfKey, {
|
|
178
|
+
registry,
|
|
179
|
+
coreState,
|
|
180
|
+
isInitializing: isInit,
|
|
181
|
+
pluginsReady: pluginsOk,
|
|
182
|
+
activeDocumentId,
|
|
183
|
+
activeDocument,
|
|
184
|
+
documents,
|
|
185
|
+
documentStates
|
|
186
|
+
});
|
|
156
187
|
onMounted(async () => {
|
|
157
188
|
var _a;
|
|
158
189
|
const reg = new PluginRegistry(props.engine, { logger: props.logger });
|
|
159
190
|
reg.registerPluginBatch(props.plugins);
|
|
160
191
|
await reg.initialize();
|
|
192
|
+
if (reg.isDestroyed()) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const store = reg.getStore();
|
|
196
|
+
coreState.value = store.getState().core;
|
|
197
|
+
const unsubscribe = store.subscribe((action, newState, oldState) => {
|
|
198
|
+
if (store.isCoreAction(action) && newState.core !== oldState.core) {
|
|
199
|
+
coreState.value = newState.core;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
161
202
|
await ((_a = props.onInitialized) == null ? void 0 : _a.call(props, reg));
|
|
203
|
+
if (reg.isDestroyed()) {
|
|
204
|
+
unsubscribe();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
162
207
|
registry.value = reg;
|
|
163
208
|
isInit.value = false;
|
|
164
|
-
reg.pluginsReady().then(() =>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
209
|
+
reg.pluginsReady().then(() => {
|
|
210
|
+
if (!reg.isDestroyed()) {
|
|
211
|
+
pluginsOk.value = true;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
onBeforeUnmount(() => {
|
|
215
|
+
var _a2;
|
|
216
|
+
unsubscribe();
|
|
217
|
+
(_a2 = registry.value) == null ? void 0 : _a2.destroy();
|
|
218
|
+
});
|
|
169
219
|
});
|
|
170
220
|
return (_ctx, _cache) => {
|
|
171
|
-
return pluginsOk.value &&
|
|
221
|
+
return pluginsOk.value && __props.autoMountDomElements ? (openBlock(), createBlock(_sfc_main$1, {
|
|
172
222
|
key: 0,
|
|
173
|
-
plugins:
|
|
223
|
+
plugins: __props.plugins
|
|
174
224
|
}, {
|
|
175
225
|
default: withCtx(() => [
|
|
176
226
|
renderSlot(_ctx.$slots, "default", {
|
|
177
227
|
registry: registry.value,
|
|
228
|
+
coreState: coreState.value,
|
|
178
229
|
isInitializing: isInit.value,
|
|
179
|
-
pluginsReady: pluginsOk.value
|
|
230
|
+
pluginsReady: pluginsOk.value,
|
|
231
|
+
activeDocumentId: activeDocumentId.value,
|
|
232
|
+
activeDocument: activeDocument.value,
|
|
233
|
+
documents: documents.value,
|
|
234
|
+
documentStates: documentStates.value
|
|
180
235
|
})
|
|
181
236
|
]),
|
|
182
237
|
_: 3
|
|
183
238
|
}, 8, ["plugins"])) : renderSlot(_ctx.$slots, "default", {
|
|
184
239
|
key: 1,
|
|
185
240
|
registry: registry.value,
|
|
241
|
+
coreState: coreState.value,
|
|
186
242
|
isInitializing: isInit.value,
|
|
187
|
-
pluginsReady: pluginsOk.value
|
|
243
|
+
pluginsReady: pluginsOk.value,
|
|
244
|
+
activeDocumentId: activeDocumentId.value,
|
|
245
|
+
activeDocument: activeDocument.value,
|
|
246
|
+
documents: documents.value,
|
|
247
|
+
documentStates: documentStates.value
|
|
188
248
|
});
|
|
189
249
|
};
|
|
190
250
|
}
|
|
@@ -193,6 +253,7 @@ export {
|
|
|
193
253
|
_sfc_main as EmbedPDF,
|
|
194
254
|
useCapability,
|
|
195
255
|
useCoreState,
|
|
256
|
+
useDocumentState,
|
|
196
257
|
usePlugin,
|
|
197
258
|
useRegistry,
|
|
198
259
|
useStoreState
|
package/dist/vue/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/vue/context.ts","../../src/vue/composables/use-registry.ts","../../src/vue/composables/use-core-state.ts","../../src/vue/composables/use-plugin.ts","../../src/vue/composables/use-capability.ts","../../src/vue/composables/use-store-state.ts","../../src/vue/components/nested-wrapper.vue","../../src/vue/components/auto-mount.vue","../../src/vue/components/embed-pdf.vue"],"sourcesContent":["import { InjectionKey, Ref, ShallowRef } from 'vue';\nimport type { PluginRegistry } from '@embedpdf/core';\n\nexport interface PDFContextState {\n registry: ShallowRef<PluginRegistry | null>;\n isInitializing: Ref<boolean>;\n pluginsReady: Ref<boolean>;\n}\n\nexport const pdfKey: InjectionKey<PDFContextState> = Symbol('pdfKey');\n","import { inject } from 'vue';\nimport { pdfKey } from '../context';\n\nexport function useRegistry() {\n const ctx = inject(pdfKey);\n if (!ctx) throw new Error('useRegistry must be used inside <EmbedPDF>');\n return ctx;\n}\n","import { ref, onMounted, onBeforeUnmount } from 'vue';\nimport { arePropsEqual, type CoreState } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\nexport function useCoreState() {\n const { registry } = useRegistry();\n const core = ref<CoreState>();\n\n onMounted(() => {\n const store = registry.value!.getStore();\n core.value = store.getState().core;\n\n const unsub = store.subscribe((action, newSt, oldSt) => {\n if (store.isCoreAction(action) && !arePropsEqual(newSt.core, oldSt.core)) {\n core.value = newSt.core;\n }\n });\n onBeforeUnmount(unsub);\n });\n\n return core;\n}\n","import { shallowRef, ref, onMounted, watch, type ShallowRef, type Ref } from 'vue';\nimport type { BasePlugin } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\nexport interface PluginState<T extends BasePlugin> {\n plugin: ShallowRef<T | null>;\n isLoading: Ref<boolean>;\n ready: Ref<Promise<void>>;\n}\n\nexport function usePlugin<T extends BasePlugin>(pluginId: T['id']): PluginState<T> {\n const { registry } = useRegistry();\n\n const plugin = shallowRef(null) as ShallowRef<T | null>;\n\n const isLoading = ref(true);\n const ready = ref<Promise<void>>(new Promise(() => {}));\n\n const load = () => {\n if (!registry.value) return;\n\n const p = registry.value.getPlugin<T>(pluginId);\n if (!p) throw new Error(`Plugin ${pluginId} not found`);\n\n plugin.value = p;\n isLoading.value = false;\n ready.value = p.ready?.() ?? Promise.resolve();\n };\n\n onMounted(load);\n watch(registry, load);\n\n return { plugin, isLoading, ready };\n}\n","import type { BasePlugin } from '@embedpdf/core';\nimport { computed, type Ref } from 'vue';\nimport { usePlugin } from './use-plugin';\n\nexport interface CapabilityState<C> {\n provides: Ref<C | null>;\n isLoading: Ref<boolean>;\n ready: Ref<Promise<void>>;\n}\n\n/**\n * Access the public capability exposed by a plugin.\n *\n * @example\n * const { provides: zoom } = useCapability<ZoomPlugin>(ZoomPlugin.id);\n * zoom.value?.zoomIn();\n */\nexport function useCapability<T extends BasePlugin>(\n pluginId: T['id'],\n): CapabilityState<ReturnType<NonNullable<T['provides']>>> {\n const { plugin, isLoading, ready } = usePlugin<T>(pluginId);\n\n const provides = computed(() => {\n if (!plugin.value) return null;\n if (!plugin.value.provides) {\n throw new Error(`Plugin ${pluginId} does not implement provides()`);\n }\n return plugin.value.provides() as ReturnType<NonNullable<T['provides']>>;\n });\n\n return { provides, isLoading, ready };\n}\n","import { ref, onMounted, onBeforeUnmount, watch } from 'vue';\nimport type { CoreState, StoreState } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\n/**\n * Reactive getter for the *entire* global store.\n * Re‑emits whenever any slice changes.\n *\n * @example\n * const state = useStoreState(); // Ref<StoreState<CoreState>>\n * console.log(state.value.core.scale);\n */\nexport function useStoreState<T = CoreState>() {\n const { registry } = useRegistry();\n const state = ref<StoreState<T>>();\n\n function attach() {\n if (!registry.value) return () => {};\n\n // initial snapshot\n state.value = registry.value.getStore().getState() as StoreState<T>;\n\n // live updates\n return registry.value\n .getStore()\n .subscribe((_action, newState) => (state.value = newState as StoreState<T>));\n }\n\n /* attach now and re‑attach if registry instance ever changes */\n let unsubscribe = attach();\n watch(registry, () => {\n unsubscribe?.();\n unsubscribe = attach();\n });\n\n onBeforeUnmount(() => unsubscribe?.());\n\n return state;\n}\n","<script setup lang=\"ts\">\ndefineProps<{\n wrappers: any[];\n}>();\n</script>\n\n<template>\n <component :is=\"wrappers[0]\">\n <NestedWrapper v-if=\"wrappers.length > 1\" :wrappers=\"wrappers.slice(1)\">\n <slot />\n </NestedWrapper>\n <slot v-else />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { hasAutoMountElements, type PluginBatchRegistration, type IPlugin } from '@embedpdf/core';\nimport NestedWrapper from './nested-wrapper.vue';\n\nconst props = defineProps<{\n plugins: PluginBatchRegistration<IPlugin<any>, any>[];\n}>();\n\nconst elements = computed(() => {\n const utilities: any[] = [];\n const wrappers: any[] = [];\n\n for (const reg of props.plugins) {\n const pkg = reg.package;\n if (hasAutoMountElements(pkg)) {\n const elements = pkg.autoMountElements() || [];\n\n for (const element of elements) {\n if (element.type === 'utility') {\n utilities.push(element.component);\n } else if (element.type === 'wrapper') {\n wrappers.push(element.component);\n }\n }\n }\n }\n\n return { utilities, wrappers };\n});\n</script>\n\n<template>\n <NestedWrapper v-if=\"elements.wrappers.length > 0\" :wrappers=\"elements.wrappers\">\n <slot />\n </NestedWrapper>\n <slot v-else />\n\n <component\n v-for=\"(utility, index) in elements.utilities\"\n :key=\"`utility-${index}`\"\n :is=\"utility\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { ref, provide, onMounted, onBeforeUnmount, shallowRef } from 'vue';\nimport { PluginRegistry, PluginBatchRegistrations } from '@embedpdf/core';\nimport { Logger, PdfEngine } from '@embedpdf/models';\nimport { pdfKey, PDFContextState } from '../context';\nimport AutoMount from './auto-mount.vue';\n\nexport type { PluginBatchRegistrations };\n\nconst props = withDefaults(\n defineProps<{\n engine: PdfEngine;\n logger?: Logger;\n plugins: PluginBatchRegistrations;\n onInitialized?: (registry: PluginRegistry) => Promise<void>;\n autoMountDomElements?: boolean;\n }>(),\n {\n autoMountDomElements: true,\n },\n);\n\n/* reactive state */\nconst registry = shallowRef<PluginRegistry | null>(null);\nconst isInit = ref(true);\nconst pluginsOk = ref(false);\n\n/* expose to children */\nprovide<PDFContextState>(pdfKey, { registry, isInitializing: isInit, pluginsReady: pluginsOk });\n\nonMounted(async () => {\n const reg = new PluginRegistry(props.engine, { logger: props.logger });\n reg.registerPluginBatch(props.plugins);\n await reg.initialize();\n await props.onInitialized?.(reg);\n\n registry.value = reg;\n isInit.value = false;\n\n reg.pluginsReady().then(() => (pluginsOk.value = true));\n});\n\nonBeforeUnmount(() => registry.value?.destroy());\n</script>\n\n<template>\n <AutoMount v-if=\"pluginsOk && autoMountDomElements\" :plugins=\"plugins\">\n <!-- scoped slot keeps API parity with React version -->\n <slot :registry=\"registry\" :isInitializing=\"isInit\" :pluginsReady=\"pluginsOk\" />\n </AutoMount>\n\n <!-- No auto-mount or not ready yet -->\n <slot v-else :registry=\"registry\" :isInitializing=\"isInit\" :pluginsReady=\"pluginsOk\" />\n</template>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","wrappers","_renderSlot","elements","NestedWrapper","_createElementBlock","_Fragment","autoMountDomElements","AutoMount","plugins"],"mappings":";;AASa,MAAA,SAAwC,OAAO,QAAQ;ACN7D,SAAS,cAAc;AACtB,QAAA,MAAM,OAAO,MAAM;AACzB,MAAI,CAAC,IAAW,OAAA,IAAI,MAAM,4CAA4C;AAC/D,SAAA;AACT;ACHO,SAAS,eAAe;AACvB,QAAA,EAAE,SAAS,IAAI,YAAY;AACjC,QAAM,OAAO,IAAe;AAE5B,YAAU,MAAM;AACR,UAAA,QAAQ,SAAS,MAAO,SAAS;A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AQ;AAAA,QAAG,gBAAgB,OAAM;AAAA,QAAG,cAAc,UAAS;AAAA,MAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/vue/context.ts","../../src/vue/composables/use-registry.ts","../../src/vue/composables/use-core-state.ts","../../src/vue/composables/use-document-state.ts","../../src/vue/composables/use-plugin.ts","../../src/vue/composables/use-capability.ts","../../src/vue/composables/use-store-state.ts","../../src/vue/components/nested-wrapper.vue","../../src/vue/components/auto-mount.vue","../../src/vue/components/embed-pdf.vue"],"sourcesContent":["import { InjectionKey, Ref, ShallowRef } from 'vue';\nimport type { PluginRegistry, CoreState, DocumentState } from '@embedpdf/core';\n\nexport interface PDFContextState {\n registry: ShallowRef<PluginRegistry | null>;\n coreState: Ref<CoreState | null>;\n isInitializing: Ref<boolean>;\n pluginsReady: Ref<boolean>;\n\n // Convenience accessors (always safe to use)\n activeDocumentId: Ref<string | null>;\n activeDocument: Ref<DocumentState | null>;\n documents: Ref<Record<string, DocumentState>>;\n documentStates: Ref<DocumentState[]>;\n}\n\nexport const pdfKey: InjectionKey<PDFContextState> = Symbol('pdfKey');\n","import { inject } from 'vue';\nimport { pdfKey } from '../context';\n\nexport function useRegistry() {\n const ctx = inject(pdfKey);\n if (!ctx) throw new Error('useRegistry must be used inside <EmbedPDF>');\n return ctx;\n}\n","import { Ref } from 'vue';\nimport { type CoreState } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\n/**\n * Hook that provides access to the current core state.\n *\n * Note: This reads from the context which is already subscribed to core state changes\n * in the EmbedPDF component, so there's no additional subscription overhead.\n */\nexport function useCoreState(): Ref<CoreState | null> {\n const { coreState } = useRegistry();\n return coreState;\n}\n","import { computed, toValue, type MaybeRefOrGetter } from 'vue';\nimport { useCoreState } from './use-core-state';\n\n/**\n * Hook that provides reactive access to a specific document's state from the core store.\n *\n * @param documentId The ID of the document to retrieve (can be ref, computed, getter, or plain value).\n * @returns A computed ref containing the DocumentState object or null if not found.\n */\nexport function useDocumentState(documentId: MaybeRefOrGetter<string | null>) {\n const coreState = useCoreState();\n\n const documentState = computed(() => {\n const core = coreState.value;\n const docId = toValue(documentId);\n\n if (!core || !docId) return null;\n return core.documents[docId] ?? null;\n });\n\n return documentState;\n}\n","import { shallowRef, ref, onMounted, watch, type ShallowRef, type Ref } from 'vue';\nimport type { BasePlugin } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\nexport interface PluginState<T extends BasePlugin> {\n plugin: ShallowRef<T | null>;\n isLoading: Ref<boolean>;\n ready: Ref<Promise<void>>;\n}\n\nexport function usePlugin<T extends BasePlugin>(pluginId: T['id']): PluginState<T> {\n const { registry } = useRegistry();\n\n const plugin = shallowRef(null) as ShallowRef<T | null>;\n\n const isLoading = ref(true);\n const ready = ref<Promise<void>>(new Promise(() => {}));\n\n const load = () => {\n if (!registry.value) return;\n\n const p = registry.value.getPlugin<T>(pluginId);\n if (!p) throw new Error(`Plugin ${pluginId} not found`);\n\n plugin.value = p;\n isLoading.value = false;\n ready.value = p.ready?.() ?? Promise.resolve();\n };\n\n onMounted(load);\n watch(registry, load);\n\n return { plugin, isLoading, ready };\n}\n","import type { BasePlugin } from '@embedpdf/core';\nimport { computed, type Ref } from 'vue';\nimport { usePlugin } from './use-plugin';\n\nexport interface CapabilityState<C> {\n provides: Ref<C | null>;\n isLoading: Ref<boolean>;\n ready: Ref<Promise<void>>;\n}\n\n/**\n * Access the public capability exposed by a plugin.\n *\n * @example\n * const { provides: zoom } = useCapability<ZoomPlugin>(ZoomPlugin.id);\n * zoom.value?.zoomIn();\n */\nexport function useCapability<T extends BasePlugin>(\n pluginId: T['id'],\n): CapabilityState<ReturnType<NonNullable<T['provides']>>> {\n const { plugin, isLoading, ready } = usePlugin<T>(pluginId);\n\n const provides = computed(() => {\n if (!plugin.value) return null;\n if (!plugin.value.provides) {\n throw new Error(`Plugin ${pluginId} does not implement provides()`);\n }\n return plugin.value.provides() as ReturnType<NonNullable<T['provides']>>;\n });\n\n return { provides, isLoading, ready };\n}\n","import { ref, onMounted, onBeforeUnmount, watch } from 'vue';\nimport type { CoreState, StoreState } from '@embedpdf/core';\nimport { useRegistry } from './use-registry';\n\n/**\n * Reactive getter for the *entire* global store.\n * Re‑emits whenever any slice changes.\n *\n * @example\n * const state = useStoreState(); // Ref<StoreState<CoreState>>\n * console.log(state.value.core.scale);\n */\nexport function useStoreState<T = CoreState>() {\n const { registry } = useRegistry();\n const state = ref<StoreState<T>>();\n\n function attach() {\n if (!registry.value) return () => {};\n\n // initial snapshot\n state.value = registry.value.getStore().getState() as StoreState<T>;\n\n // live updates\n return registry.value\n .getStore()\n .subscribe((_action, newState) => (state.value = newState as StoreState<T>));\n }\n\n /* attach now and re‑attach if registry instance ever changes */\n let unsubscribe = attach();\n watch(registry, () => {\n unsubscribe?.();\n unsubscribe = attach();\n });\n\n onBeforeUnmount(() => unsubscribe?.());\n\n return state;\n}\n","<script setup lang=\"ts\">\ndefineProps<{\n wrappers: any[];\n}>();\n</script>\n\n<template>\n <component :is=\"wrappers[0]\">\n <NestedWrapper v-if=\"wrappers.length > 1\" :wrappers=\"wrappers.slice(1)\">\n <slot />\n </NestedWrapper>\n <slot v-else />\n </component>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { hasAutoMountElements, type PluginBatchRegistration, type IPlugin } from '@embedpdf/core';\nimport NestedWrapper from './nested-wrapper.vue';\n\nconst props = defineProps<{\n plugins: PluginBatchRegistration<IPlugin<any>, any>[];\n}>();\n\nconst elements = computed(() => {\n const utilities: any[] = [];\n const wrappers: any[] = [];\n\n for (const reg of props.plugins) {\n const pkg = reg.package;\n if (hasAutoMountElements(pkg)) {\n const elements = pkg.autoMountElements() || [];\n\n for (const element of elements) {\n if (element.type === 'utility') {\n utilities.push(element.component);\n } else if (element.type === 'wrapper') {\n wrappers.push(element.component);\n }\n }\n }\n }\n\n return { utilities, wrappers };\n});\n</script>\n\n<template>\n <NestedWrapper v-if=\"elements.wrappers.length > 0\" :wrappers=\"elements.wrappers\">\n <slot />\n </NestedWrapper>\n <slot v-else />\n\n <component\n v-for=\"(utility, index) in elements.utilities\"\n :key=\"`utility-${index}`\"\n :is=\"utility\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { ref, provide, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue';\nimport { PluginRegistry, PluginBatchRegistrations, CoreState, DocumentState } from '@embedpdf/core';\nimport { Logger, PdfEngine } from '@embedpdf/models';\nimport { pdfKey, PDFContextState } from '../context';\nimport AutoMount from './auto-mount.vue';\n\nexport type { PluginBatchRegistrations };\n\nconst props = withDefaults(\n defineProps<{\n engine: PdfEngine;\n logger?: Logger;\n plugins: PluginBatchRegistrations;\n onInitialized?: (registry: PluginRegistry) => Promise<void>;\n autoMountDomElements?: boolean;\n }>(),\n {\n autoMountDomElements: true,\n },\n);\n\n/* reactive state */\nconst registry = shallowRef<PluginRegistry | null>(null);\nconst coreState = ref<CoreState | null>(null);\nconst isInit = ref(true);\nconst pluginsOk = ref(false);\n\n// Compute convenience accessors\nconst activeDocumentId = computed(() => coreState.value?.activeDocumentId ?? null);\nconst documents = computed(() => coreState.value?.documents ?? {});\nconst documentOrder = computed(() => coreState.value?.documentOrder ?? []);\n\nconst activeDocument = computed(() => {\n const docId = activeDocumentId.value;\n const docs = documents.value;\n return docId && docs[docId] ? docs[docId] : null;\n});\n\nconst documentStates = computed(() => {\n const docs = documents.value;\n const order = documentOrder.value;\n return order\n .map((docId) => docs[docId])\n .filter((doc): doc is DocumentState => doc !== null && doc !== undefined);\n});\n\n/* expose to children */\nprovide<PDFContextState>(pdfKey, {\n registry,\n coreState,\n isInitializing: isInit,\n pluginsReady: pluginsOk,\n activeDocumentId,\n activeDocument,\n documents,\n documentStates,\n});\n\nonMounted(async () => {\n const reg = new PluginRegistry(props.engine, { logger: props.logger });\n reg.registerPluginBatch(props.plugins);\n await reg.initialize();\n\n if (reg.isDestroyed()) {\n return;\n }\n\n const store = reg.getStore();\n coreState.value = store.getState().core;\n\n const unsubscribe = store.subscribe((action, newState, oldState) => {\n // Only update if it's a core action and the core state changed\n if (store.isCoreAction(action) && newState.core !== oldState.core) {\n coreState.value = newState.core;\n }\n });\n\n await props.onInitialized?.(reg);\n\n if (reg.isDestroyed()) {\n unsubscribe();\n return;\n }\n\n registry.value = reg;\n isInit.value = false;\n\n reg.pluginsReady().then(() => {\n if (!reg.isDestroyed()) {\n pluginsOk.value = true;\n }\n });\n\n onBeforeUnmount(() => {\n unsubscribe();\n registry.value?.destroy();\n });\n});\n</script>\n\n<template>\n <AutoMount v-if=\"pluginsOk && autoMountDomElements\" :plugins=\"plugins\">\n <!-- scoped slot keeps API parity with React version -->\n <slot\n :registry=\"registry\"\n :coreState=\"coreState\"\n :isInitializing=\"isInit\"\n :pluginsReady=\"pluginsOk\"\n :activeDocumentId=\"activeDocumentId\"\n :activeDocument=\"activeDocument\"\n :documents=\"documents\"\n :documentStates=\"documentStates\"\n />\n </AutoMount>\n\n <!-- No auto-mount or not ready yet -->\n <slot\n v-else\n :registry=\"registry\"\n :coreState=\"coreState\"\n :isInitializing=\"isInit\"\n :pluginsReady=\"pluginsOk\"\n :activeDocumentId=\"activeDocumentId\"\n :activeDocument=\"activeDocument\"\n :documents=\"documents\"\n :documentStates=\"documentStates\"\n />\n</template>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_renderSlot","elements","NestedWrapper","_createElementBlock","_Fragment","_a","AutoMount"],"mappings":";;AAgBO,MAAM,SAAwC,OAAO,QAAQ;ACb7D,SAAS,cAAc;AAC5B,QAAM,MAAM,OAAO,MAAM;AACzB,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;ACGO,SAAS,eAAsC;AACpD,QAAM,EAAE,UAAA,IAAc,YAAA;AACtB,SAAO;AACT;ACJO,SAAS,iBAAiB,YAA6C;AAC5E,QAAM,YAAY,aAAA;AAElB,QAAM,gBAAgB,SAAS,MAAM;AACnC,UAAM,OAAO,UAAU;AACvB,UAAM,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,UAAA;AAAA,QACX,gBAAgB,eAAA;AAAA,MAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@embedpdf/build": "1.1.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@embedpdf/engines": "
|
|
44
|
-
"@embedpdf/models": "
|
|
43
|
+
"@embedpdf/engines": "2.0.0-next.0",
|
|
44
|
+
"@embedpdf/models": "2.0.0-next.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"preact": "^10.26.4",
|