@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
@@ -37317,7 +37317,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37317
37317
  const content = pruneIgnoredNodes(contentElements);
37318
37318
  const comments = importCommentData({ docx, converter, editor });
37319
37319
  const lists = {};
37320
- const parsedContent = nodeListHandler2.handler({
37320
+ let parsedContent = nodeListHandler2.handler({
37321
37321
  nodes: content,
37322
37322
  nodeListHandler: nodeListHandler2,
37323
37323
  docx,
@@ -37325,6 +37325,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37325
37325
  editor,
37326
37326
  lists
37327
37327
  });
37328
+ parsedContent = filterOutRootInlineNodes(parsedContent);
37328
37329
  const result = {
37329
37330
  type: "doc",
37330
37331
  content: parsedContent,
@@ -37600,7 +37601,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37600
37601
  let sectionType = sectPrHeader?.attributes["w:type"];
37601
37602
  if (converter.headerIds[sectionType]) sectionType = null;
37602
37603
  const nodeListHandler2 = defaultNodeListHandler();
37603
- const schema = nodeListHandler2.handler({
37604
+ let schema = nodeListHandler2.handler({
37604
37605
  nodes: referenceFile.elements[0].elements,
37605
37606
  nodeListHandler: nodeListHandler2,
37606
37607
  docx,
@@ -37608,6 +37609,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37608
37609
  editor,
37609
37610
  filename: currentFileName
37610
37611
  });
37612
+ schema = filterOutRootInlineNodes(schema);
37611
37613
  if (!converter.headerIds.ids) converter.headerIds.ids = [];
37612
37614
  converter.headerIds.ids.push(rId);
37613
37615
  converter.headers[rId] = { type: "doc", content: [...schema] };
@@ -37622,7 +37624,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37622
37624
  );
37623
37625
  const sectionType = sectPrFooter?.attributes["w:type"];
37624
37626
  const nodeListHandler2 = defaultNodeListHandler();
37625
- const schema = nodeListHandler2.handler({
37627
+ let schema = nodeListHandler2.handler({
37626
37628
  nodes: referenceFile.elements[0].elements,
37627
37629
  nodeListHandler: nodeListHandler2,
37628
37630
  docx,
@@ -37630,6 +37632,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37630
37632
  editor,
37631
37633
  filename: currentFileName
37632
37634
  });
37635
+ schema = filterOutRootInlineNodes(schema);
37633
37636
  if (!converter.footerIds.ids) converter.footerIds.ids = [];
37634
37637
  converter.footerIds.ids.push(rId);
37635
37638
  converter.footers[rId] = { type: "doc", content: [...schema] };
@@ -37657,6 +37660,29 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37657
37660
  currentFileName
37658
37661
  };
37659
37662
  };
37663
+ function filterOutRootInlineNodes(content = []) {
37664
+ if (!Array.isArray(content) || content.length === 0) return content;
37665
+ const INLINE_TYPES = /* @__PURE__ */ new Set([
37666
+ "text",
37667
+ "bookmarkStart",
37668
+ "lineBreak",
37669
+ "hardBreak",
37670
+ "pageNumber",
37671
+ "totalPageCount",
37672
+ "runItem",
37673
+ "image",
37674
+ "tab",
37675
+ "fieldAnnotation",
37676
+ "mention",
37677
+ "contentBlock",
37678
+ "aiLoaderNode",
37679
+ "commentRangeStart",
37680
+ "commentRangeEnd",
37681
+ "commentReference",
37682
+ "structuredContent"
37683
+ ]);
37684
+ return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
37685
+ }
37660
37686
  function getNumberingDefinitions(docx) {
37661
37687
  let numbering = docx["word/numbering.xml"];
37662
37688
  if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
@@ -37883,7 +37909,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37883
37909
  return;
37884
37910
  }
37885
37911
  }
37886
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.0") {
37912
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.17.1") {
37887
37913
  const customLocation = "docProps/custom.xml";
37888
37914
  if (!docx[customLocation]) {
37889
37915
  docx[customLocation] = generateCustomXml();
@@ -38365,7 +38391,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38365
38391
  function generateCustomXml() {
38366
38392
  return DEFAULT_CUSTOM_XML;
38367
38393
  }
38368
- function generateSuperdocVersion(pid = 2, version2 = "0.17.0") {
38394
+ function generateSuperdocVersion(pid = 2, version2 = "0.17.1") {
38369
38395
  return {
38370
38396
  type: "element",
38371
38397
  name: "property",
@@ -55225,7 +55251,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
55225
55251
  * @returns {Object | void} Migration results
55226
55252
  */
55227
55253
  processCollaborationMigrations() {
55228
- console.debug("[checkVersionMigrations] Current editor version", "0.17.0");
55254
+ console.debug("[checkVersionMigrations] Current editor version", "0.17.1");
55229
55255
  if (!this.options.ydoc) return;
55230
55256
  const metaMap = this.options.ydoc.getMap("meta");
55231
55257
  let docVersion = metaMap.get("version");
@@ -104911,7 +104937,7 @@ ${style2}
104911
104937
  this.config.colors = shuffleArray(this.config.colors);
104912
104938
  this.userColorMap = /* @__PURE__ */ new Map();
104913
104939
  this.colorIndex = 0;
104914
- this.version = "0.17.0";
104940
+ this.version = "0.17.1";
104915
104941
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
104916
104942
  this.superdocId = config.superdocId || v4();
104917
104943
  this.colors = this.config.colors;