@inkbar/vue 0.6.0 → 0.7.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 (33) hide show
  1. package/README.md +5 -1
  2. package/dist/components/InkFindBar.js +7 -0
  3. package/dist/components/InkFindBar.js.map +1 -0
  4. package/dist/components/InkFindBar.vue.d.ts +4 -0
  5. package/dist/components/InkFindBar.vue.d.ts.map +1 -0
  6. package/dist/components/InkFindBar.vue_vue_type_script_setup_true_lang.js +133 -0
  7. package/dist/components/InkFindBar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  8. package/dist/components/InkRoot.js.map +1 -1
  9. package/dist/components/InkRoot.vue.d.ts.map +1 -1
  10. package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +120 -109
  11. package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/InkSearchButton.js +7 -0
  13. package/dist/components/InkSearchButton.js.map +1 -0
  14. package/dist/components/InkSearchButton.vue.d.ts +19 -0
  15. package/dist/components/InkSearchButton.vue.d.ts.map +1 -0
  16. package/dist/components/InkSearchButton.vue_vue_type_script_setup_true_lang.js +43 -0
  17. package/dist/components/InkSearchButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  18. package/dist/components/InkViewport.js.map +1 -1
  19. package/dist/components/InkViewport.vue.d.ts.map +1 -1
  20. package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js +1 -0
  21. package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/SignatureForm.vue.d.ts +2 -2
  23. package/dist/composables/useSearch.d.ts +12 -0
  24. package/dist/composables/useSearch.d.ts.map +1 -0
  25. package/dist/composables/useSearch.js +27 -0
  26. package/dist/composables/useSearch.js.map +1 -0
  27. package/dist/context.d.ts +7 -1
  28. package/dist/context.d.ts.map +1 -1
  29. package/dist/context.js.map +1 -1
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +30 -27
  33. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"InkViewport.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_renderSlot","_createTextVNode","_createElementVNode","_toDisplayString","_createCommentVNode","_Fragment","_renderList","_createBlock","InkPage","_createSlots","_withCtx","_mergeProps","InkPage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","InkViewport_vue_vue_type_script_setup_true_lang_default","props","__props","slots","useSlots","ctx","injectInkContext","scroll","useTemplateRef","pages","shallowRef","state","computed","error","engine","build","custom","stops","lastReportedZoom","lastReportedPage","teardown","stop","rebuild","e","opts","setup","doc","el","first","mountViewer","a","fn","id","vp","tc","reportZoom","z","reportPage","p","page","err","onMounted","watch","t","m","r","gap","buffer","onBeforeUpdate","next","onBeforeUnmount","openBlock","createElementBlock","renderSlot","_ctx","_cache","createTextVNode","createElementVNode","toDisplayString","createCommentVNode","Fragment","renderList","createBlock","createSlots","withCtx","mergeProps","slotProps"],"sources":["../../src/components/InkViewport.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * The scroll element is handed to core's `mountViewer`, which builds the viewport, the page\n * layers, the tool controller and the keyboard shortcuts in it; Vue never renders children\n * into it. The engine reports each page host it mounts, and InkPage components rendered here\n * (they render nothing in place) teleport the page-error and custom-annotation slots into them.\n *\n * Two-way zoom and page: the viewport's own changes are reported through the context, and\n * the host's v-model values are applied only when they differ from the viewport's state, so\n * the echo of a reported value does nothing.\n */\nimport { mountViewer } from '@inkbar/core/dom'\nimport {\n computed,\n onBeforeUnmount,\n onBeforeUpdate,\n onMounted,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { injectInkContext } from '../context'\n\nimport InkPage from './InkPage.vue'\n\nimport type { AnnotationSlotProps } from './annotation-slot'\nimport type { InkError } from '@inkbar/core'\nimport type {\n LayoutMode,\n PageMount,\n ToolId,\n ViewerEngine,\n ViewRotation,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n mode?: LayoutMode\n rotation?: ViewRotation\n /** Gap between pages, CSS px. */\n gap?: number\n /** Pages kept mounted either side of the visible ones. */\n buffer?: number\n }>(),\n { mode: 'continuous', rotation: 0, gap: 16, buffer: 2 }\n)\n\nconst slots = defineSlots<{\n loading?(): unknown\n error?(props: { error: InkError }): unknown\n empty?(): unknown\n annotation?(props: AnnotationSlotProps): unknown\n /** Shown inside a page that failed to render. The rest of the document stays usable. */\n 'page-error'?(props: { error: InkError; page: number }): unknown\n}>()\n\nconst ctx = injectInkContext()\nconst scroll = useTemplateRef<HTMLElement>('scroll')\n\ninterface MountedPage {\n /** The engine build the host belongs to; part of the InkPage key. */\n build: number\n page: number\n host: HTMLElement\n mount: PageMount\n error: InkError | null\n /** Whether the build that mounted the page renders the annotation slot. */\n custom: boolean\n}\n/** Page hosts, mounts and errors the engine reported; InkPage renders Teleports for them. */\nconst pages = shallowRef<MountedPage[]>([])\n\nconst state = computed(() => ctx.status.value.state)\nconst error = computed<InkError | null>(() =>\n ctx.status.value.state === 'error' ? ctx.status.value.error : null\n)\n\nconst engine = shallowRef<ViewerEngine | null>(null)\n/**\n * Numbered before each build starts, so the pages a build mounts carry its own number. A\n * rebuild gives each page a new host and mount, so pages from an earlier build must remount,\n * not be reused.\n */\nlet build = 0\n/** Whether the current build renders the annotation slot. */\nlet custom = false\nlet stops: (() => void)[] = []\n/** The zoom and page last reported to the host. */\nlet lastReportedZoom: ZoomValue | undefined\nlet lastReportedPage: number | undefined\n\nfunction teardown(): void {\n for (const stop of stops) stop()\n stops = []\n // Unmounts every page, which empties `pages` through `onPageUnmount`.\n engine.value?.destroy()\n engine.value = null\n if (ctx.viewport.value) ctx.viewport.value = null\n if (ctx.tools.value) ctx.tools.value = null\n pages.value = []\n}\n\nfunction rebuild(opts: Parameters<ViewerEngine['rebuild']>[0]): void {\n const e = engine.value\n if (!e) return\n build += 1\n if (opts.customAnnotations !== undefined) custom = opts.customAnnotations\n e.rebuild(opts)\n}\n\n// Build for a new document or status; the previous engine is torn down first.\nfunction setup(): void {\n teardown()\n lastReportedZoom = undefined\n lastReportedPage = undefined\n const doc = ctx.document.value\n const el = scroll.value\n if (!doc || !el || ctx.status.value.state !== 'ready') return\n let first = true\n build += 1\n custom = !!slots.annotation\n engine.value = mountViewer({\n container: el,\n document: doc,\n zoom: ctx.zoomModel.value ?? 'fit-width',\n ...(ctx.pageModel.value === undefined ? {} : { page: ctx.pageModel.value }),\n mode: props.mode,\n rotation: props.rotation,\n gap: props.gap,\n buffer: props.buffer,\n tool: ctx.tool.value,\n ...(ctx.hostTools.value ? { tools: ctx.hostTools.value } : {}),\n // The engine adds the plugins' tools and layers, and decorates through the host, which\n // reads `decorateAnnotation` first.\n ...(ctx.pluginHost.value ? { plugins: ctx.pluginHost.value } : {}),\n // Read through, so the watch below can re-apply a new function without a rebuild.\n decorateAnnotation: (a) => ctx.decorateAnnotation.value?.(a),\n ...(ctx.toolStyle.value ? { toolStyle: ctx.toolStyle.value } : {}),\n toolHistory: { batch: (fn) => ctx.history.batch(fn) },\n toolOptions: ctx.toolOptions,\n fonts: [...ctx.fonts.value],\n // Read through, so a new `signatures` store reaches the tool as well as the menus.\n signatureLibrary: () => ctx.signatures.value,\n customAnnotations: custom,\n onActivate: (id) => ctx.setActivated(id),\n onBuild: (vp, tc) => {\n ctx.viewport.value = vp\n ctx.tools.value = tc\n if (first) {\n // A new document starts from where the viewport opens (its zoom, on the first page:\n // `createViewport` always starts at page 0); only later changes are reported, the\n // restored page among them, since the engine has already scrolled to it.\n first = false\n lastReportedZoom = vp.zoom.get()\n lastReportedPage = 0\n }\n for (const stop of stops) stop()\n const reportZoom = (z: ZoomValue): void => {\n if (z === lastReportedZoom) return\n lastReportedZoom = z\n ctx.reportZoom(z)\n }\n const reportPage = (p: number): void => {\n if (p === lastReportedPage) return\n lastReportedPage = p\n ctx.reportPage(p)\n }\n // A tool that switches itself (a one-shot tool once used) is reported as a pick.\n const followTool = (id: ToolId): void => {\n if (id !== ctx.tool.value) ctx.setTool(id)\n }\n stops = [\n vp.zoom.subscribe(reportZoom),\n vp.currentPage.subscribe(reportPage),\n tc.active.subscribe(followTool),\n ]\n // Whatever the build restored is reported once; nothing is when it matched.\n reportZoom(vp.zoom.get())\n reportPage(vp.currentPage.get())\n },\n onPageMount: (page, mount, host) => {\n pages.value = [...pages.value, { build, page, host, mount, error: null, custom }]\n },\n onPageUnmount: (page) => {\n pages.value = pages.value.filter((p) => p.page !== page)\n },\n onPageError: (page, err) => {\n pages.value = pages.value.map((p) => (p.page === page ? { ...p, error: err } : p))\n },\n })\n}\n\nonMounted(() => {\n ctx.viewportEl.value = scroll.value\n watch([() => ctx.document.value, () => ctx.status.value.state], setup, {\n immediate: true,\n })\n})\n\n// A new decorateAnnotation re-applies to the mounted annotation elements at once.\nwatch(\n () => ctx.decorateAnnotation.value,\n () => engine.value?.redecorate()\n)\nwatch(\n () => ctx.zoomModel.value,\n (z: ZoomValue | undefined) => {\n const vp = engine.value?.viewport\n if (vp && z !== undefined && z !== vp.zoom.get()) vp.setZoom(z)\n }\n)\nwatch(\n () => ctx.pageModel.value,\n (p) => {\n const vp = engine.value?.viewport\n if (!vp || p === undefined || p === lastReportedPage) return\n if (p !== vp.currentPage.get()) vp.scrollToPage(p)\n }\n)\nwatch(\n () => ctx.tool.value,\n (t) => {\n const tc = engine.value?.tools\n if (tc && tc.active.get() !== t) tc.set(t)\n }\n)\nwatch(\n () => props.mode,\n (m) => engine.value?.viewport.setMode(m)\n)\nwatch(\n () => props.rotation,\n (r) => engine.value?.viewport.setRotation(r)\n)\n// Gap and buffer are construction options: rebuild for the same document, keeping zoom and page.\n// The slots are already updated when this runs, so it carries the annotation slot too: a slot\n// toggle in the same tick is then recorded here and `onBeforeUpdate` finds nothing left to do.\nwatch([() => props.gap, () => props.buffer], ([gap, buffer]) =>\n rebuild({ gap, buffer, customAnnotations: !!slots.annotation })\n)\n\n// Slots are not reactive, so a change to whether the annotation slot is given is caught here.\n// `onBeforeUpdate` runs after the new slots are in place and before this render: the rebuild\n// swaps `pages` for the new build's pages synchronously, so the render that follows never pairs\n// the annotation slot with an overlay built without it (or the reverse). The rebuild keeps the\n// scroll position.\nonBeforeUpdate(() => {\n const next = !!slots.annotation\n if (engine.value && next !== custom) rebuild({ customAnnotations: next })\n})\n\nonBeforeUnmount(() => {\n teardown()\n if (ctx.viewportEl.value === scroll.value) ctx.viewportEl.value = null\n})\n</script>\n\n<template>\n <div class=\"ink-viewport-root\" data-ink-viewport-root :data-state=\"state\">\n <div v-if=\"state === 'loading'\" class=\"ink-status\" role=\"status\" aria-live=\"polite\">\n <slot name=\"loading\">Loading document…</slot>\n </div>\n <div v-else-if=\"error\" class=\"ink-status ink-error\" role=\"alert\">\n <slot name=\"error\" :error=\"error\">\n <p class=\"ink-error-title\">This document could not be opened.</p>\n <!-- The message comes from the PDF engine and is not written for readers: it stays\n off the page, on the code's tooltip. -->\n <p>\n <code class=\"ink-error-code\" :title=\"error.message\">{{ error.code }}</code>\n </p>\n </slot>\n </div>\n <div v-else-if=\"state === 'idle'\" class=\"ink-status ink-empty\">\n <slot name=\"empty\" />\n </div>\n <div\n ref=\"scroll\"\n class=\"ink-scroll\"\n data-ink-scroll\n tabindex=\"0\"\n role=\"document\"\n aria-label=\"Document\"\n />\n <InkPage\n v-for=\"p in pages\"\n :key=\"`${p.build}:${p.page}`\"\n :page=\"p.page\"\n :host=\"p.host\"\n :mount=\"p.mount\"\n :error=\"p.error\"\n :custom-annotations=\"p.custom\"\n >\n <template v-if=\"slots.annotation\" #annotation=\"slotProps\">\n <slot name=\"annotation\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"slots['page-error']\" #page-error=\"slotProps\">\n <slot name=\"page-error\" v-bind=\"slotProps\" />\n </template>\n </InkPage>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,IAAMsB,IAAQC,GAY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AJ,KAAIuB;IACJ,OAAM;IACN,mBAAA;IACA,UAAS;IACT,MAAK;IACL,cAAW;;IAEb3B,EAAA,EAAA,GAAAC,EAeUM,GAAA,MAAAC,EAdIqB,EAAA,QAAL,OADT7B,EAAA,GAAAS,EAeUC,GAAA;IAbP,KAAG,GAAKgD,EAAE,MAAK,GAAIA,EAAE;IACrB,MAAMA,EAAE;IACR,MAAMA,EAAE;IACR,OAAOA,EAAE;IACT,OAAOA,EAAE;IACT,sBAAoBA,EAAE;GAEP,GAAAyB,EAAA,EAAA,GAAA,EAAA,GAAA,CAAA5D,EAAM,aAAA;IAAa,MAAA;IACjC,IAAAX,GAD6C,MAAS,CACtDV,EAA6CwE,EAAA,QAAA,cAA7C7D,EAA6C,EAAA,SAAA,GAAA,GAAbyE,CAAS,CAAA,CAAA,CAAA;;GAE3B,IAAA,KAAA,GAAA/D,EAAK,gBAAA;IAAiB,MAAA;IACpC,IAAAX,GADgD,MAAS,CACzDV,EAA6CwE,EAAA,QAAA,cAA7C7D,EAA6C,EAAA,SAAA,GAAA,GAAbyE,CAAS,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"InkViewport.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_renderSlot","_createTextVNode","_createElementVNode","_toDisplayString","_createCommentVNode","_Fragment","_renderList","_createBlock","InkPage","_createSlots","_withCtx","_mergeProps","InkPage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","InkViewport_vue_vue_type_script_setup_true_lang_default","props","__props","slots","useSlots","ctx","injectInkContext","scroll","useTemplateRef","pages","shallowRef","state","computed","error","engine","build","custom","stops","lastReportedZoom","lastReportedPage","teardown","stop","rebuild","e","opts","setup","doc","el","first","mountViewer","a","fn","id","vp","tc","reportZoom","z","reportPage","p","page","err","onMounted","watch","t","m","r","gap","buffer","onBeforeUpdate","next","onBeforeUnmount","openBlock","createElementBlock","renderSlot","_ctx","_cache","createTextVNode","createElementVNode","toDisplayString","createCommentVNode","Fragment","renderList","createBlock","createSlots","withCtx","mergeProps","slotProps"],"sources":["../../src/components/InkViewport.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * The scroll element is handed to core's `mountViewer`, which builds the viewport, the page\n * layers, the tool controller and the keyboard shortcuts in it; Vue never renders children\n * into it. The engine reports each page host it mounts, and InkPage components rendered here\n * (they render nothing in place) teleport the page-error and custom-annotation slots into them.\n *\n * Two-way zoom and page: the viewport's own changes are reported through the context, and\n * the host's v-model values are applied only when they differ from the viewport's state, so\n * the echo of a reported value does nothing.\n */\nimport { mountViewer } from '@inkbar/core/dom'\nimport {\n computed,\n onBeforeUnmount,\n onBeforeUpdate,\n onMounted,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { injectInkContext } from '../context'\n\nimport InkPage from './InkPage.vue'\n\nimport type { AnnotationSlotProps } from './annotation-slot'\nimport type { InkError } from '@inkbar/core'\nimport type {\n LayoutMode,\n PageMount,\n ToolId,\n ViewerEngine,\n ViewRotation,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n mode?: LayoutMode\n rotation?: ViewRotation\n /** Gap between pages, CSS px. */\n gap?: number\n /** Pages kept mounted either side of the visible ones. */\n buffer?: number\n }>(),\n { mode: 'continuous', rotation: 0, gap: 16, buffer: 2 }\n)\n\nconst slots = defineSlots<{\n loading?(): unknown\n error?(props: { error: InkError }): unknown\n empty?(): unknown\n annotation?(props: AnnotationSlotProps): unknown\n /** Shown inside a page that failed to render. The rest of the document stays usable. */\n 'page-error'?(props: { error: InkError; page: number }): unknown\n}>()\n\nconst ctx = injectInkContext()\nconst scroll = useTemplateRef<HTMLElement>('scroll')\n\ninterface MountedPage {\n /** The engine build the host belongs to; part of the InkPage key. */\n build: number\n page: number\n host: HTMLElement\n mount: PageMount\n error: InkError | null\n /** Whether the build that mounted the page renders the annotation slot. */\n custom: boolean\n}\n/** Page hosts, mounts and errors the engine reported; InkPage renders Teleports for them. */\nconst pages = shallowRef<MountedPage[]>([])\n\nconst state = computed(() => ctx.status.value.state)\nconst error = computed<InkError | null>(() =>\n ctx.status.value.state === 'error' ? ctx.status.value.error : null\n)\n\nconst engine = shallowRef<ViewerEngine | null>(null)\n/**\n * Numbered before each build starts, so the pages a build mounts carry its own number. A\n * rebuild gives each page a new host and mount, so pages from an earlier build must remount,\n * not be reused.\n */\nlet build = 0\n/** Whether the current build renders the annotation slot. */\nlet custom = false\nlet stops: (() => void)[] = []\n/** The zoom and page last reported to the host. */\nlet lastReportedZoom: ZoomValue | undefined\nlet lastReportedPage: number | undefined\n\nfunction teardown(): void {\n for (const stop of stops) stop()\n stops = []\n // Unmounts every page, which empties `pages` through `onPageUnmount`.\n engine.value?.destroy()\n engine.value = null\n if (ctx.viewport.value) ctx.viewport.value = null\n if (ctx.tools.value) ctx.tools.value = null\n pages.value = []\n}\n\nfunction rebuild(opts: Parameters<ViewerEngine['rebuild']>[0]): void {\n const e = engine.value\n if (!e) return\n build += 1\n if (opts.customAnnotations !== undefined) custom = opts.customAnnotations\n e.rebuild(opts)\n}\n\n// Build for a new document or status; the previous engine is torn down first.\nfunction setup(): void {\n teardown()\n lastReportedZoom = undefined\n lastReportedPage = undefined\n const doc = ctx.document.value\n const el = scroll.value\n if (!doc || !el || ctx.status.value.state !== 'ready') return\n let first = true\n build += 1\n custom = !!slots.annotation\n engine.value = mountViewer({\n container: el,\n document: doc,\n zoom: ctx.zoomModel.value ?? 'fit-width',\n ...(ctx.pageModel.value === undefined ? {} : { page: ctx.pageModel.value }),\n mode: props.mode,\n rotation: props.rotation,\n gap: props.gap,\n buffer: props.buffer,\n tool: ctx.tool.value,\n ...(ctx.hostTools.value ? { tools: ctx.hostTools.value } : {}),\n // The engine adds the plugins' tools and layers, and decorates through the host, which\n // reads `decorateAnnotation` first.\n ...(ctx.pluginHost.value ? { plugins: ctx.pluginHost.value } : {}),\n // The engine draws the search matches on the pages.\n ...(ctx.search.value ? { search: ctx.search.value } : {}),\n // Read through, so the watch below can re-apply a new function without a rebuild.\n decorateAnnotation: (a) => ctx.decorateAnnotation.value?.(a),\n ...(ctx.toolStyle.value ? { toolStyle: ctx.toolStyle.value } : {}),\n toolHistory: { batch: (fn) => ctx.history.batch(fn) },\n toolOptions: ctx.toolOptions,\n fonts: [...ctx.fonts.value],\n // Read through, so a new `signatures` store reaches the tool as well as the menus.\n signatureLibrary: () => ctx.signatures.value,\n customAnnotations: custom,\n onActivate: (id) => ctx.setActivated(id),\n onBuild: (vp, tc) => {\n ctx.viewport.value = vp\n ctx.tools.value = tc\n if (first) {\n // A new document starts from where the viewport opens (its zoom, on the first page:\n // `createViewport` always starts at page 0); only later changes are reported, the\n // restored page among them, since the engine has already scrolled to it.\n first = false\n lastReportedZoom = vp.zoom.get()\n lastReportedPage = 0\n }\n for (const stop of stops) stop()\n const reportZoom = (z: ZoomValue): void => {\n if (z === lastReportedZoom) return\n lastReportedZoom = z\n ctx.reportZoom(z)\n }\n const reportPage = (p: number): void => {\n if (p === lastReportedPage) return\n lastReportedPage = p\n ctx.reportPage(p)\n }\n // A tool that switches itself (a one-shot tool once used) is reported as a pick.\n const followTool = (id: ToolId): void => {\n if (id !== ctx.tool.value) ctx.setTool(id)\n }\n stops = [\n vp.zoom.subscribe(reportZoom),\n vp.currentPage.subscribe(reportPage),\n tc.active.subscribe(followTool),\n ]\n // Whatever the build restored is reported once; nothing is when it matched.\n reportZoom(vp.zoom.get())\n reportPage(vp.currentPage.get())\n },\n onPageMount: (page, mount, host) => {\n pages.value = [...pages.value, { build, page, host, mount, error: null, custom }]\n },\n onPageUnmount: (page) => {\n pages.value = pages.value.filter((p) => p.page !== page)\n },\n onPageError: (page, err) => {\n pages.value = pages.value.map((p) => (p.page === page ? { ...p, error: err } : p))\n },\n })\n}\n\nonMounted(() => {\n ctx.viewportEl.value = scroll.value\n watch([() => ctx.document.value, () => ctx.status.value.state], setup, {\n immediate: true,\n })\n})\n\n// A new decorateAnnotation re-applies to the mounted annotation elements at once.\nwatch(\n () => ctx.decorateAnnotation.value,\n () => engine.value?.redecorate()\n)\nwatch(\n () => ctx.zoomModel.value,\n (z: ZoomValue | undefined) => {\n const vp = engine.value?.viewport\n if (vp && z !== undefined && z !== vp.zoom.get()) vp.setZoom(z)\n }\n)\nwatch(\n () => ctx.pageModel.value,\n (p) => {\n const vp = engine.value?.viewport\n if (!vp || p === undefined || p === lastReportedPage) return\n if (p !== vp.currentPage.get()) vp.scrollToPage(p)\n }\n)\nwatch(\n () => ctx.tool.value,\n (t) => {\n const tc = engine.value?.tools\n if (tc && tc.active.get() !== t) tc.set(t)\n }\n)\nwatch(\n () => props.mode,\n (m) => engine.value?.viewport.setMode(m)\n)\nwatch(\n () => props.rotation,\n (r) => engine.value?.viewport.setRotation(r)\n)\n// Gap and buffer are construction options: rebuild for the same document, keeping zoom and page.\n// The slots are already updated when this runs, so it carries the annotation slot too: a slot\n// toggle in the same tick is then recorded here and `onBeforeUpdate` finds nothing left to do.\nwatch([() => props.gap, () => props.buffer], ([gap, buffer]) =>\n rebuild({ gap, buffer, customAnnotations: !!slots.annotation })\n)\n\n// Slots are not reactive, so a change to whether the annotation slot is given is caught here.\n// `onBeforeUpdate` runs after the new slots are in place and before this render: the rebuild\n// swaps `pages` for the new build's pages synchronously, so the render that follows never pairs\n// the annotation slot with an overlay built without it (or the reverse). The rebuild keeps the\n// scroll position.\nonBeforeUpdate(() => {\n const next = !!slots.annotation\n if (engine.value && next !== custom) rebuild({ customAnnotations: next })\n})\n\nonBeforeUnmount(() => {\n teardown()\n if (ctx.viewportEl.value === scroll.value) ctx.viewportEl.value = null\n})\n</script>\n\n<template>\n <div class=\"ink-viewport-root\" data-ink-viewport-root :data-state=\"state\">\n <div v-if=\"state === 'loading'\" class=\"ink-status\" role=\"status\" aria-live=\"polite\">\n <slot name=\"loading\">Loading document…</slot>\n </div>\n <div v-else-if=\"error\" class=\"ink-status ink-error\" role=\"alert\">\n <slot name=\"error\" :error=\"error\">\n <p class=\"ink-error-title\">This document could not be opened.</p>\n <!-- The message comes from the PDF engine and is not written for readers: it stays\n off the page, on the code's tooltip. -->\n <p>\n <code class=\"ink-error-code\" :title=\"error.message\">{{ error.code }}</code>\n </p>\n </slot>\n </div>\n <div v-else-if=\"state === 'idle'\" class=\"ink-status ink-empty\">\n <slot name=\"empty\" />\n </div>\n <div\n ref=\"scroll\"\n class=\"ink-scroll\"\n data-ink-scroll\n tabindex=\"0\"\n role=\"document\"\n aria-label=\"Document\"\n />\n <InkPage\n v-for=\"p in pages\"\n :key=\"`${p.build}:${p.page}`\"\n :page=\"p.page\"\n :host=\"p.host\"\n :mount=\"p.mount\"\n :error=\"p.error\"\n :custom-annotations=\"p.custom\"\n >\n <template v-if=\"slots.annotation\" #annotation=\"slotProps\">\n <slot name=\"annotation\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"slots['page-error']\" #page-error=\"slotProps\">\n <slot name=\"page-error\" v-bind=\"slotProps\" />\n </template>\n </InkPage>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,IAAMsB,IAAQC,GAYRC,IAAQxB,EAAA,GASR0B,IAAMC,EAAiB,GACvBC,IAASC,EAA4B,QAAQ,GAa7CC,IAAQC,EAA0B,CAAC,CAAC,GAEpCC,IAAQC,QAAeP,EAAI,OAAO,MAAM,KAAK,GAC7CQ,IAAQD,QACZP,EAAI,OAAO,MAAM,UAAU,UAAUA,EAAI,OAAO,MAAM,QAAQ,IAChE,GAEMS,IAASJ,EAAgC,IAAI,GAM/CK,IAAQ,GAERC,IAAS,IACTC,IAAwB,CAAC,GAEzBC,GACAC;EAEJ,SAASC,IAAiB;GACxB,KAAK,IAAMC,KAAQJ,GAAO,EAAK;GAO/B,AANA,IAAQ,CAAC,GAETH,EAAO,OAAO,QAAQ,GACtB,EAAO,QAAQ,MACXT,EAAI,SAAS,UAAO,EAAI,SAAS,QAAQ,OACzCA,EAAI,MAAM,UAAO,EAAI,MAAM,QAAQ,OACvC,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AA,GAAA,GAAbyE,CAAS,CAAA,CAAA,CAAA;;GAE3B,IAAA,KAAA,GAAA/D,EAAK,gBAAA;IAAiB,MAAA;IACpC,IAAAX,GADgD,MAAS,CACzDV,EAA6CwE,EAAA,QAAA,cAA7C7D,EAA6C,EAAA,SAAA,GAAA,GAAbyE,CAAS,CAAA,CAAA,CAAA"}
@@ -3,11 +3,11 @@ type __VLS_Props = {
3
3
  fonts?: readonly string[] | undefined;
4
4
  };
5
5
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
- saved: (template: SignatureTemplate) => any;
7
6
  close: () => any;
7
+ saved: (template: SignatureTemplate) => any;
8
8
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onSaved?: (template: SignatureTemplate) => any;
10
9
  onClose?: () => any;
10
+ onSaved?: (template: SignatureTemplate) => any;
11
11
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -0,0 +1,12 @@
1
+ import { SearchState, ViewerSearch } from '@inkbar/core/dom';
2
+ import { Ref } from 'vue';
3
+ /**
4
+ * The document search for hosts building their own control: the state, and the actions the
5
+ * find bar uses. Search is set up once InkRoot has mounted, so until then (and on the server)
6
+ * the state is closed and the actions do nothing. `open()` runs the search and draws the
7
+ * highlights even when no find bar is mounted.
8
+ */
9
+ export declare function useSearch(): {
10
+ state: Readonly<Ref<SearchState>>;
11
+ } & Omit<ViewerSearch, 'state'>;
12
+ //# sourceMappingURL=useSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../src/composables/useSearch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAW9B;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI;IAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,GAAG,IAAI,CACvE,YAAY,EACZ,OAAO,CACR,CAWA"}
@@ -0,0 +1,27 @@
1
+ import { useInkContext as e } from "../context.js";
2
+ import { useReadable as t } from "../use-readable.js";
3
+ //#region src/composables/useSearch.ts
4
+ var n = {
5
+ open: !1,
6
+ query: "",
7
+ matchCase: !1,
8
+ hits: [],
9
+ current: -1,
10
+ scanning: !1
11
+ };
12
+ function r() {
13
+ let r = e("useSearch()").search;
14
+ return {
15
+ state: t(() => r.value?.state, n),
16
+ open: (e) => r.value?.open(e),
17
+ setQuery: (e) => r.value?.setQuery(e),
18
+ setMatchCase: (e) => r.value?.setMatchCase(e),
19
+ next: () => r.value?.next(),
20
+ previous: () => r.value?.previous(),
21
+ close: () => r.value?.close()
22
+ };
23
+ }
24
+ //#endregion
25
+ export { r as useSearch };
26
+
27
+ //# sourceMappingURL=useSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearch.js","names":["CLOSED","useSearch","search","useInkContext","useReadable","query","on"],"sources":["../../src/composables/useSearch.ts"],"sourcesContent":["import { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { SearchState, ViewerSearch } from '@inkbar/core/dom'\nimport type { Ref } from 'vue'\n\nconst CLOSED: SearchState = {\n open: false,\n query: '',\n matchCase: false,\n hits: [],\n current: -1,\n scanning: false,\n}\n\n/**\n * The document search for hosts building their own control: the state, and the actions the\n * find bar uses. Search is set up once InkRoot has mounted, so until then (and on the server)\n * the state is closed and the actions do nothing. `open()` runs the search and draws the\n * highlights even when no find bar is mounted.\n */\nexport function useSearch(): { state: Readonly<Ref<SearchState>> } & Omit<\n ViewerSearch,\n 'state'\n> {\n const search = useInkContext('useSearch()').search\n return {\n state: useReadable(() => search.value?.state, CLOSED),\n open: (query) => search.value?.open(query),\n setQuery: (query) => search.value?.setQuery(query),\n setMatchCase: (on) => search.value?.setMatchCase(on),\n next: () => search.value?.next(),\n previous: () => search.value?.previous(),\n close: () => search.value?.close(),\n }\n}\n"],"mappings":";;;AAMA,IAAMA,IAAsB;CAC1B,MAAM;CACN,OAAO;CACP,WAAW;CACX,MAAM,CAAC;CACP,SAAS;CACT,UAAU;AACZ;AAQA,SAAgBC,IAGd;CACA,IAAMC,IAASC,EAAc,aAAa,CAAC,CAAC;CAC5C,OAAO;EACL,OAAOC,QAAkBF,EAAO,OAAO,OAAOF,CAAM;EACpD,OAAO,MAAUE,EAAO,OAAO,KAAKG,CAAK;EACzC,WAAW,MAAUH,EAAO,OAAO,SAASG,CAAK;EACjD,eAAe,MAAOH,EAAO,OAAO,aAAaI,CAAE;EACnD,YAAYJ,EAAO,OAAO,KAAK;EAC/B,gBAAgBA,EAAO,OAAO,SAAS;EACvC,aAAaA,EAAO,OAAO,MAAM;CACnC;AACF"}
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Annotation, InkDocument, InkStatus, PdfAssets, PluginHistory, SignatureLibrary } from '@inkbar/core';
2
- import { DecorateAnnotation, PluginHost, Tool, ToolController, ToolId, ToolOptions, ToolStyle, Viewport, ZoomValue } from '@inkbar/core/dom';
2
+ import { DecorateAnnotation, PluginHost, SearchController, Tool, ToolController, ToolId, ToolOptions, ToolStyle, Viewport, ZoomValue } from '@inkbar/core/dom';
3
3
  import { Ref, ShallowRef } from 'vue';
4
4
  export type { InkStatus };
5
5
  /**
@@ -33,6 +33,12 @@ export interface InkContext {
33
33
  * to the engine; InkCommand places its commands.
34
34
  */
35
35
  pluginHost: Readonly<ShallowRef<PluginHost | null>>;
36
+ /**
37
+ * The search controller from the same set-up as `pluginHost`: shared by the find bar, the
38
+ * search button, the engine's highlights and the plugins. `null` until the root has mounted
39
+ * (and on the server) and once it unmounts.
40
+ */
41
+ search: Readonly<ShallowRef<SearchController | null>>;
36
42
  /** InkViewport's scroll element while it is mounted: the plugins' `root`. */
37
43
  viewportEl: ShallowRef<HTMLElement | null>;
38
44
  /** Set by InkViewport once it has mounted its viewport and tool controller. */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,aAAa,EACb,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,IAAI,EACJ,cAAc,EACd,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAE1C,YAAY,EAAE,SAAS,EAAE,CAAA;AAEzB;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB;;;;;OAKG;IACH,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;IAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAA;IAClD,2FAA2F;IAC3F,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;IAChC,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,UAAU,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G;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAO1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":["injectInkContext","provideInkContext","createContext","useInkContext","ctx","getCurrentInstance","consumer"],"sources":["../src/context.ts"],"sourcesContent":["import { createContext } from 'reka-ui'\nimport { getCurrentInstance } from 'vue'\n\nimport type {\n Annotation,\n InkDocument,\n InkStatus,\n PdfAssets,\n PluginHistory,\n SignatureLibrary,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n PluginHost,\n Tool,\n ToolController,\n ToolId,\n ToolOptions,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\nimport type { Ref, ShallowRef } from 'vue'\n\nexport type { InkStatus }\n\n/**\n * Undo and redo for the current document, whichever mode its annotations are in. `track` and\n * `react` (from `PluginHistory`) reach the same history, so plugin stores undo with the edits.\n */\nexport interface InkHistory extends PluginHistory {\n canUndo: Readonly<Ref<boolean>>\n canRedo: Readonly<Ref<boolean>>\n undo: () => void\n redo: () => void\n clear: () => void\n /**\n * Runs `fn` and records what it changes as one undo step. The host still receives one change\n * per add. Controlled, the history groups the resulting list changes into one step, and\n * `canUndo` updates once the current task ends. Any other change the host applies in that\n * same window joins the step.\n */\n batch: (fn: () => void) => void\n}\n\nexport interface InkContext {\n assets: Readonly<Ref<PdfAssets>>\n document: Readonly<ShallowRef<InkDocument | null>>\n /** `loading` from the moment a document starts opening, then the document's own status. */\n status: Readonly<Ref<InkStatus>>\n annotations: Readonly<Ref<readonly Annotation[]>>\n selection: Readonly<Ref<readonly string[]>>\n /**\n * The plugins from InkRoot's `plugins` prop, set up once the root has mounted and kept for\n * its life; `null` before that (and on the server) and once it unmounts. InkViewport hands it\n * to the engine; InkCommand places its commands.\n */\n pluginHost: Readonly<ShallowRef<PluginHost | null>>\n /** InkViewport's scroll element while it is mounted: the plugins' `root`. */\n viewportEl: ShallowRef<HTMLElement | null>\n /** Set by InkViewport once it has mounted its viewport and tool controller. */\n viewport: ShallowRef<Viewport | null>\n tools: ShallowRef<ToolController | null>\n /** Desired tool; InkViewport applies it to the controller. */\n tool: Readonly<Ref<ToolId>>\n setTool(id: ToolId): void\n /** Host tools from InkRoot's `tools` prop; InkViewport registers them. */\n hostTools: Readonly<Ref<Tool[] | undefined>>\n /** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */\n decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>\n /** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */\n fonts: Readonly<Ref<readonly string[]>>\n /** The tools' options for InkRoot's life, so they persist across documents. */\n toolOptions: ToolOptions\n /** The saved signatures, from InkRoot's `signatures` store (memory by default). */\n signatures: Readonly<ShallowRef<SignatureLibrary>>\n /** The fonts a typed signature offers: InkRoot's `signatureFonts`, else `SIGNATURE_FONTS`. */\n signatureFonts: Readonly<Ref<readonly string[]>>\n /** The open document's tool style; `null` while no document is open. */\n toolStyle: Readonly<ShallowRef<ToolStyle | null>>\n /** Desired zoom and page from the host's v-models; InkViewport applies and reports back. */\n zoomModel: Readonly<Ref<ZoomValue | undefined>>\n pageModel: Readonly<Ref<number | undefined>>\n reportZoom(z: ZoomValue): void\n reportPage(p: number): void\n /** Last activated annotation (Enter, click with the note tool, etc.). Popovers key off this. */\n activated: Readonly<Ref<string | null>>\n /**\n * Activates annotation `id`, or clears the activation with `null`. This is the context's\n * own: unlike core's `Viewer.setActivated`, it emits InkRoot's `activate` for an id, and it\n * does not check that the id is in the document.\n */\n setActivated(id: string | null): void\n history: InkHistory\n rootEl: Readonly<Ref<HTMLElement | null>>\n}\n\nexport const [injectInkContext, provideInkContext] = createContext<InkContext>('InkRoot')\n\n/**\n * The context for composables: throws a readable error when called outside a component\n * rendered inside `InkRoot`, instead of Vue's injection warning.\n */\nexport function useInkContext(consumer: string): InkContext {\n const ctx = getCurrentInstance() ? injectInkContext(null) : null\n if (!ctx)\n throw new Error(\n `[inkbar] ${consumer} must be called in a component inside <InkRoot>.`\n )\n return ctx\n}\n"],"mappings":";;;AAiGA,IAAa,CAACA,GAAkBC,KAAqBC,EAA0B,SAAS;AAMxF,SAAgBC,EAAc,GAA8B;CAC1D,IAAMC,IAAMC,EAAmB,IAAIL,EAAiB,IAAI,IAAI;CAC5D,IAAI,CAACI,GACH,MAAU,MACR,YAAYE,EAAS,iDACvB;CACF,OAAOF;AACT"}
1
+ {"version":3,"file":"context.js","names":["injectInkContext","provideInkContext","createContext","useInkContext","ctx","getCurrentInstance","consumer"],"sources":["../src/context.ts"],"sourcesContent":["import { createContext } from 'reka-ui'\nimport { getCurrentInstance } from 'vue'\n\nimport type {\n Annotation,\n InkDocument,\n InkStatus,\n PdfAssets,\n PluginHistory,\n SignatureLibrary,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n PluginHost,\n SearchController,\n Tool,\n ToolController,\n ToolId,\n ToolOptions,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\nimport type { Ref, ShallowRef } from 'vue'\n\nexport type { InkStatus }\n\n/**\n * Undo and redo for the current document, whichever mode its annotations are in. `track` and\n * `react` (from `PluginHistory`) reach the same history, so plugin stores undo with the edits.\n */\nexport interface InkHistory extends PluginHistory {\n canUndo: Readonly<Ref<boolean>>\n canRedo: Readonly<Ref<boolean>>\n undo: () => void\n redo: () => void\n clear: () => void\n /**\n * Runs `fn` and records what it changes as one undo step. The host still receives one change\n * per add. Controlled, the history groups the resulting list changes into one step, and\n * `canUndo` updates once the current task ends. Any other change the host applies in that\n * same window joins the step.\n */\n batch: (fn: () => void) => void\n}\n\nexport interface InkContext {\n assets: Readonly<Ref<PdfAssets>>\n document: Readonly<ShallowRef<InkDocument | null>>\n /** `loading` from the moment a document starts opening, then the document's own status. */\n status: Readonly<Ref<InkStatus>>\n annotations: Readonly<Ref<readonly Annotation[]>>\n selection: Readonly<Ref<readonly string[]>>\n /**\n * The plugins from InkRoot's `plugins` prop, set up once the root has mounted and kept for\n * its life; `null` before that (and on the server) and once it unmounts. InkViewport hands it\n * to the engine; InkCommand places its commands.\n */\n pluginHost: Readonly<ShallowRef<PluginHost | null>>\n /**\n * The search controller from the same set-up as `pluginHost`: shared by the find bar, the\n * search button, the engine's highlights and the plugins. `null` until the root has mounted\n * (and on the server) and once it unmounts.\n */\n search: Readonly<ShallowRef<SearchController | null>>\n /** InkViewport's scroll element while it is mounted: the plugins' `root`. */\n viewportEl: ShallowRef<HTMLElement | null>\n /** Set by InkViewport once it has mounted its viewport and tool controller. */\n viewport: ShallowRef<Viewport | null>\n tools: ShallowRef<ToolController | null>\n /** Desired tool; InkViewport applies it to the controller. */\n tool: Readonly<Ref<ToolId>>\n setTool(id: ToolId): void\n /** Host tools from InkRoot's `tools` prop; InkViewport registers them. */\n hostTools: Readonly<Ref<Tool[] | undefined>>\n /** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */\n decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>\n /** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */\n fonts: Readonly<Ref<readonly string[]>>\n /** The tools' options for InkRoot's life, so they persist across documents. */\n toolOptions: ToolOptions\n /** The saved signatures, from InkRoot's `signatures` store (memory by default). */\n signatures: Readonly<ShallowRef<SignatureLibrary>>\n /** The fonts a typed signature offers: InkRoot's `signatureFonts`, else `SIGNATURE_FONTS`. */\n signatureFonts: Readonly<Ref<readonly string[]>>\n /** The open document's tool style; `null` while no document is open. */\n toolStyle: Readonly<ShallowRef<ToolStyle | null>>\n /** Desired zoom and page from the host's v-models; InkViewport applies and reports back. */\n zoomModel: Readonly<Ref<ZoomValue | undefined>>\n pageModel: Readonly<Ref<number | undefined>>\n reportZoom(z: ZoomValue): void\n reportPage(p: number): void\n /** Last activated annotation (Enter, click with the note tool, etc.). Popovers key off this. */\n activated: Readonly<Ref<string | null>>\n /**\n * Activates annotation `id`, or clears the activation with `null`. This is the context's\n * own: unlike core's `Viewer.setActivated`, it emits InkRoot's `activate` for an id, and it\n * does not check that the id is in the document.\n */\n setActivated(id: string | null): void\n history: InkHistory\n rootEl: Readonly<Ref<HTMLElement | null>>\n}\n\nexport const [injectInkContext, provideInkContext] = createContext<InkContext>('InkRoot')\n\n/**\n * The context for composables: throws a readable error when called outside a component\n * rendered inside `InkRoot`, instead of Vue's injection warning.\n */\nexport function useInkContext(consumer: string): InkContext {\n const ctx = getCurrentInstance() ? injectInkContext(null) : null\n if (!ctx)\n throw new Error(\n `[inkbar] ${consumer} must be called in a component inside <InkRoot>.`\n )\n return ctx\n}\n"],"mappings":";;;AAwGA,IAAa,CAACA,GAAkBC,KAAqBC,EAA0B,SAAS;AAMxF,SAAgBC,EAAc,GAA8B;CAC1D,IAAMC,IAAMC,EAAmB,IAAIL,EAAiB,IAAI,IAAI;CAC5D,IAAI,CAACI,GACH,MAAU,MACR,YAAYE,EAAS,iDACvB;CACF,OAAOF;AACT"}
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { useZoom } from './composables/useZoom';
14
14
  export { usePage } from './composables/usePage';
15
15
  export { useHistory } from './composables/useHistory';
16
16
  export { useEmbedded } from './composables/useEmbedded';
17
+ export { useSearch } from './composables/useSearch';
17
18
  export { useCommand } from './composables/useCommand';
18
19
  export type { CommandHandle } from './composables/useCommand';
19
20
  export { default as InkViewport } from './components/InkViewport.vue';
@@ -43,4 +44,6 @@ export { default as InkPrevPage } from './components/InkPrevPage.vue';
43
44
  export { default as InkNextPage } from './components/InkNextPage.vue';
44
45
  export { default as InkThreadPopover } from './components/InkThreadPopover.vue';
45
46
  export type { ThreadPopoverSlotProps } from './components/InkThreadPopover.vue';
47
+ export { default as InkSearchButton } from './components/InkSearchButton.vue';
48
+ export { default as InkFindBar } from './components/InkFindBar.vue';
46
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,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M,mCAAmC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA"}
package/dist/index.js CHANGED
@@ -11,30 +11,33 @@ import { useZoom as l } from "./composables/useZoom.js";
11
11
  import { usePage as u } from "./composables/usePage.js";
12
12
  import { useHistory as d } from "./composables/useHistory.js";
13
13
  import { useEmbedded as f } from "./composables/useEmbedded.js";
14
- import { useCommand as p } from "./composables/useCommand.js";
15
- import m from "./components/InkAnnotation.js";
16
- import h from "./components/InkPage.js";
17
- import g from "./components/InkViewport.js";
18
- import _ from "./components/InkToolbar.js";
19
- import v from "./components/InkIcon.js";
20
- import y from "./components/InkToolButton.js";
21
- import b from "./components/InkCommand.js";
22
- import x from "./components/InkToolbarSeparator.js";
23
- import S from "./components/InkUndo.js";
24
- import C from "./components/InkRedo.js";
25
- import w from "./components/InkColorMenu.js";
26
- import T from "./components/InkShapeMenu.js";
27
- import E from "./components/InkSignatureDialog.js";
28
- import D from "./components/InkSignatureMenu.js";
29
- import O from "./components/InkHighlightMenu.js";
30
- import k from "./components/InkLineStyleMenu.js";
31
- import A from "./components/InkTextStyleMenu.js";
32
- import j from "./components/InkZoomIn.js";
33
- import M from "./components/InkZoomOut.js";
34
- import N from "./components/InkZoomSelect.js";
35
- import P from "./components/InkPageInput.js";
36
- import F from "./components/InkPageCount.js";
37
- import I from "./components/InkPrevPage.js";
38
- import L from "./components/InkNextPage.js";
39
- import R from "./components/InkThreadPopover.js";
40
- export { m as InkAnnotation, w as InkColorMenu, b as InkCommand, O as InkHighlightMenu, v as InkIcon, k as InkLineStyleMenu, L as InkNextPage, h as InkPage, F as InkPageCount, P as InkPageInput, I as InkPrevPage, C as InkRedo, n as InkRoot, T as InkShapeMenu, E as InkSignatureDialog, D as InkSignatureMenu, A as InkTextStyleMenu, R as InkThreadPopover, y as InkToolButton, _ as InkToolbar, x as InkToolbarSeparator, S as InkUndo, g as InkViewport, j as InkZoomIn, M as InkZoomOut, N as InkZoomSelect, e as injectInkContext, i as useAnnotations, p as useCommand, r as useDocument, f as useEmbedded, d as useHistory, u as usePage, t as useReadable, c as useSelection, a as useTool, s as useToolOptions, o as useToolStyle, l as useZoom };
14
+ import { useSearch as p } from "./composables/useSearch.js";
15
+ import { useCommand as m } from "./composables/useCommand.js";
16
+ import h from "./components/InkAnnotation.js";
17
+ import g from "./components/InkPage.js";
18
+ import _ from "./components/InkViewport.js";
19
+ import v from "./components/InkToolbar.js";
20
+ import y from "./components/InkIcon.js";
21
+ import b from "./components/InkToolButton.js";
22
+ import x from "./components/InkCommand.js";
23
+ import S from "./components/InkToolbarSeparator.js";
24
+ import C from "./components/InkUndo.js";
25
+ import w from "./components/InkRedo.js";
26
+ import T from "./components/InkColorMenu.js";
27
+ import E from "./components/InkShapeMenu.js";
28
+ import D from "./components/InkSignatureDialog.js";
29
+ import O from "./components/InkSignatureMenu.js";
30
+ import k from "./components/InkHighlightMenu.js";
31
+ import A from "./components/InkLineStyleMenu.js";
32
+ import j from "./components/InkTextStyleMenu.js";
33
+ import M from "./components/InkZoomIn.js";
34
+ import N from "./components/InkZoomOut.js";
35
+ import P from "./components/InkZoomSelect.js";
36
+ import F from "./components/InkPageInput.js";
37
+ import I from "./components/InkPageCount.js";
38
+ import L from "./components/InkPrevPage.js";
39
+ import R from "./components/InkNextPage.js";
40
+ import z from "./components/InkThreadPopover.js";
41
+ import B from "./components/InkSearchButton.js";
42
+ import V from "./components/InkFindBar.js";
43
+ export { h as InkAnnotation, T as InkColorMenu, x as InkCommand, V as InkFindBar, k as InkHighlightMenu, y as InkIcon, A as InkLineStyleMenu, R as InkNextPage, g as InkPage, I as InkPageCount, F as InkPageInput, L as InkPrevPage, w as InkRedo, n as InkRoot, B as InkSearchButton, E as InkShapeMenu, D as InkSignatureDialog, O as InkSignatureMenu, j as InkTextStyleMenu, z as InkThreadPopover, b as InkToolButton, v as InkToolbar, S as InkToolbarSeparator, C as InkUndo, _ as InkViewport, M as InkZoomIn, N as InkZoomOut, P as InkZoomSelect, e as injectInkContext, i as useAnnotations, m as useCommand, r as useDocument, f as useEmbedded, d as useHistory, u as usePage, t as useReadable, p as useSearch, c as useSelection, a as useTool, s as useToolOptions, o as useToolStyle, l as useZoom };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkbar/vue",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Vue 3 components and composables for Inkbar, the browser PDF viewer and editor.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://inkbar.dev",
@@ -24,17 +24,18 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "dependencies": {
27
- "@inkbar/icons": "^0.6.0",
27
+ "@inkbar/icons": "^0.7.0",
28
28
  "reka-ui": "^2.11.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@inkbar/core": "^0.6.0",
31
+ "@inkbar/core": "^0.7.0",
32
32
  "vue": "^3.5.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@inkbar/core": "0.6.0",
35
+ "@inkbar/core": "0.7.0",
36
36
  "@inkbar/fixtures": "0.0.0",
37
- "@inkbar/theme": "0.6.0",
37
+ "@inkbar/theme": "0.7.0",
38
+ "@axe-core/playwright": "^4.13.0",
38
39
  "@playwright/experimental-ct-vue": "1.62.1",
39
40
  "@playwright/test": "1.62.1",
40
41
  "@vitejs/plugin-vue": "^6.0.10",