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

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 +81 -39
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -17776,6 +17776,7 @@ var CONTENT_CONTROL_TYPES, LOCK_MODES, CONTENT_CONTROL_APPEARANCES;
17776
17776
  var init_content_controls_types = __esm(() => {
17777
17777
  CONTENT_CONTROL_TYPES = [
17778
17778
  "text",
17779
+ "richText",
17779
17780
  "date",
17780
17781
  "checkbox",
17781
17782
  "comboBox",
@@ -66095,7 +66096,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
66095
66096
  emptyOptions2 = {};
66096
66097
  });
66097
66098
 
66098
- // ../../packages/superdoc/dist/chunks/SuperConverter-CbX9ZPI9.es.js
66099
+ // ../../packages/superdoc/dist/chunks/SuperConverter-KEGUvaEC.es.js
66099
66100
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
66100
66101
  const fieldValue = extension$1.config[field];
66101
66102
  if (typeof fieldValue === "function")
@@ -77073,10 +77074,12 @@ function handleDocumentSectionNode(params3) {
77073
77074
  }
77074
77075
  function detectControlType(sdtPr) {
77075
77076
  if (!sdtPr?.elements)
77076
- return null;
77077
+ return "richText";
77077
77078
  const names = sdtPr.elements.map((el) => el.name);
77078
77079
  if (names.includes("w:text"))
77079
77080
  return "text";
77081
+ if (names.includes("w:richText"))
77082
+ return "richText";
77080
77083
  if (names.includes("w:date"))
77081
77084
  return "date";
77082
77085
  if (names.includes("w14:checkbox") || names.includes("w:checkbox"))
@@ -77091,7 +77094,16 @@ function detectControlType(sdtPr) {
77091
77094
  return "repeatingSectionItem";
77092
77095
  if (names.includes("w:group"))
77093
77096
  return "group";
77094
- return null;
77097
+ const TYPE_CHILD_NAMES = new Set([
77098
+ "w:equation",
77099
+ "w:picture",
77100
+ "w:citation",
77101
+ "w:bibliography",
77102
+ "w:docPartList"
77103
+ ]);
77104
+ if (names.some((n) => TYPE_CHILD_NAMES.has(n)))
77105
+ return null;
77106
+ return "richText";
77095
77107
  }
77096
77108
  function extractAppearance(sdtPr) {
77097
77109
  const el = sdtPr?.elements?.find((e) => e.name === "w:appearance" || e.name === "w15:appearance");
@@ -119585,7 +119597,7 @@ var isRegExp = (value) => {
119585
119597
  state.kern = kernNode.attributes["w:val"];
119586
119598
  }
119587
119599
  }, SuperConverter;
119588
- var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
119600
+ var init_SuperConverter_KEGUvaEC_es = __esm(() => {
119589
119601
  init_rolldown_runtime_Bg48TavK_es();
119590
119602
  init_jszip_C49i9kUs_es();
119591
119603
  init_xml_js_CqGKpaft_es();
@@ -134754,6 +134766,7 @@ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
134754
134766
  ]);
134755
134767
  CONTENT_CONTROL_TYPES2 = [
134756
134768
  "text",
134769
+ "richText",
134757
134770
  "date",
134758
134771
  "checkbox",
134759
134772
  "comboBox",
@@ -154963,6 +154976,7 @@ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
154963
154976
  ]);
154964
154977
  CONTROL_TYPE_ELEMENT_MAP = {
154965
154978
  text: "w:text",
154979
+ richText: "w:richText",
154966
154980
  date: "w:date",
154967
154981
  checkbox: "w14:checkbox",
154968
154982
  comboBox: "w:comboBox",
@@ -154987,12 +155001,7 @@ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
154987
155001
  attributes: validXmlAttributes$3
154988
155002
  };
154989
155003
  translator$8 = NodeTranslator.from(config$24);
154990
- translator$49 = NodeTranslator.from({
154991
- xmlName: "w:bidiVisual",
154992
- sdNodeOrKeyName: "rightToLeft",
154993
- encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
154994
- decode: ({ node: node3 }) => node3.attrs.rightToLeft ? { attributes: {} } : undefined
154995
- });
155004
+ translator$49 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bidiVisual", "rightToLeft"));
154996
155005
  translator$155 = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
154997
155006
  translator$158 = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
154998
155007
  translator$161 = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
@@ -156315,6 +156324,7 @@ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
156315
156324
  SDT_NODE_NAMES = ["structuredContent", "structuredContentBlock"];
156316
156325
  VALID_CONTROL_TYPES = [
156317
156326
  "text",
156327
+ "richText",
156318
156328
  "date",
156319
156329
  "checkbox",
156320
156330
  "comboBox",
@@ -157454,7 +157464,7 @@ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
157454
157464
  };
157455
157465
  });
157456
157466
 
