@harbour-enterprises/superdoc 0.12.36 → 0.12.37-next.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 (72) hide show
  1. package/dist/chunks/{eventemitter3-Dq2TEegt.es.js → eventemitter3-BrspJk8q.es.js} +1 -1
  2. package/dist/chunks/{eventemitter3-DuScojUH.cjs → eventemitter3-DfVviFzP.cjs} +1 -1
  3. package/dist/chunks/{index-CMBtuT02.cjs → index-B4J7wgs6.cjs} +2 -2
  4. package/dist/chunks/{index-B1MhwjTC.cjs → index-Cdsq63Xq.cjs} +4 -4
  5. package/dist/chunks/{index-SKpROzLW.es.js → index-Diu6UKHt.es.js} +4 -4
  6. package/dist/chunks/{index-BrSjd1Id.es.js → index-Hr3Um-Bg.es.js} +2 -2
  7. package/dist/chunks/{jszip-Bwu_om3F.cjs → jszip-BTAcmbVg.cjs} +1 -1
  8. package/dist/chunks/{jszip-BmWWPxfF.es.js → jszip-DckFs3A7.es.js} +1 -1
  9. package/dist/chunks/{super-editor.es-akFFn4Ld.cjs → super-editor.es-3IGIxgjF.cjs} +2139 -422
  10. package/dist/chunks/{super-editor.es-BtKVLpiq.es.js → super-editor.es-WrgX5vxB.es.js} +2139 -422
  11. package/dist/chunks/{url-DuggQ5JR.cjs → url-BIzg4y2i.cjs} +2 -2
  12. package/dist/chunks/{url-CAZQTNP3.es.js → url-CHayXMZH.es.js} +2 -2
  13. package/dist/chunks/{vue-IIIZMHTg.es.js → vue-Bi1uWinj.es.js} +17 -11
  14. package/dist/chunks/{vue-DPZkajuO.cjs → vue-HIY1g7dm.cjs} +17 -11
  15. package/dist/chunks/{xml-js-B7Vccv2s.cjs → xml-js-BjqmFOSP.cjs} +2 -2
  16. package/dist/chunks/{xml-js-BV-kCPOA.es.js → xml-js-CfClL-1b.es.js} +2 -2
  17. package/dist/core/SuperDoc.d.ts +0 -6
  18. package/dist/core/SuperDoc.d.ts.map +1 -1
  19. package/dist/core/collaboration/collaboration.d.ts +0 -9
  20. package/dist/core/collaboration/collaboration.d.ts.map +1 -1
  21. package/dist/core/collaboration/helpers.d.ts.map +1 -1
  22. package/dist/style.css +112 -7
  23. package/dist/super-editor/ai-writer.es.js +2 -2
  24. package/dist/super-editor/chunks/{converter-BSl_E2ED.js → converter-RpLHCUPf.js} +109 -10
  25. package/dist/super-editor/chunks/{docx-zipper-USmuqzmo.js → docx-zipper-V5sLSr7T.js} +1 -1
  26. package/dist/super-editor/chunks/{editor-C0hNf44Q.js → editor-CAT1dxaK.js} +2103 -350
  27. package/dist/super-editor/chunks/{toolbar-IN0IJC2L.js → toolbar-Cts0XR5V.js} +2 -2
  28. package/dist/super-editor/components/pagination-helpers.d.ts.map +1 -1
  29. package/dist/super-editor/converter.es.js +1 -1
  30. package/dist/super-editor/core/Attribute.d.ts +2 -2
  31. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  32. package/dist/super-editor/core/InputRule.d.ts +7 -0
  33. package/dist/super-editor/core/InputRule.d.ts.map +1 -1
  34. package/dist/super-editor/core/Schema.d.ts +2 -2
  35. package/dist/super-editor/core/helpers/findWordBounds.d.ts +5 -0
  36. package/dist/super-editor/core/helpers/findWordBounds.d.ts.map +1 -0
  37. package/dist/super-editor/core/helpers/setWordSelection.d.ts +2 -0
  38. package/dist/super-editor/core/helpers/setWordSelection.d.ts.map +1 -0
  39. package/dist/super-editor/core/inputRules/docx-paste/docx-paste.d.ts.map +1 -1
  40. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  41. package/dist/super-editor/core/super-converter/v2/importer/autoPageNumberImporter.d.ts.map +1 -1
  42. package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
  43. package/dist/super-editor/docx-zipper.es.js +2 -2
  44. package/dist/super-editor/editor.es.js +3 -3
  45. package/dist/super-editor/extensions/field-annotation/FieldAnnotationView.d.ts.map +1 -1
  46. package/dist/super-editor/extensions/field-annotation/field-annotation.d.ts.map +1 -1
  47. package/dist/super-editor/extensions/image/imageHelpers/imagePositionPlugin.d.ts.map +1 -1
  48. package/dist/super-editor/extensions/image/imageHelpers/index.d.ts +1 -0
  49. package/dist/super-editor/extensions/image/imageHelpers/processUploadedImage.d.ts.map +1 -1
  50. package/dist/super-editor/extensions/image/index.d.ts +1 -0
  51. package/dist/super-editor/extensions/index.d.ts +2 -1
  52. package/dist/super-editor/extensions/index.d.ts.map +1 -1
  53. package/dist/super-editor/extensions/noderesizer/index.d.ts +2 -0
  54. package/dist/super-editor/extensions/noderesizer/index.d.ts.map +1 -0
  55. package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts +7 -0
  56. package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts.map +1 -0
  57. package/dist/super-editor/extensions/page-number/page-number.d.ts +10 -0
  58. package/dist/super-editor/extensions/page-number/page-number.d.ts.map +1 -1
  59. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts +2 -1
  60. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
  61. package/dist/super-editor/extensions/pagination/pagination.d.ts.map +1 -1
  62. package/dist/super-editor/file-zipper.es.js +1 -1
  63. package/dist/super-editor/style.css +112 -7
  64. package/dist/super-editor/super-editor.es.js +8 -142
  65. package/dist/super-editor/toolbar.es.js +2 -2
  66. package/dist/super-editor.cjs +2 -2
  67. package/dist/super-editor.es.js +2 -2
  68. package/dist/superdoc.cjs +1587 -366
  69. package/dist/superdoc.es.js +1572 -367
  70. package/dist/superdoc.umd.js +3697 -774
  71. package/dist/superdoc.umd.js.map +1 -1
  72. package/package.json +3 -2
