@inkbar/vue 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +29 -3
  2. package/dist/components/InkIcon.js +7 -0
  3. package/dist/components/InkIcon.js.map +1 -0
  4. package/dist/components/InkIcon.vue.d.ts +11 -0
  5. package/dist/components/InkIcon.vue.d.ts.map +1 -0
  6. package/dist/components/InkIcon.vue_vue_type_script_setup_true_lang.js +22 -0
  7. package/dist/components/InkIcon.vue_vue_type_script_setup_true_lang.js.map +1 -0
  8. package/dist/components/InkNextPage.js +7 -0
  9. package/dist/components/InkNextPage.js.map +1 -0
  10. package/dist/components/InkNextPage.vue.d.ts +19 -0
  11. package/dist/components/InkNextPage.vue.d.ts.map +1 -0
  12. package/dist/components/InkNextPage.vue_vue_type_script_setup_true_lang.js +33 -0
  13. package/dist/components/InkNextPage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  14. package/dist/components/InkPrevPage.js +7 -0
  15. package/dist/components/InkPrevPage.js.map +1 -0
  16. package/dist/components/InkPrevPage.vue.d.ts +19 -0
  17. package/dist/components/InkPrevPage.vue.d.ts.map +1 -0
  18. package/dist/components/InkPrevPage.vue_vue_type_script_setup_true_lang.js +33 -0
  19. package/dist/components/InkPrevPage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  20. package/dist/components/InkRedo.js +7 -0
  21. package/dist/components/InkRedo.js.map +1 -0
  22. package/dist/{compositions/DefaultToolbar.vue.d.ts → components/InkRedo.vue.d.ts} +5 -5
  23. package/dist/components/InkRedo.vue.d.ts.map +1 -0
  24. package/dist/components/InkRedo.vue_vue_type_script_setup_true_lang.js +33 -0
  25. package/dist/components/InkRedo.vue_vue_type_script_setup_true_lang.js.map +1 -0
  26. package/dist/components/InkToolButton.js.map +1 -1
  27. package/dist/components/InkToolButton.vue.d.ts.map +1 -1
  28. package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js +26 -18
  29. package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/InkToolbarSeparator.js +7 -0
  31. package/dist/components/InkToolbarSeparator.js.map +1 -0
  32. package/dist/components/InkToolbarSeparator.vue.d.ts +4 -0
  33. package/dist/components/InkToolbarSeparator.vue.d.ts.map +1 -0
  34. package/dist/components/InkToolbarSeparator.vue_vue_type_script_setup_true_lang.js +17 -0
  35. package/dist/components/InkToolbarSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
  36. package/dist/components/InkUndo.js +7 -0
  37. package/dist/components/InkUndo.js.map +1 -0
  38. package/dist/components/InkUndo.vue.d.ts +19 -0
  39. package/dist/components/InkUndo.vue.d.ts.map +1 -0
  40. package/dist/components/InkUndo.vue_vue_type_script_setup_true_lang.js +33 -0
  41. package/dist/components/InkUndo.vue_vue_type_script_setup_true_lang.js.map +1 -0
  42. package/dist/components/InkZoomIn.js.map +1 -1
  43. package/dist/components/InkZoomIn.vue.d.ts.map +1 -1
  44. package/dist/components/InkZoomIn.vue_vue_type_script_setup_true_lang.js +13 -11
  45. package/dist/components/InkZoomIn.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/InkZoomOut.js.map +1 -1
  47. package/dist/components/InkZoomOut.vue.d.ts.map +1 -1
  48. package/dist/components/InkZoomOut.vue_vue_type_script_setup_true_lang.js +13 -11
  49. package/dist/components/InkZoomOut.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/components/InkZoomSelect.js.map +1 -1
  51. package/dist/components/InkZoomSelect.vue.d.ts.map +1 -1
  52. package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js +105 -29
  53. package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/index.d.ts +6 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +15 -10
  57. package/package.json +5 -5
  58. package/dist/compositions/DefaultToolbar.js +0 -7
  59. package/dist/compositions/DefaultToolbar.js.map +0 -1
  60. package/dist/compositions/DefaultToolbar.vue.d.ts.map +0 -1
  61. package/dist/compositions/DefaultToolbar.vue_vue_type_script_setup_true_lang.js +0 -100
  62. package/dist/compositions/DefaultToolbar.vue_vue_type_script_setup_true_lang.js.map +0 -1
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  ---
22
22
 
23
- Drop a PDF viewer into your Vue app and let people highlight text, leave notes with replies and review redactions. `@inkbar/vue` gives you a default toolbar and popovers styled by `@inkbar/theme`, plus the unstyled components and composables they are made from, so you can keep the defaults or build your own UI.
23
+ Drop a PDF viewer into your Vue app and let people highlight text, leave notes with replies and review redactions. `@inkbar/vue` gives you components and composables to build your own toolbars, plus note and suggestion popovers, all styled by `@inkbar/theme`.
24
24
 
25
25
  Annotations are plain typed objects. Bind them with `v-model` to keep them in your own state, or let Inkbar hold them with undo and redo.
26
26
 
@@ -40,7 +40,16 @@ import { ref } from 'vue'
40
40
  import {
41
41
  InkRoot,
42
42
  InkViewport,
43
- DefaultToolbar,
43
+ InkToolbar,
44
+ InkToolButton,
45
+ InkToolbarSeparator,
46
+ InkUndo,
47
+ InkRedo,
48
+ InkPrevPage,
49
+ InkPageInput,
50
+ InkPageCount,
51
+ InkNextPage,
52
+ InkZoomSelect,
44
53
  InkNotePopover,
45
54
  InkSuggestionCard,
46
55
  } from '@inkbar/vue'
