@harbour-enterprises/superdoc 0.15.3-next.1 → 0.15.3-next.3

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 (26) hide show
  1. package/dist/chunks/{super-editor.es-C8Ctj1OH.cjs → super-editor.es-CexWiqba.cjs} +47 -12
  2. package/dist/chunks/{super-editor.es-B183P159.es.js → super-editor.es-D52JwV6S.es.js} +47 -12
  3. package/dist/super-editor/ai-writer.es.js +2 -2
  4. package/dist/super-editor/chunks/{converter-DdrESNxU.js → converter-DqVQ7i7O.js} +33 -5
  5. package/dist/super-editor/chunks/{docx-zipper-CnP3UHsO.js → docx-zipper-Bq5VG6S2.js} +1 -1
  6. package/dist/super-editor/chunks/{editor-CAbMNHeM.js → editor-CBbHXA07.js} +16 -9
  7. package/dist/super-editor/chunks/{toolbar-gToxBJrS.js → toolbar-Cn3hmyG0.js} +2 -2
  8. package/dist/super-editor/converter.es.js +1 -1
  9. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  10. package/dist/super-editor/core/super-converter/v2/importer/markImporter.d.ts.map +1 -1
  11. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
  12. package/dist/super-editor/core/super-converter/v2/importer/tableImporter.d.ts.map +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/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts.map +1 -1
  16. package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
  17. package/dist/super-editor/file-zipper.es.js +1 -1
  18. package/dist/super-editor/super-editor.es.js +6 -6
  19. package/dist/super-editor/toolbar.es.js +2 -2
  20. package/dist/super-editor.cjs +1 -1
  21. package/dist/super-editor.es.js +1 -1
  22. package/dist/superdoc.cjs +2 -2
  23. package/dist/superdoc.es.js +3 -3
  24. package/dist/superdoc.umd.js +48 -13
  25. package/dist/superdoc.umd.js.map +1 -1
  26. package/package.json +1 -1
