@superdoc-dev/cli 0.8.0-next.26 → 0.8.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 +104 -22
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -11565,8 +11565,10 @@ var init_schemas = __esm(() => {
11565
11565
  empty: { type: "boolean" },
11566
11566
  target: { oneOf: [textTargetSchema, { type: "null" }] },
11567
11567
  activeMarks: arraySchema({ type: "string" }),
11568
+ activeCommentIds: arraySchema({ type: "string" }),
11569
+ activeChangeIds: arraySchema({ type: "string" }),
11568
11570
  text: { type: "string" }
11569
- }, ["empty", "target", "activeMarks"])
11571
+ }, ["empty", "target", "activeMarks", "activeCommentIds", "activeChangeIds"])
11570
11572
  },
11571
11573
  "mutations.preview": {
11572
11574
  input: mutationsInputSchema,
@@ -65863,7 +65865,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
65863
65865
  emptyOptions2 = {};
65864
65866
  });
65865
65867
 
65866
- // ../../packages/superdoc/dist/chunks/SuperConverter-CyrStvpz.es.js
65868
+ // ../../packages/superdoc/dist/chunks/SuperConverter-BtMpBQnx.es.js
65867
65869
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
65868
65870
  const fieldValue = extension$1.config[field];
65869
65871
  if (typeof fieldValue === "function")
@@ -118270,7 +118272,7 @@ var isRegExp = (value) => {
118270
118272
  state.kern = kernNode.attributes["w:val"];
118271
118273
  }
118272
118274
  }, SuperConverter;
