@stll/folio-vue 0.13.1 → 0.13.3

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { A as e, F as t, M as n, N as r, P as i, _ as a, c as o, d as s, f as c, g as l, j as u, l as d, m as f, p, u as m, y as h } from "./SplitCellDialog-D2wgbGwH.js";
2
2
  import { D as g, E as _, d as v, f as y, i as b, n as x, r as ee, t as te, v as ne, w as re, y as ie } from "./ListButtons-BlOX6_s_.js";
3
3
  import { t as ae } from "./zIndex-Ei9BbHSW.js";
4
- import { a as S, c as C, i as oe, l as w, o as se, r as ce, s as le, t as ue, u as de } from "./useZoom-CbTb1bPs.js";
4
+ import { a as S, c as C, i as oe, l as w, o as se, r as ce, s as le, t as ue, u as de } from "./useZoom-DZmNIcAL.js";
5
5
  import { FindReplaceDialog as fe, FootnotePropertiesDialog as pe, HyperlinkDialog as me, ImagePositionDialog as T, ImagePropertiesDialog as he, InsertImageDialog as ge, InsertSymbolDialog as E, InsertTableDialog as _e, PageSetupDialog as ve, PasteSpecialDialog as ye, SplitCellDialog as be, TablePropertiesDialog as xe, WatermarkDialog as D } from "./dialogs.js";
6
6
  import { Fragment as O, Teleport as k, computed as A, createApp as Se, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createSlots as Ce, createStaticVNode as we, createTextVNode as Te, createVNode as F, defineComponent as I, h as Ee, inject as L, mergeProps as De, nextTick as Oe, normalizeClass as R, normalizeStyle as z, onBeforeUnmount as B, onMounted as ke, onScopeDispose as Ae, openBlock as V, provide as je, ref as H, renderList as U, renderSlot as Me, shallowRef as Ne, toDisplayString as W, unref as G, vModelText as Pe, vShow as Fe, watch as K, withCtx as Ie, withDirectives as Le, withKeys as Re, withModifiers as q } from "vue";
7
7
  import { createStyleResolver as ze, extractSelectionState as Be, getSelectedText as Ve, insertImageFromFile as He, insertImageFromFile as Ue, insertPageBreakInView as We, insertPageBreakInView as Ge, insertTableInView as Ke, insertTableInView as qe, insertTableOfContentsInView as Je, insertTableOfContentsInView as Ye, schema as J } from "@stll/folio-core/prosemirror";
@@ -2576,17 +2576,23 @@ function so(e) {
2576
2576
  }
2577
2577
  //#endregion
2578
2578
  //#region src/composables/useDocxEditorRefApi.ts