@@ -26992,6 +26992,8 @@
26992
26992
  function parseMarks(property2, unknownMarks = [], docx = null) {
26993
26993
  const marks = [];
26994
26994
  const seen = /* @__PURE__ */ new Set();
26995
+ const lang = property2?.elements?.find((el) => el.name === "w:lang");
26996
+ const langAttrs = lang?.attributes || {};
26995
26997
  property2?.elements?.forEach((element) => {
26996
26998
  const marksForType = SuperConverter.markTypes.filter((mark) => mark.name === element.name);
26997
26999
  if (!marksForType.length) {
@@ -27021,6 +27023,9 @@
27021
27023
  if (attributes["w:val"] === "0" || attributes["w:val"] === "none") {
27022
27024
  return;
27023
27025
  }
27026
+ if (["w:bCs"].includes(m.name) && langAttrs["w:eastAsia"]) {
27027
+ return;
27028
+ }
27024
27029
  if (m.mark) newMark.type = m.mark;
27025
27030
  if (Object.keys(attributes).length) {
27026
27031
  const value = getMarkValue(m.type, attributes, docx);
@@ -27414,6 +27419,7 @@
27414
27419
  const pPrNormal = stylesNormal?.elements?.find((el) => el.name === "w:pPr");
27415
27420
  const pPrNormalSpacingTag = pPrNormal?.elements?.find((el) => el.name === "w:spacing") || {};
27416
27421
  const pPrNormalIndentTag = pPrNormal?.elements?.find((el) => el.name === "w:ind") || {};
27422
+ const isNormalAsDefault = stylesNormal?.attributes?.["w:default"] === "1";
27417
27423
  let pPrStyleIdSpacingTag = {};
27418
27424
  let pPrStyleIdIndentTag = {};
27419
27425
  let pPrStyleJc = {};
@@ -27441,9 +27447,11 @@
27441
27447
  const { attributes: pPrDefaultIndentAttr } = pPrDefaultIndentTag;
27442
27448
  const { attributes: pPrNormalIndentAttr } = pPrNormalIndentTag;
27443
27449
  const { attributes: pPrByIdIndentAttr } = pPrStyleIdIndentTag;
27450
+ const spacingRest = isNormalAsDefault ? pPrNormalSpacingAttr || pPrDefaultSpacingAttr : pPrDefaultSpacingAttr || pPrNormalSpacingAttr;
27451
+ const indentRest = isNormalAsDefault ? pPrNormalIndentAttr || pPrDefaultIndentAttr : pPrDefaultIndentAttr || pPrNormalIndentAttr;
27444
27452
  return {
27445
- spacing: pPrByIdSpacingAttr || pPrDefaultSpacingAttr || pPrNormalSpacingAttr,
27446
- indent: pPrByIdIndentAttr || pPrDefaultIndentAttr || pPrNormalIndentAttr,
27453
+ spacing: pPrByIdSpacingAttr || spacingRest,
27454
+ indent: pPrByIdIndentAttr || indentRest,
27447
27455
  justify: pPrByIdJcAttr,
27448
27456
  textCase
27449
27457
  };
@@ -33230,7 +33238,16 @@
33230
33238
  function generateTableProperties(node2) {
33231
33239
  const elements = [];
33232
33240
  const { attrs } = node2;
33233
- const { tableWidth, tableWidthType, tableStyleId, borders, tableIndent, tableLayout, tableCellSpacing } = attrs;
33241
+ const {
33242
+ tableWidth,
33243
+ tableWidthType,
33244
+ tableStyleId,
33245
+ borders,
33246
+ tableIndent,
33247
+ tableLayout,
33248
+ tableCellSpacing,
33249
+ justification
33250
+ } = attrs;
33234
33251
  if (tableStyleId) {
33235
33252
  const tableStyleElement = {
33236
33253
  name: "w:tblStyle",
@@ -33273,6 +33290,13 @@
33273
33290
  }
33274
33291
  });
33275
33292
  }
33293
+ if (justification) {
33294
+ const justificationElement = {
33295
+ name: "w:jc",
33296
+ attributes: { "w:val": justification }
33297
+ };
33298
+ elements.push(justificationElement);
33299
+ }
33276
33300
  return {
33277
33301
  name: "w:tblPr",
33278
33302
  elements
@@ -34402,6 +34426,10 @@
34402
34426
  };
34403
34427
  attrs["borderCollapse"] = "separate";
34404
34428
  }
34429
+ const tblJustification = tblPr.elements.find((el) => el.name === "w:jc");
34430
+ if (tblJustification?.attributes) {
34431
+ attrs["justification"] = tblJustification.attributes["w:val"];
34432
+ }
34405
34433
  const rows = node2.elements.filter((el) => el.name === "w:tr");
34406
34434
  const refStylesBorders = referencedStyles?.borders || {};
34407
34435
  const refStylesRowBorders = referencedStyles?.rowBorders || {};
@@ -36116,7 +36144,7 @@
36116
36144
  return;
36117
36145
  }
36118
36146
  }
36119
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.3-next.1") {
36147
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.3-next.3") {
36120
36148
  const customLocation = "docProps/custom.xml";
36121
36149
  if (!docx[customLocation]) {
36122
36150
  docx[customLocation] = generateCustomXml();
@@ -36594,7 +36622,7 @@
36594
36622
  function generateCustomXml() {
36595
36623
  return DEFAULT_CUSTOM_XML;
36596
36624
  }
36597
- function generateSuperdocVersion(pid = 2, version2 = "0.15.3-next.1") {
36625
+ function generateSuperdocVersion(pid = 2, version2 = "0.15.3-next.3") {
36598
36626
  return {
36599
36627
  type: "element",
36600
36628
  name: "property",
@@ -52777,7 +52805,7 @@
52777
52805
  * @returns {Object | void} Migration results
52778
52806
  */
52779
52807
  processCollaborationMigrations() {
52780
- console.debug("[checkVersionMigrations] Current editor version", "0.15.3-next.1");
52808
+ console.debug("[checkVersionMigrations] Current editor version", "0.15.3-next.3");
52781
52809
  if (!this.options.ydoc) return;
52782
52810
  const metaMap = this.options.ydoc.getMap("meta");
52783
52811
  let docVersion = metaMap.get("version");
@@ -55142,12 +55170,6 @@
55142
55170
  listNumberingType,
55143
55171
  start: numberingDefStart
55144
55172
  } = ListHelpers.getListDefinitionDetails({ numId, level, editor });
55145
- if (listNumberingType !== node2.attrs.listNumberingType) {
55146
- listNumberingType = node2.attrs.listNumberingType;
55147
- }
55148
- if (lvlText !== node2.attrs.lvlText) {
55149
- lvlText = node2.attrs.lvlText;
55150
- }
55151
55173
  const start2 = parseInt(numberingDefStart) || 1;
55152
55174
  if (!listMap.has(numId)) {
55153
55175
  const generatedLevels = {};
@@ -58321,6 +58343,19 @@
58321
58343
  };
58322
58344
  }
58323
58345
  },
58346
+ justification: {
58347
+ default: null,
58348
+ renderDOM: (attrs) => {
58349
+ if (!attrs.justification) return {};
58350
+ if (attrs.justification === "center") {
58351
+ return { style: `margin: 0 auto` };
58352
+ }
58353
+ if (attrs.justification === "right") {
58354
+ return { style: `margin-left: auto` };
58355
+ }
58356
+ return {};
58357
+ }
58358
+ },
58324
58359
  tableStyleId: {
58325
58360
  rendered: false
58326
58361
  },
@@ -99207,7 +99242,7 @@ ${style2}
99207
99242
  this.config.colors = shuffleArray(this.config.colors);
99208
99243
  this.userColorMap = /* @__PURE__ */ new Map();
99209
99244
  this.colorIndex = 0;
99210
- this.version = "0.15.3-next.1";
99245
+ this.version = "0.15.3-next.3";
99211
99246
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
99212
99247
  this.superdocId = config.superdocId || v4();
99213
99248
  this.colors = this.config.colors;