@inkbar/vue 0.4.0 → 0.5.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 +3 -5
- package/dist/components/InkAnnotation.js.map +1 -1
- package/dist/components/InkAnnotation.vue.d.ts.map +1 -1
- package/dist/components/InkAnnotation.vue_vue_type_script_setup_true_lang.js +16 -24
- package/dist/components/InkAnnotation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkColorMenu.js.map +1 -1
- package/dist/components/InkColorMenu.vue.d.ts +2 -0
- package/dist/components/InkColorMenu.vue.d.ts.map +1 -1
- package/dist/components/InkColorMenu.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/InkColorMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkHighlightMenu.js.map +1 -1
- package/dist/components/InkHighlightMenu.vue.d.ts +2 -2
- package/dist/components/InkHighlightMenu.vue.d.ts.map +1 -1
- package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js +118 -108
- 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 +408 -424
- package/dist/components/InkRoot.vue.d.ts.map +1 -1
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +33 -27
- 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 +2 -2
- package/dist/components/InkShapeMenu.vue.d.ts.map +1 -1
- package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js +99 -91
- package/dist/components/InkShapeMenu.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 +2 -2
- package/dist/components/InkSignatureMenu.vue.d.ts.map +1 -1
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js +156 -151
- 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 +9 -2
- package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useAnnotations.d.ts +915 -1386
- package/dist/composables/useAnnotations.d.ts.map +1 -1
- package/dist/composables/useAnnotations.js +13 -18
- package/dist/composables/useAnnotations.js.map +1 -1
- package/dist/context.d.ts +8 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/package.json +5 -5
- package/dist/components/InkSuggestionCard.js +0 -7
- package/dist/components/InkSuggestionCard.js.map +0 -1
- package/dist/components/InkSuggestionCard.vue.d.ts +0 -16
- package/dist/components/InkSuggestionCard.vue.d.ts.map +0 -1
- package/dist/components/InkSuggestionCard.vue_vue_type_script_setup_true_lang.js +0 -85
- package/dist/components/InkSuggestionCard.vue_vue_type_script_setup_true_lang.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkRoot.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkRoot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InkRoot.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkRoot.vue"],"names":[],"mappings":"AAuXA,OAAO,EAGL,QAAQ,EAET,MAAM,cAAc,CAAA;AAoBrB,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAI/E,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,SAAS,EACT,cAAc,EACf,MAAM,cAAc,CAAA;AACrB,OAAO,KA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { provideInkContext as e } from "../context.js";
|
|
2
2
|
import { useReadable as t } from "../use-readable.js";
|
|
3
3
|
import { createRefHistory as n } from "../ref-history.js";
|
|
4
|
-
import { computed as r, createBlock as ee, defineComponent as i, onBeforeUnmount as a, onMounted as o, onUpdated as s, openBlock as c, ref as l, renderSlot as
|
|
5
|
-
import { InkError as
|
|
6
|
-
import { FONT_FAMILIES as
|
|
7
|
-
import { Primitive as
|
|
4
|
+
import { computed as r, createBlock as ee, defineComponent as i, onBeforeUnmount as a, onMounted as o, onUpdated as s, openBlock as c, ref as l, renderSlot as te, shallowRef as u, unref as d, useTemplateRef as f, watch as p, withCtx as m } from "vue";
|
|
5
|
+
import { InkError as h, createMemorySignatureStore as g, createSignatureLibrary as _, openDocument as v } from "@inkbar/core";
|
|
6
|
+
import { FONT_FAMILIES as y, SIGNATURE_FONTS as b, createToolOptions as x, cssVariableDefaults as S, trackToolStyle as C } from "@inkbar/core/dom";
|
|
7
|
+
import { Primitive as w } from "reka-ui";
|
|
8
8
|
//#region src/components/InkRoot.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var T = /*@__PURE__*/ i({
|
|
10
10
|
__name: "InkRoot",
|
|
11
11
|
props: {
|
|
12
12
|
src: {},
|
|
@@ -16,6 +16,10 @@ var E = /*@__PURE__*/ i({
|
|
|
16
16
|
annotations: { default: void 0 },
|
|
17
17
|
tool: { default: void 0 },
|
|
18
18
|
tools: { default: void 0 },
|
|
19
|
+
decorateAnnotation: {
|
|
20
|
+
type: Function,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
19
23
|
fonts: { default: void 0 },
|
|
20
24
|
signatures: { default: void 0 },
|
|
21
25
|
signatureFonts: { default: void 0 },
|
|
@@ -40,13 +44,13 @@ var E = /*@__PURE__*/ i({
|
|
|
40
44
|
"error",
|
|
41
45
|
"activate"
|
|
42
46
|
],
|
|
43
|
-
setup(i, { expose:
|
|
44
|
-
let D = i, O =
|
|
47
|
+
setup(i, { expose: T, emit: E }) {
|
|
48
|
+
let D = i, O = E, k = f("primitive"), A = u(null);
|
|
45
49
|
function j() {
|
|
46
50
|
let e = k.value?.$el;
|
|
47
51
|
A.value = e instanceof HTMLElement ? e : null;
|
|
48
52
|
}
|
|
49
|
-
let M =
|
|
53
|
+
let M = u(null), N = u(null), P = t(() => M.value?.status ?? null, { state: "idle" }), F = r(() => N.value ?? P.value), I = t(() => M.value?.annotations.list ?? null, []), L = t(() => M.value?.annotations.selection ?? null, []), R = u(null), z = u(null), B = l(D.tool ?? "select-text"), V = l(null), H = r(() => D.annotations !== void 0);
|
|
50
54
|
function U(e) {
|
|
51
55
|
return e === null ? null : typeof e == "string" ? e : "key" in e ? e.key : e;
|
|
52
56
|
}
|
|
@@ -63,10 +67,10 @@ var E = /*@__PURE__*/ i({
|
|
|
63
67
|
N.value = { state: "loading" }, j();
|
|
64
68
|
let n;
|
|
65
69
|
try {
|
|
66
|
-
n = await
|
|
70
|
+
n = await v(t, {
|
|
67
71
|
assets: D.assets,
|
|
68
72
|
password: D.password,
|
|
69
|
-
defaults: D.defaults ?? (A.value ?
|
|
73
|
+
defaults: D.defaults ?? (A.value ? S(A.value) : void 0),
|
|
70
74
|
history: H.value ? !1 : D.history ?? !0,
|
|
71
75
|
annotations: H.value ? {
|
|
72
76
|
mode: "controlled",
|
|
@@ -78,7 +82,7 @@ var E = /*@__PURE__*/ i({
|
|
|
78
82
|
});
|
|
79
83
|
} catch (t) {
|
|
80
84
|
if (e !== W) return;
|
|
81
|
-
let n = t instanceof
|
|
85
|
+
let n = t instanceof h ? t : new h("InvalidPdf", t instanceof Error ? t.message : String(t), {}, t);
|
|
82
86
|
N.value = {
|
|
83
87
|
state: "error",
|
|
84
88
|
error: n
|
|
@@ -106,13 +110,13 @@ var E = /*@__PURE__*/ i({
|
|
|
106
110
|
batch: (e) => {
|
|
107
111
|
H.value ? q.batch(e) : M.value ? M.value.history.batch(e) : e();
|
|
108
112
|
}
|
|
109
|
-
}, Z =
|
|
110
|
-
|
|
113
|
+
}, Z = u(null), Q;
|
|
114
|
+
p(M, (e) => {
|
|
111
115
|
if (!e) {
|
|
112
116
|
Z.value = null, Q = void 0;
|
|
113
117
|
return;
|
|
114
118
|
}
|
|
115
|
-
let t =
|
|
119
|
+
let t = C({
|
|
116
120
|
store: e.annotations,
|
|
117
121
|
history: { batch: (e) => X.batch(e) },
|
|
118
122
|
tools: D.tools,
|
|
@@ -122,22 +126,23 @@ var E = /*@__PURE__*/ i({
|
|
|
122
126
|
}, {
|
|
123
127
|
immediate: !0,
|
|
124
128
|
flush: "sync"
|
|
125
|
-
}),
|
|
129
|
+
}), p(B, (e) => Q?.(e)), o(() => {
|
|
126
130
|
j(), K();
|
|
127
|
-
}), s(j),
|
|
131
|
+
}), s(j), p([() => U(D.src), () => D.password], () => void K()), p(() => D.annotations, (e) => {
|
|
128
132
|
e && M.value?.annotations.mode === "controlled" && M.value.annotations.setControlledValue(e);
|
|
129
|
-
}),
|
|
133
|
+
}), p(() => D.tool, (e) => {
|
|
130
134
|
e && (B.value = e);
|
|
131
135
|
});
|
|
132
136
|
function ne(e) {
|
|
133
|
-
|
|
137
|
+
let t = z.value;
|
|
138
|
+
B.value === e && t?.active.get() === e && t.set(e), B.value = e, O("update:tool", e);
|
|
134
139
|
}
|
|
135
140
|
a(() => {
|
|
136
141
|
W++, G();
|
|
137
142
|
});
|
|
138
|
-
let $ = r(() =>
|
|
139
|
-
|
|
140
|
-
let re =
|
|
143
|
+
let $ = r(() => _(D.signatures ?? g()));
|
|
144
|
+
p($, (e) => void e.refresh(), { immediate: !0 });
|
|
145
|
+
let re = x();
|
|
141
146
|
return e({
|
|
142
147
|
assets: r(() => D.assets),
|
|
143
148
|
document: M,
|
|
@@ -149,10 +154,11 @@ var E = /*@__PURE__*/ i({
|
|
|
149
154
|
tool: B,
|
|
150
155
|
setTool: ne,
|
|
151
156
|
hostTools: r(() => D.tools),
|
|
152
|
-
|
|
157
|
+
decorateAnnotation: r(() => D.decorateAnnotation),
|
|
158
|
+
fonts: r(() => D.fonts ?? y),
|
|
153
159
|
toolOptions: re,
|
|
154
160
|
signatures: $,
|
|
155
|
-
signatureFonts: r(() => D.signatureFonts ??
|
|
161
|
+
signatureFonts: r(() => D.signatureFonts ?? b),
|
|
156
162
|
toolStyle: Z,
|
|
157
163
|
zoomModel: r(() => D.zoom),
|
|
158
164
|
pageModel: r(() => D.page),
|
|
@@ -164,12 +170,12 @@ var E = /*@__PURE__*/ i({
|
|
|
164
170
|
},
|
|
165
171
|
history: X,
|
|
166
172
|
rootEl: A
|
|
167
|
-
}),
|
|
173
|
+
}), T({
|
|
168
174
|
document: M,
|
|
169
175
|
status: F,
|
|
170
176
|
rootEl: A,
|
|
171
177
|
history: X
|
|
172
|
-
}), (e, t) => (c(), ee(
|
|
178
|
+
}), (e, t) => (c(), ee(d(w), {
|
|
173
179
|
ref_key: "primitive",
|
|
174
180
|
ref: k,
|
|
175
181
|
"as-child": D.asChild,
|
|
@@ -177,7 +183,7 @@ var E = /*@__PURE__*/ i({
|
|
|
177
183
|
"data-ink-root": "",
|
|
178
184
|
"data-state": F.value.state
|
|
179
185
|
}, {
|
|
180
|
-
default:
|
|
186
|
+
default: m(() => [te(e.$slots, "default", {
|
|
181
187
|
status: F.value,
|
|
182
188
|
document: M.value
|
|
183
189
|
})]),
|
|
@@ -186,6 +192,6 @@ var E = /*@__PURE__*/ i({
|
|
|
186
192
|
}
|
|
187
193
|
});
|
|
188
194
|
//#endregion
|
|
189
|
-
export {
|
|
195
|
+
export { T as default };
|
|
190
196
|
|
|
191
197
|
//# sourceMappingURL=InkRoot.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkRoot.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_renderSlot","InkRoot_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","primitive","useTemplateRef","rootEl","shallowRef","syncRootEl","el","document","override","documentStatus","useReadable","status","computed","annotationList","selection","viewport","toolController","internalTool","ref","activated","controlled","identity","src","generation","release","open","gen","refHistory","doc","openDocument","cssVariableDefaults","next","change","cause","error","InkError","s","createRefHistory","list","coreCanUndo","coreCanRedo","inkHistory","fn","toolStyle","setStyleTool","watch","tracker","trackToolStyle","id","onMounted","onUpdated","t","setTool","signatures","createSignatureLibrary","createMemorySignatureStore","lib","toolOptions","createToolOptions","provideInkContext","FONT_FAMILIES","SIGNATURE_FONTS","z","p","openBlock","createBlock","unref","Primitive","withCtx","renderSlot","_ctx"],"sources":["../../src/components/InkRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n createMemorySignatureStore,\n createSignatureLibrary,\n InkError,\n openDocument,\n} from '@inkbar/core'\nimport {\n createToolOptions,\n cssVariableDefaults,\n FONT_FAMILIES,\n SIGNATURE_FONTS,\n trackToolStyle,\n} from '@inkbar/core/dom'\nimport { Primitive } from 'reka-ui'\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { provideInkContext, type InkHistory, type InkStatus } from '../context'\nimport { createRefHistory } from '../ref-history'\nimport { useReadable } from '../use-readable'\n\nimport type {\n Annotation,\n AnnotationChange,\n AnnotationDefaults,\n DocumentSource,\n InkDocument,\n PdfAssets,\n SignatureStore,\n} from '@inkbar/core'\nimport type {\n Tool,\n ToolController,\n ToolId,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n src: DocumentSource | null\n assets: PdfAssets\n password?: string | undefined\n /** Colour defaults. Without it, the theme's CSS variables on the root element apply. */\n defaults?: AnnotationDefaults | undefined\n /**\n * Pass (with v-model) to put annotations under the host's control. The mode is fixed when a\n * document opens: passing or dropping this prop later takes effect on the next open.\n */\n annotations?: Annotation[] | undefined\n tool?: ToolId | undefined\n /**\n * Host tools, added to the built-ins; one with a built-in's id replaces it. Read when a\n * document opens.\n */\n tools?: Tool[] | undefined\n /**\n * The font families text boxes offer, replacing the PDF standard families\n * (`FONT_FAMILIES`). Fonts beyond those are the PDF writer's to embed.\n */\n fonts?: string[] | undefined\n /**\n * Where saved signatures live. Default: memory, gone on reload.\n * `createLocalSignatureStore` keeps them in the browser; a host can keep them anywhere.\n * A new store takes effect at once, for the menus and the `signature` tool alike.\n */\n signatures?: SignatureStore | undefined\n /** The handwriting fonts a typed signature offers; the host loads them. */\n signatureFonts?: string[] | undefined\n page?: number | undefined\n zoom?: ZoomValue | undefined\n /** Undo history. Defaults to on for uncontrolled, off for controlled. */\n history?: boolean | undefined\n asChild?: boolean\n }>(),\n {\n password: undefined,\n defaults: undefined,\n annotations: undefined,\n tool: undefined,\n tools: undefined,\n fonts: undefined,\n signatures: undefined,\n signatureFonts: undefined,\n page: undefined,\n zoom: undefined,\n history: undefined,\n asChild: false,\n }\n)\n\nconst emit = defineEmits<{\n 'update:annotations': [next: Annotation[]]\n change: [change: AnnotationChange]\n 'update:tool': [tool: ToolId]\n 'update:page': [page: number]\n 'update:zoom': [zoom: ZoomValue]\n ready: [doc: InkDocument]\n error: [error: InkError]\n activate: [id: string]\n}>()\n\ntype TestHookElement = HTMLElement & { __inkDocument?: InkDocument | undefined }\n\n// A template ref on Primitive is a component instance; the context needs its element.\nconst primitive = useTemplateRef<{ $el: unknown }>('primitive')\nconst rootEl = shallowRef<HTMLElement | null>(null)\nfunction syncRootEl(): void {\n const el = primitive.value?.$el\n rootEl.value = el instanceof HTMLElement ? el : null\n}\n\nconst document = shallowRef<InkDocument | null>(null)\n/** Overrides the document's status while opening, and when opening itself failed. */\nconst override = shallowRef<InkStatus | null>(null)\nconst idle: InkStatus = { state: 'idle' }\nconst documentStatus = useReadable<InkStatus>(() => document.value?.status ?? null, idle)\nconst status = computed<InkStatus>(() => override.value ?? documentStatus.value)\nconst annotationList = useReadable<readonly Annotation[]>(\n () => document.value?.annotations.list ?? null,\n []\n)\nconst selection = useReadable<readonly string[]>(\n () => document.value?.annotations.selection ?? null,\n []\n)\nconst viewport = shallowRef<Viewport | null>(null)\nconst toolController = shallowRef<ToolController | null>(null)\nconst internalTool = ref<ToolId>(props.tool ?? 'select-text')\nconst activated = ref<string | null>(null)\n\nconst controlled = computed(() => props.annotations !== undefined)\n\n/** Signed URLs change; the key does not. Bytes and Blobs are their own identity. */\nfunction identity(src: DocumentSource | null): unknown {\n if (src === null) return null\n if (typeof src === 'string') return src\n if ('key' in src) return src.key\n return src\n}\n\nfunction setTestHook(doc: InkDocument | undefined): void {\n if (import.meta.env.DEV && rootEl.value)\n (rootEl.value as TestHookElement).__inkDocument = doc\n}\n\nlet generation = 0\nfunction release(): void {\n document.value?.destroy()\n document.value = null\n setTestHook(undefined)\n}\n\nasync function open(): Promise<void> {\n const gen = ++generation\n const src = props.src\n release()\n refHistory.clear()\n if (src === null) {\n override.value = null\n return\n }\n override.value = { state: 'loading' }\n syncRootEl()\n let doc: InkDocument\n try {\n doc = await openDocument(src, {\n assets: props.assets,\n password: props.password,\n defaults:\n props.defaults ?? (rootEl.value ? cssVariableDefaults(rootEl.value) : undefined),\n // Controlled hosts get the ref history below; core's own stack stays off.\n history: controlled.value ? false : (props.history ?? true),\n annotations: controlled.value\n ? {\n mode: 'controlled',\n initial: props.annotations ?? [],\n onChange: (next, change) => {\n emit('update:annotations', next)\n emit('change', change)\n },\n }\n : { mode: 'uncontrolled' },\n })\n } catch (cause) {\n if (gen !== generation) return\n const error =\n cause instanceof InkError\n ? cause\n : new InkError(\n 'InvalidPdf',\n cause instanceof Error ? cause.message : String(cause),\n {},\n cause\n )\n override.value = { state: 'error', error }\n emit('error', error)\n return\n }\n if (gen !== generation) {\n doc.destroy()\n return\n }\n // The prop may have changed while the file loaded, when there was no store to apply it to.\n if (doc.annotations.mode === 'controlled' && props.annotations !== undefined)\n doc.annotations.setControlledValue(props.annotations)\n document.value = doc\n override.value = null\n setTestHook(doc)\n const s = doc.status.get()\n if (s.state === 'ready') emit('ready', doc)\n else if (s.state === 'error') emit('error', s.error)\n}\n\nconst refHistory = createRefHistory({\n source: () => props.annotations,\n apply: (list) => document.value?.annotations.replaceAll(list, 'history'),\n enabled: computed(() => controlled.value && props.history === true),\n})\nconst coreCanUndo = useReadable(() => document.value?.history.canUndo ?? null, false)\nconst coreCanRedo = useReadable(() => document.value?.history.canRedo ?? null, false)\nconst inkHistory: InkHistory = {\n canUndo: computed(() =>\n controlled.value ? refHistory.canUndo.value : coreCanUndo.value\n ),\n canRedo: computed(() =>\n controlled.value ? refHistory.canRedo.value : coreCanRedo.value\n ),\n undo: () => (controlled.value ? refHistory.undo() : document.value?.history.undo()),\n redo: () => (controlled.value ? refHistory.redo() : document.value?.history.redo()),\n clear: () => (controlled.value ? refHistory.clear() : document.value?.history.clear()),\n batch: (fn) => {\n if (controlled.value) refHistory.batch(fn)\n else if (document.value) document.value.history.batch(fn)\n else fn()\n },\n}\n\n/** The document's tool style; it batches through `inkHistory`, whichever mode is on. */\nconst toolStyle = shallowRef<ToolStyle | null>(null)\nlet setStyleTool: ((id: ToolId) => void) | undefined\nwatch(\n document,\n (doc) => {\n if (!doc) {\n toolStyle.value = null\n setStyleTool = undefined\n return\n }\n const tracker = trackToolStyle({\n store: doc.annotations,\n history: { batch: (fn) => inkHistory.batch(fn) },\n tools: props.tools,\n tool: internalTool.value,\n })\n setStyleTool = (id) => tracker.setTool(id)\n toolStyle.value = tracker.toolStyle\n },\n // Sync: the style is in place before InkViewport's watcher mounts the engine with it.\n { immediate: true, flush: 'sync' }\n)\nwatch(internalTool, (id) => setStyleTool?.(id))\n\n// Open on the client only: on the server InkRoot renders its empty slot.\nonMounted(() => {\n syncRootEl()\n void open()\n})\nonUpdated(syncRootEl)\n\n// Separate sources, so a new `{ url, key }` object with the same key compares equal.\nwatch([() => identity(props.src), () => props.password], () => void open())\n\nwatch(\n () => props.annotations,\n (next) => {\n if (next && document.value?.annotations.mode === 'controlled')\n document.value.annotations.setControlledValue(next)\n }\n)\n\nwatch(\n () => props.tool,\n (t) => {\n if (t) internalTool.value = t\n }\n)\n\nfunction setTool(id: ToolId): void {\n internalTool.value = id\n emit('update:tool', id)\n}\n\nonBeforeUnmount(() => {\n generation++\n release()\n})\n\nconst signatures = computed(() =>\n createSignatureLibrary(props.signatures ?? createMemorySignatureStore())\n)\nwatch(signatures, (lib) => void lib.refresh(), { immediate: true })\n/** Tool options last as long as the root; the tool style is per document. */\nconst toolOptions = createToolOptions()\n\nprovideInkContext({\n assets: computed(() => props.assets),\n document,\n status,\n annotations: annotationList,\n selection,\n viewport,\n tools: toolController,\n tool: internalTool,\n setTool,\n hostTools: computed(() => props.tools),\n fonts: computed(() => props.fonts ?? FONT_FAMILIES),\n toolOptions,\n signatures,\n signatureFonts: computed(() => props.signatureFonts ?? SIGNATURE_FONTS),\n toolStyle,\n zoomModel: computed(() => props.zoom),\n pageModel: computed(() => props.page),\n reportZoom: (z) => emit('update:zoom', z),\n reportPage: (p) => emit('update:page', p),\n activated,\n setActivated(id) {\n activated.value = id\n if (id) emit('activate', id)\n },\n history: inkHistory,\n rootEl,\n})\n\n// `history` is what `useHistory()` returns inside the root, for hosts that hold a template ref:\n// a controlled host calls `history.clear()` after loading its saved list.\ndefineExpose({ document, status, rootEl, history: inkHistory })\n</script>\n\n<template>\n <Primitive\n ref=\"primitive\"\n :as-child=\"props.asChild\"\n as=\"div\"\n data-ink-root\n :data-state=\"status.state\"\n >\n <slot :status=\"status\" :document=\"document\" />\n </Primitive>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDA,IAAMQ,IAAQC,GAqDRC,IAAOH,IAcPI,IAAYC,EAAiC,WAAW,GACxDC,IAASC,EAA+B,IAAI;EAClD,SAASC,IAAmB;GAC1B,IAAMC,IAAKL,EAAU,OAAO;GAC5B,EAAO,QAAQK,aAAc,cAAcA,IAAK;EAClD;EAEA,IAAMC,IAAWH,EAA+B,IAAI,GAE9CI,IAAWJ,EAA6B,IAAI,GAE5CK,IAAiBC,QAA6BH,EAAS,OAAO,UAAU,MAAM,EAD1D,OAAO,OACmD,CAAI,GAClFI,IAASC,QAA0BJ,EAAS,SAASC,EAAe,KAAK,GACzEI,IAAiBH,QACfH,EAAS,OAAO,YAAY,QAAQ,MAC1C,CAAC,CACH,GACMO,IAAYJ,QACVH,EAAS,OAAO,YAAY,aAAa,MAC/C,CAAC,CACH,GACMQ,IAAWX,EAA4B,IAAI,GAC3CY,IAAiBZ,EAAkC,IAAI,GACvDa,IAAeC,EAAYpB,EAAM,QAAQ,aAAa,GACtDqB,IAAYD,EAAmB,IAAI,GAEnCE,IAAaR,QAAed,EAAM,gBAAgB,KAAA,CAAS;EAGjE,SAASuB,EAAS,GAAqC;GAIrD,OAHIC,MAAQ,OAAa,OACrB,OAAOA,KAAQ,WAAiBA,IAChC,SAASA,IAAYA,EAAI,MACtBA;EACT;EAOA,IAAIC,IAAa;EACjB,SAASC,IAAgB;GAEvB,AADAjB,EAAS,OAAO,QAAQ,GACxB,EAAS,QAAQ;EAEnB;EAEA,eAAekB,IAAsB;GACnC,IAAMC,IAAM,EAAEH,GACRD,IAAMxB,EAAM;GAGlB,IAFA0B,EAAQ,GACRG,EAAW,MA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GAQYC,EAAA2E,CAAA,GAAA;GAPN,SAAA;GAAJ,KAAIlE;GACH,YAAUH,EAAM;GACjB,IAAG;GACH,iBAAA;GACC,cAAYa,EAAA,MAAO;;GAEpB,SAAAlB,QAA8C,CAA9CC,EAA8C4E,EAAA,QAAA,WAAA;IAAvC,QAAQ3D,EAAA;IAAS,UAAUJ,EAAA"}
|
|
1
|
+
{"version":3,"file":"InkRoot.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_renderSlot","InkRoot_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","primitive","useTemplateRef","rootEl","shallowRef","syncRootEl","el","document","override","documentStatus","useReadable","status","computed","annotationList","selection","viewport","toolController","internalTool","ref","activated","controlled","identity","src","generation","release","open","gen","refHistory","doc","openDocument","cssVariableDefaults","next","change","cause","error","InkError","s","createRefHistory","list","coreCanUndo","coreCanRedo","inkHistory","fn","toolStyle","setStyleTool","watch","tracker","trackToolStyle","id","onMounted","onUpdated","t","setTool","tc","signatures","createSignatureLibrary","createMemorySignatureStore","lib","toolOptions","createToolOptions","provideInkContext","FONT_FAMILIES","SIGNATURE_FONTS","z","p","openBlock","createBlock","unref","Primitive","withCtx","renderSlot","_ctx"],"sources":["../../src/components/InkRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n createMemorySignatureStore,\n createSignatureLibrary,\n InkError,\n openDocument,\n} from '@inkbar/core'\nimport {\n createToolOptions,\n cssVariableDefaults,\n FONT_FAMILIES,\n SIGNATURE_FONTS,\n trackToolStyle,\n} from '@inkbar/core/dom'\nimport { Primitive } from 'reka-ui'\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport { provideInkContext, type InkHistory, type InkStatus } from '../context'\nimport { createRefHistory } from '../ref-history'\nimport { useReadable } from '../use-readable'\n\nimport type {\n Annotation,\n AnnotationChange,\n AnnotationDefaults,\n DocumentSource,\n InkDocument,\n PdfAssets,\n SignatureStore,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n Tool,\n ToolController,\n ToolId,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{\n src: DocumentSource | null\n assets: PdfAssets\n password?: string | undefined\n /** Colour defaults. Without it, the theme's CSS variables on the root element apply. */\n defaults?: AnnotationDefaults | undefined\n /**\n * Pass (with v-model) to put annotations under the host's control. The mode is fixed when a\n * document opens: passing or dropping this prop later takes effect on the next open.\n */\n annotations?: Annotation[] | undefined\n tool?: ToolId | undefined\n /**\n * Host tools, added to the built-ins; one with a built-in's id replaces it. Read when a\n * document opens.\n */\n tools?: Tool[] | undefined\n /**\n * Adds `data-*` attributes, classes and a screen-reader description to each annotation's\n * element (see `DecorateAnnotation`). Decorations re-apply whenever the annotations change\n * and when this prop changes, without rebuilding the viewer. Pass a new function when its\n * output would change for any other reason.\n */\n decorateAnnotation?: DecorateAnnotation | undefined\n /**\n * The font families text boxes offer, replacing the PDF standard families\n * (`FONT_FAMILIES`). Fonts beyond those are the PDF writer's to embed.\n */\n fonts?: string[] | undefined\n /**\n * Where saved signatures live. Default: memory, gone on reload.\n * `createLocalSignatureStore` keeps them in the browser; a host can keep them anywhere.\n * A new store takes effect at once, for the menus and the `signature` tool alike.\n */\n signatures?: SignatureStore | undefined\n /** The handwriting fonts a typed signature offers; the host loads them. */\n signatureFonts?: string[] | undefined\n page?: number | undefined\n zoom?: ZoomValue | undefined\n /** Undo history. Defaults to on for uncontrolled, off for controlled. */\n history?: boolean | undefined\n asChild?: boolean\n }>(),\n {\n password: undefined,\n defaults: undefined,\n annotations: undefined,\n tool: undefined,\n tools: undefined,\n decorateAnnotation: undefined,\n fonts: undefined,\n signatures: undefined,\n signatureFonts: undefined,\n page: undefined,\n zoom: undefined,\n history: undefined,\n asChild: false,\n }\n)\n\nconst emit = defineEmits<{\n 'update:annotations': [next: Annotation[]]\n change: [change: AnnotationChange]\n 'update:tool': [tool: ToolId]\n 'update:page': [page: number]\n 'update:zoom': [zoom: ZoomValue]\n ready: [doc: InkDocument]\n error: [error: InkError]\n activate: [id: string]\n}>()\n\ntype TestHookElement = HTMLElement & { __inkDocument?: InkDocument | undefined }\n\n// A template ref on Primitive is a component instance; the context needs its element.\nconst primitive = useTemplateRef<{ $el: unknown }>('primitive')\nconst rootEl = shallowRef<HTMLElement | null>(null)\nfunction syncRootEl(): void {\n const el = primitive.value?.$el\n rootEl.value = el instanceof HTMLElement ? el : null\n}\n\nconst document = shallowRef<InkDocument | null>(null)\n/** Overrides the document's status while opening, and when opening itself failed. */\nconst override = shallowRef<InkStatus | null>(null)\nconst idle: InkStatus = { state: 'idle' }\nconst documentStatus = useReadable<InkStatus>(() => document.value?.status ?? null, idle)\nconst status = computed<InkStatus>(() => override.value ?? documentStatus.value)\nconst annotationList = useReadable<readonly Annotation[]>(\n () => document.value?.annotations.list ?? null,\n []\n)\nconst selection = useReadable<readonly string[]>(\n () => document.value?.annotations.selection ?? null,\n []\n)\nconst viewport = shallowRef<Viewport | null>(null)\nconst toolController = shallowRef<ToolController | null>(null)\nconst internalTool = ref<ToolId>(props.tool ?? 'select-text')\nconst activated = ref<string | null>(null)\n\nconst controlled = computed(() => props.annotations !== undefined)\n\n/** Signed URLs change; the key does not. Bytes and Blobs are their own identity. */\nfunction identity(src: DocumentSource | null): unknown {\n if (src === null) return null\n if (typeof src === 'string') return src\n if ('key' in src) return src.key\n return src\n}\n\nfunction setTestHook(doc: InkDocument | undefined): void {\n if (import.meta.env.DEV && rootEl.value)\n (rootEl.value as TestHookElement).__inkDocument = doc\n}\n\nlet generation = 0\nfunction release(): void {\n document.value?.destroy()\n document.value = null\n setTestHook(undefined)\n}\n\nasync function open(): Promise<void> {\n const gen = ++generation\n const src = props.src\n release()\n refHistory.clear()\n if (src === null) {\n override.value = null\n return\n }\n override.value = { state: 'loading' }\n syncRootEl()\n let doc: InkDocument\n try {\n doc = await openDocument(src, {\n assets: props.assets,\n password: props.password,\n defaults:\n props.defaults ?? (rootEl.value ? cssVariableDefaults(rootEl.value) : undefined),\n // Controlled hosts get the ref history below; core's own stack stays off.\n history: controlled.value ? false : (props.history ?? true),\n annotations: controlled.value\n ? {\n mode: 'controlled',\n initial: props.annotations ?? [],\n onChange: (next, change) => {\n emit('update:annotations', next)\n emit('change', change)\n },\n }\n : { mode: 'uncontrolled' },\n })\n } catch (cause) {\n if (gen !== generation) return\n const error =\n cause instanceof InkError\n ? cause\n : new InkError(\n 'InvalidPdf',\n cause instanceof Error ? cause.message : String(cause),\n {},\n cause\n )\n override.value = { state: 'error', error }\n emit('error', error)\n return\n }\n if (gen !== generation) {\n doc.destroy()\n return\n }\n // The prop may have changed while the file loaded, when there was no store to apply it to.\n if (doc.annotations.mode === 'controlled' && props.annotations !== undefined)\n doc.annotations.setControlledValue(props.annotations)\n document.value = doc\n override.value = null\n setTestHook(doc)\n const s = doc.status.get()\n if (s.state === 'ready') emit('ready', doc)\n else if (s.state === 'error') emit('error', s.error)\n}\n\nconst refHistory = createRefHistory({\n source: () => props.annotations,\n apply: (list) => document.value?.annotations.replaceAll(list, 'history'),\n enabled: computed(() => controlled.value && props.history === true),\n})\nconst coreCanUndo = useReadable(() => document.value?.history.canUndo ?? null, false)\nconst coreCanRedo = useReadable(() => document.value?.history.canRedo ?? null, false)\nconst inkHistory: InkHistory = {\n canUndo: computed(() =>\n controlled.value ? refHistory.canUndo.value : coreCanUndo.value\n ),\n canRedo: computed(() =>\n controlled.value ? refHistory.canRedo.value : coreCanRedo.value\n ),\n undo: () => (controlled.value ? refHistory.undo() : document.value?.history.undo()),\n redo: () => (controlled.value ? refHistory.redo() : document.value?.history.redo()),\n clear: () => (controlled.value ? refHistory.clear() : document.value?.history.clear()),\n batch: (fn) => {\n if (controlled.value) refHistory.batch(fn)\n else if (document.value) document.value.history.batch(fn)\n else fn()\n },\n}\n\n/** The document's tool style; it batches through `inkHistory`, whichever mode is on. */\nconst toolStyle = shallowRef<ToolStyle | null>(null)\nlet setStyleTool: ((id: ToolId) => void) | undefined\nwatch(\n document,\n (doc) => {\n if (!doc) {\n toolStyle.value = null\n setStyleTool = undefined\n return\n }\n const tracker = trackToolStyle({\n store: doc.annotations,\n history: { batch: (fn) => inkHistory.batch(fn) },\n tools: props.tools,\n tool: internalTool.value,\n })\n setStyleTool = (id) => tracker.setTool(id)\n toolStyle.value = tracker.toolStyle\n },\n // Sync: the style is in place before InkViewport's watcher mounts the engine with it.\n { immediate: true, flush: 'sync' }\n)\nwatch(internalTool, (id) => setStyleTool?.(id))\n\n// Open on the client only: on the server InkRoot renders its empty slot.\nonMounted(() => {\n syncRootEl()\n void open()\n})\nonUpdated(syncRootEl)\n\n// Separate sources, so a new `{ url, key }` object with the same key compares equal.\nwatch([() => identity(props.src), () => props.password], () => void open())\n\nwatch(\n () => props.annotations,\n (next) => {\n if (next && document.value?.annotations.mode === 'controlled')\n document.value.annotations.setControlledValue(next)\n }\n)\n\nwatch(\n () => props.tool,\n (t) => {\n if (t) internalTool.value = t\n }\n)\n\nfunction setTool(id: ToolId): void {\n // Picking the active tool again starts it afresh, as after a one-shot tool's use.\n const tc = toolController.value\n if (internalTool.value === id && tc?.active.get() === id) tc.set(id)\n internalTool.value = id\n emit('update:tool', id)\n}\n\nonBeforeUnmount(() => {\n generation++\n release()\n})\n\nconst signatures = computed(() =>\n createSignatureLibrary(props.signatures ?? createMemorySignatureStore())\n)\nwatch(signatures, (lib) => void lib.refresh(), { immediate: true })\n/** Tool options last as long as the root; the tool style is per document. */\nconst toolOptions = createToolOptions()\n\nprovideInkContext({\n assets: computed(() => props.assets),\n document,\n status,\n annotations: annotationList,\n selection,\n viewport,\n tools: toolController,\n tool: internalTool,\n setTool,\n hostTools: computed(() => props.tools),\n decorateAnnotation: computed(() => props.decorateAnnotation),\n fonts: computed(() => props.fonts ?? FONT_FAMILIES),\n toolOptions,\n signatures,\n signatureFonts: computed(() => props.signatureFonts ?? SIGNATURE_FONTS),\n toolStyle,\n zoomModel: computed(() => props.zoom),\n pageModel: computed(() => props.page),\n reportZoom: (z) => emit('update:zoom', z),\n reportPage: (p) => emit('update:page', p),\n activated,\n setActivated(id) {\n activated.value = id\n if (id) emit('activate', id)\n },\n history: inkHistory,\n rootEl,\n})\n\n// `history` is what `useHistory()` returns inside the root, for hosts that hold a template ref:\n// a controlled host calls `history.clear()` after loading its saved list.\ndefineExpose({ document, status, rootEl, history: inkHistory })\n</script>\n\n<template>\n <Primitive\n ref=\"primitive\"\n :as-child=\"props.asChild\"\n as=\"div\"\n data-ink-root\n :data-state=\"status.state\"\n >\n <slot :status=\"status\" :document=\"document\" />\n </Primitive>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDA,IAAMQ,IAAQC,GA6DRC,IAAOH,GAcPI,IAAYC,EAAiC,WAAW,GACxDC,IAASC,EAA+B,IAAI;EAClD,SAASC,IAAmB;GAC1B,IAAMC,IAAKL,EAAU,OAAO;GAC5B,EAAO,QAAQK,aAAc,cAAcA,IAAK;EAClD;EAEA,IAAMC,IAAWH,EAA+B,IAAI,GAE9CI,IAAWJ,EAA6B,IAAI,GAE5CK,IAAiBC,QAA6BH,EAAS,OAAO,UAAU,MAAM,EAD1D,OAAO,OACmD,CAAI,GAClFI,IAASC,QAA0BJ,EAAS,SAASC,EAAe,KAAK,GACzEI,IAAiBH,QACfH,EAAS,OAAO,YAAY,QAAQ,MAC1C,CAAC,CACH,GACMO,IAAYJ,QACVH,EAAS,OAAO,YAAY,aAAa,MAC/C,CAAC,CACH,GACMQ,IAAWX,EAA4B,IAAI,GAC3CY,IAAiBZ,EAAkC,IAAI,GACvDa,IAAeC,EAAYpB,EAAM,QAAQ,aAAa,GACtDqB,IAAYD,EAAmB,IAAI,GAEnCE,IAAaR,QAAed,EAAM,gBAAgB,KAAA,CAAS;EAGjE,SAASuB,EAAS,GAAqC;GAIrD,OAHIC,MAAQ,OAAa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SAAS+D,CAAa;GAClD;GACA;GACA,gBAAgBjD,QAAed,EAAM,kBAAkBgE,CAAe;GACtE;GACA,WAAWlD,QAAed,EAAM,IAAI;GACpC,WAAWc,QAAed,EAAM,IAAI;GACpC,aAAa,MAAME,EAAK,eAAe+D,CAAC;GACxC,aAAa,MAAM/D,EAAK,eAAegE,CAAC;GACxC;GACA,aAAa,GAAI;IAEf,AADA,EAAU,QAAQhB,GACdA,KAAIhD,EAAK,YAAYgD,CAAE;GAC7B;GACA,SAASP;GACT;EACF,CAAC,GAID7C,EAAa;GAAE;GAAU;GAAQ;GAAQ,SAAS6C;EAAW,CAAC,cAI5DnD,EAAA,GAAAC,GAQYC,EAAA4E,CAAA,GAAA;GAPN,SAAA;GAAJ,KAAInE;GACH,YAAUH,EAAM;GACjB,IAAG;GACH,iBAAA;GACC,cAAYa,EAAA,MAAO;;GAEpB,SAAAlB,QAA8C,CAA9CC,GAA8C6E,EAAA,QAAA,WAAA;IAAvC,QAAQ5D,EAAA;IAAS,UAAUJ,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkShapeMenu.js","names":["_sfc_main","InkShapeMenu_vue_vue_type_script_setup_true_lang_default","InkShapeMenu_default"],"sources":["../../src/components/InkShapeMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * A split button for the shape tool. The main part activates the tool with the current\n * kind and draws that kind's icon; the chevron opens a two-column grid of kinds. Choosing a\n * kind switches to the tool with it.\n */\nimport {\n focusInitialMenuItem,\n handleMenuKeys,\n menuItems,\n SHAPE_COLUMNS,\n SHAPE_ICONS,\n SHAPE_KINDS,\n shapeMenuModel,\n type ShapeKind,\n type ShapeOptions,\n} from '@inkbar/core/dom'\nimport { ChevronDown } from '@inkbar/icons'\nimport {\n PopoverContent,\n PopoverPortal,\n PopoverRoot,\n PopoverTrigger,\n ToolbarButton,\n} from 'reka-ui'\nimport { computed, ref } from 'vue'\n\nimport { useTool } from '../composables/useTool'\nimport { useToolOptions } from '../composables/useToolOptions'\n\nimport InkIcon from './InkIcon.vue'\n\nconst { tool, setTool } = useTool()\nconst { options, setOptions } = useToolOptions<ShapeOptions>('shape')\nconst open = ref(false)\n\nconst model = computed(() => shapeMenuModel(options.value, SHAPE_KINDS))\nconst active = computed(() => tool.value === 'shape')\nconst icon = computed(() => SHAPE_ICONS[model.value.kind])\n\n/** ArrowDown opens on the first item; a click opens on the checked one. */\nlet focusFirst = false\nfunction onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key !== 'ArrowDown' || e.defaultPrevented || open.value) return\n e.preventDefault()\n focusFirst = true\n open.value = true\n}\n\nfunction onOpenAutoFocus(e: Event): void {\n e.preventDefault()\n // One menu is open at a time.\n const menu = document.querySelector('[data-ink-menu=\"shape\"] [role=\"menu\"]')\n if (menu) {\n if (focusFirst) menuItems(menu)[0]?.focus({ preventScroll: true })\n else focusInitialMenuItem(menu)\n }\n focusFirst = false\n}\n\nfunction choose(kind: ShapeKind): void {\n setOptions({ kind })\n setTool('shape')\n open.value = false\n}\n\n// Reka's typed props stop at its own; ARIA and listeners go through bound objects.\nconst mainAttrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': model.value.label,\n title: model.value.label,\n onClick: () => setTool('shape'),\n}))\nconst triggerAttrs = {\n 'aria-label': 'Choose shape',\n title: 'Choose shape',\n 'aria-haspopup': 'menu' as const,\n onKeydown: onTriggerKeydown,\n}\nconst menuAttrs = { 'aria-label': 'Shapes' }\nconst innerAttrs = {\n role: 'menu',\n 'aria-label': 'Shapes',\n onKeydown: (e: KeyboardEvent) => handleMenuKeys(e, e.currentTarget as HTMLElement),\n}\n</script>\n\n<template>\n <div\n
|
|
1
|
+
{"version":3,"file":"InkShapeMenu.js","names":["_sfc_main","InkShapeMenu_vue_vue_type_script_setup_true_lang_default","InkShapeMenu_default"],"sources":["../../src/components/InkShapeMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * A split button for the shape tool. The main part activates the tool with the current\n * kind and draws that kind's icon; the chevron opens a two-column grid of kinds. Choosing a\n * kind switches to the tool with it.\n */\nimport {\n focusInitialMenuItem,\n handleMenuKeys,\n menuItems,\n SHAPE_COLUMNS,\n SHAPE_ICONS,\n SHAPE_KINDS,\n shapeMenuModel,\n type ShapeKind,\n type ShapeOptions,\n} from '@inkbar/core/dom'\nimport { ChevronDown } from '@inkbar/icons'\nimport {\n PopoverAnchor,\n PopoverContent,\n PopoverPortal,\n PopoverRoot,\n PopoverTrigger,\n ToolbarButton,\n} from 'reka-ui'\nimport { computed, ref } from 'vue'\n\nimport { useTool } from '../composables/useTool'\nimport { useToolOptions } from '../composables/useToolOptions'\n\nimport InkIcon from './InkIcon.vue'\n\ndefineOptions({ inheritAttrs: false })\nconst { tool, setTool } = useTool()\nconst { options, setOptions } = useToolOptions<ShapeOptions>('shape')\nconst open = ref(false)\n\nconst model = computed(() => shapeMenuModel(options.value, SHAPE_KINDS))\nconst active = computed(() => tool.value === 'shape')\nconst icon = computed(() => SHAPE_ICONS[model.value.kind])\n\n/** ArrowDown opens on the first item; a click opens on the checked one. */\nlet focusFirst = false\nfunction onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key !== 'ArrowDown' || e.defaultPrevented || open.value) return\n e.preventDefault()\n focusFirst = true\n open.value = true\n}\n\nfunction onOpenAutoFocus(e: Event): void {\n e.preventDefault()\n // One menu is open at a time.\n const menu = document.querySelector('[data-ink-menu=\"shape\"] [role=\"menu\"]')\n if (menu) {\n if (focusFirst) menuItems(menu)[0]?.focus({ preventScroll: true })\n else focusInitialMenuItem(menu)\n }\n focusFirst = false\n}\n\nfunction choose(kind: ShapeKind): void {\n setOptions({ kind })\n setTool('shape')\n open.value = false\n}\n\n// Reka's typed props stop at its own; ARIA and listeners go through bound objects.\nconst mainAttrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': model.value.label,\n title: model.value.label,\n onClick: () => setTool('shape'),\n}))\nconst triggerAttrs = {\n 'aria-label': 'Choose shape',\n title: 'Choose shape',\n 'aria-haspopup': 'menu' as const,\n onKeydown: onTriggerKeydown,\n}\nconst menuAttrs = { 'aria-label': 'Shapes' }\nconst innerAttrs = {\n role: 'menu',\n 'aria-label': 'Shapes',\n onKeydown: (e: KeyboardEvent) => handleMenuKeys(e, e.currentTarget as HTMLElement),\n}\n</script>\n\n<template>\n <PopoverRoot v-model:open=\"open\">\n <PopoverAnchor as-child>\n <div\n role=\"group\"\n aria-label=\"Shape\"\n class=\"ink-split-button ink-shape-menu\"\n data-ink-shape-menu\n v-bind=\"$attrs\"\n >\n <ToolbarButton\n class=\"ink-tool-button ink-shape-button\"\n data-ink-tool-button\n data-ink-shape-button\n data-tool=\"shape\"\n :data-kind=\"model.kind\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"mainAttrs\"\n >\n <slot :active=\"active\" :kind=\"model.kind\"><InkIcon :icon=\"icon\" /></slot>\n </ToolbarButton>\n <ToolbarButton as-child>\n <PopoverTrigger as-child>\n <button\n type=\"button\"\n class=\"ink-menu-trigger ink-shape-menu-trigger\"\n data-ink-shape-menu-trigger\n :data-state=\"open ? 'open' : 'closed'\"\n v-bind=\"triggerAttrs\"\n >\n <InkIcon :icon=\"ChevronDown\" />\n </button>\n </PopoverTrigger>\n </ToolbarButton>\n <PopoverPortal>\n <PopoverContent\n class=\"ink-select-content ink-menu-content\"\n data-ink-select-content\n data-ink-menu=\"shape\"\n side=\"bottom\"\n align=\"start\"\n :side-offset=\"4\"\n :collision-padding=\"8\"\n v-bind=\"menuAttrs\"\n @open-auto-focus=\"onOpenAutoFocus\"\n >\n <div v-bind=\"innerAttrs\">\n <div\n role=\"group\"\n aria-label=\"Shapes\"\n class=\"ink-shape-grid\"\n :data-ink-menu-columns=\"SHAPE_COLUMNS\"\n >\n <button\n v-for=\"item in model.items\"\n :key=\"item.kind\"\n type=\"button\"\n role=\"menuitemradio\"\n class=\"ink-select-item ink-menu-item ink-shape-item\"\n data-ink-select-item\n tabindex=\"-1\"\n :data-key=\"item.kind\"\n :aria-checked=\"item.checked\"\n :data-state=\"item.checked ? 'checked' : 'unchecked'\"\n @click=\"choose(item.kind)\"\n >\n <InkIcon :icon=\"SHAPE_ICONS[item.kind]\" :size=\"16\" />\n {{ item.label }}\n </button>\n </div>\n </div>\n </PopoverContent>\n </PopoverPortal>\n </div>\n </PopoverAnchor>\n </PopoverRoot>\n</template>\n"],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ShapeKind } from '@inkbar/core/dom';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_21: {
|
|
3
3
|
active: boolean;
|
|
4
4
|
kind: ShapeKind;
|
|
5
5
|
};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_21) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkShapeMenu.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkShapeMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InkShapeMenu.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkShapeMenu.vue"],"names":[],"mappings":"AA6KA,OAAO,EAQL,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAA;AA+SzB,QAAA,IAAI,QAAQ;;;CAAY,CAAC;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAGhD,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,118 +1,126 @@
|
|
|
1
1
|
import { useTool as e } from "../composables/useTool.js";
|
|
2
2
|
import { useToolOptions as t } from "../composables/useToolOptions.js";
|
|
3
3
|
import n from "./InkIcon.js";
|
|
4
|
-
import { Fragment as r, computed as i,
|
|
5
|
-
import { SHAPE_COLUMNS as
|
|
6
|
-
import { PopoverContent as
|
|
7
|
-
import { ChevronDown as
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, mergeProps as f, normalizeProps as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
|
|
5
|
+
import { SHAPE_COLUMNS as x, SHAPE_ICONS as S, SHAPE_KINDS as C, focusInitialMenuItem as w, handleMenuKeys as T, menuItems as E, shapeMenuModel as D } from "@inkbar/core/dom";
|
|
6
|
+
import { PopoverAnchor as O, PopoverContent as k, PopoverPortal as A, PopoverRoot as j, PopoverTrigger as M, ToolbarButton as N } from "reka-ui";
|
|
7
|
+
import { ChevronDown as P } from "@inkbar/icons";
|
|
8
8
|
//#region src/components/InkShapeMenu.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
10
|
-
role: "group",
|
|
11
|
-
"aria-label": "Shape",
|
|
12
|
-
class: "ink-split-button ink-shape-menu",
|
|
13
|
-
"data-ink-shape-menu": ""
|
|
14
|
-
}, P = ["data-state"], F = ["data-ink-menu-columns"], I = [
|
|
9
|
+
var F = ["data-state"], I = ["data-ink-menu-columns"], L = [
|
|
15
10
|
"data-key",
|
|
16
11
|
"aria-checked",
|
|
17
12
|
"data-state",
|
|
18
13
|
"onClick"
|
|
19
|
-
],
|
|
14
|
+
], R = /*@__PURE__*/ u({
|
|
15
|
+
inheritAttrs: !1,
|
|
20
16
|
__name: "InkShapeMenu",
|
|
21
|
-
setup(
|
|
22
|
-
let { tool:
|
|
23
|
-
function K(e) {
|
|
24
|
-
e.key !== "ArrowDown" || e.defaultPrevented || V.value || (e.preventDefault(), G = !0, V.value = !0);
|
|
25
|
-
}
|
|
17
|
+
setup(u) {
|
|
18
|
+
let { tool: R, setTool: z } = e(), { options: B, setOptions: V } = t("shape"), H = h(!1), U = i(() => D(B.value, C)), W = i(() => R.value === "shape"), G = i(() => S[U.value.kind]), K = !1;
|
|
26
19
|
function q(e) {
|
|
20
|
+
e.key !== "ArrowDown" || e.defaultPrevented || H.value || (e.preventDefault(), K = !0, H.value = !0);
|
|
21
|
+
}
|
|
22
|
+
function J(e) {
|
|
27
23
|
e.preventDefault();
|
|
28
24
|
let t = document.querySelector("[data-ink-menu=\"shape\"] [role=\"menu\"]");
|
|
29
|
-
t && (
|
|
25
|
+
t && (K ? E(t)[0]?.focus({ preventScroll: !0 }) : w(t)), K = !1;
|
|
30
26
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
27
|
+
function Y(e) {
|
|
28
|
+
V({ kind: e }), z("shape"), H.value = !1;
|
|
33
29
|
}
|
|
34
|
-
let
|
|
35
|
-
"aria-pressed": String(
|
|
36
|
-
"aria-label":
|
|
37
|
-
title:
|
|
38
|
-
onClick: () =>
|
|
39
|
-
})),
|
|
30
|
+
let X = i(() => ({
|
|
31
|
+
"aria-pressed": String(W.value),
|
|
32
|
+
"aria-label": U.value.label,
|
|
33
|
+
title: U.value.label,
|
|
34
|
+
onClick: () => z("shape")
|
|
35
|
+
})), Z = {
|
|
40
36
|
"aria-label": "Choose shape",
|
|
41
37
|
title: "Choose shape",
|
|
42
38
|
"aria-haspopup": "menu",
|
|
43
|
-
onKeydown:
|
|
44
|
-
},
|
|
39
|
+
onKeydown: q
|
|
40
|
+
}, Q = { "aria-label": "Shapes" }, $ = {
|
|
45
41
|
role: "menu",
|
|
46
42
|
"aria-label": "Shapes",
|
|
47
|
-
onKeydown: (e) =>
|
|
43
|
+
onKeydown: (e) => T(e, e.currentTarget)
|
|
48
44
|
};
|
|
49
|
-
return (e, t) => (
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"data-ink-shape-button": "",
|
|
53
|
-
"data-tool": "shape",
|
|
54
|
-
"data-kind": H.value.kind,
|
|
55
|
-
"data-state": U.value ? "on" : "off"
|
|
56
|
-
}, Y.value), {
|
|
57
|
-
default: y(() => [g(e.$slots, "default", {
|
|
58
|
-
active: U.value,
|
|
59
|
-
kind: H.value.kind
|
|
60
|
-
}, () => [c(n, { icon: W.value }, null, 8, ["icon"])])]),
|
|
61
|
-
_: 3
|
|
62
|
-
}, 16, ["data-kind", "data-state"]), c(v(k), {
|
|
63
|
-
open: V.value,
|
|
64
|
-
"onUpdate:open": t[0] ||= (e) => V.value = e
|
|
45
|
+
return (e, t) => (m(), a(y(j), {
|
|
46
|
+
open: H.value,
|
|
47
|
+
"onUpdate:open": t[0] ||= (e) => H.value = e
|
|
65
48
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
default:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
49
|
+
default: b(() => [l(y(O), { "as-child": "" }, {
|
|
50
|
+
default: b(() => [s("div", f({
|
|
51
|
+
role: "group",
|
|
52
|
+
"aria-label": "Shape",
|
|
53
|
+
class: "ink-split-button ink-shape-menu",
|
|
54
|
+
"data-ink-shape-menu": ""
|
|
55
|
+
}, e.$attrs), [
|
|
56
|
+
l(y(N), f({
|
|
57
|
+
class: "ink-tool-button ink-shape-button",
|
|
58
|
+
"data-ink-tool-button": "",
|
|
59
|
+
"data-ink-shape-button": "",
|
|
60
|
+
"data-tool": "shape",
|
|
61
|
+
"data-kind": U.value.kind,
|
|
62
|
+
"data-state": W.value ? "on" : "off"
|
|
63
|
+
}, X.value), {
|
|
64
|
+
default: b(() => [_(e.$slots, "default", {
|
|
65
|
+
active: W.value,
|
|
66
|
+
kind: U.value.kind
|
|
67
|
+
}, () => [l(n, { icon: G.value }, null, 8, ["icon"])])]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 16, ["data-kind", "data-state"]),
|
|
70
|
+
l(y(N), { "as-child": "" }, {
|
|
71
|
+
default: b(() => [l(y(M), { "as-child": "" }, {
|
|
72
|
+
default: b(() => [s("button", f({
|
|
73
|
+
type: "button",
|
|
74
|
+
class: "ink-menu-trigger ink-shape-menu-trigger",
|
|
75
|
+
"data-ink-shape-menu-trigger": "",
|
|
76
|
+
"data-state": H.value ? "open" : "closed"
|
|
77
|
+
}, Z), [l(n, { icon: y(P) }, null, 8, ["icon"])], 16, F)]),
|
|
78
|
+
_: 1
|
|
79
|
+
})]),
|
|
80
|
+
_: 1
|
|
81
|
+
}),
|
|
82
|
+
l(y(A), null, {
|
|
83
|
+
default: b(() => [l(y(k), f({
|
|
84
|
+
class: "ink-select-content ink-menu-content",
|
|
85
|
+
"data-ink-select-content": "",
|
|
86
|
+
"data-ink-menu": "shape",
|
|
87
|
+
side: "bottom",
|
|
88
|
+
align: "start",
|
|
89
|
+
"side-offset": 4,
|
|
90
|
+
"collision-padding": 8
|
|
91
|
+
}, Q, { onOpenAutoFocus: J }), {
|
|
92
|
+
default: b(() => [s("div", p(d($)), [s("div", {
|
|
93
|
+
role: "group",
|
|
94
|
+
"aria-label": "Shapes",
|
|
95
|
+
class: "ink-shape-grid",
|
|
96
|
+
"data-ink-menu-columns": y(x)
|
|
97
|
+
}, [(m(!0), o(r, null, g(U.value.items, (e) => (m(), o("button", {
|
|
98
|
+
key: e.kind,
|
|
99
|
+
type: "button",
|
|
100
|
+
role: "menuitemradio",
|
|
101
|
+
class: "ink-select-item ink-menu-item ink-shape-item",
|
|
102
|
+
"data-ink-select-item": "",
|
|
103
|
+
tabindex: "-1",
|
|
104
|
+
"data-key": e.kind,
|
|
105
|
+
"aria-checked": e.checked,
|
|
106
|
+
"data-state": e.checked ? "checked" : "unchecked",
|
|
107
|
+
onClick: (t) => Y(e.kind)
|
|
108
|
+
}, [l(n, {
|
|
109
|
+
icon: y(S)[e.kind],
|
|
110
|
+
size: 16
|
|
111
|
+
}, null, 8, ["icon"]), c(" " + v(e.label), 1)], 8, L))), 128))], 8, I)], 16)]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 16)]),
|
|
114
|
+
_: 1
|
|
115
|
+
})
|
|
116
|
+
], 16)]),
|
|
117
|
+
_: 3
|
|
110
118
|
})]),
|
|
111
|
-
_:
|
|
112
|
-
}, 8, ["open"])
|
|
119
|
+
_: 3
|
|
120
|
+
}, 8, ["open"]));
|
|
113
121
|
}
|
|
114
122
|
});
|
|
115
123
|
//#endregion
|
|
116
|
-
export {
|
|
124
|
+
export { R as default };
|
|
117
125
|
|
|
118
126
|
//# sourceMappingURL=InkShapeMenu.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkShapeMenu.vue_vue_type_script_setup_true_lang.js","names":["
|
|
1
|
+
{"version":3,"file":"InkShapeMenu.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createElementVNode","_mergeProps","_renderSlot","InkIcon","_normalizeProps","_guardReactiveProps","_createElementBlock","_Fragment","_renderList","_createTextVNode","_toDisplayString","InkIcon_default","_hoisted_1","_hoisted_2","_hoisted_3","InkShapeMenu_vue_vue_type_script_setup_true_lang_default","useTool","useToolOptions","open","ref","model","computed","shapeMenuModel","options","SHAPE_KINDS","active","tool","icon","SHAPE_ICONS","focusFirst","onTriggerKeydown","onOpenAutoFocus","menu","menuItems","focusInitialMenuItem","choose","setOptions","setTool","mainAttrs","triggerAttrs","menuAttrs","innerAttrs","handleMenuKeys","openBlock","createBlock","unref","PopoverRoot","_cache","$event","withCtx","createVNode","PopoverAnchor","createElementVNode","mergeProps","_ctx","ToolbarButton","renderSlot","PopoverTrigger","ChevronDown","PopoverPortal","PopoverContent","normalizeProps","guardReactiveProps","SHAPE_COLUMNS","createElementBlock","Fragment","renderList","item","createTextVNode","toDisplayString"],"sources":["../../src/components/InkShapeMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * A split button for the shape tool. The main part activates the tool with the current\n * kind and draws that kind's icon; the chevron opens a two-column grid of kinds. Choosing a\n * kind switches to the tool with it.\n */\nimport {\n focusInitialMenuItem,\n handleMenuKeys,\n menuItems,\n SHAPE_COLUMNS,\n SHAPE_ICONS,\n SHAPE_KINDS,\n shapeMenuModel,\n type ShapeKind,\n type ShapeOptions,\n} from '@inkbar/core/dom'\nimport { ChevronDown } from '@inkbar/icons'\nimport {\n PopoverAnchor,\n PopoverContent,\n PopoverPortal,\n PopoverRoot,\n PopoverTrigger,\n ToolbarButton,\n} from 'reka-ui'\nimport { computed, ref } from 'vue'\n\nimport { useTool } from '../composables/useTool'\nimport { useToolOptions } from '../composables/useToolOptions'\n\nimport InkIcon from './InkIcon.vue'\n\ndefineOptions({ inheritAttrs: false })\nconst { tool, setTool } = useTool()\nconst { options, setOptions } = useToolOptions<ShapeOptions>('shape')\nconst open = ref(false)\n\nconst model = computed(() => shapeMenuModel(options.value, SHAPE_KINDS))\nconst active = computed(() => tool.value === 'shape')\nconst icon = computed(() => SHAPE_ICONS[model.value.kind])\n\n/** ArrowDown opens on the first item; a click opens on the checked one. */\nlet focusFirst = false\nfunction onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key !== 'ArrowDown' || e.defaultPrevented || open.value) return\n e.preventDefault()\n focusFirst = true\n open.value = true\n}\n\nfunction onOpenAutoFocus(e: Event): void {\n e.preventDefault()\n // One menu is open at a time.\n const menu = document.querySelector('[data-ink-menu=\"shape\"] [role=\"menu\"]')\n if (menu) {\n if (focusFirst) menuItems(menu)[0]?.focus({ preventScroll: true })\n else focusInitialMenuItem(menu)\n }\n focusFirst = false\n}\n\nfunction choose(kind: ShapeKind): void {\n setOptions({ kind })\n setTool('shape')\n open.value = false\n}\n\n// Reka's typed props stop at its own; ARIA and listeners go through bound objects.\nconst mainAttrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': model.value.label,\n title: model.value.label,\n onClick: () => setTool('shape'),\n}))\nconst triggerAttrs = {\n 'aria-label': 'Choose shape',\n title: 'Choose shape',\n 'aria-haspopup': 'menu' as const,\n onKeydown: onTriggerKeydown,\n}\nconst menuAttrs = { 'aria-label': 'Shapes' }\nconst innerAttrs = {\n role: 'menu',\n 'aria-label': 'Shapes',\n onKeydown: (e: KeyboardEvent) => handleMenuKeys(e, e.currentTarget as HTMLElement),\n}\n</script>\n\n<template>\n <PopoverRoot v-model:open=\"open\">\n <PopoverAnchor as-child>\n <div\n role=\"group\"\n aria-label=\"Shape\"\n class=\"ink-split-button ink-shape-menu\"\n data-ink-shape-menu\n v-bind=\"$attrs\"\n >\n <ToolbarButton\n class=\"ink-tool-button ink-shape-button\"\n data-ink-tool-button\n data-ink-shape-button\n data-tool=\"shape\"\n :data-kind=\"model.kind\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"mainAttrs\"\n >\n <slot :active=\"active\" :kind=\"model.kind\"><InkIcon :icon=\"icon\" /></slot>\n </ToolbarButton>\n <ToolbarButton as-child>\n <PopoverTrigger as-child>\n <button\n type=\"button\"\n class=\"ink-menu-trigger ink-shape-menu-trigger\"\n data-ink-shape-menu-trigger\n :data-state=\"open ? 'open' : 'closed'\"\n v-bind=\"triggerAttrs\"\n >\n <InkIcon :icon=\"ChevronDown\" />\n </button>\n </PopoverTrigger>\n </ToolbarButton>\n <PopoverPortal>\n <PopoverContent\n class=\"ink-select-content ink-menu-content\"\n data-ink-select-content\n data-ink-menu=\"shape\"\n side=\"bottom\"\n align=\"start\"\n :side-offset=\"4\"\n :collision-padding=\"8\"\n v-bind=\"menuAttrs\"\n @open-auto-focus=\"onOpenAutoFocus\"\n >\n <div v-bind=\"innerAttrs\">\n <div\n role=\"group\"\n aria-label=\"Shapes\"\n class=\"ink-shape-grid\"\n :data-ink-menu-columns=\"SHAPE_COLUMNS\"\n >\n <button\n v-for=\"item in model.items\"\n :key=\"item.kind\"\n type=\"button\"\n role=\"menuitemradio\"\n class=\"ink-select-item ink-menu-item ink-shape-item\"\n data-ink-select-item\n tabindex=\"-1\"\n :data-key=\"item.kind\"\n :aria-checked=\"item.checked\"\n :data-state=\"item.checked ? 'checked' : 'unchecked'\"\n @click=\"choose(item.kind)\"\n >\n <InkIcon :icon=\"SHAPE_ICONS[item.kind]\" :size=\"16\" />\n {{ item.label }}\n </button>\n </div>\n </div>\n </PopoverContent>\n </PopoverPortal>\n </div>\n </PopoverAnchor>\n </PopoverRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAkCA,IAAM,EAAE,SAAM,eAAYsB,EAAQ,GAC5B,EAAE,YAAS,kBAAeC,EAA6B,OAAO,GAC9DC,IAAOC,EAAI,EAAK,GAEhBC,IAAQC,QAAeC,EAAeC,EAAQ,OAAOC,CAAW,CAAC,GACjEC,IAASJ,QAAeK,EAAK,UAAU,OAAO,GAC9CC,IAAON,QAAeO,EAAYR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