@inkbar/vue 0.8.0 → 0.10.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 +70 -4
- package/dist/components/InkDownloadButton.js +7 -0
- package/dist/components/InkDownloadButton.js.map +1 -0
- package/dist/components/InkDownloadButton.vue.d.ts +21 -0
- package/dist/components/InkDownloadButton.vue.d.ts.map +1 -0
- package/dist/components/InkDownloadButton.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/InkDownloadButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkFindBar.js.map +1 -1
- package/dist/components/InkFindBar.vue.d.ts.map +1 -1
- package/dist/components/InkFindBar.vue_vue_type_script_setup_true_lang.js +48 -48
- package/dist/components/InkFindBar.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.map +1 -1
- package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js +67 -65
- package/dist/components/InkHighlightMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkPanel.js +7 -0
- package/dist/components/InkPanel.js.map +1 -0
- package/dist/components/InkPanel.vue.d.ts +21 -0
- package/dist/components/InkPanel.vue.d.ts.map +1 -0
- package/dist/components/InkPanel.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/InkPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkPrintButton.js +7 -0
- package/dist/components/InkPrintButton.js.map +1 -0
- package/dist/components/InkPrintButton.vue.d.ts +19 -0
- package/dist/components/InkPrintButton.vue.d.ts.map +1 -0
- package/dist/components/InkPrintButton.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/InkPrintButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkRecordList.js +7 -0
- package/dist/components/InkRecordList.js.map +1 -0
- package/dist/components/InkRecordList.vue.d.ts +35 -0
- package/dist/components/InkRecordList.vue.d.ts.map +1 -0
- package/dist/components/InkRecordList.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/InkRecordList.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkRoot.js.map +1 -1
- package/dist/components/InkRoot.vue.d.ts +48 -4
- package/dist/components/InkRoot.vue.d.ts.map +1 -1
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js +177 -164
- package/dist/components/InkRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkSearchResults.js +7 -0
- package/dist/components/InkSearchResults.js.map +1 -0
- package/dist/components/InkSearchResults.vue.d.ts +9 -0
- package/dist/components/InkSearchResults.vue.d.ts.map +1 -0
- package/dist/components/InkSearchResults.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/InkSearchResults.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkShapeMenu.js.map +1 -1
- package/dist/components/InkShapeMenu.vue.d.ts.map +1 -1
- package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js +58 -56
- package/dist/components/InkShapeMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkSidebar.js +7 -0
- package/dist/components/InkSidebar.js.map +1 -0
- package/dist/components/InkSidebar.vue.d.ts +34 -0
- package/dist/components/InkSidebar.vue.d.ts.map +1 -0
- package/dist/components/InkSidebar.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/components/InkSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkSignatureDialog.js.map +1 -1
- package/dist/components/InkSignatureDialog.vue.d.ts +3 -2
- package/dist/components/InkSignatureDialog.vue.d.ts.map +1 -1
- package/dist/components/InkSignatureDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkSignatureMenu.js.map +1 -1
- package/dist/components/InkSignatureMenu.vue.d.ts.map +1 -1
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js +77 -75
- package/dist/components/InkSignatureMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkThumbnail.js +7 -0
- package/dist/components/InkThumbnail.js.map +1 -0
- package/dist/components/InkThumbnail.vue.d.ts +18 -0
- package/dist/components/InkThumbnail.vue.d.ts.map +1 -0
- package/dist/components/InkThumbnail.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/InkThumbnail.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkThumbnails.js +7 -0
- package/dist/components/InkThumbnails.js.map +1 -0
- package/dist/components/InkThumbnails.vue.d.ts +27 -0
- package/dist/components/InkThumbnails.vue.d.ts.map +1 -0
- package/dist/components/InkThumbnails.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/InkThumbnails.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkToolButton.js.map +1 -1
- package/dist/components/InkToolButton.vue.d.ts.map +1 -1
- package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js +39 -36
- package/dist/components/InkToolButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkToolbarButton.js +7 -0
- package/dist/components/InkToolbarButton.js.map +1 -0
- package/dist/components/InkToolbarButton.vue.d.ts +22 -0
- package/dist/components/InkToolbarButton.vue.d.ts.map +1 -0
- package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/InkToolbarButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/InkViewport.js.map +1 -1
- package/dist/components/InkViewport.vue.d.ts.map +1 -1
- package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js +37 -36
- package/dist/components/InkViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/InkZoomSelect.js.map +1 -1
- package/dist/components/InkZoomSelect.vue.d.ts.map +1 -1
- package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/InkZoomSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/RecordCards.js +7 -0
- package/dist/components/RecordCards.js.map +1 -0
- package/dist/components/RecordCards.vue.d.ts +25 -0
- package/dist/components/RecordCards.vue.d.ts.map +1 -0
- package/dist/components/RecordCards.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/RecordCards.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/SidebarTrigger.js +7 -0
- package/dist/components/SidebarTrigger.js.map +1 -0
- package/dist/components/SidebarTrigger.vue.d.ts +9 -0
- package/dist/components/SidebarTrigger.vue.d.ts.map +1 -0
- package/dist/components/SidebarTrigger.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/SidebarTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/SignatureForm.js.map +1 -1
- package/dist/components/SignatureForm.vue.d.ts.map +1 -1
- package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/components/SignatureForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/sidebar-context.d.ts +21 -0
- package/dist/components/sidebar-context.d.ts.map +1 -0
- package/dist/components/sidebar-context.js +7 -0
- package/dist/components/sidebar-context.js.map +1 -0
- package/dist/composables/useAnnotations.d.ts +91 -0
- package/dist/composables/useAnnotations.d.ts.map +1 -1
- package/dist/composables/useRecordSelection.d.ts +12 -0
- package/dist/composables/useRecordSelection.d.ts.map +1 -0
- package/dist/composables/useRecordSelection.js +15 -0
- package/dist/composables/useRecordSelection.js.map +1 -0
- package/dist/composables/useRecords.d.ts +14 -0
- package/dist/composables/useRecords.d.ts.map +1 -0
- package/dist/composables/useRecords.js +16 -0
- package/dist/composables/useRecords.js.map +1 -0
- package/dist/composables/useRegisteredTool.d.ts +21 -0
- package/dist/composables/useRegisteredTool.d.ts.map +1 -0
- package/dist/composables/useRegisteredTool.js +25 -0
- package/dist/composables/useRegisteredTool.js.map +1 -0
- package/dist/composables/useSearch.d.ts.map +1 -1
- package/dist/composables/useSearch.js +1 -0
- package/dist/composables/useSearch.js.map +1 -1
- package/dist/composables/useToolOptions.d.ts +8 -0
- package/dist/composables/useToolOptions.d.ts.map +1 -1
- package/dist/composables/useToolOptions.js +10 -5
- package/dist/composables/useToolOptions.js.map +1 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -29
- package/dist/to-readable.d.ts +7 -0
- package/dist/to-readable.d.ts.map +1 -0
- package/dist/to-readable.js +11 -0
- package/dist/to-readable.js.map +1 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnnotations.d.ts","sourceRoot":"","sources":["../../src/composables/useAnnotations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEhF,wBAAgB,cAAc
|
|
1
|
+
{"version":3,"file":"useAnnotations.d.ts","sourceRoot":"","sources":["../../src/composables/useAnnotations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEhF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAC9B,MAAM;kBACL,MAAM,EAAE;IACtB,+CAA+C;kBACjC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The selected record under `key` (`<plugin>.<name>`): the one selection the marks and every
|
|
4
|
+
* record list over those records share. `select` takes an id, or null to clear; an id that has
|
|
5
|
+
* no mark changes nothing. Until InkRoot has mounted (and on the server) nothing is selected
|
|
6
|
+
* and `select` does nothing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useRecordSelection(key: string): {
|
|
9
|
+
selected: Readonly<Ref<string | null>>;
|
|
10
|
+
select: (id: string | null) => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useRecordSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecordSelection.d.ts","sourceRoot":"","sources":["../../src/composables/useRecordSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAKxC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG;IAC/C,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAA;IACtC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CACpC,CAOA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { useReadable as t } from "../use-readable.js";
|
|
3
|
+
import { computed as n } from "vue";
|
|
4
|
+
//#region src/composables/useRecordSelection.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { pluginHost: i } = e("useRecordSelection()"), a = n(() => i.value?.selection(r) ?? null);
|
|
7
|
+
return {
|
|
8
|
+
selected: t(() => a.value?.selected, null),
|
|
9
|
+
select: (e) => a.value?.select(e)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useRecordSelection };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=useRecordSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecordSelection.js","names":["useRecordSelection","useInkContext","selection","computed","pluginHost","key","useReadable","id"],"sources":["../../src/composables/useRecordSelection.ts"],"sourcesContent":["import { computed, type Ref } from 'vue'\n\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\n/**\n * The selected record under `key` (`<plugin>.<name>`): the one selection the marks and every\n * record list over those records share. `select` takes an id, or null to clear; an id that has\n * no mark changes nothing. Until InkRoot has mounted (and on the server) nothing is selected\n * and `select` does nothing.\n */\nexport function useRecordSelection(key: string): {\n selected: Readonly<Ref<string | null>>\n select: (id: string | null) => void\n} {\n const { pluginHost } = useInkContext('useRecordSelection()')\n const selection = computed(() => pluginHost.value?.selection(key) ?? null)\n return {\n selected: useReadable(() => selection.value?.selected, null),\n select: (id) => selection.value?.select(id),\n }\n}\n"],"mappings":";;;;AAWA,SAAgBA,EAAmB,GAGjC;CACA,IAAM,EAAE,kBAAeC,EAAc,sBAAsB,GACrDC,IAAYC,QAAeC,EAAW,OAAO,UAAUC,CAAG,KAAK,IAAI;CACzE,OAAO;EACL,UAAUC,QAAkBJ,EAAU,OAAO,UAAU,IAAI;EAC3D,SAAS,MAAOA,EAAU,OAAO,OAAOK,CAAE;CAC5C;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { RecordBase } from '@inkbar/core';
|
|
3
|
+
import { HostRecords } from '@inkbar/core/dom';
|
|
4
|
+
/**
|
|
5
|
+
* The records a plugin keeps under `key` (`<plugin>.<name>`), for host components: the live list
|
|
6
|
+
* for the open document, and the handle to read and write them, each write one undo step.
|
|
7
|
+
* Plugins are set up once InkRoot has mounted, so until then (and on the server) `handle` is
|
|
8
|
+
* null and `records` is empty. `T` is the plugin's record type.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRecords<T extends RecordBase>(key: string): {
|
|
11
|
+
records: Readonly<Ref<readonly T[]>>;
|
|
12
|
+
handle: ComputedRef<HostRecords<T> | null>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useRecords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecords.d.ts","sourceRoot":"","sources":["../../src/composables/useRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAK1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAC7C,GAAG,EAAE,MAAM,GACV;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;CAAE,CAItF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { useReadable as t } from "../use-readable.js";
|
|
3
|
+
import { computed as n } from "vue";
|
|
4
|
+
//#region src/composables/useRecords.ts
|
|
5
|
+
var r = Object.freeze([]);
|
|
6
|
+
function i(i) {
|
|
7
|
+
let { pluginHost: a } = e("useRecords()"), o = n(() => a.value?.records(i) ?? null);
|
|
8
|
+
return {
|
|
9
|
+
records: t(() => o.value?.list, r),
|
|
10
|
+
handle: o
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as useRecords };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useRecords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecords.js","names":["NONE","useRecords","useInkContext","handle","computed","pluginHost","key","useReadable"],"sources":["../../src/composables/useRecords.ts"],"sourcesContent":["import { computed, type ComputedRef, type Ref } from 'vue'\n\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { RecordBase } from '@inkbar/core'\nimport type { HostRecords } from '@inkbar/core/dom'\n\nconst NONE: readonly never[] = Object.freeze([])\n\n/**\n * The records a plugin keeps under `key` (`<plugin>.<name>`), for host components: the live list\n * for the open document, and the handle to read and write them, each write one undo step.\n * Plugins are set up once InkRoot has mounted, so until then (and on the server) `handle` is\n * null and `records` is empty. `T` is the plugin's record type.\n */\nexport function useRecords<T extends RecordBase>(\n key: string\n): { records: Readonly<Ref<readonly T[]>>; handle: ComputedRef<HostRecords<T> | null> } {\n const { pluginHost } = useInkContext('useRecords()')\n const handle = computed(() => pluginHost.value?.records<T>(key) ?? null)\n return { records: useReadable(() => handle.value?.list, NONE), handle }\n}\n"],"mappings":";;;;AAQA,IAAMA,IAAyB,OAAO,OAAO,CAAC,CAAC;AAQ/C,SAAgBC,EACd,GACsF;CACtF,IAAM,EAAE,kBAAeC,EAAc,cAAc,GAC7CC,IAASC,QAAeC,EAAW,OAAO,QAAWC,CAAG,KAAK,IAAI;CACvE,OAAO;EAAE,SAASC,QAAkBJ,EAAO,OAAO,MAAMH,CAAI;EAAG;CAAO;AACxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { InkContext } from '../context';
|
|
3
|
+
import { PluginHost, Tool, ToolId } from '@inkbar/core/dom';
|
|
4
|
+
/** `select-text` and `select`, then the host's tools, then the plugins' tools, by id. */
|
|
5
|
+
export declare function toolIdsOf(hostTools: readonly Tool[] | undefined, pluginHost: PluginHost | null): ToolId[];
|
|
6
|
+
/**
|
|
7
|
+
* The tools a control may use: those in `tools` and the plugins now that the open viewer was
|
|
8
|
+
* also built with, so a control never offers a tool the viewer would refuse. A tool added to
|
|
9
|
+
* `tools` counts from the next open; one removed stops at once. With no viewer, `tools` and
|
|
10
|
+
* the plugins alone.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registeredToolIds(hostTools: readonly Tool[] | undefined, pluginHost: PluginHost | null, opened: readonly ToolId[] | null): ToolId[];
|
|
13
|
+
/** Whether a tool by this id is registered, without logging anything when it is not. */
|
|
14
|
+
export declare function useHasTool(ctx: InkContext, id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a tool by this id is registered: always for `select-text` and `select`, else when
|
|
17
|
+
* InkRoot's `tools` or a plugin has it. When it is not, once the plugins are set up, this logs
|
|
18
|
+
* `InkError('UnknownTool')` to the console, once per component.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRegisteredTool(id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>>;
|
|
21
|
+
//# sourceMappingURL=useRegisteredTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegisteredTool.d.ts","sourceRoot":"","sources":["../../src/composables/useRegisteredTool.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAE/E,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEhE,yFAAyF;AACzF,wBAAgB,SAAS,CACvB,SAAS,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,EACtC,UAAU,EAAE,UAAU,GAAG,IAAI,GAC5B,MAAM,EAAE,CAIV;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,EACtC,UAAU,EAAE,UAAU,GAAG,IAAI,EAC7B,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAC/B,MAAM,EAAE,CAGV;AAKD,wFAAwF;AACxF,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAExB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAetF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useInkContext as e } from "../context.js";
|
|
2
|
+
import { computed as t, toValue as n, watch as r } from "vue";
|
|
3
|
+
import { unknownTool as i, withHostTools as a } from "@inkbar/core/dom";
|
|
4
|
+
//#region src/composables/useRegisteredTool.ts
|
|
5
|
+
function o(e, t) {
|
|
6
|
+
return a([...e ?? [], ...t?.tools ?? []]).map((e) => e.id);
|
|
7
|
+
}
|
|
8
|
+
function s(e, t, n) {
|
|
9
|
+
let r = o(e, t);
|
|
10
|
+
return n ? r.filter((e) => n.includes(e)) : r;
|
|
11
|
+
}
|
|
12
|
+
var c = (e) => s(e.hostTools.value, e.pluginHost.value, e.openedToolIds.value);
|
|
13
|
+
function l(e, r) {
|
|
14
|
+
return t(() => c(e).includes(n(r)));
|
|
15
|
+
}
|
|
16
|
+
function u(t) {
|
|
17
|
+
let a = e("useRegisteredTool()"), o = l(a, t), s = !1;
|
|
18
|
+
return r([() => a.pluginHost.value !== null, o], ([e, r]) => {
|
|
19
|
+
!e || r || s || (s = !0, console.error(i(n(t), c(a))));
|
|
20
|
+
}, { immediate: !0 }), o;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as registeredToolIds, o as toolIdsOf, l as useHasTool, u as useRegisteredTool };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useRegisteredTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegisteredTool.js","names":["toolIdsOf","withHostTools","hostTools","pluginHost","t","registeredToolIds","ids","opened","id","idsIn","ctx","useHasTool","computed","toValue","useRegisteredTool","useInkContext","registered","logged","watch","ready","ok","unknownTool"],"sources":["../../src/composables/useRegisteredTool.ts"],"sourcesContent":["import { unknownTool, withHostTools } from '@inkbar/core/dom'\nimport { computed, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'\n\nimport { useInkContext, type InkContext } from '../context'\n\nimport type { PluginHost, Tool, ToolId } from '@inkbar/core/dom'\n\n/** `select-text` and `select`, then the host's tools, then the plugins' tools, by id. */\nexport function toolIdsOf(\n hostTools: readonly Tool[] | undefined,\n pluginHost: PluginHost | null\n): ToolId[] {\n return withHostTools([...(hostTools ?? []), ...(pluginHost?.tools ?? [])]).map(\n (t) => t.id\n )\n}\n\n/**\n * The tools a control may use: those in `tools` and the plugins now that the open viewer was\n * also built with, so a control never offers a tool the viewer would refuse. A tool added to\n * `tools` counts from the next open; one removed stops at once. With no viewer, `tools` and\n * the plugins alone.\n */\nexport function registeredToolIds(\n hostTools: readonly Tool[] | undefined,\n pluginHost: PluginHost | null,\n opened: readonly ToolId[] | null\n): ToolId[] {\n const ids = toolIdsOf(hostTools, pluginHost)\n return opened ? ids.filter((id) => opened.includes(id)) : ids\n}\n\nconst idsIn = (ctx: InkContext): ToolId[] =>\n registeredToolIds(ctx.hostTools.value, ctx.pluginHost.value, ctx.openedToolIds.value)\n\n/** Whether a tool by this id is registered, without logging anything when it is not. */\nexport function useHasTool(\n ctx: InkContext,\n id: MaybeRefOrGetter<ToolId>\n): Readonly<Ref<boolean>> {\n return computed(() => idsIn(ctx).includes(toValue(id)))\n}\n\n/**\n * Whether a tool by this id is registered: always for `select-text` and `select`, else when\n * InkRoot's `tools` or a plugin has it. When it is not, once the plugins are set up, this logs\n * `InkError('UnknownTool')` to the console, once per component.\n */\nexport function useRegisteredTool(id: MaybeRefOrGetter<ToolId>): Readonly<Ref<boolean>> {\n const ctx = useInkContext('useRegisteredTool()')\n const registered = useHasTool(ctx, id)\n let logged = false\n // The plugins' tools are known once InkRoot has mounted and set up its plugin host.\n watch(\n [() => ctx.pluginHost.value !== null, registered],\n ([ready, ok]) => {\n if (!ready || ok || logged) return\n logged = true\n console.error(unknownTool(toValue(id), idsIn(ctx)))\n },\n { immediate: true }\n )\n return registered\n}\n"],"mappings":";;;;AAQA,SAAgBA,EACd,GACA,GACU;CACV,OAAOC,EAAc,CAAC,GAAIC,KAAa,CAAC,GAAI,GAAIC,GAAY,SAAS,CAAC,CAAE,CAAC,CAAC,CAAC,KACxE,MAAMC,EAAE,EACX;AACF;AAQA,SAAgBC,EACd,GACA,GACA,GACU;CACV,IAAMC,IAAMN,EAAUE,GAAWC,CAAU;CAC3C,OAAOI,IAASD,EAAI,QAAQ,MAAOC,EAAO,SAASC,CAAE,CAAC,IAAIF;AAC5D;AAEA,IAAMG,KAAS,MACbJ,EAAkBK,EAAI,UAAU,OAAOA,EAAI,WAAW,OAAOA,EAAI,cAAc,KAAK;AAGtF,SAAgBC,EACd,GACA,GACwB;CACxB,OAAOC,QAAeH,EAAMC,CAAG,CAAC,CAAC,SAASG,EAAQL,CAAE,CAAC,CAAC;AACxD;AAOA,SAAgBM,EAAkB,GAAsD;CACtF,IAAMJ,IAAMK,EAAc,qBAAqB,GACzCC,IAAaL,EAAWD,GAAKF,CAAE,GACjCS,IAAS;CAWb,OATAC,EACE,OAAOR,EAAI,WAAW,UAAU,MAAMM,CAAU,IAC/C,CAACG,GAAOC,OAAQ;EACf,AAAI,CAACD,KAASC,KAAMH,MACpB,IAAS,IACT,QAAQ,MAAMI,EAAYR,EAAQL,CAAE,GAAGC,EAAMC,CAAG,CAAC,CAAC;CACpD,GACA,EAAE,WAAW,GAAK,CACpB,GACOM;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../src/composables/useSearch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAW9B;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI;IAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,GAAG,IAAI,CACvE,YAAY,EACZ,OAAO,CACR,
|
|
1
|
+
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../src/composables/useSearch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAW9B;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI;IAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,GAAG,IAAI,CACvE,YAAY,EACZ,OAAO,CACR,CAYA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","names":["CLOSED","useSearch","search","useInkContext","useReadable","query","on"],"sources":["../../src/composables/useSearch.ts"],"sourcesContent":["import { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { SearchState, ViewerSearch } from '@inkbar/core/dom'\nimport type { Ref } from 'vue'\n\nconst CLOSED: SearchState = {\n open: false,\n query: '',\n matchCase: false,\n hits: [],\n current: -1,\n scanning: false,\n}\n\n/**\n * The document search for hosts building their own control: the state, and the actions the\n * find bar uses. Search is set up once InkRoot has mounted, so until then (and on the server)\n * the state is closed and the actions do nothing. `open()` runs the search and draws the\n * highlights even when no find bar is mounted.\n */\nexport function useSearch(): { state: Readonly<Ref<SearchState>> } & Omit<\n ViewerSearch,\n 'state'\n> {\n const search = useInkContext('useSearch()').search\n return {\n state: useReadable(() => search.value?.state, CLOSED),\n open: (query) => search.value?.open(query),\n setQuery: (query) => search.value?.setQuery(query),\n setMatchCase: (on) => search.value?.setMatchCase(on),\n next: () => search.value?.next(),\n previous: () => search.value?.previous(),\n close: () => search.value?.close(),\n }\n}\n"],"mappings":";;;AAMA,IAAMA,IAAsB;CAC1B,MAAM;CACN,OAAO;CACP,WAAW;CACX,MAAM,CAAC;CACP,SAAS;CACT,UAAU;AACZ;AAQA,SAAgBC,IAGd;CACA,IAAMC,IAASC,EAAc,aAAa,CAAC,CAAC;CAC5C,OAAO;EACL,OAAOC,QAAkBF,EAAO,OAAO,OAAOF,CAAM;EACpD,OAAO,MAAUE,EAAO,OAAO,KAAKG,CAAK;EACzC,WAAW,MAAUH,EAAO,OAAO,SAASG,CAAK;EACjD,eAAe,MAAOH,EAAO,OAAO,aAAaI,CAAE;EACnD,YAAYJ,EAAO,OAAO,KAAK;EAC/B,gBAAgBA,EAAO,OAAO,SAAS;EACvC,
|
|
1
|
+
{"version":3,"file":"useSearch.js","names":["CLOSED","useSearch","search","useInkContext","useReadable","query","on","index"],"sources":["../../src/composables/useSearch.ts"],"sourcesContent":["import { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { SearchState, ViewerSearch } from '@inkbar/core/dom'\nimport type { Ref } from 'vue'\n\nconst CLOSED: SearchState = {\n open: false,\n query: '',\n matchCase: false,\n hits: [],\n current: -1,\n scanning: false,\n}\n\n/**\n * The document search for hosts building their own control: the state, and the actions the\n * find bar uses. Search is set up once InkRoot has mounted, so until then (and on the server)\n * the state is closed and the actions do nothing. `open()` runs the search and draws the\n * highlights even when no find bar is mounted.\n */\nexport function useSearch(): { state: Readonly<Ref<SearchState>> } & Omit<\n ViewerSearch,\n 'state'\n> {\n const search = useInkContext('useSearch()').search\n return {\n state: useReadable(() => search.value?.state, CLOSED),\n open: (query) => search.value?.open(query),\n setQuery: (query) => search.value?.setQuery(query),\n setMatchCase: (on) => search.value?.setMatchCase(on),\n next: () => search.value?.next(),\n previous: () => search.value?.previous(),\n select: (index) => search.value?.select(index),\n close: () => search.value?.close(),\n }\n}\n"],"mappings":";;;AAMA,IAAMA,IAAsB;CAC1B,MAAM;CACN,OAAO;CACP,WAAW;CACX,MAAM,CAAC;CACP,SAAS;CACT,UAAU;AACZ;AAQA,SAAgBC,IAGd;CACA,IAAMC,IAASC,EAAc,aAAa,CAAC,CAAC;CAC5C,OAAO;EACL,OAAOC,QAAkBF,EAAO,OAAO,OAAOF,CAAM;EACpD,OAAO,MAAUE,EAAO,OAAO,KAAKG,CAAK;EACzC,WAAW,MAAUH,EAAO,OAAO,SAASG,CAAK;EACjD,eAAe,MAAOH,EAAO,OAAO,aAAaI,CAAE;EACnD,YAAYJ,EAAO,OAAO,KAAK;EAC/B,gBAAgBA,EAAO,OAAO,SAAS;EACvC,SAAS,MAAUA,EAAO,OAAO,OAAOK,CAAK;EAC7C,aAAaL,EAAO,OAAO,MAAM;CACnC;AACF"}
|
|
@@ -8,4 +8,12 @@ export declare function useToolOptions<O extends object = object>(id: MaybeRefOr
|
|
|
8
8
|
options: Readonly<Ref<O>>;
|
|
9
9
|
setOptions: (patch: Partial<O>) => void;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* `useToolOptions` that reads and sets nothing while `active` is false, so a control for a
|
|
13
|
+
* missing tool leaves the controller's own `UnknownTool` log alone.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useToolOptionsWhile<O extends object = object>(id: MaybeRefOrGetter<ToolId>, active: MaybeRefOrGetter<boolean>): {
|
|
16
|
+
options: Readonly<Ref<O>>;
|
|
17
|
+
setOptions: (patch: Partial<O>) => void;
|
|
18
|
+
};
|
|
11
19
|
//# sourceMappingURL=useToolOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useToolOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"useToolOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useToolOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3B;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,CAExE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC3D,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAChC;IAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,CAYxE"}
|
|
@@ -3,14 +3,19 @@ import { useReadable as t } from "../use-readable.js";
|
|
|
3
3
|
import { toValue as n } from "vue";
|
|
4
4
|
//#region src/composables/useToolOptions.ts
|
|
5
5
|
var r = {};
|
|
6
|
-
function i(
|
|
7
|
-
|
|
6
|
+
function i(e) {
|
|
7
|
+
return a(e, !0);
|
|
8
|
+
}
|
|
9
|
+
function a(i, a) {
|
|
10
|
+
let o = e("useToolOptions()");
|
|
8
11
|
return {
|
|
9
|
-
options: t(() => a.tools.value?.options(n(i)), r),
|
|
10
|
-
setOptions: (e) =>
|
|
12
|
+
options: t(() => n(a) ? o.tools.value?.options(n(i)) : null, r),
|
|
13
|
+
setOptions: (e) => {
|
|
14
|
+
n(a) && o.tools.value?.setOptions(n(i), e);
|
|
15
|
+
}
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
//#endregion
|
|
14
|
-
export { i as useToolOptions };
|
|
19
|
+
export { i as useToolOptions, a as useToolOptionsWhile };
|
|
15
20
|
|
|
16
21
|
//# sourceMappingURL=useToolOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolOptions.js","names":["NO_OPTIONS","useToolOptions","ctx","useInkContext","useReadable","toValue","
|
|
1
|
+
{"version":3,"file":"useToolOptions.js","names":["NO_OPTIONS","useToolOptions","useToolOptionsWhile","id","ctx","useInkContext","useReadable","toValue","active","patch"],"sources":["../../src/composables/useToolOptions.ts"],"sourcesContent":["import { toValue, type MaybeRefOrGetter, type Ref } from 'vue'\n\nimport { useInkContext } from '../context'\nimport { useReadable } from '../use-readable'\n\nimport type { ToolId } from '@inkbar/core/dom'\n\nconst NO_OPTIONS: object = {}\n\n/**\n * A tool's options and a setter that merges a patch into them without switching tools.\n * Options are empty, and the setter does nothing, until the viewport has mounted.\n */\nexport function useToolOptions<O extends object = object>(\n id: MaybeRefOrGetter<ToolId>\n): { options: Readonly<Ref<O>>; setOptions: (patch: Partial<O>) => void } {\n return useToolOptionsWhile<O>(id, true)\n}\n\n/**\n * `useToolOptions` that reads and sets nothing while `active` is false, so a control for a\n * missing tool leaves the controller's own `UnknownTool` log alone.\n */\nexport function useToolOptionsWhile<O extends object = object>(\n id: MaybeRefOrGetter<ToolId>,\n active: MaybeRefOrGetter<boolean>\n): { options: Readonly<Ref<O>>; setOptions: (patch: Partial<O>) => void } {\n const ctx = useInkContext('useToolOptions()')\n const options = useReadable(\n () => (toValue(active) ? ctx.tools.value?.options(toValue(id)) : null),\n NO_OPTIONS\n ) as Readonly<Ref<O>>\n return {\n options,\n setOptions: (patch) => {\n if (toValue(active)) ctx.tools.value?.setOptions(toValue(id), patch)\n },\n }\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAqB,CAAC;AAM5B,SAAgBC,EACd,GACwE;CACxE,OAAOC,EAAuBC,GAAI,EAAI;AACxC;AAMA,SAAgBD,EACd,GACA,GACwE;CACxE,IAAME,IAAMC,EAAc,kBAAkB;CAK5C,OAAO;EACL,SALcC,QACPC,EAAQC,CAAM,IAAIJ,EAAI,MAAM,OAAO,QAAQG,EAAQJ,CAAE,CAAC,IAAI,MACjEH,CAGA;EACA,aAAa,MAAU;GACrB,AAAIO,EAAQC,CAAM,KAAGJ,EAAI,MAAM,OAAO,WAAWG,EAAQJ,CAAE,GAAGM,CAAK;EACrE;CACF;AACF"}
|
package/dist/context.d.ts
CHANGED
|
@@ -49,6 +49,11 @@ export interface InkContext {
|
|
|
49
49
|
setTool(id: ToolId): void;
|
|
50
50
|
/** Host tools from InkRoot's `tools` prop; InkViewport registers them. */
|
|
51
51
|
hostTools: Readonly<Ref<Tool[] | undefined>>;
|
|
52
|
+
/**
|
|
53
|
+
* The ids of the tools the current viewer was built with, set by InkViewport; `null` while
|
|
54
|
+
* there is none. A tool added to `tools` later is registered from the next build.
|
|
55
|
+
*/
|
|
56
|
+
openedToolIds: ShallowRef<readonly ToolId[] | null>;
|
|
52
57
|
/** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */
|
|
53
58
|
decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>;
|
|
54
59
|
/** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,cAAc,EACd,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAE1C,YAAY,EAAE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,GAAG,IAAI,CAAA;IAC1C,2FAA2F;IAC3F,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;CACnC;AAED,eAAO,MAAO,gBAAgB,uIAAE,iBAAiB,0CAAwC,CAAA;AAEzF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAO1D"}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["injectInkContext","provideInkContext","createContext","useInkContext","ctx","getCurrentInstance","consumer"],"sources":["../src/context.ts"],"sourcesContent":["import { createContext } from 'reka-ui'\nimport { getCurrentInstance } from 'vue'\n\nimport type {\n Annotation,\n FormAction,\n InkDocument,\n InkError,\n InkStatus,\n PdfAssets,\n PluginHistory,\n SignatureLibrary,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n PluginHost,\n SearchController,\n Tool,\n ToolController,\n ToolId,\n ToolOptions,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\nimport type { Ref, ShallowRef } from 'vue'\n\nexport type { InkStatus }\n\n/**\n * Undo and redo for the current document, whichever mode its annotations are in. `track` and\n * `react` (from `PluginHistory`) reach the same history, so plugin stores undo with the edits.\n */\nexport interface InkHistory extends PluginHistory {\n canUndo: Readonly<Ref<boolean>>\n canRedo: Readonly<Ref<boolean>>\n undo: () => void\n redo: () => void\n clear: () => void\n /**\n * Runs `fn` and records what it changes as one undo step. The host still receives one change\n * per add. Controlled, the history groups the resulting list changes into one step, and\n * `canUndo` updates once the current task ends. Any other change the host applies in that\n * same window joins the step.\n */\n batch: (fn: () => void) => void\n}\n\nexport interface InkContext {\n assets: Readonly<Ref<PdfAssets>>\n document: Readonly<ShallowRef<InkDocument | null>>\n /** `loading` from the moment a document starts opening, then the document's own status. */\n status: Readonly<Ref<InkStatus>>\n annotations: Readonly<Ref<readonly Annotation[]>>\n selection: Readonly<Ref<readonly string[]>>\n /**\n * The plugins from InkRoot's `plugins` prop, set up once the root has mounted and kept for\n * its life; `null` before that (and on the server) and once it unmounts. InkViewport hands it\n * to the engine; InkCommand places its commands.\n */\n pluginHost: Readonly<ShallowRef<PluginHost | null>>\n /**\n * The search controller from the same set-up as `pluginHost`: shared by the find bar, the\n * search button, the engine's highlights and the plugins. `null` until the root has mounted\n * (and on the server) and once it unmounts.\n */\n search: Readonly<ShallowRef<SearchController | null>>\n /** InkViewport's scroll element while it is mounted: the plugins' `root`. */\n viewportEl: ShallowRef<HTMLElement | null>\n /** Set by InkViewport once it has mounted its viewport and tool controller. */\n viewport: ShallowRef<Viewport | null>\n tools: ShallowRef<ToolController | null>\n /** Desired tool; InkViewport applies it to the controller. */\n tool: Readonly<Ref<ToolId>>\n setTool(id: ToolId): void\n /** Host tools from InkRoot's `tools` prop; InkViewport registers them. */\n hostTools: Readonly<Ref<Tool[] | undefined>>\n /** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */\n decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>\n /** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */\n fonts: Readonly<Ref<readonly string[]>>\n /** The tools' options for InkRoot's life, so they persist across documents. */\n toolOptions: ToolOptions\n /** The saved signatures, from InkRoot's `signatures` store (memory by default). */\n signatures: Readonly<ShallowRef<SignatureLibrary>>\n /** The fonts a typed signature offers: InkRoot's `signatureFonts`, else `SIGNATURE_FONTS`. */\n signatureFonts: Readonly<Ref<readonly string[]>>\n /** The open document's tool style; `null` while no document is open. */\n toolStyle: Readonly<ShallowRef<ToolStyle | null>>\n /** Desired zoom and page from the host's v-models; InkViewport applies and reports back. */\n zoomModel: Readonly<Ref<ZoomValue | undefined>>\n pageModel: Readonly<Ref<number | undefined>>\n reportZoom(z: ZoomValue): void\n reportPage(p: number): void\n /** Last activated annotation (Enter, click with the note tool, etc.). Popovers key off this. */\n activated: Readonly<Ref<string | null>>\n /**\n * Activates annotation `id`, or clears the activation with `null`. This is the context's\n * own: unlike core's `Viewer.setActivated`, it emits InkRoot's `activate` for an id, and it\n * does not check that the id is in the document.\n */\n setActivated(id: string | null): void\n history: InkHistory\n rootEl: Readonly<Ref<HTMLElement | null>>\n /** InkRoot's `formHighlight`; InkViewport reads it when it builds the viewer. */\n formHighlight: Readonly<Ref<boolean | undefined>>\n /** Emits InkRoot's `form-action`. */\n reportFormAction(action: FormAction): void\n /** Emits InkRoot's `error`, for failures after the document opened (a refused signing). */\n reportError(error: InkError): void\n}\n\nexport const [injectInkContext, provideInkContext] = createContext<InkContext>('InkRoot')\n\n/**\n * The context for composables: throws a readable error when called outside a component\n * rendered inside `InkRoot`, instead of Vue's injection warning.\n */\nexport function useInkContext(consumer: string): InkContext {\n const ctx = getCurrentInstance() ? injectInkContext(null) : null\n if (!ctx)\n throw new Error(\n `[inkbar] ${consumer} must be called in a component inside <InkRoot>.`\n )\n return ctx\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"context.js","names":["injectInkContext","provideInkContext","createContext","useInkContext","ctx","getCurrentInstance","consumer"],"sources":["../src/context.ts"],"sourcesContent":["import { createContext } from 'reka-ui'\nimport { getCurrentInstance } from 'vue'\n\nimport type {\n Annotation,\n FormAction,\n InkDocument,\n InkError,\n InkStatus,\n PdfAssets,\n PluginHistory,\n SignatureLibrary,\n} from '@inkbar/core'\nimport type {\n DecorateAnnotation,\n PluginHost,\n SearchController,\n Tool,\n ToolController,\n ToolId,\n ToolOptions,\n ToolStyle,\n Viewport,\n ZoomValue,\n} from '@inkbar/core/dom'\nimport type { Ref, ShallowRef } from 'vue'\n\nexport type { InkStatus }\n\n/**\n * Undo and redo for the current document, whichever mode its annotations are in. `track` and\n * `react` (from `PluginHistory`) reach the same history, so plugin stores undo with the edits.\n */\nexport interface InkHistory extends PluginHistory {\n canUndo: Readonly<Ref<boolean>>\n canRedo: Readonly<Ref<boolean>>\n undo: () => void\n redo: () => void\n clear: () => void\n /**\n * Runs `fn` and records what it changes as one undo step. The host still receives one change\n * per add. Controlled, the history groups the resulting list changes into one step, and\n * `canUndo` updates once the current task ends. Any other change the host applies in that\n * same window joins the step.\n */\n batch: (fn: () => void) => void\n}\n\nexport interface InkContext {\n assets: Readonly<Ref<PdfAssets>>\n document: Readonly<ShallowRef<InkDocument | null>>\n /** `loading` from the moment a document starts opening, then the document's own status. */\n status: Readonly<Ref<InkStatus>>\n annotations: Readonly<Ref<readonly Annotation[]>>\n selection: Readonly<Ref<readonly string[]>>\n /**\n * The plugins from InkRoot's `plugins` prop, set up once the root has mounted and kept for\n * its life; `null` before that (and on the server) and once it unmounts. InkViewport hands it\n * to the engine; InkCommand places its commands.\n */\n pluginHost: Readonly<ShallowRef<PluginHost | null>>\n /**\n * The search controller from the same set-up as `pluginHost`: shared by the find bar, the\n * search button, the engine's highlights and the plugins. `null` until the root has mounted\n * (and on the server) and once it unmounts.\n */\n search: Readonly<ShallowRef<SearchController | null>>\n /** InkViewport's scroll element while it is mounted: the plugins' `root`. */\n viewportEl: ShallowRef<HTMLElement | null>\n /** Set by InkViewport once it has mounted its viewport and tool controller. */\n viewport: ShallowRef<Viewport | null>\n tools: ShallowRef<ToolController | null>\n /** Desired tool; InkViewport applies it to the controller. */\n tool: Readonly<Ref<ToolId>>\n setTool(id: ToolId): void\n /** Host tools from InkRoot's `tools` prop; InkViewport registers them. */\n hostTools: Readonly<Ref<Tool[] | undefined>>\n /**\n * The ids of the tools the current viewer was built with, set by InkViewport; `null` while\n * there is none. A tool added to `tools` later is registered from the next build.\n */\n openedToolIds: ShallowRef<readonly ToolId[] | null>\n /** InkRoot's `decorateAnnotation` prop. InkViewport re-applies decorations when it changes. */\n decorateAnnotation: Readonly<Ref<DecorateAnnotation | undefined>>\n /** The font families text boxes offer: InkRoot's `fonts`, else `FONT_FAMILIES`. */\n fonts: Readonly<Ref<readonly string[]>>\n /** The tools' options for InkRoot's life, so they persist across documents. */\n toolOptions: ToolOptions\n /** The saved signatures, from InkRoot's `signatures` store (memory by default). */\n signatures: Readonly<ShallowRef<SignatureLibrary>>\n /** The fonts a typed signature offers: InkRoot's `signatureFonts`, else `SIGNATURE_FONTS`. */\n signatureFonts: Readonly<Ref<readonly string[]>>\n /** The open document's tool style; `null` while no document is open. */\n toolStyle: Readonly<ShallowRef<ToolStyle | null>>\n /** Desired zoom and page from the host's v-models; InkViewport applies and reports back. */\n zoomModel: Readonly<Ref<ZoomValue | undefined>>\n pageModel: Readonly<Ref<number | undefined>>\n reportZoom(z: ZoomValue): void\n reportPage(p: number): void\n /** Last activated annotation (Enter, click with the note tool, etc.). Popovers key off this. */\n activated: Readonly<Ref<string | null>>\n /**\n * Activates annotation `id`, or clears the activation with `null`. This is the context's\n * own: unlike core's `Viewer.setActivated`, it emits InkRoot's `activate` for an id, and it\n * does not check that the id is in the document.\n */\n setActivated(id: string | null): void\n history: InkHistory\n rootEl: Readonly<Ref<HTMLElement | null>>\n /** InkRoot's `formHighlight`; InkViewport reads it when it builds the viewer. */\n formHighlight: Readonly<Ref<boolean | undefined>>\n /** Emits InkRoot's `form-action`. */\n reportFormAction(action: FormAction): void\n /** Emits InkRoot's `error`, for failures after the document opened (a refused signing). */\n reportError(error: InkError): void\n}\n\nexport const [injectInkContext, provideInkContext] = createContext<InkContext>('InkRoot')\n\n/**\n * The context for composables: throws a readable error when called outside a component\n * rendered inside `InkRoot`, instead of Vue's injection warning.\n */\nexport function useInkContext(consumer: string): InkContext {\n const ctx = getCurrentInstance() ? injectInkContext(null) : null\n if (!ctx)\n throw new Error(\n `[inkbar] ${consumer} must be called in a component inside <InkRoot>.`\n )\n return ctx\n}\n"],"mappings":";;;AAqHA,IAAa,CAACA,GAAkBC,KAAqBC,EAA0B,SAAS;AAMxF,SAAgBC,EAAc,GAA8B;CAC1D,IAAMC,IAAMC,EAAmB,IAAIL,EAAiB,IAAI,IAAI;CAC5D,IAAI,CAACI,GACH,MAAU,MACR,YAAYE,EAAS,iDACvB;CACF,OAAOF;AACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export { useHistory } from './composables/useHistory';
|
|
|
16
16
|
export { useEmbedded } from './composables/useEmbedded';
|
|
17
17
|
export { useSearch } from './composables/useSearch';
|
|
18
18
|
export { useCommand } from './composables/useCommand';
|
|
19
|
+
export { useRecords } from './composables/useRecords';
|
|
20
|
+
export { useRecordSelection } from './composables/useRecordSelection';
|
|
19
21
|
export { useForm } from './composables/useForm';
|
|
20
22
|
export type { FormHandle } from './composables/useForm';
|
|
21
23
|
export type { CommandHandle } from './composables/useCommand';
|
|
@@ -27,8 +29,11 @@ export { default as InkToolbar } from './components/InkToolbar.vue';
|
|
|
27
29
|
export { default as InkIcon } from './components/InkIcon.vue';
|
|
28
30
|
export { default as InkToolButton } from './components/InkToolButton.vue';
|
|
29
31
|
export { default as InkCommand } from './components/InkCommand.vue';
|
|
32
|
+
export { default as InkToolbarButton } from './components/InkToolbarButton.vue';
|
|
30
33
|
export { default as InkToolbarSeparator } from './components/InkToolbarSeparator.vue';
|
|
31
34
|
export { default as InkUndo } from './components/InkUndo.vue';
|
|
35
|
+
export { default as InkDownloadButton } from './components/InkDownloadButton.vue';
|
|
36
|
+
export { default as InkPrintButton } from './components/InkPrintButton.vue';
|
|
32
37
|
export { default as InkRedo } from './components/InkRedo.vue';
|
|
33
38
|
export { default as InkColorMenu } from './components/InkColorMenu.vue';
|
|
34
39
|
export { default as InkShapeMenu } from './components/InkShapeMenu.vue';
|
|
@@ -48,4 +53,11 @@ export { default as InkThreadPopover } from './components/InkThreadPopover.vue';
|
|
|
48
53
|
export type { ThreadPopoverSlotProps } from './components/InkThreadPopover.vue';
|
|
49
54
|
export { default as InkSearchButton } from './components/InkSearchButton.vue';
|
|
50
55
|
export { default as InkFindBar } from './components/InkFindBar.vue';
|
|
56
|
+
export { default as InkSidebar } from './components/InkSidebar.vue';
|
|
57
|
+
export { default as InkPanel } from './components/InkPanel.vue';
|
|
58
|
+
export { default as InkThumbnail } from './components/InkThumbnail.vue';
|
|
59
|
+
export { default as InkThumbnails } from './components/InkThumbnails.vue';
|
|
60
|
+
export { default as InkRecordList } from './components/InkRecordList.vue';
|
|
61
|
+
export { default as InkSearchResults } from './components/InkSearchResults.vue';
|
|
62
|
+
export type { CardSpec, HostRecords, SidebarLayout, SidebarOpen, SidebarSide, } from '@inkbar/core/dom';
|
|
51
63
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAClE,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,GACV,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2B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AAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,YAAY,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -13,32 +13,43 @@ import { useHistory as d } from "./composables/useHistory.js";
|
|
|
13
13
|
import { useEmbedded as f } from "./composables/useEmbedded.js";
|
|
14
14
|
import { useSearch as p } from "./composables/useSearch.js";
|
|
15
15
|
import { useCommand as m } from "./composables/useCommand.js";
|
|
16
|
-
import {
|
|
17
|
-
import g from "./
|
|
18
|
-
import _ from "./
|
|
19
|
-
import v from "./components/
|
|
20
|
-
import y from "./components/
|
|
21
|
-
import b from "./components/
|
|
22
|
-
import x from "./components/
|
|
23
|
-
import S from "./components/
|
|
24
|
-
import C from "./components/
|
|
25
|
-
import w from "./components/
|
|
26
|
-
import T from "./components/
|
|
27
|
-
import E from "./components/
|
|
28
|
-
import D from "./components/
|
|
29
|
-
import O from "./components/
|
|
30
|
-
import k from "./components/
|
|
31
|
-
import A from "./components/
|
|
32
|
-
import j from "./components/
|
|
33
|
-
import M from "./components/
|
|
34
|
-
import N from "./components/
|
|
35
|
-
import P from "./components/
|
|
36
|
-
import F from "./components/
|
|
37
|
-
import I from "./components/
|
|
38
|
-
import L from "./components/
|
|
39
|
-
import R from "./components/
|
|
40
|
-
import z from "./components/
|
|
41
|
-
import B from "./components/
|
|
42
|
-
import V from "./components/
|
|
43
|
-
import H from "./components/
|
|
44
|
-
|
|
16
|
+
import { useRecords as h } from "./composables/useRecords.js";
|
|
17
|
+
import { useRecordSelection as g } from "./composables/useRecordSelection.js";
|
|
18
|
+
import { useForm as _ } from "./composables/useForm.js";
|
|
19
|
+
import v from "./components/InkAnnotation.js";
|
|
20
|
+
import y from "./components/InkPage.js";
|
|
21
|
+
import b from "./components/InkSignatureDialog.js";
|
|
22
|
+
import x from "./components/InkIcon.js";
|
|
23
|
+
import S from "./components/InkViewport.js";
|
|
24
|
+
import C from "./components/InkToolbar.js";
|
|
25
|
+
import w from "./components/InkToolButton.js";
|
|
26
|
+
import T from "./components/InkCommand.js";
|
|
27
|
+
import E from "./components/InkToolbarButton.js";
|
|
28
|
+
import D from "./components/InkToolbarSeparator.js";
|
|
29
|
+
import O from "./components/InkUndo.js";
|
|
30
|
+
import k from "./components/InkDownloadButton.js";
|
|
31
|
+
import A from "./components/InkPrintButton.js";
|
|
32
|
+
import j from "./components/InkRedo.js";
|
|
33
|
+
import M from "./components/InkColorMenu.js";
|
|
34
|
+
import N from "./components/InkShapeMenu.js";
|
|
35
|
+
import P from "./components/InkSignatureMenu.js";
|
|
36
|
+
import F from "./components/InkHighlightMenu.js";
|
|
37
|
+
import I from "./components/InkLineStyleMenu.js";
|
|
38
|
+
import L from "./components/InkTextStyleMenu.js";
|
|
39
|
+
import R from "./components/InkZoomIn.js";
|
|
40
|
+
import z from "./components/InkZoomOut.js";
|
|
41
|
+
import B from "./components/InkZoomSelect.js";
|
|
42
|
+
import V from "./components/InkPageInput.js";
|
|
43
|
+
import H from "./components/InkPageCount.js";
|
|
44
|
+
import U from "./components/InkPrevPage.js";
|
|
45
|
+
import W from "./components/InkNextPage.js";
|
|
46
|
+
import G from "./components/InkThreadPopover.js";
|
|
47
|
+
import K from "./components/InkSearchButton.js";
|
|
48
|
+
import q from "./components/InkFindBar.js";
|
|
49
|
+
import J from "./components/InkSidebar.js";
|
|
50
|
+
import Y from "./components/InkPanel.js";
|
|
51
|
+
import X from "./components/InkThumbnail.js";
|
|
52
|
+
import Z from "./components/InkThumbnails.js";
|
|
53
|
+
import Q from "./components/InkRecordList.js";
|
|
54
|
+
import $ from "./components/InkSearchResults.js";
|
|
55
|
+
export { v as InkAnnotation, M as InkColorMenu, T as InkCommand, k as InkDownloadButton, q as InkFindBar, F as InkHighlightMenu, x as InkIcon, I as InkLineStyleMenu, W as InkNextPage, y as InkPage, H as InkPageCount, V as InkPageInput, Y as InkPanel, U as InkPrevPage, A as InkPrintButton, Q as InkRecordList, j as InkRedo, n as InkRoot, K as InkSearchButton, $ as InkSearchResults, N as InkShapeMenu, J as InkSidebar, b as InkSignatureDialog, P as InkSignatureMenu, L as InkTextStyleMenu, G as InkThreadPopover, X as InkThumbnail, Z as InkThumbnails, w as InkToolButton, C as InkToolbar, E as InkToolbarButton, D as InkToolbarSeparator, O as InkUndo, S as InkViewport, R as InkZoomIn, z as InkZoomOut, B as InkZoomSelect, e as injectInkContext, i as useAnnotations, m as useCommand, r as useDocument, f as useEmbedded, _ as useForm, d as useHistory, u as usePage, t as useReadable, g as useRecordSelection, h as useRecords, p as useSearch, c as useSelection, a as useTool, s as useToolOptions, o as useToolStyle, l as useZoom };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Readable } from '@inkbar/core';
|
|
2
|
+
/**
|
|
3
|
+
* A core `Readable` that follows a Vue source, for the core controllers and painters that
|
|
4
|
+
* components build on. Call it in `setup`: it stops following with the component.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toReadable<T>(source: () => T): Readable<T>;
|
|
7
|
+
//# sourceMappingURL=to-readable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-readable.d.ts","sourceRoot":"","sources":["../src/to-readable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGhE;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAI1D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { watch as e } from "vue";
|
|
2
|
+
import { readonly as t, writable as n } from "@inkbar/core";
|
|
3
|
+
//#region src/to-readable.ts
|
|
4
|
+
function r(r) {
|
|
5
|
+
let i = n(r());
|
|
6
|
+
return e(r, (e) => i.set(e), { flush: "sync" }), t(i);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { r as toReadable };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=to-readable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-readable.js","names":["toReadable","store","writable","source","watch","value","readonly"],"sources":["../src/to-readable.ts"],"sourcesContent":["import { readonly, writable, type Readable } from '@inkbar/core'\nimport { watch } from 'vue'\n\n/**\n * A core `Readable` that follows a Vue source, for the core controllers and painters that\n * components build on. Call it in `setup`: it stops following with the component.\n */\nexport function toReadable<T>(source: () => T): Readable<T> {\n const store = writable(source())\n watch(source, (value) => store.set(value), { flush: 'sync' })\n return readonly(store)\n}\n"],"mappings":";;;AAOA,SAAgBA,EAAc,GAA8B;CAC1D,IAAMC,IAAQC,EAASC,EAAO,CAAC;CAE/B,OADAC,EAAMD,IAAS,MAAUF,EAAM,IAAII,CAAK,GAAG,EAAE,OAAO,OAAO,CAAC,GACrDC,EAASL,CAAK;AACvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkbar/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Vue 3 components and composables for Inkbar, the browser PDF viewer and editor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://inkbar.dev",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@inkbar/icons": "^0.
|
|
27
|
+
"@inkbar/icons": "^0.10.0",
|
|
28
28
|
"reka-ui": "^2.11.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@inkbar/core": "^0.
|
|
31
|
+
"@inkbar/core": "^0.10.0",
|
|
32
32
|
"vue": "^3.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@inkbar/core": "0.
|
|
35
|
+
"@inkbar/core": "0.10.0",
|
|
36
36
|
"@inkbar/fixtures": "0.0.0",
|
|
37
|
-
"@inkbar/theme": "0.
|
|
37
|
+
"@inkbar/theme": "0.10.0",
|
|
38
38
|
"@axe-core/playwright": "^4.13.0",
|
|
39
39
|
"@playwright/experimental-ct-vue": "1.62.1",
|
|
40
40
|
"@playwright/test": "1.62.1",
|