@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,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const core = require("@embedpdf/core");
|
|
4
|
+
const host = require("@embedpdf/plugin-selection/contract/host");
|
|
5
|
+
const web = require("@embedpdf/web");
|
|
6
|
+
const capabilities = require("./capabilities-DVNJmgy7.cjs");
|
|
7
|
+
const documents = require("./documents-TQ1fMdWI.cjs");
|
|
8
|
+
const page = require("./page-Doy4_Sdz.cjs");
|
|
9
|
+
const pluginSelection = require("@embedpdf/plugin-selection");
|
|
10
|
+
const Anchored_vue_vue_type_script_setup_true_lang = require("./Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs");
|
|
11
|
+
const projector = require("./projector-Cf7879sx.cjs");
|
|
12
|
+
const dev = require("./dev-eeIS2B4c.cjs");
|
|
13
|
+
const scope = require("./scope-BQA4toWB.cjs");
|
|
14
|
+
const state = require("./state-M22NDJQo.cjs");
|
|
15
|
+
function useSelection() {
|
|
16
|
+
return capabilities.useCapability(pluginSelection.SelectionToken);
|
|
17
|
+
}
|
|
18
|
+
function useSelectionEvent(select, handler) {
|
|
19
|
+
capabilities.useCapabilityEvent(pluginSelection.SelectionToken, select, handler);
|
|
20
|
+
}
|
|
21
|
+
const useSelectionState = state.stateComposable(pluginSelection.selectionState);
|
|
22
|
+
const useSelectionSettings = state.settingsComposable(pluginSelection.SelectionToken);
|
|
23
|
+
const _hoisted_1 = {
|
|
24
|
+
key: 0,
|
|
25
|
+
style: {
|
|
26
|
+
position: "absolute",
|
|
27
|
+
inset: 0,
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
overflow: "visible",
|
|
31
|
+
pointerEvents: "none"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const _hoisted_2 = ["points"];
|
|
35
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
36
|
+
__name: "SelectionLayer",
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const NO_SEGMENTS = Object.freeze([]);
|
|
39
|
+
const page$1 = page.usePage();
|
|
40
|
+
const selection = capabilities.useOptionalCapability(host.SelectionToken);
|
|
41
|
+
const segments = capabilities.useOptionalSelector(
|
|
42
|
+
host.SelectionToken,
|
|
43
|
+
(lens) => lens.listSegments(page$1.value.ref),
|
|
44
|
+
NO_SEGMENTS,
|
|
45
|
+
core.shallowEqual
|
|
46
|
+
);
|
|
47
|
+
const visible = capabilities.useOptionalSelector(host.SelectionToken, (lens) => lens.isHighlightVisible(), false);
|
|
48
|
+
const color = useSelectionSettings((settings) => settings.color);
|
|
49
|
+
const accent = documents.useViewerSettings((settings) => settings.accent);
|
|
50
|
+
vue.watch(
|
|
51
|
+
[selection, () => page$1.value.ref],
|
|
52
|
+
([lens, pageRef]) => {
|
|
53
|
+
if (lens) void lens.ensureLoaded(pageRef);
|
|
54
|
+
},
|
|
55
|
+
{ immediate: true }
|
|
56
|
+
);
|
|
57
|
+
const fill = vue.computed(
|
|
58
|
+
() => web.paint("text-selection", color.value ?? web.mixAccent("text-selection", accent.value))
|
|
59
|
+
);
|
|
60
|
+
const polygons = vue.computed(
|
|
61
|
+
() => segments.value.map((segment) => web.svgPoints(web.quadInPixels(segment.quad, page$1.value.transform)))
|
|
62
|
+
);
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return vue.unref(visible) ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1, [
|
|
65
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(polygons.value, (points, index) => {
|
|
66
|
+
return vue.openBlock(), vue.createElementBlock("polygon", {
|
|
67
|
+
key: index,
|
|
68
|
+
points,
|
|
69
|
+
style: vue.normalizeStyle({ fill: fill.value })
|
|
70
|
+
}, null, 12, _hoisted_2);
|
|
71
|
+
}), 128))
|
|
72
|
+
])) : vue.createCommentVNode("", true);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
77
|
+
__name: "SelectionMenu",
|
|
78
|
+
props: {
|
|
79
|
+
gap: { default: 8 },
|
|
80
|
+
placement: { default: "top" }
|
|
81
|
+
},
|
|
82
|
+
setup(__props) {
|
|
83
|
+
const selecting = useSelectionState((state2) => state2.isSelecting);
|
|
84
|
+
const anchor = capabilities.useOptionalSelector(
|
|
85
|
+
pluginSelection.SelectionToken,
|
|
86
|
+
(selection) => selection.getAnchor(),
|
|
87
|
+
null,
|
|
88
|
+
web.samePageBounds
|
|
89
|
+
);
|
|
90
|
+
return (_ctx, _cache) => {
|
|
91
|
+
return !vue.unref(selecting) && vue.unref(anchor) ? (vue.openBlock(), vue.createBlock(Anchored_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
92
|
+
key: 0,
|
|
93
|
+
anchor: vue.unref(anchor),
|
|
94
|
+
placement: __props.placement,
|
|
95
|
+
gap: __props.gap
|
|
96
|
+
}, {
|
|
97
|
+
default: vue.withCtx(() => [
|
|
98
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
99
|
+
]),
|
|
100
|
+
_: 3
|
|
101
|
+
}, 8, ["anchor", "placement", "gap"])) : vue.createCommentVNode("", true);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
106
|
+
__name: "SelectionHandles",
|
|
107
|
+
props: {
|
|
108
|
+
token: {}
|
|
109
|
+
},
|
|
110
|
+
setup(__props) {
|
|
111
|
+
const props = __props;
|
|
112
|
+
const token = scope.useStageToken(() => props.token);
|
|
113
|
+
const host$1 = capabilities.useCapability(host.SelectionToken);
|
|
114
|
+
const stage = capabilities.useOptionalCapability(token);
|
|
115
|
+
const surface = projector.useOptionalProjectorBinding();
|
|
116
|
+
if (!surface || surface.value.projector.space !== "overlay") {
|
|
117
|
+
dev.devWarn(
|
|
118
|
+
"selection-handles-outside-stage",
|
|
119
|
+
"<SelectionHandles> renders nothing here: mount it in the <Stage> #overlay slot (a <PageView> has no camera to project the handles through)."
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
const selecting = useSelectionState((state2) => state2.isSelecting);
|
|
123
|
+
const visible = capabilities.useOptionalSelector(host.SelectionToken, (lens) => lens.isHighlightVisible(), false);
|
|
124
|
+
const handles = useSelectionSettings((settings) => settings.handles);
|
|
125
|
+
const accent = documents.useViewerSettings((settings) => settings.accent);
|
|
126
|
+
const endpoints = capabilities.useOptionalSelector(
|
|
127
|
+
host.SelectionToken,
|
|
128
|
+
(lens) => pluginSelection.selectionHandleEndpointsOf(lens.getSnapshot()),
|
|
129
|
+
null,
|
|
130
|
+
web.sameSelectionEndpoints
|
|
131
|
+
);
|
|
132
|
+
const camera = capabilities.useKernelValue(() => {
|
|
133
|
+
var _a;
|
|
134
|
+
return ((_a = stage.value) == null ? void 0 : _a.listVisiblePages()) ?? null;
|
|
135
|
+
});
|
|
136
|
+
const dragging = vue.ref(null);
|
|
137
|
+
const geometry = vue.computed(() => {
|
|
138
|
+
void camera.value;
|
|
139
|
+
const lens = stage.value;
|
|
140
|
+
const ends = endpoints.value;
|
|
141
|
+
if (!lens || !ends) return null;
|
|
142
|
+
const view = pluginSelection.selectionHandleViewOf(lens);
|
|
143
|
+
return {
|
|
144
|
+
start: pluginSelection.selectionHandleGeom(view, ends.start, "start"),
|
|
145
|
+
end: pluginSelection.selectionHandleGeom(view, ends.end, "end")
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
const shown = vue.computed(
|
|
149
|
+
() => geometry.value !== null && visible.value && (!selecting.value || dragging.value !== null)
|
|
150
|
+
);
|
|
151
|
+
const color = vue.computed(() => web.paint("text-selection-handle", handles.value.color ?? accent.value));
|
|
152
|
+
const shadow = vue.computed(() => web.paint("text-selection-handle-shadow", handles.value.shadow));
|
|
153
|
+
function gripStyles(role) {
|
|
154
|
+
var _a;
|
|
155
|
+
const grip = (_a = geometry.value) == null ? void 0 : _a[role];
|
|
156
|
+
if (!grip) return null;
|
|
157
|
+
const barTop = pluginSelection.HANDLE_PAD + (role === "start" ? pluginSelection.HANDLE_HEAD : 0);
|
|
158
|
+
const pivotX = pluginSelection.HANDLE_PAD + pluginSelection.HANDLE_BAR / 2;
|
|
159
|
+
return {
|
|
160
|
+
grip: {
|
|
161
|
+
position: "absolute",
|
|
162
|
+
left: `${grip.bar.from.x - pivotX}px`,
|
|
163
|
+
top: `${grip.bar.from.y - barTop}px`,
|
|
164
|
+
width: `${pluginSelection.HANDLE_BAR + 2 * pluginSelection.HANDLE_PAD}px`,
|
|
165
|
+
height: `${grip.length + pluginSelection.HANDLE_HEAD + 2 * pluginSelection.HANDLE_PAD}px`,
|
|
166
|
+
// Upright text carries no transform: pixel-identical to an axis-aligned box.
|
|
167
|
+
...grip.upright ? {} : { transform: `rotate(${grip.rotation}deg)`, transformOrigin: `${pivotX}px ${barTop}px` },
|
|
168
|
+
touchAction: "none",
|
|
169
|
+
cursor: "grab",
|
|
170
|
+
pointerEvents: "auto"
|
|
171
|
+
},
|
|
172
|
+
// The caret bar: the selection's own edge, the glyph's ink height at any tilt.
|
|
173
|
+
bar: {
|
|
174
|
+
position: "absolute",
|
|
175
|
+
left: `${pluginSelection.HANDLE_PAD}px`,
|
|
176
|
+
top: `${barTop}px`,
|
|
177
|
+
width: `${pluginSelection.HANDLE_BAR}px`,
|
|
178
|
+
height: `${grip.length}px`,
|
|
179
|
+
background: color.value,
|
|
180
|
+
borderRadius: `${pluginSelection.HANDLE_BAR / 2}px`
|
|
181
|
+
},
|
|
182
|
+
// The head, flush against the bar: past the ascent at the start, past the
|
|
183
|
+
// baseline at the end, in the text's frame.
|
|
184
|
+
head: {
|
|
185
|
+
position: "absolute",
|
|
186
|
+
left: `${pivotX - pluginSelection.HANDLE_HEAD / 2}px`,
|
|
187
|
+
top: `${role === "start" ? pluginSelection.HANDLE_PAD : pluginSelection.HANDLE_PAD + grip.length}px`,
|
|
188
|
+
width: `${pluginSelection.HANDLE_HEAD}px`,
|
|
189
|
+
height: `${pluginSelection.HANDLE_HEAD}px`,
|
|
190
|
+
borderRadius: "50%",
|
|
191
|
+
background: color.value,
|
|
192
|
+
boxShadow: shadow.value
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const startStyles = vue.computed(() => gripStyles("start"));
|
|
197
|
+
const endStyles = vue.computed(() => gripStyles("end"));
|
|
198
|
+
function arm(role) {
|
|
199
|
+
const lens = stage.value;
|
|
200
|
+
const ends = endpoints.value;
|
|
201
|
+
if (!lens || !ends) return null;
|
|
202
|
+
const armed = pluginSelection.armSelectionHandle(host$1, pluginSelection.selectionHandleViewOf(lens), ends, role);
|
|
203
|
+
if (!armed) return null;
|
|
204
|
+
dragging.value = role;
|
|
205
|
+
return {
|
|
206
|
+
// The point the user grabbed: the bar's midpoint.
|
|
207
|
+
base: armed.base,
|
|
208
|
+
session: {
|
|
209
|
+
move: armed.drag.move,
|
|
210
|
+
end: () => {
|
|
211
|
+
armed.drag.end();
|
|
212
|
+
dragging.value = null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const startGrip = vue.ref(null);
|
|
218
|
+
const endGrip = vue.ref(null);
|
|
219
|
+
for (const [role, element] of [
|
|
220
|
+
["start", startGrip],
|
|
221
|
+
["end", endGrip]
|
|
222
|
+
]) {
|
|
223
|
+
vue.watch(
|
|
224
|
+
element,
|
|
225
|
+
(grip, _previous, onCleanup) => {
|
|
226
|
+
if (grip) onCleanup(web.attachSelectionHandle(grip, { arm: () => arm(role) }));
|
|
227
|
+
},
|
|
228
|
+
{ flush: "post" }
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
return (_ctx, _cache) => {
|
|
232
|
+
return shown.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
233
|
+
startStyles.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
234
|
+
key: 0,
|
|
235
|
+
ref_key: "startGrip",
|
|
236
|
+
ref: startGrip,
|
|
237
|
+
style: vue.normalizeStyle(startStyles.value.grip)
|
|
238
|
+
}, [
|
|
239
|
+
vue.createElementVNode("div", {
|
|
240
|
+
style: vue.normalizeStyle(startStyles.value.bar)
|
|
241
|
+
}, null, 4),
|
|
242
|
+
vue.createElementVNode("div", {
|
|
243
|
+
style: vue.normalizeStyle(startStyles.value.head)
|
|
244
|
+
}, null, 4)
|
|
245
|
+
], 4)) : vue.createCommentVNode("", true),
|
|
246
|
+
endStyles.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
247
|
+
key: 1,
|
|
248
|
+
ref_key: "endGrip",
|
|
249
|
+
ref: endGrip,
|
|
250
|
+
style: vue.normalizeStyle(endStyles.value.grip)
|
|
251
|
+
}, [
|
|
252
|
+
vue.createElementVNode("div", {
|
|
253
|
+
style: vue.normalizeStyle(endStyles.value.bar)
|
|
254
|
+
}, null, 4),
|
|
255
|
+
vue.createElementVNode("div", {
|
|
256
|
+
style: vue.normalizeStyle(endStyles.value.head)
|
|
257
|
+
}, null, 4)
|
|
258
|
+
], 4)) : vue.createCommentVNode("", true)
|
|
259
|
+
], 64)) : vue.createCommentVNode("", true);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
264
|
+
__name: "SelectionClipboard",
|
|
265
|
+
props: {
|
|
266
|
+
prefetch: { type: Boolean, default: true },
|
|
267
|
+
target: {}
|
|
268
|
+
},
|
|
269
|
+
emits: ["refused"],
|
|
270
|
+
setup(__props, { emit: __emit }) {
|
|
271
|
+
const props = __props;
|
|
272
|
+
const emit = __emit;
|
|
273
|
+
const selection = capabilities.useOptionalCapability(pluginSelection.SelectionToken);
|
|
274
|
+
vue.watch(
|
|
275
|
+
[selection, () => props.prefetch, () => vue.toValue(props.target)],
|
|
276
|
+
([lens, prefetch, target], _previous, onCleanup) => {
|
|
277
|
+
if (!lens || props.target !== void 0 && !target) return;
|
|
278
|
+
onCleanup(
|
|
279
|
+
web.wireSelectionClipboard(lens, {
|
|
280
|
+
prefetch,
|
|
281
|
+
target: target ?? void 0,
|
|
282
|
+
onRefused: () => emit("refused")
|
|
283
|
+
})
|
|
284
|
+
);
|
|
285
|
+
},
|
|
286
|
+
{ immediate: true, flush: "post" }
|
|
287
|
+
);
|
|
288
|
+
return (_ctx, _cache) => {
|
|
289
|
+
return null;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
exports._sfc_main = _sfc_main;
|
|
294
|
+
exports._sfc_main$1 = _sfc_main$1;
|
|
295
|
+
exports._sfc_main$2 = _sfc_main$3;
|
|
296
|
+
exports._sfc_main$3 = _sfc_main$2;
|
|
297
|
+
exports.useSelection = useSelection;
|
|
298
|
+
exports.useSelectionEvent = useSelectionEvent;
|
|
299
|
+
exports.useSelectionSettings = useSelectionSettings;
|
|
300
|
+
exports.useSelectionState = useSelectionState;
|
|
301
|
+
//# sourceMappingURL=SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs","sources":["../src/selection/composables.ts","../src/selection/SelectionLayer.vue","../src/selection/SelectionMenu.vue","../src/selection/SelectionHandles.vue","../src/selection/SelectionClipboard.vue"],"sourcesContent":["/**\n * The selection composables: `useSelection()` (the API), `useSelectionState()`,\n * `useSelectionSettings()` and `useSelectionEvent()`. App code gets the public\n * lens only; the layers in this folder resolve the host lens themselves.\n */\nimport { SelectionToken, selectionState } from '@embedpdf/plugin-selection';\nimport type { SelectionCapability } from '@embedpdf/plugin-selection';\nimport type { EventHook } from '@embedpdf/core';\nimport { useCapability, useCapabilityEvent } from '../runtime/capabilities';\nimport { settingsComposable, stateComposable } from '../state';\n\n/**\n * The selection API (`select()`, `readText()`, `canCopy()`, …) for your\n * chrome: toolbars, context menus, automation. The object never changes.\n */\nexport function useSelection(): SelectionCapability {\n return useCapability(SelectionToken);\n}\n\n/** Subscribe to one selection event while the component lives: `useSelectionEvent((selection) => selection.onCommitted, handler)`. */\nexport function useSelectionEvent<Event>(\n select: (selection: SelectionCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(SelectionToken, select, handler);\n}\n\n/**\n * The selection's state as refs: whether anything is selected, whether the\n * user is still selecting, the range and the pages it's on (the page's State\n * table, declared once in `selectionState`). With a selector, one ref that\n * updates only when the value it picks changes. The empty state without a\n * document.\n */\nexport const useSelectionState = stateComposable(selectionState);\n\n/** The selection settings (`dragThreshold`, `color`, `handles`), with or without a document, as refs. Takes a selector. */\nexport const useSelectionSettings = settingsComposable(SelectionToken);\n","<!--\n <SelectionLayer>: the highlight of the selected text on one page. It warms\n the page's text geometry when it mounts, reads the selected lines in page\n space and maps each one's four corners to the page's pixels, in the plugin's\n `color` setting, which the `--epdf-text-selection` CSS variable overrides.\n It handles no pointer input: <PagePointerSource> and the interaction hub do.\n-->\n<script setup lang=\"ts\">\nimport { computed, watch } from 'vue';\nimport { shallowEqual } from '@embedpdf/core';\n// The layer is a host of the plugin (geometry warming, the highlight\n// handshake); app code gets the public lens through `useSelection()`.\nimport { SelectionToken as SelectionHostToken } from '@embedpdf/plugin-selection/contract/host';\nimport type { SelectionSegment } from '@embedpdf/plugin-selection';\nimport { mixAccent, paint, quadInPixels, svgPoints } from '@embedpdf/web';\nimport { useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { useViewerSettings } from '../runtime/documents';\nimport { usePage } from '../runtime/page';\nimport { useSelectionSettings } from './composables';\n\nconst NO_SEGMENTS: readonly SelectionSegment[] = Object.freeze([]);\n\nconst page = usePage();\nconst selection = useOptionalCapability(SelectionHostToken);\n// The same list until a line on this page changes.\nconst segments = useOptionalSelector(\n SelectionHostToken,\n (lens) => lens.listSegments(page.value.ref),\n NO_SEGMENTS,\n shallowEqual,\n);\n// Something drawing its own preview of the selection (a markup tool) can take\n// the visual over; then this layer draws nothing, so the two never overlap.\nconst visible = useOptionalSelector(SelectionHostToken, (lens) => lens.isHighlightVisible(), false);\nconst color = useSelectionSettings((settings) => settings.color);\n// An unset color follows the viewer's accent, behind the `--epdf-accent` variable.\nconst accent = useViewerSettings((settings) => settings.accent);\n\n// Warm this page's text geometry as soon as it's on screen, so the first press\n// can hit-test without waiting for the engine. Without permission to select\n// text nothing loads, and nothing is drawn.\nwatch(\n [selection, () => page.value.ref],\n ([lens, pageRef]) => {\n if (lens) void lens.ensureLoaded(pageRef);\n },\n { immediate: true },\n);\n\n// Unset, the color is the accent at 35%, the accent's CSS variables included.\nconst fill = computed(() =>\n paint('text-selection', color.value ?? mixAccent('text-selection', accent.value)),\n);\n\n// Page space to the page layer's pixels, which turn with the page: mapping the\n// four corners is exact, for turned text too.\nconst polygons = computed(() =>\n segments.value.map((segment) => svgPoints(quadInPixels(segment.quad, page.value.transform))),\n);\n</script>\n\n<template>\n <svg\n v-if=\"visible\"\n :style=\"{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n overflow: 'visible',\n pointerEvents: 'none',\n }\"\n >\n <!-- The fill goes in `style`: an SVG attribute doesn't read var(). -->\n <polygon v-for=\"(points, index) in polygons\" :key=\"index\" :points=\"points\" :style=\"{ fill }\" />\n </svg>\n</template>\n","<!--\n <SelectionMenu>: your content, floating over the selected text. One anchor\n however many pages the selection spans: it sits on the page where the\n selection ends. It shows once the selection settles: hidden while someone\n drags, it appears when the pointer lifts, and a selection made from code\n shows at once. It works in a <Stage>'s #overlay slot and inside a\n <PageView>: the surface provides the projection. For UI that follows the\n drag live, put `<Anchored :anchor>` with `getAnchor()` together yourself.\n-->\n<script setup lang=\"ts\">\nimport { SelectionToken } from '@embedpdf/plugin-selection';\nimport { samePageBounds } from '@embedpdf/web';\nimport type { AnchoredPlacement } from '@embedpdf/web';\nimport Anchored from '../anchored/Anchored.vue';\nimport { useOptionalSelector } from '../runtime/capabilities';\nimport { useSelectionState } from './composables';\n\nwithDefaults(\n defineProps<{\n /** Gap in screen px between the selection and the menu. Default 8. */\n gap?: number;\n /** Where the menu sits around the selection. Default `'top'`. */\n placement?: AnchoredPlacement;\n }>(),\n { gap: 8, placement: 'top' },\n);\n\ndefineSlots<{\n /** The menu: compose it from `useSelection()`, `copySelection`, an annotation call. */\n default?(): unknown;\n}>();\n\nconst selecting = useSelectionState((state) => state.isSelecting);\n// The plugin reads a new anchor object every time: compared by value, so the\n// menu moves only when the selection did.\nconst anchor = useOptionalSelector(\n SelectionToken,\n (selection) => selection.getAnchor(),\n null,\n samePageBounds,\n);\n</script>\n\n<template>\n <Anchored v-if=\"!selecting && anchor\" :anchor=\"anchor\" :placement=\"placement\" :gap=\"gap\">\n <slot />\n </Anchored>\n</template>\n","<!--\n <SelectionHandles>: the grips at the two ends of the selected text, drawn the\n way phones draw them: a thin caret bar that is the selection's own start or\n end edge (so turned text and turned pages carry the grip with them), capped\n by a circle that keeps its size on screen, above the first line at the start\n and below the last line at the end.\n\n On touch, where nobody drags a caret, the grips are how a selection grows or\n shrinks: a long press selects a word, then each grip extends from the other\n end, snapping to glyphs and crossing pages exactly like a pointer drag, so\n highlights, menus and the commit event all behave the same. Mount it in the\n <Stage>'s #overlay slot next to <SelectionMenu>; elsewhere it draws nothing\n (a <PageView> has no camera to project through). Grabbing a grip never pans\n the Stage. Painted in the plugin's `handles` setting, which the\n `--epdf-text-selection-handle` and `--epdf-text-selection-handle-shadow` CSS\n variables override.\n\n What it draws is the plugin's (the view over the Stage, the endpoints,\n `selectionHandleGeom`, the armed drag) and how a grip follows the pointer is\n `@embedpdf/web`'s (`attachSelectionHandle`);\n this component keeps what only Vue does: the subscriptions and the markup.\n-->\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport {\n HANDLE_BAR,\n HANDLE_HEAD,\n HANDLE_PAD,\n armSelectionHandle,\n selectionHandleEndpointsOf,\n selectionHandleGeom,\n selectionHandleViewOf,\n} from '@embedpdf/plugin-selection';\nimport { SelectionToken as SelectionHostToken } from '@embedpdf/plugin-selection/contract/host';\nimport { attachSelectionHandle, paint, sameSelectionEndpoints } from '@embedpdf/web';\nimport { useOptionalProjectorBinding } from '../anchored/projector';\nimport { devWarn } from '../dev';\nimport { useCapability, useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { useViewerSettings } from '../runtime/documents';\nimport { useKernelValue } from '../runtime/kernel';\nimport { useStageToken } from '../stage/scope';\nimport type { StageTokenProp } from '../stage/scope';\nimport { useSelectionSettings, useSelectionState } from './composables';\n\ntype Role = 'start' | 'end';\n\nconst props = defineProps<{\n /** The stage view this overlay belongs to. Default: the enclosing `<Stage>`'s. */\n token?: StageTokenProp;\n}>();\n\nconst token = useStageToken(() => props.token);\nconst host = useCapability(SelectionHostToken);\nconst stage = useOptionalCapability(token);\n\n// Outside a Stage there is no camera to project through: say so, rather than\n// drawing nothing without a word.\nconst surface = useOptionalProjectorBinding();\nif (!surface || surface.value.projector.space !== 'overlay') {\n devWarn(\n 'selection-handles-outside-stage',\n '<SelectionHandles> renders nothing here: mount it in the <Stage> #overlay slot ' +\n '(a <PageView> has no camera to project the handles through).',\n );\n}\n\nconst selecting = useSelectionState((state) => state.isSelecting);\nconst visible = useOptionalSelector(SelectionHostToken, (lens) => lens.isHighlightVisible(), false);\nconst handles = useSelectionSettings((settings) => settings.handles);\nconst accent = useViewerSettings((settings) => settings.accent);\nconst endpoints = useOptionalSelector(\n SelectionHostToken,\n (lens) => selectionHandleEndpointsOf(lens.getSnapshot()),\n null,\n sameSelectionEndpoints,\n);\n// The grips are placed by projecting the endpoints through the camera, so they\n// follow every camera move. The visible pages are the stage's one value for\n// that (the pages move on it too, so grip and highlight move in one frame).\nconst camera = useKernelValue(() => stage.value?.listVisiblePages() ?? null);\nconst dragging = ref<Role | null>(null);\n\n/** Where each grip goes, in the overlay's pixels; null for one whose page isn't laid out. */\nconst geometry = computed(() => {\n void camera.value;\n const lens = stage.value;\n const ends = endpoints.value;\n if (!lens || !ends) return null;\n const view = selectionHandleViewOf(lens);\n return {\n start: selectionHandleGeom(view, ends.start, 'start'),\n end: selectionHandleGeom(view, ends.end, 'end'),\n };\n});\n\n// Hidden while a pointer drag selects (like the menu), but a grip drag is a\n// selection gesture too, and keeps its grips.\nconst shown = computed(\n () => geometry.value !== null && visible.value && (!selecting.value || dragging.value !== null),\n);\n\n// Each is its CSS variable first, then the setting; an unset color is the accent.\nconst color = computed(() => paint('text-selection-handle', handles.value.color ?? accent.value));\nconst shadow = computed(() => paint('text-selection-handle-shadow', handles.value.shadow));\n\n/**\n * One grip's three boxes. The grip is laid out upright in its own frame (a bar\n * the edge's length, the head above it at the start, below it at the end),\n * then turned onto the projected edge about the bar's ascent tip, the one\n * point that must land exactly on the glyph's corner.\n */\nfunction gripStyles(role: Role): Record<'grip' | 'bar' | 'head', CSSProperties> | null {\n const grip = geometry.value?.[role];\n if (!grip) return null;\n const barTop = HANDLE_PAD + (role === 'start' ? HANDLE_HEAD : 0);\n const pivotX = HANDLE_PAD + HANDLE_BAR / 2;\n return {\n grip: {\n position: 'absolute',\n left: `${grip.bar.from.x - pivotX}px`,\n top: `${grip.bar.from.y - barTop}px`,\n width: `${HANDLE_BAR + 2 * HANDLE_PAD}px`,\n height: `${grip.length + HANDLE_HEAD + 2 * HANDLE_PAD}px`,\n // Upright text carries no transform: pixel-identical to an axis-aligned box.\n ...(grip.upright\n ? {}\n : { transform: `rotate(${grip.rotation}deg)`, transformOrigin: `${pivotX}px ${barTop}px` }),\n touchAction: 'none',\n cursor: 'grab',\n pointerEvents: 'auto',\n },\n // The caret bar: the selection's own edge, the glyph's ink height at any tilt.\n bar: {\n position: 'absolute',\n left: `${HANDLE_PAD}px`,\n top: `${barTop}px`,\n width: `${HANDLE_BAR}px`,\n height: `${grip.length}px`,\n background: color.value,\n borderRadius: `${HANDLE_BAR / 2}px`,\n },\n // The head, flush against the bar: past the ascent at the start, past the\n // baseline at the end, in the text's frame.\n head: {\n position: 'absolute',\n left: `${pivotX - HANDLE_HEAD / 2}px`,\n top: `${role === 'start' ? HANDLE_PAD : HANDLE_PAD + grip.length}px`,\n width: `${HANDLE_HEAD}px`,\n height: `${HANDLE_HEAD}px`,\n borderRadius: '50%',\n background: color.value,\n boxShadow: shadow.value,\n },\n };\n}\n\nconst startStyles = computed(() => gripStyles('start'));\nconst endStyles = computed(() => gripStyles('end'));\n\n/**\n * Arm a grip drag at the press. It reads the stage and the endpoints as they\n * are now, never as they were when the listener was attached.\n */\nfunction arm(role: Role) {\n const lens = stage.value;\n const ends = endpoints.value;\n if (!lens || !ends) return null;\n const armed = armSelectionHandle(host, selectionHandleViewOf(lens), ends, role);\n if (!armed) return null;\n dragging.value = role;\n return {\n // The point the user grabbed: the bar's midpoint.\n base: armed.base,\n session: {\n move: armed.drag.move,\n end: () => {\n armed.drag.end(); // the selection settles: the menu comes back, the commit event fires\n dragging.value = null;\n },\n },\n };\n}\n\nconst startGrip = ref<HTMLDivElement | null>(null);\nconst endGrip = ref<HTMLDivElement | null>(null);\n// The press is taken with a native listener on the grip itself, so the Stage\n// never sees it; a grip that remounts is bound again.\nfor (const [role, element] of [\n ['start', startGrip],\n ['end', endGrip],\n] as const) {\n watch(\n element,\n (grip, _previous, onCleanup) => {\n if (grip) onCleanup(attachSelectionHandle(grip, { arm: () => arm(role) }));\n },\n { flush: 'post' },\n );\n}\n</script>\n\n<template>\n <template v-if=\"shown\">\n <div v-if=\"startStyles\" ref=\"startGrip\" :style=\"startStyles.grip\">\n <div :style=\"startStyles.bar\" />\n <div :style=\"startStyles.head\" />\n </div>\n <div v-if=\"endStyles\" ref=\"endGrip\" :style=\"endStyles.grip\">\n <div :style=\"endStyles.bar\" />\n <div :style=\"endStyles.head\" />\n </div>\n </template>\n</template>\n","<!--\n <SelectionClipboard>: mount once per viewer to wire copying the selected\n text. It fetches the text when the selection settles, answers the browser's\n `copy` event at once, and falls back to the Clipboard API for Ctrl+C / Cmd+C\n when the page has no selection of its own. A selection the user may not\n copy isn't copied, and it emits `refused`. It draws nothing, and wires\n nothing until a document is ready. For a Copy button, call\n `copySelection(useSelection())` from its click handler instead.\n-->\n<script setup lang=\"ts\">\nimport { toValue, watch, type MaybeRefOrGetter } from 'vue';\nimport { SelectionToken } from '@embedpdf/plugin-selection';\nimport { wireSelectionClipboard } from '@embedpdf/web';\nimport { useOptionalCapability } from '../runtime/capabilities';\n\n// A boolean prop left out is `false` in Vue: the default says `true` itself.\nconst props = withDefaults(\n defineProps<{\n /**\n * Fetch the selected text as soon as the selection settles (default true).\n * The browser's `copy` event must be answered at once, so without it only\n * Ctrl+C / Cmd+C copies, a moment later.\n */\n prefetch?: boolean;\n /**\n * Copy only while focus is inside this element (a template ref), for a\n * page with more than one viewer. Copying works once it has mounted.\n * Default: anywhere on the page.\n */\n target?: MaybeRefOrGetter<HTMLElement | null | undefined>;\n }>(),\n { prefetch: true },\n);\nconst emit = defineEmits<{\n /** Ctrl+C or the Copy menu met a selection the user may not copy: say so. */\n refused: [];\n}>();\n\nconst selection = useOptionalCapability(SelectionToken);\n// Wired again for another document, or when `prefetch` or `target` changes.\nwatch(\n [selection, () => props.prefetch, () => toValue(props.target)],\n ([lens, prefetch, target], _previous, onCleanup) => {\n // A target that hasn't mounted yet wires nothing; its ref being set runs this again.\n if (!lens || (props.target !== undefined && !target)) return;\n onCleanup(\n wireSelectionClipboard(lens, {\n prefetch,\n target: target ?? undefined,\n onRefused: () => emit('refused'),\n }),\n );\n },\n { immediate: true, flush: 'post' },\n);\n</script>\n\n<template></template>\n"],"names":["useCapability","SelectionToken","useCapabilityEvent","stateComposable","selectionState","settingsComposable","page","usePage","useOptionalCapability","SelectionHostToken","useOptionalSelector","shallowEqual","useViewerSettings","watch","computed","paint","mixAccent","svgPoints","quadInPixels","_unref","_openBlock","_createElementBlock","_Fragment","_renderList","state","samePageBounds","_createBlock","Anchored","_renderSlot","useStageToken","host","useOptionalProjectorBinding","devWarn","selectionHandleEndpointsOf","sameSelectionEndpoints","useKernelValue","ref","selectionHandleViewOf","selectionHandleGeom","HANDLE_PAD","HANDLE_HEAD","HANDLE_BAR","armSelectionHandle","attachSelectionHandle","_normalizeStyle","_createElementVNode","toValue","wireSelectionClipboard"],"mappings":";;;;;;;;;;;;;;AAeO,SAAS,eAAoC;AAClD,SAAOA,aAAAA,cAAcC,gBAAAA,cAAc;AACrC;AAGO,SAAS,kBACd,QACA,SACM;AACNC,kCAAmBD,gBAA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uB,IAAAA,eAAE,UAAA,MAAU,IAAI;AAAA,QAAA;UACxDC,IAAAA,mBAA8B,OAAA;AAAA,YAAxB,OAAKD,IAAAA,eAAE,UAAA,MAAU,GAAG;AAAA,UAAA;UAC1BC,IAAAA,mBAA+B,OAAA;AAAA,YAAzB,OAAKD,IAAAA,eAAE,UAAA,MAAU,IAAI;AAAA,UAAA;;;;;;;;;;;;;;AClMjC,UAAM,QAAQ;AAiBd,UAAM,OAAO;AAKb,UAAM,YAAYpC,aAAAA,sBAAsBP,8BAAc;AAEtDY,QAAAA;AAAAA,MACE,CAAC,WAAW,MAAM,MAAM,UAAU,MAAMiC,YAAQ,MAAM,MAAM,CAAC;AAAA,MAC7D,CAAC,CAAC,MAAM,UAAU,MAAM,GAAG,WAAW,cAAc;AAElD,YAAI,CAAC,QAAS,MAAM,WAAW,UAAa,CAAC,OAAS;AACtD;AAAA,UACEC,IAAAA,uBAAuB,MAAM;AAAA,YAC3B;AAAA,YACA,QAAQ,UAAU;AAAA,YAClB,WAAW,MAAM,KAAK,SAAS;AAAA,UAAA,CAChC;AAAA,QAAA;AAAA,MAEL;AAAA,MACA,EAAE,WAAW,MAAM,OAAO,OAAA;AAAA,IAAO;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const web = require("@embedpdf/web");
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
5
|
+
__name: "SvgShapes",
|
|
6
|
+
props: {
|
|
7
|
+
shapes: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
const mounts = web.createFontMounts();
|
|
12
|
+
vue.onUnmounted(() => mounts.release());
|
|
13
|
+
vue.watchEffect(
|
|
14
|
+
() => mounts.mount(props.shapes.flatMap((shape) => shape.program ? [shape.program] : []))
|
|
15
|
+
);
|
|
16
|
+
const blendOf = (blend) => blend ? { mixBlendMode: blend } : void 0;
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
const _component_SvgShapes = vue.resolveComponent("SvgShapes", true);
|
|
19
|
+
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.shapes, (shape, index) => {
|
|
20
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(shape.tag), vue.mergeProps({ key: index }, { ref_for: true }, shape.attributes, {
|
|
21
|
+
style: blendOf(shape.blend)
|
|
22
|
+
}), {
|
|
23
|
+
default: vue.withCtx(() => [
|
|
24
|
+
shape.children ? (vue.openBlock(), vue.createBlock(_component_SvgShapes, {
|
|
25
|
+
key: 0,
|
|
26
|
+
shapes: shape.children
|
|
27
|
+
}, null, 8, ["shapes"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
28
|
+
vue.createTextVNode(vue.toDisplayString(shape.text), 1)
|
|
29
|
+
], 64))
|
|
30
|
+
]),
|
|
31
|
+
_: 2
|
|
32
|
+
}, 1040, ["style"]);
|
|
33
|
+
}), 128);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports._sfc_main = _sfc_main;
|
|
38
|
+
//# sourceMappingURL=SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs","sources":["../src/runtime/SvgShapes.vue"],"sourcesContent":["<!--\n Scene shapes as SVG elements: `@embedpdf/web`'s element descriptions (`svgShapesOf`), one\n element each, a clipping `svg` with its children, and the faces their text draws in mounted\n while they show. The annotation and form layers draw their scenes through it, inside an `<svg>`\n (Vue takes the namespace from it).\n-->\n<script setup lang=\"ts\">\nimport { onUnmounted, watchEffect } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { createFontMounts, type SvgShape } from '@embedpdf/web';\n\nconst props = defineProps<{ shapes: readonly SvgShape[] }>();\n\n// The faces of this level's text: a clipping `svg` mounts its own children's.\nconst mounts = createFontMounts();\nonUnmounted(() => mounts.release());\nwatchEffect(() =>\n mounts.mount(props.shapes.flatMap((shape) => (shape.program ? [shape.program] : []))),\n);\n\n/** A shape's blend is CSS, never an attribute. */\nconst blendOf = (blend: string | undefined): CSSProperties | undefined =>\n blend ? { mixBlendMode: blend as CSSProperties['mixBlendMode'] } : undefined;\n</script>\n\n<template>\n <component\n :is=\"shape.tag\"\n v-for=\"(shape, index) in shapes\"\n :key=\"index\"\n v-bind=\"shape.attributes\"\n :style=\"blendOf(shape.blend)\"\n >\n <SvgShapes v-if=\"shape.children\" :shapes=\"shape.children\" />\n <template v-else>{{ shape.text }}</template>\n </component>\n</template>\n"],"names":["createFontMounts","onUnmounted","watchEffect","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_mergeProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;AAWA,UAAM,QAAQ;AAGd,UAAM,SAASA,IAAAA,iBAAA;AACfC,oBAAY,MAAM,OAAO,SAAS;AAClCC,QAAAA;AAAAA,MAAY,MACV,OAAO,MAAM,MAAM,OAAO,QAAQ,CAAC,UAAW,MAAM,UAAU,CAAC,MAAM,OAAO,IAAI,CAAA,CAAG,CAAC;AAAA,IAAA;AAItF,UAAM,UAAU,CAAC,UACf,QAAQ,EAAE,cAAc,UAA2C;;;AAInE,aAAAC,cAAA,IAAA,GAAAC,IAAAA,mBASYC,IAAAA,UAAA,MAAAC,IAAAA,WAPe,QAAA,QAAM,CAAvB,OAAO,UAAK;AAFtB,eAAAH,IAAAA,aAAAI,IAAAA,YASYC,IAAAA,wBARL,MAAM,GAAG,GADhBC,IAAAA,WASY,EANT,KAAK,SAAK,EAAA,SAAA,KAAA,GACH,MAAM,YAAU;AAAA,UACvB,OAAO,QAAQ,MAAM,KAAK;AAAA,QAAA;+BAE3B,MAA4D;AAAA,YAA3C,MAAM,6BAAvBF,IAAAA,YAA4D,sBAAA;AAAA;cAA1B,QAAQ,MAAM;AAAA,YAAA,6CAChDH,IAAAA,mBAA4CC,IAAAA,UAAA,EAAA,KAAA,KAAA;AAAA,cAAxBK,IAAAA,gBAAAC,IAAAA,gBAAA,MAAM,IAAI,GAAA,CAAA;AAAA,YAAA;;;;;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent, onUnmounted, watchEffect, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, resolveDynamicComponent, mergeProps, withCtx, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { createFontMounts } from "@embedpdf/web";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "SvgShapes",
|
|
5
|
+
props: {
|
|
6
|
+
shapes: {}
|
|
7
|
+
},
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const props = __props;
|
|
10
|
+
const mounts = createFontMounts();
|
|
11
|
+
onUnmounted(() => mounts.release());
|
|
12
|
+
watchEffect(
|
|
13
|
+
() => mounts.mount(props.shapes.flatMap((shape) => shape.program ? [shape.program] : []))
|
|
14
|
+
);
|
|
15
|
+
const blendOf = (blend) => blend ? { mixBlendMode: blend } : void 0;
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
const _component_SvgShapes = resolveComponent("SvgShapes", true);
|
|
18
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.shapes, (shape, index) => {
|
|
19
|
+
return openBlock(), createBlock(resolveDynamicComponent(shape.tag), mergeProps({ key: index }, { ref_for: true }, shape.attributes, {
|
|
20
|
+
style: blendOf(shape.blend)
|
|
21
|
+
}), {
|
|
22
|
+
default: withCtx(() => [
|
|
23
|
+
shape.children ? (openBlock(), createBlock(_component_SvgShapes, {
|
|
24
|
+
key: 0,
|
|
25
|
+
shapes: shape.children
|
|
26
|
+
}, null, 8, ["shapes"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
27
|
+
createTextVNode(toDisplayString(shape.text), 1)
|
|
28
|
+
], 64))
|
|
29
|
+
]),
|
|
30
|
+
_: 2
|
|
31
|
+
}, 1040, ["style"]);
|
|
32
|
+
}), 128);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
_sfc_main as _
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js","sources":["../src/runtime/SvgShapes.vue"],"sourcesContent":["<!--\n Scene shapes as SVG elements: `@embedpdf/web`'s element descriptions (`svgShapesOf`), one\n element each, a clipping `svg` with its children, and the faces their text draws in mounted\n while they show. The annotation and form layers draw their scenes through it, inside an `<svg>`\n (Vue takes the namespace from it).\n-->\n<script setup lang=\"ts\">\nimport { onUnmounted, watchEffect } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { createFontMounts, type SvgShape } from '@embedpdf/web';\n\nconst props = defineProps<{ shapes: readonly SvgShape[] }>();\n\n// The faces of this level's text: a clipping `svg` mounts its own children's.\nconst mounts = createFontMounts();\nonUnmounted(() => mounts.release());\nwatchEffect(() =>\n mounts.mount(props.shapes.flatMap((shape) => (shape.program ? [shape.program] : []))),\n);\n\n/** A shape's blend is CSS, never an attribute. */\nconst blendOf = (blend: string | undefined): CSSProperties | undefined =>\n blend ? { mixBlendMode: blend as CSSProperties['mixBlendMode'] } : undefined;\n</script>\n\n<template>\n <component\n :is=\"shape.tag\"\n v-for=\"(shape, index) in shapes\"\n :key=\"index\"\n v-bind=\"shape.attributes\"\n :style=\"blendOf(shape.blend)\"\n >\n <SvgShapes v-if=\"shape.children\" :shapes=\"shape.children\" />\n <template v-else>{{ shape.text }}</template>\n </component>\n</template>\n"],"names":["_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_mergeProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;AAWA,UAAM,QAAQ;AAGd,UAAM,SAAS,iBAAA;AACf,gBAAY,MAAM,OAAO,SAAS;AAClC;AAAA,MAAY,MACV,OAAO,MAAM,MAAM,OAAO,QAAQ,CAAC,UAAW,MAAM,UAAU,CAAC,MAAM,OAAO,IAAI,CAAA,CAAG,CAAC;AAAA,IAAA;AAItF,UAAM,UAAU,CAAC,UACf,QAAQ,EAAE,cAAc,UAA2C;;;AAInE,aAAAA,UAAA,IAAA,GAAAC,mBASYC,UAAA,MAAAC,WAPe,QAAA,QAAM,CAAvB,OAAO,UAAK;AAFtB,eAAAH,aAAAI,YASYC,wBARL,MAAM,GAAG,GADhBC,WASY,EANT,KAAK,SAAK,EAAA,SAAA,KAAA,GACH,MAAM,YAAU;AAAA,UACvB,OAAO,QAAQ,MAAM,KAAK;AAAA,QAAA;2BAE3B,MAA4D;AAAA,YAA3C,MAAM,yBAAvBF,YAA4D,sBAAA;AAAA;cAA1B,QAAQ,MAAM;AAAA,YAAA,yCAChDH,mBAA4CC,UAAA,EAAA,KAAA,KAAA;AAAA,cAAxBK,gBAAAC,gBAAA,MAAM,IAAI,GAAA,CAAA;AAAA,YAAA;;;;;;;;"}
|
package/dist/actions.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pluginActions = require("@embedpdf/plugin-actions");
|
|
4
|
+
const vue = require("vue");
|
|
5
|
+
const contract = require("@embedpdf/plugin-stage/contract");
|
|
6
|
+
const web = require("@embedpdf/web");
|
|
7
|
+
const capabilities = require("./capabilities-DVNJmgy7.cjs");
|
|
8
|
+
const state = require("./state-M22NDJQo.cjs");
|
|
9
|
+
function useActions() {
|
|
10
|
+
return capabilities.useCapability(pluginActions.ActionsToken);
|
|
11
|
+
}
|
|
12
|
+
const useActionsSettings = state.settingsComposable(pluginActions.ActionsToken);
|
|
13
|
+
function useActionsEvent(select, handler) {
|
|
14
|
+
capabilities.useCapabilityEvent(pluginActions.ActionsToken, select, handler);
|
|
15
|
+
}
|
|
16
|
+
function useActionsUiAdapter(handlers) {
|
|
17
|
+
const actions = capabilities.useOptionalCapability(pluginActions.ActionsToken);
|
|
18
|
+
const stage = capabilities.useOptionalCapability(contract.StageToken);
|
|
19
|
+
vue.watch(
|
|
20
|
+
[actions, stage],
|
|
21
|
+
([current, view], _previous, onCleanup) => {
|
|
22
|
+
if (!current) return;
|
|
23
|
+
const adapter = web.createDefaultActionsUiAdapter({
|
|
24
|
+
overrides: () => vue.toValue(handlers),
|
|
25
|
+
goToPage: (page) => view == null ? void 0 : view.goToPage(page)
|
|
26
|
+
});
|
|
27
|
+
onCleanup(current.setUiAdapter(adapter));
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true, flush: "sync" }
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
exports.useActions = useActions;
|
|
33
|
+
exports.useActionsEvent = useActionsEvent;
|
|
34
|
+
exports.useActionsSettings = useActionsSettings;
|
|
35
|
+
exports.useActionsUiAdapter = useActionsUiAdapter;
|
|
36
|
+
Object.keys(pluginActions).forEach((k) => {
|
|
37
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: () => pluginActions[k]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=actions.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.cjs","sources":["../src/actions.ts"],"sourcesContent":["/**\n * @embedpdf/vue/actions: the Vue view of `@embedpdf/plugin-actions`, the\n * action engine's UI port.\n *\n * The plugin has no DOM: opening a website, printing and showing an alert are\n * this layer's job. `useActionsUiAdapter()` installs the browser's defaults\n * (the same sanitizer and `window.open` the link layer uses; print is the\n * browser's dialog), and you can replace any of them. Without it, actions\n * routed to the adapter (a website, a print) report a `no-adapter` diagnostic\n * instead of running.\n */\n\n// One line per feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-actions';\nimport { toValue, watch } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { ActionsToken } from '@embedpdf/plugin-actions';\nimport type { ActionsCapability, ActionUiAdapter } from '@embedpdf/plugin-actions';\nimport { StageToken } from '@embedpdf/plugin-stage/contract';\nimport type { EventHook } from '@embedpdf/core';\nimport { createDefaultActionsUiAdapter } from '@embedpdf/web';\nimport { useCapability, useCapabilityEvent, useOptionalCapability } from './runtime/capabilities';\nimport { settingsComposable } from './state';\n\n/**\n * The actions API (`execute`, `executeNamed`, `dispatch`, the settings) of the\n * nearest `<DocumentScope>`'s document, else the active one. The object never\n * changes; outside a document the settings calls work and every other method\n * throws `not-ready`.\n */\nexport function useActions(): ActionsCapability {\n return useCapability(ActionsToken);\n}\n\n/** The actions settings (`policy`, `triggers`, `openSequence`, `javascript`), with or without a document, as refs. Takes a selector. */\nexport const useActionsSettings = settingsComposable(ActionsToken);\n\n/** Subscribe to one actions event while the component lives: `useActionsEvent((actions) => actions.onExecuted, handler)`. */\nexport function useActionsEvent<Event>(\n select: (actions: ActionsCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(ActionsToken, select, handler);\n}\n\n/** Your own handlers for any of the adapter's effects: `openUri`, `print`, `alert`, `gotoPage`. */\nexport type ActionsUiHandlers = Partial<ActionUiAdapter>;\n\n/**\n * Install the UI adapter for the action dispatcher of the document in scope,\n * for as long as the component lives. The defaults (which effects may show\n * themselves for which start, websites opened through `sanitizeExternalUri`,\n * the browser's print dialog and alert) are `@embedpdf/web`'s\n * `createDefaultActionsUiAdapter`, written once for every framework; this is\n * the Vue glue. `handlers` replace any of them, and can be a ref or a getter:\n * they are read each time an action needs them, so changing them never\n * reinstalls the adapter. The adapter is installed again only when the\n * document or its Stage changes. The `doc.print` permission is checked by the\n * plugin, before any handler runs.\n */\nexport function useActionsUiAdapter(\n handlers?: MaybeRefOrGetter<ActionsUiHandlers | undefined>,\n): void {\n const actions = useOptionalCapability(ActionsToken);\n const stage = useOptionalCapability(StageToken);\n // `sync`: installed in the same change that made the capability resolvable,\n // so no action between that change and the next render misses it.\n watch(\n [actions, stage],\n ([current, view], _previous, onCleanup) => {\n if (!current) return;\n const adapter: ActionUiAdapter = createDefaultActionsUiAdapter({\n overrides: () => toValue(handlers),\n goToPage: (page) => view?.goToPage(page),\n });\n onCleanup(current.setUiAdapter(adapter));\n },\n { immediate: true, flush: 'sync' },\n );\n}\n"],"names":["useCapability","ActionsToken","settingsComposable","useCapabilityEvent","useOptionalCapability","StageToken","watch","createDefaultActionsUiAdapter","toValue"],"mappings":";;;;;;;;AA8BO,SAAS,aAAgC;AAC9C,SAAOA,aAAAA,cAAcC,cAAAA,YAAY;AACnC;AAGO,MAAM,qBAAqBC,MAAAA,mBAAmBD,cAAAA,YAAY;AAG1D,SAAS,gBACd,QACA,SACM;AACNE,kCAAmBF,cAAAA,cAAc,QAAQ,OAAO;AAClD;AAiBO,SAAS,oBACd,UACM;AACN,QAAM,UAAUG,aAAAA,sBAAsBH,0BAAY;AAClD,QAAM,QAAQG,aAAAA,sBAAsBC,mBAAU;AAG9CC,MAAAA;AAAAA,IACE,CAAC,SAAS,KAAK;AAAA,IACf,CAAC,CAAC,SAAS,IAAI,GAAG,WAAW,cAAc;AACzC,UAAI,CAAC,QAAS;AACd,YAAM,UAA2BC,IAAAA,8BAA8B;AAAA,QAC7D,WAAW,MAAMC,IAAAA,QAAQ,QAAQ;AAAA,QACjC,UAAU,CAAC,SAAS,6BAAM,SAAS;AAAA,MAAI,CACxC;AACD,gBAAU,QAAQ,aAAa,OAAO,CAAC;AAAA,IACzC;AAAA,IACA,EAAE,WAAW,MAAM,OAAO,OAAA;AAAA,EAAO;AAErC;;;;;;;;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/vue/actions: the Vue view of `@embedpdf/plugin-actions`, the
|
|
3
|
+
* action engine's UI port.
|
|
4
|
+
*
|
|
5
|
+
* The plugin has no DOM: opening a website, printing and showing an alert are
|
|
6
|
+
* this layer's job. `useActionsUiAdapter()` installs the browser's defaults
|
|
7
|
+
* (the same sanitizer and `window.open` the link layer uses; print is the
|
|
8
|
+
* browser's dialog), and you can replace any of them. Without it, actions
|
|
9
|
+
* routed to the adapter (a website, a print) report a `no-adapter` diagnostic
|
|
10
|
+
* instead of running.
|
|
11
|
+
*/
|
|
12
|
+
export * from '@embedpdf/plugin-actions';
|
|
13
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
14
|
+
import type { ActionsCapability, ActionUiAdapter } from '@embedpdf/plugin-actions';
|
|
15
|
+
import type { EventHook } from '@embedpdf/core';
|
|
16
|
+
/**
|
|
17
|
+
* The actions API (`execute`, `executeNamed`, `dispatch`, the settings) of the
|
|
18
|
+
* nearest `<DocumentScope>`'s document, else the active one. The object never
|
|
19
|
+
* changes; outside a document the settings calls work and every other method
|
|
20
|
+
* throws `not-ready`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useActions(): ActionsCapability;
|
|
23
|
+
/** The actions settings (`policy`, `triggers`, `openSequence`, `javascript`), with or without a document, as refs. Takes a selector. */
|
|
24
|
+
export declare const useActionsSettings: import("./state.cjs").SettingsComposable<import("@embedpdf/plugin-actions").ActionsSettings & object>;
|
|
25
|
+
/** Subscribe to one actions event while the component lives: `useActionsEvent((actions) => actions.onExecuted, handler)`. */
|
|
26
|
+
export declare function useActionsEvent<Event>(select: (actions: ActionsCapability) => EventHook<Event>, handler: (event: Event) => void): void;
|
|
27
|
+
/** Your own handlers for any of the adapter's effects: `openUri`, `print`, `alert`, `gotoPage`. */
|
|
28
|
+
export type ActionsUiHandlers = Partial<ActionUiAdapter>;
|
|
29
|
+
/**
|
|
30
|
+
* Install the UI adapter for the action dispatcher of the document in scope,
|
|
31
|
+
* for as long as the component lives. The defaults (which effects may show
|
|
32
|
+
* themselves for which start, websites opened through `sanitizeExternalUri`,
|
|
33
|
+
* the browser's print dialog and alert) are `@embedpdf/web`'s
|
|
34
|
+
* `createDefaultActionsUiAdapter`, written once for every framework; this is
|
|
35
|
+
* the Vue glue. `handlers` replace any of them, and can be a ref or a getter:
|
|
36
|
+
* they are read each time an action needs them, so changing them never
|
|
37
|
+
* reinstalls the adapter. The adapter is installed again only when the
|
|
38
|
+
* document or its Stage changes. The `doc.print` permission is checked by the
|
|
39
|
+
* plugin, before any handler runs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useActionsUiAdapter(handlers?: MaybeRefOrGetter<ActionsUiHandlers | undefined>): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/vue/actions: the Vue view of `@embedpdf/plugin-actions`, the
|
|
3
|
+
* action engine's UI port.
|
|
4
|
+
*
|
|
5
|
+
* The plugin has no DOM: opening a website, printing and showing an alert are
|
|
6
|
+
* this layer's job. `useActionsUiAdapter()` installs the browser's defaults
|
|
7
|
+
* (the same sanitizer and `window.open` the link layer uses; print is the
|
|
8
|
+
* browser's dialog), and you can replace any of them. Without it, actions
|
|
9
|
+
* routed to the adapter (a website, a print) report a `no-adapter` diagnostic
|
|
10
|
+
* instead of running.
|
|
11
|
+
*/
|
|
12
|
+
export * from '@embedpdf/plugin-actions';
|
|
13
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
14
|
+
import type { ActionsCapability, ActionUiAdapter } from '@embedpdf/plugin-actions';
|
|
15
|
+
import type { EventHook } from '@embedpdf/core';
|
|
16
|
+
/**
|
|
17
|
+
* The actions API (`execute`, `executeNamed`, `dispatch`, the settings) of the
|
|
18
|
+
* nearest `<DocumentScope>`'s document, else the active one. The object never
|
|
19
|
+
* changes; outside a document the settings calls work and every other method
|
|
20
|
+
* throws `not-ready`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useActions(): ActionsCapability;
|
|
23
|
+
/** The actions settings (`policy`, `triggers`, `openSequence`, `javascript`), with or without a document, as refs. Takes a selector. */
|
|
24
|
+
export declare const useActionsSettings: import("./state.js").SettingsComposable<import("@embedpdf/plugin-actions").ActionsSettings & object>;
|
|
25
|
+
/** Subscribe to one actions event while the component lives: `useActionsEvent((actions) => actions.onExecuted, handler)`. */
|
|
26
|
+
export declare function useActionsEvent<Event>(select: (actions: ActionsCapability) => EventHook<Event>, handler: (event: Event) => void): void;
|
|
27
|
+
/** Your own handlers for any of the adapter's effects: `openUri`, `print`, `alert`, `gotoPage`. */
|
|
28
|
+
export type ActionsUiHandlers = Partial<ActionUiAdapter>;
|
|
29
|
+
/**
|
|
30
|
+
* Install the UI adapter for the action dispatcher of the document in scope,
|
|
31
|
+
* for as long as the component lives. The defaults (which effects may show
|
|
32
|
+
* themselves for which start, websites opened through `sanitizeExternalUri`,
|
|
33
|
+
* the browser's print dialog and alert) are `@embedpdf/web`'s
|
|
34
|
+
* `createDefaultActionsUiAdapter`, written once for every framework; this is
|
|
35
|
+
* the Vue glue. `handlers` replace any of them, and can be a ref or a getter:
|
|
36
|
+
* they are read each time an action needs them, so changing them never
|
|
37
|
+
* reinstalls the adapter. The adapter is installed again only when the
|
|
38
|
+
* document or its Stage changes. The `doc.print` permission is checked by the
|
|
39
|
+
* plugin, before any handler runs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useActionsUiAdapter(handlers?: MaybeRefOrGetter<ActionsUiHandlers | undefined>): void;
|
package/dist/actions.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ActionsToken } from "@embedpdf/plugin-actions";
|
|
2
|
+
export * from "@embedpdf/plugin-actions";
|
|
3
|
+
import { watch, toValue } from "vue";
|
|
4
|
+
import { StageToken } from "@embedpdf/plugin-stage/contract";
|
|
5
|
+
import { createDefaultActionsUiAdapter } from "@embedpdf/web";
|
|
6
|
+
import { a as useCapability, b as useCapabilityEvent, h as useOptionalCapability } from "./capabilities-C7YzgPCX.js";
|
|
7
|
+
import { s as settingsComposable } from "./state-DZg8q3v6.js";
|
|
8
|
+
function useActions() {
|
|
9
|
+
return useCapability(ActionsToken);
|
|
10
|
+
}
|
|
11
|
+
const useActionsSettings = settingsComposable(ActionsToken);
|
|
12
|
+
function useActionsEvent(select, handler) {
|
|
13
|
+
useCapabilityEvent(ActionsToken, select, handler);
|
|
14
|
+
}
|
|
15
|
+
function useActionsUiAdapter(handlers) {
|
|
16
|
+
const actions = useOptionalCapability(ActionsToken);
|
|
17
|
+
const stage = useOptionalCapability(StageToken);
|
|
18
|
+
watch(
|
|
19
|
+
[actions, stage],
|
|
20
|
+
([current, view], _previous, onCleanup) => {
|
|
21
|
+
if (!current) return;
|
|
22
|
+
const adapter = createDefaultActionsUiAdapter({
|
|
23
|
+
overrides: () => toValue(handlers),
|
|
24
|
+
goToPage: (page) => view == null ? void 0 : view.goToPage(page)
|
|
25
|
+
});
|
|
26
|
+
onCleanup(current.setUiAdapter(adapter));
|
|
27
|
+
},
|
|
28
|
+
{ immediate: true, flush: "sync" }
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
useActions,
|
|
33
|
+
useActionsEvent,
|
|
34
|
+
useActionsSettings,
|
|
35
|
+
useActionsUiAdapter
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../src/actions.ts"],"sourcesContent":["/**\n * @embedpdf/vue/actions: the Vue view of `@embedpdf/plugin-actions`, the\n * action engine's UI port.\n *\n * The plugin has no DOM: opening a website, printing and showing an alert are\n * this layer's job. `useActionsUiAdapter()` installs the browser's defaults\n * (the same sanitizer and `window.open` the link layer uses; print is the\n * browser's dialog), and you can replace any of them. Without it, actions\n * routed to the adapter (a website, a print) report a `no-adapter` diagnostic\n * instead of running.\n */\n\n// One line per feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-actions';\nimport { toValue, watch } from 'vue';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { ActionsToken } from '@embedpdf/plugin-actions';\nimport type { ActionsCapability, ActionUiAdapter } from '@embedpdf/plugin-actions';\nimport { StageToken } from '@embedpdf/plugin-stage/contract';\nimport type { EventHook } from '@embedpdf/core';\nimport { createDefaultActionsUiAdapter } from '@embedpdf/web';\nimport { useCapability, useCapabilityEvent, useOptionalCapability } from './runtime/capabilities';\nimport { settingsComposable } from './state';\n\n/**\n * The actions API (`execute`, `executeNamed`, `dispatch`, the settings) of the\n * nearest `<DocumentScope>`'s document, else the active one. The object never\n * changes; outside a document the settings calls work and every other method\n * throws `not-ready`.\n */\nexport function useActions(): ActionsCapability {\n return useCapability(ActionsToken);\n}\n\n/** The actions settings (`policy`, `triggers`, `openSequence`, `javascript`), with or without a document, as refs. Takes a selector. */\nexport const useActionsSettings = settingsComposable(ActionsToken);\n\n/** Subscribe to one actions event while the component lives: `useActionsEvent((actions) => actions.onExecuted, handler)`. */\nexport function useActionsEvent<Event>(\n select: (actions: ActionsCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(ActionsToken, select, handler);\n}\n\n/** Your own handlers for any of the adapter's effects: `openUri`, `print`, `alert`, `gotoPage`. */\nexport type ActionsUiHandlers = Partial<ActionUiAdapter>;\n\n/**\n * Install the UI adapter for the action dispatcher of the document in scope,\n * for as long as the component lives. The defaults (which effects may show\n * themselves for which start, websites opened through `sanitizeExternalUri`,\n * the browser's print dialog and alert) are `@embedpdf/web`'s\n * `createDefaultActionsUiAdapter`, written once for every framework; this is\n * the Vue glue. `handlers` replace any of them, and can be a ref or a getter:\n * they are read each time an action needs them, so changing them never\n * reinstalls the adapter. The adapter is installed again only when the\n * document or its Stage changes. The `doc.print` permission is checked by the\n * plugin, before any handler runs.\n */\nexport function useActionsUiAdapter(\n handlers?: MaybeRefOrGetter<ActionsUiHandlers | undefined>,\n): void {\n const actions = useOptionalCapability(ActionsToken);\n const stage = useOptionalCapability(StageToken);\n // `sync`: installed in the same change that made the capability resolvable,\n // so no action between that change and the next render misses it.\n watch(\n [actions, stage],\n ([current, view], _previous, onCleanup) => {\n if (!current) return;\n const adapter: ActionUiAdapter = createDefaultActionsUiAdapter({\n overrides: () => toValue(handlers),\n goToPage: (page) => view?.goToPage(page),\n });\n onCleanup(current.setUiAdapter(adapter));\n },\n { immediate: true, flush: 'sync' },\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BO,SAAS,aAAgC;AAC9C,SAAO,cAAc,YAAY;AACnC;AAGO,MAAM,qBAAqB,mBAAmB,YAAY;AAG1D,SAAS,gBACd,QACA,SACM;AACN,qBAAmB,cAAc,QAAQ,OAAO;AAClD;AAiBO,SAAS,oBACd,UACM;AACN,QAAM,UAAU,sBAAsB,YAAY;AAClD,QAAM,QAAQ,sBAAsB,UAAU;AAG9C;AAAA,IACE,CAAC,SAAS,KAAK;AAAA,IACf,CAAC,CAAC,SAAS,IAAI,GAAG,WAAW,cAAc;AACzC,UAAI,CAAC,QAAS;AACd,YAAM,UAA2B,8BAA8B;AAAA,QAC7D,WAAW,MAAM,QAAQ,QAAQ;AAAA,QACjC,UAAU,CAAC,SAAS,6BAAM,SAAS;AAAA,MAAI,CACxC;AACD,gBAAU,QAAQ,aAAa,OAAO,CAAC;AAAA,IACzC;AAAA,IACA,EAAE,WAAW,MAAM,OAAO,OAAA;AAAA,EAAO;AAErC;"}
|