118273
- var init_SuperConverter_CyrStvpz_es = __esm(() => {
118275
+ var init_SuperConverter_BtMpBQnx_es = __esm(() => {
118274
118276
  init_rolldown_runtime_Bg48TavK_es();
118275
118277
  init_jszip_C49i9kUs_es();
118276
118278
  init_xml_js_CqGKpaft_es();
@@ -131160,11 +131162,15 @@ var init_SuperConverter_CyrStvpz_es = __esm(() => {
131160
131162
  empty: { type: "boolean" },
131161
131163
  target: { oneOf: [textTargetSchema2, { type: "null" }] },
131162
131164
  activeMarks: arraySchema2({ type: "string" }),
131165
+ activeCommentIds: arraySchema2({ type: "string" }),
131166
+ activeChangeIds: arraySchema2({ type: "string" }),
131163
131167
  text: { type: "string" }
131164
131168
  }, [
131165
131169
  "empty",
131166
131170
  "target",
131167
- "activeMarks"
131171
+ "activeMarks",
131172
+ "activeCommentIds",
131173
+ "activeChangeIds"
131168
131174
  ])
131169
131175
  },
131170
131176
  "mutations.preview": {
@@ -155869,7 +155875,7 @@ var init_SuperConverter_CyrStvpz_es = __esm(() => {
155869
155875
  };
155870
155876
  });
155871
155877
 
155872
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-JcG-eLAZ.es.js
155878
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-FOTAKCop.es.js
155873
155879
  function parseSizeUnit(val = "0") {
155874
155880
  const length3 = val.toString() || "0";
155875
155881
  const value = Number.parseFloat(length3);
@@ -158491,8 +158497,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
158491
158497
  }
158492
158498
  };
158493
158499
  };
158494
- var init_create_headless_toolbar_JcG_eLAZ_es = __esm(() => {
158495
- init_SuperConverter_CyrStvpz_es();
158500
+ var init_create_headless_toolbar_FOTAKCop_es = __esm(() => {
158501
+ init_SuperConverter_BtMpBQnx_es();
158496
158502
  init_constants_DrU4EASo_es();
158497
158503
  init_dist_B8HfvhaK_es();
158498
158504
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -207179,7 +207185,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
207179
207185
  init_remark_gfm_BhnWr3yf_es();
207180
207186
  });
207181
207187
 
207182
- // ../../packages/superdoc/dist/chunks/src-4pRutOwm.es.js
207188
+ // ../../packages/superdoc/dist/chunks/src-XFPz5mDi.es.js
207183
207189
  function deleteProps(obj, propOrProps) {
207184
207190
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
207185
207191
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -216088,7 +216094,7 @@ function getMarksDiff(marksA = [], marksB = []) {
216088
216094
  if (!attrs)
216089
216095
  return {};
216090
216096
  const ignoredMarkKeys = /* @__PURE__ */ new Set;
216091
- if (TRACK_CHANGE_MARK_NAMES.has(markName))
216097
+ if (TRACK_CHANGE_MARK_NAMES$1.has(markName))
216092
216098
  for (const key2 of TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS)
216093
216099
  ignoredMarkKeys.add(key2);
216094
216100
  const normalized = {};
@@ -234216,14 +234222,21 @@ function resolveCurrentSelectionInfo(editor, input2) {
234216
234222
  return {
234217
234223
  empty: true,
234218
234224
  target: null,
234219
- activeMarks: []
234225
+ activeMarks: [],
234226
+ activeCommentIds: [],
234227
+ activeChangeIds: []
234220
234228
  };
234221
234229
  const { from: from$1, to, empty: empty$1 } = state.selection;
234222
234230
  const segments = collectTextSegments(state.doc, from$1, to);
234231
+ const target = segments && segments.length > 0 ? buildTextTarget(segments) : null;
234232
+ const activeMarks = collectActiveMarks(state, from$1, to);
234233
+ const { commentIds: activeCommentIds, changeIds: activeChangeRawIds } = collectActiveEntityIds(state, from$1, to);
234223
234234
  const info = {
234224
234235
  empty: empty$1,
234225
- target: segments && segments.length > 0 ? buildTextTarget(segments) : null,
234226
- activeMarks: collectActiveMarks(state, from$1, to)
234236
+ target,
234237
+ activeMarks,
234238
+ activeCommentIds,
234239
+ activeChangeIds: mapRawChangeIdsToCanonical(editor, activeChangeRawIds)
234227
234240
  };
234228
234241
  if (input2.includeText && !empty$1)
234229
234242
  info.text = state.doc.textBetween(from$1, to, " ");
@@ -234272,6 +234285,68 @@ function readBlockId(node3) {
234272
234285
  const id2 = attrs.sdBlockId ?? attrs.id ?? attrs.blockId;
234273
234286
  return typeof id2 === "string" && id2.length > 0 ? id2 : null;
234274
234287
  }
234288
+ function mapRawChangeIdsToCanonical(editor, rawIds) {
234289
+ if (rawIds.length === 0)
234290
+ return rawIds;
234291
+ let grouped;
234292
+ try {
234293
+ grouped = groupTrackedChanges(editor);
234294
+ } catch {
234295
+ return [];
234296
+ }
234297
+ const rawToCanonical = /* @__PURE__ */ new Map;
234298
+ for (const change of grouped)
234299
+ rawToCanonical.set(change.rawId, change.id);
234300
+ const seen = /* @__PURE__ */ new Set;
234301
+ const out = [];
234302
+ for (const raw of rawIds) {
234303
+ const canonical = rawToCanonical.get(raw);
234304
+ if (!canonical)
234305
+ continue;
234306
+ if (seen.has(canonical))
234307
+ continue;
234308
+ seen.add(canonical);
234309
+ out.push(canonical);
234310
+ }
234311
+ return out;
234312
+ }
234313
+ function collectActiveEntityIds(state, from$1, to) {
234314
+ const commentIds = /* @__PURE__ */ new Set;
234315
+ const changeIds = /* @__PURE__ */ new Set;
234316
+ const collectFromMark = (markType, attrs) => {
234317
+ if (markType === COMMENT_MARK_NAME2) {
234318
+ const id2 = resolveCommentIdFromAttrs(attrs ?? {});
234319
+ if (typeof id2 === "string" && id2.length > 0)
234320
+ commentIds.add(id2);
234321
+ } else if (TRACK_CHANGE_MARK_NAMES.has(markType)) {
234322
+ const id2 = attrs?.id;
234323
+ if (typeof id2 === "string" && id2.length > 0)
234324
+ changeIds.add(id2);
234325
+ }
234326
+ };
234327
+ if (from$1 === to) {
234328
+ if (state.storedMarks)
234329
+ for (const mark2 of state.storedMarks)
234330
+ collectFromMark(mark2.type.name, mark2.attrs);
234331
+ const $pos = state.doc.resolve(from$1);
234332
+ for (const mark2 of $pos.marks())
234333
+ collectFromMark(mark2.type.name, mark2.attrs);
234334
+ } else
234335
+ state.doc.nodesBetween(from$1, to, (node3, pos) => {
234336
+ if (!node3.isText)
234337
+ return true;
234338
+ const start$1 = Math.max(pos, from$1);
234339
+ if (Math.min(pos + node3.nodeSize, to) <= start$1)
234340
+ return false;
234341
+ for (const mark2 of node3.marks)
234342
+ collectFromMark(mark2.type.name, mark2.attrs);
234343
+ return false;
234344
+ });
234345
+ return {
234346
+ commentIds: Array.from(commentIds),
234347
+ changeIds: Array.from(changeIds)
234348
+ };
234349
+ }
234275
234350
  function collectActiveMarks(state, from$1, to) {
234276
234351
  const names = /* @__PURE__ */ new Set;
234277
234352
  const stored = state.storedMarks;
@@ -234326,7 +234401,9 @@ function selectionInfoKey(info) {
234326
234401
  else
234327
234402
  targetKey = target.segments.map((s2) => `${s2.blockId}:${s2.range.start}-${s2.range.end}`).join("|");
234328
234403
  const marks = [...info.activeMarks].sort().join(",");
234329
- return `${info.empty ? "1" : "0"}:${targetKey}:${marks}`;
234404
+ const comments = [...info.activeCommentIds].sort().join(",");
234405
+ const changes = [...info.activeChangeIds].sort().join(",");
234406
+ return `${info.empty ? "1" : "0"}:${targetKey}:${marks}:c=${comments}:tc=${changes}`;
234330
234407
  }
234331
234408
  function markTypesPresentEverywhere(doc$12, from$1, to) {
234332
234409
  let common = null;
@@ -277646,7 +277723,7 @@ var Node$13 = class Node$14 {
277646
277723
  id: { default: null },
277647
277724
  edGrp: { default: null },
277648
277725
  displacedByCustomXml: { default: null }
277649
- }), PermEnd, PermEndBlock, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, VOLATILE_PARAGRAPH_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, SLOT_VARIANTS, PART_KINDS, DOCUMENT_RELS_PATH$2 = "word/_rels/document.xml.rels", DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", BODY_RELATIONSHIP_EXCLUSIONS, setNestedValue = (target, path2, value) => {
277726
+ }), PermEnd, PermEndBlock, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES$1, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, VOLATILE_PARAGRAPH_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, SLOT_VARIANTS, PART_KINDS, DOCUMENT_RELS_PATH$2 = "word/_rels/document.xml.rels", DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", BODY_RELATIONSHIP_EXCLUSIONS, setNestedValue = (target, path2, value) => {
277650
277727
  if (!path2.includes(".")) {
277651
277728
  target[path2] = value;
277652
277729
  return;
@@ -280561,7 +280638,7 @@ var Node$13 = class Node$14 {
280561
280638
  listener(snapshot2);
280562
280639
  } catch {}
280563
280640
  }
280564
- }, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
280641
+ }, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, COMMENT_MARK_NAME2 = "commentMark", TRACK_CHANGE_MARK_NAMES, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
280565
280642
  #done = [];
280566
280643
  #redone = [];
280567
280644
  #listeners = /* @__PURE__ */ new Set;
@@ -296258,12 +296335,12 @@ menclose::after {
296258
296335
  return;
296259
296336
  console.log(...args$1);
296260
296337
  }, 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;
296261
- var init_src_4pRutOwm_es = __esm(() => {
296338
+ var init_src_XFPz5mDi_es = __esm(() => {
296262
296339
  init_rolldown_runtime_Bg48TavK_es();
296263
- init_SuperConverter_CyrStvpz_es();
296340
+ init_SuperConverter_BtMpBQnx_es();
296264
296341
  init_jszip_C49i9kUs_es();
296265
296342
  init_uuid_qzgm05fK_es();
296266
- init_create_headless_toolbar_JcG_eLAZ_es();
296343
+ init_create_headless_toolbar_FOTAKCop_es();
296267
296344
  init_constants_DrU4EASo_es();
296268
296345
  init_dist_B8HfvhaK_es();
296269
296346
  init_unified_Dsuw2be5_es();
@@ -314526,7 +314603,7 @@ function print() { __p += __j.call(arguments, '') }
314526
314603
  attributes: sharedAttributes
314527
314604
  });
314528
314605
  IGNORED_ATTRIBUTE_KEYS = new Set(["sdBlockId"]);
314529
- TRACK_CHANGE_MARK_NAMES = new Set([
314606
+ TRACK_CHANGE_MARK_NAMES$1 = new Set([
314530
314607
  "trackInsert",
314531
314608
  "trackDelete",
314532
314609
  "trackFormat"
@@ -319344,6 +319421,11 @@ function print() { __p += __j.call(arguments, '') }
319344
319421
  bullet: "disc"
319345
319422
  };
319346
319423
  EDGE_NODE_TYPES$1 = new Set(SELECTION_EDGE_NODE_TYPES2);
319424
+ TRACK_CHANGE_MARK_NAMES = new Set([
319425
+ "trackInsert",
319426
+ "trackDelete",
319427
+ "trackFormat"
319428
+ ]);
319347
319429
  POINTS_TO_PIXELS = 96 / 72;
319348
319430
  PIXELS_TO_TWIPS = 1440 / 96;
319349
319431
  WORD_DEFAULT_TBL_LOOK = {
@@ -333172,11 +333254,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
333172
333254
 
333173
333255
  // ../../packages/superdoc/dist/super-editor.es.js
333174
333256
  var init_super_editor_es = __esm(() => {
333175
- init_src_4pRutOwm_es();
333176
- init_SuperConverter_CyrStvpz_es();
333257
+ init_src_XFPz5mDi_es();
333258
+ init_SuperConverter_BtMpBQnx_es();
333177
333259
  init_jszip_C49i9kUs_es();
333178
333260
  init_xml_js_CqGKpaft_es();
333179
- init_create_headless_toolbar_JcG_eLAZ_es();
333261
+ init_create_headless_toolbar_FOTAKCop_es();
333180
333262
  init_constants_DrU4EASo_es();
333181
333263
  init_dist_B8HfvhaK_es();
333182
333264
  init_unified_Dsuw2be5_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.8.0-next.26",
3
+ "version": "0.8.0-next.27",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -24,21 +24,21 @@
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": "1.29.0",
30
- "@superdoc/pm-adapter": "0.0.0"
30
+ "superdoc": "1.29.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.26",
38
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.26",
39
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.26",
40
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.26",
41
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.26"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.27",
38
+ "@superdoc-dev/cli-darwin-x64": "0.8.0-next.27",
39
+ "@superdoc-dev/cli-linux-arm64": "0.8.0-next.27",
40
+ "@superdoc-dev/cli-linux-x64": "0.8.0-next.27",
41
+ "@superdoc-dev/cli-windows-x64": "0.8.0-next.27"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",