157457
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbUkXBcM.es.js
157467
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DwiDDjhC.es.js
157458
157468
  function parseSizeUnit(val = "0") {
157459
157469
  const length3 = val.toString() || "0";
157460
157470
  const value = Number.parseFloat(length3);
@@ -160176,8 +160186,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
160176
160186
  }
160177
160187
  };
160178
160188
  };
160179
- var init_create_headless_toolbar_CbUkXBcM_es = __esm(() => {
160180
- init_SuperConverter_CbX9ZPI9_es();
160189
+ var init_create_headless_toolbar_DwiDDjhC_es = __esm(() => {
160190
+ init_SuperConverter_KEGUvaEC_es();
160181
160191
  init_constants_DrU4EASo_es();
160182
160192
  init_dist_B8HfvhaK_es();
160183
160193
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -208875,7 +208885,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
208875
208885
  init_remark_gfm_BhnWr3yf_es();
208876
208886
  });
208877
208887
 
208878
- // ../../packages/superdoc/dist/chunks/src-BfDVvw9H.es.js
208888
+ // ../../packages/superdoc/dist/chunks/src-XCAViTso.es.js
208879
208889
  function deleteProps(obj, propOrProps) {
208880
208890
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
208881
208891
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -209130,6 +209140,16 @@ function getParagraphInlineDirection(attrs) {
209130
209140
  if (attrs?.direction === "ltr" || attrs?.dir === "ltr" || attrs?.rtl === false || ppRtl === false)
209131
209141
  return "ltr";
209132
209142
  }
209143
+ function getTableVisualDirection(attrs) {
209144
+ const fromContext = attrs?.tableDirectionContext?.visualDirection;
209145
+ if (fromContext != null)
209146
+ return fromContext;
209147
+ const tp = attrs?.tableProperties;
209148
+ if (tp?.rightToLeft === true || tp?.bidiVisual === true)
209149
+ return "rtl";
209150
+ if (tp?.rightToLeft === false || tp?.bidiVisual === false)
209151
+ return "ltr";
209152
+ }
209133
209153
  function resolveTableWidthAttr(value) {
209134
209154
  if (!value || typeof value !== "object")
209135
209155
  return null;
@@ -213629,7 +213649,7 @@ function getTableContext($head) {
213629
213649
  };
213630
213650
  }
213631
213651
  function isRtlTable(table2) {
213632
- return table2?.attrs?.tableProperties?.rightToLeft === true;
213652
+ return getTableVisualDirection(table2?.attrs) === "rtl";
213633
213653
  }
213634
213654
  function getCellRect(context) {
213635
213655
  const map$12 = TableMap.get(context.table);
@@ -244486,7 +244506,10 @@ function wrapWrapper(editor, input2, options) {
244486
244506
  id: id2,
244487
244507
  tag: input2.tag,
244488
244508
  alias: input2.alias,
244489
- lockMode: input2.lockMode ?? "unlocked"
244509
+ lockMode: input2.lockMode ?? "unlocked",
244510
+ controlType: "richText",
244511
+ type: "richText",
244512
+ sdtPr: buildDefaultSdtPr("richText")
244490
244513
  }, resolved.node);
244491
244514
  const { tr } = editor.state;
244492
244515
  tr.replaceWith(resolved.pos, resolved.pos + resolved.node.nodeSize, wrapperNode);
@@ -244699,6 +244722,11 @@ function buildDefaultTypeSdtPrElement(controlType) {
244699
244722
  name: "w:text",
244700
244723
  type: "element"
244701
244724
  };
244725
+ case "richText":
244726
+ return {
244727
+ name: "w:richText",
244728
+ type: "element"
244729
+ };
244702
244730
  case "date":
244703
244731
  return {
244704
244732
  name: "w:date",
@@ -245408,15 +245436,16 @@ function createWrapper(editor, input2, options) {
245408
245436
  if (input2.target)
245409
245437
  resolveSdtByTarget(editor.state.doc, input2.target);
245410
245438
  return executeSdtMutation(editor, target, options, () => {
245439
+ const controlType = input2.controlType ?? "richText";
245411
245440
  const attrs = {
245412
245441
  id: id2,
245413
245442
  tag: input2.tag,
245414
245443
  alias: input2.alias,
245415
245444
  lockMode: input2.lockMode ?? "unlocked",
245416
- controlType: input2.controlType ?? "unknown",
245417
- type: input2.controlType ?? "unknown"
245445
+ controlType,
245446
+ type: controlType
245418
245447
  };
245419
- const defaultSdtPr = buildDefaultSdtPr(input2.controlType ?? "unknown");
245448
+ const defaultSdtPr = buildDefaultSdtPr(controlType);
245420
245449
  const isDateCreate = input2.controlType === "date" && input2.content == null;
245421
245450
  const dateDefaults = isDateCreate ? buildDateControlDefaults() : null;
245422
245451
  const sdtPrWithDateDefaults = dateDefaults ? applyDateDefaultsToSdtPr(defaultSdtPr, dateDefaults) : defaultSdtPr;
@@ -255390,7 +255419,7 @@ function resolveRenderedTableWidth(columnWidth, measuredWidth, attrs) {
255390
255419
  function resolveTableFrame(baseX, columnWidth, tableWidth, attrs) {
255391
255420
  const width = resolveRenderedTableWidth(columnWidth, tableWidth, attrs);
255392
255421
  const explicitJustification = typeof attrs?.justification === "string" ? attrs.justification : undefined;
255393
- const isRtlTable$1 = attrs?.tableProperties?.rightToLeft === true;
255422
+ const isRtlTable$1 = getTableVisualDirection(attrs) === "rtl";
255394
255423
  const effectiveJustification = explicitJustification ?? (isRtlTable$1 ? "end" : undefined);
255395
255424
  const tableIndent = getTableIndentWidth(attrs);
255396
255425
  if (effectiveJustification === "center")
@@ -265679,11 +265708,7 @@ function tableNodeToBlock(node3, { nextBlockId, positions, storyKey, trackedChan
265679
265708
  };
265680
265709
  };
265681
265710
  const borderSource = getBorderSource();
265682
- const isRtlTable$1 = tablePropertiesForCascade?.rightToLeft === true;
265683
- const tableBorders = borderSource ? extractTableBorders(borderSource.borders, {
265684
- unit: borderSource.unit,
265685
- isRtl: isRtlTable$1
265686
- }) : undefined;
265711
+ const tableBorders = borderSource ? extractTableBorders(borderSource.borders, { unit: borderSource.unit }) : undefined;
265687
265712
  if (tableBorders)
265688
265713
  tableAttrs.borders = tableBorders;
265689
265714
  if (node3.attrs?.borderCollapse)
@@ -265717,6 +265742,12 @@ function tableNodeToBlock(node3, { nextBlockId, positions, storyKey, trackedChan
265717
265742
  const tableProperties = node3.attrs?.tableProperties;
265718
265743
  if (tableProperties && typeof tableProperties === "object")
265719
265744
  tableAttrs.tableProperties = tableProperties;
265745
+ const styleResolvedTableProps = effectiveStyleId && converterContext?.translatedLinkedStyles ? resolveTableProperties(effectiveStyleId, converterContext.translatedLinkedStyles) : undefined;
265746
+ const inlineProps = rawTableProperties;
265747
+ const styleProps = styleResolvedTableProps;
265748
+ const inlineVisual = inlineProps?.rightToLeft ?? inlineProps?.bidiVisual;
265749
+ const styleVisual = styleProps?.rightToLeft ?? styleProps?.bidiVisual;
265750
+ tableAttrs.tableDirectionContext = resolveTableDirection({ rightToLeft: inlineVisual ?? styleVisual }, converterContext?.sectionDirectionContext ?? resolveSectionDirection(undefined));
265720
265751
  let columnWidths = undefined;
265721
265752
  const twipsToPixels$2 = (twips) => {
265722
265753
  return twips / 1440 * 96;
@@ -290286,7 +290317,7 @@ menclose::after {
290286
290317
  const tableBorders = block.attrs?.borders;
290287
290318
  const tableIndentValue = block.attrs?.tableIndent?.width;
290288
290319
  const tableIndent = typeof tableIndentValue === "number" && Number.isFinite(tableIndentValue) ? tableIndentValue : 0;
290289
- const isRtl = block.attrs?.tableProperties?.rightToLeft === true;
290320
+ const isRtl = getTableVisualDirection(block.attrs) === "rtl";
290290
290321
  const container = doc$12.createElement("div");
290291
290322
  container.classList.add(CLASS_NAMES$1.fragment);
290292
290323
  applyStyles$2(container, fragmentStyles);
@@ -295804,6 +295835,16 @@ menclose::after {
295804
295835
  mutated = true;
295805
295836
  }
295806
295837
  return mutated ? mirrored : indent2;
295838
+ }, resolveTableDirection = (tableProperties, parentSection) => {
295839
+ let visualDirection;
295840
+ if (tableProperties?.rightToLeft === true || tableProperties?.bidiVisual === true)
295841
+ visualDirection = "rtl";
295842
+ else if (tableProperties?.rightToLeft === false || tableProperties?.bidiVisual === false)
295843
+ visualDirection = "ltr";
295844
+ return {
295845
+ visualDirection,
295846
+ parentSection
295847
+ };
295807
295848
  }, writingModeFromTextDirection = (val) => {
295808
295849
  switch (val) {
295809
295850
  case "lrTb":
@@ -297568,11 +297609,11 @@ menclose::after {
297568
297609
  val: normalizeLegacyBorderStyle(b$1.val)
297569
297610
  };
297570
297611
  }
297571
- const fallback = extractCellBorders({ borders: filteredLegacyBorders }, { isRtl: tableProperties?.rightToLeft === true });
297612
+ const fallback = extractCellBorders({ borders: filteredLegacyBorders });
297572
297613
  if (fallback)
297573
297614
  cellAttrs.borders = fallback;
297574
297615
  }
297575
- const padding = extractCellPadding(cellNode.attrs ?? {}, { isRtl: tableProperties?.rightToLeft === true }) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
297616
+ const padding = extractCellPadding(cellNode.attrs ?? {}) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
297576
297617
  if (padding)
297577
297618
  cellAttrs.padding = padding;
297578
297619
  const verticalAlign = cellNode.attrs?.verticalAlign;
@@ -302718,12 +302759,12 @@ menclose::after {
302718
302759
  return;
302719
302760
  console.log(...args$1);
302720
302761
  }, 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;
302721
- var init_src_BfDVvw9H_es = __esm(() => {
302762
+ var init_src_XCAViTso_es = __esm(() => {
302722
302763
  init_rolldown_runtime_Bg48TavK_es();
302723
- init_SuperConverter_CbX9ZPI9_es();
302764
+ init_SuperConverter_KEGUvaEC_es();
302724
302765
  init_jszip_C49i9kUs_es();
302725
302766
  init_uuid_qzgm05fK_es();
302726
- init_create_headless_toolbar_CbUkXBcM_es();
302767
+ init_create_headless_toolbar_DwiDDjhC_es();
302727
302768
  init_constants_DrU4EASo_es();
302728
302769
  init_dist_B8HfvhaK_es();
302729
302770
  init_unified_Dsuw2be5_es();
@@ -326986,6 +327027,7 @@ function print() { __p += __j.call(arguments, '') }
326986
327027
  ]);
326987
327028
  CONTROL_TYPE_SDT_PR_ELEMENTS = {
326988
327029
  text: "w:text",
327030
+ richText: "w:richText",
326989
327031
  date: "w:date",
326990
327032
  checkbox: "w14:checkbox",
326991
327033
  comboBox: "w:comboBox",
@@ -340765,11 +340807,11 @@ function print() { __p += __j.call(arguments, '') }
340765
340807
  ];
340766
340808
  });
340767
340809
 
340768
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkcWwDom.es.js
340810
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BEAzL3ry.es.js
340769
340811
  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;
340770
- var init_create_super_doc_ui_CkcWwDom_es = __esm(() => {
340771
- init_SuperConverter_CbX9ZPI9_es();
340772
- init_create_headless_toolbar_CbUkXBcM_es();
340812
+ var init_create_super_doc_ui_BEAzL3ry_es = __esm(() => {
340813
+ init_SuperConverter_KEGUvaEC_es();
340814
+ init_create_headless_toolbar_DwiDDjhC_es();
340773
340815
  MOD_ALIASES = new Set([
340774
340816
  "Mod",
340775
340817
  "Meta",
@@ -340811,16 +340853,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
340811
340853
 
340812
340854
  // ../../packages/superdoc/dist/super-editor.es.js
340813
340855
  var init_super_editor_es = __esm(() => {
340814
- init_src_BfDVvw9H_es();
340815
- init_SuperConverter_CbX9ZPI9_es();
340856
+ init_src_XCAViTso_es();
340857
+ init_SuperConverter_KEGUvaEC_es();
340816
340858
  init_jszip_C49i9kUs_es();
340817
340859
  init_xml_js_CqGKpaft_es();
340818
- init_create_headless_toolbar_CbUkXBcM_es();
340860
+ init_create_headless_toolbar_DwiDDjhC_es();
340819
340861
  init_constants_DrU4EASo_es();
340820
340862
  init_dist_B8HfvhaK_es();
340821
340863
  init_unified_Dsuw2be5_es();
340822
340864
  init_DocxZipper_TPSo9G36_es();
340823
- init_create_super_doc_ui_CkcWwDom_es();
340865
+ init_create_super_doc_ui_BEAzL3ry_es();
340824
340866
  init_ui_CGB3qmy3_es();
340825
340867
  init_eventemitter3_UwU_CLPU_es();
340826
340868
  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.104",
3
+ "version": "0.8.0-next.107",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -24,9 +24,9 @@
24
24
  "@types/node": "22.19.2",
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
- "@superdoc/pm-adapter": "0.0.0",
28
27
  "@superdoc/document-api": "0.0.1",
29
28
  "@superdoc/super-editor": "0.0.1",
29
+ "@superdoc/pm-adapter": "0.0.0",
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.104",
38
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.104",
39
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.104",
40
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.104",
41
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.104"
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"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",