@superdoc-dev/mcp 0.12.0-next.36 → 0.12.0-next.38

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 +366 -68
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -50479,7 +50479,7 @@ var init_remark_gfm_BUJjZJLy_es = __esm(() => {
50479
50479
  emptyOptions2 = {};
50480
50480
  });
50481
50481
 
50482
- // ../../packages/superdoc/dist/chunks/SuperConverter-Bdmhv7BA.es.js
50482
+ // ../../packages/superdoc/dist/chunks/SuperConverter-DVjSc-AY.es.js
50483
50483
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
50484
50484
  const fieldValue = extension$1.config[field];
50485
50485
  if (typeof fieldValue === "function")
@@ -52051,6 +52051,26 @@ function validateClearDirection(input) {
52051
52051
  assertParagraphTarget(input, "format.paragraph.clearDirection");
52052
52052
  assertNoUnknownFields(input, CLEAR_DIRECTION_KEYS, "format.paragraph.clearDirection");
52053
52053
  }
52054
+ function validateSetNumbering(input) {
52055
+ const op = "format.paragraph.setNumbering";
52056
+ assertParagraphTarget(input, op);
52057
+ assertNoUnknownFields(input, SET_NUMBERING_KEYS, op);
52058
+ const rec = input;
52059
+ if (rec.numId === undefined)
52060
+ throw new DocumentApiValidationError("INVALID_INPUT", `${op} requires a numId field.`);
52061
+ if (typeof rec.numId !== "number" || !Number.isInteger(rec.numId) || rec.numId < 1)
52062
+ throw new DocumentApiValidationError("INVALID_INPUT", `${op} numId must be a positive integer (numId 0 is the no-numbering sentinel). Got ${JSON.stringify(rec.numId)}.`, {
52063
+ field: "numId",
52064
+ value: rec.numId
52065
+ });
52066
+ if (rec.level !== undefined) {
52067
+ if (typeof rec.level !== "number" || !Number.isInteger(rec.level) || rec.level < 0 || rec.level > 8)
52068
+ throw new DocumentApiValidationError("INVALID_INPUT", `${op} level must be an integer 0-8. Got ${JSON.stringify(rec.level)}.`, {
52069
+ field: "level",
52070
+ value: rec.level
52071
+ });
52072
+ }
52073
+ }
52054
52074
  function executeParagraphsSetStyle(adapter, input, options) {
52055
52075
  validateSetStyle(input);
52056
52076
  return adapter.setStyle(input, normalizeMutationOptions(options));
@@ -52148,6 +52168,10 @@ function executeParagraphsClearDirection(adapter, input, options) {
52148
52168
  validateClearDirection(input);
52149
52169
  return adapter.clearDirection(input, normalizeMutationOptions(options));
52150
52170
  }
52171
+ function executeParagraphsSetNumbering(adapter, input, options) {
52172
+ validateSetNumbering(input);
52173
+ return adapter.setNumbering(input, normalizeMutationOptions(options));
52174
+ }
52151
52175
  function getPropertyDefinition(key, channel) {
52152
52176
  return PROPERTY_INDEX.get(`${channel}:${key}`);
52153
52177
  }
@@ -54956,6 +54980,7 @@ function buildDispatchTable(api2) {
54956
54980
  "format.paragraph.setMarkRunProps": (input, options) => api2.format.paragraph.setMarkRunProps(input, options),
54957
54981
  "format.paragraph.setDirection": (input, options) => api2.format.paragraph.setDirection(input, options),
54958
54982
  "format.paragraph.clearDirection": (input, options) => api2.format.paragraph.clearDirection(input, options),
54983
+ "format.paragraph.setNumbering": (input, options) => api2.format.paragraph.setNumbering(input, options),
54959
54984
  "styles.apply": (input, options) => api2.styles.apply(input, options),
54960
54985
  "templates.apply": (input, options) => api2.templates.apply(input, options),
54961
54986
  "create.paragraph": (input, options) => api2.create.paragraph(input, options),
@@ -57958,6 +57983,9 @@ function createDocumentApi(adapters) {
57958
57983
  },
57959
57984
  clearDirection(input, options) {
57960
57985
  return executeParagraphsClearDirection(adapters.paragraphs, input, options);
57986
+ },
57987
+ setNumbering(input, options) {
57988
+ return executeParagraphsSetNumbering(adapters.paragraphs, input, options);
57961
57989
  }
57962
57990
  }
57963
57991
  },
@@ -90857,8 +90885,13 @@ function buildFallbackBlockNodeId(nodeType, pos, path2) {
90857
90885
  }
