@harbour-enterprises/superdoc 0.12.16 → 0.12.17

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.
@@ -19281,9 +19281,15 @@ function translateList(params2) {
19281
19281
  if (!outputNode.elements) {
19282
19282
  outputNode.elements = [];
19283
19283
  }
19284
+ if (Array.isArray(outputNode)) {
19285
+ const mapped = [];
19286
+ outputNode.forEach((el) => mapped.push(...el.elements, { name: "w:br", type: "element" }));
19287
+ mapped.unshift(carbonCopy(pPr));
19288
+ return listNodes.push({ name: "w:p", elements: mapped });
19289
+ }
19284
19290
  const propsElementIndex = outputNode.elements.findIndex((e) => e.name === "w:pPr");
19285
19291
  const content2 = outputNode.elements.filter((e) => e.name !== "w:pPr");
19286
- if (!content2.length) {
19292
+ if (!content2.length && !Array.isArray(outputNode)) {
19287
19293
  const elements = contentNode.attrs.paragraphProperties ? [contentNode.attrs.paragraphProperties] : [];
19288
19294
  const spacer = {
19289
19295
  name: "w:p",
@@ -19292,6 +19298,23 @@ function translateList(params2) {
19292
19298
  };
19293
19299
  return listNodes.push(spacer);
19294
19300
  }
19301
+ outputNode.elements = outputNode.elements.map((el, index22) => {
19302
+ if (el.name === "w:sdt") {
19303
+ const contentIndex = el.elements.findIndex((e) => e.name === "w:sdtContent");
19304
+ const content3 = el.elements[contentIndex];
19305
+ const innerContent = content3.elements[0];
19306
+ if (innerContent.name === "w:p") {
19307
+ content3.elements = innerContent.elements;
19308
+ }
19309
+ return {
19310
+ name: "w:r",
19311
+ type: "element",
19312
+ elements: [el]
19313
+ };
19314
+ } else {
19315
+ return el;
19316
+ }
19317
+ });
19295
19318
  const { attributes: generalAttributes } = attrs;
19296
19319
  const { originalInlineRunProps } = generalAttributes || {};
19297
19320
  if (originalInlineRunProps) pPr.elements.push(originalInlineRunProps);
@@ -21459,12 +21482,6 @@ function handleListNodes({
21459
21482
  let lastNestedListLevel = 0;
21460
21483
  for (let [index2, item] of listItems.entries()) {
21461
21484
  if (item.seen) continue;
21462
- if (item.elements && !hasTextNode(item.elements)) {
21463
- const n = handleStandardNode2({ ...params2, nodes: [item] }).nodes[0];
21464
- if (n) parsedListItems[parsedListItems.length - 1]?.content.push(n);
21465
- item.seen = true;
21466
- continue;
21467
- }
21468
21485
  const { attributes, elements, marks = [] } = parseProperties(item);
21469
21486
  const matchedStyle = getStyleTagFromStyleId(styleId, docx) || {};
21470
21487
  const { marks: styleIdMarks } = parseProperties(matchedStyle);
@@ -21502,9 +21519,10 @@ function handleListNodes({
21502
21519
  overallListType = listType;
21503
21520
  item.seen = true;
21504
21521
  const schemaElements = [];
21522
+ const nodeContents = nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n) || [];
21505
21523
  let parNode = {
21506
21524
  type: "paragraph",
21507
- content: nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n)
21525
+ content: nodeContents
21508
21526
  };
21509
21527
  if (parNode.content) {
21510
21528
  parNode = {
@@ -23269,7 +23287,7 @@ const _SuperConverter = class _SuperConverter2 {
23269
23287
  return;
23270
23288
  }
23271
23289
  }
23272
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.16") {
23290
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.17") {
23273
23291
  const customLocation = "docProps/custom.xml";
23274
23292
  if (!docx[customLocation]) {
23275
23293
  docx[customLocation] = generateCustomXml();
@@ -23735,7 +23753,7 @@ function storeSuperdocVersion(docx) {
23735
23753
  function generateCustomXml() {
23736
23754
  return DEFAULT_CUSTOM_XML;
23737
23755
  }
23738
- function generateSuperdocVersion(pid = 2, version2 = "0.12.16") {
23756
+ function generateSuperdocVersion(pid = 2, version2 = "0.12.17") {
23739
23757
  return {
23740
23758
  type: "element",
23741
23759
  name: "property",
@@ -40889,7 +40907,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
40889
40907
  * @returns {Object | void} Migration results
40890
40908
  */
40891
40909
  processCollaborationMigrations() {
40892
- console.debug("[checkVersionMigrations] Current editor version", "0.12.16");
40910
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.17");
40893
40911
  if (!this.options.ydoc) return;
40894
40912
  const metaMap = this.options.ydoc.getMap("meta");
40895
40913
  let docVersion = metaMap.get("version");
@@ -19298,9 +19298,15 @@ function translateList(params2) {
19298
19298
  if (!outputNode.elements) {
19299
19299
  outputNode.elements = [];
19300
19300
  }
19301
+ if (Array.isArray(outputNode)) {
19302
+ const mapped = [];
19303
+ outputNode.forEach((el) => mapped.push(...el.elements, { name: "w:br", type: "element" }));
19304
+ mapped.unshift(carbonCopy(pPr));
19305
+ return listNodes.push({ name: "w:p", elements: mapped });
19306
+ }
19301
19307
  const propsElementIndex = outputNode.elements.findIndex((e) => e.name === "w:pPr");
19302
19308
  const content2 = outputNode.elements.filter((e) => e.name !== "w:pPr");
19303
- if (!content2.length) {
19309
+ if (!content2.length && !Array.isArray(outputNode)) {
19304
19310
  const elements = contentNode.attrs.paragraphProperties ? [contentNode.attrs.paragraphProperties] : [];
19305
19311
  const spacer = {
19306
19312
  name: "w:p",
@@ -19309,6 +19315,23 @@ function translateList(params2) {
19309
19315
  };
19310
19316
  return listNodes.push(spacer);
19311
19317
  }
19318
+ outputNode.elements = outputNode.elements.map((el, index22) => {
19319
+ if (el.name === "w:sdt") {
19320
+ const contentIndex = el.elements.findIndex((e) => e.name === "w:sdtContent");
19321
+ const content3 = el.elements[contentIndex];
19322
+ const innerContent = content3.elements[0];
19323
+ if (innerContent.name === "w:p") {
19324
+ content3.elements = innerContent.elements;
19325
+ }
19326
+ return {
19327
+ name: "w:r",
19328
+ type: "element",
19329
+ elements: [el]
19330
+ };
19331
+ } else {
19332
+ return el;
19333
+ }
19334
+ });
19312
19335
  const { attributes: generalAttributes } = attrs;
19313
19336
  const { originalInlineRunProps } = generalAttributes || {};
19314
19337
  if (originalInlineRunProps) pPr.elements.push(originalInlineRunProps);
@@ -21476,12 +21499,6 @@ function handleListNodes({
21476
21499
  let lastNestedListLevel = 0;
21477
21500
  for (let [index2, item] of listItems.entries()) {
21478
21501
  if (item.seen) continue;
21479
- if (item.elements && !hasTextNode(item.elements)) {
21480
- const n = handleStandardNode2({ ...params2, nodes: [item] }).nodes[0];
21481
- if (n) parsedListItems[parsedListItems.length - 1]?.content.push(n);
21482
- item.seen = true;
21483
- continue;
21484
- }
21485
21502
  const { attributes, elements, marks = [] } = parseProperties(item);
21486
21503
  const matchedStyle = getStyleTagFromStyleId(styleId, docx) || {};
21487
21504
  const { marks: styleIdMarks } = parseProperties(matchedStyle);
@@ -21519,9 +21536,10 @@ function handleListNodes({
21519
21536
  overallListType = listType;
21520
21537
  item.seen = true;
21521
21538
  const schemaElements = [];
21539
+ const nodeContents = nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n) || [];
21522
21540
  let parNode = {
21523
21541
  type: "paragraph",
21524
- content: nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n)
21542
+ content: nodeContents
21525
21543
  };
21526
21544
  if (parNode.content) {
21527
21545
  parNode = {
@@ -23286,7 +23304,7 @@ const _SuperConverter = class _SuperConverter2 {
23286
23304
  return;
23287
23305
  }
23288
23306
  }
23289
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.16") {
23307
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.17") {
23290
23308
  const customLocation = "docProps/custom.xml";
23291
23309
  if (!docx[customLocation]) {
23292
23310
  docx[customLocation] = generateCustomXml();
@@ -23752,7 +23770,7 @@ function storeSuperdocVersion(docx) {
23752
23770
  function generateCustomXml() {
23753
23771
  return DEFAULT_CUSTOM_XML;
23754
23772
  }
23755
- function generateSuperdocVersion(pid = 2, version2 = "0.12.16") {
23773
+ function generateSuperdocVersion(pid = 2, version2 = "0.12.17") {
23756
23774
  return {
23757
23775
  type: "element",
23758
23776
  name: "property",
@@ -40906,7 +40924,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
40906
40924
  * @returns {Object | void} Migration results
40907
40925
  */
40908
40926
  processCollaborationMigrations() {
40909
- console.debug("[checkVersionMigrations] Current editor version", "0.12.16");
40927
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.17");
40910
40928
  if (!this.options.ydoc) return;
40911
40929
  const metaMap = this.options.ydoc.getMap("meta");
40912
40930
  let docVersion = metaMap.get("version");
@@ -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-CaX3dOo9.js";
3
- import { _ as _export_sfc } from "./chunks/editor-Ctzz2gCC.js";
2
+ import { T as TextSelection } from "./chunks/converter-DOKQJqK4.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-BDrgQZvS.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 = {}) {
@@ -19300,9 +19300,15 @@ function translateList(params) {
19300
19300
  if (!outputNode.elements) {
19301
19301
  outputNode.elements = [];
19302
19302
  }
19303
+ if (Array.isArray(outputNode)) {
19304
+ const mapped = [];
19305
+ outputNode.forEach((el) => mapped.push(...el.elements, { name: "w:br", type: "element" }));
19306
+ mapped.unshift(carbonCopy(pPr));
19307
+ return listNodes.push({ name: "w:p", elements: mapped });
19308
+ }
19303
19309
  const propsElementIndex = outputNode.elements.findIndex((e) => e.name === "w:pPr");
19304
19310
  const content2 = outputNode.elements.filter((e) => e.name !== "w:pPr");
19305
- if (!content2.length) {
19311
+ if (!content2.length && !Array.isArray(outputNode)) {
19306
19312
  const elements = contentNode.attrs.paragraphProperties ? [contentNode.attrs.paragraphProperties] : [];
19307
19313
  const spacer = {
19308
19314
  name: "w:p",
@@ -19311,6 +19317,23 @@ function translateList(params) {
19311
19317
  };
19312
19318
  return listNodes.push(spacer);
19313
19319
  }
19320
+ outputNode.elements = outputNode.elements.map((el, index2) => {
19321
+ if (el.name === "w:sdt") {
19322
+ const contentIndex = el.elements.findIndex((e) => e.name === "w:sdtContent");
19323
+ const content3 = el.elements[contentIndex];
19324
+ const innerContent = content3.elements[0];
19325
+ if (innerContent.name === "w:p") {
19326
+ content3.elements = innerContent.elements;
19327
+ }
19328
+ return {
19329
+ name: "w:r",
19330
+ type: "element",
19331
+ elements: [el]
19332
+ };
19333
+ } else {
19334
+ return el;
19335
+ }
19336
+ });
19314
19337
  const { attributes: generalAttributes } = attrs;
19315
19338
  const { originalInlineRunProps } = generalAttributes || {};
19316
19339
  if (originalInlineRunProps) pPr.elements.push(originalInlineRunProps);
@@ -21478,12 +21501,6 @@ function handleListNodes({
21478
21501
  let lastNestedListLevel = 0;
21479
21502
  for (let [index, item] of listItems.entries()) {
21480
21503
  if (item.seen) continue;
21481
- if (item.elements && !hasTextNode(item.elements)) {
21482
- const n = handleStandardNode2({ ...params, nodes: [item] }).nodes[0];
21483
- if (n) parsedListItems[parsedListItems.length - 1]?.content.push(n);
21484
- item.seen = true;
21485
- continue;
21486
- }
21487
21504
  const { attributes, elements, marks = [] } = parseProperties(item);
21488
21505
  const matchedStyle = getStyleTagFromStyleId(styleId, docx) || {};
21489
21506
  const { marks: styleIdMarks } = parseProperties(matchedStyle);
@@ -21521,9 +21538,10 @@ function handleListNodes({
21521
21538
  overallListType = listType;
21522
21539
  item.seen = true;
21523
21540
  const schemaElements = [];
21541
+ const nodeContents = nodeListHandler2.handler({ ...params, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n) || [];
21524
21542
  let parNode = {
21525
21543
  type: "paragraph",
21526
- content: nodeListHandler2.handler({ ...params, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n)
21544
+ content: nodeContents
21527
21545
  };
21528
21546
  if (parNode.content) {
21529
21547
  parNode = {
@@ -23288,7 +23306,7 @@ const _SuperConverter = class _SuperConverter {
23288
23306
  return;
23289
23307
  }
23290
23308
  }
23291
- static updateDocumentVersion(docx = this.convertedXml, version = "0.12.16") {
23309
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.12.17") {
23292
23310
  const customLocation = "docProps/custom.xml";
23293
23311
  if (!docx[customLocation]) {
23294
23312
  docx[customLocation] = generateCustomXml();
@@ -23757,7 +23775,7 @@ function storeSuperdocVersion(docx) {
23757
23775
  function generateCustomXml() {
23758
23776
  return DEFAULT_CUSTOM_XML;
23759
23777
  }
23760
- function generateSuperdocVersion(pid = 2, version = "0.12.16") {
23778
+ function generateSuperdocVersion(pid = 2, version = "0.12.17") {
23761
23779
  return {
23762
23780
  type: "element",
23763
23781
  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-CaX3dOo9.js";
1
+ import { x as process$1, a1 as commonjsGlobal, B as Buffer, a2 as getDefaultExportFromCjs, a3 as getContentTypesFromXml, a4 as xmljs } from "./converter-DOKQJqK4.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, _commandService, _css, _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, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_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, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as generateRandom32BitHex, u as DOMSerializer, v as Mark$1, w as dropPoint, x as process$1, B as Buffer2, y as isRegExp, z as TrackDeleteMarkName, C as TrackInsertMarkName, E as v4, G as TrackFormatMarkName, H as comments_module_events, I as AddMarkStep, J as RemoveMarkStep, K as twipsToLines, L as pixelsToTwips, O as SuperConverter, Q as EditorState, U as hasSomeParentWithClass, V as parseSizeUnit, W as getLineHeightValueString, X as toKebabCase, Y as kebabCase, Z as getColStyleDeclaration, _ as SelectionRange, $ as Transform, a0 as createColGroup } from "./converter-CaX3dOo9.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as generateRandom32BitHex, u as DOMSerializer, v as Mark$1, w as dropPoint, x as process$1, B as Buffer2, y as isRegExp, z as TrackDeleteMarkName, C as TrackInsertMarkName, E as v4, G as TrackFormatMarkName, H as comments_module_events, I as AddMarkStep, J as RemoveMarkStep, K as twipsToLines, L as pixelsToTwips, O as SuperConverter, Q as EditorState, U as hasSomeParentWithClass, V as parseSizeUnit, W as getLineHeightValueString, X as toKebabCase, Y as kebabCase, Z as getColStyleDeclaration, _ as SelectionRange, $ as Transform, a0 as createColGroup } from "./converter-DOKQJqK4.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-C21KiTVk.js";
17
+ import { D as DocxZipper } from "./docx-zipper-CeXxI7BH.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -14676,7 +14676,7 @@ const _Editor = class _Editor extends EventEmitter {
14676
14676
  * @returns {Object | void} Migration results
14677
14677
  */
14678
14678
  processCollaborationMigrations() {
14679
- console.debug("[checkVersionMigrations] Current editor version", "0.12.16");
14679
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.17");
14680
14680
  if (!this.options.ydoc) return;
14681
14681
  const metaMap = this.options.ydoc.getMap("meta");
14682
14682
  let docVersion = metaMap.get("version");
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, unref, createBlock, toDisplayString, withDirectives, withKeys, withModifiers, vModelText, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, nextTick, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { x as process$1 } from "./converter-CaX3dOo9.js";
3
- import { _ as _export_sfc, g as global$1 } from "./editor-Ctzz2gCC.js";
2
+ import { x as process$1 } from "./converter-DOKQJqK4.js";
3
+ import { _ as _export_sfc, g as global$1 } from "./editor-BDrgQZvS.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 { O } from "./chunks/converter-CaX3dOo9.js";
1
+ import { O } from "./chunks/converter-DOKQJqK4.js";
2
2
  export {
3
3
  O as SuperConverter
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/core/super-converter/exporter.js"],"names":[],"mappings":"AAwBA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,2CAHW,YAAY,GACV,YAAY,CAsCxB;AA+DD;;;;;GAKG;AACH,qDAFa,YAAY,CAyBxB;AAk3DD;;;;;;;;;EAcC;AA+FD;IACE,4BAEC;IADC,eAA0B;IAG5B,gDAGC;;CAsEF;;;;;;;;;;;;;mBAptEa,KAAQ;;;;;;UAKR,MAAM;;;;aACN,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;UAMjB,MAAM;;;;cACN,KAAK,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;UAgBnB,MAAM"}
1
+ {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/core/super-converter/exporter.js"],"names":[],"mappings":"AAwBA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,2CAHW,YAAY,GACV,YAAY,CAsCxB;AA+DD;;;;;GAKG;AACH,qDAFa,YAAY,CAyBxB;AA84DD;;;;;;;;;EAcC;AA+FD;IACE,4BAEC;IADC,eAA0B;IAG5B,gDAGC;;CAsEF;;;;;;;;;;;;;mBAhvEa,KAAQ;;;;;;UAKR,MAAM;;;;aACN,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;UAMjB,MAAM;;;;cACN,KAAK,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;UAgBnB,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"listImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/listImporter.js"],"names":[],"mappings":"AA2UA;;;;;GAKG;AACH,kCAHW,OAAO,cACL,OAAO,CAkBnB;AAkND;;;;;;;GAOG;AACH,6DAJW,GAAG,QACH,UAAU;;;;;;;;;;;;;;;;;;;;EA8CpB;AA/lBD;;GAEG;AACH,iCAwCE;AAEF;;GAEG;AACH,oCAGE"}
1
+ {"version":3,"file":"listImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/listImporter.js"],"names":[],"mappings":"AAmUA;;;;;GAKG;AACH,kCAHW,OAAO,cACL,OAAO,CAkBnB;AAkND;;;;;;;GAOG;AACH,6DAJW,GAAG,QACH,UAAU;;;;;;;;;;;;;;;;;;;;EA8CpB;AAvlBD;;GAEG;AACH,iCAwCE;AAEF;;GAEG;AACH,oCAGE"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CaX3dOo9.js";
2
- import { D } from "./chunks/docx-zipper-C21KiTVk.js";
1
+ import "./chunks/converter-DOKQJqK4.js";
2
+ import { D } from "./chunks/docx-zipper-CeXxI7BH.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-Ctzz2gCC.js";
2
- import "./chunks/converter-CaX3dOo9.js";
3
- import "./chunks/docx-zipper-C21KiTVk.js";
1
+ import { E } from "./chunks/editor-BDrgQZvS.js";
2
+ import "./chunks/converter-DOKQJqK4.js";
3
+ import "./chunks/docx-zipper-CeXxI7BH.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-C21KiTVk.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-CeXxI7BH.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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 { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions, M as Mark, j as Extension, A as Attribute, N as Node } from "./chunks/editor-Ctzz2gCC.js";
13
- import { C, T, l, n, k, m } from "./chunks/editor-Ctzz2gCC.js";
14
- import { a2 as getDefaultExportFromCjs, E as v4, a5 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-CaX3dOo9.js";
15
- import { O } from "./chunks/converter-CaX3dOo9.js";
12
+ import { _ as _export_sfc, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, u as undoDepth, r as redoDepth, E as Editor, e as getStarterExtensions, P as Placeholder, h as getRichTextExtensions, M as Mark, j as Extension, A as Attribute, N as Node } from "./chunks/editor-BDrgQZvS.js";
13
+ import { C, T, l, n, k, m } from "./chunks/editor-BDrgQZvS.js";
14
+ import { a2 as getDefaultExportFromCjs, E as v4, a5 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-DOKQJqK4.js";
15
+ import { O } from "./chunks/converter-DOKQJqK4.js";
16
16
  import { ref, createElementBlock, openBlock, createElementVNode, unref, getCurrentInstance, computed, watch, onMounted, createCommentVNode, withDirectives, withKeys, normalizeClass, withModifiers, vModelText, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-C0EZHJoI.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-Syznaamh.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-C21KiTVk.js";
19
+ import { D } from "./chunks/docx-zipper-CeXxI7BH.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  (function(module) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-C0EZHJoI.js";
3
- import "./chunks/editor-Ctzz2gCC.js";
2
+ import { T } from "./chunks/toolbar-Syznaamh.js";
3
+ import "./chunks/editor-BDrgQZvS.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-C1sOUR_S.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-bzN38eJ6.cjs");
4
4
  require("./chunks/vue-DPZkajuO.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.BasicUpload = superEditor_es._sfc_main$1;
@@ -1,4 +1,4 @@
1
- import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-BB3W_xzz.es.js";
1
+ import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-C5seifML.es.js";
2
2
  import "./chunks/vue-IIIZMHTg.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -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-C1sOUR_S.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-bzN38eJ6.cjs");
4
4
  const vue = require("./chunks/vue-DPZkajuO.cjs");
5
5
  const jszip = require("./chunks/jszip-Bwu_om3F.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -46558,7 +46558,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46558
46558
  this.config.colors = shuffleArray(this.config.colors);
46559
46559
  this.userColorMap = /* @__PURE__ */ new Map();
46560
46560
  this.colorIndex = 0;
46561
- this.version = "0.12.16";
46561
+ this.version = "0.12.17";
46562
46562
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46563
46563
  this.superdocId = config.superdocId || uuid.v4();
46564
46564
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-BB3W_xzz.es.js";
2
- import { S, i, m } from "./chunks/super-editor.es-BB3W_xzz.es.js";
1
+ import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-C5seifML.es.js";
2
+ import { S, i, m } from "./chunks/super-editor.es-C5seifML.es.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -46557,7 +46557,7 @@ class SuperDoc extends EventEmitter {
46557
46557
  this.config.colors = shuffleArray(this.config.colors);
46558
46558
  this.userColorMap = /* @__PURE__ */ new Map();
46559
46559
  this.colorIndex = 0;
46560
- this.version = "0.12.16";
46560
+ this.version = "0.12.17";
46561
46561
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46562
46562
  this.superdocId = config.superdocId || v4();
46563
46563
  this.colors = this.config.colors;
@@ -26658,9 +26658,15 @@
26658
26658
  if (!outputNode.elements) {
26659
26659
  outputNode.elements = [];
26660
26660
  }
26661
+ if (Array.isArray(outputNode)) {
26662
+ const mapped = [];
26663
+ outputNode.forEach((el) => mapped.push(...el.elements, { name: "w:br", type: "element" }));
26664
+ mapped.unshift(carbonCopy(pPr));
26665
+ return listNodes.push({ name: "w:p", elements: mapped });
26666
+ }
26661
26667
  const propsElementIndex = outputNode.elements.findIndex((e) => e.name === "w:pPr");
26662
26668
  const content2 = outputNode.elements.filter((e) => e.name !== "w:pPr");
26663
- if (!content2.length) {
26669
+ if (!content2.length && !Array.isArray(outputNode)) {
26664
26670
  const elements = contentNode.attrs.paragraphProperties ? [contentNode.attrs.paragraphProperties] : [];
26665
26671
  const spacer = {
26666
26672
  name: "w:p",
@@ -26669,6 +26675,23 @@
26669
26675
  };
26670
26676
  return listNodes.push(spacer);
26671
26677
  }
26678
+ outputNode.elements = outputNode.elements.map((el, index22) => {
26679
+ if (el.name === "w:sdt") {
26680
+ const contentIndex = el.elements.findIndex((e) => e.name === "w:sdtContent");
26681
+ const content3 = el.elements[contentIndex];
26682
+ const innerContent = content3.elements[0];
26683
+ if (innerContent.name === "w:p") {
26684
+ content3.elements = innerContent.elements;
26685
+ }
26686
+ return {
26687
+ name: "w:r",
26688
+ type: "element",
26689
+ elements: [el]
26690
+ };
26691
+ } else {
26692
+ return el;
26693
+ }
26694
+ });
26672
26695
  const { attributes: generalAttributes } = attrs;
26673
26696
  const { originalInlineRunProps } = generalAttributes || {};
26674
26697
  if (originalInlineRunProps) pPr.elements.push(originalInlineRunProps);
@@ -28836,12 +28859,6 @@
28836
28859
  let lastNestedListLevel = 0;
28837
28860
  for (let [index2, item] of listItems.entries()) {
28838
28861
  if (item.seen) continue;
28839
- if (item.elements && !hasTextNode(item.elements)) {
28840
- const n = handleStandardNode2({ ...params2, nodes: [item] }).nodes[0];
28841
- if (n) parsedListItems[parsedListItems.length - 1]?.content.push(n);
28842
- item.seen = true;
28843
- continue;
28844
- }
28845
28862
  const { attributes, elements, marks = [] } = parseProperties(item);
28846
28863
  const matchedStyle = getStyleTagFromStyleId(styleId, docx) || {};
28847
28864
  const { marks: styleIdMarks } = parseProperties(matchedStyle);
@@ -28879,9 +28896,10 @@
28879
28896
  overallListType = listType;
28880
28897
  item.seen = true;
28881
28898
  const schemaElements = [];
28899
+ const nodeContents = nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n) || [];
28882
28900
  let parNode = {
28883
28901
  type: "paragraph",
28884
- content: nodeListHandler2.handler({ ...params2, nodes: [attributes.paragraphProperties, ...elements] })?.filter((n) => n)
28902
+ content: nodeContents
28885
28903
  };
28886
28904
  if (parNode.content) {
28887
28905
  parNode = {
@@ -30646,7 +30664,7 @@
30646
30664
  return;
30647
30665
  }
30648
30666
  }
30649
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.16") {
30667
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.17") {
30650
30668
  const customLocation = "docProps/custom.xml";
30651
30669
  if (!docx[customLocation]) {
30652
30670
  docx[customLocation] = generateCustomXml();
@@ -31112,7 +31130,7 @@
31112
31130
  function generateCustomXml() {
31113
31131
  return DEFAULT_CUSTOM_XML;
31114
31132
  }
31115
- function generateSuperdocVersion(pid = 2, version2 = "0.12.16") {
31133
+ function generateSuperdocVersion(pid = 2, version2 = "0.12.17") {
31116
31134
  return {
31117
31135
  type: "element",
31118
31136
  name: "property",
@@ -48266,7 +48284,7 @@
48266
48284
  * @returns {Object | void} Migration results
48267
48285
  */
48268
48286
  processCollaborationMigrations() {
48269
- console.debug("[checkVersionMigrations] Current editor version", "0.12.16");
48287
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.17");
48270
48288
  if (!this.options.ydoc) return;
48271
48289
  const metaMap = this.options.ydoc.getMap("meta");
48272
48290
  let docVersion = metaMap.get("version");
@@ -89375,7 +89393,7 @@ ${style2}
89375
89393
  this.config.colors = shuffleArray(this.config.colors);
89376
89394
  this.userColorMap = /* @__PURE__ */ new Map();
89377
89395
  this.colorIndex = 0;
89378
- this.version = "0.12.16";
89396
+ this.version = "0.12.17";
89379
89397
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
89380
89398
  this.superdocId = config.superdocId || v4();
89381
89399
  this.colors = this.config.colors;