@@ -12438,7 +12438,7 @@ const OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;
12438
12438
  function wsOptionsFor(type2, preserveWhitespace, base) {
12439
12439
  if (preserveWhitespace != null)
12440
12440
  return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
12441
- return type2 && type2.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & -5;
12441
+ return type2 && type2.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT;
12442
12442
  }
12443
12443
  class NodeContext {
12444
12444
  constructor(type2, attrs, marks, solid, match, options2) {
@@ -15409,7 +15409,7 @@ class Transaction extends Transform {
15409
15409
  throw new RangeError("Selection passed to setSelection must point at the current document");
15410
15410
  this.curSelection = selection;
15411
15411
  this.curSelectionFor = this.steps.length;
15412
- this.updated = (this.updated | UPDATED_SEL) & -3;
15412
+ this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;
15413
15413
  this.storedMarks = null;
15414
15414
  return this;
15415
15415
  }
@@ -15460,7 +15460,7 @@ class Transaction extends Transform {
15460
15460
  */
15461
15461
  addStep(step, doc2) {
15462
15462
  super.addStep(step, doc2);
15463
- this.updated = this.updated & -3;
15463
+ this.updated = this.updated & ~UPDATED_MARKS;
15464
15464
  this.storedMarks = null;
15465
15465
  }
15466
15466
  /**
@@ -18864,7 +18864,9 @@ function exportSchemaToJson(params) {
18864
18864
  shapeContainer: translateShapeContainer,
18865
18865
  shapeTextbox: translateShapeTextbox,
18866
18866
  contentBlock: translateContentBlock,
18867
- structuredContent: translateStructuredContent
18867
+ structuredContent: translateStructuredContent,
18868
+ "page-number": translatePageNumberNode,
18869
+ "total-page-number": translateTotalPageNumberNode
18868
18870
  };
18869
18871
  if (!router[type2]) {
18870
18872
  console.error("No translation function found for node type:", type2);
@@ -20561,6 +20563,81 @@ function translateStructuredContent(params) {
20561
20563
  elements: nodeElements
20562
20564
  };
20563
20565
  }
20566
+ const translatePageNumberNode = (params) => {
20567
+ const outputMarks = processOutputMarks(params.node.attrs?.marksAsAttrs || []);
20568
+ return getAutoPageJson("PAGE", outputMarks);
20569
+ };
20570
+ const translateTotalPageNumberNode = (params) => {
20571
+ const outputMarks = processOutputMarks(params.node.attrs?.marksAsAttrs || []);
20572
+ return getAutoPageJson("NUMPAGES", outputMarks);
20573
+ };
20574
+ const getAutoPageJson = (type2, outputMarks = []) => {
20575
+ return [
20576
+ {
20577
+ "name": "w:r",
20578
+ "elements": [
20579
+ {
20580
+ "name": "w:rPr",
20581
+ "elements": outputMarks
20582
+ },
20583
+ {
20584
+ "name": "w:fldChar",
20585
+ "attributes": {
20586
+ "w:fldCharType": "begin"
20587
+ }
20588
+ }
20589
+ ]
20590
+ },
20591
+ {
20592
+ "name": "w:r",
20593
+ "elements": [
20594
+ {
20595
+ "name": "w:rPr",
20596
+ "elements": outputMarks
20597
+ },
20598
+ {
20599
+ "name": "w:instrText",
20600
+ "elements": [
20601
+ {
20602
+ "type": "text",
20603
+ "text": ` ${type2}`
20604
+ }
20605
+ ]
20606
+ }
20607
+ ]
20608
+ },
20609
+ {
20610
+ "name": "w:r",
20611
+ "elements": [
20612
+ {
20613
+ "name": "w:rPr",
20614
+ "elements": outputMarks
20615
+ },
20616
+ {
20617
+ "name": "w:fldChar",
20618
+ "attributes": {
20619
+ "w:fldCharType": "separate"
20620
+ }
20621
+ }
20622
+ ]
20623
+ },
20624
+ {
20625
+ "name": "w:r",
20626
+ "elements": [
20627
+ {
20628
+ "name": "w:rPr",
20629
+ "elements": outputMarks
20630
+ },
20631
+ {
20632
+ "name": "w:fldChar",
20633
+ "attributes": {
20634
+ "w:fldCharType": "end"
20635
+ }
20636
+ }
20637
+ ]
20638
+ }
20639
+ ];
20640
+ };
20564
20641
  const defaultInitialXml = `<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>`;
20565
20642
  const parseXmlToJson = (xml) => {
20566
20643
  return JSON.parse(xmljs.xml2json(xml, null, 2));
@@ -21459,6 +21536,8 @@ const handleListNode = (params) => {
21459
21536
  listItems.push(possibleList);
21460
21537
  possibleList = siblings.shift();
21461
21538
  if (possibleList?.elements && !hasTextNode(possibleList.elements)) {
21539
+ const { name } = possibleList;
21540
+ if (name === "w:tbl") continue;
21462
21541
  listItems.push(possibleList);
21463
21542
  possibleList = siblings.shift();
21464
21543
  }
@@ -22269,15 +22348,25 @@ const processCombinedNodesForFldChar = (nodesToCombine = []) => {
22269
22348
  if (!isNumPages) isNumPages = instrText?.trim().startsWith("NUMPAGES");
22270
22349
  const urlMatch = instrText?.match(/HYPERLINK\s+"([^"]+)"/);
22271
22350
  if (hasPageMarker) {
22272
- processedNodes.push({
22351
+ const pageNumNode = {
22273
22352
  name: "sd:autoPageNumber",
22274
22353
  type: "element"
22354
+ };
22355
+ nodesToCombine.forEach((n) => {
22356
+ const rPrNode = n.elements.find((el) => el.name === "w:rPr");
22357
+ if (rPrNode) pageNumNode.elements = [rPrNode];
22275
22358
  });
22359
+ processedNodes.push(pageNumNode);
22276
22360
  } else if (isNumPages) {
22277
- processedNodes.push({
22361
+ const totalPageNumNode = {
22278
22362
  name: "sd:totalPageNumber",
22279
22363
  type: "element"
22364
+ };
22365
+ nodesToCombine.forEach((n) => {
22366
+ const rPrNode = n.elements.find((el) => el.name === "w:rPr");
22367
+ if (rPrNode) totalPageNumNode.elements = [rPrNode];
22280
22368
  });
22369
+ processedNodes.push(totalPageNumNode);
22281
22370
  } else if (urlMatch && urlMatch?.length >= 2) {
22282
22371
  const url = urlMatch[1];
22283
22372
  const textMarks = [];
@@ -22613,8 +22702,13 @@ const handleAutoPageNumber = (params) => {
22613
22702
  if (nodes.length === 0 || nodes[0].name !== "sd:autoPageNumber") {
22614
22703
  return { nodes: [], consumed: 0 };
22615
22704
  }
22705
+ const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
22706
+ const marks = parseMarks(rPr || { elements: [] });
22616
22707
  const processedNode = {
22617
- type: "page-number"
22708
+ type: "page-number",
22709
+ attrs: {
22710
+ marksAsAttrs: marks
22711
+ }
22618
22712
  };
22619
22713
  return { nodes: [processedNode], consumed: 1 };
22620
22714
  };
@@ -22627,8 +22721,13 @@ const handleAutoTotalPageNumber = (params) => {
22627
22721
  if (nodes.length === 0 || nodes[0].name !== "sd:totalPageNumber") {
22628
22722
  return { nodes: [], consumed: 0 };
22629
22723
  }
22724
+ const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
22725
+ const marks = parseMarks(rPr || { elements: [] });
22630
22726
  const processedNode = {
22631
- type: "total-page-number"
22727
+ type: "total-page-number",
22728
+ attrs: {
22729
+ marksAsAttrs: marks
22730
+ }
22632
22731
  };
22633
22732
  return { nodes: [processedNode], consumed: 1 };
22634
22733
  };
@@ -23313,7 +23412,7 @@ const _SuperConverter = class _SuperConverter {
23313
23412
  return;
23314
23413
  }
23315
23414
  }
23316
- static updateDocumentVersion(docx = this.convertedXml, version = "0.12.36") {
23415
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.12.37-next.2") {
23317
23416
  const customLocation = "docProps/custom.xml";
23318
23417
  if (!docx[customLocation]) {
23319
23418
  docx[customLocation] = generateCustomXml();
@@ -23783,7 +23882,7 @@ function storeSuperdocVersion(docx) {
23783
23882
  function generateCustomXml() {
23784
23883
  return DEFAULT_CUSTOM_XML;
23785
23884
  }
23786
- function generateSuperdocVersion(pid = 2, version = "0.12.36") {
23885
+ function generateSuperdocVersion(pid = 2, version = "0.12.37-next.2") {
23787
23886
  return {
23788
23887
  type: "element",
23789
23888
  name: "property",
@@ -1,4 +1,4 @@
1
- import { x as process$1, a1 as commonjsGlobal, B as Buffer, a2 as getDefaultExportFromCjs, a3 as getContentTypesFromXml, a4 as xmljs } from "./converter-BSl_E2ED.js";
1
+ import { x as process$1, a1 as commonjsGlobal, B as Buffer, a2 as getDefaultExportFromCjs, a3 as getContentTypesFromXml, a4 as xmljs } from "./converter-RpLHCUPf.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
  }