@harbour-enterprises/superdoc 0.17.1 → 0.17.2

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.
Files changed (25) hide show
  1. package/dist/chunks/{PdfViewer-CdQaViwe.es.js → PdfViewer-6H4_b2ZT.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-B8JzHLrU.cjs → PdfViewer-D3TZQGhX.cjs} +1 -1
  3. package/dist/chunks/{index-CVp87_VW.cjs → index-HYXkzjPW.cjs} +3 -3
  4. package/dist/chunks/{index-B1qS_V43.es.js → index-M_voHCSh.es.js} +3 -3
  5. package/dist/chunks/{super-editor.es-CHzSx5FH.cjs → super-editor.es-ChJNDS8S.cjs} +32 -6
  6. package/dist/chunks/{super-editor.es-Cx4I-VrC.es.js → super-editor.es-Cwq4Yz00.es.js} +32 -6
  7. package/dist/super-editor/ai-writer.es.js +2 -2
  8. package/dist/super-editor/chunks/{converter-B_IuCnqV.js → converter-CEUnrj5c.js} +31 -5
  9. package/dist/super-editor/chunks/{docx-zipper-C_Qak38x.js → docx-zipper-oH8QMMXL.js} +1 -1
  10. package/dist/super-editor/chunks/{editor-DrBQYZYl.js → editor-C6i6Nz_X.js} +3 -3
  11. package/dist/super-editor/chunks/{toolbar-CnAXgAhs.js → toolbar-CGqVRPKn.js} +2 -2
  12. package/dist/super-editor/converter.es.js +1 -1
  13. package/dist/super-editor/docx-zipper.es.js +2 -2
  14. package/dist/super-editor/editor.es.js +3 -3
  15. package/dist/super-editor/file-zipper.es.js +1 -1
  16. package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +15 -0
  17. package/dist/super-editor/super-editor.es.js +6 -6
  18. package/dist/super-editor/toolbar.es.js +2 -2
  19. package/dist/super-editor.cjs +1 -1
  20. package/dist/super-editor.es.js +1 -1
  21. package/dist/superdoc.cjs +2 -2
  22. package/dist/superdoc.es.js +2 -2
  23. package/dist/superdoc.umd.js +33 -7
  24. package/dist/superdoc.umd.js.map +1 -1
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-B1qS_V43.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-M_voHCSh.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-CVp87_VW.cjs");
4
+ const superdoc = require("./index-HYXkzjPW.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-CHzSx5FH.cjs");
2
+ const superEditor_es = require("./super-editor.es-ChJNDS8S.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -17265,7 +17265,7 @@ const _sfc_main = {
17265
17265
  __name: "SuperDoc",
17266
17266
  emits: ["selection-update"],
17267
17267
  setup(__props, { emit: __emit }) {
17268
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B8JzHLrU.cjs")));
17268
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-D3TZQGhX.cjs")));
17269
17269
  const superdocStore = useSuperdocStore();
17270
17270
  const commentsStore = useCommentsStore();
17271
17271
  const {
@@ -17909,7 +17909,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
17909
17909
  this.config.colors = shuffleArray(this.config.colors);
17910
17910
  this.userColorMap = /* @__PURE__ */ new Map();
17911
17911
  this.colorIndex = 0;
17912
- this.version = "0.17.0";
17912
+ this.version = "0.17.1";
17913
17913
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17914
17914
  this.superdocId = config.superdocId || uuid.v4();
17915
17915
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-Cx4I-VrC.es.js";
1
+ import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-Cwq4Yz00.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -17248,7 +17248,7 @@ const _sfc_main = {
17248
17248
  __name: "SuperDoc",
17249
17249
  emits: ["selection-update"],
17250
17250
  setup(__props, { emit: __emit }) {
17251
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CdQaViwe.es.js"));
17251
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-6H4_b2ZT.es.js"));
17252
17252
  const superdocStore = useSuperdocStore();
17253
17253
  const commentsStore = useCommentsStore();
17254
17254
  const {
@@ -17892,7 +17892,7 @@ class SuperDoc extends EventEmitter {
17892
17892
  this.config.colors = shuffleArray(this.config.colors);
17893
17893
  this.userColorMap = /* @__PURE__ */ new Map();
17894
17894
  this.colorIndex = 0;
17895
- this.version = "0.17.0";
17895
+ this.version = "0.17.1";
17896
17896
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17897
17897
  this.superdocId = config.superdocId || v4();
17898
17898
  this.colors = this.config.colors;
@@ -29619,7 +29619,7 @@ const createDocumentJson = (docx, converter, editor) => {
29619
29619
  const content = pruneIgnoredNodes(contentElements);
29620
29620
  const comments = importCommentData({ docx, converter, editor });
29621
29621
  const lists = {};
29622
- const parsedContent = nodeListHandler2.handler({
29622
+ let parsedContent = nodeListHandler2.handler({
29623
29623
  nodes: content,
29624
29624
  nodeListHandler: nodeListHandler2,
29625
29625
  docx,
@@ -29627,6 +29627,7 @@ const createDocumentJson = (docx, converter, editor) => {
29627
29627
  editor,
29628
29628
  lists
29629
29629
  });
29630
+ parsedContent = filterOutRootInlineNodes(parsedContent);
29630
29631
  const result = {
29631
29632
  type: "doc",
29632
29633
  content: parsedContent,
@@ -29902,7 +29903,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29902
29903
  let sectionType = sectPrHeader?.attributes["w:type"];
29903
29904
  if (converter.headerIds[sectionType]) sectionType = null;
29904
29905
  const nodeListHandler2 = defaultNodeListHandler();
29905
- const schema = nodeListHandler2.handler({
29906
+ let schema = nodeListHandler2.handler({
29906
29907
  nodes: referenceFile.elements[0].elements,
29907
29908
  nodeListHandler: nodeListHandler2,
29908
29909
  docx,
@@ -29910,6 +29911,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29910
29911
  editor,
29911
29912
  filename: currentFileName
29912
29913
  });
29914
+ schema = filterOutRootInlineNodes(schema);
29913
29915
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
29914
29916
  converter.headerIds.ids.push(rId);
29915
29917
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -29924,7 +29926,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29924
29926
  );
29925
29927
  const sectionType = sectPrFooter?.attributes["w:type"];
29926
29928
  const nodeListHandler2 = defaultNodeListHandler();
29927
- const schema = nodeListHandler2.handler({
29929
+ let schema = nodeListHandler2.handler({
29928
29930
  nodes: referenceFile.elements[0].elements,
29929
29931
  nodeListHandler: nodeListHandler2,
29930
29932
  docx,
@@ -29932,6 +29934,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29932
29934
  editor,
29933
29935
  filename: currentFileName
29934
29936
  });
29937
+ schema = filterOutRootInlineNodes(schema);
29935
29938
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
29936
29939
  converter.footerIds.ids.push(rId);
29937
29940
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -29959,6 +29962,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
29959
29962
  currentFileName
29960
29963
  };
29961
29964
  };
29965
+ function filterOutRootInlineNodes(content = []) {
29966
+ if (!Array.isArray(content) || content.length === 0) return content;
29967
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
29968
+ "text",
29969
+ "bookmarkStart",
29970
+ "lineBreak",
29971
+ "hardBreak",
29972
+ "pageNumber",
29973
+ "totalPageCount",
29974
+ "runItem",
29975
+ "image",
29976
+ "tab",
29977
+ "fieldAnnotation",
29978
+ "mention",
29979
+ "contentBlock",
29980
+ "aiLoaderNode",
29981
+ "commentRangeStart",
29982
+ "commentRangeEnd",
29983
+ "commentReference",
29984
+ "structuredContent"
29985
+ ]);
29986
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
29987
+ }
29962
29988
  function getNumberingDefinitions(docx) {
29963
29989
  let numbering = docx["word/numbering.xml"];
29964
29990
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -30185,7 +30211,7 @@ const _SuperConverter = class _SuperConverter2 {
30185
30211
  return;
30186
30212
  }
30187
30213
  }
30188
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.0") {
30214
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.1") {
30189
30215
  const customLocation = "docProps/custom.xml";
30190
30216
  if (!docx[customLocation]) {
30191
30217
  docx[customLocation] = generateCustomXml();
@@ -30667,7 +30693,7 @@ function storeSuperdocVersion(docx) {
30667
30693
  function generateCustomXml() {
30668
30694
  return DEFAULT_CUSTOM_XML;
30669
30695
  }
30670
- function generateSuperdocVersion(pid = 2, version2 = "0.17.0") {
30696
+ function generateSuperdocVersion(pid = 2, version2 = "0.17.1") {
30671
30697
  return {
30672
30698
  type: "element",
30673
30699
  name: "property",
@@ -47527,7 +47553,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
47527
47553
  * @returns {Object | void} Migration results
47528
47554
  */
47529
47555
  processCollaborationMigrations() {
47530
- console.debug("[checkVersionMigrations] Current editor version", "0.17.0");
47556
+ console.debug("[checkVersionMigrations] Current editor version", "0.17.1");
47531
47557
  if (!this.options.ydoc) return;
47532
47558
  const metaMap = this.options.ydoc.getMap("meta");
47533
47559
  let docVersion = metaMap.get("version");
@@ -29602,7 +29602,7 @@ const createDocumentJson = (docx, converter, editor) => {
29602
29602
  const content = pruneIgnoredNodes(contentElements);
29603
29603
  const comments = importCommentData({ docx, converter, editor });
29604
29604
  const lists = {};
29605
- const parsedContent = nodeListHandler2.handler({
29605
+ let parsedContent = nodeListHandler2.handler({
29606
29606
  nodes: content,
29607
29607
  nodeListHandler: nodeListHandler2,
29608
29608
  docx,
@@ -29610,6 +29610,7 @@ const createDocumentJson = (docx, converter, editor) => {
29610
29610
  editor,
29611
29611
  lists
29612
29612
  });
29613
+ parsedContent = filterOutRootInlineNodes(parsedContent);
29613
29614
  const result = {
29614
29615
  type: "doc",
29615
29616
  content: parsedContent,
@@ -29885,7 +29886,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29885
29886
  let sectionType = sectPrHeader?.attributes["w:type"];
29886
29887
  if (converter.headerIds[sectionType]) sectionType = null;
29887
29888
  const nodeListHandler2 = defaultNodeListHandler();
29888
- const schema = nodeListHandler2.handler({
29889
+ let schema = nodeListHandler2.handler({
29889
29890
  nodes: referenceFile.elements[0].elements,
29890
29891
  nodeListHandler: nodeListHandler2,
29891
29892
  docx,
@@ -29893,6 +29894,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29893
29894
  editor,
29894
29895
  filename: currentFileName
29895
29896
  });
29897
+ schema = filterOutRootInlineNodes(schema);
29896
29898
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
29897
29899
  converter.headerIds.ids.push(rId);
29898
29900
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -29907,7 +29909,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29907
29909
  );
29908
29910
  const sectionType = sectPrFooter?.attributes["w:type"];
29909
29911
  const nodeListHandler2 = defaultNodeListHandler();
29910
- const schema = nodeListHandler2.handler({
29912
+ let schema = nodeListHandler2.handler({
29911
29913
  nodes: referenceFile.elements[0].elements,
29912
29914
  nodeListHandler: nodeListHandler2,
29913
29915
  docx,
@@ -29915,6 +29917,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29915
29917
  editor,
29916
29918
  filename: currentFileName
29917
29919
  });
29920
+ schema = filterOutRootInlineNodes(schema);
29918
29921
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
29919
29922
  converter.footerIds.ids.push(rId);
29920
29923
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -29942,6 +29945,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
29942
29945
  currentFileName
29943
29946
  };
29944
29947
  };
29948
+ function filterOutRootInlineNodes(content = []) {
29949
+ if (!Array.isArray(content) || content.length === 0) return content;
29950
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
29951
+ "text",
29952
+ "bookmarkStart",
29953
+ "lineBreak",
29954
+ "hardBreak",
29955
+ "pageNumber",
29956
+ "totalPageCount",
29957
+ "runItem",
29958
+ "image",
29959
+ "tab",
29960
+ "fieldAnnotation",
29961
+ "mention",
29962
+ "contentBlock",
29963
+ "aiLoaderNode",
29964
+ "commentRangeStart",
29965
+ "commentRangeEnd",
29966
+ "commentReference",
29967
+ "structuredContent"
29968
+ ]);
29969
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
29970
+ }
29945
29971
  function getNumberingDefinitions(docx) {
29946
29972
  let numbering = docx["word/numbering.xml"];
29947
29973
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -30168,7 +30194,7 @@ const _SuperConverter = class _SuperConverter2 {
30168
30194
  return;
30169
30195
  }
30170
30196
  }
30171
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.0") {
30197
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.1") {
30172
30198
  const customLocation = "docProps/custom.xml";
30173
30199
  if (!docx[customLocation]) {
30174
30200
  docx[customLocation] = generateCustomXml();
@@ -30650,7 +30676,7 @@ function storeSuperdocVersion(docx) {
30650
30676
  function generateCustomXml() {
30651
30677
  return DEFAULT_CUSTOM_XML;
30652
30678
  }
30653
- function generateSuperdocVersion(pid = 2, version2 = "0.17.0") {
30679
+ function generateSuperdocVersion(pid = 2, version2 = "0.17.1") {
30654
30680
  return {
30655
30681
  type: "element",
30656
30682
  name: "property",
@@ -47510,7 +47536,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
47510
47536
  * @returns {Object | void} Migration results
47511
47537
  */
47512
47538
  processCollaborationMigrations() {
47513
- console.debug("[checkVersionMigrations] Current editor version", "0.17.0");
47539
+ console.debug("[checkVersionMigrations] Current editor version", "0.17.1");
47514
47540
  if (!this.options.ydoc) return;
47515
47541
  const metaMap = this.options.ydoc.getMap("meta");
47516
47542
  let docVersion = metaMap.get("version");
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-B_IuCnqV.js";
3
- import { _ as _export_sfc } from "./chunks/editor-DrBQYZYl.js";
2
+ import { T as TextSelection } from "./chunks/converter-CEUnrj5c.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-C6i6Nz_X.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -29600,7 +29600,7 @@ const createDocumentJson = (docx, converter, editor) => {
29600
29600
  const content = pruneIgnoredNodes(contentElements);
29601
29601
  const comments = importCommentData({ docx, converter, editor });
29602
29602
  const lists = {};
29603
- const parsedContent = nodeListHandler2.handler({
29603
+ let parsedContent = nodeListHandler2.handler({
29604
29604
  nodes: content,
29605
29605
  nodeListHandler: nodeListHandler2,
29606
29606
  docx,
@@ -29608,6 +29608,7 @@ const createDocumentJson = (docx, converter, editor) => {
29608
29608
  editor,
29609
29609
  lists
29610
29610
  });
29611
+ parsedContent = filterOutRootInlineNodes(parsedContent);
29611
29612
  const result = {
29612
29613
  type: "doc",
29613
29614
  content: parsedContent,
@@ -29883,7 +29884,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29883
29884
  let sectionType = sectPrHeader?.attributes["w:type"];
29884
29885
  if (converter.headerIds[sectionType]) sectionType = null;
29885
29886
  const nodeListHandler2 = defaultNodeListHandler();
29886
- const schema = nodeListHandler2.handler({
29887
+ let schema = nodeListHandler2.handler({
29887
29888
  nodes: referenceFile.elements[0].elements,
29888
29889
  nodeListHandler: nodeListHandler2,
29889
29890
  docx,
@@ -29891,6 +29892,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29891
29892
  editor,
29892
29893
  filename: currentFileName
29893
29894
  });
29895
+ schema = filterOutRootInlineNodes(schema);
29894
29896
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
29895
29897
  converter.headerIds.ids.push(rId);
29896
29898
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -29905,7 +29907,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29905
29907
  );
29906
29908
  const sectionType = sectPrFooter?.attributes["w:type"];
29907
29909
  const nodeListHandler2 = defaultNodeListHandler();
29908
- const schema = nodeListHandler2.handler({
29910
+ let schema = nodeListHandler2.handler({
29909
29911
  nodes: referenceFile.elements[0].elements,
29910
29912
  nodeListHandler: nodeListHandler2,
29911
29913
  docx,
@@ -29913,6 +29915,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
29913
29915
  editor,
29914
29916
  filename: currentFileName
29915
29917
  });
29918
+ schema = filterOutRootInlineNodes(schema);
29916
29919
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
29917
29920
  converter.footerIds.ids.push(rId);
29918
29921
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -29940,6 +29943,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
29940
29943
  currentFileName
29941
29944
  };
29942
29945
  };
29946
+ function filterOutRootInlineNodes(content = []) {
29947
+ if (!Array.isArray(content) || content.length === 0) return content;
29948
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
29949
+ "text",
29950
+ "bookmarkStart",
29951
+ "lineBreak",
29952
+ "hardBreak",
29953
+ "pageNumber",
29954
+ "totalPageCount",
29955
+ "runItem",
29956
+ "image",
29957
+ "tab",
29958
+ "fieldAnnotation",
29959
+ "mention",
29960
+ "contentBlock",
29961
+ "aiLoaderNode",
29962
+ "commentRangeStart",
29963
+ "commentRangeEnd",
29964
+ "commentReference",
29965
+ "structuredContent"
29966
+ ]);
29967
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
29968
+ }
29943
29969
  function getNumberingDefinitions(docx) {
29944
29970
  let numbering = docx["word/numbering.xml"];
29945
29971
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -30166,7 +30192,7 @@ const _SuperConverter = class _SuperConverter {
30166
30192
  return;
30167
30193
  }
30168
30194
  }
30169
- static updateDocumentVersion(docx = this.convertedXml, version = "0.17.0") {
30195
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.17.1") {
30170
30196
  const customLocation = "docProps/custom.xml";
30171
30197
  if (!docx[customLocation]) {
30172
30198
  docx[customLocation] = generateCustomXml();
@@ -30651,7 +30677,7 @@ function storeSuperdocVersion(docx) {
30651
30677
  function generateCustomXml() {
30652
30678
  return DEFAULT_CUSTOM_XML;
30653
30679
  }
30654
- function generateSuperdocVersion(pid = 2, version = "0.17.0") {
30680
+ function generateSuperdocVersion(pid = 2, version = "0.17.1") {
30655
30681
  return {
30656
30682
  type: "element",
30657
30683
  name: "property",
@@ -1,4 +1,4 @@
1
- import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-B_IuCnqV.js";
1
+ import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-CEUnrj5c.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, o as Slice, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-B_IuCnqV.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, o as Slice, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-CEUnrj5c.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-C_Qak38x.js";
17
+ import { D as DocxZipper } from "./docx-zipper-oH8QMMXL.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -14353,7 +14353,7 @@ const _Editor = class _Editor extends EventEmitter {
14353
14353
  * @returns {Object | void} Migration results
14354
14354
  */
14355
14355
  processCollaborationMigrations() {
14356
- console.debug("[checkVersionMigrations] Current editor version", "0.17.0");
14356
+ console.debug("[checkVersionMigrations] Current editor version", "0.17.1");
14357
14357
  if (!this.options.ydoc) return;
14358
14358
  const metaMap = this.options.ydoc.getMap("meta");
14359
14359
  let docVersion = metaMap.get("version");
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { H as process$1 } from "./converter-B_IuCnqV.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DrBQYZYl.js";
2
+ import { H as process$1 } from "./converter-CEUnrj5c.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-C6i6Nz_X.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { a4 } from "./chunks/converter-B_IuCnqV.js";
1
+ import { a4 } from "./chunks/converter-CEUnrj5c.js";
2
2
  export {
3
3
  a4 as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-B_IuCnqV.js";
2
- import { D } from "./chunks/docx-zipper-C_Qak38x.js";
1
+ import "./chunks/converter-CEUnrj5c.js";
2
+ import { D } from "./chunks/docx-zipper-oH8QMMXL.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DrBQYZYl.js";
2
- import "./chunks/converter-B_IuCnqV.js";
3
- import "./chunks/docx-zipper-C_Qak38x.js";
1
+ import { E } from "./chunks/editor-C6i6Nz_X.js";
2
+ import "./chunks/converter-CEUnrj5c.js";
3
+ import "./chunks/docx-zipper-oH8QMMXL.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-C_Qak38x.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-oH8QMMXL.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -8,6 +8,21 @@
8
8
  * @returns {Object | null} The updated styles object with default styles
9
9
  */
10
10
  export function addDefaultStylesIfMissing(styles: any): any | null;
11
+ /**
12
+ * Remove any nodes that belong to the inline group when they appear at the root.
13
+ * ProseMirror's doc node only accepts block-level content; inline nodes here cause
14
+ * Invalid content for node doc errors. This is a conservative filter that only
15
+ * drops clearly inline node types if they somehow escape their paragraph.
16
+ *
17
+ * @param {Array<{type: string, content?: any, attrs?: any, marks?: any[]}>} content
18
+ * @returns {Array}
19
+ */
20
+ export function filterOutRootInlineNodes(content?: Array<{
21
+ type: string;
22
+ content?: any;
23
+ attrs?: any;
24
+ marks?: any[];
25
+ }>): any[];
11
26
  export function createDocumentJson(docx: ParsedDocx, converter: SuperConverter, editor: Editor): {
12
27
  pmDoc: PmNodeJson;
13
28
  savedTagsToRestore: XmlNode;
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, a as Plugin } from "./chunks/converter-B_IuCnqV.js";
13
- import { aE, a4, d, a1 } from "./chunks/converter-B_IuCnqV.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-DrBQYZYl.js";
15
- import { k, C, l, T, i, m, j } from "./chunks/editor-DrBQYZYl.js";
12
+ import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, a as Plugin } from "./chunks/converter-CEUnrj5c.js";
13
+ import { aE, a4, d, a1 } from "./chunks/converter-CEUnrj5c.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-C6i6Nz_X.js";
15
+ import { k, C, l, T, i, m, j } from "./chunks/editor-C6i6Nz_X.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-CnAXgAhs.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-CGqVRPKn.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-C_Qak38x.js";
19
+ import { D } from "./chunks/docx-zipper-oH8QMMXL.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-CnAXgAhs.js";
3
- import "./chunks/editor-DrBQYZYl.js";
2
+ import { T } from "./chunks/toolbar-CGqVRPKn.js";
3
+ import "./chunks/editor-C6i6Nz_X.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-CHzSx5FH.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-ChJNDS8S.cjs");
4
4
  require("./chunks/vue-DWle4Cai.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, q } from "./chunks/super-editor.es-Cx4I-VrC.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, q } from "./chunks/super-editor.es-Cwq4Yz00.es.js";
2
2
  import "./chunks/vue-CXxsqYcP.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-CHzSx5FH.cjs");
4
- const superdoc = require("./chunks/index-CVp87_VW.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-ChJNDS8S.cjs");
4
+ const superdoc = require("./chunks/index-HYXkzjPW.cjs");
5
5
  require("./chunks/vue-DWle4Cai.cjs");
6
6
  require("./chunks/jszip-b7l8QkfH.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, p, q } from "./chunks/super-editor.es-Cx4I-VrC.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-B1qS_V43.es.js";
1
+ import { a, E, b, S, d, i, j, n, p, q } from "./chunks/super-editor.es-Cwq4Yz00.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-M_voHCSh.es.js";
3
3
  import "./chunks/vue-CXxsqYcP.es.js";
4
4
  import "./chunks/jszip-B8KIZSNe.es.js";
5
5
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";