90858
90886
  function isListItem(attrs) {
90859
90887
  const numbering = attrs?.paragraphProperties?.numberingProperties;
90860
- if (numbering && (numbering.numId != null || numbering.ilvl != null))
90861
- return true;
90888
+ if (numbering) {
90889
+ const numId = toFiniteNumber(numbering.numId);
90890
+ if (numId != null && numId !== 0)
90891
+ return true;
90892
+ if (numId == null && numbering.ilvl != null)
90893
+ return true;
90894
+ }
90862
90895
  const listRendering = attrs?.listRendering;
90863
90896
  if (listRendering?.markerText)
90864
90897
  return true;
@@ -98874,7 +98907,7 @@ var isRegExp = (value) => {
98874
98907
  tracked: false,
98875
98908
  carrier: runAttributeCarrier(runPropertyKey ?? key),
98876
98909
  schema
98877
- }), INLINE_PROPERTY_REGISTRY, INLINE_PROPERTY_KEY_SET, INLINE_PROPERTY_BY_KEY, UNDERLINE_OBJECT_ALLOWED_KEYS, SHADING_ALLOWED_KEYS, BORDER_ALLOWED_KEYS, FIT_TEXT_ALLOWED_KEYS, LANG_ALLOWED_KEYS, RFONTS_ALLOWED_KEYS, EAST_ASIAN_LAYOUT_ALLOWED_KEYS, STYLISTIC_SET_ALLOWED_KEYS, VERT_ALIGN_VALUES, PROPERTY_VALIDATOR_MAP, TABLE_COLOR_PATTERN, PARAGRAPH_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TAB_STOP_LEADERS, BORDER_SIDES, CLEAR_BORDER_SIDES, LINE_RULES, PARAGRAPH_DIRECTIONS, ALIGNMENT_POLICIES, PARAGRAPH_BLOCK_TYPES, SET_STYLE_KEYS, CLEAR_STYLE_KEYS, RESET_DIRECT_FORMATTING_KEYS, SET_ALIGNMENT_KEYS, CLEAR_ALIGNMENT_KEYS, SET_INDENTATION_KEYS, CLEAR_INDENTATION_KEYS, SET_SPACING_KEYS, CLEAR_SPACING_KEYS, SET_KEEP_OPTIONS_KEYS, SET_OUTLINE_LEVEL_KEYS, SET_FLOW_OPTIONS_KEYS, SET_TAB_STOP_KEYS, CLEAR_TAB_STOP_KEYS, CLEAR_ALL_TAB_STOPS_KEYS, SET_BORDER_KEYS, CLEAR_BORDER_KEYS, SET_SHADING_KEYS, CLEAR_SHADING_KEYS, SET_MARK_RUN_PROPS_KEYS, MARK_RUN_PROPS_FIELD_KEYS, MARK_RUN_COLOR_REF_KEYS, MARK_RUN_FONTS_KEYS, MARK_RUN_LANG_KEYS, MARK_RUN_UNDERLINE_KEYS, MARK_RUN_SHADING_KEYS, MARK_RUN_BORDER_KEYS, MARK_RUN_COLOR_MODE_VALUES, MARK_RUN_VERTICAL_ALIGN_VALUES, SET_DIRECTION_KEYS, CLEAR_DIRECTION_KEYS, ST_ON_OFF_ON_VALUES, ST_ON_OFF_OFF_VALUES, ST_UNDERLINE_VALUES, ST_UNDERLINE_VALUE_SET, ST_VERTICAL_ALIGN_RUN, ST_EM, ST_TEXT_ALIGNMENT, ST_TEXT_DIRECTION, ST_TEXTBOX_TIGHT_WRAP, ST_TEXT_TRANSFORM, ST_JUSTIFICATION, FONT_FAMILY_SCHEMA, COLOR_SCHEMA, SPACING_SCHEMA, INDENT_SCHEMA, UNDERLINE_SCHEMA, BORDER_PROPERTIES_SCHEMA, SHADING_SCHEMA, LANG_SCHEMA, EAST_ASIAN_LAYOUT_SCHEMA, FIT_TEXT_SCHEMA, NUMBERING_PROPERTIES_SCHEMA, FRAME_PR_SCHEMA, PARAGRAPH_BORDERS_SCHEMA, TAB_STOP_SCHEMA, PROPERTY_REGISTRY, ALLOWED_KEYS_BY_CHANNEL, PROPERTY_INDEX, EXCLUDED_KEYS, INPUT_ALLOWED_KEYS, TARGET_ALLOWED_KEYS, OPTIONS_ALLOWED_KEYS, VALID_CHANNELS, Z_ORDER_RELATIVE_HEIGHT_MAX = 4294967295, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES, VALID_EDGE_NODE_TYPES, VALID_DOCUMENT_EDGES, VALID_REF_BOUNDARIES, VALID_ANCHOR_KINDS, RESOLVE_RANGE_ALLOWED_KEYS, SELECTION_CURRENT_ALLOWED_KEYS, CREATE_COMMENT_ALLOWED_KEYS, TRACKED_CHANGE_COMMENT_TARGET_ALLOWED_KEYS, TEXT_SEARCH_COMMENT_TARGET_ALLOWED_KEYS, PATCH_COMMENT_ALLOWED_KEYS, STYLE_APPLY_INPUT_ALLOWED_KEYS, INLINE_ALIAS_INPUT_ALLOWED_KEYS, DELETE_INPUT_ALLOWED_KEYS, VALID_BEHAVIORS, CONTENT_KIND_SET, INLINE_KIND_SET, LEGACY_TOP_LEVEL_TYPES, TEXT_INSERT_ALLOWED_KEYS, STRUCTURAL_INSERT_ALLOWED_KEYS, VALID_INSERT_TYPES, LIST_KINDS, LIST_INSERT_POSITIONS, JOIN_DIRECTIONS, MUTATION_SCOPES, LEVEL_ALIGNMENTS, TRAILING_CHARACTERS, LIST_PRESET_IDS, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS, VALID_INSERT_POSITIONS, VALID_JOIN_DIRECTIONS, VALID_MUTATION_SCOPES, VALID_LEVEL_ALIGNMENTS, VALID_TRAILING_CHARACTERS, VALID_LIST_PRESETS, VALID_CONTINUITY_VALUES, VALID_SEQUENCE_MODES, VALID_LIST_CREATE_MODES, VALID_V2_LIST_BLOCK_NODE_TYPES, TEXT_REPLACE_ALLOWED_KEYS, STRUCTURAL_REPLACE_ALLOWED_KEYS, VALID_HEADING_LEVELS, SECTION_BREAK_TYPES$1, SECTION_BREAK_REPRESENTATIONS, SUPPORTED_DELETE_NODE_TYPES, REJECTED_DELETE_NODE_TYPES, VALID_BLOCK_NODE_TYPES, BODY_STORY_LOCATOR, PARAGRAPH_SHAPE_TYPES, PLAN_EXECUTE_UNSUPPORTED_OPERATION_IDS, SNAPSHOT_VERSIONS, PAYLOAD_VERSIONS, VALID_STYLE_OPTION_FLAGS, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT = 250, SECTION_BREAK_TYPES, SECTION_ORIENTATIONS, SECTION_VERTICAL_ALIGNS, SECTION_DIRECTIONS, HEADER_FOOTER_KINDS, HEADER_FOOTER_VARIANTS, LINE_NUMBER_RESTARTS, PAGE_NUMBER_FORMATS, PAGE_NUMBER_CHAPTER_SEPARATORS, PAGE_BORDER_DISPLAYS, PAGE_BORDER_OFFSET_FROM_VALUES, PAGE_BORDER_Z_ORDER_VALUES, VALID_WRAP_TYPES, VALID_WRAP_SIDES, VALID_IMAGE_SIZE_UNITS, VALID_TOC_UPDATE_MODES, EDIT_ENTRY_PATCH_ALLOWED_KEYS, PATCH_FIELDS, CONTENT_CONTROL_TYPES, LOCK_MODES, CONTENT_CONTROL_APPEARANCES, VALID_NODE_KINDS, VALID_LOCK_MODES$1, VALID_CC_TYPES, VALID_CC_APPEARANCES, VALID_CONTENT_FORMATS, VALID_RAW_PATCH_OPS, VALID_SET_MODES, VALID_CREATE_LOCATION_KINDS, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$220) => ({
98910
+ }), INLINE_PROPERTY_REGISTRY, INLINE_PROPERTY_KEY_SET, INLINE_PROPERTY_BY_KEY, UNDERLINE_OBJECT_ALLOWED_KEYS, SHADING_ALLOWED_KEYS, BORDER_ALLOWED_KEYS, FIT_TEXT_ALLOWED_KEYS, LANG_ALLOWED_KEYS, RFONTS_ALLOWED_KEYS, EAST_ASIAN_LAYOUT_ALLOWED_KEYS, STYLISTIC_SET_ALLOWED_KEYS, VERT_ALIGN_VALUES, PROPERTY_VALIDATOR_MAP, TABLE_COLOR_PATTERN, PARAGRAPH_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TAB_STOP_LEADERS, BORDER_SIDES, CLEAR_BORDER_SIDES, LINE_RULES, PARAGRAPH_DIRECTIONS, ALIGNMENT_POLICIES, PARAGRAPH_BLOCK_TYPES, SET_STYLE_KEYS, CLEAR_STYLE_KEYS, RESET_DIRECT_FORMATTING_KEYS, SET_ALIGNMENT_KEYS, CLEAR_ALIGNMENT_KEYS, SET_INDENTATION_KEYS, CLEAR_INDENTATION_KEYS, SET_SPACING_KEYS, CLEAR_SPACING_KEYS, SET_KEEP_OPTIONS_KEYS, SET_OUTLINE_LEVEL_KEYS, SET_FLOW_OPTIONS_KEYS, SET_TAB_STOP_KEYS, CLEAR_TAB_STOP_KEYS, CLEAR_ALL_TAB_STOPS_KEYS, SET_BORDER_KEYS, CLEAR_BORDER_KEYS, SET_SHADING_KEYS, CLEAR_SHADING_KEYS, SET_MARK_RUN_PROPS_KEYS, MARK_RUN_PROPS_FIELD_KEYS, MARK_RUN_COLOR_REF_KEYS, MARK_RUN_FONTS_KEYS, MARK_RUN_LANG_KEYS, MARK_RUN_UNDERLINE_KEYS, MARK_RUN_SHADING_KEYS, MARK_RUN_BORDER_KEYS, MARK_RUN_COLOR_MODE_VALUES, MARK_RUN_VERTICAL_ALIGN_VALUES, SET_DIRECTION_KEYS, SET_NUMBERING_KEYS, CLEAR_DIRECTION_KEYS, ST_ON_OFF_ON_VALUES, ST_ON_OFF_OFF_VALUES, ST_UNDERLINE_VALUES, ST_UNDERLINE_VALUE_SET, ST_VERTICAL_ALIGN_RUN, ST_EM, ST_TEXT_ALIGNMENT, ST_TEXT_DIRECTION, ST_TEXTBOX_TIGHT_WRAP, ST_TEXT_TRANSFORM, ST_JUSTIFICATION, FONT_FAMILY_SCHEMA, COLOR_SCHEMA, SPACING_SCHEMA, INDENT_SCHEMA, UNDERLINE_SCHEMA, BORDER_PROPERTIES_SCHEMA, SHADING_SCHEMA, LANG_SCHEMA, EAST_ASIAN_LAYOUT_SCHEMA, FIT_TEXT_SCHEMA, NUMBERING_PROPERTIES_SCHEMA, FRAME_PR_SCHEMA, PARAGRAPH_BORDERS_SCHEMA, TAB_STOP_SCHEMA, PROPERTY_REGISTRY, ALLOWED_KEYS_BY_CHANNEL, PROPERTY_INDEX, EXCLUDED_KEYS, INPUT_ALLOWED_KEYS, TARGET_ALLOWED_KEYS, OPTIONS_ALLOWED_KEYS, VALID_CHANNELS, Z_ORDER_RELATIVE_HEIGHT_MAX = 4294967295, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES, VALID_EDGE_NODE_TYPES, VALID_DOCUMENT_EDGES, VALID_REF_BOUNDARIES, VALID_ANCHOR_KINDS, RESOLVE_RANGE_ALLOWED_KEYS, SELECTION_CURRENT_ALLOWED_KEYS, CREATE_COMMENT_ALLOWED_KEYS, TRACKED_CHANGE_COMMENT_TARGET_ALLOWED_KEYS, TEXT_SEARCH_COMMENT_TARGET_ALLOWED_KEYS, PATCH_COMMENT_ALLOWED_KEYS, STYLE_APPLY_INPUT_ALLOWED_KEYS, INLINE_ALIAS_INPUT_ALLOWED_KEYS, DELETE_INPUT_ALLOWED_KEYS, VALID_BEHAVIORS, CONTENT_KIND_SET, INLINE_KIND_SET, LEGACY_TOP_LEVEL_TYPES, TEXT_INSERT_ALLOWED_KEYS, STRUCTURAL_INSERT_ALLOWED_KEYS, VALID_INSERT_TYPES, LIST_KINDS, LIST_INSERT_POSITIONS, JOIN_DIRECTIONS, MUTATION_SCOPES, LEVEL_ALIGNMENTS, TRAILING_CHARACTERS, LIST_PRESET_IDS, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS, VALID_INSERT_POSITIONS, VALID_JOIN_DIRECTIONS, VALID_MUTATION_SCOPES, VALID_LEVEL_ALIGNMENTS, VALID_TRAILING_CHARACTERS, VALID_LIST_PRESETS, VALID_CONTINUITY_VALUES, VALID_SEQUENCE_MODES, VALID_LIST_CREATE_MODES, VALID_V2_LIST_BLOCK_NODE_TYPES, TEXT_REPLACE_ALLOWED_KEYS, STRUCTURAL_REPLACE_ALLOWED_KEYS, VALID_HEADING_LEVELS, SECTION_BREAK_TYPES$1, SECTION_BREAK_REPRESENTATIONS, SUPPORTED_DELETE_NODE_TYPES, REJECTED_DELETE_NODE_TYPES, VALID_BLOCK_NODE_TYPES, BODY_STORY_LOCATOR, PARAGRAPH_SHAPE_TYPES, PLAN_EXECUTE_UNSUPPORTED_OPERATION_IDS, SNAPSHOT_VERSIONS, PAYLOAD_VERSIONS, VALID_STYLE_OPTION_FLAGS, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT = 250, SECTION_BREAK_TYPES, SECTION_ORIENTATIONS, SECTION_VERTICAL_ALIGNS, SECTION_DIRECTIONS, HEADER_FOOTER_KINDS, HEADER_FOOTER_VARIANTS, LINE_NUMBER_RESTARTS, PAGE_NUMBER_FORMATS, PAGE_NUMBER_CHAPTER_SEPARATORS, PAGE_BORDER_DISPLAYS, PAGE_BORDER_OFFSET_FROM_VALUES, PAGE_BORDER_Z_ORDER_VALUES, VALID_WRAP_TYPES, VALID_WRAP_SIDES, VALID_IMAGE_SIZE_UNITS, VALID_TOC_UPDATE_MODES, EDIT_ENTRY_PATCH_ALLOWED_KEYS, PATCH_FIELDS, CONTENT_CONTROL_TYPES, LOCK_MODES, CONTENT_CONTROL_APPEARANCES, VALID_NODE_KINDS, VALID_LOCK_MODES$1, VALID_CC_TYPES, VALID_CC_APPEARANCES, VALID_CONTENT_FORMATS, VALID_RAW_PATCH_OPS, VALID_SET_MODES, VALID_CREATE_LOCATION_KINDS, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$220) => ({
98878
98911
  handlerName,
98879
98912
  handler: (params) => {
98880
98913
  const { nodes } = params;
@@ -109140,7 +109173,10 @@ var isRegExp = (value) => {
109140
109173
  abstractId
109141
109174
  };
109142
109175
  }, hasListDefinition = (editor, numId, ilvl) => {
109143
- const { definitions, abstracts } = editor.converter.numbering;
109176
+ const numbering = editor?.converter?.numbering;
109177
+ if (!numbering)
109178
+ return false;
109179
+ const { definitions, abstracts } = numbering;
109144
109180
  const numDef = definitions[numId];
109145
109181
  if (!numDef)
109146
109182
  return false;
@@ -118444,7 +118480,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
118444
118480
  state.kern = kernNode.attributes["w:val"];
118445
118481
  }
118446
118482
  }, SuperConverter;
118447
- var init_SuperConverter_Bdmhv7BA_es = __esm(() => {
118483
+ var init_SuperConverter_DVjSc_AY_es = __esm(() => {
118448
118484
  init_rolldown_runtime_Bg48TavK_es();
118449
118485
  init_jszip_C49i9kUs_es();
118450
118486
  init_xml_js_CqGKpaft_es();
@@ -121474,6 +121510,11 @@ var init_SuperConverter_Bdmhv7BA_es = __esm(() => {
121474
121510
  "direction",
121475
121511
  "alignmentPolicy"
121476
121512
  ]);
121513
+ SET_NUMBERING_KEYS = new Set([
121514
+ "target",
121515
+ "numId",
121516
+ "level"
121517
+ ]);
121477
121518
  CLEAR_DIRECTION_KEYS = new Set(["target"]);
121478
121519
  ST_ON_OFF_ON_VALUES = new Set([
121479
121520
  "true",
@@ -147448,7 +147489,7 @@ var init_SuperConverter_Bdmhv7BA_es = __esm(() => {
147448
147489
  };
147449
147490
  });
147450
147491
 
147451
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-VA4azb5D.es.js
147492
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DYtdH4mX.es.js
147452
147493
  function parseSizeUnit(val = "0") {
147453
147494
  const length = val.toString() || "0";
147454
147495
  const value = Number.parseFloat(length);
@@ -149336,7 +149377,7 @@ function executeTextSelector(editor, index2, query, diagnostics, options = {}) {
149336
149377
  total: 0
149337
149378
  };
149338
149379
  const search2 = requireEditorCommand(editor.commands?.search, "find (search)");
149339
- const searchModel = options.searchModel ?? "visible";
149380
+ const searchModel = options.searchModel ?? (selector.includeDeletedText ? "raw" : "visible");
149340
149381
  const textOffsetOptions = { textModel: searchModel };
149341
149382
  pattern.lastIndex = 0;
149342
149383
  const rawResult = search2(pattern, {
@@ -150751,6 +150792,56 @@ function paragraphsSetFlowOptionsWrapper(editor, input, options) {
150751
150792
  return result;
150752
150793
  }, options);
150753
150794
  }
150795
+ function numberedSubtype(nodeType) {
150796
+ return nodeType === "heading" ? "heading" : "listItem";
150797
+ }
150798
+ function buildNumberedTarget(editor, candidate, fallback) {
150799
+ const originalType = candidate.nodeType;
150800
+ const subtype = numberedSubtype(originalType);
150801
+ const withStory = (nodeType, nodeId) => ({
150802
+ kind: "block",
150803
+ nodeType,
150804
+ nodeId,
150805
+ ...fallback.story ? { story: fallback.story } : {}
150806
+ });
150807
+ if (subtype === originalType)
150808
+ return withStory(subtype, candidate.nodeId);
150809
+ const resolved = getBlockIndex(editor).candidates.find((c) => c.pos === candidate.pos);
150810
+ if (resolved && PARAGRAPH_NODE_TYPES.has(resolved.nodeType))
150811
+ return withStory(resolved.nodeType, resolved.nodeId);
150812
+ return fallback;
150813
+ }
150814
+ function paragraphsSetNumberingWrapper(editor, input, options) {
150815
+ rejectTrackedMode("format.paragraph.setNumbering", options);
150816
+ const candidate = resolveParagraphBlock(editor, input.target);
150817
+ const numId = input.numId;
150818
+ const level = input.level ?? 0;
150819
+ if (!ListHelpers.hasListDefinition(editor, numId, level))
150820
+ throw new DocumentApiAdapterError("INVALID_TARGET", `No numbering definition resolves for numId ${numId} at level ${level}.`, {
150821
+ numId,
150822
+ level
150823
+ });
150824
+ if (options?.dryRun)
150825
+ return successResult(input.target);
150826
+ if (executeDomainCommand(editor, () => {
150827
+ const node2 = editor.state.doc.nodeAt(candidate.pos);
150828
+ if (!node2)
150829
+ return false;
150830
+ const existing = node2.attrs.paragraphProperties?.numberingProperties;
150831
+ if (existing && toFiniteNumber(existing.numId) === numId && (toFiniteNumber(existing.ilvl) ?? 0) === level)
150832
+ return false;
150833
+ const tr = editor.state.tr;
150834
+ updateNumberingProperties({
150835
+ numId,
150836
+ ilvl: level
150837
+ }, node2, candidate.pos, editor, tr);
150838
+ editor.dispatch(tr);
150839
+ clearIndexCache(editor);
150840
+ return true;
150841
+ }, { expectedRevision: options?.expectedRevision }).steps[0]?.effect !== "changed")
150842
+ return noOpResult("format.paragraph.setNumbering");
150843
+ return successResult(buildNumberedTarget(editor, candidate, input.target));
150844
+ }
150754
150845
  function paragraphsSetTabStopWrapper(editor, input, options) {
150755
150846
  rejectTrackedMode("format.paragraph.setTabStop", options);
150756
150847
  return mutateParagraphProperties(editor, resolveParagraphBlock(editor, input.target), "format.paragraph.setTabStop", input.target, (pPr) => {
@@ -158141,9 +158232,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, MARK_KEYS, STEP_OP_CATALOG_UNFROZEN, PU
158141
158232
  }
158142
158233
  };
158143
158234
  };
158144
- var init_create_headless_toolbar_VA4azb5D_es = __esm(() => {
158235
+ var init_create_headless_toolbar_DYtdH4mX_es = __esm(() => {
158145
158236
  init_rolldown_runtime_Bg48TavK_es();
158146
- init_SuperConverter_Bdmhv7BA_es();
158237
+ init_SuperConverter_DVjSc_AY_es();
158147
158238
  init_jszip_C49i9kUs_es();
158148
158239
  init_uuid_B2wVPhPi_es();
158149
158240
  init_constants_D9qj59G2_es();
@@ -213758,7 +213849,7 @@ var init_remark_gfm_DCND_V_3_es = __esm(() => {
213758
213849
  init_remark_gfm_BUJjZJLy_es();
213759
213850
  });
213760
213851
 
213761
- // ../../packages/superdoc/dist/chunks/src-C3y2aHWQ.es.js
213852
+ // ../../packages/superdoc/dist/chunks/src-DrsB0vrP.es.js
213762
213853
  function deleteProps(obj, propOrProps) {
213763
213854
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
213764
213855
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -229527,8 +229618,9 @@ function queryMatchAdapter(editor, input2) {
229527
229618
  throw planError("INVALID_INPUT", `limit/offset are not valid when require is "${require$1}"`);
229528
229619
  const isTextSelector = input2.select.type === "text";
229529
229620
  const effectiveResolved = hasStyleCascade && isTextSelector;
229621
+ const { includeDeletedText: _stripped, ...textSelectWithoutDeleted } = isTextSelector ? input2.select : {};
229530
229622
  const result = findLegacyAdapter(storyEditor, {
229531
- select: input2.select,
229623
+ select: isTextSelector ? textSelectWithoutDeleted : input2.select,
229532
229624
  within: input2.within,
229533
229625
  includeNodes: input2.includeNodes,
229534
229626
  limit: isTextSelector ? undefined : input2.limit,
@@ -235081,6 +235173,19 @@ function resolveBlockFontSizePt(styleCtx, styleId$1) {
235081
235173
  return styleCtx.docDefaultsFontSizeHp / 2;
235082
235174
  return OOXML_DEFAULT_FONT_SIZE_PT;
235083
235175
  }
235176
+ function extractBlockNumbering(node2) {
235177
+ const attrs = node2.attrs;
235178
+ const numbering = attrs?.paragraphProperties?.numberingProperties ?? attrs?.numberingProperties;
235179
+ if (!numbering)
235180
+ return;
235181
+ const numId = toFiniteNumber(numbering.numId);
235182
+ if (numId === undefined || numId === 0)
235183
+ return;
235184
+ return {
235185
+ numId,
235186
+ level: toFiniteNumber(numbering.ilvl) ?? 0
235187
+ };
235188
+ }
235084
235189
  function extractBlockFormatting(node2, styleCtx) {
235085
235190
  const pProps = node2.attrs.paragraphProperties;
235086
235191
  const styleId$1 = pProps?.styleId ?? null;
@@ -235205,6 +235310,7 @@ function blocksListWrapper(editor, input2) {
235205
235310
  blocks: paged.map((candidate, i3) => {
235206
235311
  const textLength = computeTextContentLength(candidate.node);
235207
235312
  const fullText = input2?.includeText ? extractBlockText$1(candidate.node) : undefined;
235313
+ const numbering = extractBlockNumbering(candidate.node);
235208
235314
  const ref$1 = textLength > 0 ? encodeV4Ref({
235209
235315
  v: 4,
235210
235316
  rev,
@@ -235226,6 +235332,7 @@ function blocksListWrapper(editor, input2) {
235226
235332
  ...fullText !== undefined ? { text: fullText } : {},
235227
235333
  isEmpty: textLength === 0,
235228
235334
  ...extractBlockFormatting(candidate.node, styleCtx),
235335
+ ...numbering ? { paragraphNumbering: numbering } : {},
235229
235336
  ...ref$1 ? { ref: ref$1 } : {}
235230
235337
  };
235231
235338
  }),
@@ -251694,7 +251801,8 @@ function assembleDocumentApiAdapters(editor) {
251694
251801
  clearShading: (input2, options) => paragraphsClearShadingWrapper(editor, input2, options),
251695
251802
  setMarkRunProps: () => capabilityUnavailable("format.paragraph.setMarkRunProps is only available on v2-backed sessions."),
251696
251803
  setDirection: (input2, options) => paragraphsSetDirectionWrapper(editor, input2, options),
251697
- clearDirection: (input2, options) => paragraphsClearDirectionWrapper(editor, input2, options)
251804
+ clearDirection: (input2, options) => paragraphsClearDirectionWrapper(editor, input2, options),
251805
+ setNumbering: (input2, options) => paragraphsSetNumberingWrapper(editor, input2, options)
251698
251806
  },
251699
251807
  trackChanges: {
251700
251808
  list: (input2) => trackChangesListWrapper(editor, input2),
@@ -288448,32 +288556,39 @@ var Node$13 = class Node$14 {
288448
288556
  const ranges = searchIndex.offsetRangeToDocRanges(indexMatch.start, indexMatch.end);
288449
288557
  if (ranges.length === 0)
288450
288558
  continue;
288451
- const matchTexts = ranges.map((r$1) => doc$12.textBetween(r$1.from, r$1.to));
288452
- const matchText = typeof indexMatch.text === "string" ? indexMatch.text : matchTexts.join("");
288453
- const match$1 = {
288559
+ const matchText = typeof indexMatch.text === "string" ? indexMatch.text : ranges.map((r$1) => doc$12.textBetween(r$1.from, r$1.to)).join("");
288560
+ matches2.push({
288454
288561
  from: ranges[0].from,
288455
288562
  to: ranges[ranges.length - 1].to,
288456
288563
  text: matchText,
288457
288564
  id: v4_default(),
288458
288565
  ranges,
288459
288566
  trackerIds: []
288460
- };
288461
- if (positionTracker?.trackMany) {
288462
- const trackedRanges = ranges.map((range, rangeIndex) => ({
288463
- from: range.from,
288464
- to: range.to,
288465
- spec: {
288466
- type: SEARCH_POSITION_TRACKER_TYPE,
288467
- metadata: { rangeIndex }
288468
- }
288469
- }));
288470
- const trackerIds = positionTracker.trackMany(trackedRanges);
288471
- if (trackerIds.length > 0) {
288472
- match$1.trackerIds = trackerIds;
288473
- match$1.id = trackerIds[0];
288474
- }
288567
+ });
288568
+ }
288569
+ if (positionTracker?.trackMany && matches2.length > 0) {
288570
+ const allTrackedRanges = [];
288571
+ for (const match$1 of matches2)
288572
+ match$1.ranges.forEach((range, rangeIndex) => {
288573
+ allTrackedRanges.push({
288574
+ from: range.from,
288575
+ to: range.to,
288576
+ spec: {
288577
+ type: SEARCH_POSITION_TRACKER_TYPE,
288578
+ metadata: { rangeIndex }
288579
+ }
288580
+ });
288581
+ });
288582
+ const allIds = positionTracker.trackMany(allTrackedRanges);
288583
+ if (allIds.length !== allTrackedRanges.length)
288584
+ throw new Error(`Search position tracker returned ${allIds.length} ids for ${allTrackedRanges.length} ranges; expected one id per range.`);
288585
+ let offset$1 = 0;
288586
+ for (const match$1 of matches2) {
288587
+ const count = match$1.ranges.length;
288588
+ match$1.trackerIds = allIds.slice(offset$1, offset$1 + count);
288589
+ match$1.id = match$1.trackerIds[0];
288590
+ offset$1 += count;
288475
288591
  }
288476
- matches2.push(match$1);
288477
288592
  }
288478
288593
  return matches2;
288479
288594
  }, resolveMatchSelectionRange = (match$1, positionTracker) => {
@@ -312575,13 +312690,13 @@ menclose::after {
312575
312690
  return;
312576
312691
  console.log(...args$1);
312577
312692
  }, 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, TRACKED_MARK_NAMES;
312578
- var init_src_C3y2aHWQ_es = __esm(() => {
312693
+ var init_src_DrsB0vrP_es = __esm(() => {
312579
312694
  init_rolldown_runtime_Bg48TavK_es();
312580
- init_SuperConverter_Bdmhv7BA_es();
312695
+ init_SuperConverter_DVjSc_AY_es();
312581
312696
  init_jszip_C49i9kUs_es();
312582
312697
  init_xml_js_CqGKpaft_es();
312583
312698
  init_uuid_B2wVPhPi_es();
312584
- init_create_headless_toolbar_VA4azb5D_es();
312699
+ init_create_headless_toolbar_DYtdH4mX_es();
312585
312700
  init_constants_D9qj59G2_es();
312586
312701
  init_unified_BDuVPlMu_es();
312587
312702
  init_remark_gfm_BUJjZJLy_es();
@@ -313951,6 +314066,21 @@ var init_src_C3y2aHWQ_es = __esm(() => {
313951
314066
  referenceDocPath: "format/paragraph/clear-direction.mdx",
313952
314067
  referenceGroup: "format.paragraph"
313953
314068
  },
314069
+ "format.paragraph.setNumbering": {
314070
+ memberPath: "format.paragraph.setNumbering",
314071
+ description: "Attach numbering (numId + level) to an existing paragraph or heading so it joins a numbered sequence. Numbering is a paragraph property; the node and its style are otherwise unchanged, though any direct paragraph indent is cleared so the numbering level controls indentation. Direct edits only; tracked mode is unsupported.",
314072
+ expectedResult: "Returns a ParagraphMutationResult; reports NO_OP if the block already carries this numbering. On a successful apply, resolution.target reflects the post-mutation address (a numbered plain paragraph re-resolves to listItem; a heading stays a heading); a dryRun returns the input target.",
314073
+ requiresDocumentContext: true,
314074
+ metadata: mutationOperation({
314075
+ idempotency: "conditional",
314076
+ supportsDryRun: true,
314077
+ supportsTrackedMode: false,
314078
+ possibleFailureCodes: ["NO_OP"],
314079
+ throws: T_PARAGRAPH_MUTATION
314080
+ }),
314081
+ referenceDocPath: "format/paragraph/set-numbering.mdx",
314082
+ referenceGroup: "format.paragraph"
314083
+ },
313954
314084
  "lists.list": {
313955
314085
  memberPath: "lists.list",
313956
314086
  description: "List all list nodes in the document, optionally filtered by scope.",
@@ -354805,11 +354935,11 @@ function print() { __p += __j.call(arguments, '') }
354805
354935
  ]);
354806
354936
  });
354807
354937
 
354808
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-Bi5_b_W1.es.js
354938
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-D8ibpwMt.es.js
354809
354939
  var DEFAULT_TEXT_ALIGN_OPTIONS, DEFAULT_LINE_HEIGHT_OPTIONS, DEFAULT_ZOOM_OPTIONS, DEFAULT_DOCUMENT_MODE_OPTIONS, DEFAULT_FONT_SIZE_OPTIONS, headlessToolbarConstants, 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, FONT_SIZE_OPTIONS;
354810
- var init_create_super_doc_ui_Bi5_b_W1_es = __esm(() => {
354811
- init_SuperConverter_Bdmhv7BA_es();
354812
- init_create_headless_toolbar_VA4azb5D_es();
354940
+ var init_create_super_doc_ui_D8ibpwMt_es = __esm(() => {
354941
+ init_SuperConverter_DVjSc_AY_es();
354942
+ init_create_headless_toolbar_DYtdH4mX_es();
354813
354943
  DEFAULT_TEXT_ALIGN_OPTIONS = [
354814
354944
  {
354815
354945
  label: "Left",
@@ -355100,15 +355230,15 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
355100
355230
 
355101
355231
  // ../../packages/superdoc/dist/super-editor.es.js
355102
355232
  var init_super_editor_es = __esm(() => {
355103
- init_src_C3y2aHWQ_es();
355104
- init_SuperConverter_Bdmhv7BA_es();
355233
+ init_src_DrsB0vrP_es();
355234
+ init_SuperConverter_DVjSc_AY_es();
355105
355235
  init_jszip_C49i9kUs_es();
355106
355236
  init_xml_js_CqGKpaft_es();
355107
- init_create_headless_toolbar_VA4azb5D_es();
355237
+ init_create_headless_toolbar_DYtdH4mX_es();
355108
355238
  init_constants_D9qj59G2_es();
355109
355239
  init_unified_BDuVPlMu_es();
355110
355240
  init_DocxZipper_BzS208BW_es();
355111
- init_create_super_doc_ui_Bi5_b_W1_es();
355241
+ init_create_super_doc_ui_D8ibpwMt_es();
355112
355242
  init_ui_CGB3qmy3_es();
355113
355243
  init_eventemitter3_UwU_CLPU_es();
355114
355244
  init_errors_C_DoKMoN_es();
@@ -355306,8 +355436,13 @@ var init_block_identity_renaming = __esm(() => {
355306
355436
  // ../../packages/super-editor/src/editors/v1/document-api-adapters/helpers/node-address-resolver.ts
355307
355437
  function isListItem3(attrs) {
355308
355438
  const numbering = attrs?.paragraphProperties?.numberingProperties;
355309
- if (numbering && (numbering.numId != null || numbering.ilvl != null))
355310
- return true;
355439
+ if (numbering) {
355440
+ const numId = toFiniteNumber2(numbering.numId);
355441
+ if (numId != null && numId !== 0)
355442
+ return true;
355443
+ if (numId == null && numbering.ilvl != null)
355444
+ return true;
355445
+ }
355311
355446
  const listRendering = attrs?.listRendering;
355312
355447
  if (listRendering?.markerText)
355313
355448
  return true;
@@ -358336,6 +358471,21 @@ More content with **bold** and *italic*.`
358336
358471
  referenceDocPath: "format/paragraph/clear-direction.mdx",
358337
358472
  referenceGroup: "format.paragraph"
358338
358473
  },
358474
+ "format.paragraph.setNumbering": {
358475
+ memberPath: "format.paragraph.setNumbering",
358476
+ description: "Attach numbering (numId + level) to an existing paragraph or heading so it joins a numbered sequence. Numbering is a paragraph property; the node and its style are otherwise unchanged, though any direct paragraph indent is cleared so the numbering level controls indentation. Direct edits only; tracked mode is unsupported.",
358477
+ expectedResult: "Returns a ParagraphMutationResult; reports NO_OP if the block already carries this numbering. On a successful apply, resolution.target reflects the post-mutation address (a numbered plain paragraph re-resolves to listItem; a heading stays a heading); a dryRun returns the input target.",
358478
+ requiresDocumentContext: true,
358479
+ metadata: mutationOperation2({
358480
+ idempotency: "conditional",
358481
+ supportsDryRun: true,
358482
+ supportsTrackedMode: false,
358483
+ possibleFailureCodes: ["NO_OP"],
358484
+ throws: T_PARAGRAPH_MUTATION2
358485
+ }),
358486
+ referenceDocPath: "format/paragraph/set-numbering.mdx",
358487
+ referenceGroup: "format.paragraph"
358488
+ },
358339
358489
  "lists.list": {
358340
358490
  memberPath: "lists.list",
358341
358491
  description: "List all list nodes in the document, optionally filtered by scope.",
@@ -363330,6 +363480,23 @@ function validateClearDirection2(input2) {
363330
363480
  assertParagraphTarget2(input2, "format.paragraph.clearDirection");
363331
363481
  assertNoUnknownFields2(input2, CLEAR_DIRECTION_KEYS2, "format.paragraph.clearDirection");
363332
363482
  }
363483
+ function validateSetNumbering2(input2) {
363484
+ const op = "format.paragraph.setNumbering";
363485
+ assertParagraphTarget2(input2, op);
363486
+ assertNoUnknownFields2(input2, SET_NUMBERING_KEYS2, op);
363487
+ const rec = input2;
363488
+ if (rec.numId === undefined) {
363489
+ throw new DocumentApiValidationError3("INVALID_INPUT", `${op} requires a numId field.`);
363490
+ }
363491
+ if (typeof rec.numId !== "number" || !Number.isInteger(rec.numId) || rec.numId < 1) {
363492
+ throw new DocumentApiValidationError3("INVALID_INPUT", `${op} numId must be a positive integer (numId 0 is the no-numbering sentinel). Got ${JSON.stringify(rec.numId)}.`, { field: "numId", value: rec.numId });
363493
+ }
363494
+ if (rec.level !== undefined) {
363495
+ if (typeof rec.level !== "number" || !Number.isInteger(rec.level) || rec.level < 0 || rec.level > 8) {
363496
+ throw new DocumentApiValidationError3("INVALID_INPUT", `${op} level must be an integer 0-8. Got ${JSON.stringify(rec.level)}.`, { field: "level", value: rec.level });
363497
+ }
363498
+ }
363499
+ }
363333
363500
  function executeParagraphsSetStyle2(adapter, input2, options) {
363334
363501
  validateSetStyle2(input2);
363335
363502
  return adapter.setStyle(input2, normalizeMutationOptions2(options));
@@ -363428,7 +363595,11 @@ function executeParagraphsClearDirection2(adapter, input2, options) {
363428
363595
  validateClearDirection2(input2);
363429
363596
  return adapter.clearDirection(input2, normalizeMutationOptions2(options));
363430
363597
  }
363431
- var PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_MARK_RUN_PROPS_KEYS2, MARK_RUN_PROPS_FIELD_KEYS2, MARK_RUN_COLOR_REF_KEYS2, MARK_RUN_FONTS_KEYS2, MARK_RUN_LANG_KEYS2, MARK_RUN_UNDERLINE_KEYS2, MARK_RUN_SHADING_KEYS2, MARK_RUN_BORDER_KEYS2, MARK_RUN_COLOR_MODE_VALUES2, MARK_RUN_VERTICAL_ALIGN_VALUES2, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2;
363598
+ function executeParagraphsSetNumbering2(adapter, input2, options) {
363599
+ validateSetNumbering2(input2);
363600
+ return adapter.setNumbering(input2, normalizeMutationOptions2(options));
363601
+ }
363602
+ var PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_MARK_RUN_PROPS_KEYS2, MARK_RUN_PROPS_FIELD_KEYS2, MARK_RUN_COLOR_REF_KEYS2, MARK_RUN_FONTS_KEYS2, MARK_RUN_LANG_KEYS2, MARK_RUN_UNDERLINE_KEYS2, MARK_RUN_SHADING_KEYS2, MARK_RUN_BORDER_KEYS2, MARK_RUN_COLOR_MODE_VALUES2, MARK_RUN_VERTICAL_ALIGN_VALUES2, SET_DIRECTION_KEYS2, SET_NUMBERING_KEYS2, CLEAR_DIRECTION_KEYS2;
363432
363603
  var init_paragraphs = __esm(() => {
363433
363604
  init_errors5();
363434
363605
  init_validation_primitives();
@@ -363520,6 +363691,7 @@ var init_paragraphs = __esm(() => {
363520
363691
  MARK_RUN_COLOR_MODE_VALUES2 = ["rgb", "theme", "auto"];
363521
363692
  MARK_RUN_VERTICAL_ALIGN_VALUES2 = ["baseline", "superscript", "subscript"];
363522
363693
  SET_DIRECTION_KEYS2 = new Set(["target", "direction", "alignmentPolicy"]);
363694
+ SET_NUMBERING_KEYS2 = new Set(["target", "numId", "level"]);
363523
363695
  CLEAR_DIRECTION_KEYS2 = new Set(["target"]);
363524
363696
  });
363525
363697
 
@@ -364825,7 +364997,7 @@ function refConfigSchemas() {
364825
364997
  failure: refFailureSchema
364826
364998
  };
364827
364999
  }
364828
- var trackChangeTypeValues, nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, commentTrackedChangeTargetSchema, textSearchCommentTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, listsV2BlockTargetSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, commentTrackedChangeLinkSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, commentsCreateSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, markRunColorRefSchema, markRunFontsSchema, markRunLanguagesSchema, markRunUnderlineSchema, markRunShadingSchema, markRunBorderSchema, markRunPropsSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, trackChangeSourceIdsSchema, trackChangeBroadTypeEnum, trackChangeGroupingEnum, trackChangeCanonicalizationKindEnum, trackChangeAddressKindEnum, trackChangeSourcePlatformEnum, trackChangeReplacementSideSchema, trackChangeReplacementSchema, trackChangeOverlapRelationshipSchema, trackChangeOverlapLayerSchema, trackChangeOverlapInfoSchema, trackChangeFormattingSnapshotSchema, trackChangeTargetSchema, trackChangeSnapshotSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, reviewDecideRangeTargetOptions, historyActionCollaborationSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern, tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQueryProperties, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, customXmlPartTargetSchema, customXmlPartMutation, customXmlPartCreateMutation, anchoredMetadataAttachMutation, anchoredMetadataMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
365000
+ var trackChangeTypeValues, nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, commentTrackedChangeTargetSchema, textSearchCommentTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, listsV2BlockTargetSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, commentTrackedChangeLinkSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, commentsCreateSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, markRunColorRefSchema, markRunFontsSchema, markRunLanguagesSchema, markRunUnderlineSchema, markRunShadingSchema, markRunBorderSchema, markRunPropsSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, planTextSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, trackChangeSourceIdsSchema, trackChangeBroadTypeEnum, trackChangeGroupingEnum, trackChangeCanonicalizationKindEnum, trackChangeAddressKindEnum, trackChangeSourcePlatformEnum, trackChangeReplacementSideSchema, trackChangeReplacementSchema, trackChangeOverlapRelationshipSchema, trackChangeOverlapLayerSchema, trackChangeOverlapInfoSchema, trackChangeFormattingSnapshotSchema, trackChangeTargetSchema, trackChangeSnapshotSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, reviewDecideRangeTargetOptions, historyActionCollaborationSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern, tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQueryProperties, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, customXmlPartTargetSchema, customXmlPartMutation, customXmlPartCreateMutation, anchoredMetadataAttachMutation, anchoredMetadataMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
364829
365001
  var init_schemas4 = __esm(() => {
364830
365002
  init_command_catalog();
364831
365003
  init_types4();
@@ -365431,6 +365603,20 @@ var init_schemas4 = __esm(() => {
365431
365603
  hint: { type: "string" }
365432
365604
  }, ["message"]);
365433
365605
  textSelectorSchema = objectSchema({
365606
+ type: { const: "text", description: "Must be 'text' for text pattern search." },
365607
+ pattern: {
365608
+ type: "string",
365609
+ description: "Text to match. In regex mode, patterns are validated for syntax, maximum length, and safety before execution."
365610
+ },
365611
+ mode: {
365612
+ enum: ["contains", "regex"],
365613
+ description: "Match mode: 'contains' (literal substring, recommended for literal text) or 'regex' (validated regular expression)."
365614
+ },
365615
+ caseSensitive: { type: "boolean", description: "Case-sensitive matching. Default: false." },
365616
+ wholeWord: { type: "boolean", description: "Require word-boundary matches. Default: false." },
365617
+ includeDeletedText: { type: "boolean", description: "When true, includes text from pending tracked deletions. Default: false." }
365618
+ }, ["type", "pattern"]);
365619
+ planTextSelectorSchema = objectSchema({
365434
365620
  type: { const: "text", description: "Must be 'text' for text pattern search." },
365435
365621
  pattern: {
365436
365622
  type: "string",
@@ -365459,7 +365645,8 @@ var init_schemas4 = __esm(() => {
365459
365645
  pattern: { type: "string" },
365460
365646
  mode: { enum: ["contains", "regex"] },
365461
365647
  caseSensitive: { type: "boolean" },
365462
- wholeWord: { type: "boolean" }
365648
+ wholeWord: { type: "boolean" },
365649
+ includeDeletedText: { type: "boolean" }
365463
365650
  }, ["type", "pattern"]);
365464
365651
  sdNodeSelectorSchema = objectSchema({
365465
365652
  type: { const: "node" },
@@ -366916,6 +367103,15 @@ var init_schemas4 = __esm(() => {
366916
367103
  color: { type: "string", description: "Text color when explicitly set (e.g. '#000000')." },
366917
367104
  alignment: { type: "string", description: "Paragraph alignment." },
366918
367105
  headingLevel: { type: "number", description: "Heading level (1-6)." },
367106
+ paragraphNumbering: {
367107
+ type: "object",
367108
+ description: "Numbering reference (numId + level) for numbered blocks, including numbered headings. Absent for non-numbered blocks.",
367109
+ properties: {
367110
+ numId: { type: "number" },
367111
+ level: { type: "number" }
367112
+ },
367113
+ additionalProperties: false
367114
+ },
366919
367115
  ref: {
366920
367116
  type: "string",
366921
367117
  description: "Ref handle for this block. Pass directly to superdoc_format or superdoc_edit ref param. Only present for non-empty blocks."
@@ -367305,6 +367501,16 @@ var init_schemas4 = __esm(() => {
367305
367501
  success: paragraphMutationSuccessSchema,
367306
367502
  failure: paragraphMutationFailureSchemaFor("format.paragraph.clearDirection")
367307
367503
  },
367504
+ "format.paragraph.setNumbering": {
367505
+ input: objectSchema({
367506
+ target: paragraphTargetSchema,
367507
+ numId: { type: "integer", minimum: 1 },
367508
+ level: { type: "integer", minimum: 0, maximum: 8 }
367509
+ }, ["target", "numId"]),
367510
+ output: paragraphMutationResultSchemaFor("format.paragraph.setNumbering"),
367511
+ success: paragraphMutationSuccessSchema,
367512
+ failure: paragraphMutationFailureSchemaFor("format.paragraph.setNumbering")
367513
+ },
367308
367514
  "styles.apply": (() => {
367309
367515
  const runInputSchema = objectSchema({
367310
367516
  target: objectSchema({ scope: { const: "docDefaults" }, channel: { const: "run" } }, ["scope", "channel"]),
@@ -368473,7 +368679,12 @@ var init_schemas4 = __esm(() => {
368473
368679
  commentId: { type: "string" },
368474
368680
  text: { type: "string", description: "Updated comment text." },
368475
368681
  target: {
368476
- oneOf: [textAddressSchema, selectionTargetSchema, commentTrackedChangeTargetSchema, textSearchCommentTargetSchema],
368682
+ oneOf: [
368683
+ textAddressSchema,
368684
+ selectionTargetSchema,
368685
+ commentTrackedChangeTargetSchema,
368686
+ textSearchCommentTargetSchema
368687
+ ],
368477
368688
  description: "New anchor for the comment. Accepts a plain TextAddress, a SelectionTarget {kind:'selection', start, end}, a TextSearchCommentTarget {text, story?}, or a TrackedChangeCommentTarget, with or without kind, that names a logical tracked-change id as a convenience re-anchor target ."
368478
368689
  },
368479
368690
  status: {
@@ -368617,7 +368828,7 @@ var init_schemas4 = __esm(() => {
368617
368828
  in: storyLocatorSchema,
368618
368829
  select: {
368619
368830
  description: "Search selector. Use {type:'text', pattern:'...'} for text search or {type:'node', nodeType:'paragraph'|'heading'|...} for node search.",
368620
- oneOf: [textSelectorSchema, nodeSelectorSchema]
368831
+ oneOf: [planTextSelectorSchema, nodeSelectorSchema]
368621
368832
  },
368622
368833
  within: {
368623
368834
  ...blockNodeAddressSchema,
@@ -368659,7 +368870,7 @@ var init_schemas4 = __esm(() => {
368659
368870
  ...(() => {
368660
368871
  const selectWhereSchema = objectSchema({
368661
368872
  by: { const: "select", type: "string" },
368662
- select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
368873
+ select: { oneOf: [planTextSelectorSchema, nodeSelectorSchema] },
368663
368874
  within: blockNodeAddressSchema,
368664
368875
  require: { enum: ["first", "exactlyOne", "all"] }
368665
368876
  }, ["by", "select", "require"]);
@@ -368684,7 +368895,7 @@ var init_schemas4 = __esm(() => {
368684
368895
  oneOf: [
368685
368896
  objectSchema({
368686
368897
  by: { const: "select", type: "string" },
368687
- select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
368898
+ select: { oneOf: [planTextSelectorSchema, nodeSelectorSchema] },
368688
368899
  within: blockNodeAddressSchema,
368689
368900
  require: { enum: ["first", "exactlyOne"] }
368690
368901
  }, ["by", "select", "require"]),
@@ -368695,7 +368906,7 @@ var init_schemas4 = __esm(() => {
368695
368906
  };
368696
368907
  const assertWhereSchema = objectSchema({
368697
368908
  by: { const: "select", type: "string" },
368698
- select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
368909
+ select: { oneOf: [planTextSelectorSchema, nodeSelectorSchema] },
368699
368910
  within: blockNodeAddressSchema
368700
368911
  }, ["by", "select"]);
368701
368912
  const replacementBlockSchema = objectSchema({ text: { type: "string" } }, ["text"]);
@@ -370362,7 +370573,10 @@ var init_schemas4 = __esm(() => {
370362
370573
  "footnotes.insert": {
370363
370574
  input: {
370364
370575
  oneOf: [
370365
- objectSchema({ at: textTargetSchema, type: { enum: ["footnote", "endnote"] }, content: { type: "string" } }, ["type", "content"]),
370576
+ objectSchema({ at: textTargetSchema, type: { enum: ["footnote", "endnote"] }, content: { type: "string" } }, [
370577
+ "type",
370578
+ "content"
370579
+ ]),
370366
370580
  objectSchema({
370367
370581
  at: textTargetSchema,
370368
370582
  type: { enum: ["footnote", "endnote"] },
@@ -373185,7 +373399,10 @@ function executeListsSetLevelLayout2(adapter, input2, options) {
373185
373399
  }
373186
373400
  function validateV2BlockTarget2(value, field, operationName) {
373187
373401
  if (!isRecord4(value)) {
373188
- throw new DocumentApiValidationError3("INVALID_TARGET", `${operationName} ${field} must be an object.`, { field, value });
373402
+ throw new DocumentApiValidationError3("INVALID_TARGET", `${operationName} ${field} must be an object.`, {
373403
+ field,
373404
+ value
373405
+ });
373189
373406
  }
373190
373407
  const v = value;
373191
373408
  if (v.kind !== "block") {
@@ -373220,7 +373437,10 @@ function executeListsApply2(adapter, input2, options) {
373220
373437
  validateV2BlockTarget2(input2.target, "target", "lists.apply");
373221
373438
  requireEnum2(input2.seed, "seed", VALID_LIST_KINDS2, "lists.apply");
373222
373439
  if (input2.reuseNumId !== undefined && typeof input2.reuseNumId !== "string") {
373223
- throw new DocumentApiValidationError3("INVALID_INPUT", "lists.apply reuseNumId must be a string when provided.", { field: "reuseNumId", value: input2.reuseNumId });
373440
+ throw new DocumentApiValidationError3("INVALID_INPUT", "lists.apply reuseNumId must be a string when provided.", {
373441
+ field: "reuseNumId",
373442
+ value: input2.reuseNumId
373443
+ });
373224
373444
  }
373225
373445
  optionalInteger2(input2.ilvl, "ilvl", "lists.apply");
373226
373446
  if (!adapter.apply)
@@ -373711,7 +373931,9 @@ function validateBlockNodeAddressParagraph2(address2, operationLabel, field) {
373711
373931
  }
373712
373932
  function validateBlocksSplitInput2(input2) {
373713
373933
  if (!input2 || typeof input2 !== "object") {
373714
- throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.split requires an input object.", { fields: ["input"] });
373934
+ throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.split requires an input object.", {
373935
+ fields: ["input"]
373936
+ });
373715
373937
  }
373716
373938
  validateBlockNodeAddressParagraph2(input2.target, "blocks.split", "target");
373717
373939
  if (typeof input2.offset !== "number" || !Number.isInteger(input2.offset) || input2.offset < 0) {
@@ -373720,19 +373942,25 @@ function validateBlocksSplitInput2(input2) {
373720
373942
  }
373721
373943
  function validateBlocksMergeInput2(input2) {
373722
373944
  if (!input2 || typeof input2 !== "object") {
373723
- throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.merge requires an input object.", { fields: ["input"] });
373945
+ throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.merge requires an input object.", {
373946
+ fields: ["input"]
373947
+ });
373724
373948
  }
373725
373949
  validateBlockNodeAddressParagraph2(input2.first, "blocks.merge", "first");
373726
373950
  validateBlockNodeAddressParagraph2(input2.second, "blocks.merge", "second");
373727
373951
  }
373728
373952
  function validateBlocksMoveInput2(input2) {
373729
373953
  if (!input2 || typeof input2 !== "object") {
373730
- throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.move requires an input object.", { fields: ["input"] });
373954
+ throw new DocumentApiValidationError3("INVALID_INPUT", "blocks.move requires an input object.", {
373955
+ fields: ["input"]
373956
+ });
373731
373957
  }
373732
373958
  validateBlockNodeAddressParagraph2(input2.source, "blocks.move", "source");
373733
373959
  validateBlockNodeAddressParagraph2(input2.destination, "blocks.move", "destination");
373734
373960
  if (input2.placement !== "before" && input2.placement !== "after") {
373735
- throw new DocumentApiValidationError3("INVALID_INPUT", 'blocks.move placement must be "before" or "after".', { fields: ["placement"] });
373961
+ throw new DocumentApiValidationError3("INVALID_INPUT", 'blocks.move placement must be "before" or "after".', {
373962
+ fields: ["placement"]
373963
+ });
373736
373964
  }
373737
373965
  }
373738
373966
  function unavailableBlocksResult2(operationName) {
@@ -374164,6 +374392,7 @@ function buildDispatchTable2(api2) {
374164
374392
  "format.paragraph.setMarkRunProps": (input2, options) => api2.format.paragraph.setMarkRunProps(input2, options),
374165
374393
  "format.paragraph.setDirection": (input2, options) => api2.format.paragraph.setDirection(input2, options),
374166
374394
  "format.paragraph.clearDirection": (input2, options) => api2.format.paragraph.clearDirection(input2, options),
374395
+ "format.paragraph.setNumbering": (input2, options) => api2.format.paragraph.setNumbering(input2, options),
374167
374396
  "styles.apply": (input2, options) => api2.styles.apply(input2, options),
374168
374397
  "templates.apply": (input2, options) => api2.templates.apply(input2, options),
374169
374398
  "create.paragraph": (input2, options) => api2.create.paragraph(input2, options),
@@ -374811,10 +375040,7 @@ function createPlanApi2(invoke) {
374811
375040
  var PLAN_EXECUTE_UNSUPPORTED_OPERATION_IDS2;
374812
375041
  var init_plan = __esm(() => {
374813
375042
  init_errors5();
374814
- PLAN_EXECUTE_UNSUPPORTED_OPERATION_IDS2 = new Set([
374815
- "plan.execute",
374816
- "templates.apply"
374817
- ]);
375043
+ PLAN_EXECUTE_UNSUPPORTED_OPERATION_IDS2 = new Set(["plan.execute", "templates.apply"]);
374818
375044
  });
374819
375045
 
374820
375046
  // ../../packages/document-api/dist/diff/diff.js
@@ -377591,6 +377817,9 @@ function createDocumentApi2(adapters) {
377591
377817
  },
377592
377818
  clearDirection(input2, options) {
377593
377819
  return executeParagraphsClearDirection2(adapters.paragraphs, input2, options);
377820
+ },
377821
+ setNumbering(input2, options) {
377822
+ return executeParagraphsSetNumbering2(adapters.paragraphs, input2, options);
377594
377823
  }
377595
377824
  }
377596
377825
  },
@@ -406935,7 +407164,7 @@ function executeTextSelector2(editor, index2, query2, diagnostics, options = {})
406935
407164
  if (!pattern)
406936
407165
  return { matches: [], total: 0 };
406937
407166
  const search4 = requireEditorCommand2(editor.commands?.search, "find (search)");
406938
- const searchModel = options.searchModel ?? "visible";
407167
+ const searchModel = options.searchModel ?? (selector.includeDeletedText ? "raw" : "visible");
406939
407168
  const textOffsetOptions = { textModel: searchModel };
406940
407169
  pattern.lastIndex = 0;
406941
407170
  const rawResult = search4(pattern, {
@@ -408072,8 +408301,9 @@ function queryMatchAdapter2(editor, input2) {
408072
408301
  }
408073
408302
  const isTextSelector = input2.select.type === "text";
408074
408303
  const effectiveResolved = hasStyleCascade && isTextSelector;
408304
+ const { includeDeletedText: _stripped, ...textSelectWithoutDeleted } = isTextSelector ? input2.select : {};
408075
408305
  const query2 = {
408076
- select: input2.select,
408306
+ select: isTextSelector ? textSelectWithoutDeleted : input2.select,
408077
408307
  within: input2.within,
408078
408308
  includeNodes: input2.includeNodes,
408079
408309
  limit: isTextSelector ? undefined : input2.limit,
@@ -471749,7 +471979,10 @@ var generateNewListDefinition3 = ({
471749
471979
  abstractId
471750
471980
  };
471751
471981
  }, hasListDefinition2 = (editor, numId, ilvl) => {
471752
- const { definitions, abstracts } = editor.converter.numbering;
471982
+ const numbering = editor?.converter?.numbering;
471983
+ if (!numbering)
471984
+ return false;
471985
+ const { definitions, abstracts } = numbering;
471753
471986
  const numDef = definitions[numId];
471754
471987
  if (!numDef)
471755
471988
  return false;
@@ -474081,6 +474314,55 @@ function paragraphsSetFlowOptionsWrapper2(editor, input2, options) {
474081
474314
  return result;
474082
474315
  }, options);
474083
474316
  }
474317
+ function numberedSubtype2(nodeType) {
474318
+ return nodeType === "heading" ? "heading" : "listItem";
474319
+ }
474320
+ function buildNumberedTarget2(editor, candidate, fallback) {
474321
+ const originalType = candidate.nodeType;
474322
+ const subtype = numberedSubtype2(originalType);
474323
+ const withStory = (nodeType, nodeId) => ({
474324
+ kind: "block",
474325
+ nodeType,
474326
+ nodeId,
474327
+ ...fallback.story ? { story: fallback.story } : {}
474328
+ });
474329
+ if (subtype === originalType)
474330
+ return withStory(subtype, candidate.nodeId);
474331
+ const resolved = getBlockIndex2(editor).candidates.find((c) => c.pos === candidate.pos);
474332
+ if (resolved && PARAGRAPH_NODE_TYPES2.has(resolved.nodeType)) {
474333
+ return withStory(resolved.nodeType, resolved.nodeId);
474334
+ }
474335
+ return fallback;
474336
+ }
474337
+ function paragraphsSetNumberingWrapper2(editor, input2, options) {
474338
+ rejectTrackedMode2("format.paragraph.setNumbering", options);
474339
+ const candidate = resolveParagraphBlock2(editor, input2.target);
474340
+ const numId = input2.numId;
474341
+ const level = input2.level ?? 0;
474342
+ if (!ListHelpers2.hasListDefinition(editor, numId, level)) {
474343
+ throw new DocumentApiAdapterError3("INVALID_TARGET", `No numbering definition resolves for numId ${numId} at level ${level}.`, { numId, level });
474344
+ }
474345
+ if (options?.dryRun)
474346
+ return successResult2(input2.target);
474347
+ const receipt2 = executeDomainCommand2(editor, () => {
474348
+ const node4 = editor.state.doc.nodeAt(candidate.pos);
474349
+ if (!node4)
474350
+ return false;
474351
+ const existing = node4.attrs.paragraphProperties?.numberingProperties;
474352
+ if (existing && toFiniteNumber2(existing.numId) === numId && (toFiniteNumber2(existing.ilvl) ?? 0) === level) {
474353
+ return false;
474354
+ }
474355
+ const tr = editor.state.tr;
474356
+ updateNumberingProperties2({ numId, ilvl: level }, node4, candidate.pos, editor, tr);
474357
+ editor.dispatch(tr);
474358
+ clearIndexCache2(editor);
474359
+ return true;
474360
+ }, { expectedRevision: options?.expectedRevision });
474361
+ if (receipt2.steps[0]?.effect !== "changed") {
474362
+ return noOpResult2("format.paragraph.setNumbering");
474363
+ }
474364
+ return successResult2(buildNumberedTarget2(editor, candidate, input2.target));
474365
+ }
474084
474366
  function paragraphsSetTabStopWrapper2(editor, input2, options) {
474085
474367
  rejectTrackedMode2("format.paragraph.setTabStop", options);
474086
474368
  const candidate = resolveParagraphBlock2(editor, input2.target);
@@ -474200,6 +474482,8 @@ var init_paragraphs_wrappers = __esm(() => {
474200
474482
  init_mutation_helpers();
474201
474483
  init_plan_wrappers();
474202
474484
  init_resolvedPropertiesCache();
474485
+ init_changeListLevel();
474486
+ init_list_numbering_helpers();
474203
474487
  PARAGRAPH_NODE_TYPES2 = new Set(["paragraph", "heading", "listItem"]);
474204
474488
  DIRECT_FORMATTING_MARK_NAMES2 = new Set([
474205
474489
  "textStyle",
@@ -488677,6 +488961,17 @@ function resolveBlockFontSizePt2(styleCtx, styleId3) {
488677
488961
  return styleCtx.docDefaultsFontSizeHp / 2;
488678
488962
  return OOXML_DEFAULT_FONT_SIZE_PT2;
488679
488963
  }
488964
+ function extractBlockNumbering2(node4) {
488965
+ const attrs = node4.attrs;
488966
+ const numbering = attrs?.paragraphProperties?.numberingProperties ?? attrs?.numberingProperties;
488967
+ if (!numbering)
488968
+ return;
488969
+ const numId = toFiniteNumber2(numbering.numId);
488970
+ if (numId === undefined || numId === 0)
488971
+ return;
488972
+ const level = toFiniteNumber2(numbering.ilvl) ?? 0;
488973
+ return { numId, level };
488974
+ }
488680
488975
  function extractBlockFormatting2(node4, styleCtx) {
488681
488976
  const pProps = node4.attrs.paragraphProperties;
488682
488977
  const styleId3 = pProps?.styleId ?? null;
@@ -488798,6 +489093,7 @@ function blocksListWrapper2(editor, input2) {
488798
489093
  const blocks2 = paged.map((candidate, i4) => {
488799
489094
  const textLength = computeTextContentLength2(candidate.node);
488800
489095
  const fullText = input2?.includeText ? extractBlockText2(candidate.node) : undefined;
489096
+ const numbering = extractBlockNumbering2(candidate.node);
488801
489097
  const ref3 = textLength > 0 ? encodeV4Ref2({
488802
489098
  v: 4,
488803
489099
  rev,
@@ -488815,6 +489111,7 @@ function blocksListWrapper2(editor, input2) {
488815
489111
  ...fullText !== undefined ? { text: fullText } : {},
488816
489112
  isEmpty: textLength === 0,
488817
489113
  ...extractBlockFormatting2(candidate.node, styleCtx),
489114
+ ...numbering ? { paragraphNumbering: numbering } : {},
488818
489115
  ...ref3 ? { ref: ref3 } : {}
488819
489116
  };
488820
489117
  });
@@ -512365,7 +512662,8 @@ function assembleDocumentApiAdapters2(editor) {
512365
512662
  clearShading: (input2, options) => paragraphsClearShadingWrapper2(editor, input2, options),
512366
512663
  setMarkRunProps: () => capabilityUnavailable("format.paragraph.setMarkRunProps is only available on v2-backed sessions."),
512367
512664
  setDirection: (input2, options) => paragraphsSetDirectionWrapper2(editor, input2, options),
512368
- clearDirection: (input2, options) => paragraphsClearDirectionWrapper2(editor, input2, options)
512665
+ clearDirection: (input2, options) => paragraphsClearDirectionWrapper2(editor, input2, options),
512666
+ setNumbering: (input2, options) => paragraphsSetNumberingWrapper2(editor, input2, options)
512369
512667
  },
512370
512668
  trackChanges: {
512371
512669
  list: (input2) => trackChangesListWrapper2(editor, input2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.12.0-next.36",
3
+ "version": "0.12.0-next.38",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -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.1.0-alpha.0",
23
22
  "superdoc": "1.41.0",
24
- "@superdoc/super-editor": "0.0.1"
23
+ "@superdoc/super-editor": "0.0.1",
24
+ "@superdoc/document-api": "0.1.0-alpha.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"