@superdoc-dev/cli 0.2.0-next.26 → 0.2.0-next.27

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 +82 -13
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -101168,9 +101168,9 @@ var init_remark_gfm_CQ3Jg4PR_es = __esm(() => {
101168
101168
  init_remark_gfm_z_sDF4ss_es();
101169
101169
  });
101170
101170
 
101171
- // ../../packages/superdoc/dist/chunks/src-LEL3AcVi.es.js
101172
- var exports_src_LEL3AcVi_es = {};
101173
- __export(exports_src_LEL3AcVi_es, {
101171
+ // ../../packages/superdoc/dist/chunks/src-DPtHGvLJ.es.js
101172
+ var exports_src_DPtHGvLJ_es = {};
101173
+ __export(exports_src_DPtHGvLJ_es, {
101174
101174
  zt: () => defineMark,
101175
101175
  z: () => cM,
101176
101176
  yt: () => removeAwarenessStates,
@@ -136428,6 +136428,32 @@ function createDropcapPlugin(editor) {
136428
136428
  } }
136429
136429
  });
136430
136430
  }
136431
+ function parseCssLength(value) {
136432
+ if (!value)
136433
+ return null;
136434
+ const match$1 = value.match(/^(-?[0-9]*\.?[0-9]+)\s*(%|[a-z]*)$/i);
136435
+ if (!match$1)
136436
+ return null;
136437
+ const num = parseFloat(match$1[1]);
136438
+ if (isNaN(num))
136439
+ return null;
136440
+ const unit = match$1[2];
136441
+ if (!unit)
136442
+ return {
136443
+ points: num,
136444
+ unit: ""
136445
+ };
136446
+ if (unit === "%")
136447
+ return {
136448
+ points: num,
136449
+ unit: "%"
136450
+ };
136451
+ const factor = CSS_LENGTH_TO_PT[unit];
136452
+ return factor != null ? {
136453
+ points: num * factor,
136454
+ unit
136455
+ } : null;
136456
+ }
136431
136457
  function parseAttrs(node3) {
136432
136458
  const numberingProperties = {};
136433
136459
  let indent2, spacing;
@@ -136447,13 +136473,49 @@ function parseAttrs(node3) {
136447
136473
  try {
136448
136474
  spacing = JSON.parse(attr.value);
136449
136475
  Object.keys(spacing).forEach((key$1) => {
136450
- spacing[key$1] = Number(spacing[key$1]);
136476
+ if (key$1 !== "lineRule")
136477
+ spacing[key$1] = Number(spacing[key$1]);
136451
136478
  });
136452
136479
  } catch {}
136453
136480
  else
136454
136481
  acc[attr.name] = attr.value;
136455
136482
  return acc;
136456
136483
  }, {});
