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

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 +124 -46
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -66095,7 +66095,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
66095
66095
  emptyOptions2 = {};
66096
66096
  });
66097
66097
 
66098
- // ../../packages/superdoc/dist/chunks/SuperConverter-5Idv4fhC.es.js
66098
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CbX9ZPI9.es.js
66099
66099
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
66100
66100
  const fieldValue = extension$1.config[field];
66101
66101
  if (typeof fieldValue === "function")
@@ -105829,25 +105829,62 @@ var isRegExp = (value) => {
105829
105829
  node3._vMergeConsumed = true;
105830
105830
  }, getTableCellMargins = (inlineMargins, referencedStyles) => {
105831
105831
  const { cellMargins = {} } = referencedStyles;
105832
- return [
105833
- "left",
105834
- "right",
105835
- "top",
105836
- "bottom"
105837
- ].reduce((acc, direction) => {
105838
- const key = `margin${direction.charAt(0).toUpperCase() + direction.slice(1)}`;
105839
- const inlineValue = inlineMargins ? inlineMargins?.[key]?.value : null;
105840
- const styleValue = cellMargins ? cellMargins[key] : null;
105841
- if (inlineValue != null)
105842
- acc[direction] = twipsToPixels(inlineValue);
105843
- else if (styleValue == null)
105844
- acc[direction] = undefined;
105845
- else if (typeof styleValue === "object")
105846
- acc[direction] = twipsToPixels(styleValue.value);
105832
+ const readMargin = (source, key) => {
105833
+ if (!source)
105834
+ return null;
105835
+ const v = source[key];
105836
+ if (v == null)
105837
+ return null;
105838
+ if (typeof v === "number")
105839
+ return v;
105840
+ if (typeof v === "object" && typeof v.value === "number")
105841
+ return v.value;
105842
+ return null;
105843
+ };
105844
+ const sides = [
105845
+ {
105846
+ physical: "top",
105847
+ physicalKey: "marginTop",
105848
+ logicalKey: null
105849
+ },
105850
+ {
105851
+ physical: "bottom",
105852
+ physicalKey: "marginBottom",
105853
+ logicalKey: null
105854
+ },
105855
+ {
105856
+ physical: "left",
105857
+ physicalKey: "marginLeft",
105858
+ logicalKey: "marginStart"
105859
+ },
105860
+ {
105861
+ physical: "right",
105862
+ physicalKey: "marginRight",
105863
+ logicalKey: "marginEnd"
105864
+ }
105865
+ ];
105866
+ const result = {};
105867
+ for (const { physical, physicalKey, logicalKey } of sides) {
105868
+ const inlinePhysical = readMargin(inlineMargins, physicalKey);
105869
+ const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
105870
+ if (inlinePhysical != null) {
105871
+ result[physical] = twipsToPixels(inlinePhysical);
105872
+ continue;
105873
+ }
105874
+ if (inlineLogical != null) {
105875
+ result[physical] = twipsToPixels(inlineLogical);
105876
+ continue;
105877
+ }
105878
+ const stylePhysical = readMargin(cellMargins, physicalKey);
105879
+ const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
105880
+ if (stylePhysical != null)
105881
+ result[physical] = twipsToPixels(stylePhysical);
105882
+ else if (styleLogical != null)
105883
+ result[physical] = twipsToPixels(styleLogical);
105847
105884
  else
105848
- acc[direction] = twipsToPixels(styleValue);
105849
- return acc;
105850
- }, {});
105885
+ result[physical] = undefined;
105886
+ }
105887
+ return result;
105851
105888
  }, PX_PER_PT$1, pxToEighthPoints = (px) => Math.round(px / PX_PER_PT$1 * 8), SIDES, XML_NODE_NAME$30 = "w:tc", SD_NODE_NAME$29 = "tableCell", validXmlAttributes$8, config$29, translator$6, propertyTranslators$9, translator$154, translator$51, translator$68, translator$69, translator$74, translator$157, translator$160, translator$172, translator$177, translator$178, propertyTranslators$8, translator$173, createPlaceholderCell = (gridWidth, reason) => {
105852
105889
  const safeWidth = Number.isFinite(gridWidth) ? gridWidth : 0;
105853
105890
  const noBorder = {
@@ -119548,7 +119585,7 @@ var isRegExp = (value) => {
119548
119585
  state.kern = kernNode.attributes["w:val"];
119549
119586
  }
119550
119587
  }, SuperConverter;
119551
- var init_SuperConverter_5Idv4fhC_es = __esm(() => {
119588
+ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
119552
119589
  init_rolldown_runtime_Bg48TavK_es();
119553
119590
  init_jszip_C49i9kUs_es();
119554
119591
  init_xml_js_CqGKpaft_es();
@@ -157417,7 +157454,7 @@ var init_SuperConverter_5Idv4fhC_es = __esm(() => {
157417
157454
  };
157418
157455
  });
157419
157456
 
157420
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CEUTigkM.es.js
157457
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbUkXBcM.es.js
157421
157458
  function parseSizeUnit(val = "0") {
157422
157459
  const length3 = val.toString() || "0";
157423
157460
  const value = Number.parseFloat(length3);
@@ -160139,8 +160176,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
160139
160176
  }
160140
160177
  };
160141
160178
  };
