@harbour-enterprises/superdoc 0.9.23 → 0.9.25

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.
@@ -16111,7 +16111,7 @@ const dt = class dt {
16111
16111
  return;
16112
16112
  }
16113
16113
  }
16114
- static updateDocumentVersion(e = this.convertedXml, t = "0.9.23") {
16114
+ static updateDocumentVersion(e = this.convertedXml, t = "0.9.25") {
16115
16115
  const n = "docProps/custom.xml";
16116
16116
  e[n] || (e[n] = Au());
16117
16117
  const i = e["docProps/custom.xml"];
@@ -16336,7 +16336,7 @@ function Jm(r) {
16336
16336
  function Au() {
16337
16337
  return Nf;
16338
16338
  }
16339
- function Du(r = 2, e = "0.9.23") {
16339
+ function Du(r = 2, e = "0.9.25") {
16340
16340
  return {
16341
16341
  type: "element",
16342
16342
  name: "property",
@@ -1,4 +1,4 @@
1
- import { p as Tt, O as wt, B as ut, Q as Bt, U as Rt } from "./converter-DpRzc-Wm.js";
1
+ import { p as Tt, O as wt, B as ut, Q as Bt, U as Rt } from "./converter-sW9TD9S-.js";
2
2
  function kt(bt) {
3
3
  throw new Error('Could not dynamically require "' + bt + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -7,9 +7,9 @@ var P = (t, e, n) => ff(t, typeof e != "symbol" ? e + "" : e, n), Ho = (t, e, n)
7
7
  var Qe = (t, e, n) => (Ho(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ft = (t, e, n) => e.has(t) ? Gs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), jo = (t, e, n, r) => (Ho(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), I = (t, e, n) => (Ho(t, e, "access private method"), n);
8
8
  import * as T from "yjs";
9
9
  import { UndoManager as pf, Item as hf, ContentType as mf, Text as gf, XmlElement as yf } from "yjs";
10
- import { P as G, a as Z, M as lr, N as B, S as J, T as V, b as H, D as zn, F as E, c as Mn, d as bf, e as Jl, A as Mr, p as ie, B as wf, f as Yl, i as vf, g as wt, l as Ar, h as jt, j as Gl, r as Zl, R as an, o as cr, k as Vt, m as bi, n as Ql, q as ue, s as Ve, v as Do, t as vn, u as kf, w as xe, x as to, y as ec, z as kn, C as Wo, E as Uo, G as qo, H as no, I as Cf, J as Zs, K as Sf, L as xf } from "./converter-DpRzc-Wm.js";
10
+ import { P as G, a as Z, M as lr, N as B, S as J, T as V, b as H, D as zn, F as E, c as Mn, d as bf, e as Jl, A as Mr, p as ie, B as wf, f as Yl, i as vf, g as wt, l as Ar, h as jt, j as Gl, r as Zl, R as an, o as cr, k as Vt, m as bi, n as Ql, q as ue, s as Ve, v as Do, t as vn, u as kf, w as xe, x as to, y as ec, z as kn, C as Wo, E as Uo, G as qo, H as no, I as Cf, J as Zs, K as Sf, L as xf } from "./converter-sW9TD9S-.js";
11
11
  import { ref as Qs, computed as Mf, createElementBlock as Xt, openBlock as Jt, withModifiers as Ko, Fragment as Af, renderList as Of, normalizeClass as Tf, createCommentVNode as ea, toDisplayString as Xo, createElementVNode as Df, createApp as Nf } from "vue";
12
- import { D as ta } from "./docx-zipper-tpHTzIXH.js";
12
+ import { D as ta } from "./docx-zipper-CtBfaHzU.js";
13
13
  function No(t) {
14
14
  const { from: e, to: n, empty: r } = t.selection, o = [];
15
15
  return r ? (t.storedMarks && o.push(...t.storedMarks), o.push(...t.selection.$head.marks())) : t.doc.nodesBetween(e, n, (i) => {
@@ -8416,7 +8416,7 @@ const Cy = (t, e = {}) => ({ state: n, dispatch: r }) => {
8416
8416
  const { selection: g, storedMarks: b } = r, { splittableMarks: w } = i.extensionService, C = b || g.$to.parentOffset && g.$from.marks();
8417
8417
  if (n.split(a.pos, 2, m).scrollIntoView(), !C || !o) return !0;
8418
8418
  const y = C.filter((S) => w.includes(S.type.name));
8419
- n.ensureMarks(y);
8419
+ n.ensureMarks(y), n.setMeta("splitListItem", y);
8420
8420
  }
8421
8421
  return !0;
8422
8422
  }, Dy = (t) => ({ state: e, dispatch: n }) => {
@@ -10018,7 +10018,7 @@ const Js = class Js extends ag {
10018
10018
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
10019
10019
  */
10020
10020
  processCollaborationMigrations() {
10021
- if (console.debug("[checkVersionMigrations] Current editor version", "0.9.23"), !this.options.ydoc) return;
10021
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.9.25"), !this.options.ydoc) return;
10022
10022
  let r = this.options.ydoc.getMap("meta").get("version");
10023
10023
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
10024
10024
  const o = Qa(r) || [], s = this.state.plugins.find((c) => c.key.startsWith("y-sync"));
@@ -11221,7 +11221,7 @@ function Db(t) {
11221
11221
  listLevel: _
11222
11222
  };
11223
11223
  });
11224
- }), l ? s : null;
11224
+ }), s.setMeta("orderedListMarker", !0), l ? s : null;
11225
11225
  }
11226
11226
  });
11227
11227
  }
@@ -11493,12 +11493,12 @@ function Hb(t = {}) {
11493
11493
  return F.create(n.doc, r);
11494
11494
  },
11495
11495
  apply(e, n, r, o) {
11496
- if (!e.docChanged) return n;
11497
- const i = [
11498
- ...rl(o),
11496
+ if (!e.docChanged || e.getMeta("orderedListMarker")) return n;
11497
+ const s = e.getMeta("splitListItem"), a = [
11498
+ ...rl(o, s),
11499
11499
  ...ol(o)
11500
11500
  ];
11501
- return F.create(o.doc, i);
11501
+ return F.create(o.doc, a);
11502
11502
  }
11503
11503
  },
11504
11504
  props: {
@@ -11508,33 +11508,35 @@ function Hb(t = {}) {
11508
11508
  }
11509
11509
  });
11510
11510
  }
11511
- function rl(t) {
11512
- let { doc: e, storedMarks: n } = t, r = [], o = Ls(e, (i) => i.type.name === "listItem");
11513
- return o.length && o.forEach(({ node: i, pos: s }) => {
11514
- let a = [], l = xt("textStyle", e.type.schema);
11515
- if (Wb(i) && n) {
11516
- let g = n.filter((b) => b.type === l);
11517
- a.push(...g);
11511
+ function rl(t, e = []) {
11512
+ let { doc: n, storedMarks: r } = t, o = [];
11513
+ Array.isArray(r) && e.push(...r);
11514
+ let i = Ls(n, (s) => s.type.name === "listItem");
11515
+ return i.length && i.forEach(({ node: s, pos: a }) => {
11516
+ let l = xt("textStyle", n.type.schema), c = [...e.filter((b) => b.type === l)];
11517
+ if (Wb(s) && e.length) {
11518
+ const b = e.filter((w) => w.type === l);
11519
+ c.push(...b);
11518
11520
  } else {
11519
- let g = jb(i, e, l);
11520
- a.push(...g);
11521
- }
11522
- let d = null, u = null;
11523
- a.forEach((g) => {
11524
- let { attrs: b } = g;
11525
- if (b.fontSize && !d) {
11526
- let [w, C] = Ct(b.fontSize);
11527
- Number.isNaN(w) || (C = C ?? "pt", d = `${w}${C}`);
11521
+ const b = jb(s, n, l);
11522
+ c.push(...b);
11523
+ }
11524
+ let u = null, f = null;
11525
+ c.forEach((b) => {
11526
+ let { attrs: w } = b;
11527
+ if (w.fontSize && !u) {
11528
+ let [C, y] = Ct(w.fontSize);
11529
+ Number.isNaN(C) || (y = y ?? "pt", u = `${C}${y}`);
11528
11530
  }
11529
- b.fontFamily && !u && (u = b.fontFamily);
11531
+ w.fontFamily && !f && (f = w.fontFamily);
11530
11532
  });
11531
- let f = {
11532
- style: `--marker-font-size: ${d ?? "initial"}`
11533
- }, p = {
11534
- style: `--marker-font-family: ${u ?? "initial"}`
11535
- }, h = N.mergeAttributes(f, p), m = z.node(s, s + i.nodeSize, h);
11536
- r.push(m);
11537
- }), r;
11533
+ let p = {
11534
+ style: `--marker-font-size: ${u ?? "initial"}`
11535
+ }, h = {
11536
+ style: `--marker-font-family: ${f ?? "initial"}`
11537
+ }, m = N.mergeAttributes(p, h), g = z.node(a, a + s.nodeSize, m);
11538
+ o.push(g);
11539
+ }), o;
11538
11540
  }
11539
11541
  function ol(t) {
11540
11542
  let { doc: e } = t, n = [], r = Ls(e, (o) => o.type.name === "listItem");
@@ -11657,12 +11659,20 @@ const tu = Y.create({
11657
11659
  getCurrentListNode: () => ({ state: t }) => je((e) => e.type.name === this.name)(t.selection),
11658
11660
  increaseListIndent: () => ({ commands: t }) => t.sinkListItem(this.name) ? (t.updateNodeStyle(), t.updateOrderedListStyleType(), !0) : !1,
11659
11661
  decreaseListIndent: () => ({ commands: t }) => {
11660
- const e = t.getCurrentList(), n = t.getCurrentListNode(), r = e?.node?.children.findIndex((s) => s === n.node), o = n?.pos + n?.node.nodeSize, i = e?.node?.children.slice(r + 1) || [];
11661
- return t.liftListItem(this.name) ? (t.updateNodeStyle(), t.updateOrderedListStyleType(), t.restartListNodes(i, o), !0) : !1;
11662
+ const e = t.getCurrentList();
11663
+ if (e?.depth === 1) return !1;
11664
+ if (!t.liftListItem(this.name))
11665
+ return !0;
11666
+ if (!t.updateNodeStyle())
11667
+ return !1;
11668
+ const r = t.getCurrentListNode(), o = e?.node?.children.findIndex((a) => a === r.node), i = r?.pos + r?.node.nodeSize, s = e?.node?.children.slice(o + 1) || [];
11669
+ return t.updateOrderedListStyleType(), t.restartListNodes(s, i), !0;
11662
11670
  },
11663
11671
  updateNodeStyle: () => ({ tr: t, state: e }) => {
11664
11672
  let n = je((s) => s.type.name === "orderedList")(t.selection);
11665
- const r = je((s) => s.type.name === this.name)(e.selection), o = n?.node.children[0]?.attrs, i = t.mapping.map(r.pos);
11673
+ const r = je((s) => s.type.name === this.name)(e.selection);
11674
+ if (!n) return !1;
11675
+ const o = n?.node.children[0]?.attrs, i = t.mapping.map(r.pos);
11666
11676
  return t.setNodeMarkup(i, void 0, {
11667
11677
  ...o
11668
11678
  }), !0;
@@ -1,6 +1,6 @@
1
1
  import { computed as _, createElementBlock as se, openBlock as q, createElementVNode as pn, createCommentVNode as pe, normalizeClass as Zt, normalizeStyle as Jt, ref as R, unref as W, createBlock as Ge, toDisplayString as ni, withDirectives as dt, withKeys as Nr, withModifiers as Hr, vModelText as jr, getCurrentInstance as _t, createVNode as Et, readonly as Qt, watch as we, onMounted as Ke, onBeforeUnmount as Be, reactive as Ks, onBeforeMount as dr, inject as te, onActivated as Vs, onDeactivated as ri, createTextVNode as At, Fragment as _e, Comment as fr, defineComponent as ee, provide as Se, h as E, Teleport as Us, toRef as ie, nextTick as Gs, renderSlot as Xs, isVNode as qs, shallowRef as Ys, watchEffect as ft, mergeProps as pt, Transition as en, vShow as Zs, cloneVNode as Js, Text as Qs, renderList as el, withCtx as Bn } from "vue";
2
- import { p as tn } from "./converter-DpRzc-Wm.js";
3
- import { _ as vt, g as Pt } from "./editor-DSlpsUzO.js";
2
+ import { p as tn } from "./converter-sW9TD9S-.js";
3
+ import { _ as vt, g as Pt } from "./editor--8YB7Owp.js";
4
4
  const Mp = (e, t) => {
5
5
  let n = e.replace(/[^0-9.]/g, "");
6
6
  return n = parseFloat(n), isNaN(n) && (n = t), n = parseFloat(n), n;
@@ -1,4 +1,4 @@
1
- import { G as o } from "./chunks/converter-DpRzc-Wm.js";
1
+ import { G as o } from "./chunks/converter-sW9TD9S-.js";
2
2
  export {
3
3
  o as SuperConverter
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"splitListItem.d.ts","sourceRoot":"","sources":["../../../src/core/commands/splitListItem.js"],"names":[],"mappings":"AAcO,iDAAuC,UAAK,aAqGlD"}
1
+ {"version":3,"file":"splitListItem.d.ts","sourceRoot":"","sources":["../../../src/core/commands/splitListItem.js"],"names":[],"mappings":"AAcO,iDAAuC,UAAK,aAwGlD"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-DpRzc-Wm.js";
2
- import { D as a } from "./chunks/docx-zipper-tpHTzIXH.js";
1
+ import "./chunks/converter-sW9TD9S-.js";
2
+ import { D as a } from "./chunks/docx-zipper-CtBfaHzU.js";
3
3
  export {
4
4
  a as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E as m } from "./chunks/editor-DSlpsUzO.js";
2
- import "./chunks/converter-DpRzc-Wm.js";
3
- import "./chunks/docx-zipper-tpHTzIXH.js";
1
+ import { E as m } from "./chunks/editor--8YB7Owp.js";
2
+ import "./chunks/converter-sW9TD9S-.js";
3
+ import "./chunks/docx-zipper-CtBfaHzU.js";
4
4
  export {
5
5
  m as Editor
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"styledListMarkerPlugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/list-item/helpers/styledListMarkerPlugin.js"],"names":[],"mappings":"AAMA,sEA6BC;8BAlCyC,kBAAkB;uBAD1B,mBAAmB"}
1
+ {"version":3,"file":"styledListMarkerPlugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/list-item/helpers/styledListMarkerPlugin.js"],"names":[],"mappings":"AAMA,sEAkCC;8BAvCyC,kBAAkB;uBAD1B,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../src/extensions/list-item/list-item.js"],"names":[],"mappings":"AAKA,2BA8KG"}
1
+ {"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../src/extensions/list-item/list-item.js"],"names":[],"mappings":"AAKA,2BAmLG"}
@@ -1 +1 @@
1
- {"version":3,"file":"orderedListMarkerPlugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/ordered-list/helpers/orderedListMarkerPlugin.js"],"names":[],"mappings":"AAEA,4DA4GC;uBA9GiC,mBAAmB"}
1
+ {"version":3,"file":"orderedListMarkerPlugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/ordered-list/helpers/orderedListMarkerPlugin.js"],"names":[],"mappings":"AAEA,4DA6GC;uBA/GiC,mBAAmB"}
@@ -1,4 +1,4 @@
1
- import { J as p } from "./chunks/docx-zipper-tpHTzIXH.js";
1
+ import { J as p } from "./chunks/docx-zipper-CtBfaHzU.js";
2
2
  async function c(o, t) {
3
3
  const e = new p();
4
4
  return o.forEach((i, n) => {
@@ -6,13 +6,13 @@ var rt = (t, s, o) => s in t ? at(t, s, { enumerable: !0, configurable: !0, writ
6
6
  var Ie = (t, s, o) => rt(t, typeof s != "symbol" ? s + "" : s, o), ze = (t, s, o) => s.has(t) || Ne("Cannot " + o);
7
7
  var we = (t, s, o) => (ze(t, s, "read from private field"), o ? o.call(t) : s.get(t)), Le = (t, s, o) => s.has(t) ? Ne("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, o);
8
8
  var O = (t, s, o) => (ze(t, s, "access private method"), o);
9
- import { _ as K, a as Ue, b as ct, I as Me, f as dt, c as Pe, d as ut, i as mt, u as pt, r as ft, E as De, e as ht, P as vt, h as gt, j as yt, A as bt, N as kt } from "./chunks/editor-DSlpsUzO.js";
10
- import { C as ko, T as Co, l as _o, n as wo, k as xo, m as Eo } from "./chunks/editor-DSlpsUzO.js";
11
- import { Q as Ct, v as _t, V as wt, T as Ve, a as xt } from "./chunks/converter-DpRzc-Wm.js";
12
- import { G as To } from "./chunks/converter-DpRzc-Wm.js";
9
+ import { _ as K, a as Ue, b as ct, I as Me, f as dt, c as Pe, d as ut, i as mt, u as pt, r as ft, E as De, e as ht, P as vt, h as gt, j as yt, A as bt, N as kt } from "./chunks/editor--8YB7Owp.js";
10
+ import { C as ko, T as Co, l as _o, n as wo, k as xo, m as Eo } from "./chunks/editor--8YB7Owp.js";
11
+ import { Q as Ct, v as _t, V as wt, T as Ve, a as xt } from "./chunks/converter-sW9TD9S-.js";
12
+ import { G as To } from "./chunks/converter-sW9TD9S-.js";
13
13
  import { ref as g, createElementBlock as C, openBlock as k, createElementVNode as x, unref as $, getCurrentInstance as Et, computed as j, watch as St, onMounted as ke, createCommentVNode as ee, withDirectives as Tt, withKeys as At, normalizeClass as te, withModifiers as be, vModelText as Ft, createTextVNode as It, toDisplayString as ne, Fragment as U, renderList as J, normalizeStyle as Y, createVNode as P, h as W, createApp as Lt, reactive as We, onUnmounted as Mt, shallowRef as qe, onBeforeUnmount as Ge, createBlock as Dt } from "vue";
14
- import { t as G, s as $t, T as Bt, N as Z } from "./chunks/toolbar-CDed0wTy.js";
15
- import { D as Fo } from "./chunks/docx-zipper-tpHTzIXH.js";
14
+ import { t as G, s as $t, T as Bt, N as Z } from "./chunks/toolbar-DxQCXy5M.js";
15
+ import { D as Fo } from "./chunks/docx-zipper-CtBfaHzU.js";
16
16
  import { createZip as Lo } from "./file-zipper.es.js";
17
17
  var Ke = { exports: {} };
18
18
  (function(t) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T as p } from "./chunks/toolbar-CDed0wTy.js";
3
- import "./chunks/editor-DSlpsUzO.js";
2
+ import { T as p } from "./chunks/toolbar-DxQCXy5M.js";
3
+ import "./chunks/editor--8YB7Owp.js";
4
4
  export {
5
5
  p as default
6
6
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/super-editor.es-6eI_Ba7J.cjs");require("./chunks/vue-Ckf0DkDN.cjs");exports.BasicUpload=e.ho;exports.CommentsPluginKey=e.me;exports.DocxZipper=e.Nt;exports.Editor=e.ji;exports.Extensions=e.go;exports.SuperConverter=e.kt;exports.SuperEditor=e.fo;exports.SuperInput=e.vo;exports.SuperToolbar=e.po;exports.Toolbar=e._p;exports.TrackChangesBasePluginKey=e.de;exports.createZip=e.c;exports.fieldAnnotationHelpers=e.Wk;exports.getActiveFormatting=e.Ef;exports.getAllowedImageDimensions=e.Gn;exports.getMarksFromSelection=e.No;exports.getRichTextExtensions=e.Ik;exports.getStarterExtensions=e.Pk;exports.helpers=e.Sd;exports.trackChangesHelpers=e.qk;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/super-editor.es-h2nZfGPP.cjs");require("./chunks/vue-Ckf0DkDN.cjs");exports.BasicUpload=e.ho;exports.CommentsPluginKey=e.me;exports.DocxZipper=e.Nt;exports.Editor=e.ji;exports.Extensions=e.go;exports.SuperConverter=e.kt;exports.SuperEditor=e.fo;exports.SuperInput=e.vo;exports.SuperToolbar=e.po;exports.Toolbar=e._p;exports.TrackChangesBasePluginKey=e.de;exports.createZip=e.c;exports.fieldAnnotationHelpers=e.Wk;exports.getActiveFormatting=e.Ef;exports.getAllowedImageDimensions=e.Gn;exports.getMarksFromSelection=e.No;exports.getRichTextExtensions=e.Ik;exports.getStarterExtensions=e.Pk;exports.helpers=e.Sd;exports.trackChangesHelpers=e.qk;
@@ -1,4 +1,4 @@
1
- import { h as t, m as r, N as o, j as n, g as i, k as p, f as g, v as l, p as c, _ as m, d as u, c as S, W as d, E as x, G as E, a as h, I as k, P as C, S as T, q as f } from "./chunks/super-editor.es-B-EAaHla.es.js";
1
+ import { h as t, m as r, N as o, j as n, g as i, k as p, f as g, v as l, p as c, _ as m, d as u, c as S, W as d, E as x, G as E, a as h, I as k, P as C, S as T, q as f } from "./chunks/super-editor.es-CIN79FjT.es.js";
2
2
  import "./chunks/vue-BDbTsTMu.es.js";
3
3
  export {
4
4
  t as BasicUpload,