@inkbar/vue 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +70 -4
  2. package/dist/components/InkDownloadButton.js +7 -0
  3. package/dist/components/InkDownloadButton.js.map +1 -0
  4. package/dist/components/InkDownloadButton.vue.d.ts +21 -0
  5. package/dist/components/InkDownloadButton.vue.d.ts.map +1 -0
  6. package/dist/components/InkDownloadButton.vue_vue_type_script_setup_true_lang.js +42 -0
  7. package/dist/components/InkDownloadButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  8. package/dist/components/InkFindBar.js.map +1 -1
  9. package/dist/components/InkFindBar.vue.d.ts.map +1 -1
  10. package/dist/components/InkFindBar.vue_vue_type_script_setup_true_lang.js +48 -48
  11. package/dist/components/InkFindBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/InkHighlightMenu.js.map +1 -1
  13. package/dist/components/InkHighlightMenu.vue.d.ts.map +1 -1
  14. package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js +67 -65
  15. package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/components/InkPanel.js +7 -0
  17. package/dist/components/InkPanel.js.map +1 -0
  18. package/dist/components/InkPanel.vue.d.ts +21 -0
  19. package/dist/components/InkPanel.vue.d.ts.map +1 -0
  20. package/dist/components/InkPanel.vue_vue_type_script_setup_true_lang.js +48 -0
  21. package/dist/components/InkPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  22. package/dist/components/InkPrintButton.js +7 -0
  23. package/dist/components/InkPrintButton.js.map +1 -0
  24. package/dist/components/InkPrintButton.vue.d.ts +19 -0
  25. package/dist/components/InkPrintButton.vue.d.ts.map +1 -0
  26. package/dist/components/InkPrintButton.vue_vue_type_script_setup_true_lang.js +39 -0
  27. package/dist/components/InkPrintButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  28. package/dist/components/InkRecordList.js +7 -0
  29. package/dist/components/InkRecordList.js.map +1 -0
  30. package/dist/components/InkRecordList.vue.d.ts +35 -0
  31. package/dist/components/InkRecordList.vue.d.ts.map +1 -0
  32. package/dist/components/InkRecordList.vue_vue_type_script_setup_true_lang.js +41 -0
  33. package/dist/components/InkRecordList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  34. package/dist/components/InkRoot.js.map +1 -1
  35. package/dist/components/InkRoot.vue.d.ts +48 -4
  36. package/dist/components/InkRoot.vue.d.ts.map +1 -1
  37. package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +177 -164
  38. package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/components/InkSearchResults.js +7 -0
  40. package/dist/components/InkSearchResults.js.map +1 -0
  41. package/dist/components/InkSearchResults.vue.d.ts +9 -0
  42. package/dist/components/InkSearchResults.vue.d.ts.map +1 -0
  43. package/dist/components/InkSearchResults.vue_vue_type_script_setup_true_lang.js +52 -0
  44. package/dist/components/InkSearchResults.vue_vue_type_script_setup_true_lang.js.map +1 -0
  45. package/dist/components/InkShapeMenu.js.map +1 -1
  46. package/dist/components/InkShapeMenu.vue.d.ts.map +1 -1
  47. package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js +58 -56
  48. package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/InkSidebar.js +7 -0
  50. package/dist/components/InkSidebar.js.map +1 -0
  51. package/dist/components/InkSidebar.vue.d.ts +34 -0
  52. package/dist/components/InkSidebar.vue.d.ts.map +1 -0
  53. package/dist/components/InkSidebar.vue_vue_type_script_setup_true_lang.js +95 -0
  54. package/dist/components/InkSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  55. package/dist/components/InkSignatureDialog.js.map +1 -1
  56. package/dist/components/InkSignatureDialog.vue.d.ts +3 -2
  57. package/dist/components/InkSignatureDialog.vue.d.ts.map +1 -1
  58. package/dist/components/InkSignatureDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/InkSignatureMenu.js.map +1 -1
  60. package/dist/components/InkSignatureMenu.vue.d.ts.map +1 -1
  61. package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js +77 -75
  62. package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/InkThumbnail.js +7 -0
  64. package/dist/components/InkThumbnail.js.map +1 -0
  65. package/dist/components/InkThumbnail.vue.d.ts +18 -0
  66. package/dist/components/InkThumbnail.vue.d.ts.map +1 -0
  67. package/dist/components/InkThumbnail.vue_vue_type_script_setup_true_lang.js +49 -0
  68. package/dist/components/InkThumbnail.vue_vue_type_script_setup_true_lang.js.map +1 -0
  69. package/dist/components/InkThumbnails.js +7 -0
  70. package/dist/components/InkThumbnails.js.map +1 -0
  71. package/dist/components/InkThumbnails.vue.d.ts +27 -0
  72. package/dist/components/InkThumbnails.vue.d.ts.map +1 -0
  73. package/dist/components/InkThumbnails.vue_vue_type_script_setup_true_lang.js +107 -0
  74. package/dist/components/InkThumbnails.vue_vue_type_script_setup_true_lang.js.map +1 -0
  75. package/dist/components/InkToolButton.js.map +1 -1
  76. package/dist/components/InkToolButton.vue.d.ts.map +1 -1
  77. package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js +39 -36
  78. package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  79. package/dist/components/InkToolbarButton.js +7 -0
  80. package/dist/components/InkToolbarButton.js.map +1 -0
  81. package/dist/components/InkToolbarButton.vue.d.ts +22 -0
  82. package/dist/components/InkToolbarButton.vue.d.ts.map +1 -0
  83. package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js +32 -0
  84. package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  85. package/dist/components/InkViewport.js.map +1 -1
  86. package/dist/components/InkViewport.vue.d.ts.map +1 -1
  87. package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js +37 -36
  88. package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
  89. package/dist/components/InkZoomSelect.js.map +1 -1
  90. package/dist/components/InkZoomSelect.vue.d.ts.map +1 -1
  91. package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  92. package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/RecordCards.js +7 -0
  94. package/dist/components/RecordCards.js.map +1 -0
  95. package/dist/components/RecordCards.vue.d.ts +25 -0
  96. package/dist/components/RecordCards.vue.d.ts.map +1 -0
  97. package/dist/components/RecordCards.vue_vue_type_script_setup_true_lang.js +120 -0
  98. package/dist/components/RecordCards.vue_vue_type_script_setup_true_lang.js.map +1 -0
  99. package/dist/components/SidebarTrigger.js +7 -0
  100. package/dist/components/SidebarTrigger.js.map +1 -0
  101. package/dist/components/SidebarTrigger.vue.d.ts +9 -0
  102. package/dist/components/SidebarTrigger.vue.d.ts.map +1 -0
  103. package/dist/components/SidebarTrigger.vue_vue_type_script_setup_true_lang.js +33 -0
  104. package/dist/components/SidebarTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
  105. package/dist/components/SignatureForm.js.map +1 -1
  106. package/dist/components/SignatureForm.vue.d.ts.map +1 -1
  107. package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js +56 -55
  108. package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/components/sidebar-context.d.ts +21 -0
  110. package/dist/components/sidebar-context.d.ts.map +1 -0
  111. package/dist/components/sidebar-context.js +7 -0
  112. package/dist/components/sidebar-context.js.map +1 -0
  113. package/dist/composables/useAnnotations.d.ts +91 -0
  114. package/dist/composables/useAnnotations.d.ts.map +1 -1
  115. package/dist/composables/useRecordSelection.d.ts +12 -0
  116. package/dist/composables/useRecordSelection.d.ts.map +1 -0
  117. package/dist/composables/useRecordSelection.js +15 -0
  118. package/dist/composables/useRecordSelection.js.map +1 -0
  119. package/dist/composables/useRecords.d.ts +14 -0
  120. package/dist/composables/useRecords.d.ts.map +1 -0
  121. package/dist/composables/useRecords.js +16 -0
  122. package/dist/composables/useRecords.js.map +1 -0
  123. package/dist/composables/useRegisteredTool.d.ts +21 -0
  124. package/dist/composables/useRegisteredTool.d.ts.map +1 -0
  125. package/dist/composables/useRegisteredTool.js +25 -0
  126. package/dist/composables/useRegisteredTool.js.map +1 -0
  127. package/dist/composables/useSearch.d.ts.map +1 -1
  128. package/dist/composables/useSearch.js +1 -0
  129. package/dist/composables/useSearch.js.map +1 -1
  130. package/dist/composables/useToolOptions.d.ts +8 -0
  131. package/dist/composables/useToolOptions.d.ts.map +1 -1
  132. package/dist/composables/useToolOptions.js +10 -5
  133. package/dist/composables/useToolOptions.js.map +1 -1
  134. package/dist/context.d.ts +5 -0
  135. package/dist/context.d.ts.map +1 -1
  136. package/dist/context.js.map +1 -1
  137. package/dist/index.d.ts +12 -0
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +40 -29
  140. package/dist/to-readable.d.ts +7 -0
  141. package/dist/to-readable.d.ts.map +1 -0
  142. package/dist/to-readable.js +11 -0
  143. package/dist/to-readable.js.map +1 -0
  144. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"InkRoot.js","names":["_sfc_main","InkRoot_vue_vue_type_script_setup_true_lang_default","InkRoot_default"],"sources":["../../src/components/InkRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n createMemorySignatureStore,\n createSignatureLibrary,\n InkError,\n openDocument,\n readonly,\n writable,\n} from '@inkbar/core'\nimport {\n attachHistoryKeys,\n createPluginHost,\n createSearchController,\n createToolOptions,\n handleFindKey,\n pageSelectionText,\n viewerSearchOf,\n cssVariableDefaults,\n FONT_FAMILIES,\n keepHistoryFocus,\n SIGNATURE_FONTS,\n trackToolStyle,\n} from '@inkbar/core/dom'\nimport { Primitive } from 'reka-ui'\nimport {\n computed,\n onBeforeUnmount,\n onUnmounted,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { provideInkContext, type InkHistory, type InkStatus } from '../context'\nimport { createRefHistory } from '../ref-history'\nimport { useReadable } from '../use-readable'\n\nimport type {\n Annotation,\n AnnotationChange,\n AnnotationDefaults,\n DocumentSource,\n FieldsChange,\n FieldValues,\n FormAction,\n InkDocument,\n PdfAssets,\n SignatureStore,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n InkPlugin,\n PluginHost,\n SearchController,\n Tool,\n ToolController,\n ToolId,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n src: DocumentSource | null\n assets: PdfAssets\n password?: string | undefined\n /** Colour defaults. Without it, the theme's CSS variables on the root element apply. */\n defaults?: AnnotationDefaults | undefined\n /**\n * Pass (with v-model) to put annotations under the host's control. The mode is fixed when a\n * document opens: passing or dropping this prop later takes effect on the next open.\n */\n annotations?: Annotation[] | undefined\n /**\n * Pass (with `v-model:fields`) to put the form's field values under the host's control. A\n * commit shows at once and is reported after; the host's push wins. The mode is fixed when\n * a document opens, as for `annotations`.\n */\n fields?: FieldValues | undefined\n /** Tints fillable form fields. Default true. A change applies to the open document in place. */\n formHighlight?: boolean | undefined\n tool?: ToolId | undefined\n /**\n * Host tools, added to the built-ins; one with a built-in's id replaces it. Read when a\n * document opens.\n */\n tools?: Tool[] | undefined\n /**\n * Plugins, set up once when the root is created; a later change to this prop is not\n * applied. Their tools join `tools`, their decoration and page layers apply to every\n * document, and their commands are placed with `InkCommand` or `useCommand`.\n */\n plugins?: InkPlugin[] | undefined\n /**\n * Adds `data-*` attributes, classes and a screen-reader description to each annotation's\n * element (see `DecorateAnnotation`). Decorations re-apply whenever the annotations change\n * and when this prop changes, without rebuilding the viewer. Pass a new function when its\n * output would change for any other reason.\n */\n decorateAnnotation?: DecorateAnnotation | undefined\n /**\n * The font families text boxes offer, replacing the PDF standard families\n * (`FONT_FAMILIES`). Fonts beyond those are the PDF writer's to embed.\n */\n fonts?: string[] | undefined\n /**\n * Where saved signatures live. Default: memory, gone on reload.\n * `createLocalSignatureStore` keeps them in the browser; a host can keep them anywhere.\n * A new store takes effect at once, for the menus and the `signature` tool alike.\n */\n signatures?: SignatureStore | undefined\n /** The handwriting fonts a typed signature offers; the host loads them. */\n signatureFonts?: string[] | undefined\n page?: number | undefined\n zoom?: ZoomValue | undefined\n /** Undo history. Defaults to on for uncontrolled, off for controlled. */\n history?: boolean | undefined\n asChild?: boolean\n }>(),\n {\n password: undefined,\n defaults: undefined,\n annotations: undefined,\n fields: undefined,\n formHighlight: undefined,\n tool: undefined,\n tools: undefined,\n plugins: undefined,\n decorateAnnotation: undefined,\n fonts: undefined,\n signatures: undefined,\n signatureFonts: undefined,\n page: undefined,\n zoom: undefined,\n history: undefined,\n asChild: false,\n }\n)\n\nconst emit = defineEmits<{\n 'update:annotations': [next: Annotation[]]\n change: [change: AnnotationChange]\n /** Committed field values, in full, with what changed them. */\n 'update:fields': [next: FieldValues, change: FieldsChange]\n /** The form asked to submit, open a link, send mail, print or prompt. Inkbar does none. */\n 'form-action': [action: FormAction]\n 'update:tool': [tool: ToolId]\n 'update:page': [page: number]\n 'update:zoom': [zoom: ZoomValue]\n ready: [doc: InkDocument]\n /**\n * Opening failed, or later a form script failed or a signature field refused its signing.\n * An error from while the document opened comes after `ready`.\n */\n error: [error: InkError]\n activate: [id: string]\n}>()\n\ntype TestHookElement = HTMLElement & { __inkDocument?: InkDocument | undefined }\n\n// A template ref on Primitive is a component instance; the context needs its element.\nconst primitive = useTemplateRef<{ $el: unknown }>('primitive')\nconst rootEl = shallowRef<HTMLElement | null>(null)\nfunction syncRootEl(): void {\n const el = primitive.value?.$el\n rootEl.value = el instanceof HTMLElement ? el : null\n}\n\nconst document = shallowRef<InkDocument | null>(null)\n/** Overrides the document's status while opening, and when opening itself failed. */\nconst override = shallowRef<InkStatus | null>(null)\nconst idle: InkStatus = { state: 'idle' }\nconst documentStatus = useReadable<InkStatus>(() => document.value?.status ?? null, idle)\nconst status = computed<InkStatus>(() => override.value ?? documentStatus.value)\nconst annotationList = useReadable<readonly Annotation[]>(\n () => document.value?.annotations.list ?? null,\n []\n)\nconst selection = useReadable<readonly string[]>(\n () => document.value?.annotations.selection ?? null,\n []\n)\nconst viewport = shallowRef<Viewport | null>(null)\nconst toolController = shallowRef<ToolController | null>(null)\nconst internalTool = ref<ToolId>(props.tool ?? 'select-text')\nconst activated = ref<string | null>(null)\n\nconst controlled = computed(() => props.annotations !== undefined)\nconst fieldsControlled = computed(() => props.fields !== undefined)\n\nfunction setActivated(id: string | null): void {\n activated.value = id\n if (id) emit('activate', id)\n}\n\nconst noop = () => {}\n\n/** Signed URLs change; the key does not. Bytes and Blobs are their own identity. */\nfunction identity(src: DocumentSource | null): unknown {\n if (src === null) return null\n if (typeof src === 'string') return src\n if ('key' in src) return src.key\n return src\n}\n\nfunction setTestHook(doc: InkDocument | undefined): void {\n if (import.meta.env.DEV && rootEl.value)\n (rootEl.value as TestHookElement).__inkDocument = doc\n}\n\nlet generation = 0\nlet stopFormErrors: () => void = noop\nfunction release(): void {\n stopFormErrors()\n stopFormErrors = noop\n // Cleared first, so the plugins close their stores while the document is still alive.\n const doc = document.value\n document.value = null\n doc?.destroy()\n setTestHook(undefined)\n}\n\nasync function open(): Promise<void> {\n const gen = ++generation\n const src = props.src\n release()\n refHistory.clear()\n if (src === null) {\n override.value = null\n return\n }\n override.value = { state: 'loading' }\n syncRootEl()\n let doc: InkDocument\n try {\n doc = await openDocument(src, {\n assets: props.assets,\n password: props.password,\n defaults:\n props.defaults ?? (rootEl.value ? cssVariableDefaults(rootEl.value) : undefined),\n // Controlled hosts get the ref history below; core's own stack stays off.\n history: controlled.value ? false : (props.history ?? true),\n annotations: controlled.value\n ? {\n mode: 'controlled',\n initial: props.annotations ?? [],\n onChange: (next, change) => {\n emit('update:annotations', next)\n emit('change', change)\n },\n }\n : { mode: 'uncontrolled' },\n fields: fieldsControlled.value\n ? {\n mode: 'controlled',\n initial: props.fields ?? {},\n onChange: (next, change) => emit('update:fields', next, change),\n }\n : { mode: 'uncontrolled' },\n })\n } catch (cause) {\n if (gen !== generation) return\n const error =\n cause instanceof InkError\n ? cause\n : new InkError(\n 'InvalidPdf',\n cause instanceof Error ? cause.message : String(cause),\n {},\n cause\n )\n override.value = { state: 'error', error }\n emit('error', error)\n return\n }\n if (gen !== generation) {\n doc.destroy()\n return\n }\n // The prop may have changed while the file loaded, when there was no store to apply it to.\n if (doc.annotations.mode === 'controlled' && props.annotations !== undefined)\n doc.annotations.setControlledValue(props.annotations)\n // The same for the fields; a document whose fields opened uncontrolled ignores the push.\n if (props.fields !== undefined) doc.form.setControlledValue(props.fields)\n // A form script that fails leaves the form fillable; the failure goes to `error`. Subscribed\n // before anyone hears of the document, so the form replays the errors from while it opened\n // here, not to a listener added in `ready`; they are held until `ready` has gone out.\n let held: InkError[] | undefined = []\n stopFormErrors = doc.form.on('error', (e) => {\n if (held) held.push(e)\n else emit('error', e)\n })\n document.value = doc\n override.value = null\n setTestHook(doc)\n const s = doc.status.get()\n if (s.state === 'ready') emit('ready', doc)\n else if (s.state === 'error') emit('error', s.error)\n const early = held\n held = undefined\n if (gen === generation) for (const e of early) emit('error', e)\n}\n\nconst refHistory = createRefHistory({\n source: () => props.annotations,\n apply: (list) => document.value?.annotations.replaceAll(list, 'history'),\n enabled: computed(() => controlled.value && props.history === true),\n store: () =>\n document.value?.annotations.mode === 'controlled' ? document.value.annotations : null,\n})\nconst coreCanUndo = useReadable(() => document.value?.history.canUndo ?? null, false)\nconst coreCanRedo = useReadable(() => document.value?.history.canRedo ?? null, false)\nconst inkHistory: InkHistory = {\n canUndo: computed(() =>\n controlled.value ? refHistory.canUndo.value : coreCanUndo.value\n ),\n canRedo: computed(() =>\n controlled.value ? refHistory.canRedo.value : coreCanRedo.value\n ),\n undo: () => (controlled.value ? refHistory.undo() : document.value?.history.undo()),\n redo: () => (controlled.value ? refHistory.redo() : document.value?.history.redo()),\n clear: () => (controlled.value ? refHistory.clear() : document.value?.history.clear()),\n batch: (fn) => {\n if (controlled.value) refHistory.batch(fn)\n else if (document.value) document.value.history.batch(fn)\n else fn()\n },\n track: (store) =>\n controlled.value\n ? refHistory.track(store)\n : (document.value?.history.track(store) ?? noop),\n react: (fn) =>\n controlled.value ? refHistory.react(fn) : (document.value?.history.react(fn) ?? noop),\n}\n\n// The undo and redo keys anywhere in the root do what InkUndo and InkRedo do. When either\n// button undoes or redoes the last step and disables itself, focus goes back to the document.\n// The find key listens here too.\nwatch(\n rootEl,\n (el, _prev, onCleanup) => {\n if (!el) return\n const stopKeys = attachHistoryKeys(el, () => ({\n canUndo: inkHistory.canUndo.value,\n canRedo: inkHistory.canRedo.value,\n undo: inkHistory.undo,\n redo: inkHistory.redo,\n }))\n const stopFocus = keepHistoryFocus(el, () =>\n el.querySelector<HTMLElement>('[data-ink-scroll]')\n )\n // Not a template listener: Vue leaves those on the element when it unmounts.\n el.addEventListener('keydown', onKeydown)\n onCleanup(() => {\n stopKeys()\n stopFocus()\n el.removeEventListener('keydown', onKeydown)\n })\n },\n { immediate: true }\n)\n\n/*\n * One plugin host for the root's life, built once mounted so that no `setup` runs on the\n * server, where nothing would clean it up. Until then `pluginHost` is null, and InkCommand\n * renders its command disabled. The host follows `hostDocument`, which is set after `document`\n * (a sync watch): when the host reads `inkHistory` for a new document, it is that document's\n * history.\n */\nconst hostDocument = writable<InkDocument | null>(null)\nwatch(document, (doc) => hostDocument.set(doc), { flush: 'sync' })\nconst viewportEl = shallowRef<HTMLElement | null>(null)\nconst hostRoot = writable<HTMLElement | null>(null)\nwatch(viewportEl, (el) => hostRoot.set(el), { flush: 'sync' })\nconst hostActivated = writable<string | null>(null)\nwatch(activated, (id) => hostActivated.set(id), { flush: 'sync' })\nconst pluginHost = shallowRef<PluginHost | null>(null)\n/** One search controller for the root's life, built with the plugin host that shares it. */\nconst search = shallowRef<SearchController | null>(null)\nfunction setUpPlugins(): void {\n const controller = createSearchController({\n document: readonly(hostDocument),\n viewport: () => viewport.value,\n })\n search.value = controller\n pluginHost.value = createPluginHost({\n plugins: props.plugins ?? [],\n document: readonly(hostDocument),\n history: () => inkHistory,\n activated: readonly(hostActivated),\n // As in `createViewer`: an id not in the open document is ignored.\n setActivated: (id) => {\n if (id === null || document.value?.annotations.get(id)) setActivated(id)\n },\n root: readonly(hostRoot),\n decorate: () => props.decorateAnnotation,\n viewport: () => viewport.value,\n search: viewerSearchOf(controller),\n })\n}\n\n/** Ctrl/Cmd+F while focus is in the root and a find bar is mounted; else the browser's. */\nfunction onKeydown(e: KeyboardEvent): void {\n const controller = search.value\n const root = e.currentTarget\n if (controller && root instanceof HTMLElement)\n handleFindKey(e, controller, () => pageSelectionText(root))\n}\n\n/** The document's tool style; it batches through `inkHistory`, whichever mode is on. */\nconst toolStyle = shallowRef<ToolStyle | null>(null)\nlet setStyleTool: ((id: ToolId) => void) | undefined\nwatch(\n document,\n (doc) => {\n if (!doc) {\n toolStyle.value = null\n setStyleTool = undefined\n return\n }\n const tracker = trackToolStyle({\n store: doc.annotations,\n history: { batch: (fn) => inkHistory.batch(fn) },\n // The plugins' tools too, so a plugin tool's style group applies (the host is set by now:\n // it is built on mount, before the first document opens).\n tools: [...(props.tools ?? []), ...(pluginHost.value?.tools ?? [])],\n tool: internalTool.value,\n })\n setStyleTool = (id) => tracker.setTool(id)\n toolStyle.value = tracker.toolStyle\n },\n // Sync: the style is in place before InkViewport's watcher mounts the engine with it.\n { immediate: true, flush: 'sync' }\n)\nwatch(internalTool, (id) => setStyleTool?.(id))\n\n// Plugins and the document on the client only: on the server InkRoot renders its empty slot.\n// The plugins first, so the first document opens with their stores and reactions.\nonMounted(() => {\n syncRootEl()\n // A plugin whose setup throws still leaves the document to open; the error then goes to\n // Vue's error handling (`onErrorCaptured`, `app.config.errorHandler`).\n try {\n setUpPlugins()\n } finally {\n void open()\n }\n})\nonUpdated(syncRootEl)\n\n// Separate sources, so a new `{ url, key }` object with the same key compares equal.\nwatch([() => identity(props.src), () => props.password], () => void open())\n\nwatch(\n () => props.annotations,\n (next) => {\n if (next && document.value?.annotations.mode === 'controlled')\n document.value.annotations.setControlledValue(next)\n }\n)\n\nwatch(\n () => props.fields,\n (next) => {\n if (next) document.value?.form.setControlledValue(next)\n }\n)\n\nwatch(\n () => props.tool,\n (t) => {\n if (t) internalTool.value = t\n }\n)\n\nfunction setTool(id: ToolId): void {\n // Picking the active tool again starts it afresh, as after a one-shot tool's use.\n const tc = toolController.value\n if (internalTool.value === id && tc?.active.get() === id) tc.set(id)\n internalTool.value = id\n emit('update:tool', id)\n}\n\nonBeforeUnmount(() => {\n generation++\n release()\n})\n\n// After the children: InkViewport's engine, and the plugin layers with it, are gone by now, as\n// in `createViewer`, so no layer `destroy` runs after the plugins' cleanups.\nonUnmounted(() => {\n pluginHost.value?.destroy()\n pluginHost.value = null\n search.value?.destroy()\n search.value = null\n})\n\nconst signatures = computed(() =>\n createSignatureLibrary(props.signatures ?? createMemorySignatureStore())\n)\nwatch(signatures, (lib) => void lib.refresh(), { immediate: true })\n/** Tool options last as long as the root; the tool style is per document. */\nconst toolOptions = createToolOptions()\n\nprovideInkContext({\n assets: computed(() => props.assets),\n document,\n status,\n annotations: annotationList,\n selection,\n viewport,\n tools: toolController,\n tool: internalTool,\n setTool,\n hostTools: computed(() => props.tools),\n decorateAnnotation: computed(() => props.decorateAnnotation),\n fonts: computed(() => props.fonts ?? FONT_FAMILIES),\n toolOptions,\n signatures,\n signatureFonts: computed(() => props.signatureFonts ?? SIGNATURE_FONTS),\n toolStyle,\n zoomModel: computed(() => props.zoom),\n pageModel: computed(() => props.page),\n reportZoom: (z) => emit('update:zoom', z),\n reportPage: (p) => emit('update:page', p),\n activated,\n setActivated,\n pluginHost,\n search,\n viewportEl,\n history: inkHistory,\n rootEl,\n formHighlight: computed(() => props.formHighlight),\n reportFormAction: (a) => emit('form-action', a),\n reportError: (e) => emit('error', e),\n})\n\n// `history` is what `useHistory()` returns inside the root, for hosts that hold a template ref:\n// a controlled host calls `history.clear()` after loading its saved list.\ndefineExpose({ document, status, rootEl, history: inkHistory })\n</script>\n\n<template>\n <Primitive\n ref=\"primitive\"\n :as-child=\"props.asChild\"\n as=\"div\"\n data-ink-root\n :data-state=\"status.state\"\n >\n <slot :status=\"status\" :document=\"document\" />\n </Primitive>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"InkRoot.js","names":["_sfc_main","InkRoot_vue_vue_type_script_setup_true_lang_default","InkRoot_default"],"sources":["../../src/components/InkRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n createMemorySignatureStore,\n createSignatureLibrary,\n InkError,\n openDocument,\n readonly,\n writable,\n} from '@inkbar/core'\nimport {\n attachFileKeys,\n attachHistoryKeys,\n createPluginHost,\n createSearchController,\n createToolOptions,\n handleFindKey,\n pageSelectionText,\n viewerSearchOf,\n cssVariableDefaults,\n FONT_FAMILIES,\n keepHistoryFocus,\n SIGNATURE_FONTS,\n trackToolStyle,\n unknownTool,\n} from '@inkbar/core/dom'\nimport { Primitive } from 'reka-ui'\nimport {\n computed,\n onBeforeUnmount,\n onUnmounted,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { registeredToolIds } from '../composables/useRegisteredTool'\nimport { provideInkContext, type InkHistory, type InkStatus } from '../context'\nimport { createRefHistory } from '../ref-history'\nimport { useReadable } from '../use-readable'\n\nimport type {\n Annotation,\n AnnotationChange,\n AnnotationDefaults,\n DocumentSource,\n FieldsChange,\n FieldValues,\n FormAction,\n InkDocument,\n PdfAssets,\n SignatureStore,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n InkPlugin,\n PluginHost,\n SearchController,\n Tool,\n ToolController,\n ToolId,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n src: DocumentSource | null\n assets: PdfAssets\n password?: string | undefined\n /** Colour defaults. Without it, the theme's CSS variables on the root element apply. */\n defaults?: AnnotationDefaults | undefined\n /**\n * Pass (with v-model) to put annotations under the host's control. The mode is fixed when a\n * document opens: passing or dropping this prop later takes effect on the next open.\n */\n annotations?: Annotation[] | undefined\n /**\n * Pass (with `v-model:fields`) to put the form's field values under the host's control. A\n * commit shows at once and is reported after; the host's push wins. The mode is fixed when\n * a document opens, as for `annotations`.\n */\n fields?: FieldValues | undefined\n /** Tints fillable form fields. Default true. A change applies to the open document in place. */\n formHighlight?: boolean | undefined\n tool?: ToolId | undefined\n /**\n * The creation tools, such as `allTools()` or a pick of the tool factories. `select-text`\n * and `select` are always present; a tool with either id replaces it. They are read when a\n * document opens: a tool added later is usable from the next open, one removed stops at\n * once. When the active tool goes, the viewer switches to `select-text` and emits\n * `update:tool`. A controlled `tool` naming a missing tool is reported back as\n * `select-text` and is not applied again when the tool appears later. Each mounted control\n * for a missing tool logs its own `UnknownTool`.\n */\n tools?: Tool[] | undefined\n /**\n * Plugins, set up once when the root is created; a later change to this prop is not\n * applied. Their tools join `tools`, their decoration and page layers apply to every\n * document, and their commands are placed with `InkCommand` or `useCommand`.\n */\n plugins?: InkPlugin[] | undefined\n /**\n * Adds `data-*` attributes, classes and a screen-reader description to each annotation's\n * element (see `DecorateAnnotation`). Decorations re-apply whenever the annotations change\n * and when this prop changes, without rebuilding the viewer. Pass a new function when its\n * output would change for any other reason.\n */\n decorateAnnotation?: DecorateAnnotation | undefined\n /**\n * The font families text boxes offer, replacing the PDF standard families\n * (`FONT_FAMILIES`). Fonts beyond those are the PDF writer's to embed.\n */\n fonts?: string[] | undefined\n /**\n * Where saved signatures live. Default: memory, gone on reload.\n * `createLocalSignatureStore` keeps them in the browser; a host can keep them anywhere.\n * A new store takes effect at once, for the menus and the `signature` tool alike.\n */\n signatures?: SignatureStore | undefined\n /** The handwriting fonts a typed signature offers; the host loads them. */\n signatureFonts?: string[] | undefined\n page?: number | undefined\n zoom?: ZoomValue | undefined\n /** Undo history. Defaults to on for uncontrolled, off for controlled. */\n history?: boolean | undefined\n asChild?: boolean\n }>(),\n {\n password: undefined,\n defaults: undefined,\n annotations: undefined,\n fields: undefined,\n formHighlight: undefined,\n tool: undefined,\n tools: undefined,\n plugins: undefined,\n decorateAnnotation: undefined,\n fonts: undefined,\n signatures: undefined,\n signatureFonts: undefined,\n page: undefined,\n zoom: undefined,\n history: undefined,\n asChild: false,\n }\n)\n\nconst emit = defineEmits<{\n 'update:annotations': [next: Annotation[]]\n change: [change: AnnotationChange]\n /** Committed field values, in full, with what changed them. */\n 'update:fields': [next: FieldValues, change: FieldsChange]\n /** The form asked to submit, open a link, send mail, print or prompt. Inkbar does none. */\n 'form-action': [action: FormAction]\n 'update:tool': [tool: ToolId]\n 'update:page': [page: number]\n 'update:zoom': [zoom: ZoomValue]\n ready: [doc: InkDocument]\n /**\n * Opening failed, or later a form script failed or a signature field refused its signing.\n * An error from while the document opened comes after `ready`.\n */\n error: [error: InkError]\n activate: [id: string]\n}>()\n\ntype TestHookElement = HTMLElement & { __inkDocument?: InkDocument | undefined }\n\n// A template ref on Primitive is a component instance; the context needs its element.\nconst primitive = useTemplateRef<{ $el: unknown }>('primitive')\nconst rootEl = shallowRef<HTMLElement | null>(null)\nfunction syncRootEl(): void {\n const el = primitive.value?.$el\n rootEl.value = el instanceof HTMLElement ? el : null\n}\n\nconst document = shallowRef<InkDocument | null>(null)\n/** Overrides the document's status while opening, and when opening itself failed. */\nconst override = shallowRef<InkStatus | null>(null)\nconst idle: InkStatus = { state: 'idle' }\nconst documentStatus = useReadable<InkStatus>(() => document.value?.status ?? null, idle)\nconst status = computed<InkStatus>(() => override.value ?? documentStatus.value)\nconst annotationList = useReadable<readonly Annotation[]>(\n () => document.value?.annotations.list ?? null,\n []\n)\nconst selection = useReadable<readonly string[]>(\n () => document.value?.annotations.selection ?? null,\n []\n)\nconst viewport = shallowRef<Viewport | null>(null)\nconst toolController = shallowRef<ToolController | null>(null)\nconst internalTool = ref<ToolId>(props.tool ?? 'select-text')\nconst activated = ref<string | null>(null)\n\nconst controlled = computed(() => props.annotations !== undefined)\nconst fieldsControlled = computed(() => props.fields !== undefined)\n\nfunction setActivated(id: string | null): void {\n activated.value = id\n if (id) emit('activate', id)\n}\n\nconst noop = () => {}\n\n/** Signed URLs change; the key does not. Bytes and Blobs are their own identity. */\nfunction identity(src: DocumentSource | null): unknown {\n if (src === null) return null\n if (typeof src === 'string') return src\n if ('key' in src) return src.key\n return src\n}\n\nfunction setTestHook(doc: InkDocument | undefined): void {\n if (import.meta.env.DEV && rootEl.value)\n (rootEl.value as TestHookElement).__inkDocument = doc\n}\n\nlet generation = 0\nlet stopFormErrors: () => void = noop\nfunction release(): void {\n stopFormErrors()\n stopFormErrors = noop\n // Cleared first, so the plugins close their stores while the document is still alive.\n const doc = document.value\n document.value = null\n doc?.destroy()\n setTestHook(undefined)\n}\n\nasync function open(): Promise<void> {\n const gen = ++generation\n const src = props.src\n release()\n refHistory.clear()\n if (src === null) {\n override.value = null\n return\n }\n override.value = { state: 'loading' }\n syncRootEl()\n let doc: InkDocument\n try {\n doc = await openDocument(src, {\n assets: props.assets,\n password: props.password,\n defaults:\n props.defaults ?? (rootEl.value ? cssVariableDefaults(rootEl.value) : undefined),\n // Controlled hosts get the ref history below; core's own stack stays off.\n history: controlled.value ? false : (props.history ?? true),\n annotations: controlled.value\n ? {\n mode: 'controlled',\n initial: props.annotations ?? [],\n onChange: (next, change) => {\n emit('update:annotations', next)\n emit('change', change)\n },\n }\n : { mode: 'uncontrolled' },\n fields: fieldsControlled.value\n ? {\n mode: 'controlled',\n initial: props.fields ?? {},\n onChange: (next, change) => emit('update:fields', next, change),\n }\n : { mode: 'uncontrolled' },\n })\n } catch (cause) {\n if (gen !== generation) return\n const error =\n cause instanceof InkError\n ? cause\n : new InkError(\n 'InvalidPdf',\n cause instanceof Error ? cause.message : String(cause),\n {},\n cause\n )\n override.value = { state: 'error', error }\n emit('error', error)\n return\n }\n if (gen !== generation) {\n doc.destroy()\n return\n }\n // The prop may have changed while the file loaded, when there was no store to apply it to.\n if (doc.annotations.mode === 'controlled' && props.annotations !== undefined)\n doc.annotations.setControlledValue(props.annotations)\n // The same for the fields; a document whose fields opened uncontrolled ignores the push.\n if (props.fields !== undefined) doc.form.setControlledValue(props.fields)\n // A form script that fails leaves the form fillable; the failure goes to `error`. Subscribed\n // before anyone hears of the document, so the form replays the errors from while it opened\n // here, not to a listener added in `ready`; they are held until `ready` has gone out.\n let held: InkError[] | undefined = []\n stopFormErrors = doc.form.on('error', (e) => {\n if (held) held.push(e)\n else emit('error', e)\n })\n document.value = doc\n override.value = null\n setTestHook(doc)\n const s = doc.status.get()\n if (s.state === 'ready') emit('ready', doc)\n else if (s.state === 'error') emit('error', s.error)\n const early = held\n held = undefined\n if (gen === generation) for (const e of early) emit('error', e)\n}\n\nconst refHistory = createRefHistory({\n source: () => props.annotations,\n apply: (list) => document.value?.annotations.replaceAll(list, 'history'),\n enabled: computed(() => controlled.value && props.history === true),\n store: () =>\n document.value?.annotations.mode === 'controlled' ? document.value.annotations : null,\n})\nconst coreCanUndo = useReadable(() => document.value?.history.canUndo ?? null, false)\nconst coreCanRedo = useReadable(() => document.value?.history.canRedo ?? null, false)\nconst inkHistory: InkHistory = {\n canUndo: computed(() =>\n controlled.value ? refHistory.canUndo.value : coreCanUndo.value\n ),\n canRedo: computed(() =>\n controlled.value ? refHistory.canRedo.value : coreCanRedo.value\n ),\n undo: () => (controlled.value ? refHistory.undo() : document.value?.history.undo()),\n redo: () => (controlled.value ? refHistory.redo() : document.value?.history.redo()),\n clear: () => (controlled.value ? refHistory.clear() : document.value?.history.clear()),\n batch: (fn) => {\n if (controlled.value) refHistory.batch(fn)\n else if (document.value) document.value.history.batch(fn)\n else fn()\n },\n track: (store) =>\n controlled.value\n ? refHistory.track(store)\n : (document.value?.history.track(store) ?? noop),\n react: (fn) =>\n controlled.value ? refHistory.react(fn) : (document.value?.history.react(fn) ?? noop),\n}\n\n// The undo and redo keys anywhere in the root do what InkUndo and InkRedo do. When either\n// button undoes or redoes the last step and disables itself, focus goes back to the document.\n// The find key listens here too.\nwatch(\n rootEl,\n (el, _prev, onCleanup) => {\n if (!el) return\n const stopKeys = attachHistoryKeys(el, () => ({\n canUndo: inkHistory.canUndo.value,\n canRedo: inkHistory.canRedo.value,\n undo: inkHistory.undo,\n redo: inkHistory.redo,\n }))\n const stopFocus = keepHistoryFocus(el, () =>\n el.querySelector<HTMLElement>('[data-ink-scroll]')\n )\n // Ctrl or Cmd+P prints and +S downloads, as InkPrintButton and InkDownloadButton do.\n const stopFileKeys = attachFileKeys(el, () => document.value)\n // Not a template listener: Vue leaves those on the element when it unmounts.\n el.addEventListener('keydown', onKeydown)\n onCleanup(() => {\n stopKeys()\n stopFocus()\n stopFileKeys()\n el.removeEventListener('keydown', onKeydown)\n })\n },\n { immediate: true }\n)\n\n/*\n * One plugin host for the root's life, built once mounted so that no `setup` runs on the\n * server, where nothing would clean it up. Until then `pluginHost` is null, and InkCommand\n * renders its command disabled. The host follows `hostDocument`, which is set after `document`\n * (a sync watch): when the host reads `inkHistory` for a new document, it is that document's\n * history.\n */\nconst hostDocument = writable<InkDocument | null>(null)\nwatch(document, (doc) => hostDocument.set(doc), { flush: 'sync' })\nconst viewportEl = shallowRef<HTMLElement | null>(null)\nconst hostRoot = writable<HTMLElement | null>(null)\nwatch(viewportEl, (el) => hostRoot.set(el), { flush: 'sync' })\nconst hostActivated = writable<string | null>(null)\nwatch(activated, (id) => hostActivated.set(id), { flush: 'sync' })\nconst pluginHost = shallowRef<PluginHost | null>(null)\n/** One search controller for the root's life, built with the plugin host that shares it. */\nconst search = shallowRef<SearchController | null>(null)\nfunction setUpPlugins(): void {\n const controller = createSearchController({\n document: readonly(hostDocument),\n viewport: () => viewport.value,\n })\n search.value = controller\n pluginHost.value = createPluginHost({\n plugins: props.plugins ?? [],\n document: readonly(hostDocument),\n history: () => inkHistory,\n activated: readonly(hostActivated),\n // As in `createViewer`: an id not in the open document is ignored.\n setActivated: (id) => {\n if (id === null || document.value?.annotations.get(id)) setActivated(id)\n },\n root: readonly(hostRoot),\n decorate: () => props.decorateAnnotation,\n viewport: () => viewport.value,\n search: viewerSearchOf(controller),\n })\n}\n\n/** Ctrl/Cmd+F while focus is in the root and a find bar is mounted; else the browser's. */\nfunction onKeydown(e: KeyboardEvent): void {\n const controller = search.value\n const root = e.currentTarget\n if (controller && root instanceof HTMLElement)\n handleFindKey(e, controller, () => pageSelectionText(root))\n}\n\n/** The document's tool style; it batches through `inkHistory`, whichever mode is on. */\nconst toolStyle = shallowRef<ToolStyle | null>(null)\nlet setStyleTool: ((id: ToolId) => void) | undefined\nwatch(\n document,\n (doc) => {\n if (!doc) {\n toolStyle.value = null\n setStyleTool = undefined\n return\n }\n const tracker = trackToolStyle({\n store: doc.annotations,\n history: { batch: (fn) => inkHistory.batch(fn) },\n // The plugins' tools too, so a plugin tool's style group applies (the host is set by now:\n // it is built on mount, before the first document opens).\n tools: [...(props.tools ?? []), ...(pluginHost.value?.tools ?? [])],\n tool: internalTool.value,\n })\n setStyleTool = (id) => tracker.setTool(id)\n toolStyle.value = tracker.toolStyle\n },\n // Sync: the style is in place before InkViewport's watcher mounts the engine with it.\n { immediate: true, flush: 'sync' }\n)\nwatch(internalTool, (id) => setStyleTool?.(id))\n\n// Plugins and the document on the client only: on the server InkRoot renders its empty slot.\n// The plugins first, so the first document opens with their stores and reactions.\nonMounted(() => {\n syncRootEl()\n // A plugin whose setup throws still leaves the document to open; the error then goes to\n // Vue's error handling (`onErrorCaptured`, `app.config.errorHandler`).\n try {\n setUpPlugins()\n } finally {\n mounted.value = true\n void open()\n }\n})\nonUpdated(syncRootEl)\n\n// Separate sources, so a new `{ url, key }` object with the same key compares equal.\nwatch([() => identity(props.src), () => props.password], () => void open())\n\nwatch(\n () => props.annotations,\n (next) => {\n if (next && document.value?.annotations.mode === 'controlled')\n document.value.annotations.setControlledValue(next)\n }\n)\n\nwatch(\n () => props.fields,\n (next) => {\n if (next) document.value?.form.setControlledValue(next)\n }\n)\n\n/*\n * The tools are known once the plugins are set up on mount. A tool id nobody registered is\n * logged as `UnknownTool`; as the active tool, from a `tool` prop or because it left `tools`,\n * it falls back to `select-text`, reported through `update:tool`. A controlled `tool` that\n * stays on the missing id is not applied again.\n */\nconst mounted = ref(false)\n/** The ids of the tools the current viewer was built with; InkViewport sets them. */\nconst openedToolIds = shallowRef<readonly ToolId[] | null>(null)\nconst toolIds = computed(() =>\n registeredToolIds(props.tools, pluginHost.value, openedToolIds.value)\n)\nconst isRegistered = (id: ToolId): boolean => !mounted.value || toolIds.value.includes(id)\nconst logUnknownTool = (id: ToolId): void => console.error(unknownTool(id, toolIds.value))\n\nfunction fallBack(id: ToolId): void {\n logUnknownTool(id)\n internalTool.value = 'select-text'\n emit('update:tool', 'select-text')\n}\n\nwatch(\n () => props.tool,\n (t) => {\n if (!t) return\n if (isRegistered(t)) internalTool.value = t\n else fallBack(t)\n }\n)\nwatch([mounted, toolIds], () => {\n if (!isRegistered(internalTool.value)) fallBack(internalTool.value)\n})\n\nfunction setTool(id: ToolId): void {\n // As the tool controller does: a missing tool is logged and nothing changes.\n if (!isRegistered(id)) {\n logUnknownTool(id)\n return\n }\n // Picking the active tool again starts it afresh, as after a one-shot tool's use.\n const tc = toolController.value\n if (internalTool.value === id && tc?.active.get() === id) tc.set(id)\n internalTool.value = id\n emit('update:tool', id)\n}\n\nonBeforeUnmount(() => {\n generation++\n release()\n})\n\n// After the children: InkViewport's engine, and the plugin layers with it, are gone by now, as\n// in `createViewer`, so no layer `destroy` runs after the plugins' cleanups.\nonUnmounted(() => {\n pluginHost.value?.destroy()\n pluginHost.value = null\n search.value?.destroy()\n search.value = null\n})\n\nconst signatures = computed(() =>\n createSignatureLibrary(props.signatures ?? createMemorySignatureStore())\n)\nwatch(signatures, (lib) => void lib.refresh(), { immediate: true })\n/** Tool options last as long as the root; the tool style is per document. */\nconst toolOptions = createToolOptions()\n\nprovideInkContext({\n assets: computed(() => props.assets),\n document,\n status,\n annotations: annotationList,\n selection,\n viewport,\n tools: toolController,\n tool: internalTool,\n setTool,\n hostTools: computed(() => props.tools),\n openedToolIds,\n decorateAnnotation: computed(() => props.decorateAnnotation),\n fonts: computed(() => props.fonts ?? FONT_FAMILIES),\n toolOptions,\n signatures,\n signatureFonts: computed(() => props.signatureFonts ?? SIGNATURE_FONTS),\n toolStyle,\n zoomModel: computed(() => props.zoom),\n pageModel: computed(() => props.page),\n reportZoom: (z) => emit('update:zoom', z),\n reportPage: (p) => emit('update:page', p),\n activated,\n setActivated,\n pluginHost,\n search,\n viewportEl,\n history: inkHistory,\n rootEl,\n formHighlight: computed(() => props.formHighlight),\n reportFormAction: (a) => emit('form-action', a),\n reportError: (e) => emit('error', e),\n})\n\n// `history` is what `useHistory()` returns inside the root, for hosts that hold a template ref:\n// a controlled host calls `history.clear()` after loading its saved list.\ndefineExpose({ document, status, rootEl, history: inkHistory })\n</script>\n\n<template>\n <Primitive\n ref=\"primitive\"\n :as-child=\"props.asChild\"\n as=\"div\"\n data-ink-root\n :data-state=\"status.state\"\n >\n <slot :status=\"status\" :document=\"document\" />\n </Primitive>\n</template>\n"],"mappings":""}
