@superdoc-dev/cli 0.2.0-next.14 → 0.2.0-next.16

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 +65 -47
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -89645,9 +89645,9 @@ var init_remark_gfm_RDxetNVS_es = __esm(() => {
89645
89645
  emptyOptions4 = {};
89646
89646
  });
89647
89647
 
89648
- // ../../packages/superdoc/dist/chunks/src-DYg19ynW.es.js
89649
- var exports_src_DYg19ynW_es = {};
89650
- __export(exports_src_DYg19ynW_es, {
89648
+ // ../../packages/superdoc/dist/chunks/src-CwzSv_0N.es.js
89649
+ var exports_src_CwzSv_0N_es = {};
89650
+ __export(exports_src_CwzSv_0N_es, {
89651
89651
  zt: () => defineMark,
89652
89652
  z: () => cM,
89653
89653
  yt: () => removeAwarenessStates,
@@ -137655,7 +137655,21 @@ var Node$13 = class Node$14 {
137655
137655
  () => commands$1.joinForward(),
137656
137656
  () => commands$1.selectNodeForward()
137657
137657
  ]);
137658
- }, Keymap, Editable, EditorFocus, PositionTrackerExtension, global$2, browser2, process$2, cachedSetTimeout2, cachedClearTimeout2, queue3, draining2 = false, currentQueue2, queueIndex2 = -1, browserExports2, process$1$1, EventEmitter$1 = class {
137658
+ }, Keymap, handleBackwardReplaceInsertText = (view, event) => {
137659
+ const isInsertTextInput = event?.inputType === "insertText";
137660
+ const hasTextData = typeof event?.data === "string" && event.data.length > 0;
137661
+ const hasNonEmptySelection = !view.state.selection.empty;
137662
+ if (!isInsertTextInput || !hasTextData || !hasNonEmptySelection)
137663
+ return false;
137664
+ const selection = view.state.selection;
137665
+ if (!((selection.anchor ?? selection.from) > (selection.head ?? selection.to)))
137666
+ return false;
137667
+ const tr = view.state.tr.insertText(event.data, selection.from, selection.to);
137668
+ tr.setMeta("inputType", "insertText");
137669
+ view.dispatch(tr);
137670
+ event.preventDefault();
137671
+ return true;
137672
+ }, Editable, EditorFocus, PositionTrackerExtension, global$2, browser2, process$2, cachedSetTimeout2, cachedClearTimeout2, queue3, draining2 = false, currentQueue2, queueIndex2 = -1, browserExports2, process$1$1, EventEmitter$1 = class {
137659
137673
  #events = /* @__PURE__ */ new Map;
137660
137674
  on(name, fn) {
137661
137675
  const callbacks$1 = this.#events.get(name);
@@ -138723,43 +138737,36 @@ var Node$13 = class Node$14 {
138723
138737
  const { before = [], after = [] } = attrs;
138724
138738
  const beforeTypes = new Set(before.map((mark2) => mark2.type));
138725
138739
  const afterTypes = new Set(after.map((mark2) => mark2.type));
138726
- const added = [...afterTypes].filter((type) => !beforeTypes.has(type));
138727
- const removed = [...beforeTypes].filter((type) => !afterTypes.has(type));
138728
- const messages = [];
138729
- const nonTextStyleAdded = added.filter((type) => !["textStyle", "commentMark"].includes(type));
138730
- if (nonTextStyleAdded.length)
138731
- messages.push(`Added formatting: ${nonTextStyleAdded.join(", ")}`);
138732
- const nonTextStyleRemoved = removed.filter((type) => !["textStyle", "commentMark"].includes(type));
138733
- if (nonTextStyleRemoved.length)
138734
- messages.push(`Removed formatting: ${nonTextStyleRemoved.join(", ")}`);
138740
+ const ignore2 = new Set(["textStyle", "commentMark"]);
138741
+ const parts = [];
138742
+ const added = [...afterTypes].filter((t) => !beforeTypes.has(t) && !ignore2.has(t));
138743
+ for (const type of added)
138744
+ parts.push(type);
138745
+ const removed = [...beforeTypes].filter((t) => !afterTypes.has(t) && !ignore2.has(t));
138746
+ for (const type of removed)
138747
+ parts.push(`removed ${type}`);
138735
138748
  const beforeTextStyle = before.find((mark2) => mark2.type === "textStyle")?.attrs || {};
138736
138749
  const afterTextStyle = after.find((mark2) => mark2.type === "textStyle")?.attrs || {};
138737
- const textStyleChanges = [];
138738
138750
  const formatAttrName = (attr) => attr.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase();
138739
- Object.keys({
138751
+ for (const attr of Object.keys({
138740
138752
  ...beforeTextStyle,
138741
138753
  ...afterTextStyle
138742
- }).forEach((attr) => {
138743
- const beforeValue = beforeTextStyle[attr];
138744
- const afterValue = afterTextStyle[attr];
138745
- if (beforeValue !== afterValue)
138746
- if (afterValue === null)
138747
- return;
138748
- else if (attr === "color")
138749
- textStyleChanges.push(`Changed color`);
138750
- else {
138751
- const label = formatAttrName(attr);
138752
- if (beforeValue === undefined || beforeValue === null)
138753
- textStyleChanges.push(`Set ${label} to ${afterValue}`);
138754
- else if (afterValue === undefined || afterValue === null)
138755
- textStyleChanges.push(`Removed ${label} (was ${beforeValue})`);
138756
- else
138757
- textStyleChanges.push(`Changed ${label} from ${beforeValue} to ${afterValue}`);
138758
- }
138759
- });
138760
- if (textStyleChanges.length)
138761
- messages.push(`Modified text style: ${textStyleChanges.join(", ")}`);
138762
- return messages.length ? messages.join(". ") : "No formatting changes.";
138754
+ })) {
138755
+ const beforeVal = beforeTextStyle[attr];
138756
+ const afterVal = afterTextStyle[attr];
138757
+ if (beforeVal === afterVal || afterVal === null)
138758
+ continue;
138759
+ const label = formatAttrName(attr);
138760
+ if (attr === "color")
138761
+ parts.push("color");
138762
+ else if (beforeVal === undefined || beforeVal === null)
138763
+ parts.push(`${label} ${afterVal}`);
138764
+ else if (afterVal === undefined)
138765
+ parts.push(`removed ${label}`);
138766
+ else
138767
+ parts.push(`${label} ${afterVal}`);
138768
+ }
138769
+ return parts.length ? parts.join(", ") : "formatting";
138763
138770
  }, DEFAULT_ACTIVE_ALPHA, DEFAULT_INACTIVE_ALPHA, clampOpacity = (value) => {
138764
138771
  if (!Number.isFinite(value))
138765
138772
  return null;
@@ -142317,11 +142324,20 @@ var Node$13 = class Node$14 {
142317
142324
  }
142318
142325
 
142319
142326
  .superdoc-layout .track-insert-dec.highlighted.track-change-focused {
142327
+ border-style: solid;
142320
142328
  border-width: 2px;
142329
+ background-color: #399c7244;
142321
142330
  }
142322
142331
 
142323
142332
  .superdoc-layout .track-delete-dec.highlighted.track-change-focused {
142333
+ border-style: solid;
142324
142334
  border-width: 2px;
142335
+ background-color: #cb0e4744;
142336
+ }
142337
+
142338
+ .superdoc-layout .track-format-dec.highlighted.track-change-focused {
142339
+ border-bottom-width: 3px;
142340
+ background-color: #ffd70033;
142325
142341
  }
142326
142342
  `, SDT_CONTAINER_STYLES = `
142327
142343
  /* Document Section - Block-level container with gray border and hover tooltip */
@@ -144326,7 +144342,7 @@ var Node$13 = class Node$14 {
144326
144342
  if ("underline" in run2 && run2.underline && typeof run2.underline === "object")
144327
144343
  return run2.underline.color ?? "";
144328
144344
  return "";
144329
- }, LIST_MARKER_GAP = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, COMMENT_EXTERNAL_COLOR = "#B1124B", COMMENT_INTERNAL_COLOR = "#078383", COMMENT_INACTIVE_ALPHA = "40", COMMENT_ACTIVE_ALPHA = "66", LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_FOCUSED_CLASS = "track-change-focused", TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor = (value) => {
144345
+ }, LIST_MARKER_GAP = 8, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, COMMENT_EXTERNAL_COLOR = "#B1124B", COMMENT_INTERNAL_COLOR = "#078383", COMMENT_INACTIVE_ALPHA = "40", COMMENT_ACTIVE_ALPHA = "66", COMMENT_FADED_ALPHA = "20", LINK_DATASET_KEYS, MAX_HREF_LENGTH = 2048, SAFE_ANCHOR_PATTERN, MAX_DATA_URL_LENGTH, VALID_IMAGE_DATA_URL, MAX_RESIZE_MULTIPLIER = 3, FALLBACK_MAX_DIMENSION = 1000, MIN_IMAGE_DIMENSION = 20, AMBIGUOUS_LINK_PATTERNS, linkMetrics, TRACK_CHANGE_BASE_CLASS, TRACK_CHANGE_FOCUSED_CLASS = "track-change-focused", TRACK_CHANGE_MODIFIER_CLASS, LINK_TARGET_SET, normalizeAnchor = (value) => {
144330
144346
  if (typeof value !== "string")
144331
144347
  return null;
144332
144348
  const trimmed = value.trim();
@@ -144935,7 +144951,7 @@ var Node$13 = class Node$14 {
144935
144951
  hasNestedComments: nestedComments.length > 0
144936
144952
  };
144937
144953
  }
144938
- return {};
144954
+ return { color: `${comments[0].internal ? COMMENT_INTERNAL_COLOR : COMMENT_EXTERNAL_COLOR}${COMMENT_FADED_ALPHA}` };
144939
144955
  }
144940
144956
  return { color: `${comments[0].internal ? COMMENT_INTERNAL_COLOR : COMMENT_EXTERNAL_COLOR}${COMMENT_INACTIVE_ALPHA}` };
144941
144957
  }, applyRunDataAttributes = (element3, dataAttrs) => {
@@ -158786,7 +158802,7 @@ var Node$13 = class Node$14 {
158786
158802
  trackedChanges: context.trackedChanges ?? []
158787
158803
  });
158788
158804
  }, _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;
158789
- var init_src_DYg19ynW_es = __esm(() => {
158805
+ var init_src_CwzSv_0N_es = __esm(() => {
158790
158806
  init_rolldown_runtime_B2q5OVn9_es();
158791
158807
  init_SuperConverter_DR7gPmcP_es();
158792
158808
  init_jszip_ChlR43oI_es();
@@ -160964,11 +160980,13 @@ ${err.toString()}`);
160964
160980
  props: {
160965
160981
  editable: () => editor.options.editable,
160966
160982
  handleDOMEvents: {
160967
- beforeinput: (_view, event) => {
160983
+ beforeinput: (view, event) => {
160968
160984
  if (!editor.options.editable) {
160969
160985
  event.preventDefault();
160970
160986
  return true;
160971
160987
  }
160988
+ if (handleBackwardReplaceInsertText(view, event))
160989
+ return true;
160972
160990
  return false;
160973
160991
  },
160974
160992
  mousedown: (_view, event) => {
@@ -192182,8 +192200,8 @@ function print() { __p += __j.call(arguments, '') }
192182
192200
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
192183
192201
  };
192184
192202
  stubFalse_default = stubFalse;
192185
- freeExports$2 = typeof exports_src_DYg19ynW_es == "object" && exports_src_DYg19ynW_es && !exports_src_DYg19ynW_es.nodeType && exports_src_DYg19ynW_es;
192186
- freeModule$2 = freeExports$2 && typeof module_src_DYg19ynW_es == "object" && module_src_DYg19ynW_es && !module_src_DYg19ynW_es.nodeType && module_src_DYg19ynW_es;
192203
+ freeExports$2 = typeof exports_src_CwzSv_0N_es == "object" && exports_src_CwzSv_0N_es && !exports_src_CwzSv_0N_es.nodeType && exports_src_CwzSv_0N_es;
192204
+ freeModule$2 = freeExports$2 && typeof module_src_CwzSv_0N_es == "object" && module_src_CwzSv_0N_es && !module_src_CwzSv_0N_es.nodeType && module_src_CwzSv_0N_es;
192187
192205
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
192188
192206
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
192189
192207
  typedArrayTags = {};
@@ -192191,8 +192209,8 @@ function print() { __p += __j.call(arguments, '') }
192191
192209
  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;
192192
192210
  _baseIsTypedArray_default = baseIsTypedArray;
192193
192211
  _baseUnary_default = baseUnary;
192194
- freeExports$1 = typeof exports_src_DYg19ynW_es == "object" && exports_src_DYg19ynW_es && !exports_src_DYg19ynW_es.nodeType && exports_src_DYg19ynW_es;
192195
- freeModule$1 = freeExports$1 && typeof module_src_DYg19ynW_es == "object" && module_src_DYg19ynW_es && !module_src_DYg19ynW_es.nodeType && module_src_DYg19ynW_es;
192212
+ freeExports$1 = typeof exports_src_CwzSv_0N_es == "object" && exports_src_CwzSv_0N_es && !exports_src_CwzSv_0N_es.nodeType && exports_src_CwzSv_0N_es;
192213
+ freeModule$1 = freeExports$1 && typeof module_src_CwzSv_0N_es == "object" && module_src_CwzSv_0N_es && !module_src_CwzSv_0N_es.nodeType && module_src_CwzSv_0N_es;
192196
192214
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
192197
192215
  _nodeUtil_default = function() {
192198
192216
  try {
@@ -192297,8 +192315,8 @@ function print() { __p += __j.call(arguments, '') }
192297
192315
  Stack.prototype.has = _stackHas_default;
192298
192316
  Stack.prototype.set = _stackSet_default;
192299
192317
  _Stack_default = Stack;
192300
- freeExports = typeof exports_src_DYg19ynW_es == "object" && exports_src_DYg19ynW_es && !exports_src_DYg19ynW_es.nodeType && exports_src_DYg19ynW_es;
192301
- freeModule = freeExports && typeof module_src_DYg19ynW_es == "object" && module_src_DYg19ynW_es && !module_src_DYg19ynW_es.nodeType && module_src_DYg19ynW_es;
192318
+ freeExports = typeof exports_src_CwzSv_0N_es == "object" && exports_src_CwzSv_0N_es && !exports_src_CwzSv_0N_es.nodeType && exports_src_CwzSv_0N_es;
192319
+ freeModule = freeExports && typeof module_src_CwzSv_0N_es == "object" && module_src_CwzSv_0N_es && !module_src_CwzSv_0N_es.nodeType && module_src_CwzSv_0N_es;
192302
192320
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
192303
192321
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
192304
192322
  _cloneBuffer_default = cloneBuffer;
@@ -199950,7 +199968,7 @@ var init_zipper_BJHqrQMq_es = __esm(() => {
199950
199968
 
199951
199969
  // ../../packages/superdoc/dist/super-editor.es.js
199952
199970
  var init_super_editor_es = __esm(() => {
199953
- init_src_DYg19ynW_es();
199971
+ init_src_CwzSv_0N_es();
199954
199972
  init_SuperConverter_DR7gPmcP_es();
199955
199973
  init_jszip_ChlR43oI_es();
199956
199974
  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.14",
3
+ "version": "0.2.0-next.16",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -28,11 +28,11 @@
28
28
  "access": "public"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.14",
32
- "@superdoc-dev/cli-darwin-x64": "0.2.0-next.14",
33
- "@superdoc-dev/cli-linux-arm64": "0.2.0-next.14",
34
- "@superdoc-dev/cli-windows-x64": "0.2.0-next.14",
35
- "@superdoc-dev/cli-linux-x64": "0.2.0-next.14"
31
+ "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.16",
32
+ "@superdoc-dev/cli-darwin-x64": "0.2.0-next.16",
33
+ "@superdoc-dev/cli-linux-x64": "0.2.0-next.16",
34
+ "@superdoc-dev/cli-linux-arm64": "0.2.0-next.16",
35
+ "@superdoc-dev/cli-windows-x64": "0.2.0-next.16"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "bun run src/index.ts",