@stll/folio-vue 0.26.5 → 0.27.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/dist/components/DocxEditor/DocxEditorMenuBar.vue.d.ts +7 -5
- package/dist/components/DocxEditor.vue.d.ts +13 -11
- package/dist/components/EditorToolbar.vue.d.ts +13 -11
- package/dist/components/TitleBar.vue.d.ts +9 -7
- package/dist/components/Toolbar.vue.d.ts +7 -5
- package/dist/components/ui/Button.vue.d.ts +5 -3
- package/dist/components/ui/Dialog.vue.d.ts +5 -3
- package/dist/components/ui/MenuDropdown.vue.d.ts +8 -6
- package/dist/components/ui/Popover.vue.d.ts +10 -8
- package/dist/composables/useDocxEditor.d.ts +2 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/folio-vue.css +11 -53
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -2
- package/dist/{useZoom-C_7cmUyk.js → useZoom-7DkhQcMl.js} +311 -308
- package/dist/useZoom-ChRQsGBq.cjs +1 -0
- package/package.json +5 -12
- package/dist/useZoom-Bwnae1jX.cjs +0 -1
|
@@ -7,12 +7,14 @@ type __VLS_Props = {
|
|
|
7
7
|
/** Gates the Insert > Table menu item (mirrors the toolbar's showTableInsert). */
|
|
8
8
|
showTableInsert?: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} & {
|
|
14
|
-
|
|
10
|
+
declare const __VLS_template: () => {
|
|
11
|
+
__VLS_Slots: {
|
|
12
|
+
'title-bar-left'?: (props: {}) => any;
|
|
13
|
+
} & {
|
|
14
|
+
'title-bar-right'?: (props: {}) => any;
|
|
15
|
+
};
|
|
15
16
|
};
|
|
17
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
16
18
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
19
|
"insert-table": (rows: number, cols: number) => any;
|
|
18
20
|
rename: (name: string) => any;
|
|
@@ -2,18 +2,20 @@ import { Comment } from '@stll/folio-core/types/content';
|
|
|
2
2
|
import { Document } from '@stll/folio-core/types/document';
|
|
3
3
|
import { FindResult } from '@stll/folio-core/utils/findReplace';
|
|
4
4
|
import { DocxEditorProps, EditorMode } from './DocxEditor/types';
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} & {
|
|
9
|
-
|
|
10
|
-
} & {
|
|
11
|
-
|
|
12
|
-
} & {
|
|
13
|
-
|
|
14
|
-
} & {
|
|
15
|
-
|
|
5
|
+
declare const __VLS_template: () => {
|
|
6
|
+
__VLS_Slots: {
|
|
7
|
+
'title-bar-left'?: (props: {}) => any;
|
|
8
|
+
} & {
|
|
9
|
+
'title-bar-right'?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
'toolbar-extra'?: (props: {}) => any;
|
|
12
|
+
} & {
|
|
13
|
+
'loading-indicator'?: (props: {}) => any;
|
|
14
|
+
} & {
|
|
15
|
+
placeholder?: (props: {}) => any;
|
|
16
|
+
};
|
|
16
17
|
};
|
|
18
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
17
19
|
declare const __VLS_base: import('vue').DefineComponent<DocxEditorProps, import('..').DocxEditorRef, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
20
|
error: (error: Error) => any;
|
|
19
21
|
change: (doc: Document) => any;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
showMenuBar?: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} & {
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
11
|
-
} & {
|
|
12
|
-
|
|
13
|
-
} & {
|
|
14
|
-
|
|
4
|
+
declare const __VLS_template: () => {
|
|
5
|
+
__VLS_Slots: {
|
|
6
|
+
'title-bar'?: (props: {}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
'title-bar-left'?: (props: {}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
'document-name'?: (props: {}) => any;
|
|
11
|
+
} & {
|
|
12
|
+
'title-bar-right'?: (props: {}) => any;
|
|
13
|
+
} & {
|
|
14
|
+
toolbar?: (props: {}) => any;
|
|
15
|
+
};
|
|
15
16
|
};
|
|
17
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
16
18
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
19
|
"menu-action": (action: string) => any;
|
|
18
20
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} & {
|
|
5
|
-
|
|
6
|
-
} & {
|
|
7
|
-
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
left?: (props: {}) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: {}) => any;
|
|
6
|
+
} & {
|
|
7
|
+
right?: (props: {}) => any;
|
|
8
|
+
};
|
|
8
9
|
};
|
|
10
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
9
11
|
declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
@@ -71,12 +71,14 @@ type __VLS_Props = {
|
|
|
71
71
|
matching React's Toolbar `documentStyles` prop. Falls back to presets. */
|
|
72
72
|
documentStyles?: Style[];
|
|
73
73
|
};
|
|
74
|
-
declare
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} & {
|
|
78
|
-
|
|
74
|
+
declare const __VLS_template: () => {
|
|
75
|
+
__VLS_Slots: {
|
|
76
|
+
'table-context'?: (props: {}) => any;
|
|
77
|
+
} & {
|
|
78
|
+
'toolbar-extra'?: (props: {}) => any;
|
|
79
|
+
};
|
|
79
80
|
};
|
|
81
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
80
82
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
81
83
|
"zoom-in": () => any;
|
|
82
84
|
"zoom-out": () => any;
|
|
@@ -6,10 +6,12 @@ type __VLS_Props = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
className?: string;
|
|
8
8
|
};
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
declare const __VLS_template: () => {
|
|
10
|
+
__VLS_Slots: {
|
|
11
|
+
default?: (props: {}) => any;
|
|
12
|
+
};
|
|
12
13
|
};
|
|
14
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
15
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
16
|
click: (evt: MouseEvent) => any;
|
|
15
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -5,10 +5,12 @@ type __VLS_Props = {
|
|
|
5
5
|
backdropClass?: string;
|
|
6
6
|
closeOnBackdrop?: boolean;
|
|
7
7
|
};
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
declare const __VLS_template: () => {
|
|
9
|
+
__VLS_Slots: {
|
|
10
|
+
default?: (props: {}) => any;
|
|
11
|
+
};
|
|
11
12
|
};
|
|
13
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
14
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
15
|
close: () => any;
|
|
14
16
|
"update:open": (value: boolean) => any;
|
|
@@ -22,13 +22,15 @@ type __VLS_Props = {
|
|
|
22
22
|
showChevron?: boolean;
|
|
23
23
|
};
|
|
24
24
|
declare function closeMenu(): void;
|
|
25
|
-
declare
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
declare const __VLS_template: () => {
|
|
26
|
+
__VLS_Slots: {
|
|
27
|
+
submenu?: (props: {
|
|
28
|
+
item: MenuItem;
|
|
29
|
+
closeMenu: typeof closeMenu;
|
|
30
|
+
}) => any;
|
|
31
|
+
};
|
|
31
32
|
};
|
|
33
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
32
34
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
33
35
|
showChevron: boolean;
|
|
34
36
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -11,15 +11,17 @@ type __VLS_Props = {
|
|
|
11
11
|
closeOnScroll?: boolean;
|
|
12
12
|
};
|
|
13
13
|
declare function toggle(): void;
|
|
14
|
-
declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} & {
|
|
21
|
-
|
|
14
|
+
declare const __VLS_template: () => {
|
|
15
|
+
__VLS_Slots: {
|
|
16
|
+
trigger?: (props: {
|
|
17
|
+
toggle: typeof toggle;
|
|
18
|
+
open: boolean;
|
|
19
|
+
}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
panel?: (props: {}) => any;
|
|
22
|
+
};
|
|
22
23
|
};
|
|
24
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
23
25
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
24
26
|
close: () => any;
|
|
25
27
|
"update:open": (value: boolean) => any;
|
|
@@ -41,6 +41,8 @@ export type UseDocxEditorOptions = {
|
|
|
41
41
|
markupView?: MaybeRefOrGetter<DisplayMode>;
|
|
42
42
|
/** Paint comment highlights in All Markup. Defaults to true. Reactive. */
|
|
43
43
|
showCommentHighlights?: MaybeRefOrGetter<boolean>;
|
|
44
|
+
/** Localised text for a `w:altChunk` that has no text of its own to show. */
|
|
45
|
+
altChunkMarkerText?: MaybeRefOrGetter<string>;
|
|
44
46
|
showMarginGuides?: MaybeRefOrGetter<boolean | undefined>;
|
|
45
47
|
/** CSS color used for margin guides. Reactive. */
|
|
46
48
|
marginGuideColor?: MaybeRefOrGetter<string | undefined>;
|
package/dist/composables.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-ChRQsGBq.cjs");let t=require("vue"),n=require("@stll/folio-core/utils/textEncoding"),r=require("prosemirror-history"),i=require("@stll/folio-core/utils/documentPointerDown"),a=require("@stll/folio-core/managers/ClipboardManager"),o=require("@stll/folio-core/utils/clipboard"),s=require("@stll/folio-core/managers/TableSelectionManager"),c=require("@stll/folio-core/prosemirror/utils/visualLineNavigation"),l=require("@stll/folio-core/prosemirror/utils/extractTrackedChanges");function u(e={}){let{onCopy:r,onCut:i,onPaste:a,cleanWordFormatting:s=!0,editable:c=!0,onError:l}=e,u=(0,t.ref)(!1),d=(0,t.ref)(null),f=l?{onError:l}:{};async function p(e){if(u.value)return!1;u.value=!0;try{let t=await(0,o.copyRuns)(e.runs,f);return t&&r?.(e),t}finally{u.value=!1}}async function m(e){if(u.value||!c)return!1;u.value=!0;try{let t=await(0,o.copyRuns)(e.runs,f);return t&&i?.(e),t}finally{u.value=!1}}async function h(e=!1){if(u.value||!c)return null;u.value=!0;try{if(navigator.clipboard&&navigator.clipboard.read){let t=await navigator.clipboard.read(),r=``,i=``;for(let e of t)e.types.includes(`text/html`)&&(r=await(0,n.readBlobText)(await e.getType(`text/html`))),e.types.includes(`text/plain`)&&(i=await(0,n.readBlobText)(await e.getType(`text/plain`)));e&&(r=``);let c=(0,o.parseClipboardHtml)(r,i,s);return d.value=c,a?.(c,e),c}return null}catch(e){return l?.(e instanceof Error?e:Error(String(e))),null}finally{u.value=!1}}return{copy:p,cut:m,paste:h,isProcessing:u,lastPastedContent:d}}function d({isOpen:e,onClose:n,align:r=`left`}){let a=(0,t.ref)(null),o=(0,t.ref)(null),s=(0,t.ref)({position:`fixed`,top:`0px`,left:`0px`,zIndex:1e4});function c(e,t){s.value={position:`fixed`,top:e+`px`,left:t+`px`,zIndex:1e4}}function l(e){let t=e.target;t instanceof Node&&a.value&&!a.value.contains(t)&&o.value&&!o.value.contains(t)&&n()}function u(e){e.key===`Escape`&&n()}function d(e){let t=e.target;t instanceof Node&&o.value&&o.value.contains(t)||n()}let f;function p(){f=(0,i.onDocumentPointerDown)(document,l),document.addEventListener(`keydown`,u),window.addEventListener(`scroll`,d,!0)}function m(){f?.(),f=void 0,document.removeEventListener(`keydown`,u),window.removeEventListener(`scroll`,d,!0)}(0,t.watch)(e,e=>{if(!e){m();return}let t=a.value;if(!t)return;let n=t.getBoundingClientRect();r===`right`?requestAnimationFrame(()=>{let e=o.value;if(e){let t=e.getBoundingClientRect();c(n.bottom+4,n.right-t.width)}else c(n.bottom+4,n.left)}):c(n.bottom+4,n.left),p()}),(0,t.onScopeDispose)(m);function h(e){e.preventDefault(),e.stopPropagation()}return{containerRef:a,dropdownRef:o,dropdownStyle:s,handleMouseDown:h}}function f(e,n){let i=(0,t.computed)(()=>{n.value;let t=e.value;return t?(0,r.undoDepth)(t.state)>0:!1}),a=(0,t.computed)(()=>{n.value;let t=e.value;return t?(0,r.redoDepth)(t.state)>0:!1});function o(){let t=e.value;return t?(0,r.undo)(t.state,t.dispatch):!1}function s(){let t=e.value;return t?(0,r.redo)(t.state,t.dispatch):!1}return{canUndo:i,canRedo:a,undo:o,redo:s}}var p={backgroundColor:`rgba(26, 115, 232, 0.3)`,borderRadius:0,zIndex:0,opacity:1,mixBlendMode:`multiply`};function m(e){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return[];let n=t.getRangeAt(0);if(e&&!e.contains(n.commonAncestorContainer))return[];let r=0,i=0;if(e){let t=e.getBoundingClientRect();r=t.left+e.scrollLeft,i=t.top+e.scrollTop}let a=[];for(let e of n.getClientRects())(e.width!==0||e.height!==0)&&a.push({left:e.left-r,top:e.top-i,width:e.width,height:e.height});return a}function h(e,t=2){if(e.length<=1)return e;let n=[...e].sort((e,n)=>Math.abs(e.top-n.top)<t?e.left-n.left:e.top-n.top),r=n[0];if(!r)return e;let i=[],a={...r};for(let e=1;e<n.length;e++){let r=n[e];if(!r)continue;let o=Math.abs(r.top-a.top)<t,s=r.left<=a.left+a.width+t;if(o&&s){let e=Math.max(a.left+a.width,r.left+r.width);a.width=e-a.left,a.height=Math.max(a.height,r.height)}else i.push(a),a={...r}}return i.push(a),i}function g(e){return h(m(e))}function _(){let e=window.getSelection();return e!==null&&!e.isCollapsed&&e.rangeCount>0}function v(e){let t=window.getSelection();return!t||t.rangeCount===0?!1:e.contains(t.getRangeAt(0).commonAncestorContainer)}var y=`docx-selection-styles`,b=null;function x(){b&&=(b.remove(),null),document.getElementById(y)?.remove()}function S(e=p){x();let t=`
|
|
2
2
|
/* DOCX Editor Selection Highlighting */
|
|
3
3
|
|
|
4
4
|
.docx-editor [contenteditable="true"]::selection,
|
package/dist/composables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./useZoom-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./useZoom-7DkhQcMl.js";
|
|
2
2
|
import { computed as d, onBeforeUnmount as f, onMounted as p, onScopeDispose as m, ref as h, watch as g } from "vue";
|
|
3
3
|
import { readBlobText as _ } from "@stll/folio-core/utils/textEncoding";
|
|
4
4
|
import { redo as v, redoDepth as y, undo as b, undoDepth as x } from "prosemirror-history";
|