@superdoc-dev/cli 0.5.0-next.72 → 0.5.0-next.74

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 +62 -19
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -204645,7 +204645,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
204645
204645
  init_remark_gfm_BhnWr3yf_es();
204646
204646
  });
204647
204647
 
204648
- // ../../packages/superdoc/dist/chunks/src-CDzC82e6.es.js
204648
+ // ../../packages/superdoc/dist/chunks/src-IKYgt0gJ.es.js
204649
204649
  function deleteProps(obj, propOrProps) {
204650
204650
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
204651
204651
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -245429,6 +245429,12 @@ function forceNormalMathVariant(root3) {
245429
245429
  identifier.setAttribute("mathvariant", "normal");
245430
245430
  });
245431
245431
  }
245432
+ function getDelimiterValue(properties, name, fallback) {
245433
+ const property = properties?.elements?.find((element3) => element3.name === name);
245434
+ if (!property)
245435
+ return fallback;
245436
+ return property.attributes?.["m:val"] ?? "";
245437
+ }
245432
245438
  function convertChildNodes(children, doc$12) {
245433
245439
  const fragment2 = doc$12.createDocumentFragment();
245434
245440
  for (const child of children) {
@@ -257489,6 +257495,9 @@ function getCommentHighlightThreadIds(target) {
257489
257495
  return [];
257490
257496
  return threadIds.split(",").map((threadId) => threadId.trim()).filter(Boolean);
257491
257497
  }
257498
+ function isDirectSingleCommentHighlightHit(target) {
257499
+ return getCommentHighlightThreadIds(target).length === 1;
257500
+ }
257492
257501
  function resolveTrackChangeThreadId(target) {
257493
257502
  if (!(target instanceof Element))
257494
257503
  return null;
@@ -257561,6 +257570,8 @@ function getActiveCommentThreadId(editor) {
257561
257570
  function shouldIgnoreRepeatClickOnActiveComment(target, clientX, clientY, activeThreadId) {
257562
257571
  if (!activeThreadId)
257563
257572
  return false;
257573
+ if (isDirectSingleCommentHighlightHit(target))
257574
+ return false;
257564
257575
  return resolveCommentThreadIdNearPointer(target, clientX, clientY) === activeThreadId;
257565
257576
  }
257566
257577
  function isInRegisteredSurface(event) {
@@ -277125,7 +277136,7 @@ var Node$13 = class Node$14 {
277125
277136
  }
277126
277137
  element3.style.textAlign = resolveTextAlign(attrs?.alignment, rtl);
277127
277138
  return rtl;
277128
- }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$8 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, convertMathRun = (node3, doc$12) => {
277139
+ }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$9 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, convertMathRun = (node3, doc$12) => {
277129
277140
  const elements = node3.elements ?? [];
277130
277141
  let text5 = "";
277131
277142
  for (const child of elements)
@@ -277139,57 +277150,87 @@ var Node$13 = class Node$14 {
277139
277150
  return null;
277140
277151
  const isNormalText = elements.find((el$1) => el$1.name === "m:rPr")?.elements?.some((el$1) => el$1.name === "m:nor") ?? false;
277141
277152
  const tag = classifyMathText(text5);
277142
- const el = doc$12.createElementNS(MATHML_NS$8, tag);
277153
+ const el = doc$12.createElementNS(MATHML_NS$9, tag);
277143
277154
  el.textContent = text5;
277144
277155
  if (tag === "mi" && isNormalText)
277145
277156
  el.setAttribute("mathvariant", "normal");
277146
277157
  return el;
277147
- }, MATHML_NS$7 = "http://www.w3.org/1998/Math/MathML", convertFraction = (node3, doc$12, convertChildren) => {
277158
+ }, MATHML_NS$8 = "http://www.w3.org/1998/Math/MathML", convertFraction = (node3, doc$12, convertChildren) => {
277148
277159
  const elements = node3.elements ?? [];
277149
277160
  const num = elements.find((e) => e.name === "m:num");
277150
277161
  const den = elements.find((e) => e.name === "m:den");
277151
- const frac = doc$12.createElementNS(MATHML_NS$7, "mfrac");
277152
- const numRow = doc$12.createElementNS(MATHML_NS$7, "mrow");
277162
+ const frac = doc$12.createElementNS(MATHML_NS$8, "mfrac");
277163
+ const numRow = doc$12.createElementNS(MATHML_NS$8, "mrow");
277153
277164
  numRow.appendChild(convertChildren(num?.elements ?? []));
277154
277165
  frac.appendChild(numRow);
277155
- const denRow = doc$12.createElementNS(MATHML_NS$7, "mrow");
277166
+ const denRow = doc$12.createElementNS(MATHML_NS$8, "mrow");
277156
277167
  denRow.appendChild(convertChildren(den?.elements ?? []));
277157
277168
  frac.appendChild(denRow);
277158
277169
  return frac;
277159
- }, MATHML_NS$6 = "http://www.w3.org/1998/Math/MathML", convertBar = (node3, doc$12, convertChildren) => {
277170
+ }, MATHML_NS$7 = "http://www.w3.org/1998/Math/MathML", convertBar = (node3, doc$12, convertChildren) => {
277160
277171
  const elements = node3.elements ?? [];
277161
277172
  const isUnder = elements.find((e) => e.name === "m:barPr")?.elements?.find((e) => e.name === "m:pos")?.attributes?.["m:val"] !== "top";
277162
277173
  const base5 = elements.find((e) => e.name === "m:e");
277163
- const wrapper = doc$12.createElementNS(MATHML_NS$6, isUnder ? "munder" : "mover");
277174
+ const wrapper = doc$12.createElementNS(MATHML_NS$7, isUnder ? "munder" : "mover");
277164
277175
  const baseContent = convertChildren(base5?.elements ?? []);
277165
- const mrow = doc$12.createElementNS(MATHML_NS$6, "mrow");
277176
+ const mrow = doc$12.createElementNS(MATHML_NS$7, "mrow");
277166
277177
  mrow.appendChild(baseContent);
277167
277178
  wrapper.appendChild(mrow);
277168
- const accent = doc$12.createElementNS(MATHML_NS$6, "mo");
277179
+ const accent = doc$12.createElementNS(MATHML_NS$7, "mo");
277169
277180
  accent.setAttribute("stretchy", "true");
277170
277181
  accent.textContent = "‾";
277171
277182
  wrapper.appendChild(accent);
277172
277183
  return wrapper;
277173
- }, MATHML_NS$5 = "http://www.w3.org/1998/Math/MathML", FUNCTION_APPLY_OPERATOR = "⁡", convertFunction = (node3, doc$12, convertChildren) => {
277184
+ }, MATHML_NS$6 = "http://www.w3.org/1998/Math/MathML", FUNCTION_APPLY_OPERATOR = "⁡", convertFunction = (node3, doc$12, convertChildren) => {
277174
277185
  const elements = node3.elements ?? [];
277175
277186
  const functionName = elements.find((element3) => element3.name === "m:fName");
277176
277187
  const argument = elements.find((element3) => element3.name === "m:e");
277177
- const wrapper = doc$12.createElementNS(MATHML_NS$5, "mrow");
277178
- const functionNameRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
277188
+ const wrapper = doc$12.createElementNS(MATHML_NS$6, "mrow");
277189
+ const functionNameRow = doc$12.createElementNS(MATHML_NS$6, "mrow");
277179
277190
  functionNameRow.appendChild(convertChildren(functionName?.elements ?? []));
277180
277191
  forceNormalMathVariant(functionNameRow);
277181
277192
  if (functionNameRow.childNodes.length > 0)
277182
277193
  wrapper.appendChild(functionNameRow);
277183
- const argumentRow = doc$12.createElementNS(MATHML_NS$5, "mrow");
277194
+ const argumentRow = doc$12.createElementNS(MATHML_NS$6, "mrow");
277184
277195
  argumentRow.appendChild(convertChildren(argument?.elements ?? []));
277185
277196
  if (functionNameRow.childNodes.length > 0 && argumentRow.childNodes.length > 0) {
277186
- const applyOperator = doc$12.createElementNS(MATHML_NS$5, "mo");
277197
+ const applyOperator = doc$12.createElementNS(MATHML_NS$6, "mo");
277187
277198
  applyOperator.textContent = FUNCTION_APPLY_OPERATOR;
277188
277199
  wrapper.appendChild(applyOperator);
277189
277200
  }
277190
277201
  if (argumentRow.childNodes.length > 0)
277191
277202
  wrapper.appendChild(argumentRow);
277192
277203
  return wrapper.childNodes.length > 0 ? wrapper : null;
277204
+ }, MATHML_NS$5 = "http://www.w3.org/1998/Math/MathML", DEFAULT_BEGIN_DELIMITER = "(", DEFAULT_END_DELIMITER = ")", DEFAULT_SEPARATOR_DELIMITER = "│", convertDelimiter = (node3, doc$12, convertChildren) => {
277205
+ const elements = node3.elements ?? [];
277206
+ const delimiterProps = elements.find((element3) => element3.name === "m:dPr");
277207
+ const expressions = elements.filter((element3) => element3.name === "m:e");
277208
+ const beginDelimiter = getDelimiterValue(delimiterProps, "m:begChr", DEFAULT_BEGIN_DELIMITER);
277209
+ const endDelimiter = getDelimiterValue(delimiterProps, "m:endChr", DEFAULT_END_DELIMITER);
277210
+ const separatorDelimiter = getDelimiterValue(delimiterProps, "m:sepChr", DEFAULT_SEPARATOR_DELIMITER);
277211
+ const wrapper = doc$12.createElementNS(MATHML_NS$5, "mrow");
277212
+ const begin = doc$12.createElementNS(MATHML_NS$5, "mo");
277213
+ begin.textContent = beginDelimiter;
277214
+ wrapper.appendChild(begin);
277215
+ let renderedCount = 0;
277216
+ for (const expression of expressions) {
277217
+ const fragment2 = convertChildren(expression?.elements ?? []);
277218
+ if (fragment2.childNodes.length === 0)
277219
+ continue;
277220
+ if (renderedCount > 0) {
277221
+ const separator = doc$12.createElementNS(MATHML_NS$5, "mo");
277222
+ separator.textContent = separatorDelimiter;
277223
+ wrapper.appendChild(separator);
277224
+ }
277225
+ const group = doc$12.createElementNS(MATHML_NS$5, "mrow");
277226
+ group.appendChild(fragment2);
277227
+ wrapper.appendChild(group);
277228
+ renderedCount++;
277229
+ }
277230
+ const end$1 = doc$12.createElementNS(MATHML_NS$5, "mo");
277231
+ end$1.textContent = endDelimiter;
277232
+ wrapper.appendChild(end$1);
277233
+ return wrapper;
277193
277234
  }, MATHML_NS$4 = "http://www.w3.org/1998/Math/MathML", convertSubscript = (node3, doc$12, convertChildren) => {
277194
277235
  const elements = node3.elements ?? [];
277195
277236
  const base5 = elements.find((e) => e.name === "m:e");
@@ -285011,6 +285052,8 @@ var Node$13 = class Node$14 {
285011
285052
  return true;
285012
285053
  }
285013
285054
  #handleSingleCommentHighlightClick(event, target, editor) {
285055
+ if (isDirectSingleCommentHighlightHit(target))
285056
+ return false;
285014
285057
  const clickedThreadId = resolveCommentThreadIdNearPointer(target, event.clientX, event.clientY);
285015
285058
  if (!clickedThreadId)
285016
285059
  return false;
@@ -287353,7 +287396,7 @@ var Node$13 = class Node$14 {
287353
287396
  return;
287354
287397
  console.log(...args$1);
287355
287398
  }, 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;
287356
- var init_src_CDzC82e6_es = __esm(() => {
287399
+ var init_src_IKYgt0gJ_es = __esm(() => {
287357
287400
  init_rolldown_runtime_Bg48TavK_es();
287358
287401
  init_SuperConverter_DKPcCGTm_es();
287359
287402
  init_jszip_C49i9kUs_es();
@@ -313083,6 +313126,7 @@ function print() { __p += __j.call(arguments, '') }
313083
313126
  MATH_OBJECT_REGISTRY = {
313084
313127
  "m:r": convertMathRun,
313085
313128
  "m:bar": convertBar,
313129
+ "m:d": convertDelimiter,
313086
313130
  "m:f": convertFraction,
313087
313131
  "m:func": convertFunction,
313088
313132
  "m:sSub": convertSubscript,
@@ -313091,7 +313135,6 @@ function print() { __p += __j.call(arguments, '') }
313091
313135
  "m:acc": null,
313092
313136
  "m:borderBox": null,
313093
313137
  "m:box": null,
313094
- "m:d": null,
313095
313138
  "m:eqArr": null,
313096
313139
  "m:groupChr": null,
313097
313140
  "m:limLow": null,
@@ -321927,7 +321970,7 @@ var init_zipper_DbkgrypV_es = __esm(() => {
321927
321970
 
321928
321971
  // ../../packages/superdoc/dist/super-editor.es.js
321929
321972
  var init_super_editor_es = __esm(() => {
321930
- init_src_CDzC82e6_es();
321973
+ init_src_IKYgt0gJ_es();
321931
321974
  init_SuperConverter_DKPcCGTm_es();
321932
321975
  init_jszip_C49i9kUs_es();
321933
321976
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.5.0-next.72",
3
+ "version": "0.5.0-next.74",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -34,11 +34,11 @@
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.72",
38
- "@superdoc-dev/cli-darwin-x64": "0.5.0-next.72",
39
- "@superdoc-dev/cli-linux-x64": "0.5.0-next.72",
40
- "@superdoc-dev/cli-windows-x64": "0.5.0-next.72",
41
- "@superdoc-dev/cli-linux-arm64": "0.5.0-next.72"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.5.0-next.74",
38
+ "@superdoc-dev/cli-linux-x64": "0.5.0-next.74",
39
+ "@superdoc-dev/cli-darwin-x64": "0.5.0-next.74",
40
+ "@superdoc-dev/cli-windows-x64": "0.5.0-next.74",
41
+ "@superdoc-dev/cli-linux-arm64": "0.5.0-next.74"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",