@inkbar/vue 0.7.0 → 0.8.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 +7 -0
- 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/InkRoot.js.map +1 -1
- package/dist/components/InkRoot.vue.d.ts +15 -1
- package/dist/components/InkRoot.vue.d.ts.map +1 -1
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +178 -142
- package/dist/components/InkRoot.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 +9 -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 +72 -159
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- 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 +117 -86
- 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 +27 -21
- 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/context.d.ts +7 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -27
- package/package.json +5 -5
|
@@ -2,8 +2,8 @@ import { useInkContext as e } from "../context.js";
|
|
|
2
2
|
import { useReadable as t } from "../use-readable.js";
|
|
3
3
|
import { useTool as n } from "../composables/useTool.js";
|
|
4
4
|
import { useToolOptions as ee } from "../composables/useToolOptions.js";
|
|
5
|
-
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as te, defineComponent as c, normalizeStyle as ne, onBeforeUnmount as l, onMounted as re, openBlock as u, renderList as d, toDisplayString as f, unref as p, useId as m, useTemplateRef as h, withCtx as
|
|
6
|
-
import { SIGNATURE_LABELS as
|
|
5
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as te, defineComponent as c, normalizeStyle as ne, onBeforeUnmount as l, onMounted as re, openBlock as u, renderList as d, toDisplayString as f, unref as p, useId as m, useTemplateRef as h, withCtx as g } from "vue";
|
|
6
|
+
import { SIGNATURE_LABELS as _, SIGNATURE_TABS as ie, createSignatureDraft as ae, fontFamilyValue as v, handleRadioKeys as y, handleTabKeys as b } from "@inkbar/core/dom";
|
|
7
7
|
import { DialogClose as x } from "reka-ui";
|
|
8
8
|
//#region src/components/SignatureForm.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var S = ["aria-label"], C = [
|
|
@@ -37,21 +37,27 @@ var S = ["aria-label"], C = [
|
|
|
37
37
|
key: 1,
|
|
38
38
|
class: "ink-field-error",
|
|
39
39
|
role: "alert"
|
|
40
|
-
},
|
|
40
|
+
}, L = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "ink-field-error",
|
|
43
43
|
role: "alert",
|
|
44
44
|
"data-ink-signature-save-error": ""
|
|
45
|
-
},
|
|
45
|
+
}, oe = { class: "ink-dialog-actions" }, R = {
|
|
46
46
|
type: "button",
|
|
47
47
|
class: "ink-button",
|
|
48
48
|
"data-ink-signature-cancel": ""
|
|
49
49
|
}, z = ["disabled"], B = /*@__PURE__*/ c({
|
|
50
50
|
__name: "SignatureForm",
|
|
51
|
-
props: {
|
|
51
|
+
props: {
|
|
52
|
+
fonts: { default: void 0 },
|
|
53
|
+
select: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !0
|
|
56
|
+
}
|
|
57
|
+
},
|
|
52
58
|
emits: ["saved", "close"],
|
|
53
59
|
setup(c, { emit: B }) {
|
|
54
|
-
let V = c, H = B, U = e("InkSignatureDialog"), { setTool: W } = n(), { setOptions: G } = ee("signature"), K =
|
|
60
|
+
let V = c, H = B, U = e("InkSignatureDialog"), { setTool: W } = n(), { setOptions: G } = ee("signature"), K = ae({ fonts: V.fonts ?? U.signatureFonts.value }), q = K.state.get(), J = t(K.state, q), Y = m(), X = h("pad"), Z;
|
|
55
61
|
re(() => {
|
|
56
62
|
X.value && (Z = K.attachPad(X.value));
|
|
57
63
|
}), l(() => {
|
|
@@ -59,17 +65,17 @@ var S = ["aria-label"], C = [
|
|
|
59
65
|
});
|
|
60
66
|
function se() {
|
|
61
67
|
K.save(U.signatures.value).then((e) => {
|
|
62
|
-
e && (G({ templateId: e.id }), W("signature"), H("saved", e), H("close"));
|
|
68
|
+
e && (V.select && (G({ templateId: e.id }), W("signature")), H("saved", e), H("close"));
|
|
63
69
|
}, () => {});
|
|
64
70
|
}
|
|
65
|
-
let Q = (e) => `${Y}-tab-${e}`, $ = (e) => `${Y}-panel-${e}`, ce = i(() => J.value.name.trim() ||
|
|
71
|
+
let Q = (e) => `${Y}-tab-${e}`, $ = (e) => `${Y}-panel-${e}`, ce = i(() => J.value.name.trim() || _.namePlaceholder), le = (e) => b(e, e.currentTarget), ue = (e) => y(e, e.currentTarget), de = (e) => K.setName(e.target.value), fe = (e) => void K.chooseFile(e.target.files?.[0]);
|
|
66
72
|
return (e, t) => (u(), o(r, null, [
|
|
67
73
|
s("div", {
|
|
68
74
|
role: "tablist",
|
|
69
|
-
"aria-label": p(
|
|
75
|
+
"aria-label": p(_).tabs,
|
|
70
76
|
class: "ink-tabs",
|
|
71
77
|
onKeydown: le
|
|
72
|
-
}, [(u(!0), o(r, null, d(p(
|
|
78
|
+
}, [(u(!0), o(r, null, d(p(ie), (e) => (u(), o("button", {
|
|
73
79
|
id: Q(e),
|
|
74
80
|
key: e,
|
|
75
81
|
type: "button",
|
|
@@ -81,7 +87,7 @@ var S = ["aria-label"], C = [
|
|
|
81
87
|
"data-key": e,
|
|
82
88
|
"data-state": p(J).tab === e ? "active" : "inactive",
|
|
83
89
|
onClick: (t) => p(K).setTab(e)
|
|
84
|
-
}, f(p(
|
|
90
|
+
}, f(p(_)[e]), 9, C))), 128))], 40, S),
|
|
85
91
|
s("div", {
|
|
86
92
|
id: $("draw"),
|
|
87
93
|
role: "tabpanel",
|
|
@@ -94,14 +100,14 @@ var S = ["aria-label"], C = [
|
|
|
94
100
|
class: "ink-signature-pad-host",
|
|
95
101
|
"data-ink-signature-pad-host": "",
|
|
96
102
|
role: "img",
|
|
97
|
-
"aria-label": p(
|
|
103
|
+
"aria-label": p(_).pad
|
|
98
104
|
}, null, 8, T), s("div", E, [s("button", {
|
|
99
105
|
type: "button",
|
|
100
106
|
class: "ink-button",
|
|
101
107
|
"data-ink-signature-clear": "",
|
|
102
108
|
disabled: p(J).padEmpty,
|
|
103
109
|
onClick: t[0] ||= (e) => p(K).clearPad()
|
|
104
|
-
}, f(p(
|
|
110
|
+
}, f(p(_).clear), 9, D)])], 8, w),
|
|
105
111
|
s("div", {
|
|
106
112
|
id: $("type"),
|
|
107
113
|
role: "tabpanel",
|
|
@@ -109,17 +115,17 @@ var S = ["aria-label"], C = [
|
|
|
109
115
|
class: "ink-tab-panel",
|
|
110
116
|
"data-key": "type",
|
|
111
117
|
hidden: p(J).tab !== "type"
|
|
112
|
-
}, [s("label", k, [s("span", null, f(p(
|
|
118
|
+
}, [s("label", k, [s("span", null, f(p(_).name), 1), s("input", {
|
|
113
119
|
type: "text",
|
|
114
120
|
class: "ink-input",
|
|
115
121
|
"data-ink-signature-name": "",
|
|
116
122
|
autocomplete: "name",
|
|
117
|
-
placeholder: p(
|
|
123
|
+
placeholder: p(_).namePlaceholder,
|
|
118
124
|
value: p(J).name,
|
|
119
125
|
onInput: de
|
|
120
126
|
}, null, 40, A)]), s("div", {
|
|
121
127
|
role: "radiogroup",
|
|
122
|
-
"aria-label": p(
|
|
128
|
+
"aria-label": p(_).fonts,
|
|
123
129
|
class: "ink-signature-fonts",
|
|
124
130
|
onKeydown: ue
|
|
125
131
|
}, [(u(!0), o(r, null, d(p(K).fonts, (e) => (u(), o("button", {
|
|
@@ -145,7 +151,7 @@ var S = ["aria-label"], C = [
|
|
|
145
151
|
"data-key": "image",
|
|
146
152
|
hidden: p(J).tab !== "image"
|
|
147
153
|
}, [
|
|
148
|
-
s("label", P, [s("span", null, f(p(
|
|
154
|
+
s("label", P, [s("span", null, f(p(_).file), 1), s("input", {
|
|
149
155
|
type: "file",
|
|
150
156
|
accept: "image/png,image/jpeg",
|
|
151
157
|
class: "ink-input",
|
|
@@ -160,9 +166,9 @@ var S = ["aria-label"], C = [
|
|
|
160
166
|
}, null, 8, F)) : a("", !0),
|
|
161
167
|
p(J).imageError ? (u(), o("p", I, f(p(J).imageError), 1)) : a("", !0)
|
|
162
168
|
], 8, N),
|
|
163
|
-
p(J).saveError ? (u(), o("p",
|
|
164
|
-
s("div",
|
|
165
|
-
default:
|
|
169
|
+
p(J).saveError ? (u(), o("p", L, f(p(J).saveError), 1)) : a("", !0),
|
|
170
|
+
s("div", oe, [te(p(x), { "as-child": "" }, {
|
|
171
|
+
default: g(() => [s("button", R, f(p(_).cancel), 1)]),
|
|
166
172
|
_: 1
|
|
167
173
|
}), s("button", {
|
|
168
174
|
type: "button",
|
|
@@ -171,7 +177,7 @@ var S = ["aria-label"], C = [
|
|
|
171
177
|
"data-ink-signature-save": "",
|
|
172
178
|
disabled: !p(J).canSave,
|
|
173
179
|
onClick: se
|
|
174
|
-
}, f(p(
|
|
180
|
+
}, f(p(_).save), 9, z)])
|
|
175
181
|
], 64));
|
|
176
182
|
}
|
|
177
183
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createElementVNode","_unref","_renderList","_toDisplayString","_normalizeStyle","_createCommentVNode","_createVNode","_withCtx","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","SignatureForm_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","ctx","useInkContext","useTool","useToolOptions","draft","createSignatureDraft","IDLE","s","useReadable","uid","useId","padHost","useTemplateRef","detach","onMounted","onBeforeUnmount","save","t","setOptions","setTool","tabId","tab","panelId","shown","computed","SIGNATURE_LABELS","onTabKeydown","handleTabKeys","onRadioKeydown","handleRadioKeys","onName","onFile","openBlock","createElementBlock","Fragment","createElementVNode","unref","renderList","SIGNATURE_TABS","toDisplayString","_cache","font","normalizeStyle","fontFamilyValue","createCommentVNode","createVNode","DialogClose","withCtx"],"sources":["../../src/components/SignatureForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * The body of `InkSignatureDialog`, mounted while it is open: one draft per opening. Draw,\n * Type and Image tabs, then Cancel and Save.\n */\nimport {\n createSignatureDraft,\n fontFamilyValue,\n handleRadioKeys,\n handleTabKeys,\n SIGNATURE_LABELS,\n SIGNATURE_TABS,\n type SignatureDraftState,\n type SignatureTab,\n} from '@inkbar/core/dom'\nimport { DialogClose } from 'reka-ui'\nimport { computed, onBeforeUnmount, onMounted, useId, useTemplateRef } from 'vue'\n\nimport { useTool } from '../composables/useTool'\nimport { useToolOptions } from '../composables/useToolOptions'\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { SignatureOptions, SignatureTemplate } from '@inkbar/core'\n\nconst props = defineProps<{ fonts?: readonly string[] | undefined }>()\nconst emit = defineEmits<{ saved: [template: SignatureTemplate]; close: [] }>()\n\nconst ctx = useInkContext('InkSignatureDialog')\nconst { setTool } = useTool()\nconst { setOptions } = useToolOptions<SignatureOptions>('signature')\nconst draft = createSignatureDraft({ fonts: props.fonts ?? ctx.signatureFonts.value })\nconst IDLE: SignatureDraftState = draft.state.get()\nconst s = useReadable(draft.state, IDLE)\nconst uid = useId()\nconst padHost = useTemplateRef<HTMLDivElement>('pad')\n\nlet detach: (() => void) | undefined\nonMounted(() => {\n if (padHost.value) detach = draft.attachPad(padHost.value)\n})\nonBeforeUnmount(() => {\n detach?.()\n draft.destroy()\n})\n\nfunction save(): void {\n draft.save(ctx.signatures.value).then(\n (t) => {\n if (!t) return\n setOptions({ templateId: t.id })\n setTool('signature')\n emit('saved', t)\n emit('close')\n },\n () => {\n // The host's store refused it: the dialog stays open to try again.\n }\n )\n}\n\nconst tabId = (tab: SignatureTab) => `${uid}-tab-${tab}`\nconst panelId = (tab: SignatureTab) => `${uid}-panel-${tab}`\nconst shown = computed(() => s.value.name.trim() || SIGNATURE_LABELS.namePlaceholder)\nconst onTabKeydown = (e: KeyboardEvent) =>\n handleTabKeys(e, e.currentTarget as HTMLElement)\nconst onRadioKeydown = (e: KeyboardEvent) =>\n handleRadioKeys(e, e.currentTarget as HTMLElement)\nconst onName = (e: Event) => draft.setName((e.target as HTMLInputElement).value)\nconst onFile = (e: Event) =>\n void draft.chooseFile((e.target as HTMLInputElement).files?.[0])\n</script>\n\n<template>\n <div\n role=\"tablist\"\n :aria-label=\"SIGNATURE_LABELS.tabs\"\n class=\"ink-tabs\"\n @keydown=\"onTabKeydown\"\n >\n <button\n v-for=\"tab in SIGNATURE_TABS\"\n :id=\"tabId(tab)\"\n :key=\"tab\"\n type=\"button\"\n role=\"tab\"\n :aria-controls=\"panelId(tab)\"\n :aria-selected=\"s.tab === tab\"\n :tabindex=\"s.tab === tab ? 0 : -1\"\n class=\"ink-tab\"\n :data-key=\"tab\"\n :data-state=\"s.tab === tab ? 'active' : 'inactive'\"\n @click=\"draft.setTab(tab)\"\n >\n {{ SIGNATURE_LABELS[tab] }}\n </button>\n </div>\n <div\n :id=\"panelId('draw')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('draw')\"\n class=\"ink-tab-panel\"\n data-key=\"draw\"\n :hidden=\"s.tab !== 'draw'\"\n >\n <div\n ref=\"pad\"\n class=\"ink-signature-pad-host\"\n data-ink-signature-pad-host\n role=\"img\"\n :aria-label=\"SIGNATURE_LABELS.pad\"\n />\n <div class=\"ink-dialog-row\">\n <button\n type=\"button\"\n class=\"ink-button\"\n data-ink-signature-clear\n :disabled=\"s.padEmpty\"\n @click=\"draft.clearPad()\"\n >\n {{ SIGNATURE_LABELS.clear }}\n </button>\n </div>\n </div>\n <div\n :id=\"panelId('type')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('type')\"\n class=\"ink-tab-panel\"\n data-key=\"type\"\n :hidden=\"s.tab !== 'type'\"\n >\n <label class=\"ink-field\">\n <span>{{ SIGNATURE_LABELS.name }}</span>\n <input\n type=\"text\"\n class=\"ink-input\"\n data-ink-signature-name\n autocomplete=\"name\"\n :placeholder=\"SIGNATURE_LABELS.namePlaceholder\"\n :value=\"s.name\"\n @input=\"onName\"\n />\n </label>\n <div\n role=\"radiogroup\"\n :aria-label=\"SIGNATURE_LABELS.fonts\"\n class=\"ink-signature-fonts\"\n @keydown=\"onRadioKeydown\"\n >\n <button\n v-for=\"font in draft.fonts\"\n :key=\"font\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"s.font === font\"\n :aria-label=\"font\"\n :tabindex=\"s.font === font ? 0 : -1\"\n class=\"ink-signature-font\"\n :data-key=\"font\"\n :data-state=\"s.font === font ? 'checked' : 'unchecked'\"\n @click=\"draft.setFont(font)\"\n >\n <!-- The font is the option itself, so it is set here, not left to the theme. -->\n <span\n class=\"ink-signature-font-sample\"\n :style=\"{ fontFamily: fontFamilyValue(font) }\"\n >\n {{ shown }}\n </span>\n </button>\n </div>\n </div>\n <div\n :id=\"panelId('image')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('image')\"\n class=\"ink-tab-panel\"\n data-key=\"image\"\n :hidden=\"s.tab !== 'image'\"\n >\n <label class=\"ink-field\">\n <span>{{ SIGNATURE_LABELS.file }}</span>\n <input\n type=\"file\"\n accept=\"image/png,image/jpeg\"\n class=\"ink-input\"\n data-ink-signature-file\n @change=\"onFile\"\n />\n </label>\n <img\n v-if=\"s.image?.kind === 'image'\"\n class=\"ink-signature-image\"\n :src=\"s.image.imagedata\"\n alt=\"\"\n />\n <p v-if=\"s.imageError\" class=\"ink-field-error\" role=\"alert\">{{ s.imageError }}</p>\n </div>\n <p\n v-if=\"s.saveError\"\n class=\"ink-field-error\"\n role=\"alert\"\n data-ink-signature-save-error\n >\n {{ s.saveError }}\n </p>\n <div class=\"ink-dialog-actions\">\n <DialogClose as-child>\n <button type=\"button\" class=\"ink-button\" data-ink-signature-cancel>\n {{ SIGNATURE_LABELS.cancel }}\n </button>\n </DialogClose>\n <button\n type=\"button\"\n class=\"ink-button\"\n data-variant=\"primary\"\n data-ink-signature-save\n :disabled=\"!s.canSave\"\n @click=\"save\"\n >\n {{ SIGNATURE_LABELS.save }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,IAAMgC,IAAQC,GACRC,IAAOH,GAEPI,IAAMC,EAAc,oBAAoB,GACxC,EAAE,eAAYC,EAAQ,GACtB,EAAE,kBAAeC,GAAiC,WAAW,GAC7DC,IAAQC,EAAqB,EAAE,OAAOR,EAAM,SAASG,EAAI,eAAe,MAAM,CAAC,GAC/EM,IAA4BF,EAAM,MAAM,IAAI,GAC5CG,IAAIC,EAAYJ,EAAM,OAAOE,CAAI,GACjCG,IAAMC,EAAM,GACZC,IAAUC,EAA+B,KAAK,GAEhDC;EAIJ,AAHAC,SAAgB;GACd,AAAIH,EAAQ,UAAO,IAASP,EAAM,UAAUO,EAAQ,KAAK;EAC3D,CAAC,GACDI,QAAsB;GAEpB,AADAF,IAAS,GACTT,EAAM,QAAQ;EAChB,CAAC;EAED,SAASY,KAAa;GACpB,EAAM,KAAKhB,EAAI,WAAW,KAAK,CAAC,CAAC,MAC9B,MAAM;IACL,AAAKiB,MACLC,EAAW,EAAE,YAAYD,EAAE,GAAG,CAAC,GAC/BE,EAAQ,WAAW,GACnBpB,EAAK,SAASkB,CAAC,GACflB,EAAK,OAAO;GACd,SACM,CAEN,CACF;EACF;EAEA,IAAMqB,KAAS,MAAsB,GAAGX,EAAI,OAAOY,KAC7CC,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cL,EAAA6E,CAAA,GAAA,EAJD,YAAA,GAAQ,GAAA;IACnB,SAAAvE,SAES,CAFTP,EAES,UAFTyB,GAEStB,EADJF,EAAAwD,CAAA,CAAgB,CAAC,MAAM,GAAA,CAAA,CAAA,CAAA;;GAG9BzD,CAAAA,GAAAA,EASS,UAAA;IARP,MAAK;IACL,OAAM;IACN,gBAAa;IACb,2BAAA;IACC,UAAQ,CAAGC,EAAAsC,CAAA,CAAC,CAAC;IACb,SAAOS;GAEL,GAAA7C,EAAAF,EAAAwD,CAAA,CAAgB,CAAC,IAAI,GAAA,GAAA/B,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"SignatureForm.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createElementVNode","_unref","_renderList","_toDisplayString","_normalizeStyle","_createCommentVNode","_createVNode","_withCtx","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","SignatureForm_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","ctx","useInkContext","useTool","useToolOptions","draft","createSignatureDraft","IDLE","s","useReadable","uid","useId","padHost","useTemplateRef","detach","onMounted","onBeforeUnmount","save","t","setOptions","setTool","tabId","tab","panelId","shown","computed","SIGNATURE_LABELS","onTabKeydown","handleTabKeys","onRadioKeydown","handleRadioKeys","onName","onFile","openBlock","createElementBlock","Fragment","createElementVNode","unref","renderList","SIGNATURE_TABS","toDisplayString","_cache","font","normalizeStyle","fontFamilyValue","createCommentVNode","createVNode","DialogClose","withCtx"],"sources":["../../src/components/SignatureForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * The body of `InkSignatureDialog`, mounted while it is open: one draft per opening. Draw,\n * Type and Image tabs, then Cancel and Save.\n */\nimport {\n createSignatureDraft,\n fontFamilyValue,\n handleRadioKeys,\n handleTabKeys,\n SIGNATURE_LABELS,\n SIGNATURE_TABS,\n type SignatureDraftState,\n type SignatureTab,\n} from '@inkbar/core/dom'\nimport { DialogClose } from 'reka-ui'\nimport { computed, onBeforeUnmount, onMounted, useId, useTemplateRef } from 'vue'\n\nimport { useTool } from '../composables/useTool'\nimport { useToolOptions } from '../composables/useToolOptions'\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { SignatureOptions, SignatureTemplate } from '@inkbar/core'\n\nconst props = withDefaults(\n defineProps<{ fonts?: readonly string[] | undefined; select?: boolean }>(),\n { fonts: undefined, select: true }\n)\nconst emit = defineEmits<{ saved: [template: SignatureTemplate]; close: [] }>()\n\nconst ctx = useInkContext('InkSignatureDialog')\nconst { setTool } = useTool()\nconst { setOptions } = useToolOptions<SignatureOptions>('signature')\nconst draft = createSignatureDraft({ fonts: props.fonts ?? ctx.signatureFonts.value })\nconst IDLE: SignatureDraftState = draft.state.get()\nconst s = useReadable(draft.state, IDLE)\nconst uid = useId()\nconst padHost = useTemplateRef<HTMLDivElement>('pad')\n\nlet detach: (() => void) | undefined\nonMounted(() => {\n if (padHost.value) detach = draft.attachPad(padHost.value)\n})\nonBeforeUnmount(() => {\n detach?.()\n draft.destroy()\n})\n\nfunction save(): void {\n draft.save(ctx.signatures.value).then(\n (t) => {\n if (!t) return\n if (props.select) {\n setOptions({ templateId: t.id })\n setTool('signature')\n }\n emit('saved', t)\n emit('close')\n },\n () => {\n // The host's store refused it: the dialog stays open to try again.\n }\n )\n}\n\nconst tabId = (tab: SignatureTab) => `${uid}-tab-${tab}`\nconst panelId = (tab: SignatureTab) => `${uid}-panel-${tab}`\nconst shown = computed(() => s.value.name.trim() || SIGNATURE_LABELS.namePlaceholder)\nconst onTabKeydown = (e: KeyboardEvent) =>\n handleTabKeys(e, e.currentTarget as HTMLElement)\nconst onRadioKeydown = (e: KeyboardEvent) =>\n handleRadioKeys(e, e.currentTarget as HTMLElement)\nconst onName = (e: Event) => draft.setName((e.target as HTMLInputElement).value)\nconst onFile = (e: Event) =>\n void draft.chooseFile((e.target as HTMLInputElement).files?.[0])\n</script>\n\n<template>\n <div\n role=\"tablist\"\n :aria-label=\"SIGNATURE_LABELS.tabs\"\n class=\"ink-tabs\"\n @keydown=\"onTabKeydown\"\n >\n <button\n v-for=\"tab in SIGNATURE_TABS\"\n :id=\"tabId(tab)\"\n :key=\"tab\"\n type=\"button\"\n role=\"tab\"\n :aria-controls=\"panelId(tab)\"\n :aria-selected=\"s.tab === tab\"\n :tabindex=\"s.tab === tab ? 0 : -1\"\n class=\"ink-tab\"\n :data-key=\"tab\"\n :data-state=\"s.tab === tab ? 'active' : 'inactive'\"\n @click=\"draft.setTab(tab)\"\n >\n {{ SIGNATURE_LABELS[tab] }}\n </button>\n </div>\n <div\n :id=\"panelId('draw')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('draw')\"\n class=\"ink-tab-panel\"\n data-key=\"draw\"\n :hidden=\"s.tab !== 'draw'\"\n >\n <div\n ref=\"pad\"\n class=\"ink-signature-pad-host\"\n data-ink-signature-pad-host\n role=\"img\"\n :aria-label=\"SIGNATURE_LABELS.pad\"\n />\n <div class=\"ink-dialog-row\">\n <button\n type=\"button\"\n class=\"ink-button\"\n data-ink-signature-clear\n :disabled=\"s.padEmpty\"\n @click=\"draft.clearPad()\"\n >\n {{ SIGNATURE_LABELS.clear }}\n </button>\n </div>\n </div>\n <div\n :id=\"panelId('type')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('type')\"\n class=\"ink-tab-panel\"\n data-key=\"type\"\n :hidden=\"s.tab !== 'type'\"\n >\n <label class=\"ink-field\">\n <span>{{ SIGNATURE_LABELS.name }}</span>\n <input\n type=\"text\"\n class=\"ink-input\"\n data-ink-signature-name\n autocomplete=\"name\"\n :placeholder=\"SIGNATURE_LABELS.namePlaceholder\"\n :value=\"s.name\"\n @input=\"onName\"\n />\n </label>\n <div\n role=\"radiogroup\"\n :aria-label=\"SIGNATURE_LABELS.fonts\"\n class=\"ink-signature-fonts\"\n @keydown=\"onRadioKeydown\"\n >\n <button\n v-for=\"font in draft.fonts\"\n :key=\"font\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"s.font === font\"\n :aria-label=\"font\"\n :tabindex=\"s.font === font ? 0 : -1\"\n class=\"ink-signature-font\"\n :data-key=\"font\"\n :data-state=\"s.font === font ? 'checked' : 'unchecked'\"\n @click=\"draft.setFont(font)\"\n >\n <!-- The font is the option itself, so it is set here, not left to the theme. -->\n <span\n class=\"ink-signature-font-sample\"\n :style=\"{ fontFamily: fontFamilyValue(font) }\"\n >\n {{ shown }}\n </span>\n </button>\n </div>\n </div>\n <div\n :id=\"panelId('image')\"\n role=\"tabpanel\"\n :aria-labelledby=\"tabId('image')\"\n class=\"ink-tab-panel\"\n data-key=\"image\"\n :hidden=\"s.tab !== 'image'\"\n >\n <label class=\"ink-field\">\n <span>{{ SIGNATURE_LABELS.file }}</span>\n <input\n type=\"file\"\n accept=\"image/png,image/jpeg\"\n class=\"ink-input\"\n data-ink-signature-file\n @change=\"onFile\"\n />\n </label>\n <img\n v-if=\"s.image?.kind === 'image'\"\n class=\"ink-signature-image\"\n :src=\"s.image.imagedata\"\n alt=\"\"\n />\n <p v-if=\"s.imageError\" class=\"ink-field-error\" role=\"alert\">{{ s.imageError }}</p>\n </div>\n <p\n v-if=\"s.saveError\"\n class=\"ink-field-error\"\n role=\"alert\"\n data-ink-signature-save-error\n >\n {{ s.saveError }}\n </p>\n <div class=\"ink-dialog-actions\">\n <DialogClose as-child>\n <button type=\"button\" class=\"ink-button\" data-ink-signature-cancel>\n {{ SIGNATURE_LABELS.cancel }}\n </button>\n </DialogClose>\n <button\n type=\"button\"\n class=\"ink-button\"\n data-variant=\"primary\"\n data-ink-signature-save\n :disabled=\"!s.canSave\"\n @click=\"save\"\n >\n {{ SIGNATURE_LABELS.save }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;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A,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignatureMenuPanel.js","names":["_sfc_main","SignatureMenuPanel_vue_vue_type_script_setup_true_lang_default","SignatureMenuPanel_default"],"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":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SignatureTemplate } from '@inkbar/core';
|
|
2
|
+
import { SignatureMenuItem } from '@inkbar/core/dom';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
items: readonly SignatureMenuItem[];
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
choose: (template: SignatureTemplate) => any;
|
|
8
|
+
create: () => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onChoose?: (template: SignatureTemplate) => any;
|
|
11
|
+
onCreate?: () => any;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=SignatureMenuPanel.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignatureMenuPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/SignatureMenuPanel.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGzD,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,CAAC;AA0M3D,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { useReadable as t } from "../use-readable.js";
|
|
3
|
+
import n from "./InkIcon.js";
|
|
4
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, nextTick as f, openBlock as p, renderList as m, toDisplayString as h, unref as g, useTemplateRef as _ } from "vue";
|
|
5
|
+
import { SIGNATURE_LABELS as v, handleMenuKeys as y, signaturePreview as b } from "@inkbar/core/dom";
|
|
6
|
+
import { Plus as x, Trash2 as S } from "@inkbar/icons";
|
|
7
|
+
//#region src/components/SignatureMenuPanel.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var C = ["aria-label"], w = [
|
|
9
|
+
"aria-checked",
|
|
10
|
+
"aria-label",
|
|
11
|
+
"data-key",
|
|
12
|
+
"data-state",
|
|
13
|
+
"onClick"
|
|
14
|
+
], T = ["data-kind"], E = ["src"], D = ["viewBox"], O = ["d"], k = [
|
|
15
|
+
"aria-label",
|
|
16
|
+
"title",
|
|
17
|
+
"data-key",
|
|
18
|
+
"onClick"
|
|
19
|
+
], A = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "ink-field-error ink-signature-remove-error",
|
|
22
|
+
role: "alert",
|
|
23
|
+
"data-ink-signature-remove-error": ""
|
|
24
|
+
}, j = /*@__PURE__*/ u({
|
|
25
|
+
__name: "SignatureMenuPanel",
|
|
26
|
+
props: { items: {} },
|
|
27
|
+
emits: ["choose", "create"],
|
|
28
|
+
setup(u, { emit: j }) {
|
|
29
|
+
let M = u, N = j, P = e("SignatureMenuPanel"), F = t(() => P.signatures.value.removeError, void 0), I = _("root"), L = i(() => M.items.map((e) => e.template.kind === "ink" ? b(e.template) : null));
|
|
30
|
+
function R(e, t) {
|
|
31
|
+
P.signatures.value.remove(e).then(async () => {
|
|
32
|
+
await f();
|
|
33
|
+
let e = I.value;
|
|
34
|
+
if (!e) return;
|
|
35
|
+
let n = e.querySelectorAll(".ink-signature-item");
|
|
36
|
+
(n[Math.min(t, n.length - 1)] ?? e.querySelector("[data-ink-signature-create]"))?.focus({ preventScroll: !0 });
|
|
37
|
+
}, () => {});
|
|
38
|
+
}
|
|
39
|
+
let z = {
|
|
40
|
+
role: "menu",
|
|
41
|
+
"aria-label": v.menu,
|
|
42
|
+
onKeydown: (e) => y(e, e.currentTarget)
|
|
43
|
+
};
|
|
44
|
+
return (e, t) => (p(), o("div", d({
|
|
45
|
+
ref_key: "root",
|
|
46
|
+
ref: I
|
|
47
|
+
}, z), [
|
|
48
|
+
M.items.length > 0 ? (p(), o(r, { key: 0 }, [s("div", {
|
|
49
|
+
role: "group",
|
|
50
|
+
"aria-label": g(v).saved,
|
|
51
|
+
class: "ink-signature-list",
|
|
52
|
+
"data-ink-menu-columns": "2"
|
|
53
|
+
}, [(p(!0), o(r, null, m(M.items, (e, t) => (p(), o(r, { key: e.id }, [s("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
role: "menuitemradio",
|
|
56
|
+
"aria-checked": e.checked,
|
|
57
|
+
"aria-label": e.label,
|
|
58
|
+
tabindex: "-1",
|
|
59
|
+
class: "ink-select-item ink-menu-item ink-signature-item",
|
|
60
|
+
"data-ink-select-item": "",
|
|
61
|
+
"data-key": e.id,
|
|
62
|
+
"data-state": e.checked ? "checked" : "unchecked",
|
|
63
|
+
onClick: (t) => N("choose", e.template)
|
|
64
|
+
}, [s("span", {
|
|
65
|
+
class: "ink-signature-preview",
|
|
66
|
+
"data-kind": e.template.kind
|
|
67
|
+
}, [e.template.kind === "image" ? (p(), o("img", {
|
|
68
|
+
key: 0,
|
|
69
|
+
src: e.template.imagedata,
|
|
70
|
+
alt: "",
|
|
71
|
+
draggable: "false"
|
|
72
|
+
}, null, 8, E)) : (p(), o("svg", {
|
|
73
|
+
key: 1,
|
|
74
|
+
viewBox: L.value[t]?.viewBox,
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}, [(p(!0), o(r, null, m(L.value[t]?.paths ?? [], (e, t) => (p(), o("path", {
|
|
77
|
+
key: t,
|
|
78
|
+
d: e,
|
|
79
|
+
fill: "currentColor"
|
|
80
|
+
}, null, 8, O))), 128))], 8, D))], 8, T)], 8, w), s("button", {
|
|
81
|
+
type: "button",
|
|
82
|
+
role: "menuitem",
|
|
83
|
+
"aria-label": e.removeLabel,
|
|
84
|
+
title: e.removeLabel,
|
|
85
|
+
tabindex: "-1",
|
|
86
|
+
class: "ink-menu-item ink-signature-remove",
|
|
87
|
+
"data-ink-signature-remove": "",
|
|
88
|
+
"data-key": e.id,
|
|
89
|
+
onClick: (n) => R(e.id, t)
|
|
90
|
+
}, [l(n, {
|
|
91
|
+
icon: g(S),
|
|
92
|
+
size: 16
|
|
93
|
+
}, null, 8, ["icon"])], 8, k)], 64))), 128))], 8, C), t[1] ||= s("div", {
|
|
94
|
+
role: "separator",
|
|
95
|
+
class: "ink-select-separator"
|
|
96
|
+
}, null, -1)], 64)) : a("", !0),
|
|
97
|
+
s("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
role: "menuitem",
|
|
100
|
+
tabindex: "-1",
|
|
101
|
+
class: "ink-select-item ink-menu-item ink-signature-create",
|
|
102
|
+
"data-ink-select-item": "",
|
|
103
|
+
"data-ink-signature-create": "",
|
|
104
|
+
onClick: t[0] ||= (e) => N("create")
|
|
105
|
+
}, [l(n, {
|
|
106
|
+
icon: g(x),
|
|
107
|
+
size: 16
|
|
108
|
+
}, null, 8, ["icon"]), c(" " + h(g(v).create), 1)]),
|
|
109
|
+
g(F) ? (p(), o("p", A, h(g(F)), 1)) : a("", !0)
|
|
110
|
+
], 16));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
export { j as default };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=SignatureMenuPanel.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -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,EAA4B,MAAM,GAGzCC,IAAWC,QACfV,EAAM,MAAM,KAAK,MACfW,EAAK,SAAS,SAAS,QAAQC,EAAiBD,EAAK,QAAQ,IAAI,IACnE,CACF;EAGA,SAASE,EAAO,GAAY,GAAmB;GAC7C,EAAI,WAAW,MAAM,OAAOC,CAAE,CAAC,CAAC,KAC9B,YAAY;IACV,MAAMC,EAAS;IACf,IAAMC,IAAOT,EAAK;IAClB,IAAI,CAACS,GAAM;IACX,IAAMC,IAAOD,EAAK,iBAA8B,qBAAqB;IAIrE,CAFEC,EAAK,KAAK,IAAIC,GAAKD,EAAK,SAAS,CAAC,MAClCD,EAAK,cAA2B,6BAA6B,EAAA,EACzD,MAAM,EAAE,eAAe,GAAK,CAAC;GACrC,SACM,CAEN,CACF;EACF;EAEA,IAAMG,IAAa;GACjB,MAAM;GACN,cAAcC,EAAiB;GAC/B,YAAY,MAAqBC,EAAe,GAAG,EAAE,aAA4B;EACnF;oBAIE5C,EAAA,GAAAC,EA2EM,OA3ENC,EA2EM;GA3EG,SAAA;GAAJ,KAAI4B;EAAe,GAAAY,CAAU,GAAA;GAChBnB,EAAM,MAAM,SAAM,KAAlCvB,EAAA,GAAAC,EAqDWE,GAAA,EAAA,KAAA,EAAA,G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K;IACf,UAAK,MAAEE,EAAOF,EAAK,IAAIO,CAAG;GAE3BlC,GAAAA,CAAAA,EAAqCC,GAAA;IAA3B,MAAMH,EAAAiD,CAAA;IAAS,MAAM;uCAIrC,GAAA,GAAA,EAAA,GAAA,GAAAzC,CAAA,GAAA,AAAA0C,EAAA,OAAAnD,EAAqD,OAAA;IAAhD,MAAK;IAAY,OAAM;;GAE9BA,EAWS,UAAA;IAVP,MAAK;IACL,MAAK;IACL,UAAS;IACT,OAAM;IACN,wBAAA;IACA,6BAAA;IACC,SAAK,AAAAmD,EAAA,QAAA,MAAE9B,EAAI,QAAA;GAEZlB,GAAAA,CAAAA,EAAmCC,GAAA;IAAzB,MAAMH,EAAAoD,CAAA;IAAO,MAAM;GAAM/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"}
|
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 };
|
|
@@ -76,6 +76,12 @@ export interface InkContext {
|
|
|
76
76
|
setActivated(id: string | null): void;
|
|
77
77
|
history: InkHistory;
|
|
78
78
|
rootEl: Readonly<Ref<HTMLElement | null>>;
|
|
79
|
+
/** InkRoot's `formHighlight`; InkViewport reads it when it builds the viewer. */
|
|
80
|
+
formHighlight: Readonly<Ref<boolean | undefined>>;
|
|
81
|
+
/** Emits InkRoot's `form-action`. */
|
|
82
|
+
reportFormAction(action: FormAction): void;
|
|
83
|
+
/** Emits InkRoot's `error`, for failures after the document opened (a refused signing). */
|
|
84
|
+
reportError(error: InkError): void;
|
|
79
85
|
}
|
|
80
86
|
export declare const injectInkContext: <T extends InkContext | null | undefined = InkContext>(fallback?: T | undefined) => T extends null ? InkContext | null : InkContext, provideInkContext: (contextValue: InkContext) => InkContext;
|
|
81
87
|
/**
|
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,MAA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["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 /** 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":";;;AAgHA,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';
|
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,EA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,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,EAAE,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,32 @@ 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/InkToolbarSeparator.js";
|
|
26
|
+
import T from "./components/InkUndo.js";
|
|
27
|
+
import E from "./components/InkRedo.js";
|
|
28
|
+
import D from "./components/InkColorMenu.js";
|
|
29
|
+
import O from "./components/InkShapeMenu.js";
|
|
30
|
+
import k from "./components/InkSignatureMenu.js";
|
|
31
|
+
import A from "./components/InkHighlightMenu.js";
|
|
32
|
+
import j from "./components/InkLineStyleMenu.js";
|
|
33
|
+
import M from "./components/InkTextStyleMenu.js";
|
|
34
|
+
import N from "./components/InkZoomIn.js";
|
|
35
|
+
import P from "./components/InkZoomOut.js";
|
|
36
|
+
import F from "./components/InkZoomSelect.js";
|
|
37
|
+
import I from "./components/InkPageInput.js";
|
|
38
|
+
import L from "./components/InkPageCount.js";
|
|
39
|
+
import R from "./components/InkPrevPage.js";
|
|
40
|
+
import z from "./components/InkNextPage.js";
|
|
41
|
+
import B from "./components/InkThreadPopover.js";
|
|
42
|
+
import V from "./components/InkSearchButton.js";
|
|
43
|
+
import H from "./components/InkFindBar.js";
|
|
44
|
+
export { g as InkAnnotation, D as InkColorMenu, C as InkCommand, H as InkFindBar, A as InkHighlightMenu, y as InkIcon, j as InkLineStyleMenu, z as InkNextPage, _ as InkPage, L as InkPageCount, I as InkPageInput, R as InkPrevPage, E as InkRedo, n as InkRoot, V as InkSearchButton, O as InkShapeMenu, v as InkSignatureDialog, k as InkSignatureMenu, M as InkTextStyleMenu, B as InkThreadPopover, S as InkToolButton, x as InkToolbar, w as InkToolbarSeparator, T as InkUndo, b as InkViewport, N as InkZoomIn, P as InkZoomOut, F 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 };
|