@harbour-enterprises/superdoc 0.23.0-next.6 → 0.23.0-next.8

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.
@@ -11,10 +11,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
12
  import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, at as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as runPropertyTranslators, aG as translator, aH as translator$1, aI as translator$2, aJ as translator$3, aK as translator$4, aL as translator$5, aM as translator$6, aN as translator$7, aO as translator$8, aP as translator$9, aQ as translator$a, aR as translator$b, aS as translator$c, aT as translator$d, aU as translator$e, aV as translator$f, aW as translator$g, aX as translator$h, aY as translator$i, aZ as translator$j, a_ as translator$k, a$ as translator$l, b0 as translator$m, b1 as translator$n, b2 as translator$o, b3 as translator$p, b4 as translator$q, b5 as translator$r, b6 as translator$s, b7 as translator$t, b8 as translator$u, b9 as translator$v, ba as translator$w, bb as translator$x, bc as translator$y, bd as translator$z, be as translator$A, bf as translator$B, bg as translator$C, bh as translator$D, bi as translator$E, bj as translator$F, bk as translator$G, bl as translator$H, bm as translator$I, bn as translator$J, bo as translator$K, bp as translator$L, bq as translator$M, br as translator$N, bs as translator$O, bt as translator$P, bu as translator$Q, bv as translator$R, bw as translator$S, bx as translator$T, by as translator$U, bz as translator$V, bA as translator$W, bB as translator$X, bC as translator$Y, bD as translator$Z, bE as translator$_, bF as translator$$, bG as translator$10, bH as translator$11, bI as translator$12, a as Plugin } from "./chunks/converter-ClnqoStR.js";
13
13
  import { bJ, a5, i, a2 } from "./chunks/converter-ClnqoStR.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-DLan-MJ6.js";
15
- import { n, C, o, T, l, p, m } from "./chunks/editor-DLan-MJ6.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-Co2_vpme.js";
15
+ import { n, C, o, T, l, p, m } from "./chunks/editor-Co2_vpme.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-CekMv4Mk.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-Bevq4gO1.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
19
  import { D } from "./chunks/docx-zipper-DC28ucAi.js";
20
20
  import { createZip } from "./file-zipper.es.js";
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-CekMv4Mk.js";
3
- import "./chunks/editor-DLan-MJ6.js";
2
+ import { T } from "./chunks/toolbar-Bevq4gO1.js";
3
+ import "./chunks/editor-Co2_vpme.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C8gNFcB_.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-COK5ynTl.cjs");
4
4
  require("./chunks/vue-DKMj1I9B.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-C9Ql0kHS.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-CINrYeD9.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C8gNFcB_.cjs");
4
- const superdoc = require("./chunks/index-9hY1WuxT.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-COK5ynTl.cjs");
4
+ const superdoc = require("./chunks/index-Mh8HFZBp.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  require("./chunks/jszip-B4LDL19y.cjs");
7
7
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C9Ql0kHS.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-DTw4eF5D.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CINrYeD9.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-CPu7VToO.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import "./chunks/jszip-DAXEPCUv.es.js";
5
5
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -62101,7 +62101,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62101
62101
  * This will update every field that matches the given alias.
62102
62102
  * If any updated node does not match the schema, no updates will be applied.
62103
62103
  * @category Command
62104
- * @param {string} alias - Shared identifier for fields (e.g., "customer_name")
62104
+ * @param {string | string[]} alias - Shared identifier for fields (e.g., "customer_name")
62105
62105
  * @param {StructuredContentUpdate} options
62106
62106
  */
62107
62107
  updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
@@ -62110,35 +62110,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62110
62110
  return true;
62111
62111
  }
62112
62112
  const { schema } = editor;
62113
- const updates = [];
62114
- for (const { pos, node } of structuredContentTags) {
62115
- let content = null;
62113
+ const createContent = (node) => {
62116
62114
  if (options.text) {
62117
- content = schema.text(options.text);
62115
+ return schema.text(options.text);
62118
62116
  }
62119
62117
  if (options.html) {
62120
62118
  const html = htmlHandler(options.html, editor);
62121
62119
  const doc2 = DOMParser$1.fromSchema(schema).parse(html);
62122
- content = doc2.content;
62120
+ return doc2.content;
62123
62121
  }
62124
62122
  if (options.json) {
62125
- content = schema.nodeFromJSON(options.json);
62126
- }
62127
- if (!content) {
62128
- content = node.content;
62123
+ return schema.nodeFromJSON(options.json);
62129
62124
  }
62125
+ return node.content;
62126
+ };
62127
+ for (const { node } of structuredContentTags) {
62128
+ const content = createContent(node);
62130
62129
  const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
62131
62130
  try {
62132
62131
  updatedNode.check();
62133
- updates.push({ pos, node: updatedNode, size: node.nodeSize });
62134
62132
  } catch {
62135
62133
  console.error("Updated node does not conform to the schema");
62136
62134
  return false;
62137
62135
  }
62138
62136
  }
62139
62137
  if (dispatch) {
62140
- updates.reverse().forEach(({ pos, node, size: size2 }) => {
62141
- tr.replaceWith(pos, pos + size2, node);
62138
+ structuredContentTags.forEach(({ pos, node }) => {
62139
+ const mappedPos = tr.mapping.map(pos);
62140
+ const currentNode = tr.doc.nodeAt(mappedPos);
62141
+ if (currentNode && node.eq(currentNode)) {
62142
+ const content = createContent(node);
62143
+ const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
62144
+ tr.replaceWith(mappedPos, mappedPos + node.nodeSize, updatedNode);
62145
+ }
62142
62146
  });
62143
62147
  }
62144
62148
  return true;
@@ -79084,7 +79088,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
79084
79088
  };
79085
79089
  const handleInputSubmit = () => {
79086
79090
  const value = inlineTextInput.value;
79087
- const cleanValue = value.replace(/[^0-9]/g, "");
79091
+ const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
79088
79092
  emit2("textSubmit", cleanValue);
79089
79093
  inlineTextInput.value = cleanValue;
79090
79094
  };
@@ -79166,7 +79170,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
79166
79170
  };
79167
79171
  }
79168
79172
  };
79169
- const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-303b3245"]]);
79173
+ const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-cea02a58"]]);
79170
79174
  const _hoisted_1$2$2 = {
79171
79175
  class: "toolbar-separator",
79172
79176
  role: "separator",