@embedpdf/vue 0.0.0-stage → 3.0.0-next.16
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 -0
- package/README.md +258 -2
- package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs +124 -0
- package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs.map +1 -0
- package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js +125 -0
- package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js.map +1 -0
- package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs +20 -0
- package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs.map +1 -0
- package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js +21 -0
- package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js.map +1 -0
- package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js +192 -0
- package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js.map +1 -0
- package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs +191 -0
- package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs.map +1 -0
- package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs +682 -0
- package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs.map +1 -0
- package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js +683 -0
- package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js.map +1 -0
- package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs +174 -0
- package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs.map +1 -0
- package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js +175 -0
- package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js.map +1 -0
- package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js +33 -0
- package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js.map +1 -0
- package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs +32 -0
- package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs.map +1 -0
- package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs +151 -0
- package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs.map +1 -0
- package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js +152 -0
- package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js.map +1 -0
- package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs +480 -0
- package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs.map +1 -0
- package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js +481 -0
- package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js.map +1 -0
- package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js +118 -0
- package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js.map +1 -0
- package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs +117 -0
- package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs.map +1 -0
- package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js +302 -0
- package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js.map +1 -0
- package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs +301 -0
- package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs.map +1 -0
- package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs +38 -0
- package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs.map +1 -0
- package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js +39 -0
- package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js.map +1 -0
- package/dist/actions.cjs +42 -0
- package/dist/actions.cjs.map +1 -0
- package/dist/actions.d.cts +41 -0
- package/dist/actions.d.ts +41 -0
- package/dist/actions.js +37 -0
- package/dist/actions.js.map +1 -0
- package/dist/anchored/Anchored.vue.d.cts +40 -0
- package/dist/anchored/Anchored.vue.d.ts +40 -0
- package/dist/anchored/AnchoredScope.vue.d.cts +17 -0
- package/dist/anchored/AnchoredScope.vue.d.ts +17 -0
- package/dist/anchored/PlacedAnchored.vue.d.cts +19 -0
- package/dist/anchored/PlacedAnchored.vue.d.ts +19 -0
- package/dist/anchored/projector.d.cts +32 -0
- package/dist/anchored/projector.d.ts +32 -0
- package/dist/anchored.cjs +13 -0
- package/dist/anchored.cjs.map +1 -0
- package/dist/anchored.d.cts +15 -0
- package/dist/anchored.d.ts +15 -0
- package/dist/anchored.js +13 -0
- package/dist/anchored.js.map +1 -0
- package/dist/annotation/AnnotationChrome.vue.d.cts +20 -0
- package/dist/annotation/AnnotationChrome.vue.d.ts +20 -0
- package/dist/annotation/AnnotationDraftMenu.vue.d.cts +26 -0
- package/dist/annotation/AnnotationDraftMenu.vue.d.ts +26 -0
- package/dist/annotation/AnnotationFrame.vue.d.cts +25 -0
- package/dist/annotation/AnnotationFrame.vue.d.ts +25 -0
- package/dist/annotation/AnnotationLayer.vue.d.cts +23 -0
- package/dist/annotation/AnnotationLayer.vue.d.ts +23 -0
- package/dist/annotation/AnnotationLook.vue.d.cts +21 -0
- package/dist/annotation/AnnotationLook.vue.d.ts +21 -0
- package/dist/annotation/AnnotationMenu.vue.d.cts +23 -0
- package/dist/annotation/AnnotationMenu.vue.d.ts +23 -0
- package/dist/annotation/AnnotationRotationBadge.vue.d.cts +26 -0
- package/dist/annotation/AnnotationRotationBadge.vue.d.ts +26 -0
- package/dist/annotation/AnnotationScene.vue.d.cts +7 -0
- package/dist/annotation/AnnotationScene.vue.d.ts +7 -0
- package/dist/annotation/FreeTextBox.vue.d.cts +9 -0
- package/dist/annotation/FreeTextBox.vue.d.ts +9 -0
- package/dist/annotation/NativeDrawing.vue.d.cts +10 -0
- package/dist/annotation/NativeDrawing.vue.d.ts +10 -0
- package/dist/annotation/StampGhost.vue.d.cts +7 -0
- package/dist/annotation/StampGhost.vue.d.ts +7 -0
- package/dist/annotation/composables.d.cts +76 -0
- package/dist/annotation/composables.d.ts +76 -0
- package/dist/annotation/state.d.cts +19 -0
- package/dist/annotation/state.d.ts +19 -0
- package/dist/annotation/text-box.d.cts +28 -0
- package/dist/annotation/text-box.d.ts +28 -0
- package/dist/annotation/types.d.cts +154 -0
- package/dist/annotation/types.d.ts +154 -0
- package/dist/annotation.cjs +29 -0
- package/dist/annotation.cjs.map +1 -0
- package/dist/annotation.d.cts +35 -0
- package/dist/annotation.d.ts +35 -0
- package/dist/annotation.js +23 -0
- package/dist/annotation.js.map +1 -0
- package/dist/attachment.cjs +22 -0
- package/dist/attachment.cjs.map +1 -0
- package/dist/attachment.d.cts +34 -0
- package/dist/attachment.d.ts +34 -0
- package/dist/attachment.js +17 -0
- package/dist/attachment.js.map +1 -0
- package/dist/capabilities-C7YzgPCX.js +164 -0
- package/dist/capabilities-C7YzgPCX.js.map +1 -0
- package/dist/capabilities-DVNJmgy7.cjs +163 -0
- package/dist/capabilities-DVNJmgy7.cjs.map +1 -0
- package/dist/commands.cjs +81 -0
- package/dist/commands.cjs.map +1 -0
- package/dist/commands.d.cts +61 -0
- package/dist/commands.d.ts +61 -0
- package/dist/commands.js +76 -0
- package/dist/commands.js.map +1 -0
- package/dist/composables-BGBsNDf9.cjs +25 -0
- package/dist/composables-BGBsNDf9.cjs.map +1 -0
- package/dist/composables-Bi6QvJpj.cjs +978 -0
- package/dist/composables-Bi6QvJpj.cjs.map +1 -0
- package/dist/composables-DK3lwh38.js +979 -0
- package/dist/composables-DK3lwh38.js.map +1 -0
- package/dist/composables-DwsZdg06.js +26 -0
- package/dist/composables-DwsZdg06.js.map +1 -0
- package/dist/dev-CtMlvxjZ.js +17 -0
- package/dist/dev-CtMlvxjZ.js.map +1 -0
- package/dist/dev-eeIS2B4c.cjs +16 -0
- package/dist/dev-eeIS2B4c.cjs.map +1 -0
- package/dist/dev.d.cts +11 -0
- package/dist/dev.d.ts +11 -0
- package/dist/documents-DUu5H4yH.js +34 -0
- package/dist/documents-DUu5H4yH.js.map +1 -0
- package/dist/documents-TQ1fMdWI.cjs +33 -0
- package/dist/documents-TQ1fMdWI.cjs.map +1 -0
- package/dist/form/ButtonControl.vue.d.cts +11 -0
- package/dist/form/ButtonControl.vue.d.ts +11 -0
- package/dist/form/ComboControl.vue.d.cts +11 -0
- package/dist/form/ComboControl.vue.d.ts +11 -0
- package/dist/form/FieldPictures.vue.d.cts +3 -0
- package/dist/form/FieldPictures.vue.d.ts +3 -0
- package/dist/form/FormFocusRing.vue.d.cts +8 -0
- package/dist/form/FormFocusRing.vue.d.ts +8 -0
- package/dist/form/FormLayer.vue.d.cts +3 -0
- package/dist/form/FormLayer.vue.d.ts +3 -0
- package/dist/form/ListControl.vue.d.cts +11 -0
- package/dist/form/ListControl.vue.d.ts +11 -0
- package/dist/form/NativeListBox.vue.d.cts +27 -0
- package/dist/form/NativeListBox.vue.d.ts +27 -0
- package/dist/form/SignatureControl.vue.d.cts +11 -0
- package/dist/form/SignatureControl.vue.d.ts +11 -0
- package/dist/form/TextControl.vue.d.cts +11 -0
- package/dist/form/TextControl.vue.d.ts +11 -0
- package/dist/form/ToggleControl.vue.d.cts +11 -0
- package/dist/form/ToggleControl.vue.d.ts +11 -0
- package/dist/form/composables.d.cts +52 -0
- package/dist/form/composables.d.ts +52 -0
- package/dist/form/widget-box.d.cts +34 -0
- package/dist/form/widget-box.d.ts +34 -0
- package/dist/form.cjs +17 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.d.cts +12 -0
- package/dist/form.d.ts +12 -0
- package/dist/form.js +11 -0
- package/dist/form.js.map +1 -0
- package/dist/history.cjs +22 -0
- package/dist/history.cjs.map +1 -0
- package/dist/history.d.cts +31 -0
- package/dist/history.d.ts +31 -0
- package/dist/history.js +17 -0
- package/dist/history.js.map +1 -0
- package/dist/i18n.cjs +29 -0
- package/dist/i18n.cjs.map +1 -0
- package/dist/i18n.d.cts +36 -0
- package/dist/i18n.d.ts +36 -0
- package/dist/i18n.js +24 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.cjs +414 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +234 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/PagePointerSource.vue.d.cts +3 -0
- package/dist/interaction/PagePointerSource.vue.d.ts +3 -0
- package/dist/interaction.cjs +63 -0
- package/dist/interaction.cjs.map +1 -0
- package/dist/interaction.d.cts +40 -0
- package/dist/interaction.d.ts +40 -0
- package/dist/interaction.js +47 -0
- package/dist/interaction.js.map +1 -0
- package/dist/link/LinkAnchor.vue.d.cts +9 -0
- package/dist/link/LinkAnchor.vue.d.ts +9 -0
- package/dist/link/LinkLayer.vue.d.cts +22 -0
- package/dist/link/LinkLayer.vue.d.ts +22 -0
- package/dist/link/composables.d.cts +29 -0
- package/dist/link/composables.d.ts +29 -0
- package/dist/link.cjs +14 -0
- package/dist/link.cjs.map +1 -0
- package/dist/link.d.cts +11 -0
- package/dist/link.d.ts +11 -0
- package/dist/link.js +8 -0
- package/dist/link.js.map +1 -0
- package/dist/measurement.cjs +43 -0
- package/dist/measurement.cjs.map +1 -0
- package/dist/measurement.d.cts +51 -0
- package/dist/measurement.d.ts +51 -0
- package/dist/measurement.js +38 -0
- package/dist/measurement.js.map +1 -0
- package/dist/metadata.cjs +22 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +31 -0
- package/dist/metadata.d.ts +31 -0
- package/dist/metadata.js +17 -0
- package/dist/metadata.js.map +1 -0
- package/dist/outline.cjs +22 -0
- package/dist/outline.cjs.map +1 -0
- package/dist/outline.d.cts +36 -0
- package/dist/outline.d.ts +36 -0
- package/dist/outline.js +17 -0
- package/dist/outline.js.map +1 -0
- package/dist/page-D9XIuLSj.js +16 -0
- package/dist/page-D9XIuLSj.js.map +1 -0
- package/dist/page-Doy4_Sdz.cjs +15 -0
- package/dist/page-Doy4_Sdz.cjs.map +1 -0
- package/dist/page-edit.cjs +18 -0
- package/dist/page-edit.cjs.map +1 -0
- package/dist/page-edit.d.cts +28 -0
- package/dist/page-edit.d.ts +28 -0
- package/dist/page-edit.js +13 -0
- package/dist/page-edit.js.map +1 -0
- package/dist/page-layers-c-CJYAUO.cjs +30 -0
- package/dist/page-layers-c-CJYAUO.cjs.map +1 -0
- package/dist/page-layers-rlh4-1qr.js +31 -0
- package/dist/page-layers-rlh4-1qr.js.map +1 -0
- package/dist/page-layers.d.cts +21 -0
- package/dist/page-layers.d.ts +21 -0
- package/dist/page-view/PageView.vue.d.cts +42 -0
- package/dist/page-view/PageView.vue.d.ts +42 -0
- package/dist/page-view.cjs +5 -0
- package/dist/page-view.cjs.map +1 -0
- package/dist/page-view.d.cts +10 -0
- package/dist/page-view.d.ts +10 -0
- package/dist/page-view.js +5 -0
- package/dist/page-view.js.map +1 -0
- package/dist/projector-CDZn1kh1.js +32 -0
- package/dist/projector-CDZn1kh1.js.map +1 -0
- package/dist/projector-Cf7879sx.cjs +31 -0
- package/dist/projector-Cf7879sx.cjs.map +1 -0
- package/dist/redaction.cjs +34 -0
- package/dist/redaction.cjs.map +1 -0
- package/dist/redaction.d.cts +44 -0
- package/dist/redaction.d.ts +44 -0
- package/dist/redaction.js +29 -0
- package/dist/redaction.js.map +1 -0
- package/dist/render/RenderLayer.vue.d.cts +23 -0
- package/dist/render/RenderLayer.vue.d.ts +23 -0
- package/dist/render/TileImage.vue.d.cts +13 -0
- package/dist/render/TileImage.vue.d.ts +13 -0
- package/dist/render/TilePlane.vue.d.cts +7 -0
- package/dist/render/TilePlane.vue.d.ts +7 -0
- package/dist/render.cjs +262 -0
- package/dist/render.cjs.map +1 -0
- package/dist/render.d.cts +16 -0
- package/dist/render.d.ts +16 -0
- package/dist/render.js +257 -0
- package/dist/render.js.map +1 -0
- package/dist/runtime/DocumentGate.vue.d.cts +24 -0
- package/dist/runtime/DocumentGate.vue.d.ts +24 -0
- package/dist/runtime/DocumentScope.vue.d.cts +16 -0
- package/dist/runtime/DocumentScope.vue.d.ts +16 -0
- package/dist/runtime/KernelProvider.vue.d.cts +17 -0
- package/dist/runtime/KernelProvider.vue.d.ts +17 -0
- package/dist/runtime/SvgShapes.vue.d.cts +7 -0
- package/dist/runtime/SvgShapes.vue.d.ts +7 -0
- package/dist/runtime/Viewer.vue.d.cts +57 -0
- package/dist/runtime/Viewer.vue.d.ts +57 -0
- package/dist/runtime/capabilities.d.cts +52 -0
- package/dist/runtime/capabilities.d.ts +52 -0
- package/dist/runtime/documents.d.cts +42 -0
- package/dist/runtime/documents.d.ts +42 -0
- package/dist/runtime/kernel.d.cts +36 -0
- package/dist/runtime/kernel.d.ts +36 -0
- package/dist/runtime/page.d.cts +15 -0
- package/dist/runtime/page.d.ts +15 -0
- package/dist/runtime/refs.d.cts +12 -0
- package/dist/runtime/refs.d.ts +12 -0
- package/dist/runtime/surface-box.d.cts +12 -0
- package/dist/runtime/surface-box.d.ts +12 -0
- package/dist/runtime.cjs +53 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.d.cts +24 -0
- package/dist/runtime.d.ts +24 -0
- package/dist/runtime.js +38 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scope-BQA4toWB.cjs +17 -0
- package/dist/scope-BQA4toWB.cjs.map +1 -0
- package/dist/scope-BgdCqnYb.js +18 -0
- package/dist/scope-BgdCqnYb.js.map +1 -0
- package/dist/search/SearchLayer.vue.d.cts +17 -0
- package/dist/search/SearchLayer.vue.d.ts +17 -0
- package/dist/search/composables.d.cts +31 -0
- package/dist/search/composables.d.ts +31 -0
- package/dist/search.cjs +17 -0
- package/dist/search.cjs.map +1 -0
- package/dist/search.d.cts +10 -0
- package/dist/search.d.ts +10 -0
- package/dist/search.js +11 -0
- package/dist/search.js.map +1 -0
- package/dist/selection/SelectionClipboard.vue.d.cts +24 -0
- package/dist/selection/SelectionClipboard.vue.d.ts +24 -0
- package/dist/selection/SelectionHandles.vue.d.cts +8 -0
- package/dist/selection/SelectionHandles.vue.d.ts +8 -0
- package/dist/selection/SelectionLayer.vue.d.cts +3 -0
- package/dist/selection/SelectionLayer.vue.d.ts +3 -0
- package/dist/selection/SelectionMenu.vue.d.cts +23 -0
- package/dist/selection/SelectionMenu.vue.d.ts +23 -0
- package/dist/selection/composables.d.cts +24 -0
- package/dist/selection/composables.d.ts +24 -0
- package/dist/selection.cjs +24 -0
- package/dist/selection.cjs.map +1 -0
- package/dist/selection.d.cts +16 -0
- package/dist/selection.d.ts +16 -0
- package/dist/selection.js +15 -0
- package/dist/selection.js.map +1 -0
- package/dist/shell.cjs +72 -0
- package/dist/shell.cjs.map +1 -0
- package/dist/shell.d.cts +56 -0
- package/dist/shell.d.ts +56 -0
- package/dist/shell.js +67 -0
- package/dist/shell.js.map +1 -0
- package/dist/signature/composables.d.cts +39 -0
- package/dist/signature/composables.d.ts +39 -0
- package/dist/signature.cjs +16 -0
- package/dist/signature.cjs.map +1 -0
- package/dist/signature.d.cts +15 -0
- package/dist/signature.d.ts +15 -0
- package/dist/signature.js +10 -0
- package/dist/signature.js.map +1 -0
- package/dist/stage/PageSurface.vue.d.cts +29 -0
- package/dist/stage/PageSurface.vue.d.ts +29 -0
- package/dist/stage/Scrollbar.vue.d.cts +32 -0
- package/dist/stage/Scrollbar.vue.d.ts +32 -0
- package/dist/stage/Stage.vue.d.cts +44 -0
- package/dist/stage/Stage.vue.d.ts +44 -0
- package/dist/stage/StageScope.vue.d.cts +17 -0
- package/dist/stage/StageScope.vue.d.ts +17 -0
- package/dist/stage/composables.d.cts +41 -0
- package/dist/stage/composables.d.ts +41 -0
- package/dist/stage/scope.d.cts +12 -0
- package/dist/stage/scope.d.ts +12 -0
- package/dist/stage.cjs +21 -0
- package/dist/stage.cjs.map +1 -0
- package/dist/stage.d.cts +17 -0
- package/dist/stage.d.ts +17 -0
- package/dist/stage.js +15 -0
- package/dist/stage.js.map +1 -0
- package/dist/stamp.cjs +68 -0
- package/dist/stamp.cjs.map +1 -0
- package/dist/stamp.d.cts +61 -0
- package/dist/stamp.d.ts +61 -0
- package/dist/stamp.js +61 -0
- package/dist/stamp.js.map +1 -0
- package/dist/state-DZg8q3v6.js +52 -0
- package/dist/state-DZg8q3v6.js.map +1 -0
- package/dist/state-M22NDJQo.cjs +51 -0
- package/dist/state-M22NDJQo.cjs.map +1 -0
- package/dist/state.d.cts +32 -0
- package/dist/state.d.ts +32 -0
- package/dist/strip-BSDB39Xh.cjs +743 -0
- package/dist/strip-BSDB39Xh.cjs.map +1 -0
- package/dist/strip-C3wLonKB.js +744 -0
- package/dist/strip-C3wLonKB.js.map +1 -0
- package/dist/surface-box-B9oa4YoG.js +12 -0
- package/dist/surface-box-B9oa4YoG.js.map +1 -0
- package/dist/surface-box-C7EvUOXp.cjs +11 -0
- package/dist/surface-box-C7EvUOXp.cjs.map +1 -0
- package/dist/theme.d.cts +13 -0
- package/dist/theme.d.ts +13 -0
- package/dist/toolbar/DefaultCollapsed.vue.d.cts +9 -0
- package/dist/toolbar/DefaultCollapsed.vue.d.ts +9 -0
- package/dist/toolbar/DefaultCommand.vue.d.cts +8 -0
- package/dist/toolbar/DefaultCommand.vue.d.ts +8 -0
- package/dist/toolbar/DefaultGroupTrigger.vue.d.cts +9 -0
- package/dist/toolbar/DefaultGroupTrigger.vue.d.ts +9 -0
- package/dist/toolbar/DefaultOverflowMenu.vue.d.cts +9 -0
- package/dist/toolbar/DefaultOverflowMenu.vue.d.ts +9 -0
- package/dist/toolbar/DefaultOverflowTrigger.vue.d.cts +10 -0
- package/dist/toolbar/DefaultOverflowTrigger.vue.d.ts +10 -0
- package/dist/toolbar/Measured.vue.d.cts +21 -0
- package/dist/toolbar/Measured.vue.d.ts +21 -0
- package/dist/toolbar/NativeSlotSocket.vue.d.cts +22 -0
- package/dist/toolbar/NativeSlotSocket.vue.d.ts +22 -0
- package/dist/toolbar/Toolbar.vue.d.cts +82 -0
- package/dist/toolbar/Toolbar.vue.d.ts +82 -0
- package/dist/toolbar/ToolbarPart.vue.d.cts +42 -0
- package/dist/toolbar/ToolbarPart.vue.d.ts +42 -0
- package/dist/toolbar/paint.d.cts +3 -0
- package/dist/toolbar/paint.d.ts +3 -0
- package/dist/toolbar/strip.d.cts +14 -0
- package/dist/toolbar/strip.d.ts +14 -0
- package/dist/toolbar/views.d.cts +15 -0
- package/dist/toolbar/views.d.ts +15 -0
- package/dist/toolbar.cjs +27 -0
- package/dist/toolbar.cjs.map +1 -0
- package/dist/toolbar.d.cts +14 -0
- package/dist/toolbar.d.ts +14 -0
- package/dist/toolbar.js +12 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/view-manager.cjs +22 -0
- package/dist/view-manager.cjs.map +1 -0
- package/dist/view-manager.d.cts +24 -0
- package/dist/view-manager.d.ts +24 -0
- package/dist/view-manager.js +17 -0
- package/dist/view-manager.js.map +1 -0
- package/package.json +179 -3
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defineComponent, ref, shallowRef, computed, watch, onMounted, openBlock, createBlock, Teleport, createElementBlock, withModifiers, normalizeStyle, renderSlot, createCommentVNode, withCtx } from "vue";
|
|
2
|
+
import { observeAnchoredFit, sameAnchoredFit, projectAnchoredTarget } from "@embedpdf/web";
|
|
3
|
+
import { b as useProjectorBinding, c as useShownPages } from "./projector-CDZn1kh1.js";
|
|
4
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "PlacedAnchored",
|
|
6
|
+
props: {
|
|
7
|
+
target: {},
|
|
8
|
+
placement: {},
|
|
9
|
+
gap: {},
|
|
10
|
+
pinned: { type: Boolean }
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const binding = useProjectorBinding();
|
|
15
|
+
const element = ref(null);
|
|
16
|
+
const fit = shallowRef(null);
|
|
17
|
+
const browserMoves = ref(0);
|
|
18
|
+
const space = computed(() => binding.value.projector.space);
|
|
19
|
+
watch(
|
|
20
|
+
() => binding.value.subscribe,
|
|
21
|
+
(subscribe, _previous, onCleanup) => {
|
|
22
|
+
if (subscribe) onCleanup(subscribe(() => browserMoves.value += 1));
|
|
23
|
+
},
|
|
24
|
+
{ immediate: true }
|
|
25
|
+
);
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
if (space.value === "client") browserMoves.value += 1;
|
|
28
|
+
});
|
|
29
|
+
watch(
|
|
30
|
+
[() => binding.value.projector, () => props.target],
|
|
31
|
+
() => {
|
|
32
|
+
if (space.value === "client") browserMoves.value += 1;
|
|
33
|
+
},
|
|
34
|
+
{ flush: "post" }
|
|
35
|
+
);
|
|
36
|
+
watch(
|
|
37
|
+
[element, space],
|
|
38
|
+
([content, viewSpace], _previous, onCleanup) => {
|
|
39
|
+
if (!content) return;
|
|
40
|
+
onCleanup(
|
|
41
|
+
observeAnchoredFit(content, viewSpace, (next) => {
|
|
42
|
+
if (!sameAnchoredFit(fit.value, next)) fit.value = next;
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
{ immediate: true, flush: "post" }
|
|
47
|
+
);
|
|
48
|
+
const position = computed(() => {
|
|
49
|
+
void browserMoves.value;
|
|
50
|
+
return projectAnchoredTarget(
|
|
51
|
+
binding.value.projector,
|
|
52
|
+
props.target,
|
|
53
|
+
{ placement: props.placement, gap: props.gap, pinned: props.pinned },
|
|
54
|
+
fit.value
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
const style = computed(() => {
|
|
58
|
+
const placed = position.value;
|
|
59
|
+
if (!placed) return null;
|
|
60
|
+
return {
|
|
61
|
+
position: space.value === "client" ? "fixed" : "absolute",
|
|
62
|
+
left: `${placed.left}px`,
|
|
63
|
+
top: `${placed.top}px`,
|
|
64
|
+
// Its own width, wherever it sits: the size the placement measured.
|
|
65
|
+
width: "max-content",
|
|
66
|
+
transform: placed.transform,
|
|
67
|
+
pointerEvents: "auto"
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
return openBlock(), createBlock(Teleport, {
|
|
72
|
+
to: "body",
|
|
73
|
+
disabled: space.value !== "client"
|
|
74
|
+
}, [
|
|
75
|
+
style.value ? (openBlock(), createElementBlock("div", {
|
|
76
|
+
key: 0,
|
|
77
|
+
ref_key: "element",
|
|
78
|
+
ref: element,
|
|
79
|
+
style: normalizeStyle(style.value),
|
|
80
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
81
|
+
}, ["stop"]))
|
|
82
|
+
}, [
|
|
83
|
+
renderSlot(_ctx.$slots, "default")
|
|
84
|
+
], 36)) : createCommentVNode("", true)
|
|
85
|
+
], 8, ["disabled"]);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
90
|
+
__name: "Anchored",
|
|
91
|
+
props: {
|
|
92
|
+
anchor: {},
|
|
93
|
+
placement: { default: "top" },
|
|
94
|
+
gap: { default: 8 },
|
|
95
|
+
pinned: { type: Boolean, default: false }
|
|
96
|
+
},
|
|
97
|
+
setup(__props) {
|
|
98
|
+
const props = __props;
|
|
99
|
+
const shown = useShownPages();
|
|
100
|
+
const target = computed(() => {
|
|
101
|
+
const anchor = props.anchor;
|
|
102
|
+
if (!(anchor == null ? void 0 : anchor.bounds)) return null;
|
|
103
|
+
if (shown && !shown.value.has(anchor.page.objectNumber)) return null;
|
|
104
|
+
return { ...anchor, bounds: anchor.bounds };
|
|
105
|
+
});
|
|
106
|
+
return (_ctx, _cache) => {
|
|
107
|
+
return target.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
108
|
+
key: 0,
|
|
109
|
+
target: target.value,
|
|
110
|
+
placement: __props.placement,
|
|
111
|
+
gap: __props.gap,
|
|
112
|
+
pinned: __props.pinned
|
|
113
|
+
}, {
|
|
114
|
+
default: withCtx(() => [
|
|
115
|
+
renderSlot(_ctx.$slots, "default")
|
|
116
|
+
]),
|
|
117
|
+
_: 3
|
|
118
|
+
}, 8, ["target", "placement", "gap", "pinned"])) : createCommentVNode("", true);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
_sfc_main as _
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js","sources":["../src/anchored/PlacedAnchored.vue","../src/anchored/Anchored.vue"],"sourcesContent":["<!--\n Anchored UI on a page that is shown: it follows the camera. The projection\n runs during render from the shared pure helper; the content's size and the\n view's are measured after mount and whenever either resizes (a camera move\n changes neither). In client space (a surface without a camera) it is\n teleported to the body and placed `fixed`, out of reach of any ancestor's\n overflow clipping.\n-->\n<script setup lang=\"ts\">\nimport { computed, onMounted, ref, shallowRef, watch } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { observeAnchoredFit, projectAnchoredTarget, sameAnchoredFit } from '@embedpdf/web';\nimport type { AnchoredFit, AnchoredPlacement, AnchorTarget } from '@embedpdf/web';\nimport { useProjectorBinding } from './projector';\n\nconst props = defineProps<{\n target: AnchorTarget;\n placement: AnchoredPlacement;\n gap: number;\n pinned: boolean;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nconst binding = useProjectorBinding();\nconst element = ref<HTMLDivElement | null>(null);\nconst fit = shallowRef<AnchoredFit | null>(null);\n// Bumped by browser-driven invalidation, which no state change announces.\nconst browserMoves = ref(0);\n\nconst space = computed(() => binding.value.projector.space);\n\nwatch(\n () => binding.value.subscribe,\n (subscribe, _previous, onCleanup) => {\n if (subscribe) onCleanup(subscribe(() => (browserMoves.value += 1)));\n },\n { immediate: true },\n);\n\n// A client-space surface measures the DOM, which doesn't exist during its\n// first render: one more pass after mount shows the position as soon as it\n// can be measured.\nonMounted(() => {\n if (space.value === 'client') browserMoves.value += 1;\n});\nwatch(\n [() => binding.value.projector, () => props.target],\n () => {\n if (space.value === 'client') browserMoves.value += 1;\n },\n { flush: 'post' },\n);\n\nwatch(\n [element, space],\n ([content, viewSpace], _previous, onCleanup) => {\n if (!content) return;\n onCleanup(\n observeAnchoredFit(content, viewSpace, (next) => {\n if (!sameAnchoredFit(fit.value, next)) fit.value = next;\n }),\n );\n },\n { immediate: true, flush: 'post' },\n);\n\nconst position = computed(() => {\n void browserMoves.value;\n return projectAnchoredTarget(\n binding.value.projector,\n props.target,\n { placement: props.placement, gap: props.gap, pinned: props.pinned },\n fit.value,\n );\n});\n\nconst style = computed((): CSSProperties | null => {\n const placed = position.value;\n if (!placed) return null;\n return {\n position: space.value === 'client' ? 'fixed' : 'absolute',\n left: `${placed.left}px`,\n top: `${placed.top}px`,\n // Its own width, wherever it sits: the size the placement measured.\n width: 'max-content',\n transform: placed.transform,\n pointerEvents: 'auto',\n };\n});\n</script>\n\n<template>\n <Teleport to=\"body\" :disabled=\"space !== 'client'\">\n <div v-if=\"style\" ref=\"element\" :style=\"style\" @pointerdown.stop>\n <slot />\n </div>\n </Teleport>\n</template>\n","<!--\n <Anchored>: positions its content around a page-space box, on whichever page\n surface is in scope (a <Stage>'s #overlay slot). Once its size is measured it\n flips to the other side when the chosen one has no room, and stays inside the\n view, unless `pinned`. A click inside it never reaches the surface (which\n would read it as a click outside). On a page that isn't shown it renders\n nothing and reads only the pages on screen, so hundreds of badges cost only\n the ones in view while people scroll and zoom.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { AnchoredPlacement, AnchoredRect, AnchorTarget } from '@embedpdf/web';\nimport PlacedAnchored from './PlacedAnchored.vue';\nimport { useShownPages } from './projector';\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The box on a page to sit next to, in page coordinates: `{ page, bounds }`,\n * with `avoid` points to keep clear of. `null`, or a target without\n * `bounds` (a search match with no geometry), hides it.\n */\n anchor: (Omit<AnchorTarget, 'bounds'> & { bounds?: AnchoredRect }) | null;\n /** Where to sit: a side of the box, centred, or lined up with the side's start or end (`'top-end'`). */\n placement?: AnchoredPlacement;\n /**\n * Gap in screen px between the box and the content, and between the content\n * and the view's edge. Negative overlaps the box.\n */\n gap?: number;\n /**\n * Stay where `placement` puts it: never flip to the other side, never move\n * to stay in view, and scroll away with the box. For badges and status;\n * menus leave it off.\n */\n pinned?: boolean;\n }>(),\n { placement: 'top', gap: 8, pinned: false },\n);\n\ndefineSlots<{ default?(): unknown }>();\n\nconst shown = useShownPages();\n\n/** The anchor with its box, while it has one on a shown page. */\nconst target = computed((): AnchorTarget | null => {\n const anchor = props.anchor;\n if (!anchor?.bounds) return null;\n if (shown && !shown.value.has(anchor.page.objectNumber)) return null;\n return { ...anchor, bounds: anchor.bounds };\n});\n</script>\n\n<template>\n <PlacedAnchored v-if=\"target\" :target=\"target\" :placement=\"placement\" :gap=\"gap\" :pinned=\"pinned\">\n <slot />\n </PlacedAnchored>\n</template>\n"],"names":["_createBlock","_Teleport","_createElementBlock","_renderSlot","PlacedAnchored"],"mappings":";;;;;;;;;;;;AAeA,UAAM,QAAQ;AASd,UAAM,UAAU,oBAAA;AAChB,UAAM,UAAU,IAA2B,IAAI;AAC/C,UAAM,MAAM,WAA+B,IAAI;AAE/C,UAAM,eAAe,IAAI,CAAC;AAE1B,UAAM,QAAQ,SAAS,MAAM,QAAQ,MAAM,UAAU,KAAK;AAE1D;AAAA,M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AA,QAClB,eAAe;AAAA,MAAA;AAAA,IAEnB,CAAC;;0BAICA,YAIWC,UAAA;AAAA,QAJD,IAAG;AAAA,QAAQ,UAAU,MAAA,UAAK;AAAA,MAAA;QACvB,MAAA,sBAAXC,mBAEM,OAAA;AAAA;mBAFgB;AAAA,UAAJ,KAAI;AAAA,UAAW,sBAAO,MAAA,KAAK;AAAA,UAAG,uDAAD,MAAA;AAAA,UAAA,GAAiB,CAAA,MAAA,CAAA;AAAA,QAAA;UAC9DC,WAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;;;;;;;;AChFd,UAAM,QAAQ;AA2Bd,UAAM,QAAQ,cAAA;AAGd,UAAM,SAAS,SAAS,MAA2B;AACjD,YAAM,SAAS,MAAM;AACrB,UAAI,EAAC,iCAAQ,QAAQ,QAAO;AAC5B,UAAI,SAAS,CAAC,MAAM,MAAM,IAAI,OAAO,KAAK,YAAY,EAAG,QAAO;AAChE,aAAO,EAAE,GAAG,QAAQ,QAAQ,OAAO,OAAA;AAAA,IACrC,CAAC;;aAIuB,OAAA,sBAAtBH,YAEiBI,aAAA;AAAA;QAFc,QAAQ,OAAA;AAAA,QAAS,WAAW,QAAA;AAAA,QAAY,KAAK,QAAA;AAAA,QAAM,QAAQ,QAAA;AAAA,MAAA;yBACxF,MAAQ;AAAA,UAARD,WAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const projector = require("./projector-Cf7879sx.cjs");
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
5
|
+
__name: "AnchoredScope",
|
|
6
|
+
props: {
|
|
7
|
+
binding: {},
|
|
8
|
+
shown: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
projector.provideProjector(vue.computed(() => props.binding));
|
|
13
|
+
projector.provideShownPages(vue.computed(() => props.shown));
|
|
14
|
+
return (_ctx, _cache) => {
|
|
15
|
+
return vue.renderSlot(_ctx.$slots, "default");
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
exports._sfc_main = _sfc_main;
|
|
20
|
+
//# sourceMappingURL=AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs","sources":["../src/anchored/AnchoredScope.vue"],"sourcesContent":["<!--\n <AnchoredScope>: what a page surface wraps around the UI it lets float over\n its pages (the Stage's #overlay slot). Anchored UI inside positions through\n `binding` and sits out the pages not in `shown`. Installed by page surfaces,\n not by app code.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { provideProjector, provideShownPages } from './projector';\nimport type { ProjectorBinding, ShownPages } from './projector';\n\nconst props = defineProps<{\n binding: ProjectorBinding;\n shown: ShownPages;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nprovideProjector(computed(() => props.binding));\nprovideShownPages(computed(() => props.shown));\n</script>\n\n<template>\n <slot />\n</template>\n"],"names":["provideProjector","computed","provideShownPages","_renderSlot"],"mappings":";;;;;;;;;;AAWA,UAAM,QAAQ;AAOdA,cAAAA,iBAAiBC,IAAAA,SAAS,MAAM,MAAM,OAAO,CAAC;AAC9CC,cAAAA,kBAAkBD,IAAAA,SAAS,MAAM,MAAM,KAAK,CAAC;;aAI3CE,eAAQ,KAAA,QAAA,SAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent, computed, renderSlot } from "vue";
|
|
2
|
+
import { p as provideProjector, a as provideShownPages } from "./projector-CDZn1kh1.js";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "AnchoredScope",
|
|
5
|
+
props: {
|
|
6
|
+
binding: {},
|
|
7
|
+
shown: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
provideProjector(computed(() => props.binding));
|
|
12
|
+
provideShownPages(computed(() => props.shown));
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return renderSlot(_ctx.$slots, "default");
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
_sfc_main as _
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js","sources":["../src/anchored/AnchoredScope.vue"],"sourcesContent":["<!--\n <AnchoredScope>: what a page surface wraps around the UI it lets float over\n its pages (the Stage's #overlay slot). Anchored UI inside positions through\n `binding` and sits out the pages not in `shown`. Installed by page surfaces,\n not by app code.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { provideProjector, provideShownPages } from './projector';\nimport type { ProjectorBinding, ShownPages } from './projector';\n\nconst props = defineProps<{\n binding: ProjectorBinding;\n shown: ShownPages;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nprovideProjector(computed(() => props.binding));\nprovideShownPages(computed(() => props.shown));\n</script>\n\n<template>\n <slot />\n</template>\n"],"names":["_renderSlot"],"mappings":";;;;;;;;;AAWA,UAAM,QAAQ;AAOd,qBAAiB,SAAS,MAAM,MAAM,OAAO,CAAC;AAC9C,sBAAkB,SAAS,MAAM,MAAM,KAAK,CAAC;;aAI3CA,WAAQ,KAAA,QAAA,SAAA;AAAA;;;"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { epdfThemeVariables, browserPrinter, browserClock } from "@embedpdf/web";
|
|
2
|
+
import { defineComponent, shallowRef, toRaw, watch, onMounted, onUnmounted, computed, renderSlot, openBlock, createElementBlock, Fragment, createCommentVNode, onScopeDispose, unref } from "vue";
|
|
3
|
+
import { isLocalEngine, createKernel, viewerSettingsOf } from "@embedpdf/core";
|
|
4
|
+
import { d as devWarn } from "./dev-CtMlvxjZ.js";
|
|
5
|
+
import { k as provideViewer, p as provideDocumentScope } from "./capabilities-C7YzgPCX.js";
|
|
6
|
+
import { u as useDocument } from "./documents-DUu5H4yH.js";
|
|
7
|
+
function epdfTheme(theme) {
|
|
8
|
+
return epdfThemeVariables(theme);
|
|
9
|
+
}
|
|
10
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "Viewer",
|
|
12
|
+
props: {
|
|
13
|
+
engine: {},
|
|
14
|
+
plugins: {},
|
|
15
|
+
initialDocuments: {},
|
|
16
|
+
identity: {},
|
|
17
|
+
scope: {},
|
|
18
|
+
accent: {},
|
|
19
|
+
page: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["ready"],
|
|
22
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const settingsOf = () => viewerSettingsOf({
|
|
26
|
+
identity: toRaw(props.identity),
|
|
27
|
+
scope: toRaw(props.scope),
|
|
28
|
+
accent: props.accent,
|
|
29
|
+
page: toRaw(props.page)
|
|
30
|
+
});
|
|
31
|
+
const kernel = shallowRef(null);
|
|
32
|
+
const phase = shallowRef("booting");
|
|
33
|
+
const bootError = shallowRef(null);
|
|
34
|
+
const revision = shallowRef(0);
|
|
35
|
+
provideViewer({
|
|
36
|
+
get kernel() {
|
|
37
|
+
return kernel.value;
|
|
38
|
+
},
|
|
39
|
+
track: () => {
|
|
40
|
+
void revision.value;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const initial = {
|
|
44
|
+
engine: toRaw(props.engine),
|
|
45
|
+
plugins: toRaw(props.plugins),
|
|
46
|
+
initialDocuments: toRaw(props.initialDocuments)
|
|
47
|
+
};
|
|
48
|
+
watch(
|
|
49
|
+
() => props.plugins,
|
|
50
|
+
() => devWarn(
|
|
51
|
+
"viewer-plugins-init-only",
|
|
52
|
+
"<Viewer> plugins are read once, when it mounts; a new list is ignored. Create the list once, next to the engine, not inline in the template."
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
watch(
|
|
56
|
+
() => props.engine,
|
|
57
|
+
(engine) => {
|
|
58
|
+
if (typeof engine === "function") return;
|
|
59
|
+
devWarn(
|
|
60
|
+
"viewer-engine-init-only",
|
|
61
|
+
"<Viewer> engine is read once, when it mounts; another engine is ignored. To use another engine, mount a new <Viewer>, for example with a new `key`."
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
let teardown = null;
|
|
66
|
+
onMounted(() => {
|
|
67
|
+
const ownsEngine = typeof initial.engine === "function";
|
|
68
|
+
const engine = ownsEngine ? initial.engine() : initial.engine;
|
|
69
|
+
if (isLocalEngine(engine)) engine.warmup();
|
|
70
|
+
let created;
|
|
71
|
+
try {
|
|
72
|
+
created = createKernel({
|
|
73
|
+
engine,
|
|
74
|
+
plugins: initial.plugins,
|
|
75
|
+
settings: settingsOf(),
|
|
76
|
+
clock: browserClock(),
|
|
77
|
+
printer: browserPrinter()
|
|
78
|
+
});
|
|
79
|
+
} catch (error) {
|
|
80
|
+
bootError.value = error;
|
|
81
|
+
phase.value = "error";
|
|
82
|
+
if (ownsEngine) void engine.destroy();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const stopTracking = created.subscribe(() => {
|
|
86
|
+
revision.value += 1;
|
|
87
|
+
});
|
|
88
|
+
kernel.value = created;
|
|
89
|
+
let alive = true;
|
|
90
|
+
created.start().then(
|
|
91
|
+
() => {
|
|
92
|
+
if (!alive) return;
|
|
93
|
+
emit("ready", created);
|
|
94
|
+
phase.value = "ready";
|
|
95
|
+
created.documents.openAll(initial.initialDocuments ?? []);
|
|
96
|
+
},
|
|
97
|
+
(error) => {
|
|
98
|
+
if (!alive) return;
|
|
99
|
+
bootError.value = error;
|
|
100
|
+
phase.value = "error";
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
teardown = () => {
|
|
104
|
+
alive = false;
|
|
105
|
+
stopTracking();
|
|
106
|
+
void created.destroy().then(() => {
|
|
107
|
+
if (ownsEngine) void engine.destroy();
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
onUnmounted(() => teardown == null ? void 0 : teardown());
|
|
112
|
+
watch(settingsOf, (settings) => {
|
|
113
|
+
var _a;
|
|
114
|
+
return (_a = kernel.value) == null ? void 0 : _a.updateSettings(settings);
|
|
115
|
+
});
|
|
116
|
+
__expose({
|
|
117
|
+
/** The started kernel; null before it starts and after a failed start. */
|
|
118
|
+
kernel: computed(() => phase.value === "ready" ? kernel.value : null)
|
|
119
|
+
});
|
|
120
|
+
return (_ctx, _cache) => {
|
|
121
|
+
return phase.value === "error" ? renderSlot(_ctx.$slots, "error", { error: bootError.value }, void 0, void 0, 0) : kernel.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
122
|
+
phase.value === "ready" ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "fallback", {}, void 0, void 0, 1)
|
|
123
|
+
], 64)) : createCommentVNode("", true);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
128
|
+
__name: "KernelProvider",
|
|
129
|
+
props: {
|
|
130
|
+
kernel: {}
|
|
131
|
+
},
|
|
132
|
+
setup(__props) {
|
|
133
|
+
const props = __props;
|
|
134
|
+
const kernel = toRaw(props.kernel);
|
|
135
|
+
watch(
|
|
136
|
+
() => props.kernel,
|
|
137
|
+
() => devWarn(
|
|
138
|
+
"kernel-provider-kernel-init-only",
|
|
139
|
+
"<KernelProvider> kernel is read once, when it mounts; another kernel is ignored. To give its content another kernel, mount a new <KernelProvider>, for example with a new `key`."
|
|
140
|
+
)
|
|
141
|
+
);
|
|
142
|
+
const revision = shallowRef(0);
|
|
143
|
+
onScopeDispose(
|
|
144
|
+
kernel.subscribe(() => {
|
|
145
|
+
revision.value += 1;
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
provideViewer({
|
|
149
|
+
kernel,
|
|
150
|
+
track: () => {
|
|
151
|
+
void revision.value;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
return (_ctx, _cache) => {
|
|
155
|
+
return renderSlot(_ctx.$slots, "default");
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
160
|
+
__name: "DocumentGate",
|
|
161
|
+
setup(__props) {
|
|
162
|
+
const current = useDocument((document) => document);
|
|
163
|
+
return (_ctx, _cache) => {
|
|
164
|
+
return unref(current).status === "ready" ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : unref(current).status === "locked" && _ctx.$slots.locked ? renderSlot(_ctx.$slots, "locked", {
|
|
165
|
+
document: unref(current)
|
|
166
|
+
}, void 0, void 0, 1) : unref(current).status === "error" && _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", {
|
|
167
|
+
document: unref(current)
|
|
168
|
+
}, void 0, void 0, 2) : renderSlot(_ctx.$slots, "fallback", {}, void 0, void 0, 3);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
173
|
+
__name: "DocumentScope",
|
|
174
|
+
props: {
|
|
175
|
+
id: {}
|
|
176
|
+
},
|
|
177
|
+
setup(__props) {
|
|
178
|
+
const props = __props;
|
|
179
|
+
provideDocumentScope(() => props.id);
|
|
180
|
+
return (_ctx, _cache) => {
|
|
181
|
+
return renderSlot(_ctx.$slots, "default");
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export {
|
|
186
|
+
_sfc_main$1 as _,
|
|
187
|
+
_sfc_main as a,
|
|
188
|
+
_sfc_main$2 as b,
|
|
189
|
+
_sfc_main$3 as c,
|
|
190
|
+
epdfTheme as e
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js","sources":["../src/theme.ts","../src/runtime/Viewer.vue","../src/runtime/KernelProvider.vue","../src/runtime/DocumentGate.vue","../src/runtime/DocumentScope.vue"],"sourcesContent":["/**\n * `epdfTheme()`: a theme written with setting names, as a style for the\n * element around your viewer. The variables and their lookup are framework-free\n * (`@embedpdf/web`); this only types the result as Vue's style.\n */\nimport type { CSSProperties } from 'vue';\nimport { epdfThemeVariables, type EpdfTheme } from '@embedpdf/web';\n\nexport type { EpdfTheme } from '@embedpdf/web';\n\n/**\n * The CSS variables of a theme, for a `:style` binding: `<div :style=\"epdfTheme({ accent })\">`.\n * Everything inside the element follows them, and a CSS variable wins over any setting.\n */\nexport function epdfTheme(theme: EpdfTheme): CSSProperties {\n return epdfThemeVariables(theme) as CSSProperties;\n}\n","<!--\n <Viewer>: owns the kernel. It creates and starts the kernel when it mounts\n (never on the server) and destroys it when it unmounts; the components inside\n read it through composables. `engine`, `plugins` and `initialDocuments` are\n read once; `identity`, `scope`, `accent` and `page` are the viewer's settings\n and follow the props.\n-->\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, shallowRef, toRaw, watch } from 'vue';\nimport { createKernel, isLocalEngine, viewerSettingsOf } from '@embedpdf/core';\nimport { browserClock, browserPrinter } from '@embedpdf/web';\nimport type {\n AnyPlugin,\n Engine,\n EngineFactory,\n Identity,\n InitialDocument,\n Kernel,\n ViewerPageSettings,\n ViewerSettings,\n} from '@embedpdf/core';\nimport { devWarn } from '../dev';\nimport { provideViewer } from './kernel';\n\nconst props = defineProps<{\n /**\n * The engine, as an instance or a function. An instance is borrowed: the\n * viewer uses it and never destroys it (a module-level `localEngine()`\n * shared by every viewer). A function is the viewer's own: it calls it when\n * it mounts and destroys the engine when it unmounts. Read once.\n */\n engine: Engine | EngineFactory;\n /** The plugins, created once next to the engine. Read once. */\n plugins: AnyPlugin[];\n /** Documents to open when the viewer starts, with optional tab names. Read once. */\n initialDocuments?: InitialDocument[];\n /**\n * Who the user is, for every document opened without an `identity` of its\n * own (which replaces this one). Documents opened after a change use the new\n * value; open ones keep theirs. The local engine only: the cloud engine reads\n * it from the document's token.\n */\n identity?: Identity;\n /**\n * What the user may do, as permissions, in every document opened without a\n * `scope` of its own. Left out, they may do everything. Changes reach the\n * documents opened after them, as `identity`.\n */\n scope?: readonly string[];\n /** The color every part without a color of its own follows. CSS `--epdf-accent` wins over it. */\n accent?: string;\n /** How pages look: `background` before the picture arrives, and the `shadow` under each page. */\n page?: Partial<ViewerPageSettings>;\n}>();\n\nconst emit = defineEmits<{\n /**\n * The kernel has started: before the default slot mounts and before\n * `initialDocuments` open. The door for code outside Vue components\n * (register commands, subscribe to events).\n */\n ready: [kernel: Kernel];\n}>();\n\ndefineSlots<{\n /** The viewer's content, mounted once the kernel has started. */\n default?(): unknown;\n /** Shown while the kernel starts; the composables already work in it. */\n fallback?(): unknown;\n /** Shown when the kernel couldn't be created or started. Without it, a failed start shows nothing. */\n error?(props: { error: unknown }): unknown;\n}>();\n\n/**\n * The viewer's settings as the props give them: a prop left out is its\n * default. Values reach the kernel raw: a reactive copy would be another object\n * to it, and can't be sent to a worker.\n */\nconst settingsOf = (): ViewerSettings =>\n viewerSettingsOf({\n identity: toRaw(props.identity),\n scope: toRaw(props.scope),\n accent: props.accent,\n page: toRaw(props.page),\n });\n\nconst kernel = shallowRef<Kernel | null>(null);\nconst phase = shallowRef<'booting' | 'ready' | 'error'>('booting');\nconst bootError = shallowRef<unknown>(null);\n// Goes up on every kernel change; every reader's computed depends on it.\nconst revision = shallowRef(0);\n\nprovideViewer({\n get kernel() {\n return kernel.value;\n },\n track: () => {\n void revision.value;\n },\n});\n\n// Read once: a changed engine or plugin list can't mean \"rebuild the\n// workspace\", which would drop every open document. Raw, because the kernel\n// knows a plugin's token by identity, and a reactive copy is another object.\nconst initial = {\n engine: toRaw(props.engine),\n plugins: toRaw(props.plugins),\n initialDocuments: toRaw(props.initialDocuments),\n};\nwatch(\n () => props.plugins,\n () =>\n devWarn(\n 'viewer-plugins-init-only',\n '<Viewer> plugins are read once, when it mounts; a new list is ignored. ' +\n 'Create the list once, next to the engine, not inline in the template.',\n ),\n);\nwatch(\n () => props.engine,\n (engine) => {\n // An inline `:engine=\"() => localEngine()\"` is a new function on every\n // render; only another engine instance is worth a warning.\n if (typeof engine === 'function') return;\n devWarn(\n 'viewer-engine-init-only',\n '<Viewer> engine is read once, when it mounts; another engine is ignored. ' +\n 'To use another engine, mount a new <Viewer>, for example with a new `key`.',\n );\n },\n);\n\nlet teardown: (() => void) | null = null;\n\nonMounted(() => {\n // A function is the viewer's own engine: called now, destroyed on unmount.\n // An instance is borrowed. Construction is synchronous and inert either way,\n // so warming up a local engine overlaps its boot with the plugins' start.\n const ownsEngine = typeof initial.engine === 'function';\n const engine: Engine = ownsEngine\n ? (initial.engine as EngineFactory)()\n : (initial.engine as Engine);\n if (isLocalEngine(engine)) engine.warmup();\n let created: Kernel;\n try {\n created = createKernel({\n engine,\n plugins: initial.plugins,\n settings: settingsOf(),\n clock: browserClock(),\n printer: browserPrinter(),\n });\n } catch (error) {\n // A plan or dependency error shows in the `error` slot.\n bootError.value = error;\n phase.value = 'error';\n if (ownsEngine) void engine.destroy();\n return;\n }\n const stopTracking = created.subscribe(() => {\n revision.value += 1;\n });\n // The kernel is on the binding from now on, so the fallback can use it.\n kernel.value = created;\n let alive = true;\n created.start().then(\n () => {\n if (!alive) return;\n emit('ready', created);\n phase.value = 'ready';\n // Every tab appears at once, in order; the `active` entry (else the\n // first) is selected; a failure shows as that document's status.\n created.documents.openAll(initial.initialDocuments ?? []);\n },\n (error: unknown) => {\n if (!alive) return;\n bootError.value = error;\n phase.value = 'error';\n },\n );\n teardown = () => {\n alive = false;\n stopTracking();\n // The kernel first (it closes every document's handle), then the engine\n // the viewer owns.\n void created.destroy().then(() => {\n if (ownsEngine) void engine.destroy();\n });\n };\n});\n\n// After the content has unmounted, so its own cleanups still reach a live kernel.\nonUnmounted(() => teardown?.());\n\n// Props compare by value: an inline `:page=\"{ shadow: 'none' }\"` is a new\n// object on every render, and settings that didn't change change nothing.\nwatch(settingsOf, (settings) => kernel.value?.updateSettings(settings));\n\ndefineExpose({\n /** The started kernel; null before it starts and after a failed start. */\n kernel: computed(() => (phase.value === 'ready' ? kernel.value : null)),\n});\n</script>\n\n<template>\n <slot v-if=\"phase === 'error'\" name=\"error\" :error=\"bootError\" />\n <template v-else-if=\"kernel\">\n <slot v-if=\"phase === 'ready'\" />\n <slot v-else name=\"fallback\" />\n </template>\n</template>\n","<!--\n <KernelProvider :kernel>: gives its content a kernel someone else created and\n owns, so every composable inside works against that kernel. The full viewer's\n Vue wrapper puts the components it shows in the viewer inside one. It never\n starts or destroys the kernel; <Viewer> is the component that owns one. The\n kernel is read once: for another one, mount a new provider (a new `key`).\n-->\n<script setup lang=\"ts\">\nimport { onScopeDispose, shallowRef, toRaw, watch } from 'vue';\nimport type { Kernel } from '@embedpdf/core';\nimport { devWarn } from '../dev';\nimport { provideViewer } from './kernel';\n\nconst props = defineProps<{\n /** The kernel, created and started by its owner. Read once. */\n kernel: Kernel;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\n// Read once, as `<Viewer>` reads its engine: the composables inside took this kernel when they\n// were set up, and a new one under them would leave them reading the old one. Raw, because a\n// reactive copy of the kernel is another object.\nconst kernel = toRaw(props.kernel);\nwatch(\n () => props.kernel,\n () =>\n devWarn(\n 'kernel-provider-kernel-init-only',\n '<KernelProvider> kernel is read once, when it mounts; another kernel is ignored. ' +\n 'To give its content another kernel, mount a new <KernelProvider>, for example with a new `key`.',\n ),\n);\n\n// Goes up on every change the kernel announces; every reader's computed depends on it.\nconst revision = shallowRef(0);\nonScopeDispose(\n kernel.subscribe(() => {\n revision.value += 1;\n }),\n);\n\nprovideViewer({\n kernel,\n track: () => {\n void revision.value;\n },\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<!--\n <DocumentGate>: renders its content only while this subtree has a ready\n document, the structural way to say \"this UI is defined over a document\".\n Workspace UI (toolbars, commands) lives outside it; document UI (the Stage,\n panels) inside. A document that waits for its password, or failed, renders\n the `#locked` or `#error` slot with it, or else `#fallback`. It decides\n whether; <DocumentScope> decides which document.\n-->\n<script setup lang=\"ts\">\nimport type { DocumentInfo, FailedDocumentInfo, LockedDocumentInfo } from '@embedpdf/core';\nimport { useDocument } from './documents';\n\ndefineSlots<{\n /** Rendered while the document is ready. */\n default?(): unknown;\n /** Shown while this subtree has no document: none is open, or it's still opening. */\n fallback?(): unknown;\n /** Shown while the document waits for its password; `#fallback` without it. */\n locked?(props: { document: LockedDocumentInfo }): unknown;\n /** Shown when the document couldn't be opened, with why; `#fallback` without it. */\n error?(props: { document: FailedDocumentInfo }): unknown;\n}>();\n\nconst current = useDocument((document: DocumentInfo) => document);\n</script>\n\n<template>\n <slot v-if=\"current.status === 'ready'\" />\n <slot\n v-else-if=\"current.status === 'locked' && $slots.locked\"\n name=\"locked\"\n :document=\"current as LockedDocumentInfo\"\n />\n <slot\n v-else-if=\"current.status === 'error' && $slots.error\"\n name=\"error\"\n :document=\"current as FailedDocumentInfo\"\n />\n <slot v-else name=\"fallback\" />\n</template>\n","<!--\n <DocumentScope :id>: binds its content to one document, for panes and\n comparisons. The composables inside talk to that document instead of the\n active one, and `useDocuments()` calls without an id use it.\n-->\n<script setup lang=\"ts\">\nimport { provideDocumentScope } from './kernel';\n\nconst props = defineProps<{\n /** The document's id. */\n id: string;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nprovideDocumentScope(() => props.id);\n</script>\n\n<template>\n <slot />\n</template>\n"],"names":["_renderSlot","_createElementBlock","_Fragment","_unref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
|
+
const capabilities = require("./capabilities-DVNJmgy7.cjs");
|
|
7
|
+
const documents = require("./documents-TQ1fMdWI.cjs");
|
|
8
|
+
function epdfTheme(theme) {
|
|
9
|
+
return web.epdfThemeVariables(theme);
|
|
10
|
+
}
|
|
11
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
12
|
+
__name: "Viewer",
|
|
13
|
+
props: {
|
|
14
|
+
engine: {},
|
|
15
|
+
plugins: {},
|
|
16
|
+
initialDocuments: {},
|
|
17
|
+
identity: {},
|
|
18
|
+
scope: {},
|
|
19
|
+
accent: {},
|
|
20
|
+
page: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["ready"],
|
|
23
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const emit = __emit;
|
|
26
|
+
const settingsOf = () => core.viewerSettingsOf({
|
|
27
|
+
identity: vue.toRaw(props.identity),
|
|
28
|
+
scope: vue.toRaw(props.scope),
|
|
29
|
+
accent: props.accent,
|
|
30
|
+
page: vue.toRaw(props.page)
|
|
31
|
+
});
|
|
32
|
+
const kernel = vue.shallowRef(null);
|
|
33
|
+
const phase = vue.shallowRef("booting");
|
|
34
|
+
const bootError = vue.shallowRef(null);
|
|
35
|
+
const revision = vue.shallowRef(0);
|
|
36
|
+
capabilities.provideViewer({
|
|
37
|
+
get kernel() {
|
|
38
|
+
return kernel.value;
|
|
39
|
+
},
|
|
40
|
+
track: () => {
|
|
41
|
+
void revision.value;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const initial = {
|
|
45
|
+
engine: vue.toRaw(props.engine),
|
|
46
|
+
plugins: vue.toRaw(props.plugins),
|
|
47
|
+
initialDocuments: vue.toRaw(props.initialDocuments)
|
|
48
|
+
};
|
|
49
|
+
vue.watch(
|
|
50
|
+
() => props.plugins,
|
|
51
|
+
() => dev.devWarn(
|
|
52
|
+
"viewer-plugins-init-only",
|
|
53
|
+
"<Viewer> plugins are read once, when it mounts; a new list is ignored. Create the list once, next to the engine, not inline in the template."
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
vue.watch(
|
|
57
|
+
() => props.engine,
|
|
58
|
+
(engine) => {
|
|
59
|
+
if (typeof engine === "function") return;
|
|
60
|
+
dev.devWarn(
|
|
61
|
+
"viewer-engine-init-only",
|
|
62
|
+
"<Viewer> engine is read once, when it mounts; another engine is ignored. To use another engine, mount a new <Viewer>, for example with a new `key`."
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
let teardown = null;
|
|
67
|
+
vue.onMounted(() => {
|
|
68
|
+
const ownsEngine = typeof initial.engine === "function";
|
|
69
|
+
const engine = ownsEngine ? initial.engine() : initial.engine;
|
|
70
|
+
if (core.isLocalEngine(engine)) engine.warmup();
|
|
71
|
+
let created;
|
|
72
|
+
try {
|
|
73
|
+
created = core.createKernel({
|
|
74
|
+
engine,
|
|
75
|
+
plugins: initial.plugins,
|
|
76
|
+
settings: settingsOf(),
|
|
77
|
+
clock: web.browserClock(),
|
|
78
|
+
printer: web.browserPrinter()
|
|
79
|
+
});
|
|
80
|
+
} catch (error) {
|
|
81
|
+
bootError.value = error;
|
|
82
|
+
phase.value = "error";
|
|
83
|
+
if (ownsEngine) void engine.destroy();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const stopTracking = created.subscribe(() => {
|
|
87
|
+
revision.value += 1;
|
|
88
|
+
});
|
|
89
|
+
kernel.value = created;
|
|
90
|
+
let alive = true;
|
|
91
|
+
created.start().then(
|
|
92
|
+
() => {
|
|
93
|
+
if (!alive) return;
|
|
94
|
+
emit("ready", created);
|
|
95
|
+
phase.value = "ready";
|
|
96
|
+
created.documents.openAll(initial.initialDocuments ?? []);
|
|
97
|
+
},
|
|
98
|
+
(error) => {
|
|
99
|
+
if (!alive) return;
|
|
100
|
+
bootError.value = error;
|
|
101
|
+
phase.value = "error";
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
teardown = () => {
|
|
105
|
+
alive = false;
|
|
106
|
+
stopTracking();
|
|
107
|
+
void created.destroy().then(() => {
|
|
108
|
+
if (ownsEngine) void engine.destroy();
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
vue.onUnmounted(() => teardown == null ? void 0 : teardown());
|
|
113
|
+
vue.watch(settingsOf, (settings) => {
|
|
114
|
+
var _a;
|
|
115
|
+
return (_a = kernel.value) == null ? void 0 : _a.updateSettings(settings);
|
|
116
|
+
});
|
|
117
|
+
__expose({
|
|
118
|
+
/** The started kernel; null before it starts and after a failed start. */
|
|
119
|
+
kernel: vue.computed(() => phase.value === "ready" ? kernel.value : null)
|
|
120
|
+
});
|
|
121
|
+
return (_ctx, _cache) => {
|
|
122
|
+
return phase.value === "error" ? vue.renderSlot(_ctx.$slots, "error", { error: bootError.value }, void 0, void 0, 0) : kernel.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
123
|
+
phase.value === "ready" ? vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : vue.renderSlot(_ctx.$slots, "fallback", {}, void 0, void 0, 1)
|
|
124
|
+
], 64)) : vue.createCommentVNode("", true);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
129
|
+
__name: "KernelProvider",
|
|
130
|
+
props: {
|
|
131
|
+
kernel: {}
|
|
132
|
+
},
|
|
133
|
+
setup(__props) {
|
|
134
|
+
const props = __props;
|
|
135
|
+
const kernel = vue.toRaw(props.kernel);
|
|
136
|
+
vue.watch(
|
|
137
|
+
() => props.kernel,
|
|
138
|
+
() => dev.devWarn(
|
|
139
|
+
"kernel-provider-kernel-init-only",
|
|
140
|
+
"<KernelProvider> kernel is read once, when it mounts; another kernel is ignored. To give its content another kernel, mount a new <KernelProvider>, for example with a new `key`."
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
const revision = vue.shallowRef(0);
|
|
144
|
+
vue.onScopeDispose(
|
|
145
|
+
kernel.subscribe(() => {
|
|
146
|
+
revision.value += 1;
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
capabilities.provideViewer({
|
|
150
|
+
kernel,
|
|
151
|
+
track: () => {
|
|
152
|
+
void revision.value;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
return (_ctx, _cache) => {
|
|
156
|
+
return vue.renderSlot(_ctx.$slots, "default");
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
161
|
+
__name: "DocumentGate",
|
|
162
|
+
setup(__props) {
|
|
163
|
+
const current = documents.useDocument((document) => document);
|
|
164
|
+
return (_ctx, _cache) => {
|
|
165
|
+
return vue.unref(current).status === "ready" ? vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : vue.unref(current).status === "locked" && _ctx.$slots.locked ? vue.renderSlot(_ctx.$slots, "locked", {
|
|
166
|
+
document: vue.unref(current)
|
|
167
|
+
}, void 0, void 0, 1) : vue.unref(current).status === "error" && _ctx.$slots.error ? vue.renderSlot(_ctx.$slots, "error", {
|
|
168
|
+
document: vue.unref(current)
|
|
169
|
+
}, void 0, void 0, 2) : vue.renderSlot(_ctx.$slots, "fallback", {}, void 0, void 0, 3);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
174
|
+
__name: "DocumentScope",
|
|
175
|
+
props: {
|
|
176
|
+
id: {}
|
|
177
|
+
},
|
|
178
|
+
setup(__props) {
|
|
179
|
+
const props = __props;
|
|
180
|
+
capabilities.provideDocumentScope(() => props.id);
|
|
181
|
+
return (_ctx, _cache) => {
|
|
182
|
+
return vue.renderSlot(_ctx.$slots, "default");
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
exports._sfc_main = _sfc_main$1;
|
|
187
|
+
exports._sfc_main$1 = _sfc_main;
|
|
188
|
+
exports._sfc_main$2 = _sfc_main$2;
|
|
189
|
+
exports._sfc_main$3 = _sfc_main$3;
|
|
190
|
+
exports.epdfTheme = epdfTheme;
|
|
191
|
+
//# sourceMappingURL=DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs","sources":["../src/theme.ts","../src/runtime/Viewer.vue","../src/runtime/KernelProvider.vue","../src/runtime/DocumentGate.vue","../src/runtime/DocumentScope.vue"],"sourcesContent":["/**\n * `epdfTheme()`: a theme written with setting names, as a style for the\n * element around your viewer. The variables and their lookup are framework-free\n * (`@embedpdf/web`); this only types the result as Vue's style.\n */\nimport type { CSSProperties } from 'vue';\nimport { epdfThemeVariables, type EpdfTheme } from '@embedpdf/web';\n\nexport type { EpdfTheme } from '@embedpdf/web';\n\n/**\n * The CSS variables of a theme, for a `:style` binding: `<div :style=\"epdfTheme({ accent })\">`.\n * Everything inside the element follows them, and a CSS variable wins over any setting.\n */\nexport function epdfTheme(theme: EpdfTheme): CSSProperties {\n return epdfThemeVariables(theme) as CSSProperties;\n}\n","<!--\n <Viewer>: owns the kernel. It creates and starts the kernel when it mounts\n (never on the server) and destroys it when it unmounts; the components inside\n read it through composables. `engine`, `plugins` and `initialDocuments` are\n read once; `identity`, `scope`, `accent` and `page` are the viewer's settings\n and follow the props.\n-->\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, shallowRef, toRaw, watch } from 'vue';\nimport { createKernel, isLocalEngine, viewerSettingsOf } from '@embedpdf/core';\nimport { browserClock, browserPrinter } from '@embedpdf/web';\nimport type {\n AnyPlugin,\n Engine,\n EngineFactory,\n Identity,\n InitialDocument,\n Kernel,\n ViewerPageSettings,\n ViewerSettings,\n} from '@embedpdf/core';\nimport { devWarn } from '../dev';\nimport { provideViewer } from './kernel';\n\nconst props = defineProps<{\n /**\n * The engine, as an instance or a function. An instance is borrowed: the\n * viewer uses it and never destroys it (a module-level `localEngine()`\n * shared by every viewer). A function is the viewer's own: it calls it when\n * it mounts and destroys the engine when it unmounts. Read once.\n */\n engine: Engine | EngineFactory;\n /** The plugins, created once next to the engine. Read once. */\n plugins: AnyPlugin[];\n /** Documents to open when the viewer starts, with optional tab names. Read once. */\n initialDocuments?: InitialDocument[];\n /**\n * Who the user is, for every document opened without an `identity` of its\n * own (which replaces this one). Documents opened after a change use the new\n * value; open ones keep theirs. The local engine only: the cloud engine reads\n * it from the document's token.\n */\n identity?: Identity;\n /**\n * What the user may do, as permissions, in every document opened without a\n * `scope` of its own. Left out, they may do everything. Changes reach the\n * documents opened after them, as `identity`.\n */\n scope?: readonly string[];\n /** The color every part without a color of its own follows. CSS `--epdf-accent` wins over it. */\n accent?: string;\n /** How pages look: `background` before the picture arrives, and the `shadow` under each page. */\n page?: Partial<ViewerPageSettings>;\n}>();\n\nconst emit = defineEmits<{\n /**\n * The kernel has started: before the default slot mounts and before\n * `initialDocuments` open. The door for code outside Vue components\n * (register commands, subscribe to events).\n */\n ready: [kernel: Kernel];\n}>();\n\ndefineSlots<{\n /** The viewer's content, mounted once the kernel has started. */\n default?(): unknown;\n /** Shown while the kernel starts; the composables already work in it. */\n fallback?(): unknown;\n /** Shown when the kernel couldn't be created or started. Without it, a failed start shows nothing. */\n error?(props: { error: unknown }): unknown;\n}>();\n\n/**\n * The viewer's settings as the props give them: a prop left out is its\n * default. Values reach the kernel raw: a reactive copy would be another object\n * to it, and can't be sent to a worker.\n */\nconst settingsOf = (): ViewerSettings =>\n viewerSettingsOf({\n identity: toRaw(props.identity),\n scope: toRaw(props.scope),\n accent: props.accent,\n page: toRaw(props.page),\n });\n\nconst kernel = shallowRef<Kernel | null>(null);\nconst phase = shallowRef<'booting' | 'ready' | 'error'>('booting');\nconst bootError = shallowRef<unknown>(null);\n// Goes up on every kernel change; every reader's computed depends on it.\nconst revision = shallowRef(0);\n\nprovideViewer({\n get kernel() {\n return kernel.value;\n },\n track: () => {\n void revision.value;\n },\n});\n\n// Read once: a changed engine or plugin list can't mean \"rebuild the\n// workspace\", which would drop every open document. Raw, because the kernel\n// knows a plugin's token by identity, and a reactive copy is another object.\nconst initial = {\n engine: toRaw(props.engine),\n plugins: toRaw(props.plugins),\n initialDocuments: toRaw(props.initialDocuments),\n};\nwatch(\n () => props.plugins,\n () =>\n devWarn(\n 'viewer-plugins-init-only',\n '<Viewer> plugins are read once, when it mounts; a new list is ignored. ' +\n 'Create the list once, next to the engine, not inline in the template.',\n ),\n);\nwatch(\n () => props.engine,\n (engine) => {\n // An inline `:engine=\"() => localEngine()\"` is a new function on every\n // render; only another engine instance is worth a warning.\n if (typeof engine === 'function') return;\n devWarn(\n 'viewer-engine-init-only',\n '<Viewer> engine is read once, when it mounts; another engine is ignored. ' +\n 'To use another engine, mount a new <Viewer>, for example with a new `key`.',\n );\n },\n);\n\nlet teardown: (() => void) | null = null;\n\nonMounted(() => {\n // A function is the viewer's own engine: called now, destroyed on unmount.\n // An instance is borrowed. Construction is synchronous and inert either way,\n // so warming up a local engine overlaps its boot with the plugins' start.\n const ownsEngine = typeof initial.engine === 'function';\n const engine: Engine = ownsEngine\n ? (initial.engine as EngineFactory)()\n : (initial.engine as Engine);\n if (isLocalEngine(engine)) engine.warmup();\n let created: Kernel;\n try {\n created = createKernel({\n engine,\n plugins: initial.plugins,\n settings: settingsOf(),\n clock: browserClock(),\n printer: browserPrinter(),\n });\n } catch (error) {\n // A plan or dependency error shows in the `error` slot.\n bootError.value = error;\n phase.value = 'error';\n if (ownsEngine) void engine.destroy();\n return;\n }\n const stopTracking = created.subscribe(() => {\n revision.value += 1;\n });\n // The kernel is on the binding from now on, so the fallback can use it.\n kernel.value = created;\n let alive = true;\n created.start().then(\n () => {\n if (!alive) return;\n emit('ready', created);\n phase.value = 'ready';\n // Every tab appears at once, in order; the `active` entry (else the\n // first) is selected; a failure shows as that document's status.\n created.documents.openAll(initial.initialDocuments ?? []);\n },\n (error: unknown) => {\n if (!alive) return;\n bootError.value = error;\n phase.value = 'error';\n },\n );\n teardown = () => {\n alive = false;\n stopTracking();\n // The kernel first (it closes every document's handle), then the engine\n // the viewer owns.\n void created.destroy().then(() => {\n if (ownsEngine) void engine.destroy();\n });\n };\n});\n\n// After the content has unmounted, so its own cleanups still reach a live kernel.\nonUnmounted(() => teardown?.());\n\n// Props compare by value: an inline `:page=\"{ shadow: 'none' }\"` is a new\n// object on every render, and settings that didn't change change nothing.\nwatch(settingsOf, (settings) => kernel.value?.updateSettings(settings));\n\ndefineExpose({\n /** The started kernel; null before it starts and after a failed start. */\n kernel: computed(() => (phase.value === 'ready' ? kernel.value : null)),\n});\n</script>\n\n<template>\n <slot v-if=\"phase === 'error'\" name=\"error\" :error=\"bootError\" />\n <template v-else-if=\"kernel\">\n <slot v-if=\"phase === 'ready'\" />\n <slot v-else name=\"fallback\" />\n </template>\n</template>\n","<!--\n <KernelProvider :kernel>: gives its content a kernel someone else created and\n owns, so every composable inside works against that kernel. The full viewer's\n Vue wrapper puts the components it shows in the viewer inside one. It never\n starts or destroys the kernel; <Viewer> is the component that owns one. The\n kernel is read once: for another one, mount a new provider (a new `key`).\n-->\n<script setup lang=\"ts\">\nimport { onScopeDispose, shallowRef, toRaw, watch } from 'vue';\nimport type { Kernel } from '@embedpdf/core';\nimport { devWarn } from '../dev';\nimport { provideViewer } from './kernel';\n\nconst props = defineProps<{\n /** The kernel, created and started by its owner. Read once. */\n kernel: Kernel;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\n// Read once, as `<Viewer>` reads its engine: the composables inside took this kernel when they\n// were set up, and a new one under them would leave them reading the old one. Raw, because a\n// reactive copy of the kernel is another object.\nconst kernel = toRaw(props.kernel);\nwatch(\n () => props.kernel,\n () =>\n devWarn(\n 'kernel-provider-kernel-init-only',\n '<KernelProvider> kernel is read once, when it mounts; another kernel is ignored. ' +\n 'To give its content another kernel, mount a new <KernelProvider>, for example with a new `key`.',\n ),\n);\n\n// Goes up on every change the kernel announces; every reader's computed depends on it.\nconst revision = shallowRef(0);\nonScopeDispose(\n kernel.subscribe(() => {\n revision.value += 1;\n }),\n);\n\nprovideViewer({\n kernel,\n track: () => {\n void revision.value;\n },\n});\n</script>\n\n<template>\n <slot />\n</template>\n","<!--\n <DocumentGate>: renders its content only while this subtree has a ready\n document, the structural way to say \"this UI is defined over a document\".\n Workspace UI (toolbars, commands) lives outside it; document UI (the Stage,\n panels) inside. A document that waits for its password, or failed, renders\n the `#locked` or `#error` slot with it, or else `#fallback`. It decides\n whether; <DocumentScope> decides which document.\n-->\n<script setup lang=\"ts\">\nimport type { DocumentInfo, FailedDocumentInfo, LockedDocumentInfo } from '@embedpdf/core';\nimport { useDocument } from './documents';\n\ndefineSlots<{\n /** Rendered while the document is ready. */\n default?(): unknown;\n /** Shown while this subtree has no document: none is open, or it's still opening. */\n fallback?(): unknown;\n /** Shown while the document waits for its password; `#fallback` without it. */\n locked?(props: { document: LockedDocumentInfo }): unknown;\n /** Shown when the document couldn't be opened, with why; `#fallback` without it. */\n error?(props: { document: FailedDocumentInfo }): unknown;\n}>();\n\nconst current = useDocument((document: DocumentInfo) => document);\n</script>\n\n<template>\n <slot v-if=\"current.status === 'ready'\" />\n <slot\n v-else-if=\"current.status === 'locked' && $slots.locked\"\n name=\"locked\"\n :document=\"current as LockedDocumentInfo\"\n />\n <slot\n v-else-if=\"current.status === 'error' && $slots.error\"\n name=\"error\"\n :document=\"current as FailedDocumentInfo\"\n />\n <slot v-else name=\"fallback\" />\n</template>\n","<!--\n <DocumentScope :id>: binds its content to one document, for panes and\n comparisons. The composables inside talk to that document instead of the\n active one, and `useDocuments()` calls without an id use it.\n-->\n<script setup lang=\"ts\">\nimport { provideDocumentScope } from './kernel';\n\nconst props = defineProps<{\n /** The document's id. */\n id: string;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nprovideDocumentScope(() => props.id);\n</script>\n\n<template>\n <slot />\n</template>\n"],"names":["epdfThemeVariables","viewerSettingsOf","toRaw","shallowRef","provideViewer","watch","devWarn","onMounted","isLocalEngine","createKernel","browserClock","browserPrinter","onUnmounted","computed","_renderSlot","_createElementBlock","_Fragment","onScopeDispose","useDocument","_unref","$slots","provideDocumentScope"],"mappings":";;;;;;;AAcO,SAAS,UAAU,OAAiC;AACzD,SAAOA,IAAAA,mBAAmB,KAAK;AACjC;;;;;;;;;;;;;;ACQA,UAAM,QAAQ;AA+Bd,UAAM,OAAO;AAuBb,UAAM,aAAa,MACjBC,sBAAiB;AAAA,MACf,UAAUC,IAAAA,MAAM,MAAM,QAAQ;AAAA,MAC9B,OAAOA,IAAAA,MAAM,MAAM,KAAK;AAAA,MACxB,QAAQ,MAAM;AAAA,MACd,MAAMA,IAAAA,MAAM,MAAM,IAAI;AAAA,IAAA,CACvB;AAEH,UAAM,SAASC,IAAAA,WAA0B,IAAI;AAC7C,UAAM,QAAQA,IAAAA,WAA0C,SAAS;AACjE,UAAM,YAAYA,IAAAA,WAAoB,IAAI;AAE1C,UAAM,WAAWA,IAAAA,WAAW,CAAC;AAE7BC,+BAAc;AAAA,MACZ,IAAI,SAAS;AACX,eAAO,OAAO;AAAA,MAChB;AAAA,MACA,OAAO,MAAM;AACX,aAAK,SAAS;AAAA,MAChB;AAAA,IAAA,CACD;AAKD,UAAM,UAAU;AAAA,MACd,QAAQF,IAAAA,MAAM,MAAM,MAAM;AAAA,MAC1B,SAASA,IAAAA,MAAM,MAAM,OAAO;AAAA,MAC5B,kBAAkBA,IAAAA,MAAM,MAAM,gBAAgB;AAAA,IAAA;AAEhDG,QAAAA;AAAAA,MACE,MAAM,MAAM;AAAA,MACZ,MACEC,IAAAA;AAAAA,QACE;AAAA,QACA;AAAA,MAAA;AAAA,IAEF;AAEJD,QAAAA;AAAAA,MACE,MAAM,MAAM;AAAA,MACZ,CAAC,WAAW;AAGV,YAAI,OAAO,WAAW,WAAY;AAClCC,Y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