@superdoc-dev/cli 0.8.0-next.107 → 0.8.0-next.109

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 +166 -109
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -66096,7 +66096,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
66096
66096
  emptyOptions2 = {};
66097
66097
  });
66098
66098
 
66099
- // ../../packages/superdoc/dist/chunks/SuperConverter-KEGUvaEC.es.js
66099
+ // ../../packages/superdoc/dist/chunks/SuperConverter-B-EF8ijE.es.js
66100
66100
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
66101
66101
  const fieldValue = extension$1.config[field];
66102
66102
  if (typeof fieldValue === "function")
@@ -74932,20 +74932,23 @@ function combineProperties(propertiesArray, options = {}) {
74932
74932
  function isObject(item) {
74933
74933
  return item != null && typeof item === "object" && !Array.isArray(item);
74934
74934
  }
74935
+ function dropConflictingFontSlots(target, source) {
74936
+ const result = { ...target };
74937
+ for (const [concreteKey, themeKey] of FONT_SLOT_THEME_PAIRS)
74938
+ if (source[themeKey] != null) {
74939
+ delete result[concreteKey];
74940
+ delete result[themeKey];
74941
+ } else if (source[concreteKey] != null)
74942
+ delete result[themeKey];
74943
+ return result;
74944
+ }
74935
74945
  function combineRunProperties(propertiesArray) {
74936
74946
  return combineProperties(propertiesArray, {
74937
74947
  fullOverrideProps: ["color"],
74938
74948
  specialHandling: { fontFamily: (target, source) => {
74939
74949
  const fontFamilySource = { ...source.fontFamily };
74940
- const fontFamilyTarget = { ...target.fontFamily };
74941
- if (fontFamilySource.asciiTheme != null) {
74942
- delete fontFamilyTarget.ascii;
74943
- delete fontFamilyTarget.asciiTheme;
74944
- }
74945
- if (fontFamilySource.ascii != null)
74946
- delete fontFamilyTarget.asciiTheme;
74947
74950
  return {
74948
- ...fontFamilyTarget,
74951
+ ...dropConflictingFontSlots(target.fontFamily ?? {}, fontFamilySource),
74949
74952
  ...fontFamilySource
74950
74953
  };
74951
74954
  } }
@@ -77117,6 +77120,12 @@ function extractAppearance(sdtPr) {
77117
77120
  function extractPlaceholder(sdtPr) {
77118
77121
  return sdtPr?.elements?.find((e) => e.name === "w:placeholder")?.elements?.find((e) => e.name === "w:docPart")?.attributes?.["w:val"] ?? null;
77119
77122
  }
77123
+ function extractTemporary(sdtPr) {
77124
+ const el = sdtPr?.elements?.find((e) => e.name === "w:temporary");
77125
+ if (!el)
77126
+ return;
77127
+ return parseStrictStOnOff(el.attributes?.["w:val"], "temporary", "w:temporary");
77128
+ }
77120
77129
  function handleStructuredContentNode(params3) {
77121
77130
  const { nodes, nodeListHandler } = params3;
77122
77131
  if (nodes.length === 0 || nodes[0].name !== "w:sdt")
@@ -77137,6 +77146,7 @@ function handleStructuredContentNode(params3) {
77137
77146
  const controlType = detectControlType(sdtPr);
77138
77147
  const appearance = extractAppearance(sdtPr);
77139
77148
  const placeholder = extractPlaceholder(sdtPr);
77149
+ const temporary = extractTemporary(sdtPr);
77140
77150
  if (!sdtContent)
77141
77151
  return null;
77142
77152
  const paragraph2 = sdtContent.elements?.find((el) => el.name === "w:p");
@@ -77160,6 +77170,7 @@ function handleStructuredContentNode(params3) {
77160
77170
  type: controlType,
77161
77171
  appearance,
77162
77172
  placeholder,
77173
+ ...temporary !== undefined ? { temporary } : {},
77163
77174
  sdtPr
77164
77175
  }
77165
77176
  };
@@ -84565,6 +84576,27 @@ function resolveHypotheticalParagraphProperties(editor, $pos, inlineProps) {
84565
84576
  translatedLinkedStyles: editor.converter.translatedLinkedStyles
84566
84577
  }, inlineProps, tableStyleId);
84567
84578
  }
84579
+ function mergeFontFamilyPreservingThemeRefs(fromMarks, existing) {
84580
+ const merged = { ...fromMarks || {} };
84581
+ if (!existing || typeof existing !== "object")
84582
+ return merged;
84583
+ for (const [concreteKey, themeKey] of FONT_SLOT_THEME_PAIRS)
84584
+ if (existing[themeKey] != null) {
84585
+ merged[themeKey] = existing[themeKey];
84586
+ delete merged[concreteKey];
84587
+ }
84588
+ return merged;
84589
+ }
84590
+ function marksMatchExistingFontFamily(markFromMarks, existingFontFamily, encode$80, docx) {
84591
+ if (!existingFontFamily || typeof existingFontFamily !== "object")
84592
+ return false;
84593
+ if (!markFromMarks?.attrs)
84594
+ return false;
84595
+ const markFromExisting = encode$80({ fontFamily: existingFontFamily }, docx)?.[0];
84596
+ if (!markFromExisting?.attrs)
84597
+ return false;
84598
+ return markFromMarks.attrs.fontFamily === markFromExisting.attrs.fontFamily;
84599
+ }
84568
84600
  function getRunContext($pos) {
84569
84601
  let paragraphNode = null;
84570
84602
  let paragraphDepth = -1;
@@ -84684,10 +84716,13 @@ function getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles,
84684
84716
  const valueFromStyles = runPropertiesFromStyles[key];
84685
84717
  if (JSON.stringify(valueFromMarks) !== JSON.stringify(valueFromStyles))
84686
84718
  if (key === "fontFamily") {
84687
- const markFromStyles = encodeMarksFromRPr({ [key]: valueFromStyles }, editor.converter?.convertedXml ?? {})[0];
84688
- const markFromMarks = encodeMarksFromRPr({ [key]: valueFromMarks }, editor.converter?.convertedXml ?? {})[0];
84689
- if (JSON.stringify(markFromMarks?.attrs) !== JSON.stringify(markFromStyles?.attrs))
84690
- inlineRunProperties[key] = valueFromMarks;
84719
+ const docx = editor.converter?.convertedXml ?? {};
84720
+ const markFromStyles = encodeMarksFromRPr({ [key]: valueFromStyles }, docx)[0];
84721
+ const markFromMarks = encodeMarksFromRPr({ [key]: valueFromMarks }, docx)[0];
84722
+ if (JSON.stringify(markFromMarks?.attrs) !== JSON.stringify(markFromStyles?.attrs)) {
84723
+ const existingFontFamily = existingRunProperties?.[key];
84724
+ inlineRunProperties[key] = marksMatchExistingFontFamily(markFromMarks, existingFontFamily, encodeMarksFromRPr, docx) ? mergeFontFamilyPreservingThemeRefs(valueFromMarks, existingFontFamily) : valueFromMarks;
84725
+ }
84691
84726
  } else
84692
84727
  inlineRunProperties[key] = valueFromMarks;
84693
84728
  }
@@ -101624,10 +101659,32 @@ function removeSdtPrChild(sdtPr, childName) {
101624
101659
  };
101625
101660
  }
101626
101661
  function applyAttrsUpdate(editor, nodeId, attrsPatch) {
101627
- const updateCmd = editor.commands?.updateStructuredContentById;
101628
- if (typeof updateCmd !== "function")
101662
+ if (!editor?.state)
101663
+ return false;
101664
+ let foundPos = null;
101665
+ editor.state.doc.descendants((node3, pos) => {
101666
+ if (foundPos !== null)
101667
+ return false;
101668
+ if (SDT_NODE_TYPES.has(node3.type.name) && String(node3.attrs.id) === String(nodeId)) {
101669
+ foundPos = pos;
101670
+ return false;
101671
+ }
101672
+ return true;
101673
+ });
101674
+ if (foundPos === null)
101675
+ return false;
101676
+ const tr = editor.state.tr;
101677
+ for (const [key, value] of Object.entries(attrsPatch))
101678
+ tr.setNodeAttribute(foundPos, key, value);
101679
+ if (tr.steps.length === 0)
101680
+ return true;
101681
+ if (editor.view?.dispatch)
101682
+ editor.view.dispatch(tr);
101683
+ else if (typeof editor.dispatch === "function")
101684
+ editor.dispatch(tr);
101685
+ else
101629
101686
  return false;
101630
- return Boolean(updateCmd(nodeId, { attrs: attrsPatch }));
101687
+ return true;
101631
101688
  }
101632
101689
  function updateSdtPrChild(editor, target, childName, updater) {
101633
101690
  const currentSdtPr = resolveSdtByTarget(editor.state.doc, target).node.attrs.sdtPr ?? {
@@ -101861,6 +101918,59 @@ function buildContentControlInfoFromAttrs(attrs, kind) {
101861
101918
  }
101862
101919
  };
101863
101920
  }
101921
+ function assertNotSdtLocked(sdt, operation) {
101922
+ const mode = resolveLockMode(sdt.node.attrs);
101923
+ if (mode === "sdtLocked" || mode === "sdtContentLocked")
101924
+ throw new DocumentApiAdapterError("LOCK_VIOLATION", `Content control "${sdt.node.attrs.id}" has lock mode "${mode}" which prevents ${operation}.`, {
101925
+ lockMode: mode,
101926
+ operation
101927
+ });
101928
+ }
101929
+ function assertNotContentLocked(sdt, operation) {
101930
+ const mode = resolveLockMode(sdt.node.attrs);
101931
+ if (mode === "contentLocked" || mode === "sdtContentLocked")
101932
+ throw new DocumentApiAdapterError("LOCK_VIOLATION", `Content control "${sdt.node.attrs.id}" has lock mode "${mode}" which prevents ${operation}.`, {
101933
+ lockMode: mode,
101934
+ operation
101935
+ });
101936
+ }
101937
+ function assertControlType(sdt, expected, operation) {
101938
+ const actual = resolveControlType(sdt.node.attrs);
101939
+ const allowed = Array.isArray(expected) ? expected : [expected];
101940
+ if (!allowed.includes(actual))
101941
+ throw new DocumentApiAdapterError("TYPE_MISMATCH", `Operation "${operation}" requires control type ${allowed.join(" or ")}, but found "${actual}".`, {
101942
+ expected: allowed,
101943
+ actual,
101944
+ operation
101945
+ });
101946
+ }
101947
+ function buildMutationSuccess(target, updatedRef) {
101948
+ const result = {
101949
+ success: true,
101950
+ contentControl: target
101951
+ };
101952
+ if (updatedRef)
101953
+ result.updatedRef = updatedRef;
101954
+ return result;
101955
+ }
101956
+ function buildMutationFailure(code$1, message) {
101957
+ return {
101958
+ success: false,
101959
+ failure: {
101960
+ code: code$1,
101961
+ message
101962
+ }
101963
+ };
101964
+ }
101965
+ function applyPagination(items, opts) {
101966
+ const total = items.length;
101967
+ const offset = opts?.offset ?? 0;
101968
+ const limit = opts?.limit ?? total;
101969
+ return {
101970
+ items: items.slice(offset, offset + limit),
101971
+ total
101972
+ };
101973
+ }
101864
101974
  function resolveBlock(editor, nodeId) {
101865
101975
  const matches$1 = getBlockIndex(editor).candidates.filter((c$1) => c$1.nodeId === nodeId && (c$1.nodeType === "paragraph" || c$1.nodeType === "listItem"));
101866
101976
  if (matches$1.length === 0)
@@ -105111,7 +105221,7 @@ var isRegExp = (value) => {
105111
105221
  return true;
105112
105222
  }, areAttrsEqual = (attrsA = {}, attrsB = {}) => {
105113
105223
  return objectIncludes(attrsA, attrsB);
105114
- }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65, BASELINE_SHIFT_EPSILON = 0.000001, TABLE_STYLE_ID_TABLE_GRID = "TableGrid", TABLE_FALLBACK_BORDER, TABLE_FALLBACK_BORDERS, TABLE_FALLBACK_CELL_PADDING, DEFAULT_TBL_LOOK, CNF_STYLE_MAP, TABLE_STYLE_PRECEDENCE, getToCssFontFamily = () => {
105224
+ }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65, BASELINE_SHIFT_EPSILON = 0.000001, FONT_SLOT_THEME_PAIRS, TABLE_STYLE_ID_TABLE_GRID = "TableGrid", TABLE_FALLBACK_BORDER, TABLE_FALLBACK_BORDERS, TABLE_FALLBACK_CELL_PADDING, DEFAULT_TBL_LOOK, CNF_STYLE_MAP, TABLE_STYLE_PRECEDENCE, getToCssFontFamily = () => {
105115
105225
  return SuperConverter.toCssFontFamily;
105116
105226
  }, getSpacingStyle = (spacing, isListItem$1) => {
105117
105227
  let { before: before2, after: after2, line, lineRule, beforeAutospacing, afterAutospacing } = spacing;
@@ -119563,7 +119673,7 @@ var isRegExp = (value) => {
119563
119673
  if (id2)
119564
119674
  return trackedChanges.filter(({ mark }) => mark.attrs.id === id2);
119565
119675
  return trackedChanges;
119566
- }, DERIVED_ID_LENGTH = 24, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, 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", 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.32.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
119676
+ }, DERIVED_ID_LENGTH = 24, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", SDT_NODE_TYPES, VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, 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", 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.32.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
119567
119677
  if (!runProps?.elements?.length || !state)
119568
119678
  return;
119569
119679
  const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
@@ -119597,7 +119707,7 @@ var isRegExp = (value) => {
119597
119707
  state.kern = kernNode.attributes["w:val"];
119598
119708
  }
119599
119709
  }, SuperConverter;
119600
- var init_SuperConverter_KEGUvaEC_es = __esm(() => {
119710
+ var init_SuperConverter_B_EF8ijE_es = __esm(() => {
119601
119711
  init_rolldown_runtime_Bg48TavK_es();
119602
119712
  init_jszip_C49i9kUs_es();
119603
119713
  init_xml_js_CqGKpaft_es();
@@ -135263,6 +135373,12 @@ var init_SuperConverter_KEGUvaEC_es = __esm(() => {
135263
135373
  "highlight",
135264
135374
  "link"
135265
135375
  ];
135376
+ FONT_SLOT_THEME_PAIRS = [
135377
+ ["ascii", "asciiTheme"],
135378
+ ["hAnsi", "hAnsiTheme"],
135379
+ ["eastAsia", "eastAsiaTheme"],
135380
+ ["cs", "cstheme"]
135381
+ ];
135266
135382
  TABLE_FALLBACK_BORDER = {
135267
135383
  val: "single",
135268
135384
  size: 4,
@@ -156322,6 +156438,7 @@ var init_SuperConverter_KEGUvaEC_es = __esm(() => {
156322
156438
  };
156323
156439
  groupedCache = /* @__PURE__ */ new WeakMap;
156324
156440
  SDT_NODE_NAMES = ["structuredContent", "structuredContentBlock"];
156441
+ SDT_NODE_TYPES = new Set(SDT_NODE_NAMES);
156325
156442
  VALID_CONTROL_TYPES = [
156326
156443
  "text",
156327
156444
  "richText",
@@ -157464,7 +157581,7 @@ var init_SuperConverter_KEGUvaEC_es = __esm(() => {
157464
157581
  };
157465
157582
  });
157466
157583
 
157467
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DwiDDjhC.es.js
157584
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CAjt5qLD.es.js
157468
157585
  function parseSizeUnit(val = "0") {
157469
157586
  const length3 = val.toString() || "0";
157470
157587
  const value = Number.parseFloat(length3);
@@ -160186,8 +160303,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
160186
160303
  }
160187
160304
  };
160188
160305
  };
160189
- var init_create_headless_toolbar_DwiDDjhC_es = __esm(() => {
160190
- init_SuperConverter_KEGUvaEC_es();
160306
+ var init_create_headless_toolbar_CAjt5qLD_es = __esm(() => {
160307
+ init_SuperConverter_B_EF8ijE_es();
160191
160308
  init_constants_DrU4EASo_es();
160192
160309
  init_dist_B8HfvhaK_es();
160193
160310
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -208885,7 +209002,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
208885
209002
  init_remark_gfm_BhnWr3yf_es();
208886
209003
  });
208887
209004
 
208888
- // ../../packages/superdoc/dist/chunks/src-XCAViTso.es.js
209005
+ // ../../packages/superdoc/dist/chunks/src-CuD4BbTF.es.js
208889
209006
  function deleteProps(obj, propOrProps) {
208890
209007
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
208891
209008
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -209673,59 +209790,6 @@ function getSuperdocVersion() {
209673
209790
  return "unknown";
209674
209791
  }
209675
209792
  }
209676
- function assertNotSdtLocked(sdt, operation) {
209677
- const mode = resolveLockMode(sdt.node.attrs);
209678
- if (mode === "sdtLocked" || mode === "sdtContentLocked")
209679
- throw new DocumentApiAdapterError("LOCK_VIOLATION", `Content control "${sdt.node.attrs.id}" has lock mode "${mode}" which prevents ${operation}.`, {
209680
- lockMode: mode,
209681
- operation
209682
- });
209683
- }
209684
- function assertNotContentLocked(sdt, operation) {
209685
- const mode = resolveLockMode(sdt.node.attrs);
209686
- if (mode === "contentLocked" || mode === "sdtContentLocked")
209687
- throw new DocumentApiAdapterError("LOCK_VIOLATION", `Content control "${sdt.node.attrs.id}" has lock mode "${mode}" which prevents ${operation}.`, {
209688
- lockMode: mode,
209689
- operation
209690
- });
209691
- }
209692
- function assertControlType(sdt, expected, operation) {
209693
- const actual = resolveControlType(sdt.node.attrs);
209694
- const allowed = Array.isArray(expected) ? expected : [expected];
209695
- if (!allowed.includes(actual))
209696
- throw new DocumentApiAdapterError("TYPE_MISMATCH", `Operation "${operation}" requires control type ${allowed.join(" or ")}, but found "${actual}".`, {
209697
- expected: allowed,
209698
- actual,
209699
- operation
209700
- });
209701
- }
209702
- function buildMutationSuccess(target, updatedRef) {
209703
- const result = {
209704
- success: true,
209705
- contentControl: target
209706
- };
209707
- if (updatedRef)
209708
- result.updatedRef = updatedRef;
209709
- return result;
209710
- }
209711
- function buildMutationFailure(code7, message) {
209712
- return {
209713
- success: false,
209714
- failure: {
209715
- code: code7,
209716
- message
209717
- }
209718
- };
209719
- }
209720
- function applyPagination(items, opts) {
209721
- const total = items.length;
209722
- const offset$1 = opts?.offset ?? 0;
209723
- const limit = opts?.limit ?? total;
209724
- return {
209725
- items: items.slice(offset$1, offset$1 + limit),
209726
- total
209727
- };
209728
- }
209729
209793
  function getFocusMeta(tr) {
209730
209794
  return tr.getMeta(CustomSelectionPluginKey);
209731
209795
  }
@@ -244408,22 +244472,24 @@ function alreadyMatchesPlainTextReplacement(sdt, expectedText) {
244408
244472
  }
244409
244473
  function replaceSdtTextContent(editor, target, text5) {
244410
244474
  const resolved = resolveSdtByTarget(editor.state.doc, target);
244475
+ const { tr } = editor.state;
244476
+ const innerFrom = resolved.pos + 1;
244477
+ const innerTo = resolved.pos + resolved.node.nodeSize - 1;
244411
244478
  if (resolved.kind === "inline") {
244412
- const updateCmd = editor.commands?.updateStructuredContentById;
244413
- if (text5.length > 0)
244414
- return Boolean(updateCmd?.(target.nodeId, { text: text5 }));
244415
- const updatedNode$1 = resolved.node.type.create({ ...resolved.node.attrs }, null, resolved.node.marks);
244416
- const { tr: tr$1 } = editor.state;
244417
- tr$1.replaceWith(resolved.pos, resolved.pos + resolved.node.nodeSize, updatedNode$1);
244418
- dispatchTransaction(editor, tr$1);
244479
+ if (text5.length > 0) {
244480
+ const textNode = editor.schema.text(text5);
244481
+ tr.replaceWith(innerFrom, innerTo, textNode);
244482
+ } else
244483
+ tr.delete(innerFrom, innerTo);
244484
+ dispatchTransaction(editor, tr);
244419
244485
  return true;
244420
244486
  }
244421
244487
  const paragraph2 = buildEmptyBlockContent(editor, resolved.node);
244488
+ if (!paragraph2)
244489
+ return false;
244422
244490
  const paragraphText = text5.length > 0 ? buildTextWithTabs(editor.schema, text5, undefined) : null;
244423
- const updatedParagraph = paragraph2?.type.create(paragraph2.attrs ?? null, paragraphText, paragraph2.marks) ?? null;
244424
- const updatedNode = resolved.node.type.create({ ...resolved.node.attrs }, updatedParagraph, resolved.node.marks);
244425
- const { tr } = editor.state;
244426
- tr.replaceWith(resolved.pos, resolved.pos + resolved.node.nodeSize, updatedNode);
244491
+ const updatedParagraph = paragraph2.type.create(paragraph2.attrs ?? null, paragraphText, paragraph2.marks);
244492
+ tr.replaceWith(innerFrom, innerTo, updatedParagraph);
244427
244493
  dispatchTransaction(editor, tr);
244428
244494
  return true;
244429
244495
  }
@@ -253553,7 +253619,7 @@ function resolveParagraphContent(fragment2, block, measure) {
253553
253619
  const paraIndent = block.attrs?.indent;
253554
253620
  const paraIndentLeft = paraIndent?.left ?? 0;
253555
253621
  const paraIndentRight = paraIndent?.right ?? 0;
253556
- const { anchorIndentPx: paraMarkerAnchorIndent, firstLinePx: markerFirstLine, hangingPx: markerHanging } = resolveMarkerIndent(paraIndent, block.attrs?.direction === "rtl");
253622
+ const { anchorIndentPx: paraMarkerAnchorIndent, firstLinePx: markerFirstLine, hangingPx: markerHanging } = resolveMarkerIndent(paraIndent, getParagraphInlineDirection(block.attrs) === "rtl");
253557
253623
  const firstLineOffset = block.attrs?.suppressFirstLineIndent === true ? 0 : (paraIndent?.firstLine ?? 0) - (paraIndent?.hanging ?? 0);
253558
253624
  const paragraphEndsWithLineBreak = (block.runs.length > 0 ? block.runs[block.runs.length - 1] : null)?.kind === "lineBreak";
253559
253625
  const lines = fragment2.lines ?? measure.lines.slice(fragment2.fromLine, fragment2.toLine);
@@ -294511,16 +294577,7 @@ menclose::after {
294511
294577
  }, isRtlBlock = (block) => {
294512
294578
  if (block.kind !== "paragraph")
294513
294579
  return false;
294514
- const attrs = block.attrs;
294515
- if (!attrs)
294516
- return false;
294517
- const directionContext = attrs.directionContext;
294518
- if (directionContext?.inlineDirection != null)
294519
- return directionContext.inlineDirection === "rtl";
294520
- const directionAttr = attrs.direction ?? attrs.dir;
294521
- if (typeof directionAttr === "string" && directionAttr.toLowerCase() === "rtl")
294522
- return true;
294523
- return false;
294580
+ return getParagraphInlineDirection(block.attrs) === "rtl";
294524
294581
  }, determineColumn = (layout, fragmentX) => {
294525
294582
  const columns = layout.columns;
294526
294583
  if (!columns || columns.count <= 1)
@@ -302759,12 +302816,12 @@ menclose::after {
302759
302816
  return;
302760
302817
  console.log(...args$1);
302761
302818
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
302762
- var init_src_XCAViTso_es = __esm(() => {
302819
+ var init_src_CuD4BbTF_es = __esm(() => {
302763
302820
  init_rolldown_runtime_Bg48TavK_es();
302764
- init_SuperConverter_KEGUvaEC_es();
302821
+ init_SuperConverter_B_EF8ijE_es();
302765
302822
  init_jszip_C49i9kUs_es();
302766
302823
  init_uuid_qzgm05fK_es();
302767
- init_create_headless_toolbar_DwiDDjhC_es();
302824
+ init_create_headless_toolbar_CAjt5qLD_es();
302768
302825
  init_constants_DrU4EASo_es();
302769
302826
  init_dist_B8HfvhaK_es();
302770
302827
  init_unified_Dsuw2be5_es();
@@ -340807,11 +340864,11 @@ function print() { __p += __j.call(arguments, '') }
340807
340864
  ];
340808
340865
  });
340809
340866
 
340810
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BEAzL3ry.es.js
340867
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DrS6dKfb.es.js
340811
340868
  var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
340812
- var init_create_super_doc_ui_BEAzL3ry_es = __esm(() => {
340813
- init_SuperConverter_KEGUvaEC_es();
340814
- init_create_headless_toolbar_DwiDDjhC_es();
340869
+ var init_create_super_doc_ui_DrS6dKfb_es = __esm(() => {
340870
+ init_SuperConverter_B_EF8ijE_es();
340871
+ init_create_headless_toolbar_CAjt5qLD_es();
340815
340872
  MOD_ALIASES = new Set([
340816
340873
  "Mod",
340817
340874
  "Meta",
@@ -340853,16 +340910,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
340853
340910
 
340854
340911
  // ../../packages/superdoc/dist/super-editor.es.js
340855
340912
  var init_super_editor_es = __esm(() => {
340856
- init_src_XCAViTso_es();
340857
- init_SuperConverter_KEGUvaEC_es();
340913
+ init_src_CuD4BbTF_es();
340914
+ init_SuperConverter_B_EF8ijE_es();
340858
340915
  init_jszip_C49i9kUs_es();
340859
340916
  init_xml_js_CqGKpaft_es();
340860
- init_create_headless_toolbar_DwiDDjhC_es();
340917
+ init_create_headless_toolbar_CAjt5qLD_es();
340861
340918
  init_constants_DrU4EASo_es();
340862
340919
  init_dist_B8HfvhaK_es();
340863
340920
  init_unified_Dsuw2be5_es();
340864
340921
  init_DocxZipper_TPSo9G36_es();
340865
- init_create_super_doc_ui_BEAzL3ry_es();
340922
+ init_create_super_doc_ui_DrS6dKfb_es();
340866
340923
  init_ui_CGB3qmy3_es();
340867
340924
  init_eventemitter3_UwU_CLPU_es();
340868
340925
  init_errors_C_DoKMoN_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.8.0-next.107",
3
+ "version": "0.8.0-next.109",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -25,8 +25,8 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
- "@superdoc/super-editor": "0.0.1",
29
28
  "@superdoc/pm-adapter": "0.0.0",
29
+ "@superdoc/super-editor": "0.0.1",
30
30
  "superdoc": "1.32.0"
31
31
  },
32
32
  "module": "src/index.ts",
@@ -34,11 +34,11 @@
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.107",
38
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.107",
39
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.107",
40
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.107",
41
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.107"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.109",
38
+ "@superdoc-dev/cli-darwin-x64": "0.8.0-next.109",
39
+ "@superdoc-dev/cli-windows-x64": "0.8.0-next.109",
40
+ "@superdoc-dev/cli-linux-arm64": "0.8.0-next.109",
41
+ "@superdoc-dev/cli-linux-x64": "0.8.0-next.109"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",