@@ -22,8 +22,13 @@ type __VLS_Props = {
22
22
  formHighlight?: boolean | undefined;
23
23
  tool?: ToolId | undefined;
24
24
  /**
25
- * Host tools, added to the built-ins; one with a built-in's id replaces it. Read when a
26
- * document opens.
25
+ * The creation tools, such as `allTools()` or a pick of the tool factories. `select-text`
26
+ * and `select` are always present; a tool with either id replaces it. They are read when a
27
+ * document opens: a tool added later is usable from the next open, one removed stops at
28
+ * once. When the active tool goes, the viewer switches to `select-text` and emits
29
+ * `update:tool`. A controlled `tool` naming a missing tool is reported back as
30
+ * `select-text` and is not applied again when the tool appears later. Each mounted control
31
+ * for a missing tool logs its own `UnknownTool`.
27
32
  */
28
33
  tools?: Tool[] | undefined;
29
34
  /**
@@ -71,6 +76,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
71
76
  rootEl: import('vue').ShallowRef<HTMLElement | null, HTMLElement | null>;
72
77
  history: InkHistory;
73
78
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
79
+ ready: (doc: InkDocument) => any;
74
80
  "update:annotations": (next: ({
75
81
  type: "highlight" | "underline" | "strikeout" | "squiggly";
76
82
  quads: {
@@ -105,6 +111,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
105
111
  id: string;
106
112
  page: number;
107
113
  locked?: boolean | undefined;
114
+ hasAppearance?: boolean | undefined;
108
115
  author?: string | undefined;
109
116
  contents?: string | undefined;
110
117
  inReplyTo?: string | undefined;
@@ -128,6 +135,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
128
135
  page: number;
129
136
  type: "text";
130
137
  locked?: boolean | undefined;
138
+ hasAppearance?: boolean | undefined;
131
139
  author?: string | undefined;
132
140
  contents?: string | undefined;
133
141
  inReplyTo?: string | undefined;
@@ -176,6 +184,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
176
184
  fontSize?: undefined;
177
185
  align?: undefined;
178
186
  locked?: boolean | undefined;
187
+ hasAppearance?: boolean | undefined;
179
188
  dashes?: number[] | undefined;
180
189
  cornerRadius?: number | undefined;
181
190
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -201,6 +210,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
201
210
  page: number;
202
211
  type: "square";
203
212
  locked?: boolean | undefined;
213
+ hasAppearance?: boolean | undefined;
204
214
  dashes?: number[] | undefined;
205
215
  interiorColor?: string | undefined;
206
216
  cornerRadius?: number | undefined;
@@ -228,6 +238,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
228
238
  type: "circle";
229
239
  cornerRadius?: undefined;
230
240
  locked?: boolean | undefined;
241
+ hasAppearance?: boolean | undefined;
231
242
  dashes?: number[] | undefined;
232
243
  interiorColor?: string | undefined;
233
244
  author?: string | undefined;
@@ -261,6 +272,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
261
272
  page: number;
262
273
  type: "line";
263
274
  locked?: boolean | undefined;
275
+ hasAppearance?: boolean | undefined;
264
276
  dashes?: number[] | undefined;
265
277
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
266
278
  tail?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -291,6 +303,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
291
303
  page: number;
292
304
  type: "polyline";
293
305
  locked?: boolean | undefined;
306
+ hasAppearance?: boolean | undefined;
294
307
  dashes?: number[] | undefined;
295
308
  interiorColor?: string | undefined;
296
309
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -324,6 +337,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
324
337
  head?: undefined;
325
338
  tail?: undefined;
326
339
  locked?: boolean | undefined;
340
+ hasAppearance?: boolean | undefined;
327
341
  dashes?: number[] | undefined;
328
342
  interiorColor?: string | undefined;
329
343
  author?: string | undefined;
@@ -354,6 +368,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
354
368
  type: "ink";
355
369
  pressure?: number[][] | undefined;
356
370
  locked?: boolean | undefined;
371
+ hasAppearance?: boolean | undefined;
357
372
  dashes?: number[] | undefined;
358
373
  author?: string | undefined;
359
374
  contents?: string | undefined;
@@ -378,6 +393,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
378
393
  page: number;
379
394
  type: "stamp";
380
395
  locked?: boolean | undefined;
396
+ hasAppearance?: boolean | undefined;
381
397
  rotation?: 0 | 90 | 180 | 270 | undefined;
382
398
  author?: string | undefined;
383
399
  contents?: string | undefined;
@@ -403,6 +419,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
403
419
  page: number;
404
420
  type: "loupe";
405
421
  locked?: boolean | undefined;
422
+ hasAppearance?: boolean | undefined;
406
423
  author?: string | undefined;
407
424
  contents?: string | undefined;
408
425
  inReplyTo?: string | undefined;
@@ -427,6 +444,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
427
444
  page: number;
428
445
  type: "mask";
429
446
  locked?: boolean | undefined;
447
+ hasAppearance?: boolean | undefined;
430
448
  author?: string | undefined;
431
449
  contents?: string | undefined;
432
450
  inReplyTo?: string | undefined;
@@ -468,6 +486,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
468
486
  };
469
487
  }[] | undefined;
470
488
  locked?: boolean | undefined;
489
+ hasAppearance?: boolean | undefined;
471
490
  overlayText?: string | undefined;
472
491
  author?: string | undefined;
473
492
  contents?: string | undefined;
@@ -482,10 +501,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
482
501
  "update:tool": (tool: ToolId) => any;
483
502
  "update:page": (page: number) => any;
484
503
  "update:zoom": (zoom: ZoomValue) => any;
485
- ready: (doc: InkDocument) => any;
486
504
  error: (error: InkError) => any;
487
505
  activate: (id: string) => any;
488
506
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
507
+ onReady?: (doc: InkDocument) => any;
489
508
  "onUpdate:annotations"?: (next: ({
490
509
  type: "highlight" | "underline" | "strikeout" | "squiggly";
491
510
  quads: {
@@ -520,6 +539,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
520
539
  id: string;
521
540
  page: number;
522
541
  locked?: boolean | undefined;
542
+ hasAppearance?: boolean | undefined;
523
543
  author?: string | undefined;
524
544
  contents?: string | undefined;
525
545
  inReplyTo?: string | undefined;
@@ -543,6 +563,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
543
563
  page: number;
544
564
  type: "text";
545
565
  locked?: boolean | undefined;
566
+ hasAppearance?: boolean | undefined;
546
567
  author?: string | undefined;
547
568
  contents?: string | undefined;
548
569
  inReplyTo?: string | undefined;
@@ -591,6 +612,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
591
612
  fontSize?: undefined;
592
613
  align?: undefined;
593
614
  locked?: boolean | undefined;
615
+ hasAppearance?: boolean | undefined;
594
616
  dashes?: number[] | undefined;
595
617
  cornerRadius?: number | undefined;
596
618
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -616,6 +638,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
616
638
  page: number;
617
639
  type: "square";
618
640
  locked?: boolean | undefined;
641
+ hasAppearance?: boolean | undefined;
619
642
  dashes?: number[] | undefined;
620
643
  interiorColor?: string | undefined;
621
644
  cornerRadius?: number | undefined;
@@ -643,6 +666,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
643
666
  type: "circle";
644
667
  cornerRadius?: undefined;
645
668
  locked?: boolean | undefined;
669
+ hasAppearance?: boolean | undefined;
646
670
  dashes?: number[] | undefined;
647
671
  interiorColor?: string | undefined;
648
672
  author?: string | undefined;
@@ -676,6 +700,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
676
700
  page: number;
677
701
  type: "line";
678
702
  locked?: boolean | undefined;
703
+ hasAppearance?: boolean | undefined;
679
704
  dashes?: number[] | undefined;
680
705
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
681
706
  tail?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -706,6 +731,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
706
731
  page: number;
707
732
  type: "polyline";
708
733
  locked?: boolean | undefined;
734
+ hasAppearance?: boolean | undefined;
709
735
  dashes?: number[] | undefined;
710
736
  interiorColor?: string | undefined;
711
737
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -739,6 +765,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
739
765
  head?: undefined;
740
766
  tail?: undefined;
741
767
  locked?: boolean | undefined;
768
+ hasAppearance?: boolean | undefined;
742
769
  dashes?: number[] | undefined;
743
770
  interiorColor?: string | undefined;
744
771
  author?: string | undefined;
@@ -769,6 +796,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
769
796
  type: "ink";
770
797
  pressure?: number[][] | undefined;
771
798
  locked?: boolean | undefined;
799
+ hasAppearance?: boolean | undefined;
772
800
  dashes?: number[] | undefined;
773
801
  author?: string | undefined;
774
802
  contents?: string | undefined;
@@ -793,6 +821,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
793
821
  page: number;
794
822
  type: "stamp";
795
823
  locked?: boolean | undefined;
824
+ hasAppearance?: boolean | undefined;
796
825
  rotation?: 0 | 90 | 180 | 270 | undefined;
797
826
  author?: string | undefined;
798
827
  contents?: string | undefined;
@@ -818,6 +847,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
818
847
  page: number;
819
848
  type: "loupe";
820
849
  locked?: boolean | undefined;
850
+ hasAppearance?: boolean | undefined;
821
851
  author?: string | undefined;
822
852
  contents?: string | undefined;
823
853
  inReplyTo?: string | undefined;
@@ -842,6 +872,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
842
872
  page: number;
843
873
  type: "mask";
844
874
  locked?: boolean | undefined;
875
+ hasAppearance?: boolean | undefined;
845
876
  author?: string | undefined;
846
877
  contents?: string | undefined;
847
878
  inReplyTo?: string | undefined;
@@ -883,6 +914,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
883
914
  };
884
915
  }[] | undefined;
885
916
  locked?: boolean | undefined;
917
+ hasAppearance?: boolean | undefined;
886
918
  overlayText?: string | undefined;
887
919
  author?: string | undefined;
888
920
  contents?: string | undefined;
@@ -897,7 +929,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
897
929
  "onUpdate:tool"?: (tool: ToolId) => any;
898
930
  "onUpdate:page"?: (page: number) => any;
899
931
  "onUpdate:zoom"?: (zoom: ZoomValue) => any;
900
- onReady?: (doc: InkDocument) => any;
901
932
  onError?: (error: InkError) => any;
902
933
  onActivate?: (id: string) => any;
903
934
  }>, {
@@ -938,6 +969,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
938
969
  id: string;
939
970
  page: number;
940
971
  locked?: boolean | undefined;
972
+ hasAppearance?: boolean | undefined;
941
973
  author?: string | undefined;
942
974
  contents?: string | undefined;
943
975
  inReplyTo?: string | undefined;
@@ -961,6 +993,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
961
993
  page: number;
962
994
  type: "text";
963
995
  locked?: boolean | undefined;
996
+ hasAppearance?: boolean | undefined;
964
997
  author?: string | undefined;
965
998
  contents?: string | undefined;
966
999
  inReplyTo?: string | undefined;
@@ -1009,6 +1042,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1009
1042
  fontSize?: undefined;
1010
1043
  align?: undefined;
1011
1044
  locked?: boolean | undefined;
1045
+ hasAppearance?: boolean | undefined;
1012
1046
  dashes?: number[] | undefined;
1013
1047
  cornerRadius?: number | undefined;
1014
1048
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -1034,6 +1068,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1034
1068
  page: number;
1035
1069
  type: "square";
1036
1070
  locked?: boolean | undefined;
1071
+ hasAppearance?: boolean | undefined;
1037
1072
  dashes?: number[] | undefined;
1038
1073
  interiorColor?: string | undefined;
1039
1074
  cornerRadius?: number | undefined;
@@ -1061,6 +1096,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1061
1096
  type: "circle";
1062
1097
  cornerRadius?: undefined;
1063
1098
  locked?: boolean | undefined;
1099
+ hasAppearance?: boolean | undefined;
1064
1100
  dashes?: number[] | undefined;
1065
1101
  interiorColor?: string | undefined;
1066
1102
  author?: string | undefined;
@@ -1094,6 +1130,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1094
1130
  page: number;
1095
1131
  type: "line";
1096
1132
  locked?: boolean | undefined;
1133
+ hasAppearance?: boolean | undefined;
1097
1134
  dashes?: number[] | undefined;
1098
1135
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
1099
1136
  tail?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -1124,6 +1161,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1124
1161
  page: number;
1125
1162
  type: "polyline";
1126
1163
  locked?: boolean | undefined;
1164
+ hasAppearance?: boolean | undefined;
1127
1165
  dashes?: number[] | undefined;
1128
1166
  interiorColor?: string | undefined;
1129
1167
  head?: (string & {}) | "None" | "Square" | "Circle" | "Diamond" | "OpenArrow" | "ClosedArrow" | "Butt" | "ROpenArrow" | "RClosedArrow" | "Slash" | undefined;
@@ -1157,6 +1195,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1157
1195
  head?: undefined;
1158
1196
  tail?: undefined;
1159
1197
  locked?: boolean | undefined;
1198
+ hasAppearance?: boolean | undefined;
1160
1199
  dashes?: number[] | undefined;
1161
1200
  interiorColor?: string | undefined;
1162
1201
  author?: string | undefined;
@@ -1187,6 +1226,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1187
1226
  type: "ink";
1188
1227
  pressure?: number[][] | undefined;
1189
1228
  locked?: boolean | undefined;
1229
+ hasAppearance?: boolean | undefined;
1190
1230
  dashes?: number[] | undefined;
1191
1231
  author?: string | undefined;
1192
1232
  contents?: string | undefined;
@@ -1211,6 +1251,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1211
1251
  page: number;
1212
1252
  type: "stamp";
1213
1253
  locked?: boolean | undefined;
1254
+ hasAppearance?: boolean | undefined;
1214
1255
  rotation?: 0 | 90 | 180 | 270 | undefined;
1215
1256
  author?: string | undefined;
1216
1257
  contents?: string | undefined;
@@ -1236,6 +1277,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1236
1277
  page: number;
1237
1278
  type: "loupe";
1238
1279
  locked?: boolean | undefined;
1280
+ hasAppearance?: boolean | undefined;
1239
1281
  author?: string | undefined;
1240
1282
  contents?: string | undefined;
1241
1283
  inReplyTo?: string | undefined;
@@ -1260,6 +1302,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1260
1302
  page: number;
1261
1303
  type: "mask";
1262
1304
  locked?: boolean | undefined;
1305
+ hasAppearance?: boolean | undefined;
1263
1306
  author?: string | undefined;
1264
1307
  contents?: string | undefined;
1265
1308
  inReplyTo?: string | undefined;
@@ -1301,6 +1344,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
1301
1344
  };
1302
1345
  }[] | undefined;
1303
1346
  locked?: boolean | undefined;
1347
+ hasAppearance?: boolean | undefined;
1304
1348
  overlayText?: string | undefined;
1305
1349
  author?: string | undefined;
1306
1350
  contents?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"InkRoot.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkRoot.vue"],"names":[],"mappings":"AA+iBA,OAAO,EAGL,QAAQ,EAIT,MAAM,cAAc,CAAA;AA4BrB,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAI/E,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACf,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EAGT,IAAI,EAEJ,MAAM,EAGN,SAAS,EACV,MAAM,kBAAkB,CAAA;AAGzB,KAAK,WAAW,GAAG;IACf,GAAG,EAAE,cAAc,GAAG,IAAI,CAAA;IAC1B,MAAM,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,SAAS,CAAA;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAChC,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,CAAA;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IACjC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACnD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,S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