@harbour-enterprises/superdoc 0.19.0-next.4 → 0.19.0-next.6

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 (62) hide show
  1. package/dist/chunks/{PdfViewer-DmC4Qg1S.cjs → PdfViewer-BlV8_l4e.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-Df9H8xeA.es.js → PdfViewer-oqYWe1FJ.es.js} +1 -1
  3. package/dist/chunks/{index-C_oHQN7n.es.js → index-CeockUQz.es.js} +35 -3
  4. package/dist/chunks/{index-CWQGBk3Z.cjs → index-DHyh73q4.cjs} +35 -3
  5. package/dist/chunks/{super-editor.es-C2QwEj1z.es.js → super-editor.es-BRBU19lM.es.js} +614 -295
  6. package/dist/chunks/{super-editor.es-B_u6OGsf.cjs → super-editor.es-bu-RKSWh.cjs} +614 -295
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/stores/superdoc-store.d.ts +3 -0
  9. package/dist/stores/superdoc-store.d.ts.map +1 -1
  10. package/dist/style.css +6 -6
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-CMajoq-M.js → converter-BFq1XXek.js} +472 -208
  13. package/dist/super-editor/chunks/{docx-zipper-C5rg6GNf.js → docx-zipper-BahUy6FS.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-CH3sE8Fq.js → editor-BdLd21gy.js} +135 -85
  15. package/dist/super-editor/chunks/{toolbar-BHnLBr61.js → toolbar-DoJY1zlM.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/src/core/super-converter/exporter.d.ts +0 -7
  21. package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +0 -22
  22. package/dist/super-editor/src/core/super-converter/v3/handlers/utils.d.ts +37 -0
  23. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/cantSplit-translator.d.ts +6 -0
  24. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/index.d.ts +1 -0
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/cnfStyle-translator.d.ts +7 -0
  26. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/index.d.ts +1 -0
  27. package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/divId-translator.d.ts +6 -0
  28. package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/index.d.ts +1 -0
  29. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/gridAfter-translator.d.ts +6 -0
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/index.d.ts +1 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/gridBefore-translator.d.ts +6 -0
  32. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/index.d.ts +1 -0
  33. package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/hidden-translator.d.ts +6 -0
  34. package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/index.d.ts +1 -0
  35. package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/index.d.ts +1 -0
  36. package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/jc-translator.d.ts +6 -0
  37. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/index.d.ts +1 -0
  38. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/tblCellSpacing-translator.d.ts +6 -0
  39. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/index.d.ts +1 -0
  40. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/tblHeader-translator.d.ts +6 -0
  41. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/index.d.ts +1 -0
  42. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/tr-translator.d.ts +7 -0
  43. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/index.d.ts +1 -0
  44. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/trHeight-translator.d.ts +6 -0
  45. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/index.d.ts +1 -0
  46. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/trPr-translator.d.ts +5 -0
  47. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/index.d.ts +1 -0
  48. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/wAfter-translator.d.ts +6 -0
  49. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/index.d.ts +1 -0
  50. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/wBefore-translator.d.ts +6 -0
  51. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -1
  52. package/dist/super-editor/src/extensions/table-row/table-row.d.ts +149 -0
  53. package/dist/super-editor/style.css +6 -6
  54. package/dist/super-editor/super-editor.es.js +13 -8
  55. package/dist/super-editor/toolbar.es.js +2 -2
  56. package/dist/super-editor.cjs +1 -1
  57. package/dist/super-editor.es.js +1 -1
  58. package/dist/superdoc.cjs +2 -2
  59. package/dist/superdoc.es.js +2 -2
  60. package/dist/superdoc.umd.js +647 -296
  61. package/dist/superdoc.umd.js.map +1 -1
  62. package/package.json +1 -1
@@ -25601,37 +25601,37 @@ const _NodeTranslator = class _NodeTranslator {
25601
25601
  /** @type {typeof TranslatorTypes} */
25602
25602
  __publicField(_NodeTranslator, "translatorTypes", TranslatorTypes);
25603
25603
  let NodeTranslator = _NodeTranslator;
25604
- const encode$g = (attributes) => {
25604
+ const encode$i = (attributes) => {
25605
25605
  return attributes["w:type"];
25606
25606
  };
25607
- const decode$g = (attrs) => {
25607
+ const decode$i = (attrs) => {
25608
25608
  const { lineBreakType } = attrs;
25609
25609
  return lineBreakType;
25610
25610
  };
25611
25611
  const attrConfig$b = Object.freeze({
25612
25612
  xmlName: "w:type",
25613
25613
  sdName: "lineBreakType",
25614
- encode: encode$g,
25615
- decode: decode$g
25614
+ encode: encode$i,
25615
+ decode: decode$i
25616
25616
  });
25617
- const encode$f = (attributes) => {
25617
+ const encode$h = (attributes) => {
25618
25618
  const xmlAttrValue = attributes["w:clear"];
25619
25619
  return xmlAttrValue;
25620
25620
  };
25621
- const decode$f = (attrs) => {
25621
+ const decode$h = (attrs) => {
25622
25622
  const { clear } = attrs;
25623
25623
  return clear;
25624
25624
  };
25625
25625
  const attrConfig$a = Object.freeze({
25626
25626
  xmlName: "w:clear",
25627
25627
  sdName: "clear",
25628
- encode: encode$f,
25629
- decode: decode$f
25628
+ encode: encode$h,
25629
+ decode: decode$h
25630
25630
  });
25631
- const validXmlAttributes$4 = [attrConfig$b, attrConfig$a];
25632
- const XML_NODE_NAME$4 = "w:br";
25633
- const SD_NODE_NAME$4 = "lineBreak";
25634
- const encode$e = (_2, encodedAttrs) => {
25631
+ const validXmlAttributes$5 = [attrConfig$b, attrConfig$a];
25632
+ const XML_NODE_NAME$6 = "w:br";
25633
+ const SD_NODE_NAME$5 = "lineBreak";
25634
+ const encode$g = (_2, encodedAttrs) => {
25635
25635
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
25636
25636
  const translated = {
25637
25637
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -25641,7 +25641,7 @@ const encode$e = (_2, encodedAttrs) => {
25641
25641
  }
25642
25642
  return translated;
25643
25643
  };
25644
- const decode$e = (params, decodedAttrs) => {
25644
+ const decode$g = (params, decodedAttrs) => {
25645
25645
  const { node: node2 } = params;
25646
25646
  if (!node2) return;
25647
25647
  const wBreak = { name: "w:br" };
@@ -25658,63 +25658,63 @@ const decode$e = (params, decodedAttrs) => {
25658
25658
  };
25659
25659
  return translated;
25660
25660
  };
25661
- const config$4 = {
25662
- xmlName: XML_NODE_NAME$4,
25663
- sdNodeOrKeyName: SD_NODE_NAME$4,
25661
+ const config$6 = {
25662
+ xmlName: XML_NODE_NAME$6,
25663
+ sdNodeOrKeyName: SD_NODE_NAME$5,
25664
25664
  type: NodeTranslator.translatorTypes.NODE,
25665
- encode: encode$e,
25666
- decode: decode$e,
25667
- attributes: validXmlAttributes$4
25665
+ encode: encode$g,
25666
+ decode: decode$g,
25667
+ attributes: validXmlAttributes$5
25668
25668
  };
25669
- const translator$4 = NodeTranslator.from(config$4);
25670
- const encode$d = (attributes) => {
25669
+ const translator$i = NodeTranslator.from(config$6);
25670
+ const encode$f = (attributes) => {
25671
25671
  return attributes["w:val"];
25672
25672
  };
25673
- const decode$d = (attrs) => {
25673
+ const decode$f = (attrs) => {
25674
25674
  const { tabSize } = attrs || {};
25675
25675
  return tabSize;
25676
25676
  };
25677
25677
  const attrConfig$9 = Object.freeze({
25678
25678
  xmlName: "w:val",
25679
25679
  sdName: "tabSize",
25680
- encode: encode$d,
25681
- decode: decode$d
25680
+ encode: encode$f,
25681
+ decode: decode$f
25682
25682
  });
25683
- const encode$c = (attributes) => {
25683
+ const encode$e = (attributes) => {
25684
25684
  return attributes["w:leader"];
25685
25685
  };
25686
- const decode$c = (attrs) => {
25686
+ const decode$e = (attrs) => {
25687
25687
  const { leader } = attrs || {};
25688
25688
  return leader;
25689
25689
  };
25690
25690
  const attrConfig$8 = Object.freeze({
25691
25691
  xmlName: "w:leader",
25692
25692
  sdName: "leader",
25693
- encode: encode$c,
25694
- decode: decode$c
25693
+ encode: encode$e,
25694
+ decode: decode$e
25695
25695
  });
25696
- const encode$b = (attributes) => {
25696
+ const encode$d = (attributes) => {
25697
25697
  return attributes["w:pos"];
25698
25698
  };
25699
- const decode$b = (attrs) => {
25699
+ const decode$d = (attrs) => {
25700
25700
  const { pos } = attrs || {};
25701
25701
  return pos;
25702
25702
  };
25703
25703
  const attrConfig$7 = Object.freeze({
25704
25704
  xmlName: "w:pos",
25705
25705
  sdName: "pos",
25706
- encode: encode$b,
25707
- decode: decode$b
25706
+ encode: encode$d,
25707
+ decode: decode$d
25708
25708
  });
25709
- const validXmlAttributes$3 = [attrConfig$9, attrConfig$7, attrConfig$8];
25710
- const XML_NODE_NAME$3 = "w:tab";
25711
- const SD_NODE_NAME$3 = "tab";
25712
- const encode$a = (_2, encodedAttrs = {}) => {
25709
+ const validXmlAttributes$4 = [attrConfig$9, attrConfig$7, attrConfig$8];
25710
+ const XML_NODE_NAME$5 = "w:tab";
25711
+ const SD_NODE_NAME$4 = "tab";
25712
+ const encode$c = (_2, encodedAttrs = {}) => {
25713
25713
  const translated = { type: "tab" };
25714
25714
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
25715
25715
  return translated;
25716
25716
  };
25717
- const decode$a = (params, decodedAttrs = {}) => {
25717
+ const decode$c = (params, decodedAttrs = {}) => {
25718
25718
  const { node: node2 } = params || {};
25719
25719
  if (!node2) return;
25720
25720
  const wTab = { name: "w:tab" };
@@ -25730,15 +25730,15 @@ const decode$a = (params, decodedAttrs = {}) => {
25730
25730
  }
25731
25731
  return translated;
25732
25732
  };
25733
- const config$3 = {
25734
- xmlName: XML_NODE_NAME$3,
25735
- sdNodeOrKeyName: SD_NODE_NAME$3,
25733
+ const config$5 = {
25734
+ xmlName: XML_NODE_NAME$5,
25735
+ sdNodeOrKeyName: SD_NODE_NAME$4,
25736
25736
  type: NodeTranslator.translatorTypes.NODE,
25737
- encode: encode$a,
25738
- decode: decode$a,
25739
- attributes: validXmlAttributes$3
25737
+ encode: encode$c,
25738
+ decode: decode$c,
25739
+ attributes: validXmlAttributes$4
25740
25740
  };
25741
- const translator$3 = NodeTranslator.from(config$3);
25741
+ const translator$h = NodeTranslator.from(config$5);
25742
25742
  const mergeTextNodes = (nodes) => {
25743
25743
  if (!nodes || !Array.isArray(nodes)) {
25744
25744
  return nodes;
@@ -26308,91 +26308,91 @@ const handleParagraphNode$1 = (params) => {
26308
26308
  }
26309
26309
  return schemaNode;
26310
26310
  };
26311
- const encode$9 = (attributes) => {
26311
+ const encode$b = (attributes) => {
26312
26312
  return attributes["w:rsidDel"];
26313
26313
  };
26314
- const decode$9 = (attrs) => {
26314
+ const decode$b = (attrs) => {
26315
26315
  return attrs.rsidDel;
26316
26316
  };
26317
26317
  const attrConfig$6 = Object.freeze({
26318
26318
  xmlName: "w:rsidDel",
26319
26319
  sdName: "rsidDel",
26320
- encode: encode$9,
26321
- decode: decode$9
26320
+ encode: encode$b,
26321
+ decode: decode$b
26322
26322
  });
26323
- const encode$8 = (attributes) => {
26323
+ const encode$a = (attributes) => {
26324
26324
  return attributes["w:rsidP"];
26325
26325
  };
26326
- const decode$8 = (attrs) => {
26326
+ const decode$a = (attrs) => {
26327
26327
  return attrs.rsidP;
26328
26328
  };
26329
26329
  const attrConfig$5 = Object.freeze({
26330
26330
  xmlName: "w:rsidP",
26331
26331
  sdName: "rsidP",
26332
- encode: encode$8,
26333
- decode: decode$8
26332
+ encode: encode$a,
26333
+ decode: decode$a
26334
26334
  });
26335
- const encode$7 = (attributes) => {
26335
+ const encode$9 = (attributes) => {
26336
26336
  return attributes["w:rsidR"];
26337
26337
  };
26338
- const decode$7 = (attrs) => {
26338
+ const decode$9 = (attrs) => {
26339
26339
  return attrs.rsidR;
26340
26340
  };
26341
26341
  const attrConfig$4 = Object.freeze({
26342
26342
  xmlName: "w:rsidR",
26343
26343
  sdName: "rsidR",
26344
- encode: encode$7,
26345
- decode: decode$7
26344
+ encode: encode$9,
26345
+ decode: decode$9
26346
26346
  });
26347
- const encode$6 = (attributes) => {
26347
+ const encode$8 = (attributes) => {
26348
26348
  return attributes["w:rsidRPr"];
26349
26349
  };
26350
- const decode$6 = (attrs) => {
26350
+ const decode$8 = (attrs) => {
26351
26351
  return attrs.rsidRPr;
26352
26352
  };
26353
26353
  const attrConfig$3 = Object.freeze({
26354
26354
  xmlName: "w:rsidRPr",
26355
26355
  sdName: "rsidRPr",
26356
- encode: encode$6,
26357
- decode: decode$6
26356
+ encode: encode$8,
26357
+ decode: decode$8
26358
26358
  });
26359
- const encode$5 = (attributes) => {
26359
+ const encode$7 = (attributes) => {
26360
26360
  return attributes["w:rsidRDefault"];
26361
26361
  };
26362
- const decode$5 = (attrs) => {
26362
+ const decode$7 = (attrs) => {
26363
26363
  return attrs.rsidRDefault;
26364
26364
  };
26365
26365
  const attrConfig$2 = Object.freeze({
26366
26366
  xmlName: "w:rsidRDefault",
26367
26367
  sdName: "rsidRDefault",
26368
- encode: encode$5,
26369
- decode: decode$5
26368
+ encode: encode$7,
26369
+ decode: decode$7
26370
26370
  });
26371
- const encode$4 = (attributes) => {
26371
+ const encode$6 = (attributes) => {
26372
26372
  return attributes["w14:paraId"];
26373
26373
  };
26374
- const decode$4 = (attrs) => {
26374
+ const decode$6 = (attrs) => {
26375
26375
  return attrs.paraId;
26376
26376
  };
26377
26377
  const attrConfig$1 = Object.freeze({
26378
26378
  xmlName: "w14:paraId",
26379
26379
  sdName: "paraId",
26380
- encode: encode$4,
26381
- decode: decode$4
26380
+ encode: encode$6,
26381
+ decode: decode$6
26382
26382
  });
26383
- const encode$3 = (attributes) => {
26383
+ const encode$5 = (attributes) => {
26384
26384
  return attributes["w14:textId"];
26385
26385
  };
26386
- const decode$3 = (attrs) => {
26386
+ const decode$5 = (attrs) => {
26387
26387
  return attrs.textId;
26388
26388
  };
26389
26389
  const attrConfig = Object.freeze({
26390
26390
  xmlName: "w14:textId",
26391
26391
  sdName: "textId",
26392
- encode: encode$3,
26393
- decode: decode$3
26392
+ encode: encode$5,
26393
+ decode: decode$5
26394
26394
  });
26395
- const validXmlAttributes$2 = [
26395
+ const validXmlAttributes$3 = [
26396
26396
  attrConfig$1,
26397
26397
  attrConfig,
26398
26398
  attrConfig$4,
@@ -26401,9 +26401,9 @@ const validXmlAttributes$2 = [
26401
26401
  attrConfig$3,
26402
26402
  attrConfig$6
26403
26403
  ];
26404
- const XML_NODE_NAME$2 = "w:p";
26405
- const SD_NODE_NAME$2 = "paragraph";
26406
- const encode$2 = (params, encodedAttrs = {}) => {
26404
+ const XML_NODE_NAME$4 = "w:p";
26405
+ const SD_NODE_NAME$3 = "paragraph";
26406
+ const encode$4 = (params, encodedAttrs = {}) => {
26407
26407
  const node2 = handleParagraphNode$1(params);
26408
26408
  if (!node2) return void 0;
26409
26409
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -26411,7 +26411,7 @@ const encode$2 = (params, encodedAttrs = {}) => {
26411
26411
  }
26412
26412
  return node2;
26413
26413
  };
26414
- const decode$2 = (params, decodedAttrs = {}) => {
26414
+ const decode$4 = (params, decodedAttrs = {}) => {
26415
26415
  const translated = translateParagraphNode(params);
26416
26416
  if (!translated) return void 0;
26417
26417
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -26419,6 +26419,362 @@ const decode$2 = (params, decodedAttrs = {}) => {
26419
26419
  }
26420
26420
  return translated;
26421
26421
  };
26422
+ const config$4 = {
26423
+ xmlName: XML_NODE_NAME$4,
26424
+ sdNodeOrKeyName: SD_NODE_NAME$3,
26425
+ type: NodeTranslator.translatorTypes.NODE,
26426
+ encode: encode$4,
26427
+ decode: decode$4,
26428
+ attributes: validXmlAttributes$3
26429
+ };
26430
+ const translator$g = NodeTranslator.from(config$4);
26431
+ const generateV2HandlerEntity = (handlerName, translator2) => ({
26432
+ handlerName,
26433
+ handler: (params) => {
26434
+ const { nodes } = params;
26435
+ if (nodes.length === 0 || nodes[0].name !== translator2.xmlName) {
26436
+ return { nodes: [], consumed: 0 };
26437
+ }
26438
+ const result = translator2.encode(params);
26439
+ if (!result) return { nodes: [], consumed: 0 };
26440
+ return {
26441
+ nodes: Array.isArray(result) ? result : [result],
26442
+ consumed: 1
26443
+ };
26444
+ }
26445
+ });
26446
+ function createSingleAttrPropertyHandler(xmlName, sdName = null, attrName = "w:val", transformEncode = null, transformDecode = null) {
26447
+ if (!sdName) sdName = xmlName.split(":")[1];
26448
+ if (!transformEncode) transformEncode = (v2) => v2;
26449
+ if (!transformDecode) transformDecode = (v2) => v2;
26450
+ return {
26451
+ xmlName,
26452
+ sdNodeOrKeyName: sdName,
26453
+ encode: ({ nodes }) => {
26454
+ return transformEncode(nodes[0].attributes[attrName]) ?? void 0;
26455
+ },
26456
+ decode: ({ node: node2 }) => {
26457
+ const value = node2.attrs?.[sdName] != null ? transformDecode(node2.attrs[sdName]) : void 0;
26458
+ return value != null ? { [attrName]: value } : void 0;
26459
+ }
26460
+ };
26461
+ }
26462
+ function createMeasurementPropertyHandler(xmlName, sdName = null) {
26463
+ if (!sdName) sdName = xmlName.split(":")[1];
26464
+ return {
26465
+ xmlName,
26466
+ sdNodeOrKeyName: sdName,
26467
+ attributes: [
26468
+ createAttributeHandler("w:w", "value", parseInteger, integerToString),
26469
+ createAttributeHandler("w:type")
26470
+ ],
26471
+ encode: (_2, encodedAttrs) => {
26472
+ return encodedAttrs["value"] != null ? encodedAttrs : void 0;
26473
+ },
26474
+ decode: function({ node: node2 }) {
26475
+ const decodedAttrs = this.decodeAttributes({ node: { ...node2, attrs: node2.attrs[sdName] || {} } });
26476
+ return decodedAttrs["w:w"] != null ? decodedAttrs : void 0;
26477
+ }
26478
+ };
26479
+ }
26480
+ const createAttributeHandler = (xmlName, sdName = null, transformEncode = null, transformDecode = null) => {
26481
+ if (!transformEncode) transformEncode = (v2) => v2;
26482
+ if (!transformDecode) transformDecode = (v2) => v2;
26483
+ if (!sdName) sdName = xmlName.split(":")[1];
26484
+ return {
26485
+ xmlName,
26486
+ sdName,
26487
+ encode: (attributes) => transformEncode(attributes[xmlName]),
26488
+ decode: (attributes) => transformDecode(attributes[sdName])
26489
+ };
26490
+ };
26491
+ function encodeProperties(node2, translatorsByXmlName, asArray = false) {
26492
+ if (!node2?.elements || node2.elements.length === 0) {
26493
+ return asArray ? [] : {};
26494
+ }
26495
+ const attributes = asArray ? [] : {};
26496
+ node2.elements.forEach((el) => {
26497
+ const translator2 = translatorsByXmlName[el.name];
26498
+ if (translator2) {
26499
+ const encodedAttr = translator2.encode({ nodes: [el] });
26500
+ if (encodedAttr != null) {
26501
+ if (asArray) {
26502
+ attributes.push({ [translator2.sdNodeOrKeyName]: encodedAttr });
26503
+ } else {
26504
+ attributes[translator2.sdNodeOrKeyName] = encodedAttr;
26505
+ }
26506
+ }
26507
+ }
26508
+ });
26509
+ return attributes;
26510
+ }
26511
+ function decodeProperties(translatorsBySdName, properties) {
26512
+ if (!properties || typeof properties !== "object") {
26513
+ return [];
26514
+ }
26515
+ const elements = [];
26516
+ Object.keys(properties).forEach((key) => {
26517
+ const translator2 = translatorsBySdName[key];
26518
+ if (translator2) {
26519
+ const attributes = translator2.decode({ node: { attrs: { [key]: properties[key] } } });
26520
+ if (attributes != null) {
26521
+ elements.push({ name: translator2.xmlName, attributes });
26522
+ }
26523
+ }
26524
+ });
26525
+ return elements;
26526
+ }
26527
+ const parseBoolean = (value) => ["1", "true"].includes(value);
26528
+ const parseInteger = (value) => {
26529
+ if (value == null) return void 0;
26530
+ const intValue = parseInt(value, 10);
26531
+ return isNaN(intValue) ? void 0 : intValue;
26532
+ };
26533
+ const integerToString = (value) => {
26534
+ const intValue = parseInteger(value);
26535
+ return intValue != void 0 ? String(intValue) : void 0;
26536
+ };
26537
+ const translator$f = NodeTranslator.from({
26538
+ xmlName: "w:cantSplit",
26539
+ sdNodeOrKeyName: "cantSplit",
26540
+ encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
26541
+ decode: ({ node: node2 }) => node2.attrs?.cantSplit ? {} : void 0
26542
+ });
26543
+ const translator$e = NodeTranslator.from({
26544
+ xmlName: "w:cnfStyle",
26545
+ sdNodeOrKeyName: "cnfStyle",
26546
+ attributes: [
26547
+ "w:evenHBand",
26548
+ "w:evenVBand",
26549
+ "w:firstColumn",
26550
+ "w:firstRow",
26551
+ "w:firstRowFirstColumn",
26552
+ "w:firstRowLastColumn",
26553
+ "w:lastColumn",
26554
+ "w:lastRow",
26555
+ "w:lastRowFirstColumn",
26556
+ "w:lastRowLastColumn",
26557
+ "w:oddHBand",
26558
+ "w:oddVBand",
26559
+ "w:val"
26560
+ ].map((attr) => createAttributeHandler(attr)),
26561
+ encode: (_2, encodedAttrs) => {
26562
+ Object.keys(encodedAttrs).forEach((key) => {
26563
+ encodedAttrs[key] = ["1", "true"].includes(encodedAttrs[key]);
26564
+ });
26565
+ return Object.keys(encodedAttrs).length > 0 ? encodedAttrs : void 0;
26566
+ },
26567
+ decode: ({ node: node2 }) => {
26568
+ if (!node2.attrs?.cnfStyle) return;
26569
+ const cnfStyleAttrs = {};
26570
+ Object.entries(node2.attrs.cnfStyle).forEach(([key, value]) => {
26571
+ cnfStyleAttrs[`w:${key}`] = value ? "1" : "0";
26572
+ });
26573
+ return Object.keys(cnfStyleAttrs).length > 0 ? cnfStyleAttrs : void 0;
26574
+ }
26575
+ });
26576
+ const translator$d = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26577
+ const translator$c = NodeTranslator.from(
26578
+ createSingleAttrPropertyHandler(
26579
+ "w:gridAfter",
26580
+ null,
26581
+ "w:val",
26582
+ (v2) => parseInteger(v2) ?? void 0,
26583
+ (v2) => integerToString(v2)
26584
+ )
26585
+ );
26586
+ const translator$b = NodeTranslator.from(
26587
+ createSingleAttrPropertyHandler(
26588
+ "w:gridBefore",
26589
+ null,
26590
+ "w:val",
26591
+ (v2) => parseInteger(v2) ?? void 0,
26592
+ (v2) => integerToString(v2)
26593
+ )
26594
+ );
26595
+ const translator$a = NodeTranslator.from({
26596
+ xmlName: "w:hidden",
26597
+ sdNodeOrKeyName: "hidden",
26598
+ encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26599
+ decode: ({ node: node2 }) => node2.attrs.hidden ? {} : void 0
26600
+ });
26601
+ const translator$9 = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc"));
26602
+ const translator$8 = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "cellSpacing"));
26603
+ const translator$7 = NodeTranslator.from({
26604
+ xmlName: "w:tblHeader",
26605
+ sdNodeOrKeyName: "repeatHeader",
26606
+ encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26607
+ decode: ({ node: node2 }) => node2.attrs.repeatHeader ? {} : void 0
26608
+ });
26609
+ const translator$6 = NodeTranslator.from({
26610
+ xmlName: "w:trHeight",
26611
+ sdNodeOrKeyName: "rowHeight",
26612
+ encode: ({ nodes }) => {
26613
+ const heightAttrs = {};
26614
+ const val = nodes[0].attributes["w:val"];
26615
+ if (val) {
26616
+ heightAttrs["value"] = parseInt(val, 10);
26617
+ }
26618
+ const rule = nodes[0].attributes["w:hRule"];
26619
+ if (rule) {
26620
+ heightAttrs["rule"] = rule;
26621
+ }
26622
+ return Object.keys(heightAttrs).length > 0 ? heightAttrs : void 0;
26623
+ },
26624
+ decode: ({ node: node2 }) => {
26625
+ if (!node2.attrs?.rowHeight) return;
26626
+ const heightAttrs = {};
26627
+ if (typeof node2.attrs.rowHeight.value === "number" && !isNaN(node2.attrs.rowHeight.value)) {
26628
+ heightAttrs["w:val"] = String(node2.attrs.rowHeight.value);
26629
+ }
26630
+ if (node2.attrs.rowHeight.rule) {
26631
+ heightAttrs["w:hRule"] = node2.attrs.rowHeight.rule;
26632
+ }
26633
+ return Object.keys(heightAttrs).length > 0 ? heightAttrs : void 0;
26634
+ }
26635
+ });
26636
+ const translator$5 = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26637
+ const translator$4 = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26638
+ const XML_NODE_NAME$3 = "w:trPr";
26639
+ const SD_ATTR_KEY = "tableRowProperties";
26640
+ const encode$3 = (params) => {
26641
+ const { nodes } = params;
26642
+ const node2 = nodes[0];
26643
+ let attributes = {
26644
+ cantSplit: false,
26645
+ hidden: false,
26646
+ repeatHeader: false
26647
+ };
26648
+ attributes = {
26649
+ ...attributes,
26650
+ ...encodeProperties(node2, propertyTranslatorsByXmlName)
26651
+ };
26652
+ return {
26653
+ type: NodeTranslator.translatorTypes.ATTRIBUTE,
26654
+ xmlName: XML_NODE_NAME$3,
26655
+ sdNodeOrKeyName: SD_ATTR_KEY,
26656
+ attributes
26657
+ };
26658
+ };
26659
+ const decode$3 = (params) => {
26660
+ const { tableRowProperties = {} } = params.node.attrs || {};
26661
+ const elements = decodeProperties(propertyTranslatorsBySdName, tableRowProperties);
26662
+ const newNode = {
26663
+ name: "w:trPr",
26664
+ type: "element",
26665
+ attributes: {},
26666
+ elements
26667
+ };
26668
+ return newNode;
26669
+ };
26670
+ const propertyTranslators = [
26671
+ translator$f,
26672
+ translator$e,
26673
+ translator$d,
26674
+ translator$c,
26675
+ translator$b,
26676
+ translator$a,
26677
+ translator$9,
26678
+ translator$8,
26679
+ translator$7,
26680
+ translator$6,
26681
+ translator$5,
26682
+ translator$4
26683
+ ];
26684
+ const propertyTranslatorsByXmlName = {};
26685
+ propertyTranslators.forEach((translator2) => {
26686
+ propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
26687
+ });
26688
+ const propertyTranslatorsBySdName = {};
26689
+ propertyTranslators.forEach((translator2) => {
26690
+ propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
26691
+ });
26692
+ const config$3 = {
26693
+ xmlName: XML_NODE_NAME$3,
26694
+ sdNodeOrKeyName: SD_ATTR_KEY,
26695
+ type: NodeTranslator.translatorTypes.ATTRIBUTE,
26696
+ encode: encode$3,
26697
+ decode: decode$3
26698
+ };
26699
+ const translator$3 = NodeTranslator.from(config$3);
26700
+ const XML_NODE_NAME$2 = "w:tr";
26701
+ const SD_NODE_NAME$2 = "tableRow";
26702
+ const validXmlAttributes$2 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26703
+ (xmlName) => createAttributeHandler(xmlName)
26704
+ );
26705
+ const encode$2 = (params, encodedAttrs) => {
26706
+ const { row, table } = params.extraParams;
26707
+ let tableRowProperties = {};
26708
+ const tPr = row.elements.find((el) => el.name === "w:trPr");
26709
+ if (tPr) {
26710
+ ({ attributes: tableRowProperties } = translator$3.encode({
26711
+ ...params,
26712
+ nodes: [tPr]
26713
+ }));
26714
+ }
26715
+ encodedAttrs["tableRowProperties"] = Object.freeze(tableRowProperties);
26716
+ encodedAttrs["rowHeight"] = twipsToPixels(tableRowProperties["rowHeight"]?.value);
26717
+ encodedAttrs["cantSplit"] = tableRowProperties["cantSplit"];
26718
+ const gridColumnWidths = _getGridColumnWidths(table);
26719
+ const cellNodes = row.elements.filter((el) => el.name === "w:tc");
26720
+ let currentColumnIndex = 0;
26721
+ const content = cellNodes?.map((n) => {
26722
+ let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
26723
+ const result = translator$1.encode({
26724
+ ...params,
26725
+ extraParams: {
26726
+ ...params.extraParams,
26727
+ node: n,
26728
+ columnIndex: currentColumnIndex,
26729
+ columnWidth
26730
+ }
26731
+ });
26732
+ const tcPr = n.elements?.find((el) => el.name === "w:tcPr");
26733
+ const colspanTag = tcPr?.elements?.find((el) => el.name === "w:gridSpan");
26734
+ const colspan = parseInt(colspanTag?.attributes["w:val"] || 1, 10);
26735
+ currentColumnIndex += colspan;
26736
+ return result;
26737
+ }) || [];
26738
+ const newNode = {
26739
+ type: "tableRow",
26740
+ content,
26741
+ attrs: encodedAttrs
26742
+ };
26743
+ return newNode;
26744
+ };
26745
+ const _getGridColumnWidths = (tableNode) => {
26746
+ const tblGrid = tableNode.elements.find((el) => el.name === "w:tblGrid");
26747
+ if (!tblGrid) return [];
26748
+ const columnWidths = tblGrid?.elements?.flatMap((el) => {
26749
+ if (el.name !== "w:gridCol") return [];
26750
+ return twipsToPixels(el.attributes["w:w"]);
26751
+ }) || [];
26752
+ return columnWidths;
26753
+ };
26754
+ const decode$2 = (params, decodedAttrs) => {
26755
+ const { node: node2 } = params;
26756
+ const elements = translateChildNodes(params);
26757
+ if (node2.attrs?.tableRowProperties) {
26758
+ const tableRowProperties = { ...node2.attrs.tableRowProperties };
26759
+ if (node2.attrs.rowHeight != null) {
26760
+ const rowHeightPixels = twipsToPixels(node2.attrs.tableRowProperties["rowHeight"]?.value);
26761
+ if (rowHeightPixels !== node2.attrs.rowHeight) {
26762
+ tableRowProperties["rowHeight"] = { value: String(pixelsToTwips(node2.attrs["rowHeight"])) };
26763
+ }
26764
+ }
26765
+ tableRowProperties["cantSplit"] = node2.attrs["cantSplit"];
26766
+ const trPr = translator$3.decode({
26767
+ ...params,
26768
+ node: { ...node2, attrs: { ...node2.attrs, tableRowProperties } }
26769
+ });
26770
+ if (trPr) elements.unshift(trPr);
26771
+ }
26772
+ return {
26773
+ name: "w:tr",
26774
+ attributes: decodedAttrs || {},
26775
+ elements
26776
+ };
26777
+ };
26422
26778
  const config$2 = {
26423
26779
  xmlName: XML_NODE_NAME$2,
26424
26780
  sdNodeOrKeyName: SD_NODE_NAME$2,
@@ -26491,7 +26847,16 @@ function handleTableNode(node2, params) {
26491
26847
  attrs["borders"] = borderData;
26492
26848
  const content = [];
26493
26849
  rows.forEach((row) => {
26494
- const result = handleTableRowNode(row, node2, borderRowData, tblStyleTag, params);
26850
+ const result = translator$2.encode({
26851
+ ...params,
26852
+ nodes: [row],
26853
+ extraParams: {
26854
+ row,
26855
+ table: node2,
26856
+ rowBorders: borderRowData,
26857
+ styleTag: tblStyleTag
26858
+ }
26859
+ });
26495
26860
  if (result.content?.length) content.push(result);
26496
26861
  });
26497
26862
  return {
@@ -26500,31 +26865,6 @@ function handleTableNode(node2, params) {
26500
26865
  attrs
26501
26866
  };
26502
26867
  }
26503
- function handleTableCellNode$1({
26504
- params,
26505
- node: node2,
26506
- table,
26507
- row,
26508
- rowBorders,
26509
- styleTag,
26510
- columnIndex,
26511
- columnWidth = null
26512
- }) {
26513
- const translatorParams = {
26514
- ...params,
26515
- extraParams: {
26516
- node: node2,
26517
- table,
26518
- row,
26519
- rowBorders,
26520
- styleTag,
26521
- columnIndex,
26522
- columnWidth
26523
- }
26524
- };
26525
- const schemaNode = translator$1.encode(translatorParams);
26526
- return schemaNode;
26527
- }
26528
26868
  function getReferencedTableStyles(tblStyleTag, docx) {
26529
26869
  if (!tblStyleTag) return null;
26530
26870
  const stylesToReturn = {};
@@ -26605,50 +26945,6 @@ function processTableBorders(borderElements) {
26605
26945
  rowBorders
26606
26946
  };
26607
26947
  }
26608
- function handleTableRowNode(node2, table, rowBorders, styleTag, params) {
26609
- const attrs = {};
26610
- const tPr = node2.elements.find((el) => el.name === "w:trPr");
26611
- const rowHeightTag = tPr?.elements?.find((el) => el.name === "w:trHeight");
26612
- const rowHeight = rowHeightTag?.attributes["w:val"];
26613
- const cantSplitTag = tPr?.elements?.find((el) => el.name === "w:cantSplit");
26614
- if (cantSplitTag) {
26615
- attrs["cantSplit"] = true;
26616
- }
26617
- const borders = {};
26618
- if (rowBorders?.insideH) borders["bottom"] = rowBorders.insideH;
26619
- if (rowBorders?.insideV) borders["right"] = rowBorders.insideV;
26620
- attrs["borders"] = borders;
26621
- if (rowHeight) {
26622
- attrs["rowHeight"] = twipsToPixels(rowHeight);
26623
- }
26624
- const gridColumnWidths = getGridColumnWidths(table);
26625
- const cellNodes = node2.elements.filter((el) => el.name === "w:tc");
26626
- let currentColumnIndex = 0;
26627
- const content = cellNodes?.map((n) => {
26628
- let colWidth = gridColumnWidths?.[currentColumnIndex] || null;
26629
- const result = handleTableCellNode$1({
26630
- params,
26631
- node: n,
26632
- table,
26633
- row: node2,
26634
- rowBorders: borders,
26635
- styleTag,
26636
- columnIndex: currentColumnIndex,
26637
- columnWidth: colWidth
26638
- });
26639
- const tcPr = n.elements?.find((el) => el.name === "w:tcPr");
26640
- const colspanTag = tcPr?.elements?.find((el) => el.name === "w:gridSpan");
26641
- const colspan = parseInt(colspanTag?.attributes["w:val"] || 1, 10);
26642
- currentColumnIndex += colspan;
26643
- return result;
26644
- }) || [];
26645
- const newNode = {
26646
- type: "tableRow",
26647
- content,
26648
- attrs
26649
- };
26650
- return newNode;
26651
- }
26652
26948
  const getGridColumnWidths = (tableNode) => {
26653
26949
  const tblGrid = tableNode.elements.find((el) => el.name === "w:tblGrid");
26654
26950
  if (!tblGrid) return [];
@@ -26671,6 +26967,14 @@ function handleTableCellNode({
26671
26967
  const { docx, nodeListHandler: nodeListHandler2 } = params;
26672
26968
  const tcPr = node2.elements.find((el) => el.name === "w:tcPr");
26673
26969
  const borders = tcPr?.elements?.find((el) => el.name === "w:tcBorders");
26970
+ if (rowBorders?.insideH) {
26971
+ rowBorders["bottom"] = rowBorders.insideH;
26972
+ delete rowBorders.insideH;
26973
+ }
26974
+ if (rowBorders?.insideV) {
26975
+ rowBorders["right"] = rowBorders.insideV;
26976
+ delete rowBorders?.insideV;
26977
+ }
26674
26978
  const inlineBorders = processInlineCellBorders(borders, rowBorders);
26675
26979
  const gridColumnWidths = getGridColumnWidths(table);
26676
26980
  const tcWidth = tcPr?.elements?.find((el) => el.name === "w:tcW");
@@ -27012,7 +27316,7 @@ const _resolveHref = (docx, encodedAttrs) => {
27012
27316
  }
27013
27317
  return href;
27014
27318
  };
27015
- function decode(params, _2) {
27319
+ function decode(params) {
27016
27320
  const { node: node2 } = params;
27017
27321
  const linkMark = node2.marks.find((m2) => m2.type === "link");
27018
27322
  const linkAttrs = this.decodeAttributes({ ...params, node: linkMark });
@@ -27071,19 +27375,19 @@ function exportSchemaToJson(params) {
27071
27375
  doc: translateDocumentNode,
27072
27376
  body: translateBodyNode,
27073
27377
  heading: translateHeadingNode,
27074
- paragraph: translator$2,
27378
+ paragraph: translator$g,
27075
27379
  text: translateTextNode,
27076
27380
  bulletList: translateList,
27077
27381
  orderedList: translateList,
27078
- lineBreak: translator$4,
27382
+ lineBreak: translator$i,
27079
27383
  table: translateTable,
27080
- tableRow: translateTableRow,
27384
+ tableRow: translator$2,
27081
27385
  tableCell: translator$1,
27082
27386
  bookmarkStart: translateBookmarkStart,
27083
27387
  fieldAnnotation: translateFieldAnnotation,
27084
- tab: translator$3,
27388
+ tab: translator$h,
27085
27389
  image: translateImageNode,
27086
- hardBreak: translator$4,
27390
+ hardBreak: translator$i,
27087
27391
  commentRangeStart: () => translateCommentNode(params, "Start"),
27088
27392
  commentRangeEnd: () => translateCommentNode(params, "End"),
27089
27393
  commentReference: () => null,
@@ -27863,36 +28167,6 @@ function generateTableGrid(node2, params) {
27863
28167
  elements
27864
28168
  };
27865
28169
  }
27866
- function translateTableRow(params) {
27867
- const elements = translateChildNodes(params);
27868
- const tableRowProperties = generateTableRowProperties(params.node);
27869
- if (tableRowProperties.elements.length) elements.unshift(tableRowProperties);
27870
- return {
27871
- name: "w:tr",
27872
- elements
27873
- };
27874
- }
27875
- function generateTableRowProperties(node2) {
27876
- const { attrs } = node2;
27877
- const elements = [];
27878
- const { rowHeight, rowHeightType } = attrs;
27879
- if (rowHeight) {
27880
- const attributes = { "w:val": pixelsToTwips(rowHeight) };
27881
- if (rowHeightType) attributes["w:hRule"] = rowHeightType;
27882
- const rowHeightElement = {
27883
- name: "w:trHeight",
27884
- attributes
27885
- };
27886
- elements.push(rowHeightElement);
27887
- }
27888
- if (attrs?.cantSplit) {
27889
- elements.push({ name: "w:cantSplit" });
27890
- }
27891
- return {
27892
- name: "w:trPr",
27893
- elements
27894
- };
27895
- }
27896
28170
  function translateBookmarkStart(params) {
27897
28171
  const bookmarkStartNode = {
27898
28172
  name: "w:bookmarkStart",
@@ -29112,21 +29386,6 @@ const trackChangeNodeHandlerEntity = {
29112
29386
  handlerName: "trackChangeNodeHandler",
29113
29387
  handler: handleTrackChangeNode
29114
29388
  };
29115
- const generateV2HandlerEntity = (handlerName, translator2) => ({
29116
- handlerName,
29117
- handler: (params) => {
29118
- const { nodes } = params;
29119
- if (nodes.length === 0 || nodes[0].name !== translator2.xmlName) {
29120
- return { nodes: [], consumed: 0 };
29121
- }
29122
- const result = translator2.encode(params);
29123
- if (!result) return { nodes: [], consumed: 0 };
29124
- return {
29125
- nodes: Array.isArray(result) ? result : [result],
29126
- consumed: 1
29127
- };
29128
- }
29129
- });
29130
29389
  const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator);
29131
29390
  const handleRunNode = (params) => {
29132
29391
  const { nodes, nodeListHandler: nodeListHandler2, parentStyleId, docx } = params;
@@ -29239,7 +29498,7 @@ const handleParagraphNode = (params) => {
29239
29498
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
29240
29499
  return { nodes: [], consumed: 0 };
29241
29500
  }
29242
- const schemaNode = translator$2.encode(params);
29501
+ const schemaNode = translator$g.encode(params);
29243
29502
  const newNodes = schemaNode ? [schemaNode] : [];
29244
29503
  return { nodes: newNodes, consumed: 1 };
29245
29504
  };
@@ -29552,7 +29811,7 @@ const handler = (params) => {
29552
29811
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
29553
29812
  return { nodes: [], consumed: 0 };
29554
29813
  }
29555
- const result = translator$4.encode(params);
29814
+ const result = translator$i.encode(params);
29556
29815
  if (!result) return { nodes: [], consumed: 0 };
29557
29816
  return {
29558
29817
  nodes: [result],
@@ -30248,7 +30507,7 @@ const handleTabNode = (params) => {
30248
30507
  if (!nodes.length || nodes[0].name !== "w:tab") {
30249
30508
  return { nodes: [], consumed: 0 };
30250
30509
  }
30251
- const node2 = translator$3.encode(params);
30510
+ const node2 = translator$h.encode(params);
30252
30511
  return { nodes: [node2], consumed: 1 };
30253
30512
  };
30254
30513
  const tabNodeEntityHandler = {
@@ -30445,7 +30704,7 @@ const createNodeListHandler = (nodeHandlers) => {
30445
30704
  }
30446
30705
  } catch (error) {
30447
30706
  console.debug("Import error", error);
30448
- editor?.emit("exception", { error });
30707
+ editor?.emit("exception", { error, editor });
30449
30708
  converter?.telemetry?.trackStatistic("error", {
30450
30709
  type: "processing_error",
30451
30710
  message: error.message,
@@ -30458,7 +30717,7 @@ const createNodeListHandler = (nodeHandlers) => {
30458
30717
  return processedElements;
30459
30718
  } catch (error) {
30460
30719
  console.debug("Error during import", error);
30461
- editor?.emit("exception", { error });
30720
+ editor?.emit("exception", { error, editor });
30462
30721
  converter?.telemetry?.trackStatistic("error", {
30463
30722
  type: "fatal_error",
30464
30723
  message: error.message,
@@ -30924,8 +31183,13 @@ const _SuperConverter = class _SuperConverter {
30924
31183
  return { typeface, panose };
30925
31184
  }
30926
31185
  getSchema(editor) {
30927
- this.getDocumentInternalId();
30928
- const result = createDocumentJson({ ...this.convertedXml, media: this.media }, this, editor);
31186
+ let result;
31187
+ try {
31188
+ this.getDocumentInternalId();
31189
+ result = createDocumentJson({ ...this.convertedXml, media: this.media }, this, editor);
31190
+ } catch (error) {
31191
+ editor?.emit("exception", { error, editor });
31192
+ }
30929
31193
  if (result) {
30930
31194
  this.savedTagsToRestore.push({ ...result.savedTagsToRestore });
30931
31195
  this.pageStyles = result.pageStyles;
@@ -31329,9 +31593,9 @@ export {
31329
31593
  readFromClipboard as aC,
31330
31594
  handleClipboardPaste as aD,
31331
31595
  getFileObject as aE,
31332
- translator$2 as aF,
31333
- translator$3 as aG,
31334
- translator$4 as aH,
31596
+ translator$g as aF,
31597
+ translator$h as aG,
31598
+ translator$i as aH,
31335
31599
  _sfc_main as aI,
31336
31600
  hasSomeParentWithClass as aa,
31337
31601
  isActive as ab,