@harbour-enterprises/superdoc 0.18.0-next.7 → 0.18.0-next.9

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-Db-y1BOK.es.js → PdfViewer-BJhrCot5.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-D8DhK7x_.cjs → PdfViewer-Dq63yg58.cjs} +1 -1
  3. package/dist/chunks/{index-gPQ_psn7.es.js → index-BN78x3pO.es.js} +2 -2
  4. package/dist/chunks/{index-B2vhAyq8.cjs → index-CJZL4fJB.cjs} +2 -2
  5. package/dist/chunks/{super-editor.es-DQ7fZbC0.cjs → super-editor.es-By4UqJbm.cjs} +35 -4
  6. package/dist/chunks/{super-editor.es-BxGYOWJs.es.js → super-editor.es-wdh3sSj4.es.js} +35 -4
  7. package/dist/super-editor/ai-writer.es.js +2 -2
  8. package/dist/super-editor/chunks/{converter-Cd1Nn-Yo.js → converter-B1DscbBQ.js} +35 -4
  9. package/dist/super-editor/chunks/{docx-zipper-Bb5bKoz2.js → docx-zipper-X8EwoXbC.js} +1 -1
  10. package/dist/super-editor/chunks/{editor-BeAxGXb9.js → editor-BbzNzl_2.js} +2 -2
  11. package/dist/super-editor/chunks/{toolbar-C_zg3l4P.js → toolbar-NTW8zQ0r.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 +35 -4
  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-gPQ_psn7.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-BN78x3pO.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-B2vhAyq8.cjs");
4
+ const superdoc = require("./index-CJZL4fJB.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -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-BxGYOWJs.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-wdh3sSj4.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-Db-y1BOK.es.js"));
17251
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BJhrCot5.es.js"));
17252
17252
  const superdocStore = useSuperdocStore();
17253
17253
  const commentsStore = useCommentsStore();
17254
17254
  const {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-DQ7fZbC0.cjs");
2
+ const superEditor_es = require("./super-editor.es-By4UqJbm.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-D8DhK7x_.cjs")));
17268
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Dq63yg58.cjs")));
17269
17269
  const superdocStore = useSuperdocStore();
17270
17270
  const commentsStore = useCommentsStore();