160142
- var init_create_headless_toolbar_CEUTigkM_es = __esm(() => {
160143
- init_SuperConverter_5Idv4fhC_es();
160179
+ var init_create_headless_toolbar_CbUkXBcM_es = __esm(() => {
160180
+ init_SuperConverter_CbX9ZPI9_es();
160144
160181
  init_constants_DrU4EASo_es();
160145
160182
  init_dist_B8HfvhaK_es();
160146
160183
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -161587,7 +161624,7 @@ var init_decrypt_docx_4kQ488M9_es = __esm(() => {
161587
161624
  ]);
161588
161625
  });
161589
161626
 
161590
- // ../../packages/superdoc/dist/chunks/DocxZipper-Dh4RtvcE.es.js
161627
+ // ../../packages/superdoc/dist/chunks/DocxZipper-TPSo9G36.es.js
161591
161628
  function sniffEncoding(u8) {
161592
161629
  if (u8.length >= 2) {
161593
161630
  const b0 = u8[0], b1 = u8[1];
@@ -162247,7 +162284,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
162247
162284
  return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
162248
162285
  }
162249
162286
  }, DocxZipper_default;
162250
- var init_DocxZipper_Dh4RtvcE_es = __esm(() => {
162287
+ var init_DocxZipper_TPSo9G36_es = __esm(() => {
162251
162288
  init_rolldown_runtime_Bg48TavK_es();
162252
162289
  init_jszip_C49i9kUs_es();
162253
162290
  init_xml_js_CqGKpaft_es();
@@ -162302,7 +162339,8 @@ var init_DocxZipper_Dh4RtvcE_es = __esm(() => {
162302
162339
  ]);
162303
162340
  MIME_TYPE_FOR_EXT = {
162304
162341
  tif: "tiff",
162305
- jpg: "jpeg"
162342
+ jpg: "jpeg",
162343
+ svg: "svg+xml"
162306
162344
  };
162307
162345
  FONT_CONTENT_TYPES = {
162308
162346
  odttf: "application/vnd.openxmlformats-officedocument.obfuscatedFont",
@@ -208837,7 +208875,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
208837
208875
  init_remark_gfm_BhnWr3yf_es();
208838
208876
  });
208839
208877
 
208840
- // ../../packages/superdoc/dist/chunks/src-OZOxpRA7.es.js
208878
+ // ../../packages/superdoc/dist/chunks/src-BfDVvw9H.es.js
208841
208879
  function deleteProps(obj, propOrProps) {
208842
208880
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
208843
208881
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -211760,6 +211798,15 @@ function shallowEqual$2(a2, b$1) {
211760
211798
  return false;
211761
211799
  return true;
211762
211800
  }
211801
+ function isSdtContentFullyLocked(node3) {
211802
+ return node3.attrs.lockMode === "sdtContentLocked";
211803
+ }
211804
+ function findAncestorDepth$1($pos, predicate) {
211805
+ for (let depth = $pos.depth;depth > 0; depth -= 1)
211806
+ if (predicate($pos.node(depth)))
211807
+ return depth;
211808
+ return null;
211809
+ }
211763
211810
  function deleteFromEndOfRun(state, dispatch, $pos) {
211764
211811
  const rightRun = state.doc.nodeAt($pos.pos + 1);
211765
211812
  const $afterRightRunPos = state.doc.resolve($pos.pos + 2 + rightRun.nodeSize);
@@ -276558,6 +276605,35 @@ var Node$13 = class Node$14 {
276558
276605
  dispatch(tr.scrollIntoView());
276559
276606
  }
276560
276607
  return true;
276608
+ }, deleteBlockSdtAtTextBlockStart = () => ({ state, dispatch }) => {
276609
+ const { selection } = state;
276610
+ if (!selection.empty)
276611
+ return false;
276612
+ const { $from } = selection;
276613
+ const sdtDepth = findAncestorDepth$1($from, (node3) => node3.type.name === "structuredContentBlock");
276614
+ if (sdtDepth == null)
276615
+ return false;
276616
+ const textblockDepth = findAncestorDepth$1($from, (node3) => node3.isTextblock);
276617
+ if (textblockDepth !== sdtDepth + 1)
276618
+ return false;
276619
+ if ($from.node(textblockDepth).type.name !== "paragraph")
276620
+ return false;
276621
+ if ($from.pos !== $from.start(textblockDepth))
276622
+ return false;
276623
+ if ($from.before(textblockDepth) !== $from.start(sdtDepth))
276624
+ return false;
276625
+ const sdtNode = $from.node(sdtDepth);
276626
+ if (sdtNode.attrs.lockMode === "sdtLocked")
276627
+ return false;
276628
+ if (isSdtContentFullyLocked(sdtNode))
276629
+ return true;
276630
+ if (dispatch) {
276631
+ const from$1 = $from.before(sdtDepth);
276632
+ const tr = state.tr.delete(from$1, from$1 + sdtNode.nodeSize);
276633
+ const selectionPos = Math.min(from$1, tr.doc.content.size);
276634
+ dispatch(tr.setSelection(Selection.near(tr.doc.resolve(selectionPos), -1)).scrollIntoView());
276635
+ }
276636
+ return true;
276561
276637
  }, deleteSkipEmptyRun = () => ({ state, dispatch }) => {
276562
276638
  const sel = state.selection;
276563
276639
  if (!sel.empty)
@@ -285051,6 +285127,7 @@ var Node$13 = class Node$14 {
285051
285127
  tr.setMeta("inputType", "deleteContentBackward");
285052
285128
  return false;
285053
285129
  },
285130
+ () => commands$1.deleteBlockSdtAtTextBlockStart(),
285054
285131
  () => commands$1.backspaceEmptyRunParagraph(),
285055
285132
  () => commands$1.backspaceSkipEmptyRun(),
285056
285133
  () => commands$1.backspaceAtomBefore(),
@@ -285065,6 +285142,7 @@ var Node$13 = class Node$14 {
285065
285142
  const { view } = editor;
285066
285143
  dispatchHistoryBoundary(view);
285067
285144
  return editor.commands.first(({ commands: commands$1 }) => [
285145
+ () => commands$1.deleteBlockSdtAtTextBlockStart(),
285068
285146
  () => commands$1.deleteSkipEmptyRun(),
285069
285147
  () => commands$1.deleteAtomAfter(),
285070
285148
  () => commands$1.deleteNextToRun(),
@@ -297040,11 +297118,10 @@ menclose::after {
297040
297118
  }, EMPTY_CHART_DATA, hydrateTableStyleAttrs = (tableNode, context, effectiveStyleId) => {
297041
297119
  const hydration = {};
297042
297120
  const tableProps = tableNode.attrs?.tableProperties ?? null;
297043
- const isRtlTable$1 = tableProps?.rightToLeft === true;
297044
297121
  let inlineBorders;
297045
297122
  let inlinePadding;
297046
297123
  if (tableProps) {
297047
- const padding = convertCellMarginsToPx(tableProps.cellMargins, isRtlTable$1);
297124
+ const padding = convertCellMarginsToPx(tableProps.cellMargins);
297048
297125
  if (padding)
297049
297126
  inlinePadding = normalizeCellPaddingTopBottom(padding);
297050
297127
  if (tableProps.borders && typeof tableProps.borders === "object")
@@ -297075,7 +297152,7 @@ menclose::after {
297075
297152
  } else if (inlineBorders)
297076
297153
  hydration.borders = inlineBorders;
297077
297154
  if (resolved.cellMargins) {
297078
- const stylePadding = convertCellMarginsToPx(resolved.cellMargins, isRtlTable$1);
297155
+ const stylePadding = convertCellMarginsToPx(resolved.cellMargins);
297079
297156
  if (stylePadding) {
297080
297157
  const normalizedStylePadding = normalizeCellPaddingTopBottom(stylePadding);
297081
297158
  hydration.cellPadding = inlinePadding ? {
@@ -297141,7 +297218,7 @@ menclose::after {
297141
297218
  ...border,
297142
297219
  size: size$1
297143
297220
  } : border;
297144
- }, convertCellMarginsToPx = (margins, isRtlTable$1 = false) => {
297221
+ }, convertCellMarginsToPx = (margins) => {
297145
297222
  if (!margins || typeof margins !== "object")
297146
297223
  return;
297147
297224
  const spacing = {};
@@ -297154,8 +297231,8 @@ menclose::after {
297154
297231
  marginBottom: "bottom",
297155
297232
  marginLeft: "left",
297156
297233
  marginRight: "right",
297157
- marginStart: isRtlTable$1 ? "right" : "left",
297158
- marginEnd: isRtlTable$1 ? "left" : "right"
297234
+ marginStart: "left",
297235
+ marginEnd: "right"
297159
297236
  };
297160
297237
  Object.entries(margins).forEach(([key2, value]) => {
297161
297238
  const side = keyMap[key2];
@@ -302641,18 +302718,18 @@ menclose::after {
302641
302718
  return;
302642
302719
  console.log(...args$1);
302643
302720
  }, 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;
302644
- var init_src_OZOxpRA7_es = __esm(() => {
302721
+ var init_src_BfDVvw9H_es = __esm(() => {
302645
302722
  init_rolldown_runtime_Bg48TavK_es();
302646
- init_SuperConverter_5Idv4fhC_es();
302723
+ init_SuperConverter_CbX9ZPI9_es();
302647
302724
  init_jszip_C49i9kUs_es();
302648
302725
  init_uuid_qzgm05fK_es();
302649
- init_create_headless_toolbar_CEUTigkM_es();
302726
+ init_create_headless_toolbar_CbUkXBcM_es();
302650
302727
  init_constants_DrU4EASo_es();
302651
302728
  init_dist_B8HfvhaK_es();
302652
302729
  init_unified_Dsuw2be5_es();
302653
302730
  init_remark_gfm_BhnWr3yf_es();
302654
302731
  init_remark_stringify_6MMJfY0k_es();
302655
- init_DocxZipper_Dh4RtvcE_es();
302732
+ init_DocxZipper_TPSo9G36_es();
302656
302733
  init__plugin_vue_export_helper_HmhZBO0u_es();
302657
302734
  init_eventemitter3_UwU_CLPU_es();
302658
302735
  init_errors_C_DoKMoN_es();
@@ -305414,6 +305491,7 @@ ${err.toString()}`);
305414
305491
  decreaseListIndent: () => decreaseListIndent,
305415
305492
  decreaseTextIndent: () => decreaseTextIndent,
305416
305493
  deleteAtomAfter: () => deleteAtomAfter,
305494
+ deleteBlockSdtAtTextBlockStart: () => deleteBlockSdtAtTextBlockStart,
305417
305495
  deleteNextToRun: () => deleteNextToRun,
305418
305496
  deleteSelection: () => deleteSelection$1,
305419
305497
  deleteSkipEmptyRun: () => deleteSkipEmptyRun,
@@ -340687,11 +340765,11 @@ function print() { __p += __j.call(arguments, '') }
340687
340765
  ];
340688
340766
  });
340689
340767
 
340690
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BGYHCZ5O.es.js
340768
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkcWwDom.es.js
340691
340769
  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;
340692
- var init_create_super_doc_ui_BGYHCZ5O_es = __esm(() => {
340693
- init_SuperConverter_5Idv4fhC_es();
340694
- init_create_headless_toolbar_CEUTigkM_es();
340770
+ var init_create_super_doc_ui_CkcWwDom_es = __esm(() => {
340771
+ init_SuperConverter_CbX9ZPI9_es();
340772
+ init_create_headless_toolbar_CbUkXBcM_es();
340695
340773
  MOD_ALIASES = new Set([
340696
340774
  "Mod",
340697
340775
  "Meta",
@@ -340733,16 +340811,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
340733
340811
 
340734
340812
  // ../../packages/superdoc/dist/super-editor.es.js
340735
340813
  var init_super_editor_es = __esm(() => {
340736
- init_src_OZOxpRA7_es();
340737
- init_SuperConverter_5Idv4fhC_es();
340814
+ init_src_BfDVvw9H_es();
340815
+ init_SuperConverter_CbX9ZPI9_es();
340738
340816
  init_jszip_C49i9kUs_es();
340739
340817
  init_xml_js_CqGKpaft_es();
340740
- init_create_headless_toolbar_CEUTigkM_es();
340818
+ init_create_headless_toolbar_CbUkXBcM_es();
340741
340819
  init_constants_DrU4EASo_es();
340742
340820
  init_dist_B8HfvhaK_es();
340743
340821
  init_unified_Dsuw2be5_es();
340744
- init_DocxZipper_Dh4RtvcE_es();
340745
- init_create_super_doc_ui_BGYHCZ5O_es();
340822
+ init_DocxZipper_TPSo9G36_es();
340823
+ init_create_super_doc_ui_CkcWwDom_es();
340746
340824
  init_ui_CGB3qmy3_es();
340747
340825
  init_eventemitter3_UwU_CLPU_es();
340748
340826
  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.102",
3
+ "version": "0.8.0-next.104",
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",
27
28
  "@superdoc/document-api": "0.0.1",
28
29
  "@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-x64": "0.8.0-next.102",
38
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.102",
39
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.102",
40
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.102",
41
- "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.102"
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"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",