@@ -59,14 +68,31 @@ const annotations = ref<Annotation[]>([])
59
68
  :assets="assets"
60
69
  v-model:annotations="annotations"
61
70
  >
62
- <DefaultToolbar />
71
+ <InkToolbar>
72
+ <InkToolButton tool="select" />
73
+ <InkToolButton tool="highlight" />
74
+ <InkToolButton tool="redact-area" />
75
+ <InkToolButton tool="note" />
76
+ <InkToolbarSeparator />
77
+ <InkUndo />
78
+ <InkRedo />
79
+ </InkToolbar>
63
80
  <InkViewport />
81
+ <InkToolbar label="Page and zoom">
82
+ <InkPrevPage />
83
+ <InkPageInput />
84
+ <InkPageCount />
85
+ <InkNextPage />
86
+ <InkZoomSelect />
87
+ </InkToolbar>
64
88
  <InkNotePopover />
65
89
  <InkSuggestionCard />
66
90
  </InkRoot>
67
91
  </template>
68
92
  ```
69
93
 
94
+ Each control is a separate component, so put them in any order or leave some out. Buttons show icons from `@inkbar/icons`. Put your own in a button's default slot to replace one, and use `InkIcon` to put the same icons on your own buttons.
95
+
70
96
  `v-model:annotations` makes your list the source of truth. Leave it off and Inkbar keeps the state itself, with undo and redo.
71
97
 
72
98
  ## Controlled mode
@@ -0,0 +1,7 @@
1
+ import e from "./InkIcon.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkIcon.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkIcon.js","names":["_sfc_main","InkIcon_vue_vue_type_script_setup_true_lang_default","InkIcon_default"],"sources":["../../src/components/InkIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * An icon from `@inkbar/icons`, hidden from assistive technology: the control it sits in\n * carries the name. The theme sizes it with `--ink-icon-size`.\n */\nimport { ICON_ATTRIBUTES } from '@inkbar/icons'\n\nimport type { IconNode } from '@inkbar/icons'\n\nwithDefaults(defineProps<{ icon: IconNode; size?: number }>(), { size: 18 })\n</script>\n\n<template>\n <svg\n v-bind=\"ICON_ATTRIBUTES\"\n :width=\"size\"\n :height=\"size\"\n class=\"ink-icon\"\n aria-hidden=\"true\"\n >\n <component :is=\"tag\" v-for=\"([tag, attrs], i) in icon\" :key=\"i\" v-bind=\"attrs\" />\n </svg>\n</template>\n"],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { IconNode } from '@inkbar/icons';
2
+ type __VLS_Props = {
3
+ icon: IconNode;
4
+ size?: number;
5
+ };
6
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ size: number;
8
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ //# sourceMappingURL=InkIcon.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkIcon.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkIcon.vue"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAyCrD,QAAA,MAAM,YAAY;;6EAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,22 @@
1
+ import { Fragment as e, createBlock as t, createElementBlock as n, defineComponent as r, mergeProps as i, openBlock as a, renderList as o, resolveDynamicComponent as s, unref as c } from "vue";
2
+ import { ICON_ATTRIBUTES as l } from "@inkbar/icons";
3
+ //#region src/components/InkIcon.vue?vue&type=script&setup=true&lang.ts
4
+ var u = ["width", "height"], d = /*@__PURE__*/ r({
5
+ __name: "InkIcon",
6
+ props: {
7
+ icon: {},
8
+ size: { default: 18 }
9
+ },
10
+ setup(r) {
11
+ return (d, f) => (a(), n("svg", i(c(l), {
12
+ width: r.size,
13
+ height: r.size,
14
+ class: "ink-icon",
15
+ "aria-hidden": "true"
16
+ }), [(a(!0), n(e, null, o(r.icon, ([e, n], r) => (a(), t(s(e), i({ key: r }, { ref_for: !0 }, n), null, 16))), 128))], 16, u));
17
+ }
18
+ });
19
+ //#endregion
20
+ export { d as default };
21
+
22
+ //# sourceMappingURL=InkIcon.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkIcon.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_mergeProps","_unref","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_hoisted_1","InkIcon_vue_vue_type_script_setup_true_lang_default","openBlock","createElementBlock","mergeProps","unref","ICON_ATTRIBUTES","__props","Fragment","renderList","tag","attrs","createBlock","resolveDynamicComponent","i"],"sources":["../../src/components/InkIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/*\n * An icon from `@inkbar/icons`, hidden from assistive technology: the control it sits in\n * carries the name. The theme sizes it with `--ink-icon-size`.\n */\nimport { ICON_ATTRIBUTES } from '@inkbar/icons'\n\nimport type { IconNode } from '@inkbar/icons'\n\nwithDefaults(defineProps<{ icon: IconNode; size?: number }>(), { size: 18 })\n</script>\n\n<template>\n <svg\n v-bind=\"ICON_ATTRIBUTES\"\n :width=\"size\"\n :height=\"size\"\n class=\"ink-icon\"\n aria-hidden=\"true\"\n >\n <component :is=\"tag\" v-for=\"([tag, attrs], i) in icon\" :key=\"i\" v-bind=\"attrs\" />\n </svg>\n</template>\n"],"mappings":";;;;;;;;;;oBAaEA,EAAA,GAAAC,EAQM,OARNC,EACUC,EAOJW,CAAA,GAPmB;GACtB,OAAOC,EAAA;GACP,QAAQA,EAAA;GACT,OAAM;GACN,eAAY;EAEZf,CAAAA,GAAAA,EAAAA,EAAA,EAAA,GAAAC,EAAiFG,GAAA,MAAAC,EAAhCU,EAAA,OAAI,CAAvBG,GAAKC,IAAQ,OAA3CnB,EAAA,GAAAM,EAAiFC,EAAjEW,CAAG,GAAnBhB,EAAiF,EAAzB,KAAKoB,EAAC,GAAA,EAAA,SAAA,GAAA,GAAUH,CAAK,GAAA,MAAA,EAAA"}
@@ -0,0 +1,7 @@
1
+ import e from "./InkNextPage.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkNextPage.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkNextPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkNextPage.js","names":["_sfc_main","InkNextPage_vue_vue_type_script_setup_true_lang_default","InkNextPage_default"],"sources":["../../src/components/InkNextPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ChevronRight } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { usePage } from '../composables/usePage'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { current, count, next } = usePage()\nconst disabled = computed(() => current.value >= count.value - 1)\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Next page',\n title: 'Next page',\n onClick: () => next(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"disabled\"\n class=\"ink-next-page\"\n data-ink-next-page\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"ChevronRight\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ asChild?: boolean;
3
+ };
4
+ declare var __VLS_7: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_7) => any;
7
+ };
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ asChild: boolean;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //# sourceMappingURL=InkNextPage.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkNextPage.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkNextPage.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAwDzC,QAAA,IAAI,OAAO,IAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;6EAGd,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"}
@@ -0,0 +1,33 @@
1
+ import { usePage as e } from "../composables/usePage.js";
2
+ import t from "./InkIcon.js";
3
+ import { computed as n, createBlock as r, createVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, unref as l, withCtx as u } from "vue";
4
+ import { ToolbarButton as d } from "reka-ui";
5
+ import { ChevronRight as f } from "@inkbar/icons";
6
+ //#region src/components/InkNextPage.vue?vue&type=script&setup=true&lang.ts
7
+ var p = /*@__PURE__*/ a({
8
+ __name: "InkNextPage",
9
+ props: { asChild: {
10
+ type: Boolean,
11
+ default: !1
12
+ } },
13
+ setup(a) {
14
+ let { current: p, count: m, next: h } = e(), g = n(() => p.value >= m.value - 1), _ = {
15
+ "aria-label": "Next page",
16
+ title: "Next page",
17
+ onClick: () => h()
18
+ };
19
+ return (e, n) => (s(), r(l(d), o({
20
+ "as-child": a.asChild,
21
+ disabled: g.value,
22
+ class: "ink-next-page",
23
+ "data-ink-next-page": ""
24
+ }, _), {
25
+ default: u(() => [c(e.$slots, "default", {}, () => [i(t, { icon: l(f) }, null, 8, ["icon"])])]),
26
+ _: 3
27
+ }, 16, ["as-child", "disabled"]));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { p as default };
32
+
33
+ //# sourceMappingURL=InkNextPage.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkNextPage.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createVNode","InkIcon","InkIcon_default","InkNextPage_vue_vue_type_script_setup_true_lang_default","usePage","disabled","computed","current","count","attrs","next","openBlock","createBlock","unref","ToolbarButton","mergeProps","__props","withCtx","renderSlot","_ctx","createVNode","ChevronRight"],"sources":["../../src/components/InkNextPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ChevronRight } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { usePage } from '../composables/usePage'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { current, count, next } = usePage()\nconst disabled = computed(() => current.value >= count.value - 1)\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Next page',\n title: 'Next page',\n onClick: () => next(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"disabled\"\n class=\"ink-next-page\"\n data-ink-next-page\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"ChevronRight\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAUA,IAAM,EAAE,YAAS,UAAO,YAASU,EAAQ,GACnCC,IAAWC,QAAeC,EAAQ,SAASC,EAAM,QAAQ,CAAC,GAE1DC,IAAQ;GACZ,cAAc;GACd,OAAO;GACP,eAAeC,EAAK;EACtB;oBAIEhB,EAAA,GAAAC,EAQgBC,EAAAkB,CAAA,GARhBjB,EAQgB;GAPb,YAAUmB,EAAA;GACV,UAAUX,EAAA;GACX,OAAM;GACN,sBAAA;EACQ,GAAAI,CAAK,GAAA;GAEb,SAAAX,QAA6C,CAA7CC,EAA6CoB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAvCnB,EAAgCC,GAAA,EAAtB,MAAML,EAAAyB,CAAA,EAAY,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ import e from "./InkPrevPage.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkPrevPage.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkPrevPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkPrevPage.js","names":["_sfc_main","InkPrevPage_vue_vue_type_script_setup_true_lang_default","InkPrevPage_default"],"sources":["../../src/components/InkPrevPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ChevronLeft } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { usePage } from '../composables/usePage'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { current, previous } = usePage()\nconst disabled = computed(() => current.value <= 0)\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Previous page',\n title: 'Previous page',\n onClick: () => previous(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"disabled\"\n class=\"ink-prev-page\"\n data-ink-prev-page\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"ChevronLeft\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ asChild?: boolean;
3
+ };
4
+ declare var __VLS_7: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_7) => any;
7
+ };
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ asChild: boolean;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //# sourceMappingURL=InkPrevPage.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkPrevPage.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkPrevPage.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAwDzC,QAAA,IAAI,OAAO,IAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;6EAGd,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"}
@@ -0,0 +1,33 @@
1
+ import { usePage as e } from "../composables/usePage.js";
2
+ import t from "./InkIcon.js";
3
+ import { computed as n, createBlock as r, createVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, unref as l, withCtx as u } from "vue";
4
+ import { ToolbarButton as d } from "reka-ui";
5
+ import { ChevronLeft as f } from "@inkbar/icons";
6
+ //#region src/components/InkPrevPage.vue?vue&type=script&setup=true&lang.ts
7
+ var p = /*@__PURE__*/ a({
8
+ __name: "InkPrevPage",
9
+ props: { asChild: {
10
+ type: Boolean,
11
+ default: !1
12
+ } },
13
+ setup(a) {
14
+ let { current: p, previous: m } = e(), h = n(() => p.value <= 0), g = {
15
+ "aria-label": "Previous page",
16
+ title: "Previous page",
17
+ onClick: () => m()
18
+ };
19
+ return (e, n) => (s(), r(l(d), o({
20
+ "as-child": a.asChild,
21
+ disabled: h.value,
22
+ class: "ink-prev-page",
23
+ "data-ink-prev-page": ""
24
+ }, g), {
25
+ default: u(() => [c(e.$slots, "default", {}, () => [i(t, { icon: l(f) }, null, 8, ["icon"])])]),
26
+ _: 3
27
+ }, 16, ["as-child", "disabled"]));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { p as default };
32
+
33
+ //# sourceMappingURL=InkPrevPage.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkPrevPage.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createVNode","InkIcon","InkIcon_default","InkPrevPage_vue_vue_type_script_setup_true_lang_default","usePage","disabled","computed","current","attrs","previous","openBlock","createBlock","unref","ToolbarButton","mergeProps","__props","withCtx","renderSlot","_ctx","createVNode","ChevronLeft"],"sources":["../../src/components/InkPrevPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ChevronLeft } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { usePage } from '../composables/usePage'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { current, previous } = usePage()\nconst disabled = computed(() => current.value <= 0)\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Previous page',\n title: 'Previous page',\n onClick: () => previous(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"disabled\"\n class=\"ink-prev-page\"\n data-ink-prev-page\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"ChevronLeft\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAUA,IAAM,EAAE,YAAS,gBAAaU,EAAQ,GAChCC,IAAWC,QAAeC,EAAQ,SAAS,CAAC,GAE5CC,IAAQ;GACZ,cAAc;GACd,OAAO;GACP,eAAeC,EAAS;EAC1B;oBAIEf,EAAA,GAAAC,EAQgBC,EAAAiB,CAAA,GARhBhB,EAQgB;GAPb,YAAUkB,EAAA;GACV,UAAUV,EAAA;GACX,OAAM;GACN,sBAAA;EACQ,GAAAG,CAAK,GAAA;GAEb,SAAAV,QAA4C,CAA5CC,EAA4CmB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAtClB,EAA+BC,GAAA,EAArB,MAAML,EAAAwB,CAAA,EAAW,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ import e from "./InkRedo.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkRedo.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkRedo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkRedo.js","names":["_sfc_main","InkRedo_vue_vue_type_script_setup_true_lang_default","InkRedo_default"],"sources":["../../src/components/InkRedo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Redo2 } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useHistory } from '../composables/useHistory'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { canRedo, redo } = useHistory()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Redo',\n title: 'Redo',\n onClick: () => redo(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"!canRedo\"\n class=\"ink-redo\"\n data-ink-redo\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"Redo2\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
@@ -1,12 +1,12 @@
1
1
  type __VLS_Props = {
2
- label?: string;
2
+ asChild?: boolean;
3
3
  };
4
- declare var __VLS_99: {};
4
+ declare var __VLS_7: {};
5
5
  type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_99) => any;
6
+ default?: (props: typeof __VLS_7) => any;
7
7
  };
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
- label: string;
9
+ asChild: boolean;
10
10
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
12
  declare const _default: typeof __VLS_export;
@@ -16,4 +16,4 @@ type __VLS_WithSlots<T, S> = T & {
16
16
  $slots: S;
17
17
  };
18
18
  };
19
- //# sourceMappingURL=DefaultToolbar.vue.d.ts.map
19
+ //# sourceMappingURL=InkRedo.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkRedo.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkRedo.vue"],"names":[],"mappings":"AAuCA,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAyDzC,QAAA,IAAI,OAAO,IAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;6EAGd,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"}
@@ -0,0 +1,33 @@
1
+ import { useHistory as e } from "../composables/useHistory.js";
2
+ import t from "./InkIcon.js";
3
+ import { createBlock as n, createVNode as r, defineComponent as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c, withCtx as l } from "vue";
4
+ import { ToolbarButton as u } from "reka-ui";
5
+ import { Redo2 as d } from "@inkbar/icons";
6
+ //#region src/components/InkRedo.vue?vue&type=script&setup=true&lang.ts
7
+ var f = /*@__PURE__*/ i({
8
+ __name: "InkRedo",
9
+ props: { asChild: {
10
+ type: Boolean,
11
+ default: !1
12
+ } },
13
+ setup(i) {
14
+ let { canRedo: f, redo: p } = e(), m = {
15
+ "aria-label": "Redo",
16
+ title: "Redo",
17
+ onClick: () => p()
18
+ };
19
+ return (e, p) => (o(), n(c(u), a({
20
+ "as-child": i.asChild,
21
+ disabled: !c(f),
22
+ class: "ink-redo",
23
+ "data-ink-redo": ""
24
+ }, m), {
25
+ default: l(() => [s(e.$slots, "default", {}, () => [r(t, { icon: c(d) }, null, 8, ["icon"])])]),
26
+ _: 3
27
+ }, 16, ["as-child", "disabled"]));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { f as default };
32
+
33
+ //# sourceMappingURL=InkRedo.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkRedo.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createVNode","InkIcon","InkIcon_default","InkRedo_vue_vue_type_script_setup_true_lang_default","useHistory","attrs","redo","openBlock","createBlock","unref","ToolbarButton","mergeProps","__props","canRedo","withCtx","renderSlot","_ctx","createVNode","Redo2"],"sources":["../../src/components/InkRedo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Redo2 } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useHistory } from '../composables/useHistory'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { canRedo, redo } = useHistory()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Redo',\n title: 'Redo',\n onClick: () => redo(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"!canRedo\"\n class=\"ink-redo\"\n data-ink-redo\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"Redo2\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,IAAM,EAAE,YAAS,YAASU,EAAW,GAE/BC,IAAQ;GACZ,cAAc;GACd,OAAO;GACP,eAAeC,EAAK;EACtB;oBAIEZ,EAAA,GAAAC,EAQgBC,EAAAc,CAAA,GARhBb,EAQgB;GAPb,YAAUe,EAAA;GACV,UAAQ,CAAGhB,EAAAiB,CAAA;GACZ,OAAM;GACN,iBAAA;EACQ,GAAAR,CAAK,GAAA;GAEb,SAAAP,QAAsC,CAAtCC,EAAsCiB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAhChB,EAAyBC,GAAA,EAAf,MAAML,EAAAsB,CAAA,EAAK,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InkToolButton.js","names":["_sfc_main","InkToolButton_vue_vue_type_script_setup_true_lang_default","InkToolButton_default"],"sources":["../../src/components/InkToolButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TOOL_LABELS } from '@inkbar/core/dom'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { useTool } from '../composables/useTool'\n\nimport type { ToolId } from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{ tool: ToolId; label?: string | undefined; asChild?: boolean }>(),\n { label: undefined, asChild: false }\n)\n\nconst { tool: current, setTool } = useTool()\nconst active = computed(() => current.value === props.tool)\nconst name = computed(() => props.label ?? TOOL_LABELS[props.tool])\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': name.value,\n title: name.value,\n onClick: () => setTool(props.tool),\n}))\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n class=\"ink-tool-button\"\n data-ink-tool-button\n :data-tool=\"tool\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"attrs\"\n >\n <slot :active=\"active\" :label=\"name\">{{ name }}</slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"InkToolButton.js","names":["_sfc_main","InkToolButton_vue_vue_type_script_setup_true_lang_default","InkToolButton_default"],"sources":["../../src/components/InkToolButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TOOL_LABELS } from '@inkbar/core/dom'\nimport { Hand, Highlighter, MessageSquare, MousePointer2, Square } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { useTool } from '../composables/useTool'\n\nimport InkIcon from './InkIcon.vue'\n\nimport type { ToolId } from '@inkbar/core/dom'\nimport type { IconNode } from '@inkbar/icons'\n\nconst ICONS: Readonly<Record<ToolId, IconNode>> = {\n view: Hand,\n select: MousePointer2,\n highlight: Highlighter,\n 'redact-area': Square,\n note: MessageSquare,\n}\n\nconst props = withDefaults(\n defineProps<{ tool: ToolId; label?: string | undefined; asChild?: boolean }>(),\n { label: undefined, asChild: false }\n)\n\nconst { tool: current, setTool } = useTool()\nconst active = computed(() => current.value === props.tool)\nconst name = computed(() => props.label ?? TOOL_LABELS[props.tool])\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': name.value,\n title: name.value,\n onClick: () => setTool(props.tool),\n}))\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n class=\"ink-tool-button\"\n data-ink-tool-button\n :data-tool=\"tool\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"attrs\"\n >\n <slot :active=\"active\" :label=\"name\"><InkIcon :icon=\"ICONS[tool]\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"InkToolButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkToolButton.vue"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAG9C,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA2DnF,QAAA,IAAI,OAAO;;;CAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;;6EAGd,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
+ {"version":3,"file":"InkToolButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkToolButton.vue"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAY9C,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAqEnF,QAAA,IAAI,OAAO;;;CAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;;6EAGd,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,9 +1,11 @@
1
1
  import { useTool as e } from "../composables/useTool.js";
2
- import { computed as t, createBlock as n, createTextVNode as r, defineComponent as i, mergeProps as a, openBlock as o, renderSlot as s, toDisplayString as c, unref as l, withCtx as u } from "vue";
2
+ import t from "./InkIcon.js";
3
+ import { computed as n, createBlock as r, createVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, unref as l, withCtx as u } from "vue";
3
4
  import { TOOL_LABELS as d } from "@inkbar/core/dom";
4
5
  import { ToolbarButton as f } from "reka-ui";
6
+ import { Hand as p, Highlighter as m, MessageSquare as h, MousePointer2 as g, Square as _ } from "@inkbar/icons";
5
7
  //#region src/components/InkToolButton.vue?vue&type=script&setup=true&lang.ts
6
- var p = /*@__PURE__*/ i({
8
+ var v = /*@__PURE__*/ a({
7
9
  __name: "InkToolButton",
8
10
  props: {
9
11
  tool: {},
@@ -13,24 +15,30 @@ var p = /*@__PURE__*/ i({
13
15
  default: !1
14
16
  }
15
17
  },
16
- setup(i) {
17
- let p = i, { tool: m, setTool: h } = e(), g = t(() => m.value === p.tool), _ = t(() => p.label ?? d[p.tool]), v = t(() => ({
18
- "aria-pressed": String(g.value),
19
- "aria-label": _.value,
20
- title: _.value,
21
- onClick: () => h(p.tool)
18
+ setup(a) {
19
+ let v = {
20
+ view: p,
21
+ select: g,
22
+ highlight: m,
23
+ "redact-area": _,
24
+ note: h
25
+ }, y = a, { tool: b, setTool: x } = e(), S = n(() => b.value === y.tool), C = n(() => y.label ?? d[y.tool]), w = n(() => ({
26
+ "aria-pressed": String(S.value),
27
+ "aria-label": C.value,
28
+ title: C.value,
29
+ onClick: () => x(y.tool)
22
30
  }));
23
- return (e, t) => (o(), n(l(f), a({
24
- "as-child": i.asChild,
31
+ return (e, n) => (s(), r(l(f), o({
32
+ "as-child": a.asChild,
25
33
  class: "ink-tool-button",
26
34
  "data-ink-tool-button": "",
27
- "data-tool": i.tool,
28
- "data-state": g.value ? "on" : "off"
29
- }, v.value), {
30
- default: u(() => [s(e.$slots, "default", {
31
- active: g.value,
32
- label: _.value
33
- }, () => [r(c(_.value), 1)])]),
35
+ "data-tool": a.tool,
36
+ "data-state": S.value ? "on" : "off"
37
+ }, w.value), {
38
+ default: u(() => [c(e.$slots, "default", {
39
+ active: S.value,
40
+ label: C.value
41
+ }, () => [i(t, { icon: v[a.tool] }, null, 8, ["icon"])])]),
34
42
  _: 3
35
43
  }, 16, [
36
44
  "as-child",
@@ -40,6 +48,6 @@ var p = /*@__PURE__*/ i({
40
48
  }
41
49
  });
42
50
  //#endregion
43
- export { p as default };
51
+ export { v as default };
44
52
 
45
53
  //# sourceMappingURL=InkToolButton.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InkToolButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createTextVNode","_toDisplayString","InkToolButton_vue_vue_type_script_setup_true_lang_default","props","__props","current","useTool","active","computed","name","TOOL_LABELS","attrs","setTool","openBlock","createBlock","unref","ToolbarButton","mergeProps","withCtx","renderSlot","_ctx","createTextVNode","toDisplayString"],"sources":["../../src/components/InkToolButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TOOL_LABELS } from '@inkbar/core/dom'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { useTool } from '../composables/useTool'\n\nimport type { ToolId } from '@inkbar/core/dom'\n\nconst props = withDefaults(\n defineProps<{ tool: ToolId; label?: string | undefined; asChild?: boolean }>(),\n { label: undefined, asChild: false }\n)\n\nconst { tool: current, setTool } = useTool()\nconst active = computed(() => current.value === props.tool)\nconst name = computed(() => props.label ?? TOOL_LABELS[props.tool])\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': name.value,\n title: name.value,\n onClick: () => setTool(props.tool),\n}))\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n class=\"ink-tool-button\"\n data-ink-tool-button\n :data-tool=\"tool\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"attrs\"\n >\n <slot :active=\"active\" :label=\"name\">{{ name }}</slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,IAAMS,IAAQC,GAKR,EAAE,MAAMC,GAAS,eAAYC,EAAQ,GACrCC,IAASC,QAAeH,EAAQ,UAAUF,EAAM,IAAI,GACpDM,IAAOD,QAAeL,EAAM,SAASO,EAAYP,EAAM,KAAK,GAE5DQ,IAAQH,SAAgB;GAC5B,gBAAgB,OAAOD,EAAO,KAAK;GACnC,cAAcE,EAAK;GACnB,OAAOA,EAAK;GACZ,eAAeG,EAAQT,EAAM,IAAI;EACnC,EAAE;oBAIAT,EAAA,GAAAC,EASgBC,EAAAoB,CAAA,GAThBnB,EASgB;GARb,YAAUO,EAAA;GACX,OAAM;GACN,wBAAA;GACC,aAAWA,EAAA;GACX,cAAYG,EAAA,QAAM,OAAA;EACX,GAAAI,EAAA,KAAK,GAAA;GAEb,SAAAb,QAAsD,CAAtDC,EAAsDqB,EAAA,QAAA,WAAA;IAA/C,QAAQb,EAAA;IAAS,OAAOE,EAAA;GAA/B,SAAsD,CAAdT,EAAAC,EAAAQ,EAAA,KAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"InkToolButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createVNode","InkIcon","InkIcon_default","InkToolButton_vue_vue_type_script_setup_true_lang_default","ICONS","Hand","MousePointer2","Highlighter","Square","MessageSquare","props","__props","current","useTool","active","computed","name","TOOL_LABELS","attrs","setTool","openBlock","createBlock","unref","ToolbarButton","mergeProps","withCtx","renderSlot","_ctx","createVNode"],"sources":["../../src/components/InkToolButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TOOL_LABELS } from '@inkbar/core/dom'\nimport { Hand, Highlighter, MessageSquare, MousePointer2, Square } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\nimport { computed } from 'vue'\n\nimport { useTool } from '../composables/useTool'\n\nimport InkIcon from './InkIcon.vue'\n\nimport type { ToolId } from '@inkbar/core/dom'\nimport type { IconNode } from '@inkbar/icons'\n\nconst ICONS: Readonly<Record<ToolId, IconNode>> = {\n view: Hand,\n select: MousePointer2,\n highlight: Highlighter,\n 'redact-area': Square,\n note: MessageSquare,\n}\n\nconst props = withDefaults(\n defineProps<{ tool: ToolId; label?: string | undefined; asChild?: boolean }>(),\n { label: undefined, asChild: false }\n)\n\nconst { tool: current, setTool } = useTool()\nconst active = computed(() => current.value === props.tool)\nconst name = computed(() => props.label ?? TOOL_LABELS[props.tool])\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = computed(() => ({\n 'aria-pressed': String(active.value),\n 'aria-label': name.value,\n title: name.value,\n onClick: () => setTool(props.tool),\n}))\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n class=\"ink-tool-button\"\n data-ink-tool-button\n :data-tool=\"tool\"\n :data-state=\"active ? 'on' : 'off'\"\n v-bind=\"attrs\"\n >\n <slot :active=\"active\" :label=\"name\"><InkIcon :icon=\"ICONS[tool]\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAaA,IAAMU,IAA4C;GAChD,MAAMC;GACN,QAAQC;GACR,WAAWC;GACX,eAAeC;GACf,MAAMC;EACR,GAEMC,IAAQC,GAKR,EAAE,MAAMC,GAAS,eAAYC,EAAQ,GACrCC,IAASC,QAAeH,EAAQ,UAAUF,EAAM,IAAI,GACpDM,IAAOD,QAAeL,EAAM,SAASO,EAAYP,EAAM,KAAK,GAE5DQ,IAAQH,SAAgB;GAC5B,gBAAgB,OAAOD,EAAO,KAAK;GACnC,cAAcE,EAAK;GACnB,OAAOA,EAAK;GACZ,eAAeG,EAAQT,EAAM,IAAI;EACnC,EAAE;oBAIAhB,EAAA,GAAAC,EASgBC,EAAA2B,CAAA,GAThB1B,EASgB;GARb,YAAUc,EAAA;GACX,OAAM;GACN,wBAAA;GACC,aAAWA,EAAA;GACX,cAAYG,EAAA,QAAM,OAAA;EACX,GAAAI,EAAA,KAAK,GAAA;GAEb,SAAApB,QAA2E,CAA3EC,EAA2E4B,EAAA,QAAA,WAAA;IAApE,QAAQb,EAAA;IAAS,OAAOE,EAAA;GAA/B,SAA2E,CAAtChB,EAA+BC,GAAA,EAArB,MAAMG,EAAMO,EAAA,MAAA,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ import e from "./InkToolbarSeparator.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkToolbarSeparator.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkToolbarSeparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkToolbarSeparator.js","names":["_sfc_main","InkToolbarSeparator_vue_vue_type_script_setup_true_lang_default","InkToolbarSeparator_default"],"sources":["../../src/components/InkToolbarSeparator.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/* A divider between groups of controls in a horizontal toolbar. Not focusable. */\n</script>\n\n<template>\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n class=\"ink-toolbar-separator\"\n data-ink-toolbar-separator\n />\n</template>\n"],"mappings":""}
@@ -0,0 +1,4 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ //# sourceMappingURL=InkToolbarSeparator.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkToolbarSeparator.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkToolbarSeparator.vue"],"names":[],"mappings":"AA6BA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,17 @@
1
+ import { createElementBlock as e, defineComponent as t, openBlock as n } from "vue";
2
+ //#region src/components/InkToolbarSeparator.vue?vue&type=script&setup=true&lang.ts
3
+ var r = {
4
+ role: "separator",
5
+ "aria-orientation": "vertical",
6
+ class: "ink-toolbar-separator",
7
+ "data-ink-toolbar-separator": ""
8
+ }, i = /*@__PURE__*/ t({
9
+ __name: "InkToolbarSeparator",
10
+ setup(t) {
11
+ return (t, i) => (n(), e("div", r));
12
+ }
13
+ });
14
+ //#endregion
15
+ export { i as default };
16
+
17
+ //# sourceMappingURL=InkToolbarSeparator.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkToolbarSeparator.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_hoisted_1","InkToolbarSeparator_vue_vue_type_script_setup_true_lang_default","openBlock","createElementBlock"],"sources":["../../src/components/InkToolbarSeparator.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/* A divider between groups of controls in a horizontal toolbar. Not focusable. */\n</script>\n\n<template>\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n class=\"ink-toolbar-separator\"\n data-ink-toolbar-separator\n />\n</template>\n"],"mappings":";;;;;;;;;;oBAKEA,EAAA,GAAAC,EAKE,OALFC,CAKE"}
@@ -0,0 +1,7 @@
1
+ import e from "./InkUndo.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/InkUndo.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=InkUndo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkUndo.js","names":["_sfc_main","InkUndo_vue_vue_type_script_setup_true_lang_default","InkUndo_default"],"sources":["../../src/components/InkUndo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Undo2 } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useHistory } from '../composables/useHistory'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { canUndo, undo } = useHistory()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Undo',\n title: 'Undo',\n onClick: () => undo(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"!canUndo\"\n class=\"ink-undo\"\n data-ink-undo\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"Undo2\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ asChild?: boolean;
3
+ };
4
+ declare var __VLS_7: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_7) => any;
7
+ };
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ asChild: boolean;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //# sourceMappingURL=InkUndo.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkUndo.vue.d.ts","sourceRoot":"","sources":["../../src/components/InkUndo.vue"],"names":[],"mappings":"AAuCA,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAyDzC,QAAA,IAAI,OAAO,IAAW,CAAC;AACvB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU;;6EAGd,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"}
@@ -0,0 +1,33 @@
1
+ import { useHistory as e } from "../composables/useHistory.js";
2
+ import t from "./InkIcon.js";
3
+ import { createBlock as n, createVNode as r, defineComponent as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c, withCtx as l } from "vue";
4
+ import { ToolbarButton as u } from "reka-ui";
5
+ import { Undo2 as d } from "@inkbar/icons";
6
+ //#region src/components/InkUndo.vue?vue&type=script&setup=true&lang.ts
7
+ var f = /*@__PURE__*/ i({
8
+ __name: "InkUndo",
9
+ props: { asChild: {
10
+ type: Boolean,
11
+ default: !1
12
+ } },
13
+ setup(i) {
14
+ let { canUndo: f, undo: p } = e(), m = {
15
+ "aria-label": "Undo",
16
+ title: "Undo",
17
+ onClick: () => p()
18
+ };
19
+ return (e, p) => (o(), n(c(u), a({
20
+ "as-child": i.asChild,
21
+ disabled: !c(f),
22
+ class: "ink-undo",
23
+ "data-ink-undo": ""
24
+ }, m), {
25
+ default: l(() => [s(e.$slots, "default", {}, () => [r(t, { icon: c(d) }, null, 8, ["icon"])])]),
26
+ _: 3
27
+ }, 16, ["as-child", "disabled"]));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { f as default };
32
+
33
+ //# sourceMappingURL=InkUndo.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InkUndo.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_mergeProps","_withCtx","_renderSlot","_createVNode","InkIcon","InkIcon_default","InkUndo_vue_vue_type_script_setup_true_lang_default","useHistory","attrs","undo","openBlock","createBlock","unref","ToolbarButton","mergeProps","__props","canUndo","withCtx","renderSlot","_ctx","createVNode","Undo2"],"sources":["../../src/components/InkUndo.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Undo2 } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useHistory } from '../composables/useHistory'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { canUndo, undo } = useHistory()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Undo',\n title: 'Undo',\n onClick: () => undo(),\n}\n</script>\n\n<template>\n <ToolbarButton\n :as-child=\"asChild\"\n :disabled=\"!canUndo\"\n class=\"ink-undo\"\n data-ink-undo\n v-bind=\"attrs\"\n >\n <slot><InkIcon :icon=\"Undo2\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;EASA,IAAM,EAAE,YAAS,YAASU,EAAW,GAE/BC,IAAQ;GACZ,cAAc;GACd,OAAO;GACP,eAAeC,EAAK;EACtB;oBAIEZ,EAAA,GAAAC,EAQgBC,EAAAc,CAAA,GARhBb,EAQgB;GAPb,YAAUe,EAAA;GACV,UAAQ,CAAGhB,EAAAiB,CAAA;GACZ,OAAM;GACN,iBAAA;EACQ,GAAAR,CAAK,GAAA;GAEb,SAAAP,QAAsC,CAAtCC,EAAsCiB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAhChB,EAAyBC,GAAA,EAAf,MAAML,EAAAsB,CAAA,EAAK,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InkZoomIn.js","names":["_sfc_main","InkZoomIn_vue_vue_type_script_setup_true_lang_default","InkZoomIn_default"],"sources":["../../src/components/InkZoomIn.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useZoom } from '../composables/useZoom'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { zoomIn } = useZoom()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Zoom in',\n title: 'Zoom in',\n onClick: () => zoomIn(),\n}\n</script>\n\n<template>\n <ToolbarButton :as-child=\"asChild\" class=\"ink-zoom-in\" data-ink-zoom-in v-bind=\"attrs\">\n <slot>+</slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"InkZoomIn.js","names":["_sfc_main","InkZoomIn_vue_vue_type_script_setup_true_lang_default","InkZoomIn_default"],"sources":["../../src/components/InkZoomIn.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ZoomIn } from '@inkbar/icons'\nimport { ToolbarButton } from 'reka-ui'\n\nimport { useZoom } from '../composables/useZoom'\n\nimport InkIcon from './InkIcon.vue'\n\nwithDefaults(defineProps<{ asChild?: boolean }>(), { asChild: false })\nconst { zoomIn } = useZoom()\n// Reka's typed props stop at its own; ARIA and listeners go through a bound object.\nconst attrs = {\n 'aria-label': 'Zoom in',\n title: 'Zoom in',\n onClick: () => zoomIn(),\n}\n</script>\n\n<template>\n <ToolbarButton :as-child=\"asChild\" class=\"ink-zoom-in\" data-ink-zoom-in v-bind=\"attrs\">\n <slot><InkIcon :icon=\"ZoomIn\" /></slot>\n </ToolbarButton>\n</template>\n"],"mappings":""}