@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.
@@ -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 var __VLS_1: {}, __VLS_18: {};
11
- type __VLS_Slots = {} & {
12
- 'title-bar-left'?: (props: typeof __VLS_1) => any;
13
- } & {
14
- 'title-bar-right'?: (props: typeof __VLS_18) => any;
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 var __VLS_12: {}, __VLS_15: {}, __VLS_50: {}, __VLS_70: {}, __VLS_77: {};
6
- type __VLS_Slots = {} & {
7
- 'title-bar-left'?: (props: typeof __VLS_12) => any;
8
- } & {
9
- 'title-bar-right'?: (props: typeof __VLS_15) => any;
10
- } & {
11
- 'toolbar-extra'?: (props: typeof __VLS_50) => any;
12
- } & {
13
- 'loading-indicator'?: (props: typeof __VLS_70) => any;
14
- } & {
15
- placeholder?: (props: typeof __VLS_77) => any;
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 var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_14: {}, __VLS_16: {};
5
- type __VLS_Slots = {} & {
6
- 'title-bar'?: (props: typeof __VLS_1) => any;
7
- } & {
8
- 'title-bar-left'?: (props: typeof __VLS_3) => any;
9
- } & {
10
- 'document-name'?: (props: typeof __VLS_5) => any;
11
- } & {
12
- 'title-bar-right'?: (props: typeof __VLS_14) => any;
13
- } & {
14
- toolbar?: (props: typeof __VLS_16) => any;
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 var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
2
- type __VLS_Slots = {} & {
3
- left?: (props: typeof __VLS_1) => any;
4
- } & {
5
- default?: (props: typeof __VLS_3) => any;
6
- } & {
7
- right?: (props: typeof __VLS_5) => any;
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 var __VLS_175: {}, __VLS_192: {};
75
- type __VLS_Slots = {} & {
76
- 'table-context'?: (props: typeof __VLS_175) => any;
77
- } & {
78
- 'toolbar-extra'?: (props: typeof __VLS_192) => any;
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 var __VLS_1: {};
10
- type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_1) => any;
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 var __VLS_7: {};
9
- type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_7) => any;
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 var __VLS_28: {
26
- item: MenuItem;
27
- closeMenu: typeof closeMenu;
28
- };
29
- type __VLS_Slots = {} & {
30
- submenu?: (props: typeof __VLS_28) => any;
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 var __VLS_1: {
15
- toggle: typeof toggle;
16
- open: boolean;
17
- }, __VLS_3: {};
18
- type __VLS_Slots = {} & {
19
- trigger?: (props: typeof __VLS_1) => any;
20
- } & {
21
- panel?: (props: typeof __VLS_3) => any;
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>;
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-Bwnae1jX.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=`
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,
@@ -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-C_7cmUyk.js";
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";