2579
- var co = Date.now();
2580
- function lo(e) {
2579
+ var co = Date.now(), lo = async (e, t) => {
2580
+ let n = await e.saveDocument(t);
2581
+ if (!n) return null;
2582
+ let r = await n.arrayBuffer();
2583
+ return e.clearCommentsDirty(), e.onSave?.(r), r;
2584
+ };
2585
+ function uo(e) {
2581
2586
  let t = [];
2582
2587
  function n() {
2583
2588
  e.onPrint?.(), window.print();
2584
2589
  }
2585
- async function r(t) {
2586
- let n = await e.save(t);
2587
- if (!n) return null;
2588
- let r = await n.arrayBuffer();
2589
- return e.clearCommentsDirty(), e.onSave?.(r), r;
2590
+ function r(t) {
2591
+ return lo({
2592
+ clearCommentsDirty: e.clearCommentsDirty,
2593
+ onSave: e.onSave,
2594
+ saveDocument: e.saveDocument
2595
+ }, t);
2590
2596
  }
2591
2597
  function i(t, n) {
2592
2598
  let r = e.pagesRef.value;
@@ -2708,8 +2714,8 @@ function lo(e) {
2708
2714
  scrollToParaId: i,
2709
2715
  openPrintPreview: () => n(),
2710
2716
  print: n,
2711
- loadDocument: e.loadDocument,
2712
- loadDocumentBuffer: e.loadDocumentBuffer,
2717
+ loadDocument: (t) => e.editor.loadDocument(t),
2718
+ loadDocumentBuffer: (t) => e.editor.loadDocx(t),
2713
2719
  ensureEditorView: () => e.editor.ensureView(),
2714
2720
  createAIEditSnapshot: () => {
2715
2721
  let t = e.editorView.value;
@@ -2976,7 +2982,7 @@ function lo(e) {
2976
2982
  }
2977
2983
  //#endregion
2978
2984
  //#region src/composables/useFormattingActions.ts
2979
- function uo(e) {
2985
+ function fo(e) {
2980
2986
  let t = () => e.activeView?.value ?? e.editorView.value;
2981
2987
  function n() {
2982
2988
  let e = t();
@@ -3023,10 +3029,10 @@ function uo(e) {
3023
3029
  }
3024
3030
  //#endregion
3025
3031
  //#region src/utils/fontFaces.ts
3026
- function fo() {
3032
+ function po() {
3027
3033
  return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
3028
3034
  }
3029
- async function po(e, t, n, r) {
3035
+ async function mo(e, t, n, r) {
3030
3036
  let i;
3031
3037
  try {
3032
3038
  i = new FontFace(t, n, r), e.add(i);
@@ -3035,27 +3041,27 @@ async function po(e, t, n, r) {
3035
3041
  }
3036
3042
  return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
3037
3043
  }
3038
- function mo(e) {
3039
- let t = fo();
3044
+ function ho(e) {
3045
+ let t = po();
3040
3046
  if (t) for (let n of e) t.delete(n);
3041
3047
  }
3042
3048
  //#endregion
3043
3049
  //#region src/utils/embeddedFonts.ts
3044
- var ho = {
3050
+ var go = {
3045
3051
  faces: [],
3046
3052
  familyMap: /* @__PURE__ */ new Map()
3047
3053
  };
3048
- async function go(e) {
3049
- let t = fo();
3050
- if (!t) return ho;
3054
+ async function _o(e) {
3055
+ let t = po();
3056
+ if (!t) return go;
3051
3057
  let n;
3052
3058
  try {
3053
3059
  n = await wr(e);
3054
3060
  } catch {
3055
- return ho;
3061
+ return go;
3056
3062
  }
3057
3063
  return {
3058
- faces: (await Promise.all(n.map((e) => po(t, e.family, e.bytes, {
3064
+ faces: (await Promise.all(n.map((e) => mo(t, e.family, e.bytes, {
3059
3065
  weight: String(e.weight),
3060
3066
  style: e.style
3061
3067
  })))).filter((e) => e !== null),
@@ -3064,17 +3070,17 @@ async function go(e) {
3064
3070
  }
3065
3071
  //#endregion
3066
3072
  //#region src/utils/hostFonts.ts
3067
- function _o(e) {
3068
- return typeof e == "string" && e.trim().length > 0;
3069
- }
3070
3073
  function vo(e) {
3071
- return typeof e != "object" || !e ? !1 : _o(Reflect.get(e, "family")) && _o(Reflect.get(e, "src"));
3074
+ return typeof e == "string" && e.trim().length > 0;
3072
3075
  }
3073
3076
  function yo(e) {
3077
+ return typeof e != "object" || !e ? !1 : vo(Reflect.get(e, "family")) && vo(Reflect.get(e, "src"));
3078
+ }
3079
+ function bo(e) {
3074
3080
  if (!e) return [];
3075
3081
  let t = [];
3076
3082
  for (let n of e) {
3077
- if (!vo(n)) continue;
3083
+ if (!yo(n)) continue;
3078
3084
  let e = { display: "swap" };
3079
3085
  (typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
3080
3086
  family: n.family.trim(),
@@ -3084,20 +3090,20 @@ function yo(e) {
3084
3090
  }
3085
3091
  return t;
3086
3092
  }
3087
- async function bo(e) {
3088
- let t = fo();
3093
+ async function xo(e) {
3094
+ let t = po();
3089
3095
  if (!t) return [];
3090
- let n = yo(e);
3091
- return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => po(t, e, n, r)))).filter((e) => e !== null);
3096
+ let n = bo(e);
3097
+ return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => mo(t, e, n, r)))).filter((e) => e !== null);
3092
3098
  }
3093
3099
  //#endregion
3094
3100
  //#region src/composables/useFontLifecycle.ts
3095
- var xo = {
3096
- loadEmbedded: go,
3097
- loadHost: bo,
3098
- remove: mo
3101
+ var So = {
3102
+ loadEmbedded: _o,
3103
+ loadHost: xo,
3104
+ remove: ho
3099
3105
  };
3100
- function So(e, t = xo) {
3106
+ function Co(e, t = So) {
3101
3107
  K(() => e.isReady.value ? e.getDocument()?.originalBuffer ?? null : null, (n, r, i) => {
3102
3108
  if (!n) return;
3103
3109
  let a = !1, o = [];
@@ -3126,7 +3132,7 @@ function So(e, t = xo) {
3126
3132
  }
3127
3133
  //#endregion
3128
3134
  //#region src/composables/useHyperlinkManagement.ts
3129
- function Co(e) {
3135
+ function wo(e) {
3130
3136
  let t = H(null);
3131
3137
  function n(e, t) {
3132
3138
  t(e.state, (t) => e.dispatch(t), e);
@@ -3178,7 +3184,7 @@ function Co(e) {
3178
3184
  }
3179
3185
  //#endregion
3180
3186
  //#region src/composables/useImageActions.ts
3181
- function wo(e) {
3187
+ function To(e) {
3182
3188
  let t = Ne(null), n = H(!1), r = A(() => {
3183
3189
  e.stateTick.value;
3184
3190
  let n = e.editorView.value, r = t.value;
@@ -3228,7 +3234,7 @@ function wo(e) {
3228
3234
  }
3229
3235
  //#endregion
3230
3236
  //#region src/composables/useKeyboardShortcuts.ts
3231
- function To(e) {
3237
+ function Eo(e) {
3232
3238
  function t(t) {
3233
3239
  if (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey) {
3234
3240
  if (t.key === "o") {
@@ -3243,7 +3249,7 @@ function To(e) {
3243
3249
  }
3244
3250
  //#endregion
3245
3251
  //#region src/composables/useOutlineSidebar.ts
3246
- function Eo(e) {
3252
+ function Do(e) {
3247
3253
  function t() {
3248
3254
  let t = e.editorView.value;
3249
3255
  t && (e.outlineHeadings.value = Or(t.state.doc));
@@ -3277,7 +3283,7 @@ function Eo(e) {
3277
3283
  }
3278
3284
  //#endregion
3279
3285
  //#region src/composables/usePageSetupControls.ts
3280
- function Do(e) {
3286
+ function Oo(e) {
3281
3287
  function t(t) {
3282
3288
  if (e.readOnly.value) return;
3283
3289
  let n = e.getDocument();
@@ -3333,34 +3339,34 @@ function Do(e) {
3333
3339
  }
3334
3340
  //#endregion
3335
3341
  //#region src/utils/textSelection.ts
3336
- var Oo = /[\p{L}\p{N}\p{M}_''-]/u, ko = /\s/;
3337
- function Ao(e) {
3338
- return !e || e.length === 0 ? !1 : Oo.test(e);
3339
- }
3342
+ var ko = /[\p{L}\p{N}\p{M}_''-]/u, Ao = /\s/;
3340
3343
  function jo(e) {
3341
3344
  return !e || e.length === 0 ? !1 : ko.test(e);
3342
3345
  }
3343
- function Mo(e, t) {
3346
+ function Mo(e) {
3347
+ return !e || e.length === 0 ? !1 : Ao.test(e);
3348
+ }
3349
+ function No(e, t) {
3344
3350
  if (!e || e.length === 0) return [0, 0];
3345
3351
  t = Math.max(0, Math.min(t, e.length - 1));
3346
3352
  let n = e[t];
3347
- if (jo(n)) {
3353
+ if (Mo(n)) {
3348
3354
  let n = t, r = t;
3349
- for (; n > 0 && jo(e[n - 1]);) n--;
3350
- for (; r < e.length && jo(e[r]);) r++;
3355
+ for (; n > 0 && Mo(e[n - 1]);) n--;
3356
+ for (; r < e.length && Mo(e[r]);) r++;
3351
3357
  return [n, r];
3352
3358
  }
3353
- if (Ao(n)) {
3359
+ if (jo(n)) {
3354
3360
  let n = t, r = t;
3355
- for (; n > 0 && Ao(e[n - 1]);) n--;
3356
- for (; r < e.length && Ao(e[r]);) r++;
3361
+ for (; n > 0 && jo(e[n - 1]);) n--;
3362
+ for (; r < e.length && jo(e[r]);) r++;
3357
3363
  return [n, r];
3358
3364
  }
3359
3365
  return [t, t + 1];
3360
3366
  }
3361
3367
  //#endregion
3362
3368
  //#region src/utils/domQueries.ts
3363
- function No(e, t, n) {
3369
+ function Po(e, t, n) {
3364
3370
  let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : Yt(e);
3365
3371
  for (let e of r) {
3366
3372
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
@@ -3368,7 +3374,7 @@ function No(e, t, n) {
3368
3374
  }
3369
3375
  return null;
3370
3376
  }
3371
- function Po(e, t, n) {
3377
+ function Fo(e, t, n) {
3372
3378
  if (!e || !t) return;
3373
3379
  let r = Jt(e, n);
3374
3380
  if (!r) for (let t of Yt(e)) {
@@ -3385,21 +3391,21 @@ function Po(e, t, n) {
3385
3391
  behavior: "smooth"
3386
3392
  });
3387
3393
  }
3388
- function Fo(e, t, n, r) {
3394
+ function Io(e, t, n, r) {
3389
3395
  if (!e || !t) return null;
3390
3396
  let i = Vt(e, n, r, 1);
3391
3397
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
3392
3398
  }
3393
- function Io(e, t, n, r) {
3399
+ function Lo(e, t, n, r) {
3394
3400
  if (!e) return;
3395
- let i = No(e, t, r);
3401
+ let i = Po(e, t, r);
3396
3402
  if (!i) return;
3397
- let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Mo(a, t - o), l = o + s, u = o + c;
3403
+ let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = No(a, t - o), l = o + s, u = o + c;
3398
3404
  l < u && n(l, u);
3399
3405
  }
3400
- function Lo(e, t, n, r) {
3406
+ function Ro(e, t, n, r) {
3401
3407
  if (!e) return;
3402
- let i = No(e, t, r);
3408
+ let i = Po(e, t, r);
3403
3409
  if (!i) return;
3404
3410
  let a = i.closest(".layout-paragraph");
3405
3411
  if (!a) return;
@@ -3408,8 +3414,8 @@ function Lo(e, t, n, r) {
3408
3414
  }
3409
3415
  //#endregion
3410
3416
  //#region src/composables/usePagesPointer.ts
3411
- var Ro = 500;
3412
- function zo(e) {
3417
+ var zo = 500;
3418
+ function Bo(e) {
3413
3419
  let t = H(null), n = null;
3414
3420
  function r() {
3415
3421
  n !== null && (clearTimeout(n), n = null);
@@ -3427,7 +3433,7 @@ function zo(e) {
3427
3433
  visible: !1
3428
3434
  }), p = null;
3429
3435
  function m(t, n) {
3430
- return Fo(e.pagesRef.value, e.editorView.value, t, n);
3436
+ return Io(e.pagesRef.value, e.editorView.value, t, n);
3431
3437
  }
3432
3438
  function h() {
3433
3439
  let t = i.value;
@@ -3453,13 +3459,13 @@ function zo(e) {
3453
3459
  } catch {}
3454
3460
  }
3455
3461
  function v(t) {
3456
- Po(e.pagesRef.value, e.pagesViewportRef.value, t);
3462
+ Fo(e.pagesRef.value, e.pagesViewportRef.value, t);
3457
3463
  }
3458
3464
  function y(t) {
3459
- Io(e.pagesRef.value, t, _, i.value?.position);
3465
+ Lo(e.pagesRef.value, t, _, i.value?.position);
3460
3466
  }
3461
3467
  function b(t) {
3462
- Lo(e.pagesRef.value, t, _, i.value?.position);
3468
+ Ro(e.pagesRef.value, t, _, i.value?.position);
3463
3469
  }
3464
3470
  function x(t) {
3465
3471
  let n = e.editorView.value;
@@ -3672,7 +3678,7 @@ function zo(e) {
3672
3678
  return;
3673
3679
  }
3674
3680
  let v = Date.now();
3675
- if (v - a < Ro && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
3681
+ if (v - a < zo && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
3676
3682
  else if (s >= 3) b(m), s = 0;
3677
3683
  else if (t.shiftKey) {
3678
3684
  let { from: e } = f.state.selection;
@@ -3745,7 +3751,7 @@ function zo(e) {
3745
3751
  }
3746
3752
  //#endregion
3747
3753
  //#region src/composables/useRemoteSelectionSync.ts
3748
- var Bo = (e) => {
3754
+ var Vo = (e) => {
3749
3755
  let t = new Fr(), n = null, r = () => {
3750
3756
  n !== null && (cancelAnimationFrame(n), n = null);
3751
3757
  let r = e.pagesRef.value;
@@ -3769,7 +3775,7 @@ var Bo = (e) => {
3769
3775
  ], i, { flush: "post" }), Ae(() => {
3770
3776
  a(), r();
3771
3777
  });
3772
- }, Vo = (e) => {
3778
+ }, Ho = (e) => {
3773
3779
  let t = new Ir(), n = null, r = () => {
3774
3780
  n !== null && (cancelAnimationFrame(n), n = null);
3775
3781
  let r = e.pagesRef.value;
@@ -3821,22 +3827,22 @@ var Bo = (e) => {
3821
3827
  clearOverlay: r,
3822
3828
  updateSelectionOverlay: i
3823
3829
  };
3824
- }, Ho = { class: "docx-editor-vue__toolbar-shell" }, Uo = {
3830
+ }, Uo = { class: "docx-editor-vue__toolbar-shell" }, Wo = {
3825
3831
  key: 0,
3826
3832
  class: "docx-editor-vue__error"
3827
- }, Wo = {
3833
+ }, Go = {
3828
3834
  key: 1,
3829
3835
  class: "docx-editor-vue__loading"
3830
- }, Go = {
3836
+ }, Ko = {
3831
3837
  key: 2,
3832
3838
  class: "docx-editor-vue__placeholder"
3833
- }, Ko = { class: "docx-editor-vue__editor-area" }, qo = {
3839
+ }, qo = { class: "docx-editor-vue__editor-area" }, Jo = {
3834
3840
  key: 0,
3835
3841
  class: "docx-editor-vue__ruler-h"
3836
- }, Jo = {
3842
+ }, Yo = {
3837
3843
  key: 1,
3838
3844
  class: "docx-editor-vue__ruler-v"
3839
- }, Yo = {
3845
+ }, Xo = {
3840
3846
  class: "docx-editor-vue__editor-content-wrapper",
3841
3847
  style: {
3842
3848
  position: "relative",
@@ -3844,11 +3850,11 @@ var Bo = (e) => {
3844
3850
  flexDirection: "column",
3845
3851
  minHeight: "100%"
3846
3852
  }
3847
- }, Xo = {
3853
+ }, Zo = {
3848
3854
  "data-testid": "selection-overlay",
3849
3855
  class: "docx-editor-vue__decoration-origin",
3850
3856
  "aria-hidden": "true"
3851
- }, Zo = ["aria-label"], Qo = { class: "docx-editor-vue__note-editor-header" }, $o = ["aria-label"], es = ["aria-label"], ts = /*#__PURE__*/ t(/* @__PURE__ */ I({
3857
+ }, Qo = ["aria-label"], $o = { class: "docx-editor-vue__note-editor-header" }, es = ["aria-label"], ts = ["aria-label"], ns = /*#__PURE__*/ t(/* @__PURE__ */ I({
3852
3858
  __name: "DocxEditor",
3853
3859
  props: {
3854
3860
  documentBuffer: { default: null },
@@ -3993,7 +3999,7 @@ var Bo = (e) => {
3993
3999
  function Ke(e) {
3994
4000
  o.enableWheelZoom !== !1 && Ve(e);
3995
4001
  }
3996
- To({
4002
+ Eo({
3997
4003
  showFindReplace: he,
3998
4004
  showHyperlink: ge,
3999
4005
  handleZoomKeyDown: He
@@ -4051,18 +4057,18 @@ var Bo = (e) => {
4051
4057
  function jt() {
4052
4058
  J.value && (nt(), tt(), Ot());
4053
4059
  }
4054
- So({
4060
+ Co({
4055
4061
  isReady: dt,
4056
4062
  getDocument: Y,
4057
4063
  fonts: () => o.fonts,
4058
4064
  remeasure: jt
4059
4065
  });
4060
- let { selectedImage: Z, imageInteracting: Mt, imageToolbarContext: Nt, handleToolbarImageWrap: Pt, handleImageTransform: Ft } = wo({
4066
+ let { selectedImage: Z, imageInteracting: Mt, imageToolbarContext: Nt, handleToolbarImageWrap: Pt, handleImageTransform: Ft } = To({
4061
4067
  editorView: X,
4062
4068
  zoom: L,
4063
4069
  stateTick: T,
4064
4070
  getCommands: Dt
4065
- }), It = Vo({
4071
+ }), It = Ho({
4066
4072
  editorView: J,
4067
4073
  hiddenContainer: S,
4068
4074
  pagesRef: w,
@@ -4071,16 +4077,16 @@ var Bo = (e) => {
4071
4077
  syncCoordinator: _t,
4072
4078
  imageInteracting: Mt
4073
4079
  });
4074
- Bo({
4080
+ Vo({
4075
4081
  pagesRef: w,
4076
4082
  remoteSelections: st,
4077
4083
  syncCoordinator: _t,
4078
4084
  zoom: L
4079
4085
  });
4080
- let { hyperlinkPopupData: Lt, handleHyperlinkSubmit: Rt, handleHyperlinkRemove: Vt, handleHyperlinkPopupNavigate: Ht, handleHyperlinkPopupEdit: Ut, handleHyperlinkPopupRemove: Wt } = Co({
4086
+ let { hyperlinkPopupData: Lt, handleHyperlinkSubmit: Rt, handleHyperlinkRemove: Vt, handleHyperlinkPopupNavigate: Ht, handleHyperlinkPopupEdit: Ut, handleHyperlinkPopupRemove: Wt } = wo({
4081
4087
  editorView: X,
4082
4088
  getCommands: Dt
4083
- }), Gt = oe(), { tableInsertButton: Kt, hfEdit: qt, scrollPageInfo: Jt, resolvePos: Yt, setPmSelection: Xt, scrollVisiblePositionIntoView: Zt, handlePagesMouseDown: Qt, handlePagesMouseMove: $t, handlePagesClick: en, handlePagesDoubleClick: tn, handleTableInsertClick: nn, handleHfSave: rn, handleHfRemove: an } = zo({
4089
+ }), Gt = oe(), { tableInsertButton: Kt, hfEdit: qt, scrollPageInfo: Jt, resolvePos: Yt, setPmSelection: Xt, scrollVisiblePositionIntoView: Zt, handlePagesMouseDown: Qt, handlePagesMouseMove: $t, handlePagesClick: en, handlePagesDoubleClick: tn, handleTableInsertClick: nn, handleHfSave: rn, handleHfRemove: an } = Bo({
4084
4090
  editorView: J,
4085
4091
  pagesRef: w,
4086
4092
  pagesViewportRef: le,
@@ -4118,7 +4124,7 @@ var Bo = (e) => {
4118
4124
  K(qt, (e) => {
4119
4125
  Se.value = e?.rId ?? null, e && It.clearOverlay();
4120
4126
  }, { immediate: !0 });
4121
- let cn = Eo({
4127
+ let cn = Do({
4122
4128
  editorView: J,
4123
4129
  showOutline: xe,
4124
4130
  showSidebar: D,
@@ -4193,7 +4199,7 @@ var Bo = (e) => {
4193
4199
  transform: L.value === 1 ? void 0 : `scale(${L.value})`,
4194
4200
  transformOrigin: "top center",
4195
4201
  transition: "transform 0.2s ease"
4196
- })), { handleApplyStyle: On, handleInsertSymbol: kn, handleInsertSectionBreakNextPage: An, handleInsertSectionBreakContinuous: jn } = uo({
4202
+ })), { handleApplyStyle: On, handleInsertSymbol: kn, handleInsertSectionBreakNextPage: An, handleInsertSectionBreakContinuous: jn } = fo({
4197
4203
  editorView: X,
4198
4204
  getDocument: Y
4199
4205
  });
@@ -4234,7 +4240,7 @@ var Bo = (e) => {
4234
4240
  let e = J.value;
4235
4241
  e && (Ye(e), e.focus());
4236
4242
  }
4237
- let { handlePageSetupApply: In, handleLeftMarginChange: Ln, handleRightMarginChange: Rn, handleTopMarginChange: zn, handleBottomMarginChange: Bn, handleIndentLeftChange: Vn, handleIndentRightChange: Hn, handleFirstLineIndentChange: Un, handleTabStopRemove: Wn } = Do({
4243
+ let { handlePageSetupApply: In, handleLeftMarginChange: Ln, handleRightMarginChange: Rn, handleTopMarginChange: zn, handleBottomMarginChange: Bn, handleIndentLeftChange: Vn, handleIndentRightChange: Hn, handleFirstLineIndentChange: Un, handleTabStopRemove: Wn } = Oo({
4238
4244
  editorView: J,
4239
4245
  getDocument: Y,
4240
4246
  readOnly: d,
@@ -4357,12 +4363,13 @@ var Bo = (e) => {
4357
4363
  e(), t(), n(), r(), i();
4358
4364
  });
4359
4365
  });
4360
- let { exposed: tr } = lo({
4366
+ let { exposed: tr } = uo({
4361
4367
  editor: Je,
4362
4368
  editorView: J,
4363
4369
  isDirty: ft,
4364
4370
  commentsDirty: Q.commentsDirty,
4365
4371
  clearCommentsDirty: Q.clearCommentsDirty,
4372
+ saveDocument: bt,
4366
4373
  layout: mt,
4367
4374
  pagesRef: w,
4368
4375
  pagesViewportRef: le,
@@ -4385,9 +4392,6 @@ var Bo = (e) => {
4385
4392
  closeNoteStory: Tt,
4386
4393
  getHeaderFooterView: St,
4387
4394
  setZoom: U,
4388
- save: bt,
4389
- loadDocument: yt,
4390
- loadDocumentBuffer: vt,
4391
4395
  onPrint: o.onPrint,
4392
4396
  onSave: o.onSave
4393
4397
  });
@@ -4403,7 +4407,7 @@ var Bo = (e) => {
4403
4407
  ]),
4404
4408
  style: z(e.style)
4405
4409
  }, [
4406
- P("div", Ho, [F(Fi, {
4410
+ P("div", Uo, [F(Fi, {
4407
4411
  "show-table-insert": o.showTableInsert !== !1,
4408
4412
  onRename: n[0] ||= (e) => s("rename", e),
4409
4413
  onMenuAction: qn,
@@ -4542,10 +4546,10 @@ var Bo = (e) => {
4542
4546
  "onHyperlinkRemove",
4543
4547
  "onPageSetupApply"
4544
4548
  ]),
4545
- G(pt) ? (V(), N("div", Uo, W(G(pt)), 1)) : At.value ? (V(), N("div", Wo, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(te, {
4549
+ G(pt) ? (V(), N("div", Wo, W(G(pt)), 1)) : At.value ? (V(), N("div", Go, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(te, {
4546
4550
  key: 0,
4547
4551
  node: e.loadingIndicator
4548
- }, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(ee)("loadingDocument")), 1)], 64))], !0)])) : !G(dt) && !re.value ? (V(), N("div", Go, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(te, {
4552
+ }, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(ee)("loadingDocument")), 1)], 64))], !0)])) : !G(dt) && !re.value ? (V(), N("div", Ko, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(te, {
4549
4553
  key: 0,
4550
4554
  node: e.placeholder
4551
4555
  }, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te("No document loaded")], 64))], !0)])) : M("", !0),
@@ -4564,8 +4568,8 @@ var Bo = (e) => {
4564
4568
  ref: fe,
4565
4569
  class: "docx-editor-vue__editor-scroll",
4566
4570
  onScroll: $n
4567
- }, [P("div", Ko, [
4568
- me.value && !d.value ? (V(), N("div", qo, [F(ne, {
4571
+ }, [P("div", qo, [
4572
+ me.value && !d.value ? (V(), N("div", Jo, [F(ne, {
4569
4573
  "section-props": xn.value,
4570
4574
  zoom: G(L),
4571
4575
  unit: e.rulerUnit ?? "inch",
@@ -4599,7 +4603,7 @@ var Bo = (e) => {
4599
4603
  "onFirstLineIndentChange",
4600
4604
  "onTabStopRemove"
4601
4605
  ])])) : M("", !0),
4602
- me.value && !d.value ? (V(), N("div", Jo, [F(v, {
4606
+ me.value && !d.value ? (V(), N("div", Yo, [F(v, {
4603
4607
  "section-props": xn.value,
4604
4608
  zoom: G(L),
4605
4609
  unit: e.rulerUnit ?? "inch",
@@ -4625,7 +4629,7 @@ var Bo = (e) => {
4625
4629
  onDblclick: n[28] ||= (...e) => G(tn) && G(tn)(...e),
4626
4630
  onContextmenu: n[29] ||= q((...e) => G(pn) && G(pn)(...e), ["prevent"])
4627
4631
  }, [
4628
- P("div", Yo, [
4632
+ P("div", Xo, [
4629
4633
  P("div", {
4630
4634
  ref_key: "pagesRef",
4631
4635
  ref: w,
@@ -4645,7 +4649,7 @@ var Bo = (e) => {
4645
4649
  "selection",
4646
4650
  "zoom"
4647
4651
  ]),
4648
- P("div", Xo, [
4652
+ P("div", Zo, [
4649
4653
  F(di, {
4650
4654
  "get-view": () => G(J),
4651
4655
  "get-pages-container": () => w.value,
@@ -4743,15 +4747,15 @@ var Bo = (e) => {
4743
4747
  class: "docx-editor-vue__note-editor",
4744
4748
  "aria-label": kt.value,
4745
4749
  onKeydown: n[16] ||= Re(q((...e) => G(Tt) && G(Tt)(...e), ["stop", "prevent"]), ["esc"])
4746
- }, [P("header", Qo, [P("span", null, W(kt.value), 1), P("button", {
4750
+ }, [P("header", $o, [P("span", null, W(kt.value), 1), P("button", {
4747
4751
  type: "button",
4748
4752
  "aria-label": G(ee)("common.closeDialog"),
4749
4753
  onClick: n[15] ||= (...e) => G(Tt) && G(Tt)(...e)
4750
- }, " × ", 8, $o)]), P("div", {
4754
+ }, " × ", 8, es)]), P("div", {
4751
4755
  ref_key: "notePmRef",
4752
4756
  ref: we,
4753
4757
  class: "docx-editor-vue__note-editor-host"
4754
- }, null, 512)], 40, Zo), [[Fe, G(ut)]]),
4758
+ }, null, 512)], 40, Qo), [[Fe, G(ut)]]),
4755
4759
  F(ga, {
4756
4760
  "image-info": G(Z),
4757
4761
  zoom: G(L),
@@ -4791,7 +4795,7 @@ var Bo = (e) => {
4791
4795
  }),
4792
4796
  "aria-label": G(Kt).type === "row" ? "Insert row" : "Insert column",
4793
4797
  onMousedown: n[21] ||= (...e) => G(nn) && G(nn)(...e)
4794
- }, " + ", 44, es)) : M("", !0),
4798
+ }, " + ", 44, ts)) : M("", !0),
4795
4799
  F(g, {
4796
4800
  comments: G(yn),
4797
4801
  "pages-container": w.value,
@@ -4926,10 +4930,10 @@ var Bo = (e) => {
4926
4930
  }, null, 8, ["event-root", "view"])
4927
4931
  ], 6));
4928
4932
  }
4929
- }), [["__scopeId", "data-v-f9e968f0"]]);
4933
+ }), [["__scopeId", "data-v-9aed719f"]]);
4930
4934
  //#endregion
4931
4935
  //#region src/utils/listState.ts
4932
- function ns() {
4936
+ function rs() {
4933
4937
  return {
4934
4938
  type: "none",
4935
4939
  level: 0,
@@ -4938,30 +4942,30 @@ function ns() {
4938
4942
  }
4939
4943
  //#endregion
4940
4944
  //#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
4941
- var rs = ["aria-label"], is = ["aria-label"], as = [
4945
+ var is = ["aria-label"], as = ["aria-label"], os = [
4942
4946
  "disabled",
4943
4947
  "title",
4944
4948
  "aria-label"
4945
- ], os = [
4949
+ ], ss = [
4946
4950
  "disabled",
4947
4951
  "title",
4948
4952
  "aria-label"
4949
- ], ss = ["aria-label"], cs = [
4953
+ ], cs = ["aria-label"], ls = [
4950
4954
  "disabled",
4951
4955
  "title",
4952
4956
  "aria-label",
4953
4957
  "aria-pressed"
4954
- ], ls = [
4958
+ ], us = [
4955
4959
  "disabled",
4956
4960
  "title",
4957
4961
  "aria-label",
4958
4962
  "aria-pressed"
4959
- ], us = [
4963
+ ], ds = [
4960
4964
  "disabled",
4961
4965
  "title",
4962
4966
  "aria-label",
4963
4967
  "aria-pressed"
4964
- ], ds = /*#__PURE__*/ t(/* @__PURE__ */ I({
4968
+ ], fs = /*#__PURE__*/ t(/* @__PURE__ */ I({
4965
4969
  __name: "FormattingBar",
4966
4970
  props: {
4967
4971
  currentFormatting: {},
@@ -5003,7 +5007,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5003
5007
  "redo"
5004
5008
  ],
5005
5009
  setup(e, { emit: t }) {
5006
- let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = A(() => a.currentFormatting ?? {}), l = A(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = A(() => c.value.listState ?? ns()), d = A(() => {
5010
+ let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = A(() => a.currentFormatting ?? {}), l = A(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = A(() => c.value.listState ?? rs()), d = A(() => {
5007
5011
  let e = c.value.color;
5008
5012
  return e ? e.replace(/^#/, "").toUpperCase() : void 0;
5009
5013
  }), f = A(() => {
@@ -5036,7 +5040,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5036
5040
  }, [F(i, {
5037
5041
  name: "undo",
5038
5042
  size: 18
5039
- })], 40, as), P("button", {
5043
+ })], 40, os), P("button", {
5040
5044
  type: "button",
5041
5045
  class: "docx-formatting-bar__btn",
5042
5046
  disabled: e.disabled || !e.canRedo,
@@ -5046,7 +5050,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5046
5050
  }, [F(i, {
5047
5051
  name: "redo",
5048
5052
  size: 18
5049
- })], 40, os)], 8, is),
5053
+ })], 40, ss)], 8, as),
5050
5054
  r[13] ||= P("span", {
5051
5055
  class: "docx-formatting-bar__divider",
5052
5056
  role: "separator"
@@ -5077,7 +5081,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5077
5081
  }, [F(i, {
5078
5082
  name: "format_bold",
5079
5083
  size: 18
5080
- })], 42, cs),
5084
+ })], 42, ls),
5081
5085
  P("button", {
5082
5086
  type: "button",
5083
5087
  class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.italic }]),
@@ -5089,7 +5093,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5089
5093
  }, [F(i, {
5090
5094
  name: "format_italic",
5091
5095
  size: 18
5092
- })], 42, ls),
5096
+ })], 42, us),
5093
5097
  P("button", {
5094
5098
  type: "button",
5095
5099
  class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.underline }]),
@@ -5101,8 +5105,8 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5101
5105
  }, [F(i, {
5102
5106
  name: "format_underlined",
5103
5107
  size: 18
5104
- })], 42, us)
5105
- ], 8, ss),
5108
+ })], 42, ds)
5109
+ ], 8, cs),
5106
5110
  e.showTextColorPicker ? (V(), N(O, { key: 1 }, [r[12] ||= P("span", {
5107
5111
  class: "docx-formatting-bar__divider",
5108
5112
  role: "separator"
@@ -5144,9 +5148,9 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5144
5148
  "disabled",
5145
5149
  "can-outdent"
5146
5150
  ])) : M("", !0)
5147
- ], 10, rs));
5151
+ ], 10, is));
5148
5152
  }
5149
- }), [["__scopeId", "data-v-fc03de2e"]]), fs = [
5153
+ }), [["__scopeId", "data-v-fc03de2e"]]), ps = [
5150
5154
  {
5151
5155
  value: .5,
5152
5156
  label: "50%"
@@ -5171,7 +5175,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5171
5175
  value: 2,
5172
5176
  label: "200%"
5173
5177
  }
5174
- ], ps = /*#__PURE__*/ t(/* @__PURE__ */ I({
5178
+ ], ms = /*#__PURE__*/ t(/* @__PURE__ */ I({
5175
5179
  __name: "ZoomControl",
5176
5180
  props: {
5177
5181
  value: { default: 1 },
@@ -5188,7 +5192,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5188
5192
  },
5189
5193
  emits: ["change"],
5190
5194
  setup(e, { emit: t }) {
5191
- let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ?? fs), o = A(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = A(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = A(() => o.value ? String(o.value.value) : String(r.value)), l = A(() => {
5195
+ let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ?? ps), o = A(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = A(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = A(() => o.value ? String(o.value.value) : String(r.value)), l = A(() => {
5192
5196
  let e = a.value.map((e) => ({
5193
5197
  value: String(e.value),
5194
5198
  label: e.label
@@ -5216,7 +5220,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5216
5220
  "disabled"
5217
5221
  ]));
5218
5222
  }
5219
- }), [["__scopeId", "data-v-8079e07f"]]), ms = (e, t, n = {}) => {
5223
+ }), [["__scopeId", "data-v-8079e07f"]]), hs = (e, t, n = {}) => {
5220
5224
  let { colorMode: r = C, locale: i = "en", ...a } = n;
5221
5225
  return new Promise((n, o) => {
5222
5226
  let s = H(null), c = null, l = !1, d = {
@@ -5242,7 +5246,7 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5242
5246
  }
5243
5247
  };
5244
5248
  c = Se({ setup() {
5245
- return () => Ee(ts, {
5249
+ return () => Ee(ns, {
5246
5250
  ...a,
5247
5251
  documentBuffer: e,
5248
5252
  ref: s,
@@ -5257,4 +5261,4 @@ var rs = ["aria-label"], is = ["aria-label"], as = [
5257
5261
  });
5258
5262
  };
5259
5263
  //#endregion
5260
- export { hi as AutocompleteCaretOverlay, Jr as DEFAULT_AI_SUGGESTION_PRESETS, vt as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Gr as DOCUMENT_PRESET_VERSION, Kr as DOCUMENT_STYLE_SET_VERSION, ts as DocxEditor, fe as FindReplaceDialog, l as FolioUIProvider, pe as FootnotePropertiesDialog, ds as FormattingBar, me as HyperlinkDialog, T as ImagePositionDialog, he as ImagePropertiesDialog, ge as InsertImageDialog, E as InsertSymbolDialog, _e as InsertTableDialog, ve as PageSetupDialog, ye as PasteSpecialDialog, Hr as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, D as WatermarkDialog, ps as ZoomControl, yt as acceptAutocompleteSuggestion, bt as acceptAutocompleteWord, pt as anonymizationDecorationsKey, Y as appendAutocompleteToken, Pn as applyFolioAIEditOperations, Yr as applySuggestions, xt as autocompleteSuggestionKey, St as autocompleteSuggestionPlugin, Qr as buildPositionalText, Ct as clearAutocompleteSuggestion, Cn as clearTemplateSlashMenu, le as colorModePlugin, wn as consumeTemplateSlashQuery, ii as createAICitationDecorationsPlugin, qr as createDocx, Lr as createEmptyDocument, Rn as createFolioAIEditSnapshot, Ur as createStellaStyleDocumentPreset, Wr as createStellaStyleSet, C as defaultColorMode, e as defaultLocale, sr as deriveBlockId, Bn as diffWordSegments, Rr as extractDocumentStyleSet, zr as extractDocumentStyleSetFromDocx, wt as finishAutocompleteSuggestion, si as fromMarkdown, mt as getAnonymizationMatches, Tt as getAutocompleteSuggestion, at as getDocumentWatermark, ni as getFolioCaretViewportRect, cr as getFolioParaIdFromBlockId, ri as getFolioSelectionViewportRect, en as getTemplateDirectives, Tn as getTemplateSlashMenu, Wn as hashFolioAIBlockText, u as i18nPlugin, He as insertImageFromFile, We as insertPageBreakInView, Ke as insertTableInView, Je as insertTableOfContentsInView, Br as inspectDocumentStyles, Vr as inspectDocumentStylesFromDocx, ur as isFolioBlockId, dr as isSequentialFolioBlockId, Xr as isSuggestionStale, Gn as normalizeFolioAIBlockText, w as provideColorMode, n as provideLocale, ms as renderAsync, En as resetTemplateSlashQuery, Zr as resolveSuggestionAnchor, nn as scanDirectives, ti as scrollFolioPositionIntoView, ai as setAICitationsMeta, $r as setAISuggestionsMeta, oi as setActiveCitationMeta, gt as setAnonymizationTermsMeta, st as setDocumentWatermark, ei as setFocusedSuggestionMeta, Sn as setTemplatePreviewValues, Dt as shouldTriggerAutocomplete, Ot as startAutocompleteSuggestion, Dn as templateSlashMenuKey, ci as toMarkdown, li as toMarkdownResult, de as useColorMode, r as useTranslation, ue as useWheelZoom };
5264
+ export { hi as AutocompleteCaretOverlay, Jr as DEFAULT_AI_SUGGESTION_PRESETS, vt as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Gr as DOCUMENT_PRESET_VERSION, Kr as DOCUMENT_STYLE_SET_VERSION, ns as DocxEditor, fe as FindReplaceDialog, l as FolioUIProvider, pe as FootnotePropertiesDialog, fs as FormattingBar, me as HyperlinkDialog, T as ImagePositionDialog, he as ImagePropertiesDialog, ge as InsertImageDialog, E as InsertSymbolDialog, _e as InsertTableDialog, ve as PageSetupDialog, ye as PasteSpecialDialog, Hr as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, D as WatermarkDialog, ms as ZoomControl, yt as acceptAutocompleteSuggestion, bt as acceptAutocompleteWord, pt as anonymizationDecorationsKey, Y as appendAutocompleteToken, Pn as applyFolioAIEditOperations, Yr as applySuggestions, xt as autocompleteSuggestionKey, St as autocompleteSuggestionPlugin, Qr as buildPositionalText, Ct as clearAutocompleteSuggestion, Cn as clearTemplateSlashMenu, le as colorModePlugin, wn as consumeTemplateSlashQuery, ii as createAICitationDecorationsPlugin, qr as createDocx, Lr as createEmptyDocument, Rn as createFolioAIEditSnapshot, Ur as createStellaStyleDocumentPreset, Wr as createStellaStyleSet, C as defaultColorMode, e as defaultLocale, sr as deriveBlockId, Bn as diffWordSegments, Rr as extractDocumentStyleSet, zr as extractDocumentStyleSetFromDocx, wt as finishAutocompleteSuggestion, si as fromMarkdown, mt as getAnonymizationMatches, Tt as getAutocompleteSuggestion, at as getDocumentWatermark, ni as getFolioCaretViewportRect, cr as getFolioParaIdFromBlockId, ri as getFolioSelectionViewportRect, en as getTemplateDirectives, Tn as getTemplateSlashMenu, Wn as hashFolioAIBlockText, u as i18nPlugin, He as insertImageFromFile, We as insertPageBreakInView, Ke as insertTableInView, Je as insertTableOfContentsInView, Br as inspectDocumentStyles, Vr as inspectDocumentStylesFromDocx, ur as isFolioBlockId, dr as isSequentialFolioBlockId, Xr as isSuggestionStale, Gn as normalizeFolioAIBlockText, w as provideColorMode, n as provideLocale, hs as renderAsync, En as resetTemplateSlashQuery, Zr as resolveSuggestionAnchor, nn as scanDirectives, ti as scrollFolioPositionIntoView, ai as setAICitationsMeta, $r as setAISuggestionsMeta, oi as setActiveCitationMeta, gt as setAnonymizationTermsMeta, st as setDocumentWatermark, ei as setFocusedSuggestionMeta, Sn as setTemplatePreviewValues, Dt as shouldTriggerAutocomplete, Ot as startAutocompleteSuggestion, Dn as templateSlashMenuKey, ci as toMarkdown, li as toMarkdownResult, de as useColorMode, r as useTranslation, ue as useWheelZoom };