@superdoc-dev/cli 0.3.0-next.22 → 0.3.0-next.23

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 (2) hide show
  1. package/dist/index.js +47 -24
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -39004,7 +39004,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
39004
39004
  emptyOptions2 = {};
39005
39005
  });
39006
39006
 
39007
- // ../../packages/superdoc/dist/chunks/SuperConverter-BtAhXvns.es.js
39007
+ // ../../packages/superdoc/dist/chunks/SuperConverter-Dt28Xb1l.es.js
39008
39008
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
39009
39009
  const fieldValue = extension$1.config[field];
39010
39010
  if (typeof fieldValue === "function")
@@ -55277,13 +55277,13 @@ function extractTableInfo($pos, depth) {
55277
55277
  return fallbackInfo;
55278
55278
  }
55279
55279
  }
55280
- function segmentRunByInlineProps(runNode, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys) {
55280
+ function segmentRunByInlineProps(runNode, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys, preferExistingKeys) {
55281
55281
  const segments = [];
55282
55282
  let lastKey = null;
55283
55283
  let boundaryCounter = 0;
55284
55284
  runNode.forEach((child) => {
55285
55285
  if (child.isText) {
55286
- const { inlineProps: inlineProps$1, inlineKey: inlineKey$1 } = computeInlineRunProps(child.marks, runNode.attrs?.runProperties, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys);
55286
+ const { inlineProps: inlineProps$1, inlineKey: inlineKey$1 } = computeInlineRunProps(child.marks, runNode.attrs?.runProperties, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys, preferExistingKeys);
55287
55287
  const last = segments[segments.length - 1];
55288
55288
  if (last && inlineKey$1 === lastKey)
55289
55289
  last.content.push(child);
@@ -55311,24 +55311,36 @@ function segmentRunByInlineProps(runNode, paragraphNode, tableInfo, $pos, editor
55311
55311
  firstInlineProps: segments[0]?.inlineProps ?? null
55312
55312
  };
55313
55313
  }
55314
- function computeInlineRunProps(marks, existingRunProperties, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys) {
55314
+ function computeInlineRunProps(marks, existingRunProperties, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys, preferExistingKeys) {
55315
55315
  const runPropertiesFromMarks = decodeRPrFromMarks(marks);
55316
55316
  const paragraphProperties = getResolvedParagraphProperties(paragraphNode) || calculateResolvedParagraphProperties(editor, paragraphNode, $pos);
55317
55317
  const inlineRunProperties = getInlineRunProperties(runPropertiesFromMarks, resolveRunProperties({
55318
55318
  translatedNumbering: editor.converter?.translatedNumbering ?? {},
55319
55319
  translatedLinkedStyles: editor.converter?.translatedLinkedStyles ?? {}
55320
- }, existingRunProperties?.styleId != null ? { styleId: existingRunProperties?.styleId } : {}, paragraphProperties, tableInfo, false, Boolean(paragraphNode.attrs.paragraphProperties?.numberingProperties)), existingRunProperties, editor, preservedDerivedKeys);
55320
+ }, existingRunProperties?.styleId != null ? { styleId: existingRunProperties?.styleId } : {}, paragraphProperties, tableInfo, false, Boolean(paragraphNode.attrs.paragraphProperties?.numberingProperties)), existingRunProperties, editor, preservedDerivedKeys, preferExistingKeys);
55321
55321
  const inlineProps = Object.keys(inlineRunProperties).length ? inlineRunProperties : null;
55322
55322
  return {
55323
55323
  inlineProps,
55324
55324
  inlineKey: stableStringifyInlineProps(inlineProps)
55325
55325
  };
55326
55326
  }
55327
- function getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles, existingRunProperties, editor, preservedDerivedKeys = /* @__PURE__ */ new Set) {
55327
+ function getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles, existingRunProperties, editor, preservedDerivedKeys = /* @__PURE__ */ new Set, preferExistingKeys = /* @__PURE__ */ new Set) {
55328
55328
  const inlineRunProperties = {};
55329
55329
  for (const key in runPropertiesFromMarks) {
55330
- if (preservedDerivedKeys.has(key))
55330
+ if (preservedDerivedKeys.has(key)) {
55331
+ const fromMarks = runPropertiesFromMarks[key];
55332
+ const existing = existingRunProperties?.[key];
55333
+ if (preferExistingKeys.has(key) && existing != null)
55334
+ inlineRunProperties[key] = existing;
55335
+ else if (fromMarks != null && existing != null && typeof fromMarks === "object" && typeof existing === "object")
55336
+ inlineRunProperties[key] = {
55337
+ ...existing,
55338
+ ...fromMarks
55339
+ };
55340
+ else if (fromMarks !== undefined)
55341
+ inlineRunProperties[key] = fromMarks;
55331
55342
  continue;
55343
+ }
55332
55344
  const valueFromMarks = runPropertiesFromMarks[key];
55333
55345
  const valueFromStyles = runPropertiesFromStyles[key];
55334
55346
  if (JSON.stringify(valueFromMarks) !== JSON.stringify(valueFromStyles))
@@ -76788,13 +76800,19 @@ var isRegExp = (value) => {
76788
76800
  if (!runType)
76789
76801
  return null;
76790
76802
  const preservedDerivedKeys = /* @__PURE__ */ new Set;
76803
+ const preferExistingKeys = /* @__PURE__ */ new Set;
76791
76804
  transactions.forEach((transaction) => {
76792
- const keys$1 = transaction.getMeta(RUN_PROPERTY_PRESERVE_META_KEY);
76793
- if (!Array.isArray(keys$1))
76805
+ const entries = transaction.getMeta(RUN_PROPERTY_PRESERVE_META_KEY);
76806
+ if (!Array.isArray(entries))
76794
76807
  return;
76795
- keys$1.forEach((key) => {
76796
- if (typeof key === "string" && key.length > 0)
76797
- preservedDerivedKeys.add(key);
76808
+ entries.forEach((entry) => {
76809
+ if (typeof entry === "string" && entry.length > 0)
76810
+ preservedDerivedKeys.add(entry);
76811
+ else if (entry && typeof entry === "object" && typeof entry.key === "string") {
76812
+ preservedDerivedKeys.add(entry.key);
76813
+ if (entry.preferExisting)
76814
+ preferExistingKeys.add(entry.key);
76815
+ }
76798
76816
  });
76799
76817
  });
76800
76818
  const changedRanges = collectChangedRangesThroughTransactions(transactions, newState.doc.content.size);
@@ -76817,7 +76835,7 @@ var isRegExp = (value) => {
76817
76835
  const { paragraphNode, paragraphPos, tableInfo } = getRunContext($pos);
76818
76836
  if (!paragraphNode || paragraphPos === undefined)
76819
76837
  return;
76820
- const { segments, firstInlineProps } = segmentRunByInlineProps(runNode, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys);
76838
+ const { segments, firstInlineProps } = segmentRunByInlineProps(runNode, paragraphNode, tableInfo, $pos, editor, preservedDerivedKeys, preferExistingKeys);
76821
76839
  const runProperties = firstInlineProps ?? null;
76822
76840
  if (segments.length === 1) {
76823
76841
  if (JSON.stringify(runProperties) === JSON.stringify(runNode.attrs.runProperties))
@@ -82437,7 +82455,7 @@ var isRegExp = (value) => {
82437
82455
  }],
82438
82456
  media: footnoteMedia
82439
82457
  };
82440
- }, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", DEFAULT_XML_DECLARATION, API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.19.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
82458
+ }, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", DEFAULT_XML_DECLARATION, API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.20.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
82441
82459
  if (!runProps?.elements?.length || !state)
82442
82460
  return;
82443
82461
  const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
@@ -82471,7 +82489,7 @@ var isRegExp = (value) => {
82471
82489
  state.kern = kernNode.attributes["w:val"];
82472
82490
  }
82473
82491
  }, SuperConverter;
82474
- var init_SuperConverter_BtAhXvns_es = __esm(() => {
82492
+ var init_SuperConverter_Dt28Xb1l_es = __esm(() => {
82475
82493
  init_rolldown_runtime_B2q5OVn9_es();
82476
82494
  init_jszip_ChlR43oI_es();
82477
82495
  init_xml_js_BtmJ6bNs_es();
@@ -144335,7 +144353,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
144335
144353
  init_remark_gfm_z_sDF4ss_es();
144336
144354
  });
144337
144355
 
144338
- // ../../packages/superdoc/dist/chunks/src-DMxoYkrw.es.js
144356
+ // ../../packages/superdoc/dist/chunks/src-EwkFfYFq.es.js
144339
144357
  function deleteProps(obj, propOrProps) {
144340
144358
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
144341
144359
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -144415,7 +144433,7 @@ function prosemirrorToYXmlFragment(doc$12, xmlFragment) {
144415
144433
  }
144416
144434
  function getSuperdocVersion() {
144417
144435
  try {
144418
- return "1.19.0";
144436
+ return "1.20.0";
144419
144437
  } catch {
144420
144438
  return "unknown";
144421
144439
  }
@@ -155708,7 +155726,10 @@ function applyRunAttributePatch(tr, runType, absFrom, absTo, updates) {
155708
155726
  if (overlappingRuns.length === 0)
155709
155727
  return false;
155710
155728
  if (Object.prototype.hasOwnProperty.call(updates, "fontFamily"))
155711
- tr.setMeta(PRESERVE_RUN_PROPERTIES_META_KEY, ["fontFamily"]);
155729
+ tr.setMeta(PRESERVE_RUN_PROPERTIES_META_KEY, [{
155730
+ key: "fontFamily",
155731
+ preferExisting: true
155732
+ }]);
155712
155733
  let changed = false;
155713
155734
  for (const run2 of overlappingRuns) {
155714
155735
  const runPos = tr.mapping.map(run2.pos, 1);
@@ -155791,6 +155812,8 @@ function applyInlinePatchToRange(editor, tr, absFrom, absTo, inline) {
155791
155812
  textStylePatch[key$1] = inline[key$1];
155792
155813
  if (inline.caps !== undefined)
155793
155814
  textStylePatch.textTransform = capsToTextTransform(inline.caps ?? null);
155815
+ if (textStylePatch.fontFamily != null)
155816
+ tr.setMeta(PRESERVE_RUN_PROPERTIES_META_KEY, ["fontFamily"]);
155794
155817
  if (applyTextStylePatch(tr, schema.marks.textStyle, absFrom, absTo, textStylePatch))
155795
155818
  changed = true;
155796
155819
  const runAttributeUpdates = buildRunAttributeUpdates(inline);
@@ -205643,7 +205666,7 @@ var Node$13 = class Node$14 {
205643
205666
  domAvailabilityCache = false;
205644
205667
  return false;
205645
205668
  }
205646
- }, summaryVersion = "1.19.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
205669
+ }, summaryVersion = "1.20.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
205647
205670
  const container = document.createElement("div");
205648
205671
  container.innerHTML = html3;
205649
205672
  const result = [];
@@ -206584,7 +206607,7 @@ var Node$13 = class Node$14 {
206584
206607
  candidate = String(parseInt(hex, 16));
206585
206608
  } while (!candidate || existingIds.has(candidate));
206586
206609
  return candidate;
206587
- }, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN, FOOTER_FILE_PATTERN, SPECIAL_NOTE_TYPES, FOOTNOTES_PART_ID = "word/footnotes.xml", ENDNOTES_PART_ID = "word/endnotes.xml", FOOTNOTES_CONFIG, ENDNOTES_CONFIG, NOTES_XMLNS, footnotesPartDescriptor, endnotesPartDescriptor, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, FIELD_NODE_TYPES, TOA_LEADER_REVERSE_MAP, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.19.0", PIXELS_PER_INCH$1 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, Editor, ContextMenuPluginKey, MENU_OFFSET_X = 0, MENU_OFFSET_Y = 28, CONTEXT_MENU_OFFSET_X = 10, CONTEXT_MENU_OFFSET_Y = 10, SLASH_COOLDOWN_MS = 5000, ContextMenu, SearchQuery = class {
206610
+ }, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN, FOOTER_FILE_PATTERN, SPECIAL_NOTE_TYPES, FOOTNOTES_PART_ID = "word/footnotes.xml", ENDNOTES_PART_ID = "word/endnotes.xml", FOOTNOTES_CONFIG, ENDNOTES_CONFIG, NOTES_XMLNS, footnotesPartDescriptor, endnotesPartDescriptor, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, FIELD_NODE_TYPES, TOA_LEADER_REVERSE_MAP, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.20.0", PIXELS_PER_INCH$1 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, Editor, ContextMenuPluginKey, MENU_OFFSET_X = 0, MENU_OFFSET_Y = 28, CONTEXT_MENU_OFFSET_X = 10, CONTEXT_MENU_OFFSET_Y = 10, SLASH_COOLDOWN_MS = 5000, ContextMenu, SearchQuery = class {
206588
206611
  constructor(config2) {
206589
206612
  this.search = config2.search;
206590
206613
  this.caseSensitive = !!config2.caseSensitive;
@@ -224996,9 +225019,9 @@ var Node$13 = class Node$14 {
224996
225019
  return false;
224997
225020
  return Boolean(checker(attrs));
224998
225021
  }, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
224999
- var init_src_DMxoYkrw_es = __esm(() => {
225022
+ var init_src_EwkFfYFq_es = __esm(() => {
225000
225023
  init_rolldown_runtime_B2q5OVn9_es();
225001
- init_SuperConverter_BtAhXvns_es();
225024
+ init_SuperConverter_Dt28Xb1l_es();
225002
225025
  init_jszip_ChlR43oI_es();
225003
225026
  init_uuid_qzgm05fK_es();
225004
225027
  init_constants_ep1_Gwqi_es();
@@ -258085,8 +258108,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
258085
258108
 
258086
258109
  // ../../packages/superdoc/dist/super-editor.es.js
258087
258110
  var init_super_editor_es = __esm(() => {
258088
- init_src_DMxoYkrw_es();
258089
- init_SuperConverter_BtAhXvns_es();
258111
+ init_src_EwkFfYFq_es();
258112
+ init_SuperConverter_Dt28Xb1l_es();
258090
258113
  init_jszip_ChlR43oI_es();
258091
258114
  init_xml_js_BtmJ6bNs_es();
258092
258115
  init_constants_ep1_Gwqi_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.3.0-next.22",
3
+ "version": "0.3.0-next.23",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -21,20 +21,20 @@
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
23
  "@superdoc/document-api": "0.0.1",
24
- "@superdoc/super-editor": "0.0.1",
25
- "superdoc": "1.19.0",
26
- "@superdoc/pm-adapter": "0.0.0"
24
+ "@superdoc/pm-adapter": "0.0.0",
25
+ "superdoc": "1.20.0",
26
+ "@superdoc/super-editor": "0.0.1"
27
27
  },
28
28
  "module": "src/index.ts",
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.22",
34
- "@superdoc-dev/cli-darwin-x64": "0.3.0-next.22",
35
- "@superdoc-dev/cli-linux-x64": "0.3.0-next.22",
36
- "@superdoc-dev/cli-linux-arm64": "0.3.0-next.22",
37
- "@superdoc-dev/cli-windows-x64": "0.3.0-next.22"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.23",
34
+ "@superdoc-dev/cli-darwin-x64": "0.3.0-next.23",
35
+ "@superdoc-dev/cli-linux-x64": "0.3.0-next.23",
36
+ "@superdoc-dev/cli-windows-x64": "0.3.0-next.23",
37
+ "@superdoc-dev/cli-linux-arm64": "0.3.0-next.23"
38
38
  },
39
39
  "scripts": {
40
40
  "predev": "node scripts/ensure-superdoc-build.js",