@superdoc-dev/cli 0.3.0-next.55 → 0.3.0-next.56

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 +423 -253
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -1433,8 +1433,8 @@ var init_operation_definitions = __esm(() => {
1433
1433
  },
1434
1434
  insert: {
1435
1435
  memberPath: "insert",
1436
- description: "Insert content into the document. Two input shapes: " + "legacy string-based (value + type) inserts inline content at a text position within an existing block; " + "structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. " + "When target is omitted, content appends at the end of the document. " + "Legacy mode supports text (default), markdown, and html content types via the `type` field. " + "Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
1437
- expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports a TextAddress for legacy text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
1436
+ description: "Insert content into the document. Two input shapes: " + "text-based (value + type) inserts inline content at a SelectionTarget or ref position within an existing block; " + "structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. " + "When target/ref is omitted, content appends at the end of the document. " + "Text mode supports text (default), markdown, and html content types via the `type` field. " + "Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
1437
+ expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports the inserted TextAddress for text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
1438
1438
  requiresDocumentContext: true,
1439
1439
  metadata: mutationOperation({
1440
1440
  idempotency: "non-idempotent",
@@ -7329,6 +7329,27 @@ function targetLocatorWithPayload(payloadProperties, payloadRequired = []) {
7329
7329
  ]
7330
7330
  };
7331
7331
  }
7332
+ function optionalTargetLocatorWithPayload(payloadProperties, payloadRequired = []) {
7333
+ return {
7334
+ oneOf: [
7335
+ objectSchema({
7336
+ target: {
7337
+ ...ref("SelectionTarget"),
7338
+ description: "Selection target: {kind:'selection', start:{kind:'text', blockId, offset}, end:{kind:'text', blockId, offset}}."
7339
+ },
7340
+ ...payloadProperties
7341
+ }, ["target", ...payloadRequired]),
7342
+ objectSchema({
7343
+ ref: {
7344
+ type: "string",
7345
+ description: "Handle ref string returned by a prior search/query result."
7346
+ },
7347
+ ...payloadProperties
7348
+ }, ["ref", ...payloadRequired]),
7349
+ objectSchema({ ...payloadProperties }, [...payloadRequired])
7350
+ ]
7351
+ };
7352
+ }
7332
7353
  function imagesMutationSchemaSet(inputSchema) {
7333
7354
  return {
7334
7355
  input: inputSchema,
@@ -8693,12 +8714,8 @@ var init_schemas = __esm(() => {
8693
8714
  };
8694
8715
  insertInputSchema = {
8695
8716
  oneOf: [
8696
- objectSchema({
8717
+ optionalTargetLocatorWithPayload({
8697
8718
  in: storyLocatorSchema,
8698
- target: {
8699
- ...textAddressSchema,
8700
- description: "Insertion point: {kind:'text', blockId:'...', range:{start, end}}."
8701
- },
8702
8719
  value: { type: "string", description: "Text content to insert." },
8703
8720
  type: {
8704
8721
  type: "string",
@@ -13082,8 +13099,8 @@ function validateTargetLocator(input, operation) {
13082
13099
  value: input.target
13083
13100
  });
13084
13101
  }
13085
- if (hasRef && typeof input.ref !== "string") {
13086
- throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a string.", {
13102
+ if (hasRef && (typeof input.ref !== "string" || input.ref === "")) {
13103
+ throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a non-empty string.", {
13087
13104
  field: "ref",
13088
13105
  value: input.ref
13089
13106
  });
@@ -13103,13 +13120,8 @@ function validateStyleApplyInput(input) {
13103
13120
  }
13104
13121
  function executeStyleApply(adapter, input, options) {
13105
13122
  validateStyleApplyInput(input);
13106
- return adapter.execute({
13107
- kind: "format",
13108
- target: input.target,
13109
- ref: input.ref,
13110
- inline: input.inline,
13111
- in: input.in
13112
- }, normalizeMutationOptions(options));
13123
+ const request = input.target ? { kind: "format", target: input.target, inline: input.inline, in: input.in } : { kind: "format", ref: input.ref, inline: input.inline, in: input.in };
13124
+ return adapter.execute(request, normalizeMutationOptions(options));
13113
13125
  }
13114
13126
  function acceptsImplicitTrue(key) {
13115
13127
  return INLINE_PROPERTY_BY_KEY[key].type === "boolean" || key === "underline";
@@ -13134,13 +13146,8 @@ function executeInlineAlias(adapter, key, input, options) {
13134
13146
  const value = normalizeInlineAliasValue(key, input.value);
13135
13147
  const inline = { [key]: value };
13136
13148
  validateInlineRunPatch(inline);
13137
- return adapter.execute({
13138
- kind: "format",
13139
- target: input.target,
13140
- ref: input.ref,
13141
- inline,
13142
- in: input.in
13143
- }, normalizeMutationOptions(options));
13149
+ const request = input.target ? { kind: "format", target: input.target, inline, in: input.in } : { kind: "format", ref: input.ref, inline, in: input.in };
13150
+ return adapter.execute(request, normalizeMutationOptions(options));
13144
13151
  }
13145
13152
  var STYLE_APPLY_INPUT_ALLOWED_KEYS, INLINE_ALIAS_INPUT_ALLOWED_KEYS;
13146
13153
  var init_format = __esm(() => {
@@ -13215,8 +13222,8 @@ function validateDeleteInput(input) {
13215
13222
  value: target
13216
13223
  });
13217
13224
  }
13218
- if (hasRef && typeof ref2 !== "string") {
13219
- throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a string.", {
13225
+ if (hasRef && (typeof ref2 !== "string" || ref2 === "")) {
13226
+ throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a non-empty string.", {
13220
13227
  field: "ref",
13221
13228
  value: ref2
13222
13229
  });
@@ -13227,13 +13234,8 @@ function validateDeleteInput(input) {
13227
13234
  }
13228
13235
  function executeDelete(adapter, input, options) {
13229
13236
  validateDeleteInput(input);
13230
- return adapter.execute({
13231
- kind: "delete",
13232
- target: input.target,
13233
- ref: input.ref,
13234
- behavior: input.behavior ?? "selection",
13235
- in: input.in
13236
- }, normalizeMutationOptions(options));
13237
+ const request = input.target ? { kind: "delete", target: input.target, behavior: input.behavior ?? "selection", in: input.in } : { kind: "delete", ref: input.ref, behavior: input.behavior ?? "selection", in: input.in };
13238
+ return adapter.execute(request, normalizeMutationOptions(options));
13237
13239
  }
13238
13240
  var DELETE_INPUT_ALLOWED_KEYS, VALID_BEHAVIORS;
13239
13241
  var init_delete = __esm(() => {
@@ -13811,33 +13813,42 @@ function validateInsertInput(input) {
13811
13813
  const hasValue = "value" in input && input.value !== undefined;
13812
13814
  const hasContent = "content" in input && input.content !== undefined;
13813
13815
  if (hasValue && hasContent) {
13814
- throw new DocumentApiValidationError("INVALID_INPUT", 'Insert input must provide either "value" (legacy) or "content" (structural), not both.', { fields: ["value", "content"] });
13816
+ throw new DocumentApiValidationError("INVALID_INPUT", 'Insert input must provide either "value" (text) or "content" (structural), not both.', { fields: ["value", "content"] });
13815
13817
  }
13816
13818
  if (!hasValue && !hasContent) {
13817
- throw new DocumentApiValidationError("INVALID_INPUT", 'Insert input must provide either "value" (legacy string) or "content" (SDFragment).', { fields: ["value", "content"] });
13819
+ throw new DocumentApiValidationError("INVALID_INPUT", 'Insert input must provide either "value" (text string) or "content" (SDFragment).', { fields: ["value", "content"] });
13818
13820
  }
13819
13821
  validateStoryLocator(input.in, "in");
13820
13822
  if (hasContent) {
13821
13823
  validateStructuralInsertInput(input);
13822
13824
  } else {
13823
- validateLegacyInsertInput(input);
13825
+ validateTextInsertInput(input);
13824
13826
  }
13825
13827
  }
13826
- function validateLegacyInsertInput(input) {
13828
+ function validateTextInsertInput(input) {
13827
13829
  if ("placement" in input && input.placement !== undefined) {
13828
13830
  throw new DocumentApiValidationError("INVALID_INPUT", '"placement" is only valid with structural content input, not with "value".', { field: "placement" });
13829
13831
  }
13830
13832
  if ("nestingPolicy" in input && input.nestingPolicy !== undefined) {
13831
13833
  throw new DocumentApiValidationError("INVALID_INPUT", '"nestingPolicy" is only valid with structural content input, not with "value".', { field: "nestingPolicy" });
13832
13834
  }
13833
- assertNoUnknownFields(input, LEGACY_INSERT_ALLOWED_KEYS, "insert");
13834
- const { target, value, type } = input;
13835
- if (target !== undefined && !isTextAddress(target)) {
13836
- throw new DocumentApiValidationError("INVALID_TARGET", "target must be a text address object.", {
13835
+ assertNoUnknownFields(input, TEXT_INSERT_ALLOWED_KEYS, "insert");
13836
+ const { target, ref: ref2, value, type } = input;
13837
+ if (target !== undefined && ref2 !== undefined) {
13838
+ throw new DocumentApiValidationError("INVALID_INPUT", 'Insert input must provide either "target" or "ref", not both.', { fields: ["target", "ref"] });
13839
+ }
13840
+ if (target !== undefined && !isSelectionTarget(target)) {
13841
+ throw new DocumentApiValidationError("INVALID_TARGET", "target must be a SelectionTarget object.", {
13837
13842
  field: "target",
13838
13843
  value: target
13839
13844
  });
13840
13845
  }
13846
+ if (ref2 !== undefined && (typeof ref2 !== "string" || ref2 === "")) {
13847
+ throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a non-empty string.", {
13848
+ field: "ref",
13849
+ value: ref2
13850
+ });
13851
+ }
13841
13852
  if (typeof value !== "string") {
13842
13853
  throw new DocumentApiValidationError("INVALID_TARGET", `value must be a string, got ${typeof value}.`, {
13843
13854
  field: "value",
@@ -13866,29 +13877,35 @@ function validateStructuralInsertInput(input) {
13866
13877
  validateNestingPolicyValue(nestingPolicy);
13867
13878
  validateDocumentFragment(content);
13868
13879
  }
13869
- function executeInsert(adapter, input, options) {
13880
+ function executeInsert(selectionAdapter, writeAdapter, input, options) {
13870
13881
  validateInsertInput(input);
13871
13882
  if (isStructuralInsertInput(input)) {
13872
- return adapter.insertStructured(input, normalizeMutationOptions(options));
13883
+ return writeAdapter.insertStructured(input, normalizeMutationOptions(options));
13873
13884
  }
13874
- const { target, value } = input;
13885
+ const { target, ref: ref2, value } = input;
13875
13886
  const contentType = input.type ?? "text";
13876
13887
  if (contentType !== "text") {
13877
- return adapter.insertStructured(input, normalizeMutationOptions(options));
13888
+ return writeAdapter.insertStructured(input, normalizeMutationOptions(options));
13878
13889
  }
13879
13890
  const storyIn = input.in;
13880
- const request = target ? { kind: "insert", target, text: value, ...storyIn ? { in: storyIn } : undefined } : { kind: "insert", text: value, ...storyIn ? { in: storyIn } : undefined };
13881
- const textReceipt = executeWrite(adapter, request, options);
13891
+ if (target || ref2) {
13892
+ const request2 = target ? { kind: "insert", target, text: value, ...storyIn ? { in: storyIn } : {} } : { kind: "insert", ref: ref2, text: value, ...storyIn ? { in: storyIn } : {} };
13893
+ const textReceipt2 = selectionAdapter.execute(request2, normalizeMutationOptions(options));
13894
+ return textReceiptToSDReceipt(textReceipt2);
13895
+ }
13896
+ const request = { kind: "insert", text: value, ...storyIn ? { in: storyIn } : {} };
13897
+ const textReceipt = executeWrite(writeAdapter, request, options);
13882
13898
  return textReceiptToSDReceipt(textReceipt);
13883
13899
  }
13884
- var LEGACY_INSERT_ALLOWED_KEYS, STRUCTURAL_INSERT_ALLOWED_KEYS, VALID_INSERT_TYPES;
13900
+ var TEXT_INSERT_ALLOWED_KEYS, STRUCTURAL_INSERT_ALLOWED_KEYS, VALID_INSERT_TYPES;
13885
13901
  var init_insert = __esm(() => {
13886
13902
  init_placement();
13887
13903
  init_errors2();
13888
13904
  init_validation_primitives();
13905
+ init_selection_target_validator();
13889
13906
  init_fragment_validator();
13890
13907
  init_story_validator();
13891
- LEGACY_INSERT_ALLOWED_KEYS = new Set(["value", "type", "target", "in"]);
13908
+ TEXT_INSERT_ALLOWED_KEYS = new Set(["value", "type", "target", "ref", "in"]);
13892
13909
  STRUCTURAL_INSERT_ALLOWED_KEYS = new Set(["content", "target", "placement", "nestingPolicy", "in"]);
13893
13910
  VALID_INSERT_TYPES = new Set(["text", "markdown", "html"]);
13894
13911
  });
@@ -14065,8 +14082,8 @@ function validateTargetLocator2(input, operation) {
14065
14082
  value: input.target
14066
14083
  });
14067
14084
  }
14068
- if (hasRef && typeof input.ref !== "string") {
14069
- throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a string.", {
14085
+ if (hasRef && (typeof input.ref !== "string" || input.ref === "")) {
14086
+ throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a non-empty string.", {
14070
14087
  field: "ref",
14071
14088
  value: input.ref
14072
14089
  });
@@ -14140,13 +14157,8 @@ function executeReplace(selectionAdapter, writeAdapter, input, options) {
14140
14157
  return writeAdapter.replaceStructured(input, normalizeMutationOptions(options));
14141
14158
  }
14142
14159
  const textInput = input;
14143
- const textReceipt = selectionAdapter.execute({
14144
- kind: "replace",
14145
- target: textInput.target,
14146
- ref: textInput.ref,
14147
- text: textInput.text,
14148
- in: textInput.in
14149
- }, normalizeMutationOptions(options));
14160
+ const request = textInput.target ? { kind: "replace", target: textInput.target, text: textInput.text, in: textInput.in } : { kind: "replace", ref: textInput.ref, text: textInput.text, in: textInput.in };
14161
+ const textReceipt = selectionAdapter.execute(request, normalizeMutationOptions(options));
14150
14162
  return textReceiptToSDReceipt(textReceipt);
14151
14163
  }
14152
14164
  var TEXT_REPLACE_ALLOWED_KEYS, STRUCTURAL_REPLACE_ALLOWED_KEYS;
@@ -16664,7 +16676,7 @@ function createDocumentApi(adapters) {
16664
16676
  }
16665
16677
  },
16666
16678
  insert(input, options) {
16667
- return executeInsert(adapters.write, input, options);
16679
+ return executeInsert(adapters.selectionMutation, adapters.write, input, options);
16668
16680
  },
16669
16681
  replace(input, options) {
16670
16682
  return executeReplace(adapters.selectionMutation, adapters.write, input, options);
@@ -40060,7 +40072,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
40060
40072
  emptyOptions2 = {};
40061
40073
  });
40062
40074
 
40063
- // ../../packages/superdoc/dist/chunks/SuperConverter-Cukh7tk8.es.js
40075
+ // ../../packages/superdoc/dist/chunks/SuperConverter-C65zRR3r.es.js
40064
40076
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
40065
40077
  const fieldValue = extension$1.config[field];
40066
40078
  if (typeof fieldValue === "function")
@@ -41859,6 +41871,25 @@ function targetLocatorWithPayload2(payloadProperties, payloadRequired = []) {
41859
41871
  ...payloadProperties
41860
41872
  }, ["ref", ...payloadRequired])] };
41861
41873
  }
41874
+ function optionalTargetLocatorWithPayload2(payloadProperties, payloadRequired = []) {
41875
+ return { oneOf: [
41876
+ objectSchema2({
41877
+ target: {
41878
+ ...ref2("SelectionTarget"),
41879
+ description: "Selection target: {kind:'selection', start:{kind:'text', blockId, offset}, end:{kind:'text', blockId, offset}}."
41880
+ },
41881
+ ...payloadProperties
41882
+ }, ["target", ...payloadRequired]),
41883
+ objectSchema2({
41884
+ ref: {
41885
+ type: "string",
41886
+ description: "Handle ref string returned by a prior search/query result."
41887
+ },
41888
+ ...payloadProperties
41889
+ }, ["ref", ...payloadRequired]),
41890
+ objectSchema2({ ...payloadProperties }, [...payloadRequired])
41891
+ ] };
41892
+ }
41862
41893
  function imagesMutationSchemaSet2(inputSchema) {
41863
41894
  return {
41864
41895
  input: inputSchema,
@@ -42810,8 +42841,8 @@ function validateTargetLocator$1(input, operation) {
42810
42841
  field: "target",
42811
42842
  value: input.target
42812
42843
  });
42813
- if (hasRef && typeof input.ref !== "string")
42814
- throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a string.", {
42844
+ if (hasRef && (typeof input.ref !== "string" || input.ref === ""))
42845
+ throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a non-empty string.", {
42815
42846
  field: "ref",
42816
42847
  value: input.ref
42817
42848
  });
@@ -42828,13 +42859,18 @@ function validateStyleApplyInput2(input) {
42828
42859
  }
42829
42860
  function executeStyleApply2(adapter, input, options) {
42830
42861
  validateStyleApplyInput2(input);
42831
- return adapter.execute({
42862
+ const request = input.target ? {
42832
42863
  kind: "format",
42833
42864
  target: input.target,
42865
+ inline: input.inline,
42866
+ in: input.in
42867
+ } : {
42868
+ kind: "format",
42834
42869
  ref: input.ref,
42835
42870
  inline: input.inline,
42836
42871
  in: input.in
42837
- }, normalizeMutationOptions2(options));
42872
+ };
42873
+ return adapter.execute(request, normalizeMutationOptions2(options));
42838
42874
  }
42839
42875
  function acceptsImplicitTrue2(key) {
42840
42876
  return INLINE_PROPERTY_BY_KEY2[key].type === "boolean" || key === "underline";
@@ -42858,13 +42894,18 @@ function executeInlineAlias2(adapter, key, input, options) {
42858
42894
  const value = normalizeInlineAliasValue2(key, input.value);
42859
42895
  const inline = { [key]: value };
42860
42896
  validateInlineRunPatch2(inline);
42861
- return adapter.execute({
42897
+ const request = input.target ? {
42862
42898
  kind: "format",
42863
42899
  target: input.target,
42900
+ inline,
42901
+ in: input.in
42902
+ } : {
42903
+ kind: "format",
42864
42904
  ref: input.ref,
42865
42905
  inline,
42866
42906
  in: input.in
42867
- }, normalizeMutationOptions2(options));
42907
+ };
42908
+ return adapter.execute(request, normalizeMutationOptions2(options));
42868
42909
  }
42869
42910
  function executeGetNode2(adapter, address2) {
42870
42911
  return adapter.getNode(address2);
@@ -42907,8 +42948,8 @@ function validateDeleteInput2(input) {
42907
42948
  field: "target",
42908
42949
  value: target
42909
42950
  });
42910
- if (hasRef && typeof ref$1 !== "string")
42911
- throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a string.", {
42951
+ if (hasRef && (typeof ref$1 !== "string" || ref$1 === ""))
42952
+ throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a non-empty string.", {
42912
42953
  field: "ref",
42913
42954
  value: ref$1
42914
42955
  });
@@ -42920,13 +42961,18 @@ function validateDeleteInput2(input) {
42920
42961
  }
42921
42962
  function executeDelete$1(adapter, input, options) {
42922
42963
  validateDeleteInput2(input);
42923
- return adapter.execute({
42964
+ const request = input.target ? {
42924
42965
  kind: "delete",
42925
42966
  target: input.target,
42967
+ behavior: input.behavior ?? "selection",
42968
+ in: input.in
42969
+ } : {
42970
+ kind: "delete",
42926
42971
  ref: input.ref,
42927
42972
  behavior: input.behavior ?? "selection",
42928
42973
  in: input.in
42929
- }, normalizeMutationOptions2(options));
42974
+ };
42975
+ return adapter.execute(request, normalizeMutationOptions2(options));
42930
42976
  }
42931
42977
  function validateSDFragment2(fragment2) {
42932
42978
  const nodes = normalizeToNodeArray2(fragment2, "INVALID_PAYLOAD");
@@ -43405,27 +43451,34 @@ function validateInsertInput2(input) {
43405
43451
  const hasValue = "value" in input && input.value !== undefined;
43406
43452
  const hasContent = "content" in input && input.content !== undefined;
43407
43453
  if (hasValue && hasContent)
43408
- throw new DocumentApiValidationError2("INVALID_INPUT", 'Insert input must provide either "value" (legacy) or "content" (structural), not both.', { fields: ["value", "content"] });
43454
+ throw new DocumentApiValidationError2("INVALID_INPUT", 'Insert input must provide either "value" (text) or "content" (structural), not both.', { fields: ["value", "content"] });
43409
43455
  if (!hasValue && !hasContent)
43410
- throw new DocumentApiValidationError2("INVALID_INPUT", 'Insert input must provide either "value" (legacy string) or "content" (SDFragment).', { fields: ["value", "content"] });
43456
+ throw new DocumentApiValidationError2("INVALID_INPUT", 'Insert input must provide either "value" (text string) or "content" (SDFragment).', { fields: ["value", "content"] });
43411
43457
  validateStoryLocator2(input.in, "in");
43412
43458
  if (hasContent)
43413
43459
  validateStructuralInsertInput2(input);
43414
43460
  else
43415
- validateLegacyInsertInput2(input);
43461
+ validateTextInsertInput2(input);
43416
43462
  }
43417
- function validateLegacyInsertInput2(input) {
43463
+ function validateTextInsertInput2(input) {
43418
43464
  if ("placement" in input && input.placement !== undefined)
43419
43465
  throw new DocumentApiValidationError2("INVALID_INPUT", '"placement" is only valid with structural content input, not with "value".', { field: "placement" });
43420
43466
  if ("nestingPolicy" in input && input.nestingPolicy !== undefined)
43421
43467
  throw new DocumentApiValidationError2("INVALID_INPUT", '"nestingPolicy" is only valid with structural content input, not with "value".', { field: "nestingPolicy" });
43422
- assertNoUnknownFields3(input, LEGACY_INSERT_ALLOWED_KEYS2, "insert");
43423
- const { target, value, type } = input;
43424
- if (target !== undefined && !isTextAddress2(target))
43425
- throw new DocumentApiValidationError2("INVALID_TARGET", "target must be a text address object.", {
43468
+ assertNoUnknownFields3(input, TEXT_INSERT_ALLOWED_KEYS2, "insert");
43469
+ const { target, ref: ref$1, value, type } = input;
43470
+ if (target !== undefined && ref$1 !== undefined)
43471
+ throw new DocumentApiValidationError2("INVALID_INPUT", 'Insert input must provide either "target" or "ref", not both.', { fields: ["target", "ref"] });
43472
+ if (target !== undefined && !isSelectionTarget2(target))
43473
+ throw new DocumentApiValidationError2("INVALID_TARGET", "target must be a SelectionTarget object.", {
43426
43474
  field: "target",
43427
43475
  value: target
43428
43476
  });
43477
+ if (ref$1 !== undefined && (typeof ref$1 !== "string" || ref$1 === ""))
43478
+ throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a non-empty string.", {
43479
+ field: "ref",
43480
+ value: ref$1
43481
+ });
43429
43482
  if (typeof value !== "string")
43430
43483
  throw new DocumentApiValidationError2("INVALID_TARGET", `value must be a string, got ${typeof value}.`, {
43431
43484
  field: "value",
@@ -43455,23 +43508,32 @@ function validateStructuralInsertInput2(input) {
43455
43508
  validateNestingPolicyValue2(nestingPolicy);
43456
43509
  validateDocumentFragment2(content$2);
43457
43510
  }
43458
- function executeInsert2(adapter, input, options) {
43511
+ function executeInsert2(selectionAdapter, writeAdapter, input, options) {
43459
43512
  validateInsertInput2(input);
43460
43513
  if (isStructuralInsertInput2(input))
43461
- return adapter.insertStructured(input, normalizeMutationOptions2(options));
43462
- const { target, value } = input;
43514
+ return writeAdapter.insertStructured(input, normalizeMutationOptions2(options));
43515
+ const { target, ref: ref$1, value } = input;
43463
43516
  if ((input.type ?? "text") !== "text")
43464
- return adapter.insertStructured(input, normalizeMutationOptions2(options));
43517
+ return writeAdapter.insertStructured(input, normalizeMutationOptions2(options));
43465
43518
  const storyIn = input.in;
43466
- return textReceiptToSDReceipt2(executeWrite2(adapter, target ? {
43467
- kind: "insert",
43468
- target,
43469
- text: value,
43470
- ...storyIn ? { in: storyIn } : undefined
43471
- } : {
43519
+ if (target || ref$1) {
43520
+ const request = target ? {
43521
+ kind: "insert",
43522
+ target,
43523
+ text: value,
43524
+ ...storyIn ? { in: storyIn } : {}
43525
+ } : {
43526
+ kind: "insert",
43527
+ ref: ref$1,
43528
+ text: value,
43529
+ ...storyIn ? { in: storyIn } : {}
43530
+ };
43531
+ return textReceiptToSDReceipt2(selectionAdapter.execute(request, normalizeMutationOptions2(options)));
43532
+ }
43533
+ return textReceiptToSDReceipt2(executeWrite2(writeAdapter, {
43472
43534
  kind: "insert",
43473
43535
  text: value,
43474
- ...storyIn ? { in: storyIn } : undefined
43536
+ ...storyIn ? { in: storyIn } : {}
43475
43537
  }, options));
43476
43538
  }
43477
43539
  function validateListTarget2(input, operationName) {
@@ -43634,8 +43696,8 @@ function validateTargetLocator3(input, operation) {
43634
43696
  field: "target",
43635
43697
  value: input.target
43636
43698
  });
43637
- if (hasRef && typeof input.ref !== "string")
43638
- throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a string.", {
43699
+ if (hasRef && (typeof input.ref !== "string" || input.ref === ""))
43700
+ throw new DocumentApiValidationError2("INVALID_TARGET", "ref must be a non-empty string.", {
43639
43701
  field: "ref",
43640
43702
  value: input.ref
43641
43703
  });
@@ -43693,13 +43755,18 @@ function executeReplace2(selectionAdapter, writeAdapter, input, options) {
43693
43755
  if (isStructuralReplaceInput2(input))
43694
43756
  return writeAdapter.replaceStructured(input, normalizeMutationOptions2(options));
43695
43757
  const textInput = input;
43696
- return textReceiptToSDReceipt2(selectionAdapter.execute({
43758
+ const request = textInput.target ? {
43697
43759
  kind: "replace",
43698
43760
  target: textInput.target,
43761
+ text: textInput.text,
43762
+ in: textInput.in
43763
+ } : {
43764
+ kind: "replace",
43699
43765
  ref: textInput.ref,
43700
43766
  text: textInput.text,
43701
43767
  in: textInput.in
43702
- }, normalizeMutationOptions2(options)));
43768
+ };
43769
+ return textReceiptToSDReceipt2(selectionAdapter.execute(request, normalizeMutationOptions2(options)));
43703
43770
  }
43704
43771
  function validateTargetOnlyCreateLocation2(at, operationName) {
43705
43772
  if (at.kind !== "before" && at.kind !== "after")
@@ -45832,7 +45899,7 @@ function createDocumentApi2(adapters) {
45832
45899
  }
45833
45900
  },
45834
45901
  insert(input, options) {
45835
- return executeInsert2(adapters.write, input, options);
45902
+ return executeInsert2(adapters.selectionMutation, adapters.write, input, options);
45836
45903
  },
45837
45904
  replace(input, options) {
45838
45905
  return executeReplace2(adapters.selectionMutation, adapters.write, input, options);
@@ -68715,11 +68782,17 @@ function stableHash(input) {
68715
68782
  }
68716
68783
  return (hash >>> 0).toString(16).padStart(8, "0");
68717
68784
  }
68718
- function toTableLikeBlockNodeType(nodeType) {
68785
+ function toFallbackEligibleBlockNodeType(nodeType) {
68719
68786
  if (nodeType === "table")
68720
68787
  return "table";
68721
68788
  if (nodeType === "tableCell")
68722
68789
  return "tableCell";
68790
+ if (nodeType === "paragraph")
68791
+ return "paragraph";
68792
+ if (nodeType === "heading")
68793
+ return "heading";
68794
+ if (nodeType === "listItem")
68795
+ return "listItem";
68723
68796
  }
68724
68797
  function serializeTraversalPath(path2, pos) {
68725
68798
  if (Array.isArray(path2) && path2.length > 0)
@@ -68729,11 +68802,11 @@ function serializeTraversalPath(path2, pos) {
68729
68802
  function isVolatileRuntimeBlockId(id) {
68730
68803
  return typeof id === "string" && UUID_LIKE_PATTERN.test(id);
68731
68804
  }
68732
- function buildFallbackTableNodeId(nodeType, pos, path2) {
68733
- const tableLikeType = toTableLikeBlockNodeType(nodeType);
68734
- if (!tableLikeType)
68805
+ function buildFallbackBlockNodeId(nodeType, pos, path2) {
68806
+ const eligibleType = toFallbackEligibleBlockNodeType(nodeType);
68807
+ if (!eligibleType)
68735
68808
  return;
68736
- return `${TABLE_LIKE_PREFIX[tableLikeType]}-${stableHash(`${tableLikeType}:${serializeTraversalPath(path2, pos)}`)}`;
68809
+ return `${FALLBACK_PREFIX[eligibleType]}-${stableHash(`${eligibleType}:${serializeTraversalPath(path2, pos)}`)}`;
68737
68810
  }
68738
68811
  function isListItem(attrs) {
68739
68812
  const numbering = attrs?.paragraphProperties?.numberingProperties;
@@ -68787,16 +68860,19 @@ function mapBlockNodeType(node3) {
68787
68860
  function resolveLegacyTableIdentity(attrs) {
68788
68861
  return toId(attrs.paraId) ?? toId(attrs.blockId) ?? toId(attrs.id) ?? toId(attrs.uuid);
68789
68862
  }
68790
- function resolveRuntimeTableIdentity(nodeType, attrs, pos, path2) {
68863
+ function resolveTableRuntimeIdentity(nodeType, attrs, pos, path2) {
68791
68864
  const sdBlockId = toId(attrs.sdBlockId);
68792
68865
  if (sdBlockId && !isVolatileRuntimeBlockId(sdBlockId))
68793
68866
  return sdBlockId;
68794
- return buildFallbackTableNodeId(nodeType, pos, path2);
68867
+ return buildFallbackBlockNodeId(nodeType, pos, path2);
68868
+ }
68869
+ function resolveParagraphRuntimeIdentity(nodeType, attrs, pos, path2) {
68870
+ return toId(attrs.sdBlockId) ?? buildFallbackBlockNodeId(nodeType, pos, path2);
68795
68871
  }
68796
68872
  function resolveBlockNodeId(node3, pos, nodeType, path2) {
68797
68873
  if (node3.type.name === "paragraph") {
68798
68874
  const attrs$1 = node3.attrs;
68799
- return toId(attrs$1?.paraId) ?? toId(attrs$1?.sdBlockId);
68875
+ return toId(attrs$1?.paraId) ?? resolveParagraphRuntimeIdentity(nodeType, attrs$1 ?? {}, pos, path2);
68800
68876
  }
68801
68877
  if (nodeType === "tableOfContents")
68802
68878
  return resolvePublicTocNodeId(node3, pos);
@@ -68805,7 +68881,7 @@ function resolveBlockNodeId(node3, pos, nodeType, path2) {
68805
68881
  if (typeName === "tableRow")
68806
68882
  return toId(attrs.paraId) ?? toId(attrs.sdBlockId) ?? toId(attrs.blockId) ?? toId(attrs.id) ?? toId(attrs.uuid);
68807
68883
  if (typeName === "table" || typeName === "tableCell" || typeName === "tableHeader")
68808
- return resolveLegacyTableIdentity(attrs) ?? resolveRuntimeTableIdentity(nodeType, attrs, pos, path2);
68884
+ return resolveLegacyTableIdentity(attrs) ?? resolveTableRuntimeIdentity(nodeType, attrs, pos, path2);
68809
68885
  return toId(attrs.blockId) ?? toId(attrs.id) ?? toId(attrs.paraId) ?? toId(attrs.uuid) ?? toId(attrs.sdBlockId);
68810
68886
  }
68811
68887
  function toBlockAddress(candidate) {
@@ -68879,23 +68955,15 @@ function findBlockByIdStrict(index2, address2) {
68879
68955
  throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Block "${key}" was not found.`, { target: address2 });
68880
68956
  return candidate;
68881
68957
  }
68882
- function findBlockByNodeIdOnly(index2, nodeId) {
68883
- const matches$1 = index2.candidates.filter((candidate) => candidate.nodeId === nodeId);
68884
- if (matches$1.length === 1)
68885
- return matches$1[0];
68886
- if (matches$1.length > 1)
68887
- throw new DocumentApiAdapterError("AMBIGUOUS_TARGET", `Multiple blocks share nodeId "${nodeId}".`, {
68888
- nodeId,
68889
- count: matches$1.length
68890
- });
68958
+ function resolveBlockAlias(index2, nodeId) {
68959
+ if (!index2.byId)
68960
+ return;
68891
68961
  const aliasMatches = /* @__PURE__ */ new Map;
68892
68962
  for (const [key, candidate] of index2.byId) {
68893
68963
  if (!key.endsWith(`:${nodeId}`))
68894
68964
  continue;
68895
68965
  aliasMatches.set(`${candidate.nodeType}:${candidate.nodeId}`, candidate);
68896
68966
  }
68897
- if (aliasMatches.size === 1)
68898
- return Array.from(aliasMatches.values())[0];
68899
68967
  if (aliasMatches.size > 1)
68900
68968
  throw new DocumentApiAdapterError("AMBIGUOUS_TARGET", `Multiple blocks share nodeId "${nodeId}" via aliases.`, {
68901
68969
  nodeId,
@@ -68905,6 +68973,20 @@ function findBlockByNodeIdOnly(index2, nodeId) {
68905
68973
  nodeId: candidate.nodeId
68906
68974
  }))
68907
68975
  });
68976
+ return aliasMatches.size === 1 ? Array.from(aliasMatches.values())[0] : undefined;
68977
+ }
68978
+ function findBlockByNodeIdOnly(index2, nodeId) {
68979
+ const matches$1 = index2.candidates.filter((candidate) => candidate.nodeId === nodeId);
68980
+ if (matches$1.length === 1)
68981
+ return matches$1[0];
68982
+ if (matches$1.length > 1)
68983
+ throw new DocumentApiAdapterError("AMBIGUOUS_TARGET", `Multiple blocks share nodeId "${nodeId}".`, {
68984
+ nodeId,
68985
+ count: matches$1.length
68986
+ });
68987
+ const alias = resolveBlockAlias(index2, nodeId);
68988
+ if (alias)
68989
+ return alias;
68908
68990
  throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Block with nodeId "${nodeId}" was not found.`, { nodeId });
68909
68991
  }
68910
68992
  function isTextBlockCandidate(candidate) {
@@ -69170,66 +69252,46 @@ function insertParagraphAtEnd(editor, pos, text$2, applyMeta) {
69170
69252
  editor.dispatch(tr);
69171
69253
  }
69172
69254
  function resolveWriteTarget(editor, request) {
69173
- const requestedTarget = request.target;
69174
- if (request.kind === "insert" && !request.target) {
69175
- const fallback = resolveDefaultInsertTarget(editor);
69176
- if (!fallback)
69177
- return null;
69178
- if (fallback.kind === "structural-end") {
69179
- const pos = fallback.insertPos;
69180
- const syntheticRange = {
69181
- from: pos,
69182
- to: pos
69183
- };
69184
- const syntheticTarget = {
69185
- kind: "text",
69186
- blockId: "",
69187
- range: {
69188
- start: 0,
69189
- end: 0
69190
- }
69191
- };
69192
- return {
69193
- requestedTarget,
69194
- effectiveTarget: syntheticTarget,
69195
- range: syntheticRange,
69196
- resolution: buildTextMutationResolution({
69197
- requestedTarget,
69198
- target: syntheticTarget,
69199
- range: syntheticRange,
69200
- text: ""
69201
- }),
69202
- structuralEnd: true
69203
- };
69204
- }
69205
- const text$2 = readTextAtResolvedRange(editor, fallback.range);
69255
+ const fallback = resolveDefaultInsertTarget(editor);
69256
+ if (!fallback)
69257
+ return null;
69258
+ if (fallback.kind === "structural-end") {
69259
+ const pos = fallback.insertPos;
69260
+ const syntheticRange = {
69261
+ from: pos,
69262
+ to: pos
69263
+ };
69264
+ const syntheticTarget = {
69265
+ kind: "text",
69266
+ blockId: "",
69267
+ range: {
69268
+ start: 0,
69269
+ end: 0
69270
+ }
69271
+ };
69206
69272
  return {
69207
- requestedTarget,
69208
- effectiveTarget: fallback.target,
69209
- range: fallback.range,
69273
+ requestedTarget: undefined,
69274
+ effectiveTarget: syntheticTarget,
69275
+ range: syntheticRange,
69210
69276
  resolution: buildTextMutationResolution({
69211
- requestedTarget,
69212
- target: fallback.target,
69213
- range: fallback.range,
69214
- text: text$2
69215
- })
69277
+ requestedTarget: undefined,
69278
+ target: syntheticTarget,
69279
+ range: syntheticRange,
69280
+ text: ""
69281
+ }),
69282
+ structuralEnd: true
69216
69283
  };
69217
69284
  }
69218
- const target = request.target;
69219
- if (!target)
69220
- return null;
69221
- const range = resolveTextTarget(editor, target);
69222
- if (!range)
69223
- return null;
69285
+ const text$2 = readTextAtResolvedRange(editor, fallback.range);
69224
69286
  return {
69225
- requestedTarget,
69226
- effectiveTarget: target,
69227
- range,
69287
+ requestedTarget: undefined,
69288
+ effectiveTarget: fallback.target,
69289
+ range: fallback.range,
69228
69290
  resolution: buildTextMutationResolution({
69229
- requestedTarget,
69230
- target,
69231
- range,
69232
- text: readTextAtResolvedRange(editor, range)
69291
+ requestedTarget: undefined,
69292
+ target: fallback.target,
69293
+ range: fallback.range,
69294
+ text: text$2
69233
69295
  })
69234
69296
  };
69235
69297
  }
@@ -75030,7 +75092,7 @@ var isRegExp = (value) => {
75030
75092
  tracked: false,
75031
75093
  carrier: runAttributeCarrier2(runPropertyKey ?? key),
75032
75094
  schema
75033
- }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, 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_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, LEGACY_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES2, SNAPSHOT_VERSION2 = "sd-diff-snapshot/v1", PAYLOAD_VERSION2 = "sd-diff-payload/v1", VALID_STYLE_OPTION_FLAGS2, TABLE_BORDER_COLOR_PATTERN2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, PATCH_FIELDS2, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$216) => ({
75095
+ }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, 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_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES2, SNAPSHOT_VERSION2 = "sd-diff-snapshot/v1", PAYLOAD_VERSION2 = "sd-diff-payload/v1", VALID_STYLE_OPTION_FLAGS2, TABLE_BORDER_COLOR_PATTERN2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, PATCH_FIELDS2, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$216) => ({
75034
75096
  handlerName,
75035
75097
  handler: (params) => {
75036
75098
  const { nodes } = params;
@@ -89102,7 +89164,7 @@ var isRegExp = (value) => {
89102
89164
  candidate = candidate.prev;
89103
89165
  }
89104
89166
  }
89105
- }, DocumentApiAdapterError, SectionType, DEFAULT_PARAGRAPH_SECTION_TYPE, DEFAULT_BODY_SECTION_TYPE, TWIPS_PER_INCH = 1440, PX_PER_INCH = 96, DEFAULT_COLUMN_GAP_INCHES = 0.5, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, CommentMarkName = "commentMark", LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, TABLE_LIKE_PREFIX, UUID_LIKE_PATTERN, ALIAS_ELIGIBLE_TYPES, cacheByEditor, OBJECT_REPLACEMENT_CHAR = "", LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH = 96, DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", WORDPROCESSINGML_XMLNS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", OFFICE_DOCUMENT_RELS_XMLNS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", RELATIONSHIP_ID_PATTERN, HEADER_FILE_PATTERN, FOOTER_FILE_PATTERN, SOURCE_HEADER_FOOTER_LOCAL = "header-footer-sync:local", HEADER_PATTERN, FOOTER_PATTERN, DEFAULT_HDR_FTR_ATTRS, HEADER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", VALID_VARIANTS, FOOTNOTES_PART_ID = "word/footnotes.xml", ENDNOTES_PART_ID = "word/endnotes.xml", FOOTNOTES_CONFIG, ENDNOTES_CONFIG, NOTES_XMLNS, footnotesPartDescriptor, endnotesPartDescriptor, storeByEditor, cacheByHost, hostStoreSyncedKeys, BODY_LOCATOR, findMarkPosition = (doc$2, pos, markName) => {
89167
+ }, DocumentApiAdapterError, SectionType, DEFAULT_PARAGRAPH_SECTION_TYPE, DEFAULT_BODY_SECTION_TYPE, TWIPS_PER_INCH = 1440, PX_PER_INCH = 96, DEFAULT_COLUMN_GAP_INCHES = 0.5, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, CommentMarkName = "commentMark", LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, FALLBACK_PREFIX, UUID_LIKE_PATTERN, ALIAS_ELIGIBLE_TYPES, cacheByEditor, OBJECT_REPLACEMENT_CHAR = "", LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH = 96, DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", WORDPROCESSINGML_XMLNS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", OFFICE_DOCUMENT_RELS_XMLNS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", RELATIONSHIP_ID_PATTERN, HEADER_FILE_PATTERN, FOOTER_FILE_PATTERN, SOURCE_HEADER_FOOTER_LOCAL = "header-footer-sync:local", HEADER_PATTERN, FOOTER_PATTERN, DEFAULT_HDR_FTR_ATTRS, HEADER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", VALID_VARIANTS, FOOTNOTES_PART_ID = "word/footnotes.xml", ENDNOTES_PART_ID = "word/endnotes.xml", FOOTNOTES_CONFIG, ENDNOTES_CONFIG, NOTES_XMLNS, footnotesPartDescriptor, endnotesPartDescriptor, storeByEditor, cacheByHost, hostStoreSyncedKeys, BODY_LOCATOR, findMarkPosition = (doc$2, pos, markName) => {
89106
89168
  const $pos = doc$2.resolve(pos);
89107
89169
  const parent = $pos.parent;
89108
89170
  const start = parent.childAfter($pos.parentOffset);
@@ -89204,7 +89266,7 @@ var isRegExp = (value) => {
89204
89266
  state.kern = kernNode.attributes["w:val"];
89205
89267
  }
89206
89268
  }, SuperConverter;
89207
- var init_SuperConverter_Cukh7tk8_es = __esm(() => {
89269
+ var init_SuperConverter_C65zRR3r_es = __esm(() => {
89208
89270
  init_rolldown_runtime_B2q5OVn9_es();
89209
89271
  init_jszip_ChlR43oI_es();
89210
89272
  init_xml_js_BtmJ6bNs_es();
@@ -92352,8 +92414,8 @@ var init_SuperConverter_Cukh7tk8_es = __esm(() => {
92352
92414
  },
92353
92415
  insert: {
92354
92416
  memberPath: "insert",
92355
- description: "Insert content into the document. Two input shapes: legacy string-based (value + type) inserts inline content at a text position within an existing block; structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. When target is omitted, content appends at the end of the document. Legacy mode supports text (default), markdown, and html content types via the `type` field. Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
92356
- expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports a TextAddress for legacy text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
92417
+ description: "Insert content into the document. Two input shapes: text-based (value + type) inserts inline content at a SelectionTarget or ref position within an existing block; structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. When target/ref is omitted, content appends at the end of the document. Text mode supports text (default), markdown, and html content types via the `type` field. Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
92418
+ expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports the inserted TextAddress for text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
92357
92419
  requiresDocumentContext: true,
92358
92420
  metadata: mutationOperation2({
92359
92421
  idempotency: "non-idempotent",
@@ -99293,12 +99355,8 @@ var init_SuperConverter_Cukh7tk8_es = __esm(() => {
99293
99355
  ...objectSchema2({ tables: { enum: ["forbid", "allow"] } }),
99294
99356
  description: "Controls nesting behavior. tables: 'allow' permits inserting tables inside other tables."
99295
99357
  };
99296
- objectSchema2({
99358
+ optionalTargetLocatorWithPayload2({
99297
99359
  in: storyLocatorSchema2,
99298
- target: {
99299
- ...textAddressSchema2,
99300
- description: "Insertion point: {kind:'text', blockId:'...', range:{start, end}}."
99301
- },
99302
99360
  value: {
99303
99361
  type: "string",
99304
99362
  description: "Text content to insert."
@@ -103298,10 +103356,11 @@ var init_SuperConverter_Cukh7tk8_es = __esm(() => {
103298
103356
  "tableOfContents",
103299
103357
  "sdt"
103300
103358
  ]);
103301
- LEGACY_INSERT_ALLOWED_KEYS2 = new Set([
103359
+ TEXT_INSERT_ALLOWED_KEYS2 = new Set([
103302
103360
  "value",
103303
103361
  "type",
103304
103362
  "target",
103363
+ "ref",
103305
103364
  "in"
103306
103365
  ]);
103307
103366
  STRUCTURAL_INSERT_ALLOWED_KEYS2 = new Set([
@@ -124540,9 +124599,12 @@ var init_SuperConverter_Cukh7tk8_es = __esm(() => {
124540
124599
  "tab",
124541
124600
  "lineBreak"
124542
124601
  ]);
124543
- TABLE_LIKE_PREFIX = {
124602
+ FALLBACK_PREFIX = {
124544
124603
  table: "table-auto",
124545
- tableCell: "cell-auto"
124604
+ tableCell: "cell-auto",
124605
+ paragraph: "para-auto",
124606
+ heading: "heading-auto",
124607
+ listItem: "list-auto"
124546
124608
  };
124547
124609
  UUID_LIKE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
124548
124610
  ALIAS_ELIGIBLE_TYPES = new Set([
@@ -152177,7 +152239,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
152177
152239
  init_remark_gfm_z_sDF4ss_es();
152178
152240
  });
152179
152241
 
152180
- // ../../packages/superdoc/dist/chunks/src-D389XrYP.es.js
152242
+ // ../../packages/superdoc/dist/chunks/src-BrT7SmAZ.es.js
152181
152243
  function deleteProps(obj, propOrProps) {
152182
152244
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
152183
152245
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -175893,7 +175955,16 @@ function findTextBlockByNodeId(index2, nodeId) {
175893
175955
  blockId: nodeId,
175894
175956
  matchCount: matches2.length
175895
175957
  });
175896
- return matches2[0];
175958
+ if (matches2.length === 1)
175959
+ return matches2[0];
175960
+ try {
175961
+ const resolved = findBlockByNodeIdOnly(index2, nodeId);
175962
+ if (isTextBlockCandidate(resolved))
175963
+ return resolved;
175964
+ } catch (e) {
175965
+ if (e instanceof DocumentApiAdapterError && e.code === "AMBIGUOUS_TARGET")
175966
+ throw e;
175967
+ }
175897
175968
  }
175898
175969
  function findBlockByTypeAndId(index2, nodeType, nodeId) {
175899
175970
  const key$1 = `${nodeType}:${nodeId}`;
@@ -175902,7 +175973,15 @@ function findBlockByTypeAndId(index2, nodeType, nodeId) {
175902
175973
  nodeType,
175903
175974
  nodeId
175904
175975
  });
175905
- return index2.byId.get(key$1);
175976
+ const exact = index2.byId.get(key$1);
175977
+ if (exact)
175978
+ return exact;
175979
+ try {
175980
+ return findBlockByNodeIdOnly(index2, nodeId);
175981
+ } catch (e) {
175982
+ if (e instanceof DocumentApiAdapterError && e.code === "AMBIGUOUS_TARGET")
175983
+ throw e;
175984
+ }
175906
175985
  }
175907
175986
  function expandDeleteSelection(editor, absFrom, absTo, start$1, end$1) {
175908
175987
  if (absFrom === absTo)
@@ -176342,7 +176421,13 @@ function resolveTextRef(editor, index2, step3, ref$1) {
176342
176421
  return resolveV3TextRef(editor, index2, step3, decoded);
176343
176422
  }
176344
176423
  function resolveBlockRef(editor, index2, step3, ref$1) {
176345
- const candidate = index2.candidates.find((c) => c.nodeId === ref$1);
176424
+ const primaryMatches = index2.candidates.filter((c) => c.nodeId === ref$1);
176425
+ if (primaryMatches.length > 1)
176426
+ throw planError("AMBIGUOUS_TARGET", `Multiple blocks share nodeId "${ref$1}".`, step3.id, {
176427
+ ref: ref$1,
176428
+ count: primaryMatches.length
176429
+ });
176430
+ const candidate = primaryMatches[0] ?? resolveBlockAlias(index2, ref$1);
176346
176431
  if (!candidate)
176347
176432
  return [];
176348
176433
  const blockText = getBlockText(editor, candidate);
@@ -178751,6 +178836,18 @@ function resolveMutationStory(context) {
178751
178836
  const effectiveTargetStory = context.target?.story ?? storyFromRef;
178752
178837
  return resolveStoryFromInput({ in: context.in }, effectiveTargetStory ? { story: effectiveTargetStory } : undefined);
178753
178838
  }
178839
+ function nodeEdgeAfterOffset(editor, nodeType, nodeId) {
178840
+ const index2 = getBlockIndex(editor);
178841
+ const key$1 = `${nodeType}:${nodeId}`;
178842
+ const block = index2.byId.get(key$1);
178843
+ if (!block || !block.node.isTextblock)
178844
+ return 0;
178845
+ const contentStart = block.pos + 1;
178846
+ const contentEnd = block.end - 1;
178847
+ if (contentEnd <= contentStart)
178848
+ return 0;
178849
+ return editor.state.doc.textBetween(contentStart, contentEnd, "", "").length;
178850
+ }
178754
178851
  function editorHasDom(editor) {
178755
178852
  const opts = editor.options;
178756
178853
  return !!(opts?.document ?? opts?.mockDocument ?? (typeof document !== "undefined" ? document : null));
@@ -178821,31 +178918,6 @@ function toTextAddress$1(target) {
178821
178918
  }
178822
178919
  };
178823
178920
  }
178824
- function normalizeWriteLocator(request) {
178825
- const hasBlockId = request.blockId !== undefined;
178826
- const hasOffset = request.offset !== undefined;
178827
- if (hasOffset && request.target)
178828
- throw new DocumentApiAdapterError("INVALID_TARGET", "Cannot combine target with offset on insert request.", { fields: ["target", "offset"] });
178829
- if (hasOffset && !hasBlockId)
178830
- throw new DocumentApiAdapterError("INVALID_TARGET", "offset requires blockId on insert request.", { fields: ["offset", "blockId"] });
178831
- if (!hasBlockId)
178832
- return request;
178833
- if (request.target)
178834
- throw new DocumentApiAdapterError("INVALID_TARGET", "Cannot combine target with blockId on insert request.", { fields: ["target", "blockId"] });
178835
- const effectiveOffset = request.offset ?? 0;
178836
- return {
178837
- kind: "insert",
178838
- target: {
178839
- kind: "text",
178840
- blockId: request.blockId,
178841
- range: {
178842
- start: effectiveOffset,
178843
- end: effectiveOffset
178844
- }
178845
- },
178846
- text: request.text
178847
- };
178848
- }
178849
178921
  function mapPlanReceiptToTextReceipt(_receipt, resolution) {
178850
178922
  return {
178851
178923
  success: true,
@@ -178902,11 +178974,10 @@ function writeWrapper(editor, request, options) {
178902
178974
  const runtime = resolveWriteStoryRuntime(editor, request.in);
178903
178975
  try {
178904
178976
  const storyEditor = runtime.editor;
178905
- const normalizedRequest = normalizeWriteLocator(request);
178906
- const resolved = resolveWriteTarget(storyEditor, normalizedRequest);
178977
+ const resolved = resolveWriteTarget(storyEditor, request);
178907
178978
  if (!resolved)
178908
- throw new DocumentApiAdapterError("TARGET_NOT_FOUND", "Mutation target could not be resolved.", { target: normalizedRequest.target });
178909
- const validationFailure = validateWriteRequest(normalizedRequest, resolved);
178979
+ throw new DocumentApiAdapterError("TARGET_NOT_FOUND", "Mutation target could not be resolved.", {});
178980
+ const validationFailure = validateWriteRequest(request, resolved);
178910
178981
  if (validationFailure)
178911
178982
  return {
178912
178983
  success: false,
@@ -178923,7 +178994,7 @@ function writeWrapper(editor, request, options) {
178923
178994
  };
178924
178995
  if (resolved.structuralEnd) {
178925
178996
  const insertPos = resolved.range.from;
178926
- const text5 = normalizedRequest.text ?? "";
178997
+ const text5 = request.text ?? "";
178927
178998
  const receipt$1 = executeDomainCommand(storyEditor, () => {
178928
178999
  insertParagraphAtEnd(storyEditor, insertPos, text5, mode === "tracked" ? applyTrackedMutationMeta : applyDirectMutationMeta);
178929
179000
  return true;
@@ -178941,7 +179012,7 @@ function writeWrapper(editor, request, options) {
178941
179012
  where: STUB_WHERE,
178942
179013
  args: {
178943
179014
  position: "before",
178944
- content: { text: normalizedRequest.text ?? "" }
179015
+ content: { text: request.text ?? "" }
178945
179016
  }
178946
179017
  },
178947
179018
  targets: [toCompiledTarget(stepId, "text.insert", resolved)]
@@ -179003,6 +179074,16 @@ function buildSelectionStepDef(stepId, request, where) {
179003
179074
  style: { inline: { mode: "preserve" } }
179004
179075
  }
179005
179076
  };
179077
+ case "insert":
179078
+ return {
179079
+ id: stepId,
179080
+ op: "text.insert",
179081
+ where,
179082
+ args: {
179083
+ position: "before",
179084
+ content: { text: request.text }
179085
+ }
179086
+ };
179006
179087
  case "format":
179007
179088
  return {
179008
179089
  id: stepId,
@@ -179027,12 +179108,52 @@ function selectionMutationWrapper(editor, request, options) {
179027
179108
  }
179028
179109
  const stepId = v4_default();
179029
179110
  const compiled = compilePlan(storyEditor, [buildSelectionStepDef(stepId, request, buildSelectionWhere(request))]);
179111
+ if (request.kind === "insert" && request.target) {
179112
+ if (request.target.start.kind === "nodeEdge" || request.target.end.kind === "nodeEdge")
179113
+ throw new DocumentApiAdapterError("INVALID_TARGET", "Text inserts do not support nodeEdge targets. Use a text-offset target inside a textblock.");
179114
+ }
179115
+ if (request.kind === "insert") {
179116
+ const target = compiled.mutationSteps.find((s2) => s2.step.id === stepId)?.targets[0];
179117
+ if (target) {
179118
+ if (target.kind === "span")
179119
+ return {
179120
+ success: false,
179121
+ resolution: buildSelectionResolutionFromCompiled(compiled, stepId),
179122
+ failure: {
179123
+ code: "INVALID_TARGET",
179124
+ message: "Insert operations require a single-block target, not a multi-segment span."
179125
+ }
179126
+ };
179127
+ if (target.kind === "range") {
179128
+ if (!storyEditor.state.doc.resolve(target.absFrom).parent.isTextblock)
179129
+ return {
179130
+ success: false,
179131
+ resolution: buildSelectionResolutionFromCompiled(compiled, stepId),
179132
+ failure: {
179133
+ code: "INVALID_TARGET",
179134
+ message: "Text insert target must be inside a textblock."
179135
+ }
179136
+ };
179137
+ }
179138
+ }
179139
+ }
179030
179140
  checkRevision(storyEditor, options?.expectedRevision);
179031
- if (options?.dryRun)
179141
+ if (options?.dryRun) {
179142
+ const resolution$1 = buildSelectionResolutionFromCompiled(compiled, stepId);
179143
+ if (request.kind === "insert" && !request.text)
179144
+ return {
179145
+ success: false,
179146
+ resolution: resolution$1,
179147
+ failure: {
179148
+ code: "NO_OP",
179149
+ message: "Insert text is empty."
179150
+ }
179151
+ };
179032
179152
  return {
179033
179153
  success: true,
179034
- resolution: buildSelectionResolutionFromCompiled(compiled, stepId)
179154
+ resolution: resolution$1
179035
179155
  };
179156
+ }
179036
179157
  const stepOutcome = executeCompiledPlan(storyEditor, compiled, {
179037
179158
  changeMode: mode,
179038
179159
  expectedRevision: options?.expectedRevision
@@ -179173,17 +179294,68 @@ function insertStructuredInner(editor, input2, options) {
179173
179294
  if (isStructuralInsertInput2(input2))
179174
179295
  return executeStructuralInsertWrapper(editor, input2, options);
179175
179296
  const contentType = input2.type ?? "text";
179176
- const { value, target } = input2;
179297
+ const { value, target, ref: ref$1 } = input2;
179177
179298
  if ((options?.changeMode ?? "direct") === "tracked")
179178
179299
  throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", `Tracked mode is not supported for type: '${contentType}' insert operations.`);
179179
179300
  let resolvedRange;
179180
179301
  let effectiveTarget;
179302
+ if (ref$1 !== undefined && ref$1 === "")
179303
+ throw new DocumentApiAdapterError("INVALID_TARGET", "ref must be a non-empty string.", { ref: ref$1 });
179181
179304
  if (target) {
179182
- const range = resolveTextTarget(editor, target);
179183
- if (!range)
179184
- throw new DocumentApiAdapterError("TARGET_NOT_FOUND", "Structured insert target could not be resolved.", { target });
179185
- resolvedRange = range;
179186
- effectiveTarget = target;
179305
+ const resolved = resolveSelectionTarget(editor, target);
179306
+ resolvedRange = {
179307
+ from: resolved.absFrom,
179308
+ to: resolved.absTo
179309
+ };
179310
+ const startPoint = target.start;
179311
+ const blockId = startPoint.kind === "text" ? startPoint.blockId : startPoint.node.nodeId;
179312
+ let offset$1;
179313
+ if (startPoint.kind === "text")
179314
+ offset$1 = startPoint.offset;
179315
+ else if (startPoint.edge === "after")
179316
+ offset$1 = nodeEdgeAfterOffset(editor, startPoint.node.nodeType, startPoint.node.nodeId);
179317
+ else
179318
+ offset$1 = 0;
179319
+ effectiveTarget = {
179320
+ kind: "text",
179321
+ blockId,
179322
+ range: {
179323
+ start: offset$1,
179324
+ end: offset$1
179325
+ }
179326
+ };
179327
+ } else if (ref$1) {
179328
+ const dummyStepId = v4_default();
179329
+ const compiled = compilePlan(editor, [{
179330
+ id: dummyStepId,
179331
+ op: "text.insert",
179332
+ where: {
179333
+ by: "ref",
179334
+ ref: ref$1
179335
+ },
179336
+ args: {
179337
+ position: "before",
179338
+ content: { text: "" }
179339
+ }
179340
+ }]);
179341
+ const compiledTarget = compiled.mutationSteps.find((s2) => s2.step.id === dummyStepId)?.targets[0];
179342
+ if (!compiledTarget)
179343
+ throw new DocumentApiAdapterError("TARGET_NOT_FOUND", "Structured insert ref could not be resolved.", { ref: ref$1 });
179344
+ if (compiledTarget.kind === "span")
179345
+ throw new DocumentApiAdapterError("INVALID_TARGET", "Insert operations require a single-block ref. Multi-segment refs are not supported.", { ref: ref$1 });
179346
+ resolvedRange = {
179347
+ from: compiledTarget.absFrom,
179348
+ to: compiledTarget.absFrom
179349
+ };
179350
+ const refTarget = buildSelectionResolutionFromCompiled(compiled, dummyStepId).target;
179351
+ effectiveTarget = {
179352
+ kind: "text",
179353
+ blockId: refTarget.blockId,
179354
+ range: {
179355
+ start: refTarget.range.start,
179356
+ end: refTarget.range.start
179357
+ }
179358
+ };
179187
179359
  } else {
179188
179360
  const fallback = resolveDefaultInsertTarget(editor);
179189
179361
  if (!fallback)
@@ -179208,13 +179380,13 @@ function insertStructuredInner(editor, input2, options) {
179208
179380
  }
179209
179381
  }
179210
179382
  const resolution = buildTextMutationResolution({
179211
- requestedTarget: target,
179383
+ requestedTarget: effectiveTarget,
179212
179384
  target: effectiveTarget,
179213
179385
  range: resolvedRange,
179214
179386
  text: readTextAtResolvedRange(editor, resolvedRange)
179215
179387
  });
179216
179388
  const { from: from$1, to } = resolvedRange;
179217
- if (from$1 !== to)
179389
+ if (target && from$1 !== to)
179218
179390
  return {
179219
179391
  success: false,
179220
179392
  resolution,
@@ -231390,9 +231562,9 @@ var Node$13 = class Node$14 {
231390
231562
  return;
231391
231563
  console.log(...args$1);
231392
231564
  }, 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;
231393
- var init_src_D389XrYP_es = __esm(() => {
231565
+ var init_src_BrT7SmAZ_es = __esm(() => {
231394
231566
  init_rolldown_runtime_B2q5OVn9_es();
231395
- init_SuperConverter_Cukh7tk8_es();
231567
+ init_SuperConverter_C65zRR3r_es();
231396
231568
  init_jszip_ChlR43oI_es();
231397
231569
  init_uuid_qzgm05fK_es();
231398
231570
  init_constants_ep1_Gwqi_es();
@@ -264697,8 +264869,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
264697
264869
 
264698
264870
  // ../../packages/superdoc/dist/super-editor.es.js
264699
264871
  var init_super_editor_es = __esm(() => {
264700
- init_src_D389XrYP_es();
264701
- init_SuperConverter_Cukh7tk8_es();
264872
+ init_src_BrT7SmAZ_es();
264873
+ init_SuperConverter_C65zRR3r_es();
264702
264874
  init_jszip_ChlR43oI_es();
264703
264875
  init_xml_js_BtmJ6bNs_es();
264704
264876
  init_constants_ep1_Gwqi_es();
@@ -320035,10 +320207,11 @@ function normalizeFlatTargetFlags(operationId, apiInput) {
320035
320207
  if (SELECTION_TARGET_OPERATIONS.has(operationId)) {
320036
320208
  const blockId = apiInput.blockId;
320037
320209
  if (typeof blockId === "string") {
320038
- const start3 = typeof apiInput.start === "number" ? apiInput.start : 0;
320039
- const end2 = typeof apiInput.end === "number" ? apiInput.end : 0;
320210
+ const hasOffset = typeof apiInput.offset === "number";
320211
+ const start3 = typeof apiInput.start === "number" ? apiInput.start : hasOffset ? apiInput.offset : 0;
320212
+ const end2 = typeof apiInput.end === "number" ? apiInput.end : hasOffset ? apiInput.offset : 0;
320040
320213
  assertLegacySelectionTargetSupported(operationId, { range: { start: start3, end: end2 } });
320041
- const { blockId: _2, start: _s, end: _e, ...rest } = apiInput;
320214
+ const { blockId: _2, start: _s, end: _e, offset: _o, ...rest } = apiInput;
320042
320215
  return {
320043
320216
  ...rest,
320044
320217
  target: textAddressToSelectionTarget({ blockId, range: { start: start3, end: end2 } })
@@ -320059,18 +320232,6 @@ function normalizeFlatTargetFlags(operationId, apiInput) {
320059
320232
  }
320060
320233
  return apiInput;
320061
320234
  }
320062
- if (operationId === INSERT_OPERATION) {
320063
- const blockId = apiInput.blockId;
320064
- if (typeof blockId === "string") {
320065
- const offset3 = typeof apiInput.offset === "number" ? apiInput.offset : 0;
320066
- const { blockId: _2, offset: _o, ...rest } = apiInput;
320067
- return {
320068
- ...rest,
320069
- target: { kind: "text", blockId, range: { start: offset3, end: offset3 } }
320070
- };
320071
- }
320072
- return apiInput;
320073
- }
320074
320235
  if (operationId === "blocks.delete") {
320075
320236
  const nodeType2 = apiInput.nodeType;
320076
320237
  const nodeId = apiInput.nodeId;
@@ -320112,7 +320273,7 @@ function extractInvokeInput(operationId, cliInput) {
320112
320273
  }
320113
320274
  return normalizeFlatTargetFlags(operationId, apiInput);
320114
320275
  }
320115
- var WRAPPED_INPUT_KEY, PARAM_RENAMES, CLI_LEVEL_KEYS, CHANGEMODE_IN_INPUT, FORMAT_TARGET_OPERATIONS, SELECTION_TARGET_OPERATIONS, TEXT_ADDRESS_TARGET_OPERATIONS, INSERT_OPERATION = "insert", LIST_TARGET_OPERATIONS;
320276
+ var WRAPPED_INPUT_KEY, PARAM_RENAMES, CLI_LEVEL_KEYS, CHANGEMODE_IN_INPUT, FORMAT_TARGET_OPERATIONS, SELECTION_TARGET_OPERATIONS, TEXT_ADDRESS_TARGET_OPERATIONS, LIST_TARGET_OPERATIONS;
320116
320277
  var init_invoke_input = __esm(() => {
320117
320278
  init_errors();
320118
320279
  init_operation_set();
@@ -320159,7 +320320,12 @@ var init_invoke_input = __esm(() => {
320159
320320
  CLI_LEVEL_KEYS = new Set(["doc", "sessionId", "out", "dryRun", "force", "expectedRevision", "changeMode"]);
320160
320321
  CHANGEMODE_IN_INPUT = new Set(["mutations.apply", "mutations.preview"]);
320161
320322
  FORMAT_TARGET_OPERATIONS = CLI_DOC_OPERATIONS.filter((operationId) => operationId.startsWith("format."));
320162
- SELECTION_TARGET_OPERATIONS = new Set(["replace", "delete", ...FORMAT_TARGET_OPERATIONS]);
320323
+ SELECTION_TARGET_OPERATIONS = new Set([
320324
+ "insert",
320325
+ "replace",
320326
+ "delete",
320327
+ ...FORMAT_TARGET_OPERATIONS
320328
+ ]);
320163
320329
  TEXT_ADDRESS_TARGET_OPERATIONS = new Set(["comments.create", "comments.patch"]);
320164
320330
  LIST_TARGET_OPERATIONS = new Set([
320165
320331
  "lists.insert",
@@ -321388,7 +321554,7 @@ function deriveOptionSpecs(operationId, params4) {
321388
321554
  }
321389
321555
  return specs;
321390
321556
  }
321391
- var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, INSERT_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, OPTION_FLAG_ALIASES, CLI_OPERATION_OPTION_SPECS;
321557
+ var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, OPTION_FLAG_ALIASES, CLI_OPERATION_OPTION_SPECS;
321392
321558
  var init_operation_params = __esm(() => {
321393
321559
  init_src();
321394
321560
  init_commands();
@@ -321493,10 +321659,6 @@ var init_operation_params = __esm(() => {
321493
321659
  { name: "start", kind: "flag", type: "number", description: "Start offset within the block (character index)." },
321494
321660
  { name: "end", kind: "flag", type: "number", description: "End offset within the block (character index)." }
321495
321661
  ];
321496
- INSERT_FLAT_PARAMS = [
321497
- { name: "blockId", kind: "flag", flag: "block-id", type: "string", description: "Block ID of the target paragraph." },
321498
- { name: "offset", kind: "flag", type: "number", description: "Character offset within the block for insertion." }
321499
- ];
321500
321662
  LIST_TARGET_FLAT_PARAMS = [
321501
321663
  { name: "nodeId", kind: "flag", flag: "node-id", type: "string", description: "Node ID of the target list item." }
321502
321664
  ];
@@ -321545,7 +321707,15 @@ var init_operation_params = __esm(() => {
321545
321707
  description: "Node address to retrieve (block or inline address object)."
321546
321708
  }
321547
321709
  ],
321548
- "doc.insert": [...INSERT_FLAT_PARAMS],
321710
+ "doc.insert": [
321711
+ ...TEXT_TARGET_FLAT_PARAMS,
321712
+ {
321713
+ name: "offset",
321714
+ kind: "flag",
321715
+ type: "number",
321716
+ description: "Character offset for insertion (alias for --start/--end with same value)."
321717
+ }
321718
+ ],
321549
321719
  "doc.replace": [...TEXT_TARGET_FLAT_PARAMS],
321550
321720
  "doc.delete": [...TEXT_TARGET_FLAT_PARAMS],
321551
321721
  "doc.styles.apply": [
@@ -322564,7 +322734,7 @@ function acceptsLegacyTextAddressTarget(operationId, param, value2) {
322564
322734
  if (param.name !== "target" || !isTextAddressLike2(value2))
322565
322735
  return false;
322566
322736
  const docApiId = toDocApiId(operationId);
322567
- return docApiId === "replace" || docApiId === "delete" || docApiId?.startsWith("format.") === true;
322737
+ return docApiId === "insert" || docApiId === "replace" || docApiId === "delete" || docApiId?.startsWith("format.") === true;
322568
322738
  }
322569
322739
  function extractConstValues(variants) {
322570
322740
  const values2 = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.3.0-next.55",
3
+ "version": "0.3.0-next.56",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -20,21 +20,21 @@
20
20
  "@types/bun": "^1.3.8",
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
- "@superdoc/document-api": "0.0.1",
24
- "@superdoc/super-editor": "0.0.1",
23
+ "@superdoc/pm-adapter": "0.0.0",
25
24
  "superdoc": "1.20.0",
26
- "@superdoc/pm-adapter": "0.0.0"
25
+ "@superdoc/super-editor": "0.0.1",
26
+ "@superdoc/document-api": "0.0.1"
27
27
  },
28
28
  "module": "src/index.ts",
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.55",
34
- "@superdoc-dev/cli-darwin-x64": "0.3.0-next.55",
35
- "@superdoc-dev/cli-linux-x64": "0.3.0-next.55",
36
- "@superdoc-dev/cli-linux-arm64": "0.3.0-next.55",
37
- "@superdoc-dev/cli-windows-x64": "0.3.0-next.55"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.56",
34
+ "@superdoc-dev/cli-darwin-x64": "0.3.0-next.56",
35
+ "@superdoc-dev/cli-linux-x64": "0.3.0-next.56",
36
+ "@superdoc-dev/cli-linux-arm64": "0.3.0-next.56",
37
+ "@superdoc-dev/cli-windows-x64": "0.3.0-next.56"
38
38
  },
39
39
  "scripts": {
40
40
  "predev": "node scripts/ensure-superdoc-build.js",