17271
17271
  const {
@@ -23007,17 +23007,22 @@ const changeNumIdSameAbstract = (numId, level, listType, editor) => {
23007
23007
  const { abstract } = ListHelpers.getListDefinitionDetails({ numId, level, listType, editor });
23008
23008
  const numbering = editor.converter.numbering;
23009
23009
  const newNumbering = { ...numbering };
23010
+ if (!abstract) {
23011
+ ListHelpers.generateNewListDefinition({ numId: newId, listType, editor });
23012
+ return newId;
23013
+ }
23010
23014
  const newAbstractId = getNewListId(editor, "abstracts");
23011
23015
  const newAbstractDef = {
23012
23016
  ...abstract,
23013
23017
  attributes: {
23014
- ...abstract.attributes,
23018
+ ...abstract.attributes || {},
23015
23019
  "w:abstractNumId": String(newAbstractId)
23016
23020
  }
23017
23021
  };
23018
23022
  newNumbering.abstracts[newAbstractId] = newAbstractDef;
23019
23023
  const newNumDef = getBasicNumIdTag(newId, newAbstractId);
23020
23024
  newNumbering.definitions[newId] = newNumDef;
23025
+ editor.converter.numbering = newNumbering;
23021
23026
  return newId;
23022
23027
  };
23023
23028
  const getBasicNumIdTag = (numId, abstractId) => {
@@ -30180,7 +30185,7 @@ const createDocumentJson = (docx, converter, editor) => {
30180
30185
  const content = pruneIgnoredNodes(contentElements);
30181
30186
  const comments = importCommentData({ docx, converter, editor });
30182
30187
  const lists = {};
30183
- const parsedContent = nodeListHandler2.handler({
30188
+ let parsedContent = nodeListHandler2.handler({
30184
30189
  nodes: content,
30185
30190
  nodeListHandler: nodeListHandler2,
30186
30191
  docx,
@@ -30189,6 +30194,7 @@ const createDocumentJson = (docx, converter, editor) => {
30189
30194
  lists,
30190
30195
  path: []
30191
30196
  });
30197
+ parsedContent = filterOutRootInlineNodes(parsedContent);
30192
30198
  const result = {
30193
30199
  type: "doc",
30194
30200
  content: parsedContent,
@@ -30465,7 +30471,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30465
30471
  let sectionType = sectPrHeader?.attributes["w:type"];
30466
30472
  if (converter.headerIds[sectionType]) sectionType = null;
30467
30473
  const nodeListHandler2 = defaultNodeListHandler();
30468
- const schema = nodeListHandler2.handler({
30474
+ let schema = nodeListHandler2.handler({
30469
30475
  nodes: referenceFile.elements[0].elements,
30470
30476
  nodeListHandler: nodeListHandler2,
30471
30477
  docx,
@@ -30474,6 +30480,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30474
30480
  filename: currentFileName,
30475
30481
  path: []
30476
30482
  });
30483
+ schema = filterOutRootInlineNodes(schema);
30477
30484
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
30478
30485
  converter.headerIds.ids.push(rId);
30479
30486
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -30488,7 +30495,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30488
30495
  );
30489
30496
  const sectionType = sectPrFooter?.attributes["w:type"];
30490
30497
  const nodeListHandler2 = defaultNodeListHandler();
30491
- const schema = nodeListHandler2.handler({
30498
+ let schema = nodeListHandler2.handler({
30492
30499
  nodes: referenceFile.elements[0].elements,
30493
30500
  nodeListHandler: nodeListHandler2,
30494
30501
  docx,
@@ -30497,6 +30504,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30497
30504
  filename: currentFileName,
30498
30505
  path: []
30499
30506
  });
30507
+ schema = filterOutRootInlineNodes(schema);
30500
30508
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
30501
30509
  converter.footerIds.ids.push(rId);
30502
30510
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -30524,6 +30532,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
30524
30532
  currentFileName
30525
30533
  };
30526
30534
  };
30535
+ function filterOutRootInlineNodes(content = []) {
30536
+ if (!Array.isArray(content) || content.length === 0) return content;
30537
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
30538
+ "text",
30539
+ "bookmarkStart",
30540
+ "lineBreak",
30541
+ "hardBreak",
30542
+ "pageNumber",
30543
+ "totalPageCount",
30544
+ "runItem",
30545
+ "image",
30546
+ "tab",
30547
+ "fieldAnnotation",
30548
+ "mention",
30549
+ "contentBlock",
30550
+ "aiLoaderNode",
30551
+ "commentRangeStart",
30552
+ "commentRangeEnd",
30553
+ "commentReference",
30554
+ "structuredContent"
30555
+ ]);
30556
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
30557
+ }
30527
30558
  function getNumberingDefinitions(docx) {
30528
30559
  let numbering = docx["word/numbering.xml"];
30529
30560
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -22990,17 +22990,22 @@ const changeNumIdSameAbstract = (numId, level, listType, editor) => {
22990
22990
  const { abstract } = ListHelpers.getListDefinitionDetails({ numId, level, listType, editor });
22991
22991
  const numbering = editor.converter.numbering;
22992
22992
  const newNumbering = { ...numbering };
22993
+ if (!abstract) {
22994
+ ListHelpers.generateNewListDefinition({ numId: newId, listType, editor });
22995
+ return newId;
22996
+ }
22993
22997
  const newAbstractId = getNewListId(editor, "abstracts");
22994
22998
  const newAbstractDef = {
22995
22999
  ...abstract,
22996
23000
  attributes: {
22997
- ...abstract.attributes,
23001
+ ...abstract.attributes || {},
22998
23002
  "w:abstractNumId": String(newAbstractId)
22999
23003
  }
23000
23004
  };
23001
23005
  newNumbering.abstracts[newAbstractId] = newAbstractDef;
23002
23006
  const newNumDef = getBasicNumIdTag(newId, newAbstractId);
23003
23007
  newNumbering.definitions[newId] = newNumDef;
23008
+ editor.converter.numbering = newNumbering;
23004
23009
  return newId;
23005
23010
  };
23006
23011
  const getBasicNumIdTag = (numId, abstractId) => {
@@ -30163,7 +30168,7 @@ const createDocumentJson = (docx, converter, editor) => {
30163
30168
  const content = pruneIgnoredNodes(contentElements);
30164
30169
  const comments = importCommentData({ docx, converter, editor });
30165
30170
  const lists = {};
30166
- const parsedContent = nodeListHandler2.handler({
30171
+ let parsedContent = nodeListHandler2.handler({
30167
30172
  nodes: content,
30168
30173
  nodeListHandler: nodeListHandler2,
30169
30174
  docx,
@@ -30172,6 +30177,7 @@ const createDocumentJson = (docx, converter, editor) => {
30172
30177
  lists,
30173
30178
  path: []
30174
30179
  });
30180
+ parsedContent = filterOutRootInlineNodes(parsedContent);
30175
30181
  const result = {
30176
30182
  type: "doc",
30177
30183
  content: parsedContent,
@@ -30448,7 +30454,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30448
30454
  let sectionType = sectPrHeader?.attributes["w:type"];
30449
30455
  if (converter.headerIds[sectionType]) sectionType = null;
30450
30456
  const nodeListHandler2 = defaultNodeListHandler();
30451
- const schema = nodeListHandler2.handler({
30457
+ let schema = nodeListHandler2.handler({
30452
30458
  nodes: referenceFile.elements[0].elements,
30453
30459
  nodeListHandler: nodeListHandler2,
30454
30460
  docx,
@@ -30457,6 +30463,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30457
30463
  filename: currentFileName,
30458
30464
  path: []
30459
30465
  });
30466
+ schema = filterOutRootInlineNodes(schema);
30460
30467
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
30461
30468
  converter.headerIds.ids.push(rId);
30462
30469
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -30471,7 +30478,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30471
30478
  );
30472
30479
  const sectionType = sectPrFooter?.attributes["w:type"];
30473
30480
  const nodeListHandler2 = defaultNodeListHandler();
30474
- const schema = nodeListHandler2.handler({
30481
+ let schema = nodeListHandler2.handler({
30475
30482
  nodes: referenceFile.elements[0].elements,
30476
30483
  nodeListHandler: nodeListHandler2,
30477
30484
  docx,
@@ -30480,6 +30487,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30480
30487
  filename: currentFileName,
30481
30488
  path: []
30482
30489
  });
30490
+ schema = filterOutRootInlineNodes(schema);
30483
30491
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
30484
30492
  converter.footerIds.ids.push(rId);
30485
30493
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -30507,6 +30515,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
30507
30515
  currentFileName
30508
30516
  };
30509
30517
  };
30518
+ function filterOutRootInlineNodes(content = []) {
30519
+ if (!Array.isArray(content) || content.length === 0) return content;
30520
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
30521
+ "text",
30522
+ "bookmarkStart",
30523
+ "lineBreak",
30524
+ "hardBreak",
30525
+ "pageNumber",
30526
+ "totalPageCount",
30527
+ "runItem",
30528
+ "image",
30529
+ "tab",
30530
+ "fieldAnnotation",
30531
+ "mention",
30532
+ "contentBlock",
30533
+ "aiLoaderNode",
30534
+ "commentRangeStart",
30535
+ "commentRangeEnd",
30536
+ "commentReference",
30537
+ "structuredContent"
30538
+ ]);
30539
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
30540
+ }
30510
30541
  function getNumberingDefinitions(docx) {
30511
30542
  let numbering = docx["word/numbering.xml"];
30512
30543
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -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-Cd1Nn-Yo.js";
3
- import { _ as _export_sfc } from "./chunks/editor-BeAxGXb9.js";
2
+ import { T as TextSelection } from "./chunks/converter-B1DscbBQ.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-BbzNzl_2.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 = {}) {
@@ -22988,17 +22988,22 @@ const changeNumIdSameAbstract = (numId, level, listType, editor) => {
22988
22988
  const { abstract } = ListHelpers.getListDefinitionDetails({ numId, level, listType, editor });
22989
22989
  const numbering = editor.converter.numbering;
22990
22990
  const newNumbering = { ...numbering };
22991
+ if (!abstract) {
22992
+ ListHelpers.generateNewListDefinition({ numId: newId, listType, editor });
22993
+ return newId;
22994
+ }
22991
22995
  const newAbstractId = getNewListId(editor, "abstracts");
22992
22996
  const newAbstractDef = {
22993
22997
  ...abstract,
22994
22998
  attributes: {
22995
- ...abstract.attributes,
22999
+ ...abstract.attributes || {},
22996
23000
  "w:abstractNumId": String(newAbstractId)
22997
23001
  }
22998
23002
  };
22999
23003
  newNumbering.abstracts[newAbstractId] = newAbstractDef;
23000
23004
  const newNumDef = getBasicNumIdTag(newId, newAbstractId);
23001
23005
  newNumbering.definitions[newId] = newNumDef;
23006
+ editor.converter.numbering = newNumbering;
23002
23007
  return newId;
23003
23008
  };
23004
23009
  const getBasicNumIdTag = (numId, abstractId) => {
@@ -30170,7 +30175,7 @@ const createDocumentJson = (docx, converter, editor) => {
30170
30175
  const content = pruneIgnoredNodes(contentElements);
30171
30176
  const comments = importCommentData({ docx, converter, editor });
30172
30177
  const lists = {};
30173
- const parsedContent = nodeListHandler2.handler({
30178
+ let parsedContent = nodeListHandler2.handler({
30174
30179
  nodes: content,
30175
30180
  nodeListHandler: nodeListHandler2,
30176
30181
  docx,
@@ -30179,6 +30184,7 @@ const createDocumentJson = (docx, converter, editor) => {
30179
30184
  lists,
30180
30185
  path: []
30181
30186
  });
30187
+ parsedContent = filterOutRootInlineNodes(parsedContent);
30182
30188
  const result = {
30183
30189
  type: "doc",
30184
30190
  content: parsedContent,
@@ -30455,7 +30461,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30455
30461
  let sectionType = sectPrHeader?.attributes["w:type"];
30456
30462
  if (converter.headerIds[sectionType]) sectionType = null;
30457
30463
  const nodeListHandler2 = defaultNodeListHandler();
30458
- const schema = nodeListHandler2.handler({
30464
+ let schema = nodeListHandler2.handler({
30459
30465
  nodes: referenceFile.elements[0].elements,
30460
30466
  nodeListHandler: nodeListHandler2,
30461
30467
  docx,
@@ -30464,6 +30470,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30464
30470
  filename: currentFileName,
30465
30471
  path: []
30466
30472
  });
30473
+ schema = filterOutRootInlineNodes(schema);
30467
30474
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
30468
30475
  converter.headerIds.ids.push(rId);
30469
30476
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -30478,7 +30485,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30478
30485
  );
30479
30486
  const sectionType = sectPrFooter?.attributes["w:type"];
30480
30487
  const nodeListHandler2 = defaultNodeListHandler();
30481
- const schema = nodeListHandler2.handler({
30488
+ let schema = nodeListHandler2.handler({
30482
30489
  nodes: referenceFile.elements[0].elements,
30483
30490
  nodeListHandler: nodeListHandler2,
30484
30491
  docx,
@@ -30487,6 +30494,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
30487
30494
  filename: currentFileName,
30488
30495
  path: []
30489
30496
  });
30497
+ schema = filterOutRootInlineNodes(schema);
30490
30498
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
30491
30499
  converter.footerIds.ids.push(rId);
30492
30500
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -30514,6 +30522,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
30514
30522
  currentFileName
30515
30523
  };
30516
30524
  };
30525
+ function filterOutRootInlineNodes(content = []) {
30526
+ if (!Array.isArray(content) || content.length === 0) return content;
30527
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
30528
+ "text",
30529
+ "bookmarkStart",
30530
+ "lineBreak",
30531
+ "hardBreak",
30532
+ "pageNumber",
30533
+ "totalPageCount",
30534
+ "runItem",
30535
+ "image",
30536
+ "tab",
30537
+ "fieldAnnotation",
30538
+ "mention",
30539
+ "contentBlock",
30540
+ "aiLoaderNode",
30541
+ "commentRangeStart",
30542
+ "commentRangeEnd",
30543
+ "commentReference",
30544
+ "structuredContent"
30545
+ ]);
30546
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
30547
+ }
30517
30548
  function getNumberingDefinitions(docx) {
30518
30549
  let numbering = docx["word/numbering.xml"];
30519
30550
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -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-Cd1Nn-Yo.js";
1
+ import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-B1DscbBQ.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, o as Slice, F as Fragment, R as ReplaceAroundStep$1, 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-Cd1Nn-Yo.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, o as Slice, F as Fragment, R as ReplaceAroundStep$1, 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-B1DscbBQ.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-Bb5bKoz2.js";
17
+ import { D as DocxZipper } from "./docx-zipper-X8EwoXbC.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -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-Cd1Nn-Yo.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BeAxGXb9.js";
2
+ import { H as process$1 } from "./converter-B1DscbBQ.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BbzNzl_2.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-Cd1Nn-Yo.js";
1
+ import { a4 } from "./chunks/converter-B1DscbBQ.js";
2
2
  import "vue";
3
3
  export {
4
4
  a4 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-Cd1Nn-Yo.js";
2
- import { D } from "./chunks/docx-zipper-Bb5bKoz2.js";
1
+ import "./chunks/converter-B1DscbBQ.js";
2
+ import { D } from "./chunks/docx-zipper-X8EwoXbC.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-BeAxGXb9.js";
2
- import "./chunks/converter-Cd1Nn-Yo.js";
3
- import "./chunks/docx-zipper-Bb5bKoz2.js";
1
+ import { E } from "./chunks/editor-BbzNzl_2.js";
2
+ import "./chunks/converter-B1DscbBQ.js";
3
+ import "./chunks/docx-zipper-X8EwoXbC.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-Bb5bKoz2.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-X8EwoXbC.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, aE as translator, aF as translator$1, aG as translator$2, a as Plugin } from "./chunks/converter-Cd1Nn-Yo.js";
13
- import { aH, a4, d, a1 } from "./chunks/converter-Cd1Nn-Yo.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-BeAxGXb9.js";
15
- import { k, C, l, T, i, m, j } from "./chunks/editor-BeAxGXb9.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, aE as translator, aF as translator$1, aG as translator$2, a as Plugin } from "./chunks/converter-B1DscbBQ.js";
13
+ import { aH, a4, d, a1 } from "./chunks/converter-B1DscbBQ.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-BbzNzl_2.js";
15
+ import { k, C, l, T, i, m, j } from "./chunks/editor-BbzNzl_2.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-C_zg3l4P.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-NTW8zQ0r.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-Bb5bKoz2.js";
19
+ import { D } from "./chunks/docx-zipper-X8EwoXbC.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-C_zg3l4P.js";
3
- import "./chunks/editor-BeAxGXb9.js";
2
+ import { T } from "./chunks/toolbar-NTW8zQ0r.js";
3
+ import "./chunks/editor-BbzNzl_2.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-DQ7fZbC0.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-By4UqJbm.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, r, q } from "./chunks/super-editor.es-BxGYOWJs.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-wdh3sSj4.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-DQ7fZbC0.cjs");
4
- const superdoc = require("./chunks/index-B2vhAyq8.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-By4UqJbm.cjs");
4
+ const superdoc = require("./chunks/index-CJZL4fJB.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, r, p, q } from "./chunks/super-editor.es-BxGYOWJs.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-gPQ_psn7.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-wdh3sSj4.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-BN78x3pO.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";