136484
+ if (!spacing && node3.style) {
136485
+ const cssSpacing = {};
136486
+ const lh = parseCssLength(node3.style.lineHeight);
136487
+ if (lh && lh.points > 0)
136488
+ if (lh.unit === "" || lh.unit === "%") {
136489
+ const multiplier = lh.unit === "%" ? lh.points / 100 : lh.points;
136490
+ cssSpacing.line = Math.round(multiplier * 240 / 1.15);
136491
+ cssSpacing.lineRule = "auto";
136492
+ } else {
136493
+ cssSpacing.line = Math.round(lh.points * 20);
136494
+ cssSpacing.lineRule = "exact";
136495
+ }
136496
+ const mt = parseCssLength(node3.style.marginTop);
136497
+ if (mt && mt.unit !== "%" && mt.points >= 0)
136498
+ cssSpacing.before = Math.round(mt.points * 20);
136499
+ const mb = parseCssLength(node3.style.marginBottom);
136500
+ if (mb && mb.unit !== "%" && mb.points >= 0)
136501
+ cssSpacing.after = Math.round(mb.points * 20);
136502
+ if (Object.keys(cssSpacing).length > 0)
136503
+ spacing = cssSpacing;
136504
+ }
136505
+ if (!indent2 && node3.style) {
136506
+ const cssIndent = {};
136507
+ const ml = parseCssLength(node3.style.marginLeft);
136508
+ if (ml && ml.unit !== "%" && ml.points >= 0)
136509
+ cssIndent.left = Math.round(ml.points * 20);
136510
+ const ti = parseCssLength(node3.style.textIndent);
136511
+ if (ti && ti.unit !== "%")
136512
+ if (ti.points >= 0)
136513
+ cssIndent.firstLine = Math.round(ti.points * 20);
136514
+ else
136515
+ cssIndent.hanging = Math.round(Math.abs(ti.points) * 20);
136516
+ if (Object.keys(cssIndent).length > 0)
136517
+ indent2 = cssIndent;
136518
+ }
136457
136519
  let attrs = {
136458
136520
  paragraphProperties: { styleId: styleId || null },
136459
136521
  extraAttrs
@@ -166533,7 +166595,7 @@ var Node$13 = class Node$14 {
166533
166595
  if (first$1.childCount === 0)
166534
166596
  return false;
166535
166597
  return first$1.child(0).type.name === "fieldAnnotation";
166536
- }, bulletInputRegex, orderedInputRegex, Paragraph, Heading, CommentRangeStart, CommentRangeEnd, CommentReference, CommentsMark, toSuperscriptDigits = (value) => {
166598
+ }, CSS_LENGTH_TO_PT, bulletInputRegex, orderedInputRegex, Paragraph, Heading, CommentRangeStart, CommentRangeEnd, CommentReference, CommentsMark, toSuperscriptDigits = (value) => {
166537
166599
  const map$22 = {
166538
166600
  0: "⁰",
166539
166601
  1: "¹",
@@ -171321,7 +171383,7 @@ var Node$13 = class Node$14 {
171321
171383
  trackedChanges: context.trackedChanges ?? []
171322
171384
  });
171323
171385
  }, _hoisted_1$6, _hoisted_2$1, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
171324
- var init_src_LEL3AcVi_es = __esm(() => {
171386
+ var init_src_DPtHGvLJ_es = __esm(() => {
171325
171387
  init_rolldown_runtime_B2q5OVn9_es();
171326
171388
  init_SuperConverter_DgeVIA0v_es();
171327
171389
  init_jszip_ChlR43oI_es();
@@ -193838,6 +193900,13 @@ function print() { __p += __j.call(arguments, '') }
193838
193900
  }
193839
193901
  });
193840
193902
  nodeViewMap = /* @__PURE__ */ new WeakMap;
193903
+ CSS_LENGTH_TO_PT = {
193904
+ pt: 1,
193905
+ px: 72 / 96,
193906
+ in: 72,
193907
+ cm: 28.3465,
193908
+ mm: 2.83465
193909
+ };
193841
193910
  bulletInputRegex = /^\s*([-+*])\s$/;
193842
193911
  orderedInputRegex = /^(\d+)\.\s$/;
193843
193912
  Paragraph = OxmlNode.create({
@@ -202049,8 +202118,8 @@ function print() { __p += __j.call(arguments, '') }
202049
202118
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
202050
202119
  };
202051
202120
  stubFalse_default = stubFalse;
202052
- freeExports$2 = typeof exports_src_LEL3AcVi_es == "object" && exports_src_LEL3AcVi_es && !exports_src_LEL3AcVi_es.nodeType && exports_src_LEL3AcVi_es;
202053
- freeModule$2 = freeExports$2 && typeof module_src_LEL3AcVi_es == "object" && module_src_LEL3AcVi_es && !module_src_LEL3AcVi_es.nodeType && module_src_LEL3AcVi_es;
202121
+ freeExports$2 = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202122
+ freeModule$2 = freeExports$2 && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202054
202123
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
202055
202124
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
202056
202125
  typedArrayTags = {};
@@ -202058,8 +202127,8 @@ function print() { __p += __j.call(arguments, '') }
202058
202127
  typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
202059
202128
  _baseIsTypedArray_default = baseIsTypedArray;
202060
202129
  _baseUnary_default = baseUnary;
202061
- freeExports$1 = typeof exports_src_LEL3AcVi_es == "object" && exports_src_LEL3AcVi_es && !exports_src_LEL3AcVi_es.nodeType && exports_src_LEL3AcVi_es;
202062
- freeModule$1 = freeExports$1 && typeof module_src_LEL3AcVi_es == "object" && module_src_LEL3AcVi_es && !module_src_LEL3AcVi_es.nodeType && module_src_LEL3AcVi_es;
202130
+ freeExports$1 = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202131
+ freeModule$1 = freeExports$1 && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202063
202132
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
202064
202133
  _nodeUtil_default = function() {
202065
202134
  try {
@@ -202164,8 +202233,8 @@ function print() { __p += __j.call(arguments, '') }
202164
202233
  Stack.prototype.has = _stackHas_default;
202165
202234
  Stack.prototype.set = _stackSet_default;
202166
202235
  _Stack_default = Stack;
202167
- freeExports = typeof exports_src_LEL3AcVi_es == "object" && exports_src_LEL3AcVi_es && !exports_src_LEL3AcVi_es.nodeType && exports_src_LEL3AcVi_es;
202168
- freeModule = freeExports && typeof module_src_LEL3AcVi_es == "object" && module_src_LEL3AcVi_es && !module_src_LEL3AcVi_es.nodeType && module_src_LEL3AcVi_es;
202236
+ freeExports = typeof exports_src_DPtHGvLJ_es == "object" && exports_src_DPtHGvLJ_es && !exports_src_DPtHGvLJ_es.nodeType && exports_src_DPtHGvLJ_es;
202237
+ freeModule = freeExports && typeof module_src_DPtHGvLJ_es == "object" && module_src_DPtHGvLJ_es && !module_src_DPtHGvLJ_es.nodeType && module_src_DPtHGvLJ_es;
202169
202238
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
202170
202239
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
202171
202240
  _cloneBuffer_default = cloneBuffer;
@@ -209817,7 +209886,7 @@ var init_zipper_Cnk_HjM2_es = __esm(() => {
209817
209886
 
209818
209887
  // ../../packages/superdoc/dist/super-editor.es.js
209819
209888
  var init_super_editor_es = __esm(() => {
209820
- init_src_LEL3AcVi_es();
209889
+ init_src_DPtHGvLJ_es();
209821
209890
  init_SuperConverter_DgeVIA0v_es();
209822
209891
  init_jszip_ChlR43oI_es();
209823
209892
  init_xml_js_DLE8mr0n_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.2.0-next.26",
3
+ "version": "0.2.0-next.27",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -19,9 +19,9 @@
19
19
  "@types/bun": "^1.3.8",
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
+ "@superdoc/document-api": "0.0.1",
22
23
  "@superdoc/pm-adapter": "0.0.0",
23
24
  "superdoc": "1.16.0",
24
- "@superdoc/document-api": "0.0.1",
25
25
  "@superdoc/super-editor": "0.0.1"
26
26
  },
27
27
  "module": "src/index.ts",
@@ -29,11 +29,11 @@
29
29
  "access": "public"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.26",
33
- "@superdoc-dev/cli-darwin-x64": "0.2.0-next.26",
34
- "@superdoc-dev/cli-linux-x64": "0.2.0-next.26",
35
- "@superdoc-dev/cli-linux-arm64": "0.2.0-next.26",
36
- "@superdoc-dev/cli-windows-x64": "0.2.0-next.26"
32
+ "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.27",
33
+ "@superdoc-dev/cli-darwin-x64": "0.2.0-next.27",
34
+ "@superdoc-dev/cli-linux-x64": "0.2.0-next.27",
35
+ "@superdoc-dev/cli-linux-arm64": "0.2.0-next.27",
36
+ "@superdoc-dev/cli-windows-x64": "0.2.0-next.27"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "bun run src/index.ts",