@inkbar/vue 0.7.0 → 0.9.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.
- package/README.md +14 -2
- package/dist/components/InkFormAlert.js +7 -0
- package/dist/components/InkFormAlert.js.map +1 -0
- package/dist/components/InkFormAlert.vue.d.ts +16 -0
- package/dist/components/InkFormAlert.vue.d.ts.map +1 -0
- package/dist/components/InkFormAlert.vue_vue_type_script_setup_true_lang.js +90 -0
- package/dist/components/InkFormAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkHighlightMenu.js.map +1 -1
- package/dist/components/InkHighlightMenu.vue.d.ts.map +1 -1
- package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js +67 -65
- package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkRoot.js.map +1 -1
- package/dist/components/InkRoot.vue.d.ts +24 -5
- package/dist/components/InkRoot.vue.d.ts.map +1 -1
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +197 -148
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkShapeMenu.js.map +1 -1
- package/dist/components/InkShapeMenu.vue.d.ts.map +1 -1
- package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js +58 -56
- package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkSignFieldPopover.js +7 -0
- package/dist/components/InkSignFieldPopover.js.map +1 -0
- package/dist/components/InkSignFieldPopover.vue.d.ts +13 -0
- package/dist/components/InkSignFieldPopover.vue.d.ts.map +1 -0
- package/dist/components/InkSignFieldPopover.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/InkSignFieldPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkSignatureDialog.js.map +1 -1
- package/dist/components/InkSignatureDialog.vue.d.ts +10 -1
- package/dist/components/InkSignatureDialog.vue.d.ts.map +1 -1
- package/dist/components/InkSignatureDialog.vue_vue_type_script_setup_true_lang.js +9 -2
- package/dist/components/InkSignatureDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkSignatureMenu.js.map +1 -1
- package/dist/components/InkSignatureMenu.vue.d.ts.map +1 -1
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js +69 -154
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkToolButton.js.map +1 -1
- package/dist/components/InkToolButton.vue.d.ts.map +1 -1
- package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js +39 -36
- package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkToolbarButton.js +7 -0
- package/dist/components/InkToolbarButton.js.map +1 -0
- package/dist/components/InkToolbarButton.vue.d.ts +22 -0
- package/dist/components/InkToolbarButton.vue.d.ts.map +1 -0
- package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkViewport.js.map +1 -1
- package/dist/components/InkViewport.vue.d.ts.map +1 -1
- package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js +123 -91
- package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/SignatureForm.js.map +1 -1
- package/dist/components/SignatureForm.vue.d.ts +5 -1
- package/dist/components/SignatureForm.vue.d.ts.map +1 -1
- package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js +64 -57
- package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/SignatureMenuPanel.js +7 -0
- package/dist/components/SignatureMenuPanel.js.map +1 -0
- package/dist/components/SignatureMenuPanel.vue.d.ts +15 -0
- package/dist/components/SignatureMenuPanel.vue.d.ts.map +1 -0
- package/dist/components/SignatureMenuPanel.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/SignatureMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useForm.d.ts +18 -0
- package/dist/composables/useForm.d.ts.map +1 -0
- package/dist/composables/useForm.js +17 -0
- package/dist/composables/useForm.js.map +1 -0
- package/dist/composables/useRegisteredTool.d.ts +21 -0
- package/dist/composables/useRegisteredTool.d.ts.map +1 -0
- package/dist/composables/useRegisteredTool.js +25 -0
- package/dist/composables/useRegisteredTool.js.map +1 -0
- package/dist/composables/useToolOptions.d.ts +8 -0
- package/dist/composables/useToolOptions.d.ts.map +1 -1
- package/dist/composables/useToolOptions.js +10 -5
- package/dist/composables/useToolOptions.js.map +1 -1
- package/dist/context.d.ts +12 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -27
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignatureMenuPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_mergeProps","_Fragment","_createElementVNode","_unref","_renderList","_createVNode","InkIcon","_createCommentVNode","_createTextVNode","_toDisplayString","InkIcon_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","SignatureMenuPanel_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","ctx","useInkContext","removeError","useReadable","root","useTemplateRef","previews","computed","item","signaturePreview","remove","id","nextTick","menu","rows","row","innerAttrs","SIGNATURE_LABELS","handleMenuKeys","openBlock","createElementBlock","mergeProps","Fragment","createElementVNode","unref","renderList","i","createVNode","Trash2","_cache","createCommentVNode","Plus","createTextVNode","toDisplayString"],"sources":["../../src/components/SignatureMenuPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * The panel both signature menus show: the saved signatures as previews, each with a remove\n * button, then \"Create signature\". `InkSignatureMenu` picks a signature for the tool with it;\n * `InkSignFieldPopover` signs a field with it.\n */\nimport { handleMenuKeys, SIGNATURE_LABELS, signaturePreview } from '@inkbar/core/dom'\nimport { Plus, Trash2 } from '@inkbar/icons'\nimport { computed, nextTick, useTemplateRef } from 'vue'\n\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport InkIcon from './InkIcon.vue'\n\nimport type { SignatureTemplate } from '@inkbar/core'\nimport type { SignatureMenuItem } from '@inkbar/core/dom'\n\nconst props = defineProps<{ items: readonly SignatureMenuItem[] }>()\nconst emit = defineEmits<{ choose: [template: SignatureTemplate]; create: [] }>()\n\nconst ctx = useInkContext('SignatureMenuPanel')\nconst removeError = useReadable(() => ctx.signatures.value.removeError, undefined)\nconst root = useTemplateRef<HTMLElement>('root')\n\n/** A saved signature drawn small: ink as filled outlines. */\nconst previews = computed(() =>\n props.items.map((item) =>\n item.template.kind === 'ink' ? signaturePreview(item.template) : null\n )\n)\n\n/** Removes a template; focus moves to the signature now in its row, else \"Create signature\". */\nfunction remove(id: string, row: number): void {\n ctx.signatures.value.remove(id).then(\n async () => {\n await nextTick()\n const menu = root.value\n if (!menu) return\n const rows = menu.querySelectorAll<HTMLElement>('.ink-signature-item')\n const next =\n rows[Math.min(row, rows.length - 1)] ??\n menu.querySelector<HTMLElement>('[data-ink-signature-create]')\n next?.focus({ preventScroll: true })\n },\n () => {\n // The host's store refused: the signature stays.\n }\n )\n}\n\nconst innerAttrs = {\n role: 'menu',\n 'aria-label': SIGNATURE_LABELS.menu,\n onKeydown: (e: KeyboardEvent) => handleMenuKeys(e, e.currentTarget as HTMLElement),\n}\n</script>\n\n<template>\n <div ref=\"root\" v-bind=\"innerAttrs\">\n <template v-if=\"props.items.length > 0\">\n <div\n role=\"group\"\n :aria-label=\"SIGNATURE_LABELS.saved\"\n class=\"ink-signature-list\"\n data-ink-menu-columns=\"2\"\n >\n <template v-for=\"(item, row) in props.items\" :key=\"item.id\">\n <button\n type=\"button\"\n role=\"menuitemradio\"\n :aria-checked=\"item.checked\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n class=\"ink-select-item ink-menu-item ink-signature-item\"\n data-ink-select-item\n :data-key=\"item.id\"\n :data-state=\"item.checked ? 'checked' : 'unchecked'\"\n @click=\"emit('choose', item.template)\"\n >\n <span class=\"ink-signature-preview\" :data-kind=\"item.template.kind\">\n <img\n v-if=\"item.template.kind === 'image'\"\n :src=\"item.template.imagedata\"\n alt=\"\"\n draggable=\"false\"\n />\n <svg v-else :viewBox=\"previews[row]?.viewBox\" aria-hidden=\"true\">\n <path\n v-for=\"(d, i) in previews[row]?.paths ?? []\"\n :key=\"i\"\n :d=\"d\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n </button>\n <button\n type=\"button\"\n role=\"menuitem\"\n :aria-label=\"item.removeLabel\"\n :title=\"item.removeLabel\"\n tabindex=\"-1\"\n class=\"ink-menu-item ink-signature-remove\"\n data-ink-signature-remove\n :data-key=\"item.id\"\n @click=\"remove(item.id, row)\"\n >\n <InkIcon :icon=\"Trash2\" :size=\"16\" />\n </button>\n </template>\n </div>\n <div role=\"separator\" class=\"ink-select-separator\" />\n </template>\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"ink-select-item ink-menu-item ink-signature-create\"\n data-ink-select-item\n data-ink-signature-create\n @click=\"emit('create')\"\n >\n <InkIcon :icon=\"Plus\" :size=\"16\" />\n {{ SIGNATURE_LABELS.create }}\n </button>\n <p\n v-if=\"removeError\"\n class=\"ink-field-error ink-signature-remove-error\"\n role=\"alert\"\n data-ink-signature-remove-error\n >\n {{ removeError }}\n </p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,IAAMuB,IAAQC,GACRC,IAAOH,GAEPI,IAAMC,EAAc,oBAAoB,GACxCC,IAAcC,QAAkBH,EAAI,WAAW,MAAM,aAAa,KAAA,CAAS,GAC3EI,IAAOC,EAA4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C,GAAAA,MAAAA,GAAAA,CAAAA,MAAAA,CAAAA,GAAAA,EAAA,MACnCC,EAAGN,EAAAsC,CAAA,CAAgB,CAAC,MAAM,GAAA,CAAA,CAAA,CAAA;GAGpBtC,EAAAuB,CAAA,KADR5B,EAAA,GAAAC,EAOI,KAPJmB,GAOIT,EADCN,EAAAuB,CAAA,CAAW,GAAA,CAAA,KAAA4B,EAAA,IAAA,EAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FieldValues, FormField, FormSetResult } from '@inkbar/core';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export interface FormHandle {
|
|
4
|
+
/** The open document's form fields; empty while none is open or it has none. */
|
|
5
|
+
fields: Readonly<Ref<readonly FormField[]>>;
|
|
6
|
+
/** What the fields hold now, keyed by full name. */
|
|
7
|
+
values: Readonly<Ref<FieldValues>>;
|
|
8
|
+
/**
|
|
9
|
+
* Commits values as a person would: scripts run, and the call is one undo step. Returns the
|
|
10
|
+
* names applied and rejected, or `undefined` while no document is open.
|
|
11
|
+
*/
|
|
12
|
+
set: (values: FieldValues) => FormSetResult | undefined;
|
|
13
|
+
/** Restores the PDF's default values of `names`, or of every field. */
|
|
14
|
+
reset: (names?: string[]) => void;
|
|
15
|
+
}
|
|
16
|
+
/** The open document's form: its fields, their values, and `set` and `reset`. */
|
|
17
|
+
export declare function useForm(): FormHandle;
|
|
18
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/composables/useForm.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9B,MAAM,WAAW,UAAU;IACzB,gFAAgF;IAChF,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC,CAAA;IAC3C,oDAAoD;IACpD,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;IAClC;;;OAGG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,aAAa,GAAG,SAAS,CAAA;IACvD,uEAAuE;IACvE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CAClC;AAED,iFAAiF;AACjF,wBAAgB,OAAO,IAAI,UAAU,CASpC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { useReadable as t } from "../use-readable.js";
|
|
3
|
+
//#region src/composables/useForm.ts
|
|
4
|
+
var n = [], r = Object.freeze({});
|
|
5
|
+
function i() {
|
|
6
|
+
let i = e("useForm()"), a = () => i.document.value?.form;
|
|
7
|
+
return {
|
|
8
|
+
fields: t(() => a()?.fields, n),
|
|
9
|
+
values: t(() => a()?.values, r),
|
|
10
|
+
set: (e) => a()?.set(e),
|
|
11
|
+
reset: (e) => a()?.reset(e)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { i as useForm };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=useForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.js","names":["NO_FIELDS","NO_VALUES","useForm","ctx","useInkContext","form","useReadable","values","names"],"sources":["../../src/composables/useForm.ts"],"sourcesContent":["import { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { FieldValues, FormField, FormSetResult } from '@inkbar/core'\nimport type { Ref } from 'vue'\n\nconst NO_FIELDS: readonly FormField[] = []\nconst NO_VALUES: FieldValues = Object.freeze({})\n\nexport interface FormHandle {\n /** The open document's form fields; empty while none is open or it has none. */\n fields: Readonly<Ref<readonly FormField[]>>\n /** What the fields hold now, keyed by full name. */\n values: Readonly<Ref<FieldValues>>\n /**\n * Commits values as a person would: scripts run, and the call is one undo step. Returns the\n * names applied and rejected, or `undefined` while no document is open.\n */\n set: (values: FieldValues) => FormSetResult | undefined\n /** Restores the PDF's default values of `names`, or of every field. */\n reset: (names?: string[]) => void\n}\n\n/** The open document's form: its fields, their values, and `set` and `reset`. */\nexport function useForm(): FormHandle {\n const ctx = useInkContext('useForm()')\n const form = () => ctx.document.value?.form\n return {\n fields: useReadable(() => form()?.fields, NO_FIELDS),\n values: useReadable(() => form()?.values, NO_VALUES),\n set: (values) => form()?.set(values),\n reset: (names) => form()?.reset(names),\n }\n}\n"],"mappings":";;;AAMA,IAAMA,IAAkC,CAAC,GACnCC,IAAyB,OAAO,OAAO,CAAC,CAAC;AAiB/C,SAAgBC,IAAsB;CACpC,IAAMC,IAAMC,EAAc,WAAW,GAC/BC,UAAaF,EAAI,SAAS,OAAO;CACvC,OAAO;EACL,QAAQG,QAAkBD,EAAK,CAAC,EAAE,QAAQL,CAAS;EACnD,QAAQM,QAAkBD,EAAK,CAAC,EAAE,QAAQJ,CAAS;EACnD,MAAM,MAAWI,EAAK,CAAC,EAAE,IAAIE,CAAM;EACnC,QAAQ,MAAUF,EAAK,CAAC,EAAE,MAAMG,CAAK;CACvC;AACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { InkContext } from '../context';
|
|
3
|
+
import { PluginHost, Tool, ToolId } from '@inkbar/core/dom';
|
|
4
|
+
/** `select-text` and `select`, then the host's tools, then the plugins' tools, by id. */
|
|
5
|
+
export declare function toolIdsOf(hostTools: readonly Tool[] | undefined, pluginHost: PluginHost | null): ToolId[];
|
|
6
|
+
/**
|
|
7
|
+
* The tools a control may use: those in `tools` and the plugins now that the open viewer was
|
|
8
|
+
* also built with, so a control never offers a tool the viewer would refuse. A tool added to
|
|
9
|
+
* `tools` counts from the next open; one removed stops at once. With no viewer, `tools` and
|
|
10
|
+
* the plugins alone.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registeredToolIds(hostTools: readonly Tool[] | undefined, pluginHost: PluginHost | null, opened: readonly ToolId[] | null): ToolId[];
|
|
13
|
+
/** Whether a tool by this id is registered, without logging anything when it is not. */
|
|
14
|
+
export declare function useHasTool(ctx: InkContext, id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a tool by this id is registered: always for `select-text` and `select`, else when
|
|
17
|
+
* InkRoot's `tools` or a plugin has it. When it is not, once the plugins are set up, this logs
|
|
18
|
+
* `InkError('UnknownTool')` to the console, once per component.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRegisteredTool(id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>>;
|
|
21
|
+
//# sourceMappingURL=useRegisteredTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegisteredTool.d.ts","sourceRoot":"","sources":["../../src/composables/useRegisteredTool.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAE/E,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEhE,yFAAyF;AACzF,wBAAgB,SAAS,CACvB,SAAS,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,EACtC,UAAU,EAAE,UAAU,GAAG,IAAI,GAC5B,MAAM,EAAE,CAIV;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,EACtC,UAAU,EAAE,UAAU,GAAG,IAAI,EAC7B,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAC/B,MAAM,EAAE,CAGV;AAKD,wFAAwF;AACxF,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAExB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAetF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { computed as t, toValue as n, watch as r } from "vue";
|
|
3
|
+
import { unknownTool as i, withHostTools as a } from "@inkbar/core/dom";
|
|
4
|
+
//#region src/composables/useRegisteredTool.ts
|
|
5
|
+
function o(e, t) {
|
|
6
|
+
return a([...e ?? [], ...t?.tools ?? []]).map((e) => e.id);
|
|
7
|
+
}
|
|
8
|
+
function s(e, t, n) {
|
|
9
|
+
let r = o(e, t);
|
|
10
|
+
return n ? r.filter((e) => n.includes(e)) : r;
|
|
11
|
+
}
|
|
12
|
+
var c = (e) => s(e.hostTools.value, e.pluginHost.value, e.openedToolIds.value);
|
|
13
|
+
function l(e, r) {
|
|
14
|
+
return t(() => c(e).includes(n(r)));
|
|
15
|
+
}
|
|
16
|
+
function u(t) {
|
|
17
|
+
let a = e("useRegisteredTool()"), o = l(a, t), s = !1;
|
|
18
|
+
return r([() => a.pluginHost.value !== null, o], ([e, r]) => {
|
|
19
|
+
!e || r || s || (s = !0, console.error(i(n(t), c(a))));
|
|
20
|
+
}, { immediate: !0 }), o;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as registeredToolIds, o as toolIdsOf, l as useHasTool, u as useRegisteredTool };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useRegisteredTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegisteredTool.js","names":["toolIdsOf","withHostTools","hostTools","pluginHost","t","registeredToolIds","ids","opened","id","idsIn","ctx","useHasTool","computed","toValue","useRegisteredTool","useInkContext","registered","logged","watch","ready","ok","unknownTool"],"sources":["../../src/composables/useRegisteredTool.ts"],"sourcesContent":["import { unknownTool, withHostTools } from '@inkbar/core/dom'\nimport { computed, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'\n\nimport { useInkContext, type InkContext } from '../context'\n\nimport type { PluginHost, Tool, ToolId } from '@inkbar/core/dom'\n\n/** `select-text` and `select`, then the host's tools, then the plugins' tools, by id. */\nexport function toolIdsOf(\n hostTools: readonly Tool[] | undefined,\n pluginHost: PluginHost | null\n): ToolId[] {\n return withHostTools([...(hostTools ?? []), ...(pluginHost?.tools ?? [])]).map(\n (t) => t.id\n )\n}\n\n/**\n * The tools a control may use: those in `tools` and the plugins now that the open viewer was\n * also built with, so a control never offers a tool the viewer would refuse. A tool added to\n * `tools` counts from the next open; one removed stops at once. With no viewer, `tools` and\n * the plugins alone.\n */\nexport function registeredToolIds(\n hostTools: readonly Tool[] | undefined,\n pluginHost: PluginHost | null,\n opened: readonly ToolId[] | null\n): ToolId[] {\n const ids = toolIdsOf(hostTools, pluginHost)\n return opened ? ids.filter((id) => opened.includes(id)) : ids\n}\n\nconst idsIn = (ctx: InkContext): ToolId[] =>\n registeredToolIds(ctx.hostTools.value, ctx.pluginHost.value, ctx.openedToolIds.value)\n\n/** Whether a tool by this id is registered, without logging anything when it is not. */\nexport function useHasTool(\n ctx: InkContext,\n id: MaybeRefOrGetter<ToolId>\n): Readonly<Ref<boolean>> {\n return computed(() => idsIn(ctx).includes(toValue(id)))\n}\n\n/**\n * Whether a tool by this id is registered: always for `select-text` and `select`, else when\n * InkRoot's `tools` or a plugin has it. When it is not, once the plugins are set up, this logs\n * `InkError('UnknownTool')` to the console, once per component.\n */\nexport function useRegisteredTool(id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>> {\n const ctx = useInkContext('useRegisteredTool()')\n const registered = useHasTool(ctx, id)\n let logged = false\n // The plugins' tools are known once InkRoot has mounted and set up its plugin host.\n watch(\n [() => ctx.pluginHost.value !== null, registered],\n ([ready, ok]) => {\n if (!ready || ok || logged) return\n logged = true\n console.error(unknownTool(toValue(id), idsIn(ctx)))\n },\n { immediate: true }\n )\n return registered\n}\n"],"mappings":";;;;AAQA,SAAgBA,EACd,GACA,GACU;CACV,OAAOC,EAAc,CAAC,GAAIC,KAAa,CAAC,GAAI,GAAIC,GAAY,SAAS,CAAC,CAAE,CAAC,CAAC,CAAC,KACxE,MAAMC,EAAE,EACX;AACF;AAQA,SAAgBC,EACd,GACA,GACA,GACU;CACV,IAAMC,IAAMN,EAAUE,GAAWC,CAAU;CAC3C,OAAOI,IAASD,EAAI,QAAQ,MAAOC,EAAO,SAASC,CAAE,CAAC,IAAIF;AAC5D;AAEA,IAAMG,KAAS,MACbJ,EAAkBK,EAAI,UAAU,OAAOA,EAAI,WAAW,OAAOA,EAAI,cAAc,KAAK;AAGtF,SAAgBC,EACd,GACA,GACwB;CACxB,OAAOC,QAAeH,EAAMC,CAAG,CAAC,CAAC,SAASG,EAAQL,CAAE,CAAC,CAAC;AACxD;AAOA,SAAgBM,EAAkB,GAAsD;CACtF,IAAMJ,IAAMK,EAAc,qBAAqB,GACzCC,IAAaL,EAAWD,GAAKF,CAAE,GACjCS,IAAS;CAWb,OATAC,EACE,OAAOR,EAAI,WAAW,UAAU,MAAMM,CAAU,IAC/C,CAACG,GAAOC,OAAQ;EACf,AAAI,CAACD,KAASC,KAAMH,MACpB,IAAS,IACT,QAAQ,MAAMI,EAAYR,EAAQL,CAAE,GAAGC,EAAMC,CAAG,CAAC,CAAC;CACpD,GACA,EAAE,WAAW,GAAK,CACpB,GACOM;AACT"}
|
|
@@ -8,4 +8,12 @@ export declare function useToolOptions<O extends object = object>(id: MaybeRefOr
|
|
|
8
8
|
options: Readonly<Ref<O>>;
|
|
9
9
|
setOptions: (patch: Partial<O>) => void;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* `useToolOptions` that reads and sets nothing while `active` is false, so a control for a
|
|
13
|
+
* missing tool leaves the controller's own `UnknownTool` log alone.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useToolOptionsWhile<O extends object = object>(id: MaybeRefOrGetter<ToolId>, active: MaybeRefOrGetter<boolean>): {
|
|
16
|
+
options: Readonly<Ref<O>>;
|
|
17
|
+
setOptions: (patch: Partial<O>) => void;
|
|
18
|
+
};
|
|
11
19
|
//# sourceMappingURL=useToolOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useToolOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"useToolOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useToolOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,CAExE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC3D,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAChC;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,CAYxE"}
|
|
@@ -3,14 +3,19 @@ import { useReadable as t } from "../use-readable.js";
|
|
|
3
3
|
import { toValue as n } from "vue";
|
|
4
4
|
//#region src/composables/useToolOptions.ts
|
|
5
5
|
var r = {};
|
|
6
|
-
function i(
|
|
7
|
-
|
|
6
|
+
function i(e) {
|
|
7
|
+
return a(e, !0);
|
|
8
|
+
}
|
|
9
|
+
function a(i, a) {
|
|
10
|
+
let o = e("useToolOptions()");
|
|
8
11
|
return {
|
|
9
|
-
options: t(() => a.tools.value?.options(n(i)), r),
|
|
10
|
-
setOptions: (e) =>
|
|
12
|
+
options: t(() => n(a) ? o.tools.value?.options(n(i)) : null, r),
|
|
13
|
+
setOptions: (e) => {
|
|
14
|
+
n(a) && o.tools.value?.setOptions(n(i), e);
|
|
15
|
+
}
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
//#endregion
|
|
14
|
-
export { i as useToolOptions };
|
|
19
|
+
export { i as useToolOptions, a as useToolOptionsWhile };
|
|
15
20
|
|
|
16
21
|
//# sourceMappingURL=useToolOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolOptions.js","names":["NO_OPTIONS","useToolOptions","ctx","useInkContext","useReadable","toValue","
|
|
1
|
+
{"version":3,"file":"useToolOptions.js","names":["NO_OPTIONS","useToolOptions","useToolOptionsWhile","id","ctx","useInkContext","useReadable","toValue","active","patch"],"sources":["../../src/composables/useToolOptions.ts"],"sourcesContent":["import { toValue, type MaybeRefOrGetter, type Ref } from 'vue'\n\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { ToolId } from '@inkbar/core/dom'\n\nconst NO_OPTIONS: object = {}\n\n/**\n * A tool's options and a setter that merges a patch into them without switching tools.\n * Options are empty, and the setter does nothing, until the viewport has mounted.\n */\nexport function useToolOptions<O extends object = object>(\n id: MaybeRefOrGetter<ToolId>\n): { options: Readonly<Ref<O>>; setOptions: (patch: Partial<O>) => void } {\n return useToolOptionsWhile<O>(id, true)\n}\n\n/**\n * `useToolOptions` that reads and sets nothing while `active` is false, so a control for a\n * missing tool leaves the controller's own `UnknownTool` log alone.\n */\nexport function useToolOptionsWhile<O extends object = object>(\n id: MaybeRefOrGetter<ToolId>,\n active: MaybeRefOrGetter<boolean>\n): { options: Readonly<Ref<O>>; setOptions: (patch: Partial<O>) => void } {\n const ctx = useInkContext('useToolOptions()')\n const options = useReadable(\n () => (toValue(active) ? ctx.tools.value?.options(toValue(id)) : null),\n NO_OPTIONS\n ) as Readonly<Ref<O>>\n return {\n options,\n setOptions: (patch) => {\n if (toValue(active)) ctx.tools.value?.setOptions(toValue(id), patch)\n },\n }\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAqB,CAAC;AAM5B,SAAgBC,EACd,GACwE;CACxE,OAAOC,EAAuBC,GAAI,EAAI;AACxC;AAMA,SAAgBD,EACd,GACA,GACwE;CACxE,IAAME,IAAMC,EAAc,kBAAkB;CAK5C,OAAO;EACL,SALcC,QACPC,EAAQC,CAAM,IAAIJ,EAAI,MAAM,OAAO,QAAQG,EAAQJ,CAAE,CAAC,IAAI,MACjEH,CAGA;EACA,aAAa,MAAU;GACrB,AAAIO,EAAQC,CAAM,KAAGJ,EAAI,MAAM,OAAO,WAAWG,EAAQJ,CAAE,GAAGM,CAAK;EACrE;CACF;AACF"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Annotation, InkDocument, InkStatus, PdfAssets, PluginHistory, SignatureLibrary } from '@inkbar/core';
|
|
1
|
+
import { Annotation, FormAction, InkDocument, InkError, InkStatus, PdfAssets, PluginHistory, SignatureLibrary } from '@inkbar/core';
|
|
2
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 };
|
|
@@ -49,6 +49,11 @@ export interface InkContext {
|
|
|
49
49
|
setTool(id: ToolId): void;
|
|
50
50
|
/** Host tools from InkRoot's `tools` prop; InkViewport registers them. */
|
|
51
51
|
hostTools: Readonly<Ref<Tool[] | undefined>>;
|
|
52
|
+
/**
|
|
53
|
+
* The ids of the tools the current viewer was built with, set by InkViewport; `null` while
|
|
54
|
+
* there is none. A tool added to `tools` later is registered from the next build.
|
|
55
|
+
*/
|
|
56
|
+
openedToolIds: ShallowRef<readonly ToolId[] | null>;
|
|
52
57
|
/** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */
|
|
53
58
|
decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>;
|
|
54
59
|
/** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */
|
|
@@ -76,6 +81,12 @@ export interface InkContext {
|
|
|
76
81
|
setActivated(id: string | null): void;
|
|
77
82
|
history: InkHistory;
|
|
78
83
|
rootEl: Readonly<Ref<HTMLElement | null>>;
|
|
84
|
+
/** InkRoot's `formHighlight`; InkViewport reads it when it builds the viewer. */
|
|
85
|
+
formHighlight: Readonly<Ref<boolean | undefined>>;
|
|
86
|
+
/** Emits InkRoot's `form-action`. */
|
|
87
|
+
reportFormAction(action: FormAction): void;
|
|
88
|
+
/** Emits InkRoot's `error`, for failures after the document opened (a refused signing). */
|
|
89
|
+
reportError(error: InkError): void;
|
|
79
90
|
}
|
|
80
91
|
export declare const injectInkContext: <T extends InkContext | null | undefined = InkContext>(fallback?: T | undefined) => T extends null ? InkContext | null : InkContext, provideInkContext: (contextValue: InkContext) => InkContext;
|
|
81
92
|
/**
|
package/dist/context.d.ts.map
CHANGED
|
@@ -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,gBAAgB,EAChB,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,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IACrC,OAAO,EAAE,UAAU,CAAA;IACnB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAA;IACzC,iFAAiF;IACjF,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAA;IACjD,qCAAqC;IACrC,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1C,2FAA2F;IAC3F,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;CACnC;AAED,eAAO,MAAO,gBAAgB,uIAAE,iBAAiB,0CAAwC,CAAA;AAEzF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAO1D"}
|
package/dist/context.js.map
CHANGED
|
@@ -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 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":";;;
|
|
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 FormAction,\n InkDocument,\n InkError,\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 /**\n * The ids of the tools the current viewer was built with, set by InkViewport; `null` while\n * there is none. A tool added to `tools` later is registered from the next build.\n */\n openedToolIds: ShallowRef<readonly ToolId[] | null>\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 /** InkRoot's `formHighlight`; InkViewport reads it when it builds the viewer. */\n formHighlight: Readonly<Ref<boolean | undefined>>\n /** Emits InkRoot's `form-action`. */\n reportFormAction(action: FormAction): void\n /** Emits InkRoot's `error`, for failures after the document opened (a refused signing). */\n reportError(error: InkError): void\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":";;;AAqHA,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
|
@@ -16,6 +16,8 @@ export { useHistory } from './composables/useHistory';
|
|
|
16
16
|
export { useEmbedded } from './composables/useEmbedded';
|
|
17
17
|
export { useSearch } from './composables/useSearch';
|
|
18
18
|
export { useCommand } from './composables/useCommand';
|
|
19
|
+
export { useForm } from './composables/useForm';
|
|
20
|
+
export type { FormHandle } from './composables/useForm';
|
|
19
21
|
export type { CommandHandle } from './composables/useCommand';
|
|
20
22
|
export { default as InkViewport } from './components/InkViewport.vue';
|
|
21
23
|
export { default as InkPage } from './components/InkPage.vue';
|
|
@@ -25,6 +27,7 @@ export { default as InkToolbar } from './components/InkToolbar.vue';
|
|
|
25
27
|
export { default as InkIcon } from './components/InkIcon.vue';
|
|
26
28
|
export { default as InkToolButton } from './components/InkToolButton.vue';
|
|
27
29
|
export { default as InkCommand } from './components/InkCommand.vue';
|
|
30
|
+
export { default as InkToolbarButton } from './components/InkToolbarButton.vue';
|
|
28
31
|
export { default as InkToolbarSeparator } from './components/InkToolbarSeparator.vue';
|
|
29
32
|
export { default as InkUndo } from './components/InkUndo.vue';
|
|
30
33
|
export { default as InkRedo } from './components/InkRedo.vue';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAClE,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,GACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,M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OAAO,IAAI,gBAAgB,EAAE,MAAM,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
|
@@ -13,31 +13,33 @@ import { useHistory as d } from "./composables/useHistory.js";
|
|
|
13
13
|
import { useEmbedded as f } from "./composables/useEmbedded.js";
|
|
14
14
|
import { useSearch as p } from "./composables/useSearch.js";
|
|
15
15
|
import { useCommand as m } from "./composables/useCommand.js";
|
|
16
|
-
import h from "./
|
|
17
|
-
import g from "./components/
|
|
18
|
-
import _ from "./components/
|
|
19
|
-
import v from "./components/
|
|
16
|
+
import { useForm as h } from "./composables/useForm.js";
|
|
17
|
+
import g from "./components/InkAnnotation.js";
|
|
18
|
+
import _ from "./components/InkPage.js";
|
|
19
|
+
import v from "./components/InkSignatureDialog.js";
|
|
20
20
|
import y from "./components/InkIcon.js";
|
|
21
|
-
import b from "./components/
|
|
22
|
-
import x from "./components/
|
|
23
|
-
import S from "./components/
|
|
24
|
-
import C from "./components/
|
|
25
|
-
import w from "./components/
|
|
26
|
-
import T from "./components/
|
|
27
|
-
import E from "./components/
|
|
28
|
-
import D from "./components/
|
|
29
|
-
import O from "./components/
|
|
30
|
-
import k from "./components/
|
|
31
|
-
import A from "./components/
|
|
32
|
-
import j from "./components/
|
|
33
|
-
import M from "./components/
|
|
34
|
-
import N from "./components/
|
|
35
|
-
import P from "./components/
|
|
36
|
-
import F from "./components/
|
|
37
|
-
import I from "./components/
|
|
38
|
-
import L from "./components/
|
|
39
|
-
import R from "./components/
|
|
40
|
-
import z from "./components/
|
|
41
|
-
import B from "./components/
|
|
42
|
-
import V from "./components/
|
|
43
|
-
|
|
21
|
+
import b from "./components/InkViewport.js";
|
|
22
|
+
import x from "./components/InkToolbar.js";
|
|
23
|
+
import S from "./components/InkToolButton.js";
|
|
24
|
+
import C from "./components/InkCommand.js";
|
|
25
|
+
import w from "./components/InkToolbarButton.js";
|
|
26
|
+
import T from "./components/InkToolbarSeparator.js";
|
|
27
|
+
import E from "./components/InkUndo.js";
|
|
28
|
+
import D from "./components/InkRedo.js";
|
|
29
|
+
import O from "./components/InkColorMenu.js";
|
|
30
|
+
import k from "./components/InkShapeMenu.js";
|
|
31
|
+
import A from "./components/InkSignatureMenu.js";
|
|
32
|
+
import j from "./components/InkHighlightMenu.js";
|
|
33
|
+
import M from "./components/InkLineStyleMenu.js";
|
|
34
|
+
import N from "./components/InkTextStyleMenu.js";
|
|
35
|
+
import P from "./components/InkZoomIn.js";
|
|
36
|
+
import F from "./components/InkZoomOut.js";
|
|
37
|
+
import I from "./components/InkZoomSelect.js";
|
|
38
|
+
import L from "./components/InkPageInput.js";
|
|
39
|
+
import R from "./components/InkPageCount.js";
|
|
40
|
+
import z from "./components/InkPrevPage.js";
|
|
41
|
+
import B from "./components/InkNextPage.js";
|
|
42
|
+
import V from "./components/InkThreadPopover.js";
|
|
43
|
+
import H from "./components/InkSearchButton.js";
|
|
44
|
+
import U from "./components/InkFindBar.js";
|
|
45
|
+
export { g as InkAnnotation, O as InkColorMenu, C as InkCommand, U as InkFindBar, j as InkHighlightMenu, y as InkIcon, M as InkLineStyleMenu, B as InkNextPage, _ as InkPage, R as InkPageCount, L as InkPageInput, z as InkPrevPage, D as InkRedo, n as InkRoot, H as InkSearchButton, k as InkShapeMenu, v as InkSignatureDialog, A as InkSignatureMenu, N as InkTextStyleMenu, V as InkThreadPopover, S as InkToolButton, x as InkToolbar, w as InkToolbarButton, T as InkToolbarSeparator, E as InkUndo, b as InkViewport, P as InkZoomIn, F as InkZoomOut, I as InkZoomSelect, e as injectInkContext, i as useAnnotations, m as useCommand, r as useDocument, f as useEmbedded, h as useForm, 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.
|
|
3
|
+
"version": "0.9.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,17 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@inkbar/icons": "^0.
|
|
27
|
+
"@inkbar/icons": "^0.9.0",
|
|
28
28
|
"reka-ui": "^2.11.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@inkbar/core": "^0.
|
|
31
|
+
"@inkbar/core": "^0.9.0",
|
|
32
32
|
"vue": "^3.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@inkbar/core": "0.
|
|
35
|
+
"@inkbar/core": "0.9.0",
|
|
36
36
|
"@inkbar/fixtures": "0.0.0",
|
|
37
|
-
"@inkbar/theme": "0.
|
|
37
|
+
"@inkbar/theme": "0.9.0",
|
|
38
38
|
"@axe-core/playwright": "^4.13.0",
|
|
39
39
|
"@playwright/experimental-ct-vue": "1.62.1",
|
|
40
40
|
"@playwright/test": "1.62.1",
|