@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,979 @@
|
|
|
1
|
+
import { defineComponent, useSlots, computed, openBlock, createElementBlock, Fragment, renderList, unref, normalizeStyle, createCommentVNode, createElementVNode, renderSlot, provide, shallowRef, watch, toValue, onScopeDispose, inject, createBlock, resolveDynamicComponent, createVNode, ref, onUnmounted, withCtx, createSlots, normalizeProps, guardReactiveProps, markRaw, h, toRaw, toDisplayString } from "vue";
|
|
2
|
+
import { shallowEqual, annotationKey } from "@embedpdf/core";
|
|
3
|
+
import { AnnotationToken as AnnotationToken$1, previewBucket } from "@embedpdf/plugin-annotation/contract/host";
|
|
4
|
+
import { InteractionToken } from "@embedpdf/plugin-interaction/contract";
|
|
5
|
+
import { RenderToken } from "@embedpdf/plugin-render/contract/host";
|
|
6
|
+
import { annotationChromePaint, chromeInPixels, frameInPixels, createTextBoxEditorFollower, textBoxEditorScaleOf, ownTextBoxOf, lookFrameOf, freeTextBoxOf, sceneViewBox, svgShapesOf, ghostOpacity, pictureOrPainting, shownAppearance, rasterInFrame, loadObjectUrl, rectInPixels, registerRendererBehaviors, createShownUrls, loadAppearanceUrls, editingTextKeyOf, annotationDrawingOf, layerTextBoxesOf, bakedAppearanceOf, sameSelectionAnchor, sameCreationDraftAnchor, paint, paintDefault, sameRotationAnchor, pickRequestedFile, sameAnnotationAnchor, enrichCommentThreads, installFilePickerProvider } from "@embedpdf/web";
|
|
7
|
+
import { d as devWarn } from "./dev-CtMlvxjZ.js";
|
|
8
|
+
import { a as usePaintsPagePart } from "./page-layers-rlh4-1qr.js";
|
|
9
|
+
import { i as useOptionalSelector, h as useOptionalCapability, a as useCapability, b as useCapabilityEvent, d as useDocumentId, g as useKernelValue } from "./capabilities-C7YzgPCX.js";
|
|
10
|
+
import { u as usePage } from "./page-D9XIuLSj.js";
|
|
11
|
+
import { e as useViewerSettings } from "./documents-DUu5H4yH.js";
|
|
12
|
+
import { scene, MITER_LIMIT, hasLiveDrawing } from "@embedpdf/core-annotation";
|
|
13
|
+
import { _ as _sfc_main$b } from "./SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js";
|
|
14
|
+
import { _ as _sfc_main$c } from "./Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js";
|
|
15
|
+
import { b as useProjectorBinding } from "./projector-CDZn1kh1.js";
|
|
16
|
+
import { AnnotationToken as AnnotationToken$2 } from "@embedpdf/plugin-annotation";
|
|
17
|
+
import { annotationState, AnnotationToken } from "@embedpdf/plugin-annotation/contract";
|
|
18
|
+
import { s as settingsComposable, a as stateComposable } from "./state-DZg8q3v6.js";
|
|
19
|
+
const useAnnotationState = stateComposable(annotationState);
|
|
20
|
+
const useAnnotationSettings = settingsComposable(AnnotationToken);
|
|
21
|
+
const _hoisted_1$5 = { style: { position: "absolute", inset: 0, overflow: "visible", pointerEvents: "none" } };
|
|
22
|
+
const _hoisted_2 = ["cx", "cy", "r"];
|
|
23
|
+
const _hoisted_3 = ["x", "y", "width", "height", "transform"];
|
|
24
|
+
const _hoisted_4 = ["x1", "y1", "x2", "y2"];
|
|
25
|
+
const _hoisted_5 = ["points"];
|
|
26
|
+
const _hoisted_6 = { key: 3 };
|
|
27
|
+
const _hoisted_7 = ["x1", "y1", "x2", "y2", "opacity"];
|
|
28
|
+
const _hoisted_8 = { key: 0 };
|
|
29
|
+
const _hoisted_9 = ["x1", "y1", "x2", "y2"];
|
|
30
|
+
const _hoisted_10 = ["cx", "cy", "r"];
|
|
31
|
+
const _hoisted_11 = ["x", "y", "width", "height"];
|
|
32
|
+
const _hoisted_12 = ["x", "y", "width", "height"];
|
|
33
|
+
const _hoisted_13 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none" }
|
|
36
|
+
};
|
|
37
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
38
|
+
__name: "AnnotationChrome",
|
|
39
|
+
props: {
|
|
40
|
+
page: {}
|
|
41
|
+
},
|
|
42
|
+
setup(__props) {
|
|
43
|
+
const props = __props;
|
|
44
|
+
const slots = useSlots();
|
|
45
|
+
const NO_NODES = Object.freeze([]);
|
|
46
|
+
const nodes = useOptionalSelector(
|
|
47
|
+
AnnotationToken$1,
|
|
48
|
+
(host) => {
|
|
49
|
+
const { transform, ref: ref2 } = props.page;
|
|
50
|
+
return host.listChromeNodes(ref2, transform.viewScale, transform.rotation, transform.zoom);
|
|
51
|
+
},
|
|
52
|
+
NO_NODES,
|
|
53
|
+
shallowEqual
|
|
54
|
+
);
|
|
55
|
+
const chrome = useAnnotationSettings((settings) => settings.chrome);
|
|
56
|
+
const accent = useViewerSettings((settings) => settings.accent);
|
|
57
|
+
const painted = computed(() => {
|
|
58
|
+
const paint2 = annotationChromePaint(chrome.value, accent.value);
|
|
59
|
+
const style = (part) => ({ ...part });
|
|
60
|
+
return {
|
|
61
|
+
outline: style(paint2.outline),
|
|
62
|
+
handle: style(paint2.handle),
|
|
63
|
+
rotationHandle: style(paint2.rotationHandle),
|
|
64
|
+
rotationStalk: style({ stroke: paint2.rotationHandle.stroke }),
|
|
65
|
+
guide: style(paint2.guide),
|
|
66
|
+
rotationGuide: style(paint2.rotationGuide),
|
|
67
|
+
marquee: style(paint2.marquee)
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
const pixels = computed(() => chromeInPixels(nodes.value, props.page.transform));
|
|
71
|
+
const hasHandles = computed(
|
|
72
|
+
() => pixels.value.some((node) => node.kind === "handle" || node.kind === "rotation-handle")
|
|
73
|
+
);
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
76
|
+
(openBlock(), createElementBlock("svg", _hoisted_1$5, [
|
|
77
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(pixels.value, (node, index) => {
|
|
78
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
79
|
+
node.kind === "handle" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
80
|
+
!slots.handle ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
81
|
+
unref(chrome).handles.shape === "circle" ? (openBlock(), createElementBlock("circle", {
|
|
82
|
+
key: 0,
|
|
83
|
+
cx: node.at.x,
|
|
84
|
+
cy: node.at.y,
|
|
85
|
+
r: unref(chrome).handles.size / 2,
|
|
86
|
+
"stroke-width": "1.5",
|
|
87
|
+
style: normalizeStyle(painted.value.handle)
|
|
88
|
+
}, null, 12, _hoisted_2)) : (openBlock(), createElementBlock("rect", {
|
|
89
|
+
key: 1,
|
|
90
|
+
x: node.at.x - unref(chrome).handles.size / 2,
|
|
91
|
+
y: node.at.y - unref(chrome).handles.size / 2,
|
|
92
|
+
width: unref(chrome).handles.size,
|
|
93
|
+
height: unref(chrome).handles.size,
|
|
94
|
+
"stroke-width": "1.5",
|
|
95
|
+
style: normalizeStyle(painted.value.handle),
|
|
96
|
+
transform: node.rotation ? `rotate(${node.rotation} ${node.at.x} ${node.at.y})` : void 0
|
|
97
|
+
}, null, 12, _hoisted_3))
|
|
98
|
+
], 64)) : createCommentVNode("", true)
|
|
99
|
+
], 64)) : node.kind === "guide" ? (openBlock(), createElementBlock("line", {
|
|
100
|
+
key: 1,
|
|
101
|
+
x1: node.from.x,
|
|
102
|
+
y1: node.from.y,
|
|
103
|
+
x2: node.to.x,
|
|
104
|
+
y2: node.to.y,
|
|
105
|
+
"shape-rendering": "crispEdges",
|
|
106
|
+
style: normalizeStyle(painted.value.guide)
|
|
107
|
+
}, null, 12, _hoisted_4)) : node.kind === "turned-outline" ? (openBlock(), createElementBlock("polygon", {
|
|
108
|
+
key: 2,
|
|
109
|
+
points: node.points,
|
|
110
|
+
fill: "none",
|
|
111
|
+
style: normalizeStyle(painted.value.outline)
|
|
112
|
+
}, null, 12, _hoisted_5)) : node.kind === "rotation-guides" ? (openBlock(), createElementBlock("g", _hoisted_6, [
|
|
113
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(node.lines, (line, lineIndex) => {
|
|
114
|
+
return openBlock(), createElementBlock("line", {
|
|
115
|
+
key: lineIndex,
|
|
116
|
+
x1: line.from.x,
|
|
117
|
+
y1: line.from.y,
|
|
118
|
+
x2: line.to.x,
|
|
119
|
+
y2: line.to.y,
|
|
120
|
+
opacity: line.opacity,
|
|
121
|
+
style: normalizeStyle(painted.value.rotationGuide)
|
|
122
|
+
}, null, 12, _hoisted_7);
|
|
123
|
+
}), 128))
|
|
124
|
+
])) : node.kind === "rotation-handle" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
125
|
+
!slots["rotation-handle"] ? (openBlock(), createElementBlock("g", _hoisted_8, [
|
|
126
|
+
unref(chrome).rotationHandle.stalk ? (openBlock(), createElementBlock("line", {
|
|
127
|
+
key: 0,
|
|
128
|
+
x1: node.from.x,
|
|
129
|
+
y1: node.from.y,
|
|
130
|
+
x2: node.at.x,
|
|
131
|
+
y2: node.at.y,
|
|
132
|
+
"stroke-width": "1",
|
|
133
|
+
style: normalizeStyle(painted.value.rotationStalk)
|
|
134
|
+
}, null, 12, _hoisted_9)) : createCommentVNode("", true),
|
|
135
|
+
createElementVNode("circle", {
|
|
136
|
+
cx: node.at.x,
|
|
137
|
+
cy: node.at.y,
|
|
138
|
+
r: unref(chrome).rotationHandle.size / 2,
|
|
139
|
+
"stroke-width": "1.5",
|
|
140
|
+
style: normalizeStyle(painted.value.rotationHandle)
|
|
141
|
+
}, null, 12, _hoisted_10)
|
|
142
|
+
])) : createCommentVNode("", true)
|
|
143
|
+
], 64)) : node.kind === "marquee" ? (openBlock(), createElementBlock("rect", {
|
|
144
|
+
key: 5,
|
|
145
|
+
x: node.box.left,
|
|
146
|
+
y: node.box.top,
|
|
147
|
+
width: node.box.width,
|
|
148
|
+
height: node.box.height,
|
|
149
|
+
"stroke-width": "1",
|
|
150
|
+
"stroke-dasharray": "4 3",
|
|
151
|
+
style: normalizeStyle(painted.value.marquee)
|
|
152
|
+
}, null, 12, _hoisted_11)) : node.kind === "outline" ? (openBlock(), createElementBlock("rect", {
|
|
153
|
+
key: 6,
|
|
154
|
+
x: node.box.left,
|
|
155
|
+
y: node.box.top,
|
|
156
|
+
width: node.box.width,
|
|
157
|
+
height: node.box.height,
|
|
158
|
+
fill: "none",
|
|
159
|
+
style: normalizeStyle(painted.value.outline)
|
|
160
|
+
}, null, 12, _hoisted_12)) : createCommentVNode("", true)
|
|
161
|
+
], 64);
|
|
162
|
+
}), 128))
|
|
163
|
+
])),
|
|
164
|
+
hasHandles.value && (slots.handle || slots["rotation-handle"]) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
165
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(pixels.value, (node, index) => {
|
|
166
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
167
|
+
node.kind === "handle" && slots.handle ? renderSlot(_ctx.$slots, "handle", {
|
|
168
|
+
at: node.at,
|
|
169
|
+
size: unref(chrome).handles.size,
|
|
170
|
+
rotation: node.rotation,
|
|
171
|
+
kind: node.role,
|
|
172
|
+
active: node.active
|
|
173
|
+
}, void 0, void 0, 0) : node.kind === "rotation-handle" && slots["rotation-handle"] ? renderSlot(_ctx.$slots, "rotation-handle", {
|
|
174
|
+
at: node.at,
|
|
175
|
+
from: node.from,
|
|
176
|
+
size: unref(chrome).rotationHandle.size,
|
|
177
|
+
rotation: 0,
|
|
178
|
+
active: false
|
|
179
|
+
}, void 0, void 0, 1) : createCommentVNode("", true)
|
|
180
|
+
], 64);
|
|
181
|
+
}), 128))
|
|
182
|
+
])) : createCommentVNode("", true)
|
|
183
|
+
], 64);
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
const _hoisted_1$4 = ["inert"];
|
|
188
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
189
|
+
__name: "AnnotationFrame",
|
|
190
|
+
props: {
|
|
191
|
+
item: {},
|
|
192
|
+
page: {},
|
|
193
|
+
interactive: { type: Boolean, default: false },
|
|
194
|
+
inert: { type: Boolean, default: false }
|
|
195
|
+
},
|
|
196
|
+
setup(__props) {
|
|
197
|
+
const props = __props;
|
|
198
|
+
const style = computed(() => {
|
|
199
|
+
const box = frameInPixels(props.item.frame, props.page.transform);
|
|
200
|
+
return {
|
|
201
|
+
position: "absolute",
|
|
202
|
+
left: `${box.left}px`,
|
|
203
|
+
top: `${box.top}px`,
|
|
204
|
+
width: `${box.width}px`,
|
|
205
|
+
height: `${box.height}px`,
|
|
206
|
+
transform: box.transform,
|
|
207
|
+
transformOrigin: "center",
|
|
208
|
+
// On the frame: a turned frame groups what is inside it, so blending on
|
|
209
|
+
// an inner element would stop blending with the page.
|
|
210
|
+
mixBlendMode: props.item.blend,
|
|
211
|
+
pointerEvents: props.interactive ? "auto" : "none"
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
return (_ctx, _cache) => {
|
|
215
|
+
return openBlock(), createElementBlock("div", {
|
|
216
|
+
inert: __props.inert || void 0,
|
|
217
|
+
style: normalizeStyle(style.value)
|
|
218
|
+
}, [
|
|
219
|
+
renderSlot(_ctx.$slots, "default")
|
|
220
|
+
], 12, _hoisted_1$4);
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
function useTextBoxEditor(item, scale) {
|
|
225
|
+
const element = shallowRef(null);
|
|
226
|
+
const annotation = useOptionalCapability(AnnotationToken$1);
|
|
227
|
+
const follower = createTextBoxEditorFollower();
|
|
228
|
+
watch(
|
|
229
|
+
[annotation, element, () => toValue(item), () => toValue(scale)],
|
|
230
|
+
([capability, target, current, pixelsPerPoint]) => follower.follow(target, capability, current, pixelsPerPoint),
|
|
231
|
+
{ immediate: true, flush: "post" }
|
|
232
|
+
);
|
|
233
|
+
onScopeDispose(() => follower.detach());
|
|
234
|
+
return element;
|
|
235
|
+
}
|
|
236
|
+
const LookScaleKey = Symbol("embedpdf annotation look scale");
|
|
237
|
+
const UNSCALED = computed(() => 1);
|
|
238
|
+
function provideLookScale(scale) {
|
|
239
|
+
provide(LookScaleKey, scale);
|
|
240
|
+
}
|
|
241
|
+
const NO_STYLE = Object.freeze({});
|
|
242
|
+
function useRichTextEditor(annotation) {
|
|
243
|
+
const page = usePage();
|
|
244
|
+
const item = useOptionalSelector(
|
|
245
|
+
AnnotationToken$1,
|
|
246
|
+
(host) => {
|
|
247
|
+
const { transform } = page.value;
|
|
248
|
+
return host.getTextItem(toValue(annotation).ref, {
|
|
249
|
+
zoom: transform.zoom,
|
|
250
|
+
rotation: transform.rotation
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
null
|
|
254
|
+
);
|
|
255
|
+
const lookScale = inject(LookScaleKey, UNSCALED);
|
|
256
|
+
const scale = computed(
|
|
257
|
+
() => textBoxEditorScaleOf(item.value, page.value.transform, lookScale.value)
|
|
258
|
+
);
|
|
259
|
+
const own = computed(() => item.value ? ownTextBoxOf(item.value, scale.value) : null);
|
|
260
|
+
const element = useTextBoxEditor(item, () => {
|
|
261
|
+
var _a;
|
|
262
|
+
return ((_a = own.value) == null ? void 0 : _a.scale) ?? scale.value;
|
|
263
|
+
});
|
|
264
|
+
const style = computed(() => {
|
|
265
|
+
var _a;
|
|
266
|
+
return ((_a = own.value) == null ? void 0 : _a.style) ?? NO_STYLE;
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
ref: (target) => {
|
|
270
|
+
element.value = target instanceof HTMLElement ? target : null;
|
|
271
|
+
},
|
|
272
|
+
style,
|
|
273
|
+
editing: computed(() => {
|
|
274
|
+
var _a;
|
|
275
|
+
return ((_a = item.value) == null ? void 0 : _a.editing) ?? false;
|
|
276
|
+
})
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
280
|
+
__name: "AnnotationLook",
|
|
281
|
+
props: {
|
|
282
|
+
component: {},
|
|
283
|
+
scaled: { type: Boolean },
|
|
284
|
+
annotation: {},
|
|
285
|
+
item: {},
|
|
286
|
+
page: {},
|
|
287
|
+
native: {},
|
|
288
|
+
appearance: {},
|
|
289
|
+
interactive: { type: Boolean }
|
|
290
|
+
},
|
|
291
|
+
setup(__props) {
|
|
292
|
+
const props = __props;
|
|
293
|
+
const pixels = computed(() => frameInPixels(props.item.frame, props.page.transform));
|
|
294
|
+
const frame = computed(() => lookFrameOf(pixels.value, props.scaled));
|
|
295
|
+
provideLookScale(computed(() => props.scaled ? pixels.value.scale : 1));
|
|
296
|
+
const scaledBox = computed(
|
|
297
|
+
() => ({
|
|
298
|
+
position: "absolute",
|
|
299
|
+
left: 0,
|
|
300
|
+
top: 0,
|
|
301
|
+
width: `${pixels.value.design.width}px`,
|
|
302
|
+
height: `${pixels.value.design.height}px`,
|
|
303
|
+
transform: `scale(${pixels.value.scale})`,
|
|
304
|
+
transformOrigin: "0 0"
|
|
305
|
+
})
|
|
306
|
+
);
|
|
307
|
+
return (_ctx, _cache) => {
|
|
308
|
+
return __props.scaled ? (openBlock(), createElementBlock("div", {
|
|
309
|
+
key: 0,
|
|
310
|
+
style: normalizeStyle(scaledBox.value)
|
|
311
|
+
}, [
|
|
312
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.component), {
|
|
313
|
+
annotation: __props.annotation,
|
|
314
|
+
frame: frame.value,
|
|
315
|
+
native: __props.native,
|
|
316
|
+
appearance: __props.appearance,
|
|
317
|
+
hovered: __props.item.hovered ?? false,
|
|
318
|
+
selected: __props.item.selected,
|
|
319
|
+
interactive: __props.interactive
|
|
320
|
+
}, null, 8, ["annotation", "frame", "native", "appearance", "hovered", "selected", "interactive"]))
|
|
321
|
+
], 4)) : (openBlock(), createBlock(resolveDynamicComponent(__props.component), {
|
|
322
|
+
key: 1,
|
|
323
|
+
annotation: __props.annotation,
|
|
324
|
+
frame: frame.value,
|
|
325
|
+
native: __props.native,
|
|
326
|
+
appearance: __props.appearance,
|
|
327
|
+
hovered: __props.item.hovered ?? false,
|
|
328
|
+
selected: __props.item.selected,
|
|
329
|
+
interactive: __props.interactive
|
|
330
|
+
}, null, 8, ["annotation", "frame", "native", "appearance", "hovered", "selected", "interactive"]));
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
335
|
+
__name: "FreeTextBox",
|
|
336
|
+
props: {
|
|
337
|
+
item: {},
|
|
338
|
+
page: {}
|
|
339
|
+
},
|
|
340
|
+
setup(__props) {
|
|
341
|
+
const props = __props;
|
|
342
|
+
const chrome = useAnnotationSettings((settings) => settings.chrome);
|
|
343
|
+
const accent = useViewerSettings((settings) => settings.accent);
|
|
344
|
+
const outline = computed(() => annotationChromePaint(chrome.value, accent.value).textOutline);
|
|
345
|
+
const box = computed(() => freeTextBoxOf(props.item, props.page.transform, outline.value));
|
|
346
|
+
const element = useTextBoxEditor(
|
|
347
|
+
() => props.item,
|
|
348
|
+
() => box.value.scale
|
|
349
|
+
);
|
|
350
|
+
return (_ctx, _cache) => {
|
|
351
|
+
return openBlock(), createElementBlock("div", {
|
|
352
|
+
ref_key: "element",
|
|
353
|
+
ref: element,
|
|
354
|
+
style: normalizeStyle(box.value.style)
|
|
355
|
+
}, null, 4);
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
const _hoisted_1$3 = ["viewBox"];
|
|
360
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
361
|
+
__name: "AnnotationScene",
|
|
362
|
+
props: {
|
|
363
|
+
item: {}
|
|
364
|
+
},
|
|
365
|
+
setup(__props) {
|
|
366
|
+
const props = __props;
|
|
367
|
+
const viewBox = computed(() => sceneViewBox(props.item.box));
|
|
368
|
+
const shapes = computed(() => svgShapesOf(scene(props.item), { miterLimit: MITER_LIMIT }));
|
|
369
|
+
const style = computed(
|
|
370
|
+
() => ({
|
|
371
|
+
position: "absolute",
|
|
372
|
+
left: 0,
|
|
373
|
+
top: 0,
|
|
374
|
+
width: "100%",
|
|
375
|
+
height: "100%",
|
|
376
|
+
overflow: "visible",
|
|
377
|
+
pointerEvents: "none",
|
|
378
|
+
// A ghost is see-through as a whole, so its fill and stroke don't stack.
|
|
379
|
+
...props.item.source === "ghost" ? { opacity: ghostOpacity(props.item.ghostOpacity ?? 0.5) } : {}
|
|
380
|
+
})
|
|
381
|
+
);
|
|
382
|
+
return (_ctx, _cache) => {
|
|
383
|
+
return viewBox.value ? (openBlock(), createElementBlock("svg", {
|
|
384
|
+
key: 0,
|
|
385
|
+
viewBox: viewBox.value,
|
|
386
|
+
style: normalizeStyle(style.value)
|
|
387
|
+
}, [
|
|
388
|
+
createVNode(_sfc_main$b, { shapes: shapes.value }, null, 8, ["shapes"])
|
|
389
|
+
], 12, _hoisted_1$3)) : createCommentVNode("", true);
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
const _hoisted_1$2 = ["src"];
|
|
394
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
395
|
+
__name: "NativeDrawing",
|
|
396
|
+
props: {
|
|
397
|
+
item: {},
|
|
398
|
+
urls: {}
|
|
399
|
+
},
|
|
400
|
+
setup(__props) {
|
|
401
|
+
const props = __props;
|
|
402
|
+
const shows = computed(() => {
|
|
403
|
+
var _a;
|
|
404
|
+
const { item, urls } = props;
|
|
405
|
+
return pictureOrPainting({
|
|
406
|
+
pending: item.source !== "baked",
|
|
407
|
+
picture: urls && shownAppearance(urls, item.id, ((_a = item.annotation) == null ? void 0 : _a.appearanceState) ?? null),
|
|
408
|
+
version: item.pictureVersion ?? 0,
|
|
409
|
+
loaded: urls !== null,
|
|
410
|
+
paint: () => hasLiveDrawing(item) ? item : null
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
const baked = computed(() => {
|
|
414
|
+
const { item } = props;
|
|
415
|
+
const look = shows.value;
|
|
416
|
+
if ((look == null ? void 0 : look.kind) !== "picture" || !item.raster) return null;
|
|
417
|
+
const box = rasterInFrame(item.raster, item.frame);
|
|
418
|
+
return {
|
|
419
|
+
url: look.picture.url,
|
|
420
|
+
style: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
left: box.left,
|
|
423
|
+
top: box.top,
|
|
424
|
+
width: box.width,
|
|
425
|
+
height: box.height,
|
|
426
|
+
// The appearance box is sized in content units; a global
|
|
427
|
+
// `img { max-width: 100% }` reset would otherwise clamp it to the
|
|
428
|
+
// containing block and distort the aspect (a landscape stamp on a turned,
|
|
429
|
+
// portrait page), so honour the explicit size.
|
|
430
|
+
maxWidth: "none",
|
|
431
|
+
maxHeight: "none",
|
|
432
|
+
pointerEvents: "none",
|
|
433
|
+
// The turn the engine took out of the raster, put back about its middle.
|
|
434
|
+
transform: box.transform,
|
|
435
|
+
transformOrigin: "center"
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
});
|
|
439
|
+
return (_ctx, _cache) => {
|
|
440
|
+
var _a;
|
|
441
|
+
return baked.value ? (openBlock(), createElementBlock("img", {
|
|
442
|
+
key: 0,
|
|
443
|
+
src: baked.value.url,
|
|
444
|
+
alt: "",
|
|
445
|
+
draggable: "false",
|
|
446
|
+
style: normalizeStyle(baked.value.style)
|
|
447
|
+
}, null, 12, _hoisted_1$2)) : ((_a = shows.value) == null ? void 0 : _a.kind) === "painting" ? (openBlock(), createBlock(_sfc_main$6, {
|
|
448
|
+
key: 1,
|
|
449
|
+
item: __props.item
|
|
450
|
+
}, null, 8, ["item"])) : createCommentVNode("", true);
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
const _hoisted_1$1 = ["src"];
|
|
455
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
456
|
+
__name: "StampGhost",
|
|
457
|
+
props: {
|
|
458
|
+
page: {}
|
|
459
|
+
},
|
|
460
|
+
setup(__props) {
|
|
461
|
+
const props = __props;
|
|
462
|
+
const annotation = useOptionalCapability(AnnotationToken$1);
|
|
463
|
+
const ghost = useOptionalSelector(
|
|
464
|
+
AnnotationToken$1,
|
|
465
|
+
(host) => host.getImageGhost(props.page.ref),
|
|
466
|
+
null
|
|
467
|
+
);
|
|
468
|
+
const armed = useOptionalSelector(AnnotationToken$1, (host) => host.getArmedStamp(), null);
|
|
469
|
+
const bucket = computed(
|
|
470
|
+
() => ghost.value ? previewBucket(ghost.value.box.width * props.page.transform.renderScale) : 0
|
|
471
|
+
);
|
|
472
|
+
const url = ref(null);
|
|
473
|
+
watch(
|
|
474
|
+
[annotation, armed, bucket],
|
|
475
|
+
([host, _armed, size], _previous, onCleanup) => {
|
|
476
|
+
if (!host || !size) {
|
|
477
|
+
url.value = null;
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
onCleanup(
|
|
481
|
+
loadObjectUrl(
|
|
482
|
+
() => host.renderArmedStampPreview(size),
|
|
483
|
+
(next) => url.value = next
|
|
484
|
+
)
|
|
485
|
+
);
|
|
486
|
+
},
|
|
487
|
+
{ immediate: true }
|
|
488
|
+
);
|
|
489
|
+
const style = computed(() => {
|
|
490
|
+
const current = ghost.value;
|
|
491
|
+
if (!current) return null;
|
|
492
|
+
const frame = rectInPixels(current.box, props.page.transform);
|
|
493
|
+
return {
|
|
494
|
+
position: "absolute",
|
|
495
|
+
left: `${frame.left}px`,
|
|
496
|
+
top: `${frame.top}px`,
|
|
497
|
+
width: `${frame.width}px`,
|
|
498
|
+
height: `${frame.height}px`,
|
|
499
|
+
// Never let a global `img` reset clamp the box and distort the aspect.
|
|
500
|
+
maxWidth: "none",
|
|
501
|
+
maxHeight: "none",
|
|
502
|
+
pointerEvents: "none",
|
|
503
|
+
opacity: ghostOpacity(current.opacity),
|
|
504
|
+
...current.rot ? { transform: `rotate(${current.rot}deg)`, transformOrigin: "center" } : {}
|
|
505
|
+
};
|
|
506
|
+
});
|
|
507
|
+
return (_ctx, _cache) => {
|
|
508
|
+
return style.value && url.value ? (openBlock(), createElementBlock("img", {
|
|
509
|
+
key: 0,
|
|
510
|
+
src: url.value,
|
|
511
|
+
alt: "",
|
|
512
|
+
draggable: "false",
|
|
513
|
+
style: normalizeStyle(style.value)
|
|
514
|
+
}, null, 12, _hoisted_1$1)) : createCommentVNode("", true);
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
const _hoisted_1 = { style: { position: "absolute", inset: 0, pointerEvents: "none" } };
|
|
519
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
520
|
+
__name: "AnnotationLayer",
|
|
521
|
+
props: {
|
|
522
|
+
renderers: {}
|
|
523
|
+
},
|
|
524
|
+
setup(__props) {
|
|
525
|
+
const props = __props;
|
|
526
|
+
const slots = useSlots();
|
|
527
|
+
const NO_ITEMS = Object.freeze([]);
|
|
528
|
+
const NO_TEXTS = Object.freeze([]);
|
|
529
|
+
const page = usePage();
|
|
530
|
+
usePaintsPagePart(
|
|
531
|
+
computed(() => page.value.ref),
|
|
532
|
+
"annotations"
|
|
533
|
+
);
|
|
534
|
+
const annotation = useOptionalCapability(AnnotationToken$1);
|
|
535
|
+
const interaction = useOptionalCapability(InteractionToken);
|
|
536
|
+
const activeToolId = useOptionalSelector(
|
|
537
|
+
InteractionToken,
|
|
538
|
+
(hub) => hub.getActiveToolId(),
|
|
539
|
+
""
|
|
540
|
+
);
|
|
541
|
+
const items = useOptionalSelector(
|
|
542
|
+
AnnotationToken$1,
|
|
543
|
+
(host) => {
|
|
544
|
+
const { transform, ref: ref2 } = page.value;
|
|
545
|
+
return host.listPageItems(ref2, { zoom: transform.zoom, rotation: transform.rotation });
|
|
546
|
+
},
|
|
547
|
+
NO_ITEMS,
|
|
548
|
+
shallowEqual
|
|
549
|
+
);
|
|
550
|
+
const texts = useOptionalSelector(
|
|
551
|
+
AnnotationToken$1,
|
|
552
|
+
(host) => {
|
|
553
|
+
const { transform, ref: ref2 } = page.value;
|
|
554
|
+
return host.listTextItems(ref2, { zoom: transform.zoom, rotation: transform.rotation });
|
|
555
|
+
},
|
|
556
|
+
NO_TEXTS,
|
|
557
|
+
shallowEqual
|
|
558
|
+
);
|
|
559
|
+
const registrations = shallowRef(0);
|
|
560
|
+
watch(
|
|
561
|
+
[annotation, () => props.renderers],
|
|
562
|
+
([host, renderers], previous, onCleanup) => {
|
|
563
|
+
const before = previous == null ? void 0 : previous[1];
|
|
564
|
+
if (renderers && before && renderers !== before && shallowEqual(renderers, before)) {
|
|
565
|
+
devWarn(
|
|
566
|
+
"annotation-renderers-inline",
|
|
567
|
+
"<AnnotationLayer :renderers> was given a new array with the same entries — define it once in <script setup>, because entry identity keys the behavior registration."
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
if (host && renderers) {
|
|
571
|
+
onCleanup(
|
|
572
|
+
registerRendererBehaviors(
|
|
573
|
+
host,
|
|
574
|
+
renderers,
|
|
575
|
+
() => {
|
|
576
|
+
var _a;
|
|
577
|
+
return String(((_a = interaction.value) == null ? void 0 : _a.getActiveToolId()) ?? "");
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
registrations.value += 1;
|
|
583
|
+
},
|
|
584
|
+
{ immediate: true }
|
|
585
|
+
);
|
|
586
|
+
const urls = shallowRef(null);
|
|
587
|
+
const shown = createShownUrls();
|
|
588
|
+
onUnmounted(() => shown.release());
|
|
589
|
+
const bakedKey = useOptionalSelector(
|
|
590
|
+
AnnotationToken$1,
|
|
591
|
+
(host) => host.getAppearanceEpoch(page.value.ref),
|
|
592
|
+
""
|
|
593
|
+
);
|
|
594
|
+
const bakeScale = useOptionalSelector(
|
|
595
|
+
RenderToken,
|
|
596
|
+
(render) => render.getAppearanceScale(page.value.transform.renderScale),
|
|
597
|
+
page.value.transform.renderScale
|
|
598
|
+
);
|
|
599
|
+
watch(
|
|
600
|
+
[annotation, () => page.value.ref, bakeScale, bakedKey],
|
|
601
|
+
([host, pageRef, scale], _previous, onCleanup) => {
|
|
602
|
+
if (!host || !scale) return;
|
|
603
|
+
onCleanup(
|
|
604
|
+
loadAppearanceUrls(
|
|
605
|
+
shown,
|
|
606
|
+
(signal) => host.renderAppearances(pageRef, scale, signal),
|
|
607
|
+
annotationKey,
|
|
608
|
+
(loaded) => urls.value = loaded
|
|
609
|
+
)
|
|
610
|
+
);
|
|
611
|
+
},
|
|
612
|
+
{ immediate: true }
|
|
613
|
+
);
|
|
614
|
+
const editingKey = computed(() => editingTextKeyOf(texts.value, annotationKey));
|
|
615
|
+
const NATIVE = { kind: "native", inert: false };
|
|
616
|
+
const drawn = computed(() => {
|
|
617
|
+
void activeToolId.value;
|
|
618
|
+
void registrations.value;
|
|
619
|
+
const host = annotation.value;
|
|
620
|
+
const renderers = props.renderers;
|
|
621
|
+
return items.value.map((item) => {
|
|
622
|
+
const record = item.annotation ?? null;
|
|
623
|
+
if (!record || !host) return { item, annotation: null, drawing: NATIVE };
|
|
624
|
+
const typing = editingKey.value !== null && annotationKey(record.ref) === editingKey.value;
|
|
625
|
+
return { item, annotation: record, drawing: annotationDrawingOf(record, host, renderers, typing) };
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
const ownTexts = computed(
|
|
629
|
+
() => layerTextBoxesOf(texts.value, items.value, props.renderers, annotationKey)
|
|
630
|
+
);
|
|
631
|
+
const itemsById = computed(() => new Map(items.value.map((item) => [item.id, item])));
|
|
632
|
+
const natives = /* @__PURE__ */ new Map();
|
|
633
|
+
const framedNatives = /* @__PURE__ */ new Map();
|
|
634
|
+
function nativeOf(id) {
|
|
635
|
+
let native = natives.get(id);
|
|
636
|
+
if (!native) {
|
|
637
|
+
native = markRaw(() => {
|
|
638
|
+
const item = itemsById.value.get(id);
|
|
639
|
+
return item ? h(_sfc_main$5, { item, urls: urls.value }) : null;
|
|
640
|
+
});
|
|
641
|
+
natives.set(id, native);
|
|
642
|
+
}
|
|
643
|
+
return native;
|
|
644
|
+
}
|
|
645
|
+
function framedNativeOf(id) {
|
|
646
|
+
let native = framedNatives.get(id);
|
|
647
|
+
if (!native) {
|
|
648
|
+
native = markRaw(() => {
|
|
649
|
+
const item = itemsById.value.get(id);
|
|
650
|
+
return item ? h(_sfc_main$9, { item, page: page.value }, () => h(nativeOf(id))) : null;
|
|
651
|
+
});
|
|
652
|
+
framedNatives.set(id, native);
|
|
653
|
+
}
|
|
654
|
+
return native;
|
|
655
|
+
}
|
|
656
|
+
watch(itemsById, (shown2) => {
|
|
657
|
+
for (const id of natives.keys()) if (!shown2.has(id)) natives.delete(id);
|
|
658
|
+
for (const id of framedNatives.keys()) if (!shown2.has(id)) framedNatives.delete(id);
|
|
659
|
+
});
|
|
660
|
+
const componentOf = (component) => toRaw(component);
|
|
661
|
+
return (_ctx, _cache) => {
|
|
662
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
663
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(drawn.value, ({ item, annotation: record, drawing }) => {
|
|
664
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
665
|
+
key: item.id
|
|
666
|
+
}, [
|
|
667
|
+
drawing.kind === "owned" && record ? (openBlock(), createBlock(resolveDynamicComponent(componentOf(drawing.entry.component)), {
|
|
668
|
+
key: 0,
|
|
669
|
+
annotation: record,
|
|
670
|
+
item,
|
|
671
|
+
page: unref(page),
|
|
672
|
+
native: framedNativeOf(item.id),
|
|
673
|
+
hovered: item.hovered ?? false,
|
|
674
|
+
selected: item.selected,
|
|
675
|
+
interactive: true
|
|
676
|
+
}, null, 8, ["annotation", "item", "page", "native", "hovered", "selected"])) : drawing.kind === "look" && record ? (openBlock(), createBlock(_sfc_main$9, {
|
|
677
|
+
key: 1,
|
|
678
|
+
item,
|
|
679
|
+
page: unref(page),
|
|
680
|
+
interactive: drawing.interactive,
|
|
681
|
+
inert: drawing.inert
|
|
682
|
+
}, {
|
|
683
|
+
default: withCtx(() => {
|
|
684
|
+
var _a;
|
|
685
|
+
return [
|
|
686
|
+
createVNode(_sfc_main$8, {
|
|
687
|
+
component: componentOf(drawing.entry.component),
|
|
688
|
+
scaled: drawing.entry.scale !== false,
|
|
689
|
+
annotation: record,
|
|
690
|
+
item,
|
|
691
|
+
page: unref(page),
|
|
692
|
+
native: nativeOf(item.id),
|
|
693
|
+
appearance: urls.value && unref(bakedAppearanceOf)(urls.value, item.id, ((_a = item.annotation) == null ? void 0 : _a.appearanceState) ?? null),
|
|
694
|
+
interactive: drawing.interactive
|
|
695
|
+
}, null, 8, ["component", "scaled", "annotation", "item", "page", "native", "appearance", "interactive"])
|
|
696
|
+
];
|
|
697
|
+
}),
|
|
698
|
+
_: 2
|
|
699
|
+
}, 1032, ["item", "page", "interactive", "inert"])) : (openBlock(), createBlock(_sfc_main$9, {
|
|
700
|
+
key: 2,
|
|
701
|
+
item,
|
|
702
|
+
page: unref(page),
|
|
703
|
+
inert: drawing.kind === "native" && drawing.inert
|
|
704
|
+
}, {
|
|
705
|
+
default: withCtx(() => [
|
|
706
|
+
createVNode(_sfc_main$5, {
|
|
707
|
+
item,
|
|
708
|
+
urls: urls.value
|
|
709
|
+
}, null, 8, ["item", "urls"])
|
|
710
|
+
]),
|
|
711
|
+
_: 2
|
|
712
|
+
}, 1032, ["item", "page", "inert"]))
|
|
713
|
+
], 64);
|
|
714
|
+
}), 128)),
|
|
715
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(ownTexts.value, (text) => {
|
|
716
|
+
return openBlock(), createBlock(_sfc_main$7, {
|
|
717
|
+
key: text.id,
|
|
718
|
+
item: text,
|
|
719
|
+
page: unref(page)
|
|
720
|
+
}, null, 8, ["item", "page"]);
|
|
721
|
+
}), 128)),
|
|
722
|
+
createVNode(_sfc_main$4, { page: unref(page) }, null, 8, ["page"]),
|
|
723
|
+
createVNode(_sfc_main$a, { page: unref(page) }, createSlots({ _: 2 }, [
|
|
724
|
+
slots.handle ? {
|
|
725
|
+
name: "handle",
|
|
726
|
+
fn: withCtx((handle) => [
|
|
727
|
+
renderSlot(_ctx.$slots, "handle", normalizeProps(guardReactiveProps(handle)))
|
|
728
|
+
]),
|
|
729
|
+
key: "0"
|
|
730
|
+
} : void 0,
|
|
731
|
+
slots["rotation-handle"] ? {
|
|
732
|
+
name: "rotation-handle",
|
|
733
|
+
fn: withCtx((handle) => [
|
|
734
|
+
renderSlot(_ctx.$slots, "rotation-handle", normalizeProps(guardReactiveProps(handle)))
|
|
735
|
+
]),
|
|
736
|
+
key: "1"
|
|
737
|
+
} : void 0
|
|
738
|
+
]), 1032, ["page"])
|
|
739
|
+
]);
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
744
|
+
__name: "AnnotationMenu",
|
|
745
|
+
props: {
|
|
746
|
+
gap: { default: 15 },
|
|
747
|
+
placement: { default: "top" }
|
|
748
|
+
},
|
|
749
|
+
setup(__props) {
|
|
750
|
+
const binding = useProjectorBinding();
|
|
751
|
+
const anchor = useOptionalSelector(
|
|
752
|
+
AnnotationToken$1,
|
|
753
|
+
(host) => {
|
|
754
|
+
const selection = host.selection.getAnchor();
|
|
755
|
+
if (!selection) return null;
|
|
756
|
+
const view = binding.value.projector.viewEnv(selection.page);
|
|
757
|
+
return view ? host.getSelectionAnchorIn(view) : selection;
|
|
758
|
+
},
|
|
759
|
+
null,
|
|
760
|
+
sameSelectionAnchor
|
|
761
|
+
);
|
|
762
|
+
return (_ctx, _cache) => {
|
|
763
|
+
return unref(anchor) ? (openBlock(), createBlock(_sfc_main$c, {
|
|
764
|
+
key: 0,
|
|
765
|
+
anchor: {
|
|
766
|
+
page: unref(anchor).page,
|
|
767
|
+
bounds: unref(anchor).bounds,
|
|
768
|
+
...unref(anchor).rotationHandle ? { avoid: [unref(anchor).rotationHandle] } : {}
|
|
769
|
+
},
|
|
770
|
+
placement: __props.placement,
|
|
771
|
+
gap: __props.gap
|
|
772
|
+
}, {
|
|
773
|
+
default: withCtx(() => [
|
|
774
|
+
renderSlot(_ctx.$slots, "default")
|
|
775
|
+
]),
|
|
776
|
+
_: 3
|
|
777
|
+
}, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
782
|
+
__name: "AnnotationDraftMenu",
|
|
783
|
+
props: {
|
|
784
|
+
gap: { default: 8 },
|
|
785
|
+
placement: { default: "top" }
|
|
786
|
+
},
|
|
787
|
+
setup(__props) {
|
|
788
|
+
const draft = useOptionalSelector(
|
|
789
|
+
AnnotationToken$2,
|
|
790
|
+
(annotation) => annotation.draft.get(),
|
|
791
|
+
null,
|
|
792
|
+
sameCreationDraftAnchor
|
|
793
|
+
);
|
|
794
|
+
return (_ctx, _cache) => {
|
|
795
|
+
return unref(draft) ? (openBlock(), createBlock(_sfc_main$c, {
|
|
796
|
+
key: 0,
|
|
797
|
+
anchor: unref(draft),
|
|
798
|
+
placement: __props.placement,
|
|
799
|
+
gap: __props.gap
|
|
800
|
+
}, {
|
|
801
|
+
default: withCtx(() => [
|
|
802
|
+
renderSlot(_ctx.$slots, "default", { draft: unref(draft) })
|
|
803
|
+
]),
|
|
804
|
+
_: 3
|
|
805
|
+
}, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
810
|
+
__name: "AnnotationRotationBadge",
|
|
811
|
+
props: {
|
|
812
|
+
gap: { default: 16 },
|
|
813
|
+
placement: { default: "right" }
|
|
814
|
+
},
|
|
815
|
+
setup(__props) {
|
|
816
|
+
const slots = useSlots();
|
|
817
|
+
const rotation = useOptionalSelector(
|
|
818
|
+
AnnotationToken$2,
|
|
819
|
+
(annotation) => annotation.selection.getRotationAnchor(),
|
|
820
|
+
null,
|
|
821
|
+
sameRotationAnchor
|
|
822
|
+
);
|
|
823
|
+
const readout = useAnnotationSettings((settings) => settings.chrome.readout);
|
|
824
|
+
const badge = computed(
|
|
825
|
+
() => ({
|
|
826
|
+
pointerEvents: "none",
|
|
827
|
+
whiteSpace: "nowrap",
|
|
828
|
+
borderRadius: "4px",
|
|
829
|
+
padding: "2px 6px",
|
|
830
|
+
fontFamily: paintDefault("font-mono"),
|
|
831
|
+
fontSize: "12px",
|
|
832
|
+
background: paint("readout-background", readout.value.background),
|
|
833
|
+
color: paint("readout-color", readout.value.color)
|
|
834
|
+
})
|
|
835
|
+
);
|
|
836
|
+
return (_ctx, _cache) => {
|
|
837
|
+
return unref(rotation) && (slots.default || unref(readout).enabled) ? (openBlock(), createBlock(_sfc_main$c, {
|
|
838
|
+
key: 0,
|
|
839
|
+
anchor: { page: unref(rotation).page, bounds: { ...unref(rotation).at, width: 0, height: 0 } },
|
|
840
|
+
placement: __props.placement,
|
|
841
|
+
gap: __props.gap
|
|
842
|
+
}, {
|
|
843
|
+
default: withCtx(() => [
|
|
844
|
+
slots.default ? renderSlot(_ctx.$slots, "default", { rotation: unref(rotation) }, void 0, void 0, 0) : (openBlock(), createElementBlock("div", {
|
|
845
|
+
key: 1,
|
|
846
|
+
style: normalizeStyle(badge.value)
|
|
847
|
+
}, toDisplayString(unref(rotation).angle) + "°", 5))
|
|
848
|
+
]),
|
|
849
|
+
_: 3
|
|
850
|
+
}, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
function useAnnotation() {
|
|
855
|
+
return useCapability(AnnotationToken$2);
|
|
856
|
+
}
|
|
857
|
+
function useAnnotationEvent(select, handler) {
|
|
858
|
+
useCapabilityEvent(AnnotationToken$2, select, handler);
|
|
859
|
+
}
|
|
860
|
+
const NO_ANNOTATIONS = Object.freeze([]);
|
|
861
|
+
function useAnnotationList(filter) {
|
|
862
|
+
return useOptionalSelector(
|
|
863
|
+
AnnotationToken$2,
|
|
864
|
+
(annotation) => annotation.list(toValue(filter)),
|
|
865
|
+
NO_ANNOTATIONS,
|
|
866
|
+
shallowEqual
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
const NO_DEFAULTS = Object.freeze({});
|
|
870
|
+
function useAnnotationDefaults(toolId) {
|
|
871
|
+
return useOptionalSelector(
|
|
872
|
+
AnnotationToken$2,
|
|
873
|
+
(annotation) => annotation.tools.getDefaults(toValue(toolId)),
|
|
874
|
+
NO_DEFAULTS
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
const NO_PROPERTIES = Object.freeze({
|
|
878
|
+
properties: [],
|
|
879
|
+
values: {},
|
|
880
|
+
mixed: []
|
|
881
|
+
});
|
|
882
|
+
function useAnnotationProperties(toolId) {
|
|
883
|
+
return useOptionalSelector(
|
|
884
|
+
AnnotationToken$2,
|
|
885
|
+
(annotation) => {
|
|
886
|
+
const tool = toValue(toolId);
|
|
887
|
+
return tool === void 0 ? annotation.selection.getProperties() : annotation.tools.getProperties(tool);
|
|
888
|
+
},
|
|
889
|
+
NO_PROPERTIES
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
function useAnnotationAnchor(ref2) {
|
|
893
|
+
return useOptionalSelector(
|
|
894
|
+
AnnotationToken$1,
|
|
895
|
+
(annotation) => {
|
|
896
|
+
const wanted = toValue(ref2);
|
|
897
|
+
return wanted ? annotation.getAnnotationAnchor(wanted) : null;
|
|
898
|
+
},
|
|
899
|
+
null,
|
|
900
|
+
sameAnnotationAnchor
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
function useComments() {
|
|
904
|
+
const annotation = useAnnotation();
|
|
905
|
+
const target = markRaw({});
|
|
906
|
+
return new Proxy(target, {
|
|
907
|
+
get: (_target, key) => typeof key === "string" && key.startsWith("__v_") ? Reflect.get(target, key) : Reflect.get(annotation.comments, key),
|
|
908
|
+
has: (_target, key) => Reflect.has(annotation.comments, key)
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
const NO_PAGES = Object.freeze([]);
|
|
912
|
+
const NO_THREADS = Object.freeze([]);
|
|
913
|
+
function useCommentThreads() {
|
|
914
|
+
const documentId = useDocumentId();
|
|
915
|
+
const threads = useOptionalSelector(
|
|
916
|
+
AnnotationToken$2,
|
|
917
|
+
(annotation) => annotation.comments.listThreads(),
|
|
918
|
+
NO_THREADS
|
|
919
|
+
);
|
|
920
|
+
const pages = useKernelValue(
|
|
921
|
+
(kernel) => documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES
|
|
922
|
+
);
|
|
923
|
+
return computed(() => enrichCommentThreads(threads.value, pages.value));
|
|
924
|
+
}
|
|
925
|
+
function useCommentThread(ref2) {
|
|
926
|
+
const views = useCommentThreads();
|
|
927
|
+
const annotation = useOptionalCapability(AnnotationToken$2);
|
|
928
|
+
return computed(() => {
|
|
929
|
+
const wanted = toValue(ref2);
|
|
930
|
+
const api = annotation.value;
|
|
931
|
+
if (wanted == null || !api) return null;
|
|
932
|
+
const thread = api.comments.getThread(wanted);
|
|
933
|
+
if (!thread) return null;
|
|
934
|
+
const root = annotationKey(thread.root.ref);
|
|
935
|
+
return views.value.find((view) => annotationKey(view.root.ref) === root) ?? null;
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
const filePickerProvider = pickRequestedFile;
|
|
939
|
+
function useFilePickerProvider(provider = filePickerProvider) {
|
|
940
|
+
const annotation = useOptionalCapability(AnnotationToken$2);
|
|
941
|
+
watch(
|
|
942
|
+
[annotation, () => unref(provider)],
|
|
943
|
+
([capability, current], _previous, onCleanup) => {
|
|
944
|
+
if (!capability) return;
|
|
945
|
+
onCleanup(
|
|
946
|
+
installFilePickerProvider(
|
|
947
|
+
capability,
|
|
948
|
+
current,
|
|
949
|
+
() => devWarn(
|
|
950
|
+
"file-picker-provider-twice",
|
|
951
|
+
"useFilePickerProvider() is called from two mounted components for the same document — the later one wins. Call it once, at a document-scoped spot."
|
|
952
|
+
)
|
|
953
|
+
)
|
|
954
|
+
);
|
|
955
|
+
},
|
|
956
|
+
{ immediate: true }
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
export {
|
|
960
|
+
_sfc_main$1 as _,
|
|
961
|
+
_sfc_main$3 as a,
|
|
962
|
+
_sfc_main$2 as b,
|
|
963
|
+
_sfc_main as c,
|
|
964
|
+
useAnnotationAnchor as d,
|
|
965
|
+
useAnnotationDefaults as e,
|
|
966
|
+
filePickerProvider as f,
|
|
967
|
+
useAnnotationEvent as g,
|
|
968
|
+
useAnnotationList as h,
|
|
969
|
+
useAnnotationProperties as i,
|
|
970
|
+
useAnnotationSettings as j,
|
|
971
|
+
useAnnotationState as k,
|
|
972
|
+
useCommentThread as l,
|
|
973
|
+
useCommentThreads as m,
|
|
974
|
+
useComments as n,
|
|
975
|
+
useFilePickerProvider as o,
|
|
976
|
+
useRichTextEditor as p,
|
|
977
|
+
useAnnotation as u
|
|
978
|
+
};
|
|
979
|
+
//# sourceMappingURL=composables-DK3lwh38.js.map
|