@superdoc-dev/cli 0.2.0-next.30 → 0.2.0-next.32

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 +2462 -85
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -436,6 +436,7 @@ var init_base = __esm(() => {
436
436
  "table",
437
437
  "tableRow",
438
438
  "tableCell",
439
+ "tableOfContents",
439
440
  "image",
440
441
  "sdt",
441
442
  "run",
@@ -453,6 +454,7 @@ var init_base = __esm(() => {
453
454
  "table",
454
455
  "tableRow",
455
456
  "tableCell",
457
+ "tableOfContents",
456
458
  "image",
457
459
  "sdt"
458
460
  ];
@@ -2490,6 +2492,89 @@ var init_operation_definitions = __esm(() => {
2490
2492
  }),
2491
2493
  referenceDocPath: "tables/get-properties.mdx",
2492
2494
  referenceGroup: "tables"
2495
+ },
2496
+ "create.tableOfContents": {
2497
+ memberPath: "create.tableOfContents",
2498
+ description: "Insert a new table of contents at the target position.",
2499
+ expectedResult: "Returns a CreateTableOfContentsResult with the new TOC block address.",
2500
+ requiresDocumentContext: true,
2501
+ metadata: mutationOperation({
2502
+ idempotency: "non-idempotent",
2503
+ supportsDryRun: true,
2504
+ supportsTrackedMode: false,
2505
+ possibleFailureCodes: ["NO_OP", "INVALID_INSERTION_CONTEXT"],
2506
+ throws: ["INVALID_TARGET", "TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE"]
2507
+ }),
2508
+ referenceDocPath: "create/table-of-contents.mdx",
2509
+ referenceGroup: "create"
2510
+ },
2511
+ "toc.list": {
2512
+ memberPath: "toc.list",
2513
+ description: "List all tables of contents in the document.",
2514
+ expectedResult: "Returns a TocListResult with an array of TOC discovery items and pagination metadata.",
2515
+ requiresDocumentContext: true,
2516
+ metadata: readOperation({
2517
+ idempotency: "idempotent"
2518
+ }),
2519
+ referenceDocPath: "toc/list.mdx",
2520
+ referenceGroup: "toc"
2521
+ },
2522
+ "toc.get": {
2523
+ memberPath: "toc.get",
2524
+ description: "Retrieve details of a specific table of contents.",
2525
+ expectedResult: "Returns a TocInfo object with the instruction, source/display configuration, and entry count.",
2526
+ requiresDocumentContext: true,
2527
+ metadata: readOperation({
2528
+ idempotency: "idempotent",
2529
+ throws: T_NOT_FOUND
2530
+ }),
2531
+ referenceDocPath: "toc/get.mdx",
2532
+ referenceGroup: "toc"
2533
+ },
2534
+ "toc.configure": {
2535
+ memberPath: "toc.configure",
2536
+ description: "Update the configuration switches of a table of contents.",
2537
+ expectedResult: "Returns a TocMutationResult with the updated TOC address on success, or a failure code on no-op.",
2538
+ requiresDocumentContext: true,
2539
+ metadata: mutationOperation({
2540
+ idempotency: "conditional",
2541
+ supportsDryRun: true,
2542
+ supportsTrackedMode: false,
2543
+ possibleFailureCodes: ["NO_OP"],
2544
+ throws: ["TARGET_NOT_FOUND", "INVALID_TARGET", "CAPABILITY_UNAVAILABLE"]
2545
+ }),
2546
+ referenceDocPath: "toc/configure.mdx",
2547
+ referenceGroup: "toc"
2548
+ },
2549
+ "toc.update": {
2550
+ memberPath: "toc.update",
2551
+ description: "Rebuild the materialized content of a table of contents.",
2552
+ expectedResult: "Returns a TocMutationResult with the TOC address on success, or a failure code if content is unchanged.",
2553
+ requiresDocumentContext: true,
2554
+ metadata: mutationOperation({
2555
+ idempotency: "conditional",
2556
+ supportsDryRun: true,
2557
+ supportsTrackedMode: false,
2558
+ possibleFailureCodes: ["NO_OP"],
2559
+ throws: ["TARGET_NOT_FOUND", "INVALID_TARGET", "CAPABILITY_UNAVAILABLE"]
2560
+ }),
2561
+ referenceDocPath: "toc/update.mdx",
2562
+ referenceGroup: "toc"
2563
+ },
2564
+ "toc.remove": {
2565
+ memberPath: "toc.remove",
2566
+ description: "Remove a table of contents from the document.",
2567
+ expectedResult: "Returns a TocMutationResult with the removed TOC address on success, or a failure code on no-op.",
2568
+ requiresDocumentContext: true,
2569
+ metadata: mutationOperation({
2570
+ idempotency: "conditional",
2571
+ supportsDryRun: true,
2572
+ supportsTrackedMode: false,
2573
+ possibleFailureCodes: ["NO_OP"],
2574
+ throws: ["TARGET_NOT_FOUND", "INVALID_TARGET", "CAPABILITY_UNAVAILABLE"]
2575
+ }),
2576
+ referenceDocPath: "toc/remove.mdx",
2577
+ referenceGroup: "toc"
2493
2578
  }
2494
2579
  };
2495
2580
  OPERATION_IDS = Object.freeze(Object.keys(OPERATION_DEFINITIONS));
@@ -2800,6 +2885,18 @@ function supportsImplicitTrueValue(operationId) {
2800
2885
  return false;
2801
2886
  return entry.type === "boolean" || key === "underline";
2802
2887
  }
2888
+ function tocAddressSchema() {
2889
+ return objectSchema({
2890
+ kind: { const: "block" },
2891
+ nodeType: { const: "tableOfContents" },
2892
+ nodeId: { type: "string" }
2893
+ }, ["kind", "nodeType", "nodeId"]);
2894
+ }
2895
+ function tocMutationResultSchema() {
2896
+ return {
2897
+ oneOf: [tocMutationSuccessSchema, tocMutationFailureSchema]
2898
+ };
2899
+ }
2803
2900
  function buildInternalContractSchemas() {
2804
2901
  const operations = { ...operationSchemas };
2805
2902
  for (const operationId of OPERATION_IDS) {
@@ -2819,7 +2916,7 @@ function buildInternalContractSchemas() {
2819
2916
  operations
2820
2917
  };
2821
2918
  }
2822
- var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, selectSchema, findInputSchema, findItemDomainSchema, findOutputSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, 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, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, insertInputSchema, tableLocatorSchema, _tableScopedRowLocatorSchema, _tableScopedColumnLocatorSchema, mergeRangeLocatorSchema, mixedRowLocatorOneOf, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, formatInlineAliasOperationSchemas, operationSchemas;
2919
+ var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, selectSchema, findInputSchema, findItemDomainSchema, findOutputSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, 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, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, insertInputSchema, tableLocatorSchema, _tableScopedRowLocatorSchema, _tableScopedColumnLocatorSchema, mergeRangeLocatorSchema, mixedRowLocatorOneOf, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, operationSchemas;
2823
2920
  var init_schemas = __esm(() => {
2824
2921
  init_command_catalog();
2825
2922
  init_types2();
@@ -2839,6 +2936,7 @@ var init_schemas = __esm(() => {
2839
2936
  "trackedChange",
2840
2937
  "table",
2841
2938
  "tableCell",
2939
+ "tableOfContents",
2842
2940
  "section",
2843
2941
  "sdt",
2844
2942
  "field"
@@ -3504,6 +3602,25 @@ var init_schemas = __esm(() => {
3504
3602
  };
3505
3603
  return [operationId, schema];
3506
3604
  }));
3605
+ tocMutationFailureCodes = [
3606
+ "NO_OP",
3607
+ "INVALID_TARGET",
3608
+ "TARGET_NOT_FOUND",
3609
+ "CAPABILITY_UNAVAILABLE",
3610
+ "INVALID_INSERTION_CONTEXT"
3611
+ ];
3612
+ tocMutationFailureSchema = objectSchema({
3613
+ success: { const: false },
3614
+ failure: objectSchema({
3615
+ code: { enum: [...tocMutationFailureCodes] },
3616
+ message: { type: "string" },
3617
+ details: {}
3618
+ }, ["code", "message"])
3619
+ }, ["success", "failure"]);
3620
+ tocMutationSuccessSchema = objectSchema({ success: { const: true }, toc: tocAddressSchema() }, [
3621
+ "success",
3622
+ "toc"
3623
+ ]);
3507
3624
  operationSchemas = {
3508
3625
  find: {
3509
3626
  input: findInputSchema,
@@ -4713,6 +4830,94 @@ var init_schemas = __esm(() => {
4713
4830
  bandedColumns: { type: "boolean" }
4714
4831
  })
4715
4832
  }, ["nodeId"])
4833
+ },
4834
+ "create.tableOfContents": {
4835
+ input: objectSchema({
4836
+ at: {
4837
+ oneOf: [
4838
+ objectSchema({ kind: { const: "documentStart" } }, ["kind"]),
4839
+ objectSchema({ kind: { const: "documentEnd" } }, ["kind"]),
4840
+ objectSchema({ kind: { const: "before" }, target: blockNodeAddressSchema }, ["kind", "target"]),
4841
+ objectSchema({ kind: { const: "after" }, target: blockNodeAddressSchema }, ["kind", "target"])
4842
+ ]
4843
+ },
4844
+ config: objectSchema({
4845
+ outlineLevels: objectSchema({ from: { type: "integer" }, to: { type: "integer" } }, ["from", "to"]),
4846
+ useAppliedOutlineLevel: { type: "boolean" },
4847
+ hyperlinks: { type: "boolean" },
4848
+ hideInWebView: { type: "boolean" },
4849
+ omitPageNumberLevels: objectSchema({ from: { type: "integer" }, to: { type: "integer" } }, ["from", "to"]),
4850
+ separator: { type: "string" }
4851
+ })
4852
+ }),
4853
+ output: tocMutationResultSchema(),
4854
+ success: tocMutationSuccessSchema,
4855
+ failure: tocMutationFailureSchema
4856
+ },
4857
+ "toc.list": {
4858
+ input: objectSchema({
4859
+ limit: { type: "integer" },
4860
+ offset: { type: "integer" }
4861
+ }),
4862
+ output: objectSchema({
4863
+ evaluatedRevision: { type: "string" },
4864
+ total: { type: "integer" },
4865
+ items: arraySchema(objectSchema({
4866
+ id: { type: "string" },
4867
+ handle: ref("ResolvedHandle"),
4868
+ address: tocAddressSchema(),
4869
+ instruction: { type: "string" },
4870
+ sourceConfig: { type: "object" },
4871
+ displayConfig: { type: "object" },
4872
+ preserved: { type: "object" },
4873
+ entryCount: { type: "integer" }
4874
+ }, ["id", "handle", "address", "instruction", "entryCount"])),
4875
+ page: ref("PageInfo")
4876
+ }, ["evaluatedRevision", "total", "items", "page"])
4877
+ },
4878
+ "toc.get": {
4879
+ input: objectSchema({ target: tocAddressSchema() }, ["target"]),
4880
+ output: objectSchema({
4881
+ nodeType: { const: "tableOfContents" },
4882
+ kind: { const: "block" },
4883
+ properties: objectSchema({
4884
+ instruction: { type: "string" },
4885
+ sourceConfig: { type: "object" },
4886
+ displayConfig: { type: "object" },
4887
+ preservedSwitches: { type: "object" },
4888
+ entryCount: { type: "integer" }
4889
+ }, ["instruction", "entryCount"])
4890
+ }, ["nodeType", "kind", "properties"])
4891
+ },
4892
+ "toc.configure": {
4893
+ input: objectSchema({
4894
+ target: tocAddressSchema(),
4895
+ patch: objectSchema({
4896
+ outlineLevels: objectSchema({ from: { type: "integer" }, to: { type: "integer" } }, ["from", "to"]),
4897
+ useAppliedOutlineLevel: { type: "boolean" },
4898
+ hyperlinks: { type: "boolean" },
4899
+ hideInWebView: { type: "boolean" },
4900
+ omitPageNumberLevels: objectSchema({ from: { type: "integer" }, to: { type: "integer" } }, ["from", "to"]),
4901
+ separator: { type: "string" }
4902
+ })
4903
+ }, ["target", "patch"]),
4904
+ output: tocMutationResultSchema(),
4905
+ success: tocMutationSuccessSchema,
4906
+ failure: tocMutationFailureSchema
4907
+ },
4908
+ "toc.update": {
4909
+ input: objectSchema({
4910
+ target: tocAddressSchema()
4911
+ }, ["target"]),
4912
+ output: tocMutationResultSchema(),
4913
+ success: tocMutationSuccessSchema,
4914
+ failure: tocMutationFailureSchema
4915
+ },
4916
+ "toc.remove": {
4917
+ input: objectSchema({ target: tocAddressSchema() }, ["target"]),
4918
+ output: tocMutationResultSchema(),
4919
+ success: tocMutationSuccessSchema,
4920
+ failure: tocMutationFailureSchema
4716
4921
  }
4717
4922
  };
4718
4923
  });
@@ -4797,6 +5002,11 @@ var init_reference_doc_map = __esm(() => {
4797
5002
  title: "Tables",
4798
5003
  description: "Table structure, layout, styling, and cell operations.",
4799
5004
  pagePath: "tables/index.mdx"
5005
+ },
5006
+ toc: {
5007
+ title: "Table of Contents",
5008
+ description: "Table of contents lifecycle and configuration.",
5009
+ pagePath: "toc/index.mdx"
4800
5010
  }
4801
5011
  };
4802
5012
  REFERENCE_OPERATION_GROUPS = Object.keys(GROUP_METADATA).map((key) => ({
@@ -5598,6 +5808,24 @@ function executeCreateSectionBreak(adapter, input, options) {
5598
5808
  validateCreateSectionBreakInput(normalized);
5599
5809
  return adapter.sectionBreak(normalized, normalizeMutationOptions(options));
5600
5810
  }
5811
+ function normalizeTocCreateLocation(location2) {
5812
+ return location2 ?? { kind: "documentEnd" };
5813
+ }
5814
+ function normalizeCreateTableOfContentsInput(input) {
5815
+ return {
5816
+ at: normalizeTocCreateLocation(input.at),
5817
+ config: input.config
5818
+ };
5819
+ }
5820
+ function executeCreateTableOfContents(adapter, input, options) {
5821
+ const normalized = normalizeCreateTableOfContentsInput(input);
5822
+ const at = normalized.at;
5823
+ if ((at.kind === "before" || at.kind === "after") && "nodeId" in at) {
5824
+ throw new DocumentApiValidationError("INVALID_TARGET", "create.tableOfContents requires at.target for before/after positioning. The nodeId form is not supported.", { fields: ["at.nodeId"] });
5825
+ }
5826
+ validateTargetOnlyCreateLocation(at, "create.tableOfContents");
5827
+ return adapter.tableOfContents(normalized, normalizeMutationOptions(options));
5828
+ }
5601
5829
  var SECTION_BREAK_TYPES;
5602
5830
  var init_create = __esm(() => {
5603
5831
  init_errors2();
@@ -5796,7 +6024,13 @@ function buildDispatchTable(api) {
5796
6024
  "tables.clearCellSpacing": (input, options) => api.tables.clearCellSpacing(input, options),
5797
6025
  "tables.get": (input) => api.tables.get(input),
5798
6026
  "tables.getCells": (input) => api.tables.getCells(input),
5799
- "tables.getProperties": (input) => api.tables.getProperties(input)
6027
+ "tables.getProperties": (input) => api.tables.getProperties(input),
6028
+ "create.tableOfContents": (input, options) => api.create.tableOfContents(input, options),
6029
+ "toc.list": (input) => api.toc.list(input),
6030
+ "toc.get": (input) => api.toc.get(input),
6031
+ "toc.configure": (input, options) => api.toc.configure(input, options),
6032
+ "toc.update": (input, options) => api.toc.update(input, options),
6033
+ "toc.remove": (input, options) => api.toc.remove(input, options)
5800
6034
  };
5801
6035
  }
5802
6036
  var init_invoke = __esm(() => {
@@ -6208,6 +6442,39 @@ var init_sections = __esm(() => {
6208
6442
  PAGE_BORDER_Z_ORDER_VALUES = ["front", "back"];
6209
6443
  });
6210
6444
 
6445
+ // ../../packages/document-api/src/toc/toc.ts
6446
+ function validateTocTarget(target, operationName) {
6447
+ if (target === undefined || target === null) {
6448
+ throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} requires a target.`);
6449
+ }
6450
+ const t = target;
6451
+ if (t.kind !== "block" || t.nodeType !== "tableOfContents" || typeof t.nodeId !== "string") {
6452
+ throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} target must be a TocAddress with kind 'block', nodeType 'tableOfContents', and a string nodeId.`, { target });
6453
+ }
6454
+ }
6455
+ function executeTocList(adapter, query2) {
6456
+ return adapter.list(query2);
6457
+ }
6458
+ function executeTocGet(adapter, input) {
6459
+ validateTocTarget(input.target, "toc.get");
6460
+ return adapter.get(input);
6461
+ }
6462
+ function executeTocConfigure(adapter, input, options) {
6463
+ validateTocTarget(input.target, "toc.configure");
6464
+ return adapter.configure(input, normalizeMutationOptions(options));
6465
+ }
6466
+ function executeTocUpdate(adapter, input, options) {
6467
+ validateTocTarget(input.target, "toc.update");
6468
+ return adapter.update(input, normalizeMutationOptions(options));
6469
+ }
6470
+ function executeTocRemove(adapter, input, options) {
6471
+ validateTocTarget(input.target, "toc.remove");
6472
+ return adapter.remove(input, normalizeMutationOptions(options));
6473
+ }
6474
+ var init_toc = __esm(() => {
6475
+ init_errors2();
6476
+ });
6477
+
6211
6478
  // ../../packages/document-api/src/lists/lists.types.ts
6212
6479
  var LIST_KINDS, LIST_INSERT_POSITIONS;
6213
6480
  var init_lists_types = __esm(() => {
@@ -6314,6 +6581,9 @@ function createDocumentApi(adapters) {
6314
6581
  },
6315
6582
  sectionBreak(input, options) {
6316
6583
  return executeCreateSectionBreak(adapters.create, input, options);
6584
+ },
6585
+ tableOfContents(input, options) {
6586
+ return executeCreateTableOfContents(adapters.create, input, options);
6317
6587
  }
6318
6588
  },
6319
6589
  capabilities: capabilities2,
@@ -6518,6 +6788,23 @@ function createDocumentApi(adapters) {
6518
6788
  return adapters.tables.getProperties(input);
6519
6789
  }
6520
6790
  },
6791
+ toc: {
6792
+ list(query2) {
6793
+ return executeTocList(adapters.toc, query2);
6794
+ },
6795
+ get(input) {
6796
+ return executeTocGet(adapters.toc, input);
6797
+ },
6798
+ configure(input, options) {
6799
+ return executeTocConfigure(adapters.toc, input, options);
6800
+ },
6801
+ update(input, options) {
6802
+ return executeTocUpdate(adapters.toc, input, options);
6803
+ },
6804
+ remove(input, options) {
6805
+ return executeTocRemove(adapters.toc, input, options);
6806
+ }
6807
+ },
6521
6808
  query: {
6522
6809
  match(input) {
6523
6810
  return adapters.query.match(input);
@@ -6558,6 +6845,7 @@ var init_src = __esm(() => {
6558
6845
  init_invoke();
6559
6846
  init_tables();
6560
6847
  init_sections();
6848
+ init_toc();
6561
6849
  init_format();
6562
6850
  init_inline_run_patch();
6563
6851
  init_styles();
@@ -7204,6 +7492,7 @@ var init_operation_hints = __esm(() => {
7204
7492
  "styles.apply": "applied stylesheet defaults",
7205
7493
  "create.paragraph": "created paragraph",
7206
7494
  "create.heading": "created heading",
7495
+ "create.tableOfContents": "created table of contents",
7207
7496
  "lists.list": "listed items",
7208
7497
  "lists.get": "resolved list item",
7209
7498
  "lists.insert": "inserted list item",
@@ -7220,6 +7509,11 @@ var init_operation_hints = __esm(() => {
7220
7509
  "trackChanges.list": "listed tracked changes",
7221
7510
  "trackChanges.get": "resolved tracked change",
7222
7511
  "trackChanges.decide": "reviewed tracked change",
7512
+ "toc.list": "listed tables of contents",
7513
+ "toc.get": "resolved table of contents",
7514
+ "toc.configure": "configured table of contents",
7515
+ "toc.update": "updated table of contents",
7516
+ "toc.remove": "removed table of contents",
7223
7517
  "query.match": "matched selectors",
7224
7518
  "mutations.preview": "previewed mutations",
7225
7519
  "mutations.apply": "applied mutations",
@@ -7281,6 +7575,7 @@ var init_operation_hints = __esm(() => {
7281
7575
  "styles.apply": "receipt",
7282
7576
  "create.paragraph": "createResult",
7283
7577
  "create.heading": "createResult",
7578
+ "create.tableOfContents": "createResult",
7284
7579
  "lists.list": "listResult",
7285
7580
  "lists.get": "listItemInfo",
7286
7581
  "lists.insert": "listsMutationResult",
@@ -7297,6 +7592,11 @@ var init_operation_hints = __esm(() => {
7297
7592
  "trackChanges.list": "trackChangeList",
7298
7593
  "trackChanges.get": "trackChangeInfo",
7299
7594
  "trackChanges.decide": "trackChangeMutationReceipt",
7595
+ "toc.list": "plain",
7596
+ "toc.get": "plain",
7597
+ "toc.configure": "plain",
7598
+ "toc.update": "plain",
7599
+ "toc.remove": "plain",
7300
7600
  "query.match": "plain",
7301
7601
  "mutations.preview": "plain",
7302
7602
  "mutations.apply": "plain",
@@ -7358,6 +7658,7 @@ var init_operation_hints = __esm(() => {
7358
7658
  "styles.apply": "receipt",
7359
7659
  "create.paragraph": "result",
7360
7660
  "create.heading": "result",
7661
+ "create.tableOfContents": "result",
7361
7662
  "lists.list": "result",
7362
7663
  "lists.get": "item",
7363
7664
  "lists.insert": "result",
@@ -7374,6 +7675,11 @@ var init_operation_hints = __esm(() => {
7374
7675
  "trackChanges.list": "result",
7375
7676
  "trackChanges.get": "change",
7376
7677
  "trackChanges.decide": "receipt",
7678
+ "toc.list": "result",
7679
+ "toc.get": "result",
7680
+ "toc.configure": "result",
7681
+ "toc.update": "result",
7682
+ "toc.remove": "result",
7377
7683
  "query.match": "result",
7378
7684
  "mutations.preview": "result",
7379
7685
  "mutations.apply": "result",
@@ -7443,6 +7749,7 @@ var init_operation_hints = __esm(() => {
7443
7749
  "styles.apply": "general",
7444
7750
  "create.paragraph": "create",
7445
7751
  "create.heading": "create",
7752
+ "create.tableOfContents": "create",
7446
7753
  "lists.list": "lists",
7447
7754
  "lists.get": "lists",
7448
7755
  "lists.insert": "lists",
@@ -7459,6 +7766,11 @@ var init_operation_hints = __esm(() => {
7459
7766
  "trackChanges.list": "trackChanges",
7460
7767
  "trackChanges.get": "trackChanges",
7461
7768
  "trackChanges.decide": "trackChanges",
7769
+ "toc.list": "query",
7770
+ "toc.get": "query",
7771
+ "toc.configure": "toc",
7772
+ "toc.update": "toc",
7773
+ "toc.remove": "toc",
7462
7774
  "query.match": "query",
7463
7775
  "mutations.preview": "general",
7464
7776
  "mutations.apply": "general",
@@ -28319,7 +28631,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
28319
28631
  emptyOptions2 = {};
28320
28632
  });
28321
28633
 
28322
- // ../../packages/superdoc/dist/chunks/SuperConverter-DhpmwuUN.es.js
28634
+ // ../../packages/superdoc/dist/chunks/SuperConverter-BSZgN87C.es.js
28323
28635
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
28324
28636
  const fieldValue = extension$1.config[field];
28325
28637
  if (typeof fieldValue === "function")
@@ -29681,6 +29993,20 @@ function supportsImplicitTrueValue2(operationId) {
29681
29993
  return false;
29682
29994
  return entry.type === "boolean" || key === "underline";
29683
29995
  }
29996
+ function tocAddressSchema2() {
29997
+ return objectSchema2({
29998
+ kind: { const: "block" },
29999
+ nodeType: { const: "tableOfContents" },
30000
+ nodeId: { type: "string" }
30001
+ }, [
30002
+ "kind",
30003
+ "nodeType",
30004
+ "nodeId"
30005
+ ]);
30006
+ }
30007
+ function tocMutationResultSchema2() {
30008
+ return { oneOf: [tocMutationSuccessSchema2, tocMutationFailureSchema2] };
30009
+ }
29684
30010
  function executeCapabilities2(adapter) {
29685
30011
  return adapter.get();
29686
30012
  }
@@ -30283,6 +30609,23 @@ function executeCreateSectionBreak2(adapter, input, options) {
30283
30609
  validateCreateSectionBreakInput2(normalized);
30284
30610
  return adapter.sectionBreak(normalized, normalizeMutationOptions2(options));
30285
30611
  }
30612
+ function normalizeTocCreateLocation2(location2) {
30613
+ return location2 ?? { kind: "documentEnd" };
30614
+ }
30615
+ function normalizeCreateTableOfContentsInput2(input) {
30616
+ return {
30617
+ at: normalizeTocCreateLocation2(input.at),
30618
+ config: input.config
30619
+ };
30620
+ }
30621
+ function executeCreateTableOfContents2(adapter, input, options) {
30622
+ const normalized = normalizeCreateTableOfContentsInput2(input);
30623
+ const at = normalized.at;
30624
+ if ((at.kind === "before" || at.kind === "after") && "nodeId" in at)
30625
+ throw new DocumentApiValidationError2("INVALID_TARGET", "create.tableOfContents requires at.target for before/after positioning. The nodeId form is not supported.", { fields: ["at.nodeId"] });
30626
+ validateTargetOnlyCreateLocation2(at, "create.tableOfContents");
30627
+ return adapter.tableOfContents(normalized, normalizeMutationOptions2(options));
30628
+ }
30286
30629
  function validateBlocksDeleteInput2(input) {
30287
30630
  if (!input || typeof input !== "object")
30288
30631
  throw new DocumentApiValidationError2("INVALID_INPUT", "blocks.delete requires an input object.", { fields: ["input"] });
@@ -30448,7 +30791,13 @@ function buildDispatchTable2(api) {
30448
30791
  "tables.clearCellSpacing": (input, options) => api.tables.clearCellSpacing(input, options),
30449
30792
  "tables.get": (input) => api.tables.get(input),
30450
30793
  "tables.getCells": (input) => api.tables.getCells(input),
30451
- "tables.getProperties": (input) => api.tables.getProperties(input)
30794
+ "tables.getProperties": (input) => api.tables.getProperties(input),
30795
+ "create.tableOfContents": (input, options) => api.create.tableOfContents(input, options),
30796
+ "toc.list": (input) => api.toc.list(input),
30797
+ "toc.get": (input) => api.toc.get(input),
30798
+ "toc.configure": (input, options) => api.toc.configure(input, options),
30799
+ "toc.update": (input, options) => api.toc.update(input, options),
30800
+ "toc.remove": (input, options) => api.toc.remove(input, options)
30452
30801
  };
30453
30802
  }
30454
30803
  function validateTableLocator2(input, operationName) {
@@ -30792,6 +31141,32 @@ function executeSectionsClearPageBorders2(adapter, input, options) {
30792
31141
  assertSectionTarget2(input, "sections.clearPageBorders");
30793
31142
  return adapter.clearPageBorders(input, normalizeMutationOptions2(options));
30794
31143
  }
31144
+ function validateTocTarget2(target, operationName) {
31145
+ if (target === undefined || target === null)
31146
+ throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} requires a target.`);
31147
+ const t = target;
31148
+ if (t.kind !== "block" || t.nodeType !== "tableOfContents" || typeof t.nodeId !== "string")
31149
+ throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} target must be a TocAddress with kind 'block', nodeType 'tableOfContents', and a string nodeId.`, { target });
31150
+ }
31151
+ function executeTocList2(adapter, query2) {
31152
+ return adapter.list(query2);
31153
+ }
31154
+ function executeTocGet2(adapter, input) {
31155
+ validateTocTarget2(input.target, "toc.get");
31156
+ return adapter.get(input);
31157
+ }
31158
+ function executeTocConfigure2(adapter, input, options) {
31159
+ validateTocTarget2(input.target, "toc.configure");
31160
+ return adapter.configure(input, normalizeMutationOptions2(options));
31161
+ }
31162
+ function executeTocUpdate2(adapter, input, options) {
31163
+ validateTocTarget2(input.target, "toc.update");
31164
+ return adapter.update(input, normalizeMutationOptions2(options));
31165
+ }
31166
+ function executeTocRemove2(adapter, input, options) {
31167
+ validateTocTarget2(input.target, "toc.remove");
31168
+ return adapter.remove(input, normalizeMutationOptions2(options));
31169
+ }
30795
31170
  function buildFormatInlineAliasApi2(adapter) {
30796
31171
  return Object.fromEntries(INLINE_PROPERTY_REGISTRY2.map((entry) => {
30797
31172
  const key = entry.key;
@@ -30888,6 +31263,9 @@ function createDocumentApi2(adapters) {
30888
31263
  },
30889
31264
  sectionBreak(input, options) {
30890
31265
  return executeCreateSectionBreak2(adapters.create, input, options);
31266
+ },
31267
+ tableOfContents(input, options) {
31268
+ return executeCreateTableOfContents2(adapters.create, input, options);
30891
31269
  }
30892
31270
  },
30893
31271
  capabilities: capabilities2,
@@ -31092,6 +31470,23 @@ function createDocumentApi2(adapters) {
31092
31470
  return adapters.tables.getProperties(input);
31093
31471
  }
31094
31472
  },
31473
+ toc: {
31474
+ list(query2) {
31475
+ return executeTocList2(adapters.toc, query2);
31476
+ },
31477
+ get(input) {
31478
+ return executeTocGet2(adapters.toc, input);
31479
+ },
31480
+ configure(input, options) {
31481
+ return executeTocConfigure2(adapters.toc, input, options);
31482
+ },
31483
+ update(input, options) {
31484
+ return executeTocUpdate2(adapters.toc, input, options);
31485
+ },
31486
+ remove(input, options) {
31487
+ return executeTocRemove2(adapters.toc, input, options);
31488
+ }
31489
+ },
31095
31490
  query: { match(input) {
31096
31491
  return adapters.query.match(input);
31097
31492
  } },
@@ -46590,7 +46985,7 @@ var isRegExp = (value) => {
46590
46985
  tracked: false,
46591
46986
  carrier: runAttributeCarrier2(runPropertyKey ?? key),
46592
46987
  schema
46593
- }), 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, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_NOT_FOUND_COMMAND_TRACKED2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG2, ALIGNMENTS2, ALIGNMENT_SET2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, ALIGN_ALLOWED_KEYS2, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, listsExitSuccessSchema2, nodeSummarySchema2, nodeInfoSchema2, matchContextSchema2, unknownNodeDiagnosticSchema2, textSelectorSchema2, nodeSelectorSchema2, findItemDomainSchema2, 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, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, GROUP_METADATA2, CAPABILITY_REASON_CODES2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUE_SET2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, STYLES_APPLY_INPUT_ALLOWED_KEYS2, STYLES_APPLY_TARGET_ALLOWED_KEYS2, STYLES_APPLY_OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, DELETE_INPUT_ALLOWED_KEYS2, INSERT_INPUT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, REPLACE_INPUT_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, TABLE_LOCATOR_OPS2, ROW_LOCATOR_OPS2, COLUMN_LOCATOR_OPS2, MERGE_RANGE_LOCATOR_OPS2, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS2, HEADER_FOOTER_VARIANTS2, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$207) => ({
46988
+ }), 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, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_NOT_FOUND_COMMAND_TRACKED2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG2, ALIGNMENTS2, ALIGNMENT_SET2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, ALIGN_ALLOWED_KEYS2, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, listsExitSuccessSchema2, nodeSummarySchema2, nodeInfoSchema2, matchContextSchema2, unknownNodeDiagnosticSchema2, textSelectorSchema2, nodeSelectorSchema2, findItemDomainSchema2, 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, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, GROUP_METADATA2, CAPABILITY_REASON_CODES2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUE_SET2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, STYLES_APPLY_INPUT_ALLOWED_KEYS2, STYLES_APPLY_TARGET_ALLOWED_KEYS2, STYLES_APPLY_OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, DELETE_INPUT_ALLOWED_KEYS2, INSERT_INPUT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, REPLACE_INPUT_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, TABLE_LOCATOR_OPS2, ROW_LOCATOR_OPS2, COLUMN_LOCATOR_OPS2, MERGE_RANGE_LOCATOR_OPS2, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS2, HEADER_FOOTER_VARIANTS2, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$207) => ({
46594
46989
  handlerName,
46595
46990
  handler: (params) => {
46596
46991
  const { nodes } = params;
@@ -55341,7 +55736,7 @@ var isRegExp = (value) => {
55341
55736
  };
55342
55737
  }, decode$11 = (params) => {
55343
55738
  const { node: node3 } = params;
55344
- const contentNodes = node3.content.map((n) => exportSchemaToJson({
55739
+ const contentNodes = (Array.isArray(node3.content) ? node3.content : []).map((n) => exportSchemaToJson({
55345
55740
  ...params,
55346
55741
  node: n
55347
55742
  }));
@@ -57790,7 +58185,7 @@ var isRegExp = (value) => {
57790
58185
  state.kern = kernNode.attributes["w:val"];
57791
58186
  }
57792
58187
  }, SuperConverter;
57793
- var init_SuperConverter_DhpmwuUN_es = __esm(() => {
58188
+ var init_SuperConverter_BSZgN87C_es = __esm(() => {
57794
58189
  init_rolldown_runtime_B2q5OVn9_es();
57795
58190
  init_jszip_ChlR43oI_es();
57796
58191
  init_xml_js_DLE8mr0n_es();
@@ -60208,6 +60603,7 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
60208
60603
  "table",
60209
60604
  "tableRow",
60210
60605
  "tableCell",
60606
+ "tableOfContents",
60211
60607
  "image",
60212
60608
  "sdt",
60213
60609
  "run",
@@ -60225,6 +60621,7 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
60225
60621
  "table",
60226
60622
  "tableRow",
60227
60623
  "tableCell",
60624
+ "tableOfContents",
60228
60625
  "image",
60229
60626
  "sdt"
60230
60627
  ];
@@ -62026,6 +62423,103 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
62026
62423
  }),
62027
62424
  referenceDocPath: "tables/get-properties.mdx",
62028
62425
  referenceGroup: "tables"
62426
+ },
62427
+ "create.tableOfContents": {
62428
+ memberPath: "create.tableOfContents",
62429
+ description: "Insert a new table of contents at the target position.",
62430
+ expectedResult: "Returns a CreateTableOfContentsResult with the new TOC block address.",
62431
+ requiresDocumentContext: true,
62432
+ metadata: mutationOperation2({
62433
+ idempotency: "non-idempotent",
62434
+ supportsDryRun: true,
62435
+ supportsTrackedMode: false,
62436
+ possibleFailureCodes: ["NO_OP", "INVALID_INSERTION_CONTEXT"],
62437
+ throws: [
62438
+ "INVALID_TARGET",
62439
+ "TARGET_NOT_FOUND",
62440
+ "CAPABILITY_UNAVAILABLE"
62441
+ ]
62442
+ }),
62443
+ referenceDocPath: "create/table-of-contents.mdx",
62444
+ referenceGroup: "create"
62445
+ },
62446
+ "toc.list": {
62447
+ memberPath: "toc.list",
62448
+ description: "List all tables of contents in the document.",
62449
+ expectedResult: "Returns a TocListResult with an array of TOC discovery items and pagination metadata.",
62450
+ requiresDocumentContext: true,
62451
+ metadata: readOperation2({ idempotency: "idempotent" }),
62452
+ referenceDocPath: "toc/list.mdx",
62453
+ referenceGroup: "toc"
62454
+ },
62455
+ "toc.get": {
62456
+ memberPath: "toc.get",
62457
+ description: "Retrieve details of a specific table of contents.",
62458
+ expectedResult: "Returns a TocInfo object with the instruction, source/display configuration, and entry count.",
62459
+ requiresDocumentContext: true,
62460
+ metadata: readOperation2({
62461
+ idempotency: "idempotent",
62462
+ throws: T_NOT_FOUND2
62463
+ }),
62464
+ referenceDocPath: "toc/get.mdx",
62465
+ referenceGroup: "toc"
62466
+ },
62467
+ "toc.configure": {
62468
+ memberPath: "toc.configure",
62469
+ description: "Update the configuration switches of a table of contents.",
62470
+ expectedResult: "Returns a TocMutationResult with the updated TOC address on success, or a failure code on no-op.",
62471
+ requiresDocumentContext: true,
62472
+ metadata: mutationOperation2({
62473
+ idempotency: "conditional",
62474
+ supportsDryRun: true,
62475
+ supportsTrackedMode: false,
62476
+ possibleFailureCodes: ["NO_OP"],
62477
+ throws: [
62478
+ "TARGET_NOT_FOUND",
62479
+ "INVALID_TARGET",
62480
+ "CAPABILITY_UNAVAILABLE"
62481
+ ]
62482
+ }),
62483
+ referenceDocPath: "toc/configure.mdx",
62484
+ referenceGroup: "toc"
62485
+ },
62486
+ "toc.update": {
62487
+ memberPath: "toc.update",
62488
+ description: "Rebuild the materialized content of a table of contents.",
62489
+ expectedResult: "Returns a TocMutationResult with the TOC address on success, or a failure code if content is unchanged.",
62490
+ requiresDocumentContext: true,
62491
+ metadata: mutationOperation2({
62492
+ idempotency: "conditional",
62493
+ supportsDryRun: true,
62494
+ supportsTrackedMode: false,
62495
+ possibleFailureCodes: ["NO_OP"],
62496
+ throws: [
62497
+ "TARGET_NOT_FOUND",
62498
+ "INVALID_TARGET",
62499
+ "CAPABILITY_UNAVAILABLE"
62500
+ ]
62501
+ }),
62502
+ referenceDocPath: "toc/update.mdx",
62503
+ referenceGroup: "toc"
62504
+ },
62505
+ "toc.remove": {
62506
+ memberPath: "toc.remove",
62507
+ description: "Remove a table of contents from the document.",
62508
+ expectedResult: "Returns a TocMutationResult with the removed TOC address on success, or a failure code on no-op.",
62509
+ requiresDocumentContext: true,
62510
+ metadata: mutationOperation2({
62511
+ idempotency: "conditional",
62512
+ supportsDryRun: true,
62513
+ supportsTrackedMode: false,
62514
+ possibleFailureCodes: ["NO_OP"],
62515
+ throws: [
62516
+ "TARGET_NOT_FOUND",
62517
+ "INVALID_TARGET",
62518
+ "CAPABILITY_UNAVAILABLE"
62519
+ ]
62520
+ }),
62521
+ referenceDocPath: "toc/remove.mdx",
62522
+ referenceGroup: "toc"
62029
62523
  }
62030
62524
  };
62031
62525
  OPERATION_IDS2 = Object.freeze(Object.keys(OPERATION_DEFINITIONS2));
@@ -62951,6 +63445,24 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
62951
63445
  failure: textMutationFailureSchemaFor2(operationId)
62952
63446
  }];
62953
63447
  }));
63448
+ tocMutationFailureSchema2 = objectSchema2({
63449
+ success: { const: false },
63450
+ failure: objectSchema2({
63451
+ code: { enum: [...[
63452
+ "NO_OP",
63453
+ "INVALID_TARGET",
63454
+ "TARGET_NOT_FOUND",
63455
+ "CAPABILITY_UNAVAILABLE",
63456
+ "INVALID_INSERTION_CONTEXT"
63457
+ ]] },
63458
+ message: { type: "string" },
63459
+ details: {}
63460
+ }, ["code", "message"])
63461
+ }, ["success", "failure"]);
63462
+ tocMutationSuccessSchema2 = objectSchema2({
63463
+ success: { const: true },
63464
+ toc: tocAddressSchema2()
63465
+ }, ["success", "toc"]);
62954
63466
  objectSchema2({
62955
63467
  nodeId: { type: "string" },
62956
63468
  nodeType: { enum: [...blockNodeTypeValues2] }
@@ -63879,7 +64391,92 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
63879
64391
  bandedRows: { type: "boolean" },
63880
64392
  bandedColumns: { type: "boolean" }
63881
64393
  })
63882
- }, ["nodeId"]);
64394
+ }, ["nodeId"]), objectSchema2({
64395
+ at: { oneOf: [
64396
+ objectSchema2({ kind: { const: "documentStart" } }, ["kind"]),
64397
+ objectSchema2({ kind: { const: "documentEnd" } }, ["kind"]),
64398
+ objectSchema2({
64399
+ kind: { const: "before" },
64400
+ target: blockNodeAddressSchema2
64401
+ }, ["kind", "target"]),
64402
+ objectSchema2({
64403
+ kind: { const: "after" },
64404
+ target: blockNodeAddressSchema2
64405
+ }, ["kind", "target"])
64406
+ ] },
64407
+ config: objectSchema2({
64408
+ outlineLevels: objectSchema2({
64409
+ from: { type: "integer" },
64410
+ to: { type: "integer" }
64411
+ }, ["from", "to"]),
64412
+ useAppliedOutlineLevel: { type: "boolean" },
64413
+ hyperlinks: { type: "boolean" },
64414
+ hideInWebView: { type: "boolean" },
64415
+ omitPageNumberLevels: objectSchema2({
64416
+ from: { type: "integer" },
64417
+ to: { type: "integer" }
64418
+ }, ["from", "to"]),
64419
+ separator: { type: "string" }
64420
+ })
64421
+ }), tocMutationResultSchema2(), objectSchema2({
64422
+ limit: { type: "integer" },
64423
+ offset: { type: "integer" }
64424
+ }), objectSchema2({
64425
+ evaluatedRevision: { type: "string" },
64426
+ total: { type: "integer" },
64427
+ items: arraySchema2(objectSchema2({
64428
+ id: { type: "string" },
64429
+ handle: ref2("ResolvedHandle"),
64430
+ address: tocAddressSchema2(),
64431
+ instruction: { type: "string" },
64432
+ sourceConfig: { type: "object" },
64433
+ displayConfig: { type: "object" },
64434
+ preserved: { type: "object" },
64435
+ entryCount: { type: "integer" }
64436
+ }, [
64437
+ "id",
64438
+ "handle",
64439
+ "address",
64440
+ "instruction",
64441
+ "entryCount"
64442
+ ])),
64443
+ page: ref2("PageInfo")
64444
+ }, [
64445
+ "evaluatedRevision",
64446
+ "total",
64447
+ "items",
64448
+ "page"
64449
+ ]), objectSchema2({ target: tocAddressSchema2() }, ["target"]), objectSchema2({
64450
+ nodeType: { const: "tableOfContents" },
64451
+ kind: { const: "block" },
64452
+ properties: objectSchema2({
64453
+ instruction: { type: "string" },
64454
+ sourceConfig: { type: "object" },
64455
+ displayConfig: { type: "object" },
64456
+ preservedSwitches: { type: "object" },
64457
+ entryCount: { type: "integer" }
64458
+ }, ["instruction", "entryCount"])
64459
+ }, [
64460
+ "nodeType",
64461
+ "kind",
64462
+ "properties"
64463
+ ]), objectSchema2({
64464
+ target: tocAddressSchema2(),
64465
+ patch: objectSchema2({
64466
+ outlineLevels: objectSchema2({
64467
+ from: { type: "integer" },
64468
+ to: { type: "integer" }
64469
+ }, ["from", "to"]),
64470
+ useAppliedOutlineLevel: { type: "boolean" },
64471
+ hyperlinks: { type: "boolean" },
64472
+ hideInWebView: { type: "boolean" },
64473
+ omitPageNumberLevels: objectSchema2({
64474
+ from: { type: "integer" },
64475
+ to: { type: "integer" }
64476
+ }, ["from", "to"]),
64477
+ separator: { type: "string" }
64478
+ })
64479
+ }, ["target", "patch"]), tocMutationResultSchema2(), objectSchema2({ target: tocAddressSchema2() }, ["target"]), tocMutationResultSchema2(), objectSchema2({ target: tocAddressSchema2() }, ["target"]), tocMutationResultSchema2();
63883
64480
  projectFromDefinitions2((_id, entry) => entry.memberPath);
63884
64481
  [...new Set(OPERATION_IDS2.map((id) => OPERATION_DEFINITIONS2[id].memberPath))];
63885
64482
  projectFromDefinitions2((_id, entry) => entry.referenceDocPath);
@@ -63948,6 +64545,11 @@ var init_SuperConverter_DhpmwuUN_es = __esm(() => {
63948
64545
  title: "Tables",
63949
64546
  description: "Table structure, layout, styling, and cell operations.",
63950
64547
  pagePath: "tables/index.mdx"
64548
+ },
64549
+ toc: {
64550
+ title: "Table of Contents",
64551
+ description: "Table of contents lifecycle and configuration.",
64552
+ pagePath: "toc/index.mdx"
63951
64553
  }
63952
64554
  };
63953
64555
  Object.keys(GROUP_METADATA2).map((key) => ({
@@ -101203,9 +101805,9 @@ var init_remark_gfm_CQ3Jg4PR_es = __esm(() => {
101203
101805
  init_remark_gfm_z_sDF4ss_es();
101204
101806
  });
101205
101807
 
101206
- // ../../packages/superdoc/dist/chunks/src-B-vDSO7p.es.js
101207
- var exports_src_B_vDSO7p_es = {};
101208
- __export(exports_src_B_vDSO7p_es, {
101808
+ // ../../packages/superdoc/dist/chunks/src-DKGc94QA.es.js
101809
+ var exports_src_DKGc94QA_es = {};
101810
+ __export(exports_src_DKGc94QA_es, {
101209
101811
  zt: () => defineMark,
101210
101812
  z: () => cM,
101211
101813
  yt: () => removeAwarenessStates,
@@ -108059,6 +108661,20 @@ function normalizeExcerpt(text5) {
108059
108661
  const trimmed = text5.replace(/\s+/g, " ").trim();
108060
108662
  return trimmed.length ? trimmed : undefined;
108061
108663
  }
108664
+ function stableHash(input2) {
108665
+ let hash$3 = 2166136261;
108666
+ for (let index2 = 0;index2 < input2.length; index2 += 1) {
108667
+ hash$3 ^= input2.charCodeAt(index2);
108668
+ hash$3 = Math.imul(hash$3, 16777619);
108669
+ }
108670
+ return (hash$3 >>> 0).toString(16).padStart(8, "0");
108671
+ }
108672
+ function buildFallbackTocNodeId(node3, pos) {
108673
+ return `toc-auto-${stableHash(`${pos}:${typeof node3.attrs?.instruction === "string" ? node3.attrs.instruction : ""}`)}`;
108674
+ }
108675
+ function resolvePublicTocNodeId(node3, pos) {
108676
+ return buildFallbackTocNodeId(node3, pos);
108677
+ }
108062
108678
  function isListItem$1(attrs) {
108063
108679
  const numbering = attrs?.paragraphProperties?.numberingProperties;
108064
108680
  if (numbering && (numbering.numId != null || numbering.ilvl != null))
@@ -108099,6 +108715,8 @@ function mapBlockNodeType(node3) {
108099
108715
  return "tableCell";
108100
108716
  case "image":
108101
108717
  return "image";
108718
+ case "tableOfContents":
108719
+ return "tableOfContents";
108102
108720
  case "structuredContentBlock":
108103
108721
  case "sdt":
108104
108722
  return "sdt";
@@ -108106,11 +108724,13 @@ function mapBlockNodeType(node3) {
108106
108724
  return;
108107
108725
  }
108108
108726
  }
108109
- function resolveBlockNodeId(node3) {
108727
+ function resolveBlockNodeId(node3, pos, nodeType) {
108110
108728
  if (node3.type.name === "paragraph") {
108111
108729
  const attrs$1 = node3.attrs;
108112
108730
  return toId(attrs$1?.paraId) ?? toId(attrs$1?.sdBlockId);
108113
108731
  }
108732
+ if (nodeType === "tableOfContents")
108733
+ return resolvePublicTocNodeId(node3, pos);
108114
108734
  const attrs = node3.attrs ?? {};
108115
108735
  const typeName = node3.type.name;
108116
108736
  if (typeName === "table" || typeName === "tableRow" || typeName === "tableCell" || typeName === "tableHeader")
@@ -108146,7 +108766,7 @@ function buildBlockIndex(editor) {
108146
108766
  const nodeType = mapBlockNodeType(node3);
108147
108767
  if (!nodeType)
108148
108768
  return;
108149
- const nodeId = resolveBlockNodeId(node3);
108769
+ const nodeId = resolveBlockNodeId(node3, pos, nodeType);
108150
108770
  if (!nodeId)
108151
108771
  return;
108152
108772
  const candidate = {
@@ -108466,6 +109086,173 @@ function findCandidateByPos(candidates, pos) {
108466
109086
  return candidate;
108467
109087
  }
108468
109088
  }
109089
+ function parseLevelRange(value) {
109090
+ const match$1 = value.match(/^(\d+)-(\d+)$/);
109091
+ if (!match$1)
109092
+ return;
109093
+ return {
109094
+ from: parseInt(match$1[1], 10),
109095
+ to: parseInt(match$1[2], 10)
109096
+ };
109097
+ }
109098
+ function parseCustomStyles(value) {
109099
+ const entries = [];
109100
+ const parts = value.split(",");
109101
+ for (let i$1 = 0;i$1 < parts.length - 1; i$1 += 2) {
109102
+ const styleName = parts[i$1].trim();
109103
+ const level = parseInt(parts[i$1 + 1].trim(), 10);
109104
+ if (styleName && !isNaN(level))
109105
+ entries.push({
109106
+ styleName,
109107
+ level
109108
+ });
109109
+ }
109110
+ return entries;
109111
+ }
109112
+ function parseTocInstruction(instruction) {
109113
+ const source = {};
109114
+ const display = {};
109115
+ const preserved = {};
109116
+ const rawExtensions = [];
109117
+ let match$1;
109118
+ while ((match$1 = SWITCH_PATTERN.exec(instruction)) !== null) {
109119
+ const switchChar = match$1[1].toLowerCase();
109120
+ const arg = match$1[2] ?? "";
109121
+ switch (switchChar) {
109122
+ case "o": {
109123
+ const range = parseLevelRange(arg);
109124
+ if (range)
109125
+ source.outlineLevels = range;
109126
+ break;
109127
+ }
109128
+ case "u":
109129
+ source.useAppliedOutlineLevel = true;
109130
+ break;
109131
+ case "h":
109132
+ display.hyperlinks = true;
109133
+ break;
109134
+ case "z":
109135
+ display.hideInWebView = true;
109136
+ break;
109137
+ case "n": {
109138
+ const range = parseLevelRange(arg);
109139
+ if (range)
109140
+ display.omitPageNumberLevels = range;
109141
+ break;
109142
+ }
109143
+ case "p":
109144
+ if (arg)
109145
+ display.separator = arg;
109146
+ break;
109147
+ case "t":
109148
+ if (arg)
109149
+ preserved.customStyles = parseCustomStyles(arg);
109150
+ break;
109151
+ case "b":
109152
+ if (arg)
109153
+ preserved.bookmarkName = arg;
109154
+ break;
109155
+ case "f":
109156
+ if (arg)
109157
+ preserved.tcFieldIdentifier = arg;
109158
+ break;
109159
+ case "l": {
109160
+ const range = parseLevelRange(arg);
109161
+ if (range)
109162
+ preserved.tcFieldLevels = range;
109163
+ break;
109164
+ }
109165
+ case "a":
109166
+ if (arg)
109167
+ preserved.captionType = arg;
109168
+ break;
109169
+ case "c":
109170
+ if (arg)
109171
+ preserved.seqFieldIdentifier = arg;
109172
+ break;
109173
+ case "d":
109174
+ if (arg)
109175
+ preserved.chapterSeparator = arg;
109176
+ break;
109177
+ case "s":
109178
+ if (arg)
109179
+ preserved.chapterNumberSource = arg;
109180
+ break;
109181
+ case "w":
109182
+ preserved.preserveTabEntries = true;
109183
+ break;
109184
+ default:
109185
+ rawExtensions.push(arg ? `\\${switchChar} "${arg}"` : `\\${switchChar}`);
109186
+ break;
109187
+ }
109188
+ }
109189
+ if (rawExtensions.length > 0)
109190
+ preserved.rawExtensions = rawExtensions;
109191
+ return {
109192
+ source,
109193
+ display,
109194
+ preserved
109195
+ };
109196
+ }
109197
+ function serializeTocInstruction(config2) {
109198
+ const parts = ["TOC"];
109199
+ const { source, display, preserved } = config2;
109200
+ if (source.outlineLevels)
109201
+ parts.push(`\\o "${source.outlineLevels.from}-${source.outlineLevels.to}"`);
109202
+ if (source.useAppliedOutlineLevel)
109203
+ parts.push("\\u");
109204
+ if (preserved.customStyles?.length) {
109205
+ const pairs = preserved.customStyles.map((s2) => `${s2.styleName},${s2.level}`).join(",");
109206
+ parts.push(`\\t "${pairs}"`);
109207
+ }
109208
+ if (display.hyperlinks)
109209
+ parts.push("\\h");
109210
+ if (display.hideInWebView)
109211
+ parts.push("\\z");
109212
+ if (display.omitPageNumberLevels)
109213
+ parts.push(`\\n "${display.omitPageNumberLevels.from}-${display.omitPageNumberLevels.to}"`);
109214
+ if (display.separator)
109215
+ parts.push(`\\p "${display.separator}"`);
109216
+ if (preserved.captionType)
109217
+ parts.push(`\\a "${preserved.captionType}"`);
109218
+ if (preserved.bookmarkName)
109219
+ parts.push(`\\b "${preserved.bookmarkName}"`);
109220
+ if (preserved.seqFieldIdentifier)
109221
+ parts.push(`\\c "${preserved.seqFieldIdentifier}"`);
109222
+ if (preserved.chapterSeparator)
109223
+ parts.push(`\\d "${preserved.chapterSeparator}"`);
109224
+ if (preserved.tcFieldIdentifier)
109225
+ parts.push(`\\f "${preserved.tcFieldIdentifier}"`);
109226
+ if (preserved.tcFieldLevels)
109227
+ parts.push(`\\l "${preserved.tcFieldLevels.from}-${preserved.tcFieldLevels.to}"`);
109228
+ if (preserved.chapterNumberSource)
109229
+ parts.push(`\\s "${preserved.chapterNumberSource}"`);
109230
+ if (preserved.preserveTabEntries)
109231
+ parts.push("\\w");
109232
+ if (preserved.rawExtensions?.length)
109233
+ parts.push(...preserved.rawExtensions);
109234
+ return parts.join(" ");
109235
+ }
109236
+ function applyTocPatch(existing, patch3) {
109237
+ return {
109238
+ source: {
109239
+ ...existing.source,
109240
+ ...patch3.outlineLevels !== undefined && { outlineLevels: patch3.outlineLevels },
109241
+ ...patch3.useAppliedOutlineLevel !== undefined && { useAppliedOutlineLevel: patch3.useAppliedOutlineLevel }
109242
+ },
109243
+ display: {
109244
+ ...existing.display,
109245
+ ...patch3.hyperlinks !== undefined && { hyperlinks: patch3.hyperlinks },
109246
+ ...patch3.hideInWebView !== undefined && { hideInWebView: patch3.hideInWebView },
109247
+ ...patch3.omitPageNumberLevels !== undefined && { omitPageNumberLevels: patch3.omitPageNumberLevels },
109248
+ ...patch3.separator !== undefined && { separator: patch3.separator }
109249
+ },
109250
+ preserved: { ...existing.preserved }
109251
+ };
109252
+ }
109253
+ function areTocConfigsEqual(a2, b$1) {
109254
+ return serializeTocInstruction(a2) === serializeTocInstruction(b$1);
109255
+ }
108469
109256
  function resolveMeasurement(value) {
108470
109257
  if (typeof value === "number")
108471
109258
  return value;
@@ -108596,6 +109383,23 @@ function mapTableCellNode(candidate) {
108596
109383
  }
108597
109384
  };
108598
109385
  }
109386
+ function mapTableOfContentsNode(candidate) {
109387
+ const node3 = candidate.node;
109388
+ const instruction = node3.attrs?.instruction ?? "";
109389
+ const config2 = parseTocInstruction(instruction);
109390
+ const entryCount = node3.childCount;
109391
+ return {
109392
+ nodeType: "tableOfContents",
109393
+ kind: "block",
109394
+ properties: {
109395
+ instruction,
109396
+ sourceConfig: config2.source,
109397
+ displayConfig: config2.display,
109398
+ preservedSwitches: config2.preserved,
109399
+ entryCount
109400
+ }
109401
+ };
109402
+ }
108599
109403
  function buildImageInfo(attrs, kind) {
108600
109404
  return {
108601
109405
  nodeType: "image",
@@ -108842,6 +109646,10 @@ function mapNodeInfo(candidate, overrideType) {
108842
109646
  const attrs = candidate.node?.attrs;
108843
109647
  return buildSdtInfo(attrs, kind);
108844
109648
  }
109649
+ case "tableOfContents":
109650
+ if (kind !== "block")
109651
+ throw new DocumentApiAdapterError("INVALID_TARGET", "TableOfContents nodes can only be resolved as blocks.");
109652
+ return mapTableOfContentsNode(candidate);
108845
109653
  case "hyperlink":
108846
109654
  if (!isInlineCandidate(candidate))
108847
109655
  throw new DocumentApiAdapterError("INVALID_TARGET", "Hyperlink nodes can only be resolved inline.");
@@ -115895,10 +116703,23 @@ function tablesDistributeColumnsAdapter(editor, input2, options) {
115895
116703
  });
115896
116704
  }
115897
116705
  const tableAttrs = tableNode.attrs;
115898
- tr.setNodeMarkup(tablePos, null, {
116706
+ const normalizedGrid = normalizeGridColumns(tableAttrs.grid);
116707
+ const tableAttrUpdates = {
115899
116708
  ...tableAttrs,
115900
116709
  userEdited: true
115901
- });
116710
+ };
116711
+ if (normalizedGrid) {
116712
+ const newColumns = normalizedGrid.columns.slice();
116713
+ const evenWidthTwips = Math.max(1, Math.round(evenWidth * PIXELS_TO_TWIPS));
116714
+ const maxColumn = Math.min(rangeEnd, newColumns.length - 1);
116715
+ for (let col = Math.max(rangeStart, 0);col <= maxColumn; col++)
116716
+ newColumns[col] = { col: evenWidthTwips };
116717
+ tableAttrUpdates.grid = serializeGridColumns(tableAttrs.grid, {
116718
+ ...normalizedGrid,
116719
+ columns: newColumns
116720
+ });
116721
+ }
116722
+ tr.setNodeMarkup(tablePos, null, tableAttrUpdates);
115902
116723
  applyDirectMutationMeta(tr);
115903
116724
  editor.dispatch(tr);
115904
116725
  clearIndexCache(editor);
@@ -119280,6 +120101,335 @@ function tablesSetCellSpacingWrapper(editor, input2, options) {
119280
120101
  function tablesClearCellSpacingWrapper(editor, input2, options) {
119281
120102
  return executeTableCommand(editor, "tables.clearCellSpacing", tablesClearCellSpacingAdapter, input2, options);
119282
120103
  }
120104
+ function findAllTocNodes(doc$2) {
120105
+ const results = [];
120106
+ doc$2.descendants((node3, pos) => {
120107
+ if (node3.type.name === "tableOfContents") {
120108
+ const sdBlockId = node3.attrs?.sdBlockId;
120109
+ const nodeId = resolvePublicTocNodeId(node3, pos);
120110
+ const commandNodeId = sdBlockId;
120111
+ results.push({
120112
+ node: node3,
120113
+ pos,
120114
+ nodeId,
120115
+ commandNodeId
120116
+ });
120117
+ return false;
120118
+ }
120119
+ return true;
120120
+ });
120121
+ return results;
120122
+ }
120123
+ function resolveTocTarget(doc$2, target) {
120124
+ const found2 = findAllTocNodes(doc$2).find((t) => t.nodeId === target.nodeId || t.commandNodeId === target.nodeId);
120125
+ if (!found2)
120126
+ throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Table of contents with nodeId "${target.nodeId}" not found.`);
120127
+ return found2;
120128
+ }
120129
+ function resolvePostMutationTocId(doc$2, sdBlockId) {
120130
+ return findAllTocNodes(doc$2).find((t) => t.commandNodeId === sdBlockId)?.nodeId ?? sdBlockId;
120131
+ }
120132
+ function extractTocInfo(node3) {
120133
+ const instruction = node3.attrs?.instruction ?? "";
120134
+ const config2 = parseTocInstruction(instruction);
120135
+ return {
120136
+ nodeType: "tableOfContents",
120137
+ kind: "block",
120138
+ properties: {
120139
+ instruction,
120140
+ sourceConfig: config2.source,
120141
+ displayConfig: config2.display,
120142
+ preservedSwitches: config2.preserved,
120143
+ entryCount: node3.childCount
120144
+ }
120145
+ };
120146
+ }
120147
+ function buildTocDiscoveryItem(resolved, evaluatedRevision) {
120148
+ const instruction = resolved.node.attrs?.instruction ?? "";
120149
+ const config2 = parseTocInstruction(instruction);
120150
+ const address2 = {
120151
+ kind: "block",
120152
+ nodeType: "tableOfContents",
120153
+ nodeId: resolved.nodeId
120154
+ };
120155
+ const handle3 = buildResolvedHandle2(resolved.nodeId, "stable", "tableOfContents");
120156
+ const domain2 = {
120157
+ address: address2,
120158
+ instruction,
120159
+ sourceConfig: config2.source,
120160
+ displayConfig: config2.display,
120161
+ preserved: config2.preserved,
120162
+ entryCount: resolved.node.childCount
120163
+ };
120164
+ return buildDiscoveryItem2(`toc:${resolved.nodeId}:${evaluatedRevision}`, handle3, domain2);
120165
+ }
120166
+ function collectHeadingSources(doc$2, config2) {
120167
+ const sources = [];
120168
+ const { outlineLevels } = config2.source;
120169
+ const useApplied = config2.source.useAppliedOutlineLevel ?? false;
120170
+ doc$2.descendants((node3, _pos) => {
120171
+ if (node3.type.name === "tableOfContents")
120172
+ return false;
120173
+ if (node3.type.name === "paragraph") {
120174
+ const attrs = node3.attrs;
120175
+ const paragraphProps = attrs?.paragraphProperties;
120176
+ const styleId = paragraphProps?.styleId;
120177
+ const sdBlockId = attrs?.sdBlockId ?? attrs?.paraId;
120178
+ if (!sdBlockId)
120179
+ return true;
120180
+ const headingLevel = getHeadingLevel(styleId);
120181
+ if (headingLevel != null && outlineLevels) {
120182
+ if (headingLevel >= outlineLevels.from && headingLevel <= outlineLevels.to) {
120183
+ sources.push({
120184
+ text: flattenText(node3),
120185
+ level: headingLevel,
120186
+ sdBlockId
120187
+ });
120188
+ return false;
120189
+ }
120190
+ }
120191
+ if (useApplied && outlineLevels) {
120192
+ const rawOutlineLevel = paragraphProps?.outlineLevel;
120193
+ if (rawOutlineLevel != null) {
120194
+ const tocLevel = rawOutlineLevel + 1;
120195
+ if (tocLevel >= outlineLevels.from && tocLevel <= outlineLevels.to) {
120196
+ sources.push({
120197
+ text: flattenText(node3),
120198
+ level: tocLevel,
120199
+ sdBlockId
120200
+ });
120201
+ return false;
120202
+ }
120203
+ }
120204
+ }
120205
+ }
120206
+ return true;
120207
+ });
120208
+ return sources;
120209
+ }
120210
+ function flattenText(node3) {
120211
+ let text5 = "";
120212
+ node3.descendants((child) => {
120213
+ if (child.isText)
120214
+ text5 += child.text;
120215
+ return true;
120216
+ });
120217
+ return text5;
120218
+ }
120219
+ function buildTocEntryParagraphs(sources, config2) {
120220
+ return sources.map((source) => buildEntryParagraph(source, config2));
120221
+ }
120222
+ function buildEntryParagraph(source, config2) {
120223
+ const { display } = config2;
120224
+ const content3 = [];
120225
+ const textNode = {
120226
+ type: "text",
120227
+ text: source.text || " "
120228
+ };
120229
+ if (display.hyperlinks)
120230
+ textNode.marks = [{
120231
+ type: "link",
120232
+ attrs: {
120233
+ anchor: source.sdBlockId,
120234
+ rId: null,
120235
+ history: true
120236
+ }
120237
+ }];
120238
+ content3.push(textNode);
120239
+ const omitRange = display.omitPageNumberLevels;
120240
+ if (!(omitRange && source.level >= omitRange.from && source.level <= omitRange.to)) {
120241
+ if (display.separator)
120242
+ content3.push({
120243
+ type: "text",
120244
+ text: display.separator
120245
+ });
120246
+ else
120247
+ content3.push({ type: "tab" });
120248
+ content3.push({
120249
+ type: "text",
120250
+ text: "0"
120251
+ });
120252
+ }
120253
+ return {
120254
+ type: "paragraph",
120255
+ attrs: {
120256
+ paragraphProperties: { styleId: `TOC${source.level}` },
120257
+ sdBlockId: undefined
120258
+ },
120259
+ content: content3
120260
+ };
120261
+ }
120262
+ function tocListWrapper(editor, query2) {
120263
+ const doc$2 = editor.state.doc;
120264
+ const revision = getRevision(editor);
120265
+ const { total, items: paged } = paginate(findAllTocNodes(doc$2).map((resolved) => buildTocDiscoveryItem(resolved, revision)), query2?.offset, query2?.limit);
120266
+ return buildDiscoveryResult2({
120267
+ evaluatedRevision: revision,
120268
+ total,
120269
+ items: paged,
120270
+ page: {
120271
+ limit: query2?.limit ?? total,
120272
+ offset: query2?.offset ?? 0,
120273
+ returned: paged.length
120274
+ }
120275
+ });
120276
+ }
120277
+ function tocGetWrapper(editor, input2) {
120278
+ return extractTocInfo(resolveTocTarget(editor.state.doc, input2.target).node);
120279
+ }
120280
+ function buildTocAddress(nodeId) {
120281
+ return {
120282
+ kind: "block",
120283
+ nodeType: "tableOfContents",
120284
+ nodeId
120285
+ };
120286
+ }
120287
+ function tocSuccess(nodeId) {
120288
+ return {
120289
+ success: true,
120290
+ toc: buildTocAddress(nodeId)
120291
+ };
120292
+ }
120293
+ function tocFailure(code$1, message) {
120294
+ return {
120295
+ success: false,
120296
+ failure: {
120297
+ code: code$1,
120298
+ message
120299
+ }
120300
+ };
120301
+ }
120302
+ function toTocEditorCommand(command$1) {
120303
+ return command$1;
120304
+ }
120305
+ function runTocAction(editor, action, expectedRevision) {
120306
+ return executeDomainCommand(editor, () => {
120307
+ const result = action();
120308
+ if (result)
120309
+ clearIndexCache(editor);
120310
+ return result;
120311
+ }, { expectedRevision });
120312
+ }
120313
+ function runTocCommand(editor, command$1, args$1, expectedRevision) {
120314
+ const executeCommand = toTocEditorCommand(command$1);
120315
+ return runTocAction(editor, () => executeCommand(args$1), expectedRevision);
120316
+ }
120317
+ function receiptApplied(receipt2) {
120318
+ return receipt2.steps[0]?.effect === "changed";
120319
+ }
120320
+ function isTocContentUnchanged(existingNode, newContent) {
120321
+ if (existingNode.childCount !== newContent.length)
120322
+ return false;
120323
+ const existingEntries = [];
120324
+ let canSerialize = true;
120325
+ existingNode.forEach((child) => {
120326
+ if (!canSerialize)
120327
+ return;
120328
+ if (typeof child.toJSON !== "function") {
120329
+ canSerialize = false;
120330
+ return;
120331
+ }
120332
+ const json = child.toJSON();
120333
+ if (json.attrs)
120334
+ delete json.attrs.sdBlockId;
120335
+ existingEntries.push(json);
120336
+ });
120337
+ if (!canSerialize)
120338
+ return false;
120339
+ const normalized = newContent.map((entry) => {
120340
+ const clone = JSON.parse(JSON.stringify(entry));
120341
+ if (clone.attrs)
120342
+ delete clone.attrs.sdBlockId;
120343
+ return clone;
120344
+ });
120345
+ return JSON.stringify(existingEntries) === JSON.stringify(normalized);
120346
+ }
120347
+ function materializeTocContent(doc$2, config2) {
120348
+ const entryParagraphs = buildTocEntryParagraphs(collectHeadingSources(doc$2, config2), config2);
120349
+ return entryParagraphs.length > 0 ? entryParagraphs : NO_ENTRIES_PLACEHOLDER;
120350
+ }
120351
+ function tocConfigureWrapper(editor, input2, options) {
120352
+ rejectTrackedMode("toc.configure", options);
120353
+ const command$1 = requireEditorCommand(editor.commands?.setTableOfContentsInstructionById, "toc.configure");
120354
+ const resolved = resolveTocTarget(editor.state.doc, input2.target);
120355
+ const currentConfig = parseTocInstruction(resolved.node.attrs?.instruction ?? "");
120356
+ const patched = applyTocPatch(currentConfig, input2.patch);
120357
+ const nextContent = materializeTocContent(editor.state.doc, patched);
120358
+ if (areTocConfigsEqual(currentConfig, patched))
120359
+ return tocFailure("NO_OP", "Configuration patch produced no change.");
120360
+ if (options?.dryRun)
120361
+ return tocSuccess(resolved.nodeId);
120362
+ const shouldRefreshContent = !isTocContentUnchanged(resolved.node, nextContent);
120363
+ const commandNodeId = resolved.commandNodeId ?? resolved.nodeId;
120364
+ if (!receiptApplied(runTocCommand(editor, command$1, {
120365
+ sdBlockId: commandNodeId,
120366
+ instruction: serializeTocInstruction(patched),
120367
+ ...shouldRefreshContent ? { content: nextContent } : {}
120368
+ }, options?.expectedRevision)))
120369
+ return tocFailure("NO_OP", "Configuration change could not be applied.");
120370
+ return tocSuccess(resolvePostMutationTocId(editor.state.doc, commandNodeId));
120371
+ }
120372
+ function tocUpdateWrapper(editor, input2, options) {
120373
+ rejectTrackedMode("toc.update", options);
120374
+ const command$1 = requireEditorCommand(editor.commands?.replaceTableOfContentsContentById, "toc.update");
120375
+ const resolved = resolveTocTarget(editor.state.doc, input2.target);
120376
+ const config2 = parseTocInstruction(resolved.node.attrs?.instruction ?? "");
120377
+ const content3 = materializeTocContent(editor.state.doc, config2);
120378
+ if (isTocContentUnchanged(resolved.node, content3))
120379
+ return tocFailure("NO_OP", "TOC update produced no change.");
120380
+ if (options?.dryRun)
120381
+ return tocSuccess(resolved.nodeId);
120382
+ return receiptApplied(runTocCommand(editor, command$1, {
120383
+ sdBlockId: resolved.commandNodeId ?? resolved.nodeId,
120384
+ content: content3
120385
+ }, options?.expectedRevision)) ? tocSuccess(resolved.nodeId) : tocFailure("NO_OP", "TOC update produced no change.");
120386
+ }
120387
+ function tocRemoveWrapper(editor, input2, options) {
120388
+ rejectTrackedMode("toc.remove", options);
120389
+ const command$1 = requireEditorCommand(editor.commands?.deleteTableOfContentsById, "toc.remove");
120390
+ const resolved = resolveTocTarget(editor.state.doc, input2.target);
120391
+ if (options?.dryRun)
120392
+ return tocSuccess(resolved.nodeId);
120393
+ return receiptApplied(runTocCommand(editor, command$1, { sdBlockId: resolved.commandNodeId ?? resolved.nodeId }, options?.expectedRevision)) ? tocSuccess(resolved.nodeId) : tocFailure("NO_OP", "TOC removal produced no change.");
120394
+ }
120395
+ function createTableOfContentsWrapper(editor, input2, options) {
120396
+ rejectTrackedMode("create.tableOfContents", options);
120397
+ const command$1 = requireEditorCommand(editor.commands?.insertTableOfContentsAt, "create.tableOfContents");
120398
+ const at = input2.at ?? { kind: "documentEnd" };
120399
+ let pos;
120400
+ if (at.kind === "documentStart")
120401
+ pos = 0;
120402
+ else if (at.kind === "documentEnd")
120403
+ pos = editor.state.doc.content.size;
120404
+ else
120405
+ pos = resolveBlockInsertionPos(editor, at.target.nodeId, at.kind);
120406
+ const config2 = input2.config ? applyTocPatch(DEFAULT_TOC_CONFIG, input2.config) : DEFAULT_TOC_CONFIG;
120407
+ const instruction = serializeTocInstruction(config2);
120408
+ const content3 = materializeTocContent(editor.state.doc, config2);
120409
+ const sdBlockId = v4_default();
120410
+ if (options?.dryRun)
120411
+ return {
120412
+ success: true,
120413
+ toc: buildTocAddress("(dry-run)")
120414
+ };
120415
+ if (!receiptApplied(runTocCommand(editor, command$1, {
120416
+ pos,
120417
+ instruction,
120418
+ sdBlockId,
120419
+ content: content3
120420
+ }, options?.expectedRevision)))
120421
+ return {
120422
+ success: false,
120423
+ failure: {
120424
+ code: "INVALID_INSERTION_CONTEXT",
120425
+ message: "Table of contents could not be inserted at the requested location."
120426
+ }
120427
+ };
120428
+ return {
120429
+ success: true,
120430
+ toc: buildTocAddress(resolvePostMutationTocId(editor.state.doc, sdBlockId))
120431
+ };
120432
+ }
119283
120433
  function assembleDocumentApiAdapters(editor) {
119284
120434
  registerBuiltInExecutors();
119285
120435
  initRevision(editor);
@@ -119316,7 +120466,8 @@ function assembleDocumentApiAdapters(editor) {
119316
120466
  paragraph: (input2, options) => createParagraphWrapper(editor, input2, options),
119317
120467
  heading: (input2, options) => createHeadingWrapper(editor, input2, options),
119318
120468
  table: (input2, options) => createTableWrapper(editor, input2, options),
119319
- sectionBreak: (input2, options) => createSectionBreakAdapter(editor, input2, options)
120469
+ sectionBreak: (input2, options) => createSectionBreakAdapter(editor, input2, options),
120470
+ tableOfContents: (input2, options) => createTableOfContentsWrapper(editor, input2, options)
119320
120471
  },
119321
120472
  lists: {
119322
120473
  list: (query2) => listsListWrapper(editor, query2),
@@ -119389,6 +120540,13 @@ function assembleDocumentApiAdapters(editor) {
119389
120540
  getCells: (input2) => tablesGetCellsAdapter(editor, input2),
119390
120541
  getProperties: (input2) => tablesGetPropertiesAdapter(editor, input2)
119391
120542
  },
120543
+ toc: {
120544
+ list: (query2) => tocListWrapper(editor, query2),
120545
+ get: (input2) => tocGetWrapper(editor, input2),
120546
+ configure: (input2, options) => tocConfigureWrapper(editor, input2, options),
120547
+ update: (input2, options) => tocUpdateWrapper(editor, input2, options),
120548
+ remove: (input2, options) => tocRemoveWrapper(editor, input2, options)
120549
+ },
119392
120550
  query: { match: (input2) => queryMatchAdapter(editor, input2) },
119393
120551
  mutations: {
119394
120552
  preview: (input2) => previewPlan(editor, input2),
@@ -119753,6 +120911,101 @@ function setFocusMeta(tr, value) {
119753
120911
  function getFocusState(state) {
119754
120912
  return CustomSelectionPluginKey.getState(state);
119755
120913
  }
120914
+ function mapPreservedSelection(selection, tr) {
120915
+ if (!selection || !tr.docChanged)
120916
+ return selection;
120917
+ if (typeof selection.from !== "number" || typeof selection.to !== "number")
120918
+ return null;
120919
+ const from$12 = tr.mapping.map(selection.from, -1);
120920
+ const to = tr.mapping.map(selection.to, 1);
120921
+ if (from$12 >= to)
120922
+ return null;
120923
+ try {
120924
+ return TextSelection2.create(tr.doc, from$12, to);
120925
+ } catch {
120926
+ return null;
120927
+ }
120928
+ }
120929
+ function charOffsetToPosition(doc$2, charOffset, blockSep, leafSep) {
120930
+ const docSize = doc$2.content.size;
120931
+ if (charOffset <= 0)
120932
+ return 0;
120933
+ if (charOffset >= doc$2.textBetween(0, docSize, blockSep, leafSep).length)
120934
+ return docSize;
120935
+ let low = 0;
120936
+ let high = docSize;
120937
+ while (low < high) {
120938
+ const mid = Math.floor((low + high) / 2);
120939
+ if (doc$2.textBetween(0, mid, blockSep, leafSep).length < charOffset)
120940
+ low = mid + 1;
120941
+ else
120942
+ high = mid;
120943
+ }
120944
+ return low;
120945
+ }
120946
+ function findRangeByText(doc$2, text5, hintFrom) {
120947
+ if (!text5)
120948
+ return null;
120949
+ const docSize = doc$2.content.size;
120950
+ const full = doc$2.textBetween(0, docSize, TEXT_RANGE_BLOCK_SEP, TEXT_RANGE_LEAF_SEP);
120951
+ const matches2 = [];
120952
+ let i$1 = 0;
120953
+ for (;; ) {
120954
+ const idx = full.indexOf(text5, i$1);
120955
+ if (idx === -1)
120956
+ break;
120957
+ matches2.push(idx);
120958
+ i$1 = idx + 1;
120959
+ }
120960
+ if (matches2.length === 0)
120961
+ return null;
120962
+ const toPos = (charOffset) => charOffsetToPosition(doc$2, charOffset, TEXT_RANGE_BLOCK_SEP, TEXT_RANGE_LEAF_SEP);
120963
+ const initial = matches2[0];
120964
+ let charOffsetFrom;
120965
+ if (hintFrom == null)
120966
+ charOffsetFrom = initial;
120967
+ else
120968
+ charOffsetFrom = matches2.reduce((acc, idx) => {
120969
+ const pos = toPos(idx);
120970
+ return Math.abs(pos - hintFrom) < Math.abs(acc.bestPos - hintFrom) ? {
120971
+ best: idx,
120972
+ bestPos: pos
120973
+ } : acc;
120974
+ }, {
120975
+ best: initial,
120976
+ bestPos: toPos(initial)
120977
+ }).best;
120978
+ const from$12 = toPos(charOffsetFrom);
120979
+ const to = toPos(charOffsetFrom + text5.length);
120980
+ return from$12 < to ? {
120981
+ from: from$12,
120982
+ to
120983
+ } : null;
120984
+ }
120985
+ function resolveMovedRangeFromPrevious(doc$2, docSize, prev) {
120986
+ if (!prev.text)
120987
+ return null;
120988
+ const resolved = findRangeByText(doc$2, prev.text, prev.from);
120989
+ if (!resolved)
120990
+ return null;
120991
+ if (resolved.from < 0 || resolved.to <= resolved.from || resolved.to > docSize)
120992
+ return null;
120993
+ return resolved;
120994
+ }
120995
+ function restoreRangesFromPrevious(doc$2, docSize, previousRanges) {
120996
+ const out = [];
120997
+ for (const prev of previousRanges) {
120998
+ const resolved = resolveMovedRangeFromPrevious(doc$2, docSize, prev);
120999
+ if (!resolved)
121000
+ continue;
121001
+ out.push({
121002
+ ...prev,
121003
+ from: resolved.from,
121004
+ to: resolved.to
121005
+ });
121006
+ }
121007
+ return out;
121008
+ }
119756
121009
  function computeTabStops$1(context) {
119757
121010
  const { explicitStops, defaultTabInterval, paragraphIndent } = context;
119758
121011
  const leftIndent = paragraphIndent.left ?? 0;
@@ -121160,7 +122413,7 @@ function updateMaxFontInfo(currentMaxSize, currentMaxInfo, newRun) {
121160
122413
  return getFontInfoFromRun(newRun);
121161
122414
  return currentMaxInfo;
121162
122415
  }
121163
- function isTextRun$4(run2) {
122416
+ function isTextRun$5(run2) {
121164
122417
  return run2.kind === "text" || run2.kind === undefined;
121165
122418
  }
121166
122419
  function isTabRun$1(run2) {
@@ -121278,9 +122531,9 @@ async function measureBlock(block, constraints) {
121278
122531
  async function measureParagraphBlock(block, maxWidth) {
121279
122532
  const ctx$2 = getCanvasContext();
121280
122533
  const wordLayout = block.attrs?.wordLayout;
121281
- const firstTextRunWithSize = block.runs.find((run2) => isTextRun$4(run2) && ("fontSize" in run2) && run2.fontSize != null);
122534
+ const firstTextRunWithSize = block.runs.find((run2) => isTextRun$5(run2) && ("fontSize" in run2) && run2.fontSize != null);
121282
122535
  const fallbackFontSize = normalizeFontSize$1(firstTextRunWithSize?.fontSize, DEFAULT_PARAGRAPH_FONT_SIZE);
121283
- const fallbackFontFamily = block.runs.find((run2) => isTextRun$4(run2) && typeof run2.fontFamily === "string" && run2.fontFamily.trim().length > 0)?.fontFamily ?? DEFAULT_PARAGRAPH_FONT_FAMILY;
122536
+ const fallbackFontFamily = block.runs.find((run2) => isTextRun$5(run2) && typeof run2.fontFamily === "string" && run2.fontFamily.trim().length > 0)?.fontFamily ?? DEFAULT_PARAGRAPH_FONT_FAMILY;
121284
122537
  const normalizedRuns = normalizeRunsForMeasurement(block.runs, fallbackFontSize, fallbackFontFamily);
121285
122538
  const markerInfo = wordLayout?.marker ? (() => {
121286
122539
  const { font: markerFont } = buildFontString({
@@ -129905,7 +131158,7 @@ function mergeAdjacentRuns(runs2) {
129905
131158
  let current = runs2[0];
129906
131159
  for (let i$1 = 1;i$1 < runs2.length; i$1++) {
129907
131160
  const next2 = runs2[i$1];
129908
- if (isTextRun$1(current) && isTextRun$1(next2) && !current.token && !next2.token && current.pmStart != null && current.pmEnd != null && next2.pmStart != null && next2.pmEnd != null && current.pmEnd === next2.pmStart && current.fontFamily === next2.fontFamily && current.fontSize === next2.fontSize && current.bold === next2.bold && current.italic === next2.italic && current.underline === next2.underline && current.strike === next2.strike && current.color === next2.color && current.highlight === next2.highlight && (current.letterSpacing ?? 0) === (next2.letterSpacing ?? 0) && trackedChangesCompatible(current, next2) && dataAttrsCompatible(current, next2) && commentsCompatible(current, next2)) {
131161
+ if (isTextRun$2(current) && isTextRun$2(next2) && !current.token && !next2.token && current.pmStart != null && current.pmEnd != null && next2.pmStart != null && next2.pmEnd != null && current.pmEnd === next2.pmStart && current.fontFamily === next2.fontFamily && current.fontSize === next2.fontSize && current.bold === next2.bold && current.italic === next2.italic && current.underline === next2.underline && current.strike === next2.strike && current.color === next2.color && current.highlight === next2.highlight && (current.letterSpacing ?? 0) === (next2.letterSpacing ?? 0) && trackedChangesCompatible(current, next2) && dataAttrsCompatible(current, next2) && commentsCompatible(current, next2)) {
129909
131162
  const currText = current.text ?? "";
129910
131163
  const nextText = next2.text ?? "";
129911
131164
  current = {
@@ -131704,7 +132957,7 @@ function getCtx() {
131704
132957
  ctx$1 = canvas.getContext("2d");
131705
132958
  return ctx$1;
131706
132959
  }
131707
- function isTextRun(run2) {
132960
+ function isTextRun$1(run2) {
131708
132961
  if (run2.kind === "tab" || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation")
131709
132962
  return false;
131710
132963
  if ("src" in run2)
@@ -131712,7 +132965,7 @@ function isTextRun(run2) {
131712
132965
  return true;
131713
132966
  }
131714
132967
  function fontString(run2) {
131715
- const textRun = isTextRun(run2) ? run2 : null;
132968
+ const textRun = isTextRun$1(run2) ? run2 : null;
131716
132969
  const size$2 = textRun?.fontSize ?? 16;
131717
132970
  const family = textRun?.fontFamily ?? "Arial";
131718
132971
  return `${textRun?.italic ? "italic " : ""}${textRun?.bold ? "bold " : ""}${size$2}px ${family}`.trim();
@@ -131723,10 +132976,10 @@ function runText(run2) {
131723
132976
  function measureRunSliceWidth(run2, fromChar, toChar) {
131724
132977
  const context = getCtx();
131725
132978
  const fullText = runText(run2);
131726
- const transform = isTextRun(run2) ? run2.textTransform : undefined;
132979
+ const transform = isTextRun$1(run2) ? run2.textTransform : undefined;
131727
132980
  const text5 = applyTextTransform(fullText.slice(fromChar, toChar), transform, fullText, fromChar);
131728
132981
  if (!context) {
131729
- const size$2 = (isTextRun(run2) ? run2 : null)?.fontSize ?? 16;
132982
+ const size$2 = (isTextRun$1(run2) ? run2 : null)?.fontSize ?? 16;
131730
132983
  return Math.max(1, text5.length * (size$2 * 0.6));
131731
132984
  }
131732
132985
  context.font = fontString(run2);
@@ -131736,7 +132989,7 @@ function lineHeightForRuns(runs2, fromRun, toRun) {
131736
132989
  let maxSize$1 = 0;
131737
132990
  for (let i$1 = fromRun;i$1 <= toRun; i$1 += 1) {
131738
132991
  const run2 = runs2[i$1];
131739
- const size$2 = (run2 && isTextRun(run2) ? run2 : null)?.fontSize ?? 16;
132992
+ const size$2 = (run2 && isTextRun$1(run2) ? run2 : null)?.fontSize ?? 16;
131740
132993
  if (size$2 > maxSize$1)
131741
132994
  maxSize$1 = size$2;
131742
132995
  }
@@ -135397,6 +136650,108 @@ async function layoutWithPerSectionConstraints(kind, blocksByRId, sectionMetadat
135397
136650
  }
135398
136651
  }
135399
136652
  }
136653
+ function getBoundaries(ranges) {
136654
+ const set = /* @__PURE__ */ new Set;
136655
+ for (const r$1 of ranges) {
136656
+ if (Number.isFinite(r$1.from))
136657
+ set.add(r$1.from);
136658
+ if (Number.isFinite(r$1.to))
136659
+ set.add(r$1.to);
136660
+ }
136661
+ return [...set].sort((a2, b$1) => a2 - b$1);
136662
+ }
136663
+ function isTextRun(run2) {
136664
+ return "text" in run2 && typeof run2.text === "string";
136665
+ }
136666
+ function splitParagraphRuns(paragraph2, boundaries) {
136667
+ const newRuns = [];
136668
+ for (const run2 of paragraph2.runs) {
136669
+ if (!isTextRun(run2)) {
136670
+ newRuns.push(run2);
136671
+ continue;
136672
+ }
136673
+ const start$1 = run2.pmStart;
136674
+ const end$1 = run2.pmEnd;
136675
+ if (start$1 == null || end$1 == null || start$1 >= end$1) {
136676
+ newRuns.push(run2);
136677
+ continue;
136678
+ }
136679
+ const runBoundaries = boundaries.filter((b$1) => b$1 > start$1 && b$1 < end$1);
136680
+ if (runBoundaries.length === 0) {
136681
+ newRuns.push(run2);
136682
+ continue;
136683
+ }
136684
+ const positions = [
136685
+ start$1,
136686
+ ...runBoundaries,
136687
+ end$1
136688
+ ];
136689
+ for (let i$1 = 0;i$1 < positions.length - 1; i$1++) {
136690
+ const segStart = positions[i$1];
136691
+ const segEnd = positions[i$1 + 1];
136692
+ const charStart = segStart - start$1;
136693
+ const charEnd = segEnd - start$1;
136694
+ const segmentText = run2.text.slice(charStart, charEnd);
136695
+ if (segmentText.length === 0)
136696
+ continue;
136697
+ newRuns.push({
136698
+ ...run2,
136699
+ text: segmentText,
136700
+ pmStart: segStart,
136701
+ pmEnd: segEnd
136702
+ });
136703
+ }
136704
+ }
136705
+ return {
136706
+ ...paragraph2,
136707
+ runs: newRuns
136708
+ };
136709
+ }
136710
+ function splitRunsInTableCell(cell2, boundaries) {
136711
+ const result = { ...cell2 };
136712
+ if (cell2.paragraph)
136713
+ result.paragraph = splitParagraphRuns(cell2.paragraph, boundaries);
136714
+ if (cell2.blocks?.length)
136715
+ result.blocks = cell2.blocks.map((b$1) => {
136716
+ if (b$1.kind === "paragraph")
136717
+ return splitParagraphRuns(b$1, boundaries);
136718
+ if (b$1.kind === "table")
136719
+ return splitRunsInBlock(b$1, boundaries);
136720
+ return b$1;
136721
+ });
136722
+ return result;
136723
+ }
136724
+ function splitRunsInBlock(block, boundaries) {
136725
+ if (block.kind === "paragraph")
136726
+ return splitParagraphRuns(block, boundaries);
136727
+ if (block.kind === "table") {
136728
+ const table2 = block;
136729
+ return {
136730
+ ...table2,
136731
+ rows: table2.rows.map((row2) => ({
136732
+ ...row2,
136733
+ cells: row2.cells.map((cell2) => splitRunsInTableCell(cell2, boundaries))
136734
+ }))
136735
+ };
136736
+ }
136737
+ if (block.kind === "list") {
136738
+ const list5 = block;
136739
+ return {
136740
+ ...list5,
136741
+ items: list5.items.map((item) => ({
136742
+ ...item,
136743
+ paragraph: splitParagraphRuns(item.paragraph, boundaries)
136744
+ }))
136745
+ };
136746
+ }
136747
+ return block;
136748
+ }
136749
+ function splitRunsAtDecorationBoundaries(blocks2, ranges) {
136750
+ if (ranges.length === 0)
136751
+ return blocks2;
136752
+ const boundaries = getBoundaries(ranges);
136753
+ return blocks2.map((block) => splitRunsInBlock(block, boundaries));
136754
+ }
135400
136755
  function dropCursor(options = {}) {
135401
136756
  return new Plugin({ view(editorView) {
135402
136757
  return new DropCursorView(editorView, options);
@@ -153238,13 +154593,13 @@ var Node$13 = class Node$14 {
153238
154593
  console.warn("Failed to initialize developer tools:", error);
153239
154594
  }
153240
154595
  }
153241
- }, BLANK_DOCX_DATA_URI = `data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQAAAAIAAAAIQAykW9XXgEAAKUFAAATABwAW0NvbnRlbnRfVHlwZXNdLnhtbFVUCQADMNDOEjDQzhJ1eAsAAQT1AQAABBQAAAC1lMtqwzAQRfeF/oPRNthKuiilxMmij2UbaPoBijRORPVCmrz+vuM4NaWkMeSxMcgz994zQsxwvLEmW0FM2ruSDYo+y8BJr7Sbl+xz+po/sCyhcEoY76BkW0hsPLq9GU63AVJGapdKtkAMj5wnuQArUuEDOKpUPlqBdIxzHoT8EnPgd/3+PZfeITjMsfZgo+EzVGJpMHvZ0O+GJIJJLH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AABBQAAABQSwECHgMUAAAACAAAACEAP6/hZl8PAAANpgAADwAYAAAAAAABAAAApIFaFwAAd29yZC9zdHlsZXMueG1sVVQFAAMw0M4SdXgLAAEE9QEAAAQUAAAAUEsBAh4DCgAAAAAAk2RNWwAAAAAAAAAAAAAAAAsAGAAAAAAAAAAQAO1BAicAAHdvcmQvdGhlbWUvVVQFAAOGHO1odXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAAAAhAGeA/LSbBgAAzSAAABUAGAAAAAAAAQAAAKSBRycAAHdvcmQvdGhlbWUvdGhlbWUxLnhtbFVUBQADMNDOEnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAJNkTVsAAAAAAAAAAAAAAAALABgAAAAAAAAAEADtQTEuAAB3b3JkL19yZWxzL1VUBQADhhztaHV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAAAAIQCzvosd/gAAALYDAAAcABgAAAAAAAEAAACkgXYuAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzVVQFAAMw0M4SdXgLAAEE9QEAAAQUAAAAUEsFBgAAAAARABEAqQUAAMovAAAAAA==`, LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, DocumentApiAdapterError, ALIAS_ELIGIBLE_TYPES, cacheByEditor, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, PlanError, revisionMap, subscribedEditors, everSyncedProviders, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SUPPORTED_STEP_OPS, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, VALID_CREATE_POSITIONS, REF_HANDLERS, STEP_INTERACTION_MATRIX, MATRIX_EXEMPT_OPS, DEFAULT_INLINE_POLICY, CORE_SET_MARK_KEYS, BOOLEAN_INLINE_MARK_KEYS, TEXT_STYLE_KEYS, PRESERVE_RUN_PROPERTIES_META_KEY = "sdPreserveRunPropertiesKeys", OBJECT_REPLACEMENT_CHAR = "", STUB_WHERE, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL, DERIVED_ID_LENGTH = 24, groupedCache, SUPPORTED_NODE_TYPES, REJECTED_NODE_TYPES, CSS_NAMED_COLORS, ZERO_WIDTH_SPACE = "​", ROW_START_TO_TEXT_OFFSET = 3, CELL_TO_TEXT_OFFSET = 2, normalizeHeaderAttrsForBodyCell = (attrs) => {
154596
+ }, BLANK_DOCX_DATA_URI = `data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQAAAAIAAAAIQAykW9XXgEAAKUFAAATABwAW0NvbnRlbnRfVHlwZXNdLnhtbFVUCQADMNDOEjDQzhJ1eAsAAQT1AQAABBQAAAC1lMtqwzAQRfeF/oPRNthKuiilxMmij2UbaPoBijRORPVCmrz+vuM4NaWkMeSxMcgz994zQsxwvLEmW0FM2ruSDYo+y8BJr7Sbl+xz+po/sCyhcEoY76BkW0hsPLq9GU63AVJGapdKtkAMj5wnuQArUuEDOKpUPlqBdIxzHoT8EnPgd/3+PZfeITjMsfZgo+EzVGJpMHvZ0O+GJIJJLHtqGuuskokQjJYCqc5XTv1JyfcJBSl3PWmhQ+pRA+MHE+rK/wF73TtdTdQKsomI+CYsdfG1j4orL5eWlMVxmwOcvqq0hFZfu4XoJaREd25N0Vas0K7XxeGWdgaRlJcHaa07IRJuDaTLEzS+3fGASIJrAOydOxHWMPu4GsUv806QinKnYmbg8hitdScE0hqA5js4m2NncyySOifRh0RrJZ4w9s/eqNU5DRwgoj7+6tpEsj57PqhXkgJ1IJvvluzoG1BLAwQKAAAAAACTZE1bAAAAAAAAAAAAAAA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SBRycAAHdvcmQvdGhlbWUvdGhlbWUxLnhtbFVUBQADMNDOEnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAJNkTVsAAAAAAAAAAAAAAAALABgAAAAAAAAAEADtQTEuAAB3b3JkL19yZWxzL1VUBQADhhztaHV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAAAAIQCzvosd/gAAALYDAAAcABgAAAAAAAEAAACkgXYuAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzVVQFAAMw0M4SdXgLAAEE9QEAAAQUAAAAUEsFBgAAAAARABEAqQUAAMovAAAAAA==`, LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, DocumentApiAdapterError, ALIAS_ELIGIBLE_TYPES, cacheByEditor, DEFAULT_TOC_CONFIG, SWITCH_PATTERN, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, PlanError, revisionMap, subscribedEditors, everSyncedProviders, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SUPPORTED_STEP_OPS, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, VALID_CREATE_POSITIONS, REF_HANDLERS, STEP_INTERACTION_MATRIX, MATRIX_EXEMPT_OPS, DEFAULT_INLINE_POLICY, CORE_SET_MARK_KEYS, BOOLEAN_INLINE_MARK_KEYS, TEXT_STYLE_KEYS, PRESERVE_RUN_PROPERTIES_META_KEY = "sdPreserveRunPropertiesKeys", OBJECT_REPLACEMENT_CHAR = "", STUB_WHERE, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL, DERIVED_ID_LENGTH = 24, groupedCache, SUPPORTED_NODE_TYPES, REJECTED_NODE_TYPES, CSS_NAMED_COLORS, ZERO_WIDTH_SPACE = "​", ROW_START_TO_TEXT_OFFSET = 3, CELL_TO_TEXT_OFFSET = 2, normalizeHeaderAttrsForBodyCell = (attrs) => {
153242
154597
  if (attrs?.borders !== null)
153243
154598
  return attrs;
153244
154599
  const nextAttrs = { ...attrs };
153245
154600
  delete nextAttrs.borders;
153246
154601
  return nextAttrs;
153247
- }, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, TABLE_ADAPTER_DISPATCH, ROW_OPS, TABLE_SCOPED_OPS, registered = false, SETTINGS_PART_PATH = "word/settings.xml", SectionType, DEFAULT_PARAGRAPH_SECTION_TYPE, DEFAULT_BODY_SECTION_TYPE, TWIPS_PER_INCH$2 = 1440, PX_PER_INCH$2 = 96, DEFAULT_COLUMN_GAP_INCHES = 0.5, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH$2 = 96, DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", RELS_XMLNS2 = "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, empty_exports, init_empty, PIXELS_PER_INCH$1 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, Editor, ContextMenuPluginKey, MENU_OFFSET_X = 0, MENU_OFFSET_Y = 28, CONTEXT_MENU_OFFSET_X = 10, CONTEXT_MENU_OFFSET_Y = 10, SLASH_COOLDOWN_MS = 5000, ContextMenu, SearchQuery = class {
154602
+ }, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, TABLE_ADAPTER_DISPATCH, ROW_OPS, TABLE_SCOPED_OPS, registered = false, SETTINGS_PART_PATH = "word/settings.xml", SectionType, DEFAULT_PARAGRAPH_SECTION_TYPE, DEFAULT_BODY_SECTION_TYPE, TWIPS_PER_INCH$2 = 1440, PX_PER_INCH$2 = 96, DEFAULT_COLUMN_GAP_INCHES = 0.5, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH$2 = 96, DOCUMENT_RELS_PATH = "word/_rels/document.xml.rels", RELS_XMLNS2 = "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, NO_ENTRIES_PLACEHOLDER, empty_exports, init_empty, PIXELS_PER_INCH$1 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, Editor, ContextMenuPluginKey, MENU_OFFSET_X = 0, MENU_OFFSET_Y = 28, CONTEXT_MENU_OFFSET_X = 10, CONTEXT_MENU_OFFSET_Y = 10, SLASH_COOLDOWN_MS = 5000, ContextMenu, SearchQuery = class {
153248
154603
  constructor(config2) {
153249
154604
  this.search = config2.search;
153250
154605
  this.caseSensitive = !!config2.caseSensitive;
@@ -154303,19 +155658,35 @@ var Node$13 = class Node$14 {
154303
155658
  return "default";
154304
155659
  }
154305
155660
  }
154306
- }, NodeResizer, EXCLUDED_PLUGIN_KEY_REF_LIST, EXCLUDED_PLUGIN_KEY_REFS, EXCLUDED_PLUGIN_KEY_PREFIXES, DecorationBridge = class DecorationBridge2 {
155661
+ }, NodeResizer, EXCLUDED_PLUGIN_KEY_REF_LIST, EXCLUDED_PLUGIN_KEY_REFS, EXCLUDED_PLUGIN_KEY_PREFIXES, TEXT_RANGE_BLOCK_SEP = `
155662
+ `, TEXT_RANGE_LEAF_SEP = `
155663
+ `, DecorationBridge = class DecorationBridge2 {
154307
155664
  #applied = /* @__PURE__ */ new WeakMap;
154308
155665
  #eligiblePlugins = [];
154309
155666
  #pluginListSnapshot = [];
154310
155667
  #prevDecorationSets = /* @__PURE__ */ new Map;
154311
155668
  #hadEligiblePlugins = false;
154312
- sync(state, domIndex$1) {
155669
+ #previousRanges = /* @__PURE__ */ new Map;
155670
+ #skipRestoreEmptyOnNextCollect = false;
155671
+ #lastDocChangeToken = 0;
155672
+ #docChangeMappingsByToken = /* @__PURE__ */ new Map;
155673
+ #previousRangesTokenByPlugin = /* @__PURE__ */ new Map;
155674
+ sync(state, domIndex$1, options) {
154313
155675
  this.#refreshEligiblePlugins(state);
154314
155676
  const docSize = state.doc.content.size;
154315
- const desired = this.#eligiblePlugins.length > 0 ? this.#collectDesiredState(state, domIndex$1, docSize) : /* @__PURE__ */ new Map;
155677
+ const restoreEmpty = options?.restoreEmptyDecorations !== false;
155678
+ if (!restoreEmpty)
155679
+ this.#skipRestoreEmptyOnNextCollect = true;
155680
+ const desired = this.#eligiblePlugins.length > 0 ? this.#collectDesiredState(state, domIndex$1, docSize, restoreEmpty) : /* @__PURE__ */ new Map;
154316
155681
  this.#hadEligiblePlugins = this.#eligiblePlugins.length > 0;
154317
155682
  return this.#reconcile(desired, domIndex$1, docSize);
154318
155683
  }
155684
+ recordTransaction(transaction) {
155685
+ if (!transaction?.docChanged)
155686
+ return;
155687
+ this.#lastDocChangeToken += 1;
155688
+ this.#docChangeMappingsByToken.set(this.#lastDocChangeToken, transaction.mapping);
155689
+ }
154319
155690
  hasChanges(state) {
154320
155691
  this.#refreshEligiblePlugins(state);
154321
155692
  if (this.#eligiblePlugins.length === 0)
@@ -154325,11 +155696,66 @@ var Node$13 = class Node$14 {
154325
155696
  return true;
154326
155697
  return false;
154327
155698
  }
155699
+ collectDecorationRanges(state) {
155700
+ this.#refreshEligiblePlugins(state);
155701
+ const ranges = [];
155702
+ const docSize = state.doc.content.size;
155703
+ for (const plugin$2 of this.#eligiblePlugins) {
155704
+ const pluginRanges = [];
155705
+ const decorationSet = this.#getDecorationSet(plugin$2, state);
155706
+ const prevDecorationSet = this.#prevDecorationSets.get(plugin$2);
155707
+ const remapped = this.#remapUnchangedPluginRangesIfNeeded(plugin$2, decorationSet, prevDecorationSet, state.doc, docSize);
155708
+ if (remapped)
155709
+ pluginRanges.push(...remapped);
155710
+ else if (decorationSet !== DecorationSet.empty) {
155711
+ const decorations = decorationSet.find(0, docSize);
155712
+ for (const decoration of decorations) {
155713
+ if (!this.#isInlineDecoration(decoration))
155714
+ continue;
155715
+ const attrs = this.#extractSafeAttrs(decoration);
155716
+ if (attrs.classes.length === 0 && attrs.styleEntries.length === 0)
155717
+ continue;
155718
+ if (decoration.from >= decoration.to)
155719
+ continue;
155720
+ const dataAttrs = {};
155721
+ for (const [key$1, value] of attrs.dataEntries)
155722
+ dataAttrs[key$1] = value;
155723
+ const rangeText = typeof state.doc.textBetween === "function" ? state.doc.textBetween(decoration.from, decoration.to, TEXT_RANGE_BLOCK_SEP, TEXT_RANGE_LEAF_SEP) : undefined;
155724
+ pluginRanges.push({
155725
+ from: decoration.from,
155726
+ to: decoration.to,
155727
+ classes: attrs.classes,
155728
+ style: attrs.styleEntries.length > 0 ? attrs.styleEntries.map(([prop, val]) => `${prop}: ${val}`).join("; ") : null,
155729
+ dataAttrs,
155730
+ ...rangeText ? { text: rangeText } : {}
155731
+ });
155732
+ }
155733
+ }
155734
+ const previousPluginRanges = this.#previousRanges.get(plugin$2);
155735
+ const mayRestoreEmpty = !this.#skipRestoreEmptyOnNextCollect && previousPluginRanges && previousPluginRanges.length > 0;
155736
+ if (pluginRanges.length === 0 && mayRestoreEmpty)
155737
+ pluginRanges.push(...restoreRangesFromPrevious(state.doc, docSize, previousPluginRanges));
155738
+ this.#setPreviousRanges(plugin$2, pluginRanges.length > 0 ? [...pluginRanges] : []);
155739
+ this.#prevDecorationSets.set(plugin$2, decorationSet);
155740
+ ranges.push(...pluginRanges);
155741
+ }
155742
+ this.#clearSkipRestoreFlagIfSet();
155743
+ return ranges;
155744
+ }
155745
+ #clearSkipRestoreFlagIfSet() {
155746
+ if (this.#skipRestoreEmptyOnNextCollect)
155747
+ this.#skipRestoreEmptyOnNextCollect = false;
155748
+ }
154328
155749
  destroy() {
154329
155750
  this.#eligiblePlugins = [];
154330
155751
  this.#pluginListSnapshot = [];
154331
155752
  this.#prevDecorationSets.clear();
155753
+ this.#previousRanges.clear();
155754
+ this.#previousRangesTokenByPlugin.clear();
154332
155755
  this.#hadEligiblePlugins = false;
155756
+ this.#skipRestoreEmptyOnNextCollect = false;
155757
+ this.#lastDocChangeToken = 0;
155758
+ this.#docChangeMappingsByToken.clear();
154333
155759
  }
154334
155760
  #refreshEligiblePlugins(state) {
154335
155761
  if (state.plugins === this.#pluginListSnapshot)
@@ -154348,6 +155774,13 @@ var Node$13 = class Node$14 {
154348
155774
  for (const key$1 of this.#prevDecorationSets.keys())
154349
155775
  if (!eligibleSet.has(key$1))
154350
155776
  this.#prevDecorationSets.delete(key$1);
155777
+ for (const key$1 of this.#previousRanges.keys())
155778
+ if (!eligibleSet.has(key$1))
155779
+ this.#previousRanges.delete(key$1);
155780
+ for (const key$1 of this.#previousRangesTokenByPlugin.keys())
155781
+ if (!eligibleSet.has(key$1))
155782
+ this.#previousRangesTokenByPlugin.delete(key$1);
155783
+ this.#pruneDocChangeMappings();
154351
155784
  }
154352
155785
  #isExcludedByKeyRef(plugin$2) {
154353
155786
  const specKey = plugin$2.spec?.key;
@@ -154357,34 +155790,170 @@ var Node$13 = class Node$14 {
154357
155790
  const keyString = plugin$2.key ?? "";
154358
155791
  return EXCLUDED_PLUGIN_KEY_PREFIXES.some((prefix$2) => keyString === prefix$2 || keyString.startsWith(`${prefix$2}$`));
154359
155792
  }
154360
- #collectDesiredState(state, domIndex$1, docSize) {
155793
+ #collectDesiredState(state, domIndex$1, docSize, restoreEmptyDecorations) {
154361
155794
  const desired = /* @__PURE__ */ new Map;
154362
155795
  for (const plugin$2 of this.#eligiblePlugins) {
154363
155796
  const decorationSet = this.#getDecorationSet(plugin$2, state);
154364
- this.#prevDecorationSets.set(plugin$2, decorationSet);
154365
- if (decorationSet === DecorationSet.empty)
155797
+ const prevDecorationSet = this.#prevDecorationSets.get(plugin$2);
155798
+ const remapped = this.#remapUnchangedPluginRangesIfNeeded(plugin$2, decorationSet, prevDecorationSet, state.doc, docSize);
155799
+ if (remapped) {
155800
+ this.#applyRangesToDesired(desired, domIndex$1, remapped);
155801
+ this.#setPreviousRanges(plugin$2, [...remapped]);
155802
+ this.#prevDecorationSets.set(plugin$2, decorationSet);
154366
155803
  continue;
154367
- const decorations = decorationSet.find(0, docSize);
154368
- for (const decoration of decorations) {
154369
- if (!this.#isInlineDecoration(decoration))
154370
- continue;
154371
- const attrs = this.#extractSafeAttrs(decoration);
154372
- if (attrs.classes.length === 0 && attrs.dataEntries.length === 0 && attrs.styleEntries.length === 0)
154373
- continue;
154374
- const entries = domIndex$1.findEntriesInRange(decoration.from, decoration.to);
154375
- for (const entry of entries) {
154376
- const state$1 = this.#getOrCreateDesired(desired, entry.el);
154377
- for (const cls of attrs.classes)
154378
- state$1.classes.add(cls);
155804
+ }
155805
+ let pluginHasCurrentRanges = false;
155806
+ const currentRanges = [];
155807
+ if (decorationSet !== DecorationSet.empty) {
155808
+ const decorations = decorationSet.find(0, docSize);
155809
+ for (const decoration of decorations) {
155810
+ if (!this.#isInlineDecoration(decoration))
155811
+ continue;
155812
+ const attrs = this.#extractSafeAttrs(decoration);
155813
+ if (attrs.classes.length === 0 && attrs.dataEntries.length === 0 && attrs.styleEntries.length === 0)
155814
+ continue;
155815
+ if (decoration.from >= decoration.to)
155816
+ continue;
155817
+ pluginHasCurrentRanges = true;
155818
+ const entries = domIndex$1.findEntriesInRange(decoration.from, decoration.to);
155819
+ for (const entry of entries) {
155820
+ const d = this.#getOrCreateDesired(desired, entry.el);
155821
+ for (const cls of attrs.classes)
155822
+ d.classes.add(cls);
155823
+ for (const [key$1, value] of attrs.dataEntries)
155824
+ d.dataAttrs.set(key$1, value);
155825
+ for (const [prop, value] of attrs.styleEntries)
155826
+ d.styleProps.set(prop, value);
155827
+ }
155828
+ const dataAttrs = {};
154379
155829
  for (const [key$1, value] of attrs.dataEntries)
154380
- state$1.dataAttrs.set(key$1, value);
154381
- for (const [prop, value] of attrs.styleEntries)
154382
- state$1.styleProps.set(prop, value);
155830
+ dataAttrs[key$1] = value;
155831
+ const style$1 = attrs.styleEntries.length > 0 ? attrs.styleEntries.map(([prop, val]) => `${prop}: ${val}`).join("; ") : null;
155832
+ const rangeText = typeof state.doc.textBetween === "function" ? state.doc.textBetween(decoration.from, decoration.to, TEXT_RANGE_BLOCK_SEP, TEXT_RANGE_LEAF_SEP) : undefined;
155833
+ currentRanges.push({
155834
+ from: decoration.from,
155835
+ to: decoration.to,
155836
+ classes: attrs.classes,
155837
+ style: style$1,
155838
+ dataAttrs,
155839
+ ...rangeText ? { text: rangeText } : {}
155840
+ });
154383
155841
  }
154384
155842
  }
155843
+ if (pluginHasCurrentRanges) {
155844
+ this.#setPreviousRanges(plugin$2, currentRanges);
155845
+ this.#prevDecorationSets.set(plugin$2, decorationSet);
155846
+ continue;
155847
+ }
155848
+ if (!restoreEmptyDecorations) {
155849
+ this.#setPreviousRanges(plugin$2, []);
155850
+ this.#prevDecorationSets.set(plugin$2, decorationSet);
155851
+ continue;
155852
+ }
155853
+ const previousPluginRanges = this.#previousRanges.get(plugin$2);
155854
+ if (previousPluginRanges?.length) {
155855
+ const restoredRanges = restoreRangesFromPrevious(state.doc, docSize, previousPluginRanges);
155856
+ this.#applyRangesToDesired(desired, domIndex$1, restoredRanges);
155857
+ }
155858
+ this.#prevDecorationSets.set(plugin$2, decorationSet);
154385
155859
  }
154386
155860
  return desired;
154387
155861
  }
155862
+ #applyRangesToDesired(desired, domIndex$1, ranges) {
155863
+ for (const range of ranges) {
155864
+ const entries = domIndex$1.findEntriesInRange(range.from, range.to);
155865
+ for (const entry of entries) {
155866
+ const d = this.#getOrCreateDesired(desired, entry.el);
155867
+ for (const cls of range.classes)
155868
+ d.classes.add(cls);
155869
+ for (const [key$1, value] of Object.entries(range.dataAttrs))
155870
+ d.dataAttrs.set(key$1, value);
155871
+ if (range.style)
155872
+ for (const [prop, value] of DecorationBridge2.#parseStyleString(range.style))
155873
+ d.styleProps.set(prop, value);
155874
+ }
155875
+ }
155876
+ }
155877
+ #setPreviousRanges(plugin$2, ranges) {
155878
+ this.#previousRanges.set(plugin$2, ranges);
155879
+ this.#previousRangesTokenByPlugin.set(plugin$2, this.#lastDocChangeToken);
155880
+ this.#pruneDocChangeMappings();
155881
+ }
155882
+ #getMappingsSinceToken(fromToken) {
155883
+ if (fromToken >= this.#lastDocChangeToken)
155884
+ return [];
155885
+ const mappings = [];
155886
+ for (let token = fromToken + 1;token <= this.#lastDocChangeToken; token += 1) {
155887
+ const mapping = this.#docChangeMappingsByToken.get(token);
155888
+ if (!mapping)
155889
+ return [];
155890
+ mappings.push(mapping);
155891
+ }
155892
+ return mappings;
155893
+ }
155894
+ #mapThroughMappings(pos, assoc, mappings) {
155895
+ let mapped = pos;
155896
+ for (const mapping of mappings)
155897
+ mapped = mapping.map(mapped, assoc);
155898
+ return mapped;
155899
+ }
155900
+ #pruneDocChangeMappings() {
155901
+ if (this.#docChangeMappingsByToken.size === 0)
155902
+ return;
155903
+ let minTrackedToken = this.#lastDocChangeToken;
155904
+ for (const token of this.#previousRangesTokenByPlugin.values())
155905
+ if (token < minTrackedToken)
155906
+ minTrackedToken = token;
155907
+ for (const token of this.#docChangeMappingsByToken.keys())
155908
+ if (token <= minTrackedToken)
155909
+ this.#docChangeMappingsByToken.delete(token);
155910
+ }
155911
+ #remapUnchangedPluginRangesIfNeeded(plugin$2, currentSet, previousSet, doc$2, docSize) {
155912
+ if (!previousSet || previousSet !== currentSet)
155913
+ return null;
155914
+ const previousRanges = this.#previousRanges.get(plugin$2);
155915
+ if (!previousRanges?.length)
155916
+ return null;
155917
+ const rangesToken = this.#previousRangesTokenByPlugin.get(plugin$2) ?? -1;
155918
+ if (rangesToken === this.#lastDocChangeToken)
155919
+ return previousRanges;
155920
+ const mappings = this.#getMappingsSinceToken(rangesToken);
155921
+ if (mappings.length === 0)
155922
+ return null;
155923
+ const remapped = [];
155924
+ for (const prev of previousRanges) {
155925
+ if (prev.text) {
155926
+ const resolved = findRangeByText(doc$2, prev.text, prev.from);
155927
+ if (resolved && resolved.from >= 0 && resolved.to > resolved.from && resolved.to <= docSize) {
155928
+ remapped.push({
155929
+ from: resolved.from,
155930
+ to: resolved.to,
155931
+ classes: prev.classes,
155932
+ style: prev.style,
155933
+ dataAttrs: prev.dataAttrs,
155934
+ text: prev.text
155935
+ });
155936
+ continue;
155937
+ }
155938
+ }
155939
+ const from$12 = this.#mapThroughMappings(prev.from, -1, mappings);
155940
+ const to = this.#mapThroughMappings(prev.to, 1, mappings);
155941
+ if (from$12 < 0 || to <= from$12 || to > docSize)
155942
+ continue;
155943
+ remapped.push({
155944
+ from: from$12,
155945
+ to,
155946
+ classes: prev.classes,
155947
+ style: prev.style,
155948
+ dataAttrs: prev.dataAttrs,
155949
+ text: prev.text
155950
+ });
155951
+ }
155952
+ if (remapped.length === 0)
155953
+ return null;
155954
+ this.#setPreviousRanges(plugin$2, remapped);
155955
+ return remapped;
155956
+ }
154388
155957
  #getDecorationSet(plugin$2, state) {
154389
155958
  try {
154390
155959
  const result = plugin$2.props.decorations?.call(plugin$2, state);
@@ -155474,7 +157043,7 @@ var Node$13 = class Node$14 {
155474
157043
  target: currentX + DEFAULT_TAB_INTERVAL_PX$1,
155475
157044
  nextIndex: index2
155476
157045
  };
155477
- }, SINGLE_COLUMN_DEFAULT, isTextRun$3 = (run2) => {
157046
+ }, SINGLE_COLUMN_DEFAULT, isTextRun$4 = (run2) => {
155478
157047
  const runWithKind = run2;
155479
157048
  return !runWithKind.kind || runWithKind.kind === "text";
155480
157049
  }, isEmptyTextParagraph = (block) => {
@@ -155484,7 +157053,7 @@ var Node$13 = class Node$14 {
155484
157053
  if (runs2.length !== 1)
155485
157054
  return false;
155486
157055
  const run2 = runs2[0];
155487
- if (!isTextRun$3(run2))
157056
+ if (!isTextRun$4(run2))
155488
157057
  return false;
155489
157058
  return typeof run2.text === "string" && run2.text.length === 0;
155490
157059
  }, shouldSuppressSpacingForEmpty = (block, side) => {
@@ -157963,10 +159532,10 @@ var Node$13 = class Node$14 {
157963
159532
  }
157964
159533
  }, Y_SORT_THRESHOLD_PX = 2, Y_SAME_LINE_THRESHOLD_PX = 3, HORIZONTAL_OVERLAP_THRESHOLD = 0.8, isValidTrackedMode = (value) => {
157965
159534
  return typeof value === "string" && VALID_TRACKED_MODES.includes(value);
157966
- }, isTextRun$2 = (run2) => {
159535
+ }, isTextRun$3 = (run2) => {
157967
159536
  return "text" in run2 && run2.kind !== "tab";
157968
159537
  }, stripTrackedChangeFromRun = (run2) => {
157969
- if (!isTextRun$2(run2))
159538
+ if (!isTextRun$3(run2))
157970
159539
  return;
157971
159540
  if ("trackedChange" in run2 && run2.trackedChange)
157972
159541
  delete run2.trackedChange;
@@ -158032,14 +159601,14 @@ var Node$13 = class Node$14 {
158032
159601
  runs2.forEach((run2) => stripTrackedChangeFromRun(run2));
158033
159602
  else
158034
159603
  runs2.forEach((run2) => {
158035
- if (isTextRun$2(run2))
159604
+ if (isTextRun$3(run2))
158036
159605
  applyFormatChangeMarks(run2, config2, hyperlinkConfig, applyMarksToRun$1, themeColors, enableComments);
158037
159606
  });
158038
159607
  return runs2;
158039
159608
  }
158040
159609
  const filtered = [];
158041
159610
  runs2.forEach((run2) => {
158042
- if (!isTextRun$2(run2)) {
159611
+ if (!isTextRun$3(run2)) {
158043
159612
  filtered.push(run2);
158044
159613
  return;
158045
159614
  }
@@ -158058,12 +159627,12 @@ var Node$13 = class Node$14 {
158058
159627
  filtered.forEach((run2) => stripTrackedChangeFromRun(run2));
158059
159628
  else {
158060
159629
  filtered.forEach((run2) => {
158061
- if (isTextRun$2(run2))
159630
+ if (isTextRun$3(run2))
158062
159631
  applyFormatChangeMarks(run2, config2, hyperlinkConfig || DEFAULT_HYPERLINK_CONFIG, applyMarksToRun$1, themeColors, enableComments);
158063
159632
  });
158064
159633
  if ((config2.mode === "original" || config2.mode === "final") && config2.enabled)
158065
159634
  filtered.forEach((run2) => {
158066
- if (isTextRun$2(run2) && run2.trackedChange && (run2.trackedChange.kind === "insert" || run2.trackedChange.kind === "delete"))
159635
+ if (isTextRun$3(run2) && run2.trackedChange && (run2.trackedChange.kind === "insert" || run2.trackedChange.kind === "delete"))
158067
159636
  delete run2.trackedChange;
158068
159637
  });
158069
159638
  }
@@ -158673,7 +160242,12 @@ var Node$13 = class Node$14 {
158673
160242
  if (history$1 != null)
158674
160243
  link2.history = history$1;
158675
160244
  return link2;
158676
- }, TRACK_INSERT_MARK = "trackInsert", TRACK_DELETE_MARK = "trackDelete", TRACK_FORMAT_MARK = "trackFormat", TRACK_CHANGE_KIND_MAP, TRACK_CHANGE_PRIORITY, MAX_RUN_MARK_JSON_LENGTH = 1e4, MAX_RUN_MARK_ARRAY_LENGTH = 100, MAX_RUN_MARK_DEPTH = 5, validateDepth = (obj, currentDepth = 0) => {
160245
+ }, TRACK_INSERT_MARK = "trackInsert", TRACK_DELETE_MARK = "trackDelete", TRACK_FORMAT_MARK = "trackFormat", TRACK_CHANGE_KIND_MAP, TRACK_CHANGE_PRIORITY, MAX_RUN_MARK_JSON_LENGTH = 1e4, MAX_RUN_MARK_ARRAY_LENGTH = 100, MAX_RUN_MARK_DEPTH = 5, RANDOM_ID_LENGTH = 9, generateRandomBase36Id = (length$1) => {
160246
+ let randomId = "";
160247
+ while (randomId.length < length$1)
160248
+ randomId += Math.random().toString(36).slice(2);
160249
+ return randomId.slice(0, length$1);
160250
+ }, validateDepth = (obj, currentDepth = 0) => {
158677
160251
  if (currentDepth > MAX_RUN_MARK_DEPTH)
158678
160252
  return false;
158679
160253
  if (obj && typeof obj === "object") {
@@ -158881,7 +160455,7 @@ var Node$13 = class Node$14 {
158881
160455
  }, deriveTrackedChangeId = (kind, attrs) => {
158882
160456
  if (attrs && typeof attrs.id === "string" && attrs.id.trim())
158883
160457
  return attrs.id;
158884
- return `${kind}-${attrs && typeof attrs.authorEmail === "string" ? attrs.authorEmail : "unknown"}-${attrs && typeof attrs.date === "string" ? attrs.date : "unknown"}-${`${Date.now()}-${Math.random().toString(36).substring(2, 11)}`}`;
160458
+ return `${kind}-${attrs && typeof attrs.authorEmail === "string" ? attrs.authorEmail : "unknown"}-${attrs && typeof attrs.date === "string" ? attrs.date : "unknown"}-${`${Date.now()}-${generateRandomBase36Id(RANDOM_ID_LENGTH)}`}`;
158885
160459
  }, buildTrackedChangeMetaFromMark = (mark2) => {
158886
160460
  const kind = pickTrackedChangeKind(mark2.type);
158887
160461
  if (!kind)
@@ -159844,7 +161418,7 @@ var Node$13 = class Node$14 {
159844
161418
  if (attrs.hidden === true)
159845
161419
  return true;
159846
161420
  return typeof attrs.visibility === "string" && attrs.visibility.toLowerCase() === "hidden";
159847
- }, isTextRun$1 = (run2) => {
161421
+ }, isTextRun$2 = (run2) => {
159848
161422
  const kind = run2.kind;
159849
161423
  return (kind === undefined || kind === "text") && "text" in run2;
159850
161424
  }, dataAttrsCompatible = (a2, b$1) => {
@@ -171419,9 +172993,9 @@ var Node$13 = class Node$14 {
171419
172993
  trackedChanges: context.trackedChanges ?? []
171420
172994
  });
171421
172995
  }, _hoisted_1$6, _hoisted_2$1, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
171422
- var init_src_B_vDSO7p_es = __esm(() => {
172996
+ var init_src_DKGc94QA_es = __esm(() => {
171423
172997
  init_rolldown_runtime_B2q5OVn9_es();
171424
- init_SuperConverter_DhpmwuUN_es();
172998
+ init_SuperConverter_BSZgN87C_es();
171425
172999
  init_jszip_ChlR43oI_es();
171426
173000
  init_uuid_2IzDu5nl_es();
171427
173001
  init_constants_Dw0kAsLd_es();
@@ -179502,6 +181076,21 @@ function print() { __p += __j.call(arguments, '') }
179502
181076
  "tableCell"
179503
181077
  ]);
179504
181078
  cacheByEditor = /* @__PURE__ */ new WeakMap;
181079
+ DEFAULT_TOC_CONFIG = {
181080
+ source: {
181081
+ outlineLevels: {
181082
+ from: 1,
181083
+ to: 3
181084
+ },
181085
+ useAppliedOutlineLevel: true
181086
+ },
181087
+ display: {
181088
+ hyperlinks: true,
181089
+ hideInWebView: true
181090
+ },
181091
+ preserved: {}
181092
+ };
181093
+ SWITCH_PATTERN = /\\([a-z])\s*(?:"([^"]*)")?/gi;
179505
181094
  DUAL_KIND_TYPES = new Set(["sdt", "image"]);
179506
181095
  KNOWN_BLOCK_PM_NODE_TYPES = new Set([
179507
181096
  "paragraph",
@@ -179609,7 +181198,11 @@ function print() { __p += __j.call(arguments, '') }
179609
181198
  "tables.setTablePadding": ["insertTableAt"],
179610
181199
  "tables.setCellPadding": ["insertTableAt"],
179611
181200
  "tables.setCellSpacing": ["insertTableAt"],
179612
- "tables.clearCellSpacing": ["insertTableAt"]
181201
+ "tables.clearCellSpacing": ["insertTableAt"],
181202
+ "create.tableOfContents": ["insertTableOfContentsAt"],
181203
+ "toc.configure": ["setTableOfContentsInstructionById"],
181204
+ "toc.update": ["replaceTableOfContentsContentById"],
181205
+ "toc.remove": ["deleteTableOfContentsById"]
179613
181206
  };
179614
181207
  VALID_CAPABILITY_REASON_CODES = new Set(CAPABILITY_REASON_CODES2);
179615
181208
  REQUIRED_HELPERS = {
@@ -180074,6 +181667,14 @@ function print() { __p += __j.call(arguments, '') }
180074
181667
  RELATIONSHIP_ID_PATTERN = /^rId(\d+)$/;
180075
181668
  HEADER_FILE_PATTERN = /^word\/header(\d+)\.xml$/;
180076
181669
  FOOTER_FILE_PATTERN = /^word\/footer(\d+)\.xml$/;
181670
+ NO_ENTRIES_PLACEHOLDER = [{
181671
+ type: "paragraph",
181672
+ attrs: { paragraphProperties: {} },
181673
+ content: [{
181674
+ type: "text",
181675
+ text: "No table of contents entries found."
181676
+ }]
181677
+ }];
180077
181678
  empty_exports = /* @__PURE__ */ __export2({ default: () => null }, 1);
180078
181679
  init_empty = __esmMin(() => {});
180079
181680
  Editor = class Editor2 extends EventEmitter$1 {
@@ -182273,12 +183874,25 @@ function print() { __p += __j.call(arguments, '') }
182273
183874
  init: () => ({ ...DEFAULT_SELECTION_STATE }),
182274
183875
  apply: (tr, value) => {
182275
183876
  const meta2 = getFocusMeta(tr);
182276
- if (meta2 !== undefined)
183877
+ const nextState = meta2 !== undefined ? normalizeSelectionState({
183878
+ ...value,
183879
+ ...meta2
183880
+ }) : value;
183881
+ if (!nextState?.preservedSelection)
183882
+ return nextState;
183883
+ if (!tr.docChanged)
183884
+ return nextState;
183885
+ const mappedSelection = mapPreservedSelection(nextState.preservedSelection, tr);
183886
+ if (!mappedSelection)
182277
183887
  return {
182278
- ...value,
182279
- ...meta2
183888
+ ...nextState,
183889
+ preservedSelection: null,
183890
+ showVisualSelection: false
182280
183891
  };
182281
- return value;
183892
+ return {
183893
+ ...nextState,
183894
+ preservedSelection: mappedSelection
183895
+ };
182282
183896
  }
182283
183897
  },
182284
183898
  view: () => {
@@ -190697,7 +192311,7 @@ function print() { __p += __j.call(arguments, '') }
190697
192311
  try {
190698
192312
  this.#decorationBridge.sync(state, this.#domPositionIndex);
190699
192313
  } catch (error) {
190700
- debugLog("warn", "Decoration bridge sync failed", { error: String(error) });
192314
+ console.warn("[PresentationEditor] Decoration sync failed:", error);
190701
192315
  }
190702
192316
  }
190703
192317
  #scheduleDecorationSync() {
@@ -190749,8 +192363,21 @@ function print() { __p += __j.call(arguments, '') }
190749
192363
  this.#updateLocalAwarenessCursor();
190750
192364
  this.#scheduleA11ySelectionAnnouncement();
190751
192365
  };
190752
- const handleTransaction = () => {
190753
- this.#scheduleDecorationSync();
192366
+ const handleTransaction = (event) => {
192367
+ const tr = event?.transaction;
192368
+ this.#decorationBridge.recordTransaction(tr);
192369
+ const state = this.#editor?.view?.state;
192370
+ const decorationChanged = state && this.#decorationBridge.hasChanges(state);
192371
+ if (decorationChanged) {
192372
+ const restoreEmpty = tr ? tr.docChanged === true : false;
192373
+ this.#decorationBridge.sync(state, this.#domPositionIndex, { restoreEmptyDecorations: restoreEmpty });
192374
+ } else
192375
+ this.#scheduleDecorationSync();
192376
+ if (decorationChanged) {
192377
+ this.#pendingDocChange = true;
192378
+ this.#selectionSync.onLayoutStart();
192379
+ this.#scheduleRerender();
192380
+ }
190754
192381
  };
190755
192382
  this.#editor.on("update", handleUpdate);
190756
192383
  this.#editor.on("selectionUpdate", handleSelection);
@@ -191201,6 +192828,13 @@ function print() { __p += __j.call(arguments, '') }
191201
192828
  this.#handleLayoutError("render", /* @__PURE__ */ new Error("toFlowBlocks returned undefined blocks"));
191202
192829
  return;
191203
192830
  }
192831
+ const state = this.#editor?.view?.state;
192832
+ const decorationRanges = state ? this.#decorationBridge.collectDecorationRanges(state) : [];
192833
+ if (decorationRanges.length > 0)
192834
+ blocks2 = splitRunsAtDecorationBoundaries(blocks2, decorationRanges.map((r$1) => ({
192835
+ from: r$1.from,
192836
+ to: r$1.to
192837
+ })));
191204
192838
  this.#applyHtmlAnnotationMeasurements(blocks2);
191205
192839
  const baseLayoutOptions = this.#resolveLayoutOptions(blocks2, sectionMetadata);
191206
192840
  const footnotesLayoutInput = buildFootnotesInput(this.#editor?.state, this.#editor?.converter, converterContext, this.#editor?.converter?.themeColors ?? undefined);
@@ -197302,6 +198936,98 @@ function print() { __p += __j.call(arguments, '') }
197302
198936
  0
197303
198937
  ];
197304
198938
  },
198939
+ addCommands() {
198940
+ const normalizeTocContent = (content3, schema) => {
198941
+ if (!Array.isArray(content3))
198942
+ return null;
198943
+ return content3.map((entry) => entry && typeof entry === "object" && typeof entry.type === "string" ? schema.nodeFromJSON(entry) : entry);
198944
+ };
198945
+ return {
198946
+ insertTableOfContentsAt: (options) => ({ tr, dispatch, state }) => {
198947
+ const { pos, instruction = "", sdBlockId = null, content: content3 } = options;
198948
+ const tocType = this.editor.schema.nodes.tableOfContents;
198949
+ if (!tocType)
198950
+ return false;
198951
+ const defaultContent = [this.editor.schema.nodes.paragraph.create({}, this.editor.schema.text("Update table of contents to populate entries."))];
198952
+ const materializedContent = normalizeTocContent(content3, state.schema) ?? defaultContent;
198953
+ const tocNode = tocType.create({
198954
+ instruction,
198955
+ sdBlockId
198956
+ }, materializedContent);
198957
+ try {
198958
+ if (dispatch)
198959
+ tr.insert(pos, tocNode);
198960
+ return true;
198961
+ } catch (error) {
198962
+ if (error instanceof RangeError)
198963
+ return false;
198964
+ throw error;
198965
+ }
198966
+ },
198967
+ setTableOfContentsInstructionById: (options) => ({ tr, dispatch, state }) => {
198968
+ const { sdBlockId, instruction, content: content3 } = options;
198969
+ let found2 = false;
198970
+ state.doc.descendants((node3, pos) => {
198971
+ if (found2)
198972
+ return false;
198973
+ if (node3.type.name === "tableOfContents" && node3.attrs.sdBlockId === sdBlockId) {
198974
+ if (dispatch) {
198975
+ tr.setNodeMarkup(pos, undefined, {
198976
+ ...node3.attrs,
198977
+ instruction
198978
+ });
198979
+ const fragment = normalizeTocContent(content3, state.schema);
198980
+ if (fragment) {
198981
+ const from$12 = pos + 1;
198982
+ const to = pos + node3.nodeSize - 1;
198983
+ tr.replaceWith(from$12, to, fragment);
198984
+ }
198985
+ }
198986
+ found2 = true;
198987
+ return false;
198988
+ }
198989
+ return true;
198990
+ });
198991
+ return found2;
198992
+ },
198993
+ replaceTableOfContentsContentById: (options) => ({ tr, dispatch, state }) => {
198994
+ const { sdBlockId, content: content3 } = options;
198995
+ let found2 = false;
198996
+ state.doc.descendants((node3, pos) => {
198997
+ if (found2)
198998
+ return false;
198999
+ if (node3.type.name === "tableOfContents" && node3.attrs.sdBlockId === sdBlockId) {
199000
+ if (dispatch) {
199001
+ const from$12 = pos + 1;
199002
+ const to = pos + node3.nodeSize - 1;
199003
+ const fragment = normalizeTocContent(content3, state.schema) ?? [];
199004
+ tr.replaceWith(from$12, to, fragment);
199005
+ }
199006
+ found2 = true;
199007
+ return false;
199008
+ }
199009
+ return true;
199010
+ });
199011
+ return found2;
199012
+ },
199013
+ deleteTableOfContentsById: (options) => ({ tr, dispatch, state }) => {
199014
+ const { sdBlockId } = options;
199015
+ let found2 = false;
199016
+ state.doc.descendants((node3, pos) => {
199017
+ if (found2)
199018
+ return false;
199019
+ if (node3.type.name === "tableOfContents" && node3.attrs.sdBlockId === sdBlockId) {
199020
+ if (dispatch)
199021
+ tr.delete(pos, pos + node3.nodeSize);
199022
+ found2 = true;
199023
+ return false;
199024
+ }
199025
+ return true;
199026
+ });
199027
+ return found2;
199028
+ }
199029
+ };
199030
+ },
197305
199031
  addAttributes() {
197306
199032
  return {
197307
199033
  instruction: {
@@ -202160,8 +203886,8 @@ function print() { __p += __j.call(arguments, '') }
202160
203886
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
202161
203887
  };
202162
203888
  stubFalse_default = stubFalse;
202163
- freeExports$2 = typeof exports_src_B_vDSO7p_es == "object" && exports_src_B_vDSO7p_es && !exports_src_B_vDSO7p_es.nodeType && exports_src_B_vDSO7p_es;
202164
- freeModule$2 = freeExports$2 && typeof module_src_B_vDSO7p_es == "object" && module_src_B_vDSO7p_es && !module_src_B_vDSO7p_es.nodeType && module_src_B_vDSO7p_es;
203889
+ freeExports$2 = typeof exports_src_DKGc94QA_es == "object" && exports_src_DKGc94QA_es && !exports_src_DKGc94QA_es.nodeType && exports_src_DKGc94QA_es;
203890
+ freeModule$2 = freeExports$2 && typeof module_src_DKGc94QA_es == "object" && module_src_DKGc94QA_es && !module_src_DKGc94QA_es.nodeType && module_src_DKGc94QA_es;
202165
203891
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
202166
203892
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
202167
203893
  typedArrayTags = {};
@@ -202169,8 +203895,8 @@ function print() { __p += __j.call(arguments, '') }
202169
203895
  typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
202170
203896
  _baseIsTypedArray_default = baseIsTypedArray;
202171
203897
  _baseUnary_default = baseUnary;
202172
- freeExports$1 = typeof exports_src_B_vDSO7p_es == "object" && exports_src_B_vDSO7p_es && !exports_src_B_vDSO7p_es.nodeType && exports_src_B_vDSO7p_es;
202173
- freeModule$1 = freeExports$1 && typeof module_src_B_vDSO7p_es == "object" && module_src_B_vDSO7p_es && !module_src_B_vDSO7p_es.nodeType && module_src_B_vDSO7p_es;
203898
+ freeExports$1 = typeof exports_src_DKGc94QA_es == "object" && exports_src_DKGc94QA_es && !exports_src_DKGc94QA_es.nodeType && exports_src_DKGc94QA_es;
203899
+ freeModule$1 = freeExports$1 && typeof module_src_DKGc94QA_es == "object" && module_src_DKGc94QA_es && !module_src_DKGc94QA_es.nodeType && module_src_DKGc94QA_es;
202174
203900
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
202175
203901
  _nodeUtil_default = function() {
202176
203902
  try {
@@ -202275,8 +204001,8 @@ function print() { __p += __j.call(arguments, '') }
202275
204001
  Stack.prototype.has = _stackHas_default;
202276
204002
  Stack.prototype.set = _stackSet_default;
202277
204003
  _Stack_default = Stack;
202278
- freeExports = typeof exports_src_B_vDSO7p_es == "object" && exports_src_B_vDSO7p_es && !exports_src_B_vDSO7p_es.nodeType && exports_src_B_vDSO7p_es;
202279
- freeModule = freeExports && typeof module_src_B_vDSO7p_es == "object" && module_src_B_vDSO7p_es && !module_src_B_vDSO7p_es.nodeType && module_src_B_vDSO7p_es;
204004
+ freeExports = typeof exports_src_DKGc94QA_es == "object" && exports_src_DKGc94QA_es && !exports_src_DKGc94QA_es.nodeType && exports_src_DKGc94QA_es;
204005
+ freeModule = freeExports && typeof module_src_DKGc94QA_es == "object" && module_src_DKGc94QA_es && !module_src_DKGc94QA_es.nodeType && module_src_DKGc94QA_es;
202280
204006
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
202281
204007
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
202282
204008
  _cloneBuffer_default = cloneBuffer;
@@ -209928,8 +211654,8 @@ var init_zipper_Cnk_HjM2_es = __esm(() => {
209928
211654
 
209929
211655
  // ../../packages/superdoc/dist/super-editor.es.js
209930
211656
  var init_super_editor_es = __esm(() => {
209931
- init_src_B_vDSO7p_es();
209932
- init_SuperConverter_DhpmwuUN_es();
211657
+ init_src_DKGc94QA_es();
211658
+ init_SuperConverter_BSZgN87C_es();
209933
211659
  init_jszip_ChlR43oI_es();
209934
211660
  init_xml_js_DLE8mr0n_es();
209935
211661
  init_constants_Dw0kAsLd_es();
@@ -210271,6 +211997,23 @@ function normalizeExcerpt2(text5) {
210271
211997
  return trimmed.length ? trimmed : undefined;
210272
211998
  }
210273
211999
 
212000
+ // ../../packages/super-editor/src/document-api-adapters/helpers/toc-node-id.ts
212001
+ function stableHash2(input2) {
212002
+ let hash2 = 2166136261;
212003
+ for (let index2 = 0;index2 < input2.length; index2 += 1) {
212004
+ hash2 ^= input2.charCodeAt(index2);
212005
+ hash2 = Math.imul(hash2, 16777619);
212006
+ }
212007
+ return (hash2 >>> 0).toString(16).padStart(8, "0");
212008
+ }
212009
+ function buildFallbackTocNodeId2(node3, pos) {
212010
+ const instruction = typeof node3.attrs?.instruction === "string" ? node3.attrs.instruction : "";
212011
+ return `toc-auto-${stableHash2(`${pos}:${instruction}`)}`;
212012
+ }
212013
+ function resolvePublicTocNodeId2(node3, pos) {
212014
+ return buildFallbackTocNodeId2(node3, pos);
212015
+ }
212016
+
210274
212017
  // ../../packages/super-editor/src/document-api-adapters/errors.ts
210275
212018
  var DocumentApiAdapterError3;
210276
212019
  var init_errors3 = __esm(() => {
@@ -210329,6 +212072,8 @@ function mapBlockNodeType2(node3) {
210329
212072
  return "tableCell";
210330
212073
  case "image":
210331
212074
  return "image";
212075
+ case "tableOfContents":
212076
+ return "tableOfContents";
210332
212077
  case "structuredContentBlock":
210333
212078
  case "sdt":
210334
212079
  return "sdt";
@@ -210336,11 +212081,14 @@ function mapBlockNodeType2(node3) {
210336
212081
  return;
210337
212082
  }
210338
212083
  }
210339
- function resolveBlockNodeId2(node3) {
212084
+ function resolveBlockNodeId2(node3, pos, nodeType) {
210340
212085
  if (node3.type.name === "paragraph") {
210341
212086
  const attrs2 = node3.attrs;
210342
212087
  return toId2(attrs2?.paraId) ?? toId2(attrs2?.sdBlockId);
210343
212088
  }
212089
+ if (nodeType === "tableOfContents") {
212090
+ return resolvePublicTocNodeId2(node3, pos);
212091
+ }
210344
212092
  const attrs = node3.attrs ?? {};
210345
212093
  const typeName = node3.type.name;
210346
212094
  if (typeName === "table" || typeName === "tableRow" || typeName === "tableCell" || typeName === "tableHeader") {
@@ -210380,7 +212128,7 @@ function buildBlockIndex2(editor) {
210380
212128
  const nodeType = mapBlockNodeType2(node3);
210381
212129
  if (!nodeType)
210382
212130
  return;
210383
- const nodeId = resolveBlockNodeId2(node3);
212131
+ const nodeId = resolveBlockNodeId2(node3, pos, nodeType);
210384
212132
  if (!nodeId)
210385
212133
  return;
210386
212134
  const candidate = {
@@ -210483,6 +212231,7 @@ var init_node_address_resolver = __esm(() => {
210483
212231
  "table",
210484
212232
  "tableRow",
210485
212233
  "tableCell",
212234
+ "tableOfContents",
210486
212235
  "image",
210487
212236
  "sdt"
210488
212237
  ]);
@@ -210730,6 +212479,199 @@ var init_adapter_utils = __esm(() => {
210730
212479
  init_errors3();
210731
212480
  });
210732
212481
 
212482
+ // ../../packages/super-editor/src/core/super-converter/field-references/shared/toc-switches.ts
212483
+ function parseLevelRange2(value) {
212484
+ const match2 = value.match(/^(\d+)-(\d+)$/);
212485
+ if (!match2)
212486
+ return;
212487
+ return { from: parseInt(match2[1], 10), to: parseInt(match2[2], 10) };
212488
+ }
212489
+ function parseCustomStyles2(value) {
212490
+ const entries = [];
212491
+ const parts = value.split(",");
212492
+ for (let i4 = 0;i4 < parts.length - 1; i4 += 2) {
212493
+ const styleName = parts[i4].trim();
212494
+ const level = parseInt(parts[i4 + 1].trim(), 10);
212495
+ if (styleName && !isNaN(level)) {
212496
+ entries.push({ styleName, level });
212497
+ }
212498
+ }
212499
+ return entries;
212500
+ }
212501
+ function parseTocInstruction2(instruction) {
212502
+ const source = {};
212503
+ const display = {};
212504
+ const preserved = {};
212505
+ const rawExtensions = [];
212506
+ let match2;
212507
+ while ((match2 = SWITCH_PATTERN2.exec(instruction)) !== null) {
212508
+ const switchChar = match2[1].toLowerCase();
212509
+ const arg = match2[2] ?? "";
212510
+ switch (switchChar) {
212511
+ case "o": {
212512
+ const range = parseLevelRange2(arg);
212513
+ if (range)
212514
+ source.outlineLevels = range;
212515
+ break;
212516
+ }
212517
+ case "u":
212518
+ source.useAppliedOutlineLevel = true;
212519
+ break;
212520
+ case "h":
212521
+ display.hyperlinks = true;
212522
+ break;
212523
+ case "z":
212524
+ display.hideInWebView = true;
212525
+ break;
212526
+ case "n": {
212527
+ const range = parseLevelRange2(arg);
212528
+ if (range)
212529
+ display.omitPageNumberLevels = range;
212530
+ break;
212531
+ }
212532
+ case "p":
212533
+ if (arg)
212534
+ display.separator = arg;
212535
+ break;
212536
+ case "t":
212537
+ if (arg)
212538
+ preserved.customStyles = parseCustomStyles2(arg);
212539
+ break;
212540
+ case "b":
212541
+ if (arg)
212542
+ preserved.bookmarkName = arg;
212543
+ break;
212544
+ case "f":
212545
+ if (arg)
212546
+ preserved.tcFieldIdentifier = arg;
212547
+ break;
212548
+ case "l": {
212549
+ const range = parseLevelRange2(arg);
212550
+ if (range)
212551
+ preserved.tcFieldLevels = range;
212552
+ break;
212553
+ }
212554
+ case "a":
212555
+ if (arg)
212556
+ preserved.captionType = arg;
212557
+ break;
212558
+ case "c":
212559
+ if (arg)
212560
+ preserved.seqFieldIdentifier = arg;
212561
+ break;
212562
+ case "d":
212563
+ if (arg)
212564
+ preserved.chapterSeparator = arg;
212565
+ break;
212566
+ case "s":
212567
+ if (arg)
212568
+ preserved.chapterNumberSource = arg;
212569
+ break;
212570
+ case "w":
212571
+ preserved.preserveTabEntries = true;
212572
+ break;
212573
+ default:
212574
+ rawExtensions.push(arg ? `\\${switchChar} "${arg}"` : `\\${switchChar}`);
212575
+ break;
212576
+ }
212577
+ }
212578
+ if (rawExtensions.length > 0) {
212579
+ preserved.rawExtensions = rawExtensions;
212580
+ }
212581
+ return { source, display, preserved };
212582
+ }
212583
+ function serializeTocInstruction2(config2) {
212584
+ const parts = ["TOC"];
212585
+ const { source, display, preserved } = config2;
212586
+ if (source.outlineLevels) {
212587
+ parts.push(`\\o "${source.outlineLevels.from}-${source.outlineLevels.to}"`);
212588
+ }
212589
+ if (source.useAppliedOutlineLevel) {
212590
+ parts.push("\\u");
212591
+ }
212592
+ if (preserved.customStyles?.length) {
212593
+ const pairs = preserved.customStyles.map((s2) => `${s2.styleName},${s2.level}`).join(",");
212594
+ parts.push(`\\t "${pairs}"`);
212595
+ }
212596
+ if (display.hyperlinks) {
212597
+ parts.push("\\h");
212598
+ }
212599
+ if (display.hideInWebView) {
212600
+ parts.push("\\z");
212601
+ }
212602
+ if (display.omitPageNumberLevels) {
212603
+ parts.push(`\\n "${display.omitPageNumberLevels.from}-${display.omitPageNumberLevels.to}"`);
212604
+ }
212605
+ if (display.separator) {
212606
+ parts.push(`\\p "${display.separator}"`);
212607
+ }
212608
+ if (preserved.captionType) {
212609
+ parts.push(`\\a "${preserved.captionType}"`);
212610
+ }
212611
+ if (preserved.bookmarkName) {
212612
+ parts.push(`\\b "${preserved.bookmarkName}"`);
212613
+ }
212614
+ if (preserved.seqFieldIdentifier) {
212615
+ parts.push(`\\c "${preserved.seqFieldIdentifier}"`);
212616
+ }
212617
+ if (preserved.chapterSeparator) {
212618
+ parts.push(`\\d "${preserved.chapterSeparator}"`);
212619
+ }
212620
+ if (preserved.tcFieldIdentifier) {
212621
+ parts.push(`\\f "${preserved.tcFieldIdentifier}"`);
212622
+ }
212623
+ if (preserved.tcFieldLevels) {
212624
+ parts.push(`\\l "${preserved.tcFieldLevels.from}-${preserved.tcFieldLevels.to}"`);
212625
+ }
212626
+ if (preserved.chapterNumberSource) {
212627
+ parts.push(`\\s "${preserved.chapterNumberSource}"`);
212628
+ }
212629
+ if (preserved.preserveTabEntries) {
212630
+ parts.push("\\w");
212631
+ }
212632
+ if (preserved.rawExtensions?.length) {
212633
+ parts.push(...preserved.rawExtensions);
212634
+ }
212635
+ return parts.join(" ");
212636
+ }
212637
+ function applyTocPatch2(existing, patch3) {
212638
+ return {
212639
+ source: {
212640
+ ...existing.source,
212641
+ ...patch3.outlineLevels !== undefined && { outlineLevels: patch3.outlineLevels },
212642
+ ...patch3.useAppliedOutlineLevel !== undefined && { useAppliedOutlineLevel: patch3.useAppliedOutlineLevel }
212643
+ },
212644
+ display: {
212645
+ ...existing.display,
212646
+ ...patch3.hyperlinks !== undefined && { hyperlinks: patch3.hyperlinks },
212647
+ ...patch3.hideInWebView !== undefined && { hideInWebView: patch3.hideInWebView },
212648
+ ...patch3.omitPageNumberLevels !== undefined && { omitPageNumberLevels: patch3.omitPageNumberLevels },
212649
+ ...patch3.separator !== undefined && { separator: patch3.separator }
212650
+ },
212651
+ preserved: { ...existing.preserved }
212652
+ };
212653
+ }
212654
+ function areTocConfigsEqual2(a2, b2) {
212655
+ return serializeTocInstruction2(a2) === serializeTocInstruction2(b2);
212656
+ }
212657
+ var DEFAULT_SOURCE, DEFAULT_DISPLAY, DEFAULT_TOC_CONFIG2, SWITCH_PATTERN2;
212658
+ var init_toc_switches = __esm(() => {
212659
+ DEFAULT_SOURCE = {
212660
+ outlineLevels: { from: 1, to: 3 },
212661
+ useAppliedOutlineLevel: true
212662
+ };
212663
+ DEFAULT_DISPLAY = {
212664
+ hyperlinks: true,
212665
+ hideInWebView: true
212666
+ };
212667
+ DEFAULT_TOC_CONFIG2 = {
212668
+ source: DEFAULT_SOURCE,
212669
+ display: DEFAULT_DISPLAY,
212670
+ preserved: {}
212671
+ };
212672
+ SWITCH_PATTERN2 = /\\([a-z])\s*(?:"([^"]*)")?/gi;
212673
+ });
212674
+
210733
212675
  // ../../packages/super-editor/src/document-api-adapters/helpers/node-info-mapper.ts
210734
212676
  function resolveMeasurement2(value) {
210735
212677
  if (typeof value === "number")
@@ -210871,6 +212813,23 @@ function mapTableCellNode2(candidate) {
210871
212813
  properties
210872
212814
  };
210873
212815
  }
212816
+ function mapTableOfContentsNode2(candidate) {
212817
+ const node3 = candidate.node;
212818
+ const instruction = node3.attrs?.instruction ?? "";
212819
+ const config2 = parseTocInstruction2(instruction);
212820
+ const entryCount = node3.childCount;
212821
+ return {
212822
+ nodeType: "tableOfContents",
212823
+ kind: "block",
212824
+ properties: {
212825
+ instruction,
212826
+ sourceConfig: config2.source,
212827
+ displayConfig: config2.display,
212828
+ preservedSwitches: config2.preserved,
212829
+ entryCount
212830
+ }
212831
+ };
212832
+ }
210874
212833
  function buildImageInfo2(attrs, kind) {
210875
212834
  const properties = {
210876
212835
  src: attrs?.src ?? undefined,
@@ -211112,6 +213071,10 @@ function mapNodeInfo2(candidate, overrideType) {
211112
213071
  const attrs = candidate.node?.attrs;
211113
213072
  return buildSdtInfo2(attrs, kind);
211114
213073
  }
213074
+ case "tableOfContents":
213075
+ if (kind !== "block")
213076
+ throw new DocumentApiAdapterError3("INVALID_TARGET", "TableOfContents nodes can only be resolved as blocks.");
213077
+ return mapTableOfContentsNode2(candidate);
211115
213078
  case "hyperlink":
211116
213079
  if (!isInlineCandidate2(candidate))
211117
213080
  throw new DocumentApiAdapterError3("INVALID_TARGET", "Hyperlink nodes can only be resolved inline.");
@@ -211143,6 +213106,7 @@ function mapNodeInfo2(candidate, overrideType) {
211143
213106
  var init_node_info_mapper = __esm(() => {
211144
213107
  init_node_address_resolver();
211145
213108
  init_errors3();
213109
+ init_toc_switches();
211146
213110
  });
211147
213111
 
211148
213112
  // ../../packages/super-editor/src/document-api-adapters/helpers/node-info-resolver.ts
@@ -212148,7 +214112,11 @@ var init_capabilities_adapter = __esm(() => {
212148
214112
  "tables.setTablePadding": ["insertTableAt"],
212149
214113
  "tables.setCellPadding": ["insertTableAt"],
212150
214114
  "tables.setCellSpacing": ["insertTableAt"],
212151
- "tables.clearCellSpacing": ["insertTableAt"]
214115
+ "tables.clearCellSpacing": ["insertTableAt"],
214116
+ "create.tableOfContents": ["insertTableOfContentsAt"],
214117
+ "toc.configure": ["setTableOfContentsInstructionById"],
214118
+ "toc.update": ["replaceTableOfContentsContentById"],
214119
+ "toc.remove": ["deleteTableOfContentsById"]
212152
214120
  };
212153
214121
  VALID_CAPABILITY_REASON_CODES2 = new Set(CAPABILITY_REASON_CODES);
212154
214122
  REQUIRED_HELPERS2 = {
@@ -255017,7 +256985,8 @@ var XML_NODE_NAME24 = "sd:tableOfContents", SD_NODE_NAME20 = "tableOfContents",
255017
256985
  return processedNode;
255018
256986
  }, decode62 = (params3) => {
255019
256987
  const { node: node4 } = params3;
255020
- const contentNodes = node4.content.map((n) => exportSchemaToJson2({ ...params3, node: n }));
256988
+ const tocContent = Array.isArray(node4.content) ? node4.content : [];
256989
+ const contentNodes = tocContent.map((n) => exportSchemaToJson2({ ...params3, node: n }));
255021
256990
  const tocBeginElements = [
255022
256991
  {
255023
256992
  name: "w:r",
@@ -270171,7 +272140,18 @@ function tablesDistributeColumnsAdapter2(editor, input2, options) {
270171
272140
  }
270172
272141
  }
270173
272142
  const tableAttrs = tableNode.attrs;
270174
- tr.setNodeMarkup(tablePos, null, { ...tableAttrs, userEdited: true });
272143
+ const normalizedGrid = normalizeGridColumns2(tableAttrs.grid);
272144
+ const tableAttrUpdates = { ...tableAttrs, userEdited: true };
272145
+ if (normalizedGrid) {
272146
+ const newColumns = normalizedGrid.columns.slice();
272147
+ const evenWidthTwips = Math.max(1, Math.round(evenWidth * PIXELS_TO_TWIPS2));
272148
+ const maxColumn = Math.min(rangeEnd, newColumns.length - 1);
272149
+ for (let col = Math.max(rangeStart, 0);col <= maxColumn; col++) {
272150
+ newColumns[col] = { col: evenWidthTwips };
272151
+ }
272152
+ tableAttrUpdates.grid = serializeGridColumns2(tableAttrs.grid, { ...normalizedGrid, columns: newColumns });
272153
+ }
272154
+ tr.setNodeMarkup(tablePos, null, tableAttrUpdates);
270175
272155
  applyDirectMutationMeta2(tr);
270176
272156
  editor.dispatch(tr);
270177
272157
  clearIndexCache2(editor);
@@ -273617,6 +275597,362 @@ var init_tables_wrappers = __esm(() => {
273617
275597
  init_tables_adapter();
273618
275598
  });
273619
275599
 
275600
+ // ../../packages/super-editor/src/document-api-adapters/helpers/toc-resolver.ts
275601
+ function findAllTocNodes2(doc4) {
275602
+ const results = [];
275603
+ doc4.descendants((node4, pos) => {
275604
+ if (node4.type.name === "tableOfContents") {
275605
+ const sdBlockId = node4.attrs?.sdBlockId;
275606
+ const nodeId = resolvePublicTocNodeId2(node4, pos);
275607
+ const commandNodeId = sdBlockId;
275608
+ results.push({ node: node4, pos, nodeId, commandNodeId });
275609
+ return false;
275610
+ }
275611
+ return true;
275612
+ });
275613
+ return results;
275614
+ }
275615
+ function resolveTocTarget2(doc4, target) {
275616
+ const all6 = findAllTocNodes2(doc4);
275617
+ const found3 = all6.find((t) => t.nodeId === target.nodeId || t.commandNodeId === target.nodeId);
275618
+ if (!found3) {
275619
+ throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Table of contents with nodeId "${target.nodeId}" not found.`);
275620
+ }
275621
+ return found3;
275622
+ }
275623
+ function resolvePostMutationTocId2(doc4, sdBlockId) {
275624
+ const all6 = findAllTocNodes2(doc4);
275625
+ const found3 = all6.find((t) => t.commandNodeId === sdBlockId);
275626
+ return found3?.nodeId ?? sdBlockId;
275627
+ }
275628
+ function extractTocInfo2(node4) {
275629
+ const instruction = node4.attrs?.instruction ?? "";
275630
+ const config33 = parseTocInstruction2(instruction);
275631
+ return {
275632
+ nodeType: "tableOfContents",
275633
+ kind: "block",
275634
+ properties: {
275635
+ instruction,
275636
+ sourceConfig: config33.source,
275637
+ displayConfig: config33.display,
275638
+ preservedSwitches: config33.preserved,
275639
+ entryCount: node4.childCount
275640
+ }
275641
+ };
275642
+ }
275643
+ function buildTocDiscoveryItem2(resolved, evaluatedRevision) {
275644
+ const instruction = resolved.node.attrs?.instruction ?? "";
275645
+ const config33 = parseTocInstruction2(instruction);
275646
+ const address2 = {
275647
+ kind: "block",
275648
+ nodeType: "tableOfContents",
275649
+ nodeId: resolved.nodeId
275650
+ };
275651
+ const handle4 = buildResolvedHandle(resolved.nodeId, "stable", "tableOfContents");
275652
+ const domain3 = {
275653
+ address: address2,
275654
+ instruction,
275655
+ sourceConfig: config33.source,
275656
+ displayConfig: config33.display,
275657
+ preserved: config33.preserved,
275658
+ entryCount: resolved.node.childCount
275659
+ };
275660
+ const id2 = `toc:${resolved.nodeId}:${evaluatedRevision}`;
275661
+ return buildDiscoveryItem(id2, handle4, domain3);
275662
+ }
275663
+ var init_toc_resolver = __esm(() => {
275664
+ init_src();
275665
+ init_toc_switches();
275666
+ init_errors3();
275667
+ });
275668
+
275669
+ // ../../packages/super-editor/src/document-api-adapters/helpers/toc-entry-builder.ts
275670
+ function collectHeadingSources2(doc4, config33) {
275671
+ const sources = [];
275672
+ const { outlineLevels } = config33.source;
275673
+ const useApplied = config33.source.useAppliedOutlineLevel ?? false;
275674
+ doc4.descendants((node4, _pos) => {
275675
+ if (node4.type.name === "tableOfContents")
275676
+ return false;
275677
+ if (node4.type.name === "paragraph") {
275678
+ const attrs = node4.attrs;
275679
+ const paragraphProps = attrs?.paragraphProperties;
275680
+ const styleId = paragraphProps?.styleId;
275681
+ const sdBlockId = attrs?.sdBlockId ?? attrs?.paraId;
275682
+ if (!sdBlockId)
275683
+ return true;
275684
+ const headingLevel = getHeadingLevel2(styleId);
275685
+ if (headingLevel != null && outlineLevels) {
275686
+ if (headingLevel >= outlineLevels.from && headingLevel <= outlineLevels.to) {
275687
+ sources.push({ text: flattenText2(node4), level: headingLevel, sdBlockId });
275688
+ return false;
275689
+ }
275690
+ }
275691
+ if (useApplied && outlineLevels) {
275692
+ const rawOutlineLevel = paragraphProps?.outlineLevel;
275693
+ if (rawOutlineLevel != null) {
275694
+ const tocLevel = rawOutlineLevel + 1;
275695
+ if (tocLevel >= outlineLevels.from && tocLevel <= outlineLevels.to) {
275696
+ sources.push({ text: flattenText2(node4), level: tocLevel, sdBlockId });
275697
+ return false;
275698
+ }
275699
+ }
275700
+ }
275701
+ }
275702
+ return true;
275703
+ });
275704
+ return sources;
275705
+ }
275706
+ function flattenText2(node4) {
275707
+ let text9 = "";
275708
+ node4.descendants((child) => {
275709
+ if (child.isText)
275710
+ text9 += child.text;
275711
+ return true;
275712
+ });
275713
+ return text9;
275714
+ }
275715
+ function buildTocEntryParagraphs2(sources, config33) {
275716
+ return sources.map((source) => buildEntryParagraph2(source, config33));
275717
+ }
275718
+ function buildEntryParagraph2(source, config33) {
275719
+ const { display } = config33;
275720
+ const content5 = [];
275721
+ const textNode = {
275722
+ type: "text",
275723
+ text: source.text || " "
275724
+ };
275725
+ if (display.hyperlinks) {
275726
+ textNode.marks = [
275727
+ {
275728
+ type: "link",
275729
+ attrs: {
275730
+ anchor: source.sdBlockId,
275731
+ rId: null,
275732
+ history: true
275733
+ }
275734
+ }
275735
+ ];
275736
+ }
275737
+ content5.push(textNode);
275738
+ const omitRange = display.omitPageNumberLevels;
275739
+ const omitPageNumber = omitRange && source.level >= omitRange.from && source.level <= omitRange.to;
275740
+ if (!omitPageNumber) {
275741
+ if (display.separator) {
275742
+ content5.push({ type: "text", text: display.separator });
275743
+ } else {
275744
+ content5.push({ type: "tab" });
275745
+ }
275746
+ content5.push({ type: "text", text: "0" });
275747
+ }
275748
+ return {
275749
+ type: "paragraph",
275750
+ attrs: {
275751
+ paragraphProperties: {
275752
+ styleId: `TOC${source.level}`
275753
+ },
275754
+ sdBlockId: undefined
275755
+ },
275756
+ content: content5
275757
+ };
275758
+ }
275759
+ var init_toc_entry_builder = __esm(() => {
275760
+ init_node_address_resolver();
275761
+ });
275762
+
275763
+ // ../../packages/super-editor/src/document-api-adapters/plan-engine/toc-wrappers.ts
275764
+ function tocListWrapper2(editor, query2) {
275765
+ const doc4 = editor.state.doc;
275766
+ const revision = getRevision2(editor);
275767
+ const tocNodes = findAllTocNodes2(doc4);
275768
+ const allItems = tocNodes.map((resolved) => buildTocDiscoveryItem2(resolved, revision));
275769
+ const { total, items: paged } = paginate2(allItems, query2?.offset, query2?.limit);
275770
+ const effectiveLimit = query2?.limit ?? total;
275771
+ return buildDiscoveryResult({
275772
+ evaluatedRevision: revision,
275773
+ total,
275774
+ items: paged,
275775
+ page: { limit: effectiveLimit, offset: query2?.offset ?? 0, returned: paged.length }
275776
+ });
275777
+ }
275778
+ function tocGetWrapper2(editor, input2) {
275779
+ const resolved = resolveTocTarget2(editor.state.doc, input2.target);
275780
+ return extractTocInfo2(resolved.node);
275781
+ }
275782
+ function buildTocAddress2(nodeId) {
275783
+ return { kind: "block", nodeType: "tableOfContents", nodeId };
275784
+ }
275785
+ function tocSuccess2(nodeId) {
275786
+ return { success: true, toc: buildTocAddress2(nodeId) };
275787
+ }
275788
+ function tocFailure2(code10, message) {
275789
+ return { success: false, failure: { code: code10, message } };
275790
+ }
275791
+ function toTocEditorCommand2(command2) {
275792
+ return command2;
275793
+ }
275794
+ function runTocAction2(editor, action, expectedRevision) {
275795
+ return executeDomainCommand2(editor, () => {
275796
+ const result = action();
275797
+ if (result)
275798
+ clearIndexCache2(editor);
275799
+ return result;
275800
+ }, { expectedRevision });
275801
+ }
275802
+ function runTocCommand2(editor, command2, args3, expectedRevision) {
275803
+ const executeCommand = toTocEditorCommand2(command2);
275804
+ return runTocAction2(editor, () => executeCommand(args3), expectedRevision);
275805
+ }
275806
+ function receiptApplied2(receipt2) {
275807
+ return receipt2.steps[0]?.effect === "changed";
275808
+ }
275809
+ function isTocContentUnchanged2(existingNode, newContent) {
275810
+ if (existingNode.childCount !== newContent.length)
275811
+ return false;
275812
+ const existingEntries = [];
275813
+ let canSerialize = true;
275814
+ existingNode.forEach((child) => {
275815
+ if (!canSerialize)
275816
+ return;
275817
+ if (typeof child.toJSON !== "function") {
275818
+ canSerialize = false;
275819
+ return;
275820
+ }
275821
+ const json = child.toJSON();
275822
+ if (json.attrs)
275823
+ delete json.attrs.sdBlockId;
275824
+ existingEntries.push(json);
275825
+ });
275826
+ if (!canSerialize)
275827
+ return false;
275828
+ const normalized = newContent.map((entry) => {
275829
+ const clone = JSON.parse(JSON.stringify(entry));
275830
+ if (clone.attrs)
275831
+ delete clone.attrs.sdBlockId;
275832
+ return clone;
275833
+ });
275834
+ return JSON.stringify(existingEntries) === JSON.stringify(normalized);
275835
+ }
275836
+ function materializeTocContent2(doc4, config33) {
275837
+ const headingSources = collectHeadingSources2(doc4, config33);
275838
+ const entryParagraphs = buildTocEntryParagraphs2(headingSources, config33);
275839
+ return entryParagraphs.length > 0 ? entryParagraphs : NO_ENTRIES_PLACEHOLDER2;
275840
+ }
275841
+ function tocConfigureWrapper2(editor, input2, options) {
275842
+ rejectTrackedMode2("toc.configure", options);
275843
+ const command2 = requireEditorCommand2(editor.commands?.setTableOfContentsInstructionById, "toc.configure");
275844
+ const resolved = resolveTocTarget2(editor.state.doc, input2.target);
275845
+ const currentConfig = parseTocInstruction2(resolved.node.attrs?.instruction ?? "");
275846
+ const patched = applyTocPatch2(currentConfig, input2.patch);
275847
+ const nextContent = materializeTocContent2(editor.state.doc, patched);
275848
+ if (areTocConfigsEqual2(currentConfig, patched)) {
275849
+ return tocFailure2("NO_OP", "Configuration patch produced no change.");
275850
+ }
275851
+ if (options?.dryRun) {
275852
+ return tocSuccess2(resolved.nodeId);
275853
+ }
275854
+ const shouldRefreshContent = !isTocContentUnchanged2(resolved.node, nextContent);
275855
+ const commandNodeId = resolved.commandNodeId ?? resolved.nodeId;
275856
+ const receipt2 = runTocCommand2(editor, command2, {
275857
+ sdBlockId: commandNodeId,
275858
+ instruction: serializeTocInstruction2(patched),
275859
+ ...shouldRefreshContent ? { content: nextContent } : {}
275860
+ }, options?.expectedRevision);
275861
+ if (!receiptApplied2(receipt2)) {
275862
+ return tocFailure2("NO_OP", "Configuration change could not be applied.");
275863
+ }
275864
+ const postMutationId = resolvePostMutationTocId2(editor.state.doc, commandNodeId);
275865
+ return tocSuccess2(postMutationId);
275866
+ }
275867
+ function tocUpdateWrapper2(editor, input2, options) {
275868
+ rejectTrackedMode2("toc.update", options);
275869
+ const command2 = requireEditorCommand2(editor.commands?.replaceTableOfContentsContentById, "toc.update");
275870
+ const resolved = resolveTocTarget2(editor.state.doc, input2.target);
275871
+ const config33 = parseTocInstruction2(resolved.node.attrs?.instruction ?? "");
275872
+ const content5 = materializeTocContent2(editor.state.doc, config33);
275873
+ if (isTocContentUnchanged2(resolved.node, content5)) {
275874
+ return tocFailure2("NO_OP", "TOC update produced no change.");
275875
+ }
275876
+ if (options?.dryRun) {
275877
+ return tocSuccess2(resolved.nodeId);
275878
+ }
275879
+ const receipt2 = runTocCommand2(editor, command2, {
275880
+ sdBlockId: resolved.commandNodeId ?? resolved.nodeId,
275881
+ content: content5
275882
+ }, options?.expectedRevision);
275883
+ return receiptApplied2(receipt2) ? tocSuccess2(resolved.nodeId) : tocFailure2("NO_OP", "TOC update produced no change.");
275884
+ }
275885
+ function tocRemoveWrapper2(editor, input2, options) {
275886
+ rejectTrackedMode2("toc.remove", options);
275887
+ const command2 = requireEditorCommand2(editor.commands?.deleteTableOfContentsById, "toc.remove");
275888
+ const resolved = resolveTocTarget2(editor.state.doc, input2.target);
275889
+ if (options?.dryRun) {
275890
+ return tocSuccess2(resolved.nodeId);
275891
+ }
275892
+ const receipt2 = runTocCommand2(editor, command2, {
275893
+ sdBlockId: resolved.commandNodeId ?? resolved.nodeId
275894
+ }, options?.expectedRevision);
275895
+ return receiptApplied2(receipt2) ? tocSuccess2(resolved.nodeId) : tocFailure2("NO_OP", "TOC removal produced no change.");
275896
+ }
275897
+ function createTableOfContentsWrapper2(editor, input2, options) {
275898
+ rejectTrackedMode2("create.tableOfContents", options);
275899
+ const command2 = requireEditorCommand2(editor.commands?.insertTableOfContentsAt, "create.tableOfContents");
275900
+ const at = input2.at ?? { kind: "documentEnd" };
275901
+ let pos;
275902
+ if (at.kind === "documentStart") {
275903
+ pos = 0;
275904
+ } else if (at.kind === "documentEnd") {
275905
+ pos = editor.state.doc.content.size;
275906
+ } else {
275907
+ pos = resolveBlockInsertionPos2(editor, at.target.nodeId, at.kind);
275908
+ }
275909
+ const config33 = input2.config ? applyTocPatch2(DEFAULT_TOC_CONFIG2, input2.config) : DEFAULT_TOC_CONFIG2;
275910
+ const instruction = serializeTocInstruction2(config33);
275911
+ const content5 = materializeTocContent2(editor.state.doc, config33);
275912
+ const sdBlockId = v42();
275913
+ if (options?.dryRun) {
275914
+ return { success: true, toc: buildTocAddress2("(dry-run)") };
275915
+ }
275916
+ const receipt2 = runTocCommand2(editor, command2, {
275917
+ pos,
275918
+ instruction,
275919
+ sdBlockId,
275920
+ content: content5
275921
+ }, options?.expectedRevision);
275922
+ if (!receiptApplied2(receipt2)) {
275923
+ return {
275924
+ success: false,
275925
+ failure: {
275926
+ code: "INVALID_INSERTION_CONTEXT",
275927
+ message: "Table of contents could not be inserted at the requested location."
275928
+ }
275929
+ };
275930
+ }
275931
+ const postMutationId = resolvePostMutationTocId2(editor.state.doc, sdBlockId);
275932
+ return { success: true, toc: buildTocAddress2(postMutationId) };
275933
+ }
275934
+ var NO_ENTRIES_PLACEHOLDER2;
275935
+ var init_toc_wrappers = __esm(() => {
275936
+ init_wrapper();
275937
+ init_src();
275938
+ init_toc_switches();
275939
+ init_toc_resolver();
275940
+ init_toc_entry_builder();
275941
+ init_adapter_utils();
275942
+ init_revision_tracker();
275943
+ init_plan_wrappers();
275944
+ init_mutation_helpers();
275945
+ init_index_cache();
275946
+ init_create_insertion();
275947
+ NO_ENTRIES_PLACEHOLDER2 = [
275948
+ {
275949
+ type: "paragraph",
275950
+ attrs: { paragraphProperties: {} },
275951
+ content: [{ type: "text", text: "No table of contents entries found." }]
275952
+ }
275953
+ ];
275954
+ });
275955
+
273620
275956
  // ../../packages/super-editor/src/document-api-adapters/assemble-adapters.ts
273621
275957
  function assembleDocumentApiAdapters2(editor) {
273622
275958
  registerBuiltInExecutors2();
@@ -273666,7 +276002,8 @@ function assembleDocumentApiAdapters2(editor) {
273666
276002
  paragraph: (input2, options) => createParagraphWrapper2(editor, input2, options),
273667
276003
  heading: (input2, options) => createHeadingWrapper2(editor, input2, options),
273668
276004
  table: (input2, options) => createTableWrapper2(editor, input2, options),
273669
- sectionBreak: (input2, options) => createSectionBreakAdapter2(editor, input2, options)
276005
+ sectionBreak: (input2, options) => createSectionBreakAdapter2(editor, input2, options),
276006
+ tableOfContents: (input2, options) => createTableOfContentsWrapper2(editor, input2, options)
273670
276007
  },
273671
276008
  lists: {
273672
276009
  list: (query2) => listsListWrapper2(editor, query2),
@@ -273739,6 +276076,13 @@ function assembleDocumentApiAdapters2(editor) {
273739
276076
  getCells: (input2) => tablesGetCellsAdapter2(editor, input2),
273740
276077
  getProperties: (input2) => tablesGetPropertiesAdapter2(editor, input2)
273741
276078
  },
276079
+ toc: {
276080
+ list: (query2) => tocListWrapper2(editor, query2),
276081
+ get: (input2) => tocGetWrapper2(editor, input2),
276082
+ configure: (input2, options) => tocConfigureWrapper2(editor, input2, options),
276083
+ update: (input2, options) => tocUpdateWrapper2(editor, input2, options),
276084
+ remove: (input2, options) => tocRemoveWrapper2(editor, input2, options)
276085
+ },
273742
276086
  query: {
273743
276087
  match: (input2) => queryMatchAdapter2(editor, input2)
273744
276088
  },
@@ -273769,6 +276113,7 @@ var init_assemble_adapters = __esm(() => {
273769
276113
  init_sections_adapter();
273770
276114
  init_tables_wrappers();
273771
276115
  init_tables_adapter();
276116
+ init_toc_wrappers();
273772
276117
  });
273773
276118
 
273774
276119
  // ../../packages/super-editor/src/document-api-adapters/index.ts
@@ -276853,6 +279198,25 @@ function mapBlocksError(operationId, error, code10) {
276853
279198
  return error;
276854
279199
  return new CliError("COMMAND_FAILED", message, { operationId, details });
276855
279200
  }
279201
+ function mapTocError(operationId, error, code10) {
279202
+ const message = extractErrorMessage(error);
279203
+ const details = extractErrorDetails(error);
279204
+ const planEngineError = tryMapPlanEngineError(operationId, error, code10);
279205
+ if (planEngineError)
279206
+ return planEngineError;
279207
+ if (code10 === "TARGET_NOT_FOUND") {
279208
+ return new CliError("TARGET_NOT_FOUND", message, { operationId, details });
279209
+ }
279210
+ if (code10 === "INVALID_TARGET") {
279211
+ return new CliError("INVALID_ARGUMENT", message, { operationId, details });
279212
+ }
279213
+ if (code10 === "COMMAND_UNAVAILABLE") {
279214
+ return new CliError("COMMAND_FAILED", message, { operationId, details });
279215
+ }
279216
+ if (error instanceof CliError)
279217
+ return error;
279218
+ return new CliError("COMMAND_FAILED", message, { operationId, details });
279219
+ }
276856
279220
  function mapQueryError(operationId, error, code10) {
276857
279221
  const message = extractErrorMessage(error);
276858
279222
  const details = extractErrorDetails(error);
@@ -276871,11 +279235,14 @@ function tryMapPlanEngineError(operationId, error, code10) {
276871
279235
  details: extractErrorDetails(error)
276872
279236
  });
276873
279237
  }
279238
+ function resolveOperationFamily(operationId) {
279239
+ return OPERATION_FAMILY[operationId] ?? "general";
279240
+ }
276874
279241
  function mapInvokeError(operationId, error) {
276875
279242
  if (error instanceof CliError)
276876
279243
  return error;
276877
279244
  const code10 = extractErrorCode(error);
276878
- const family = OPERATION_FAMILY[operationId];
279245
+ const family = resolveOperationFamily(operationId);
276879
279246
  return FAMILY_MAPPERS[family](operationId, error, code10);
276880
279247
  }
276881
279248
  function isReceiptLike(value) {
@@ -276889,7 +279256,7 @@ function mapFailedReceipt(operationId, result) {
276889
279256
  if (result.success)
276890
279257
  return null;
276891
279258
  const failure = result.failure;
276892
- const family = OPERATION_FAMILY[operationId];
279259
+ const family = resolveOperationFamily(operationId);
276893
279260
  if (!failure) {
276894
279261
  return new CliError("COMMAND_FAILED", `${operationId}: operation failed.`, { operationId });
276895
279262
  }
@@ -276949,6 +279316,15 @@ function mapFailedReceipt(operationId, result) {
276949
279316
  }
276950
279317
  return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
276951
279318
  }
279319
+ if (family === "toc") {
279320
+ if (failureCode === "TARGET_NOT_FOUND") {
279321
+ return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
279322
+ }
279323
+ if (failureCode === "INVALID_TARGET") {
279324
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
279325
+ }
279326
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
279327
+ }
276952
279328
  if (family === "tables") {
276953
279329
  if (failureCode === "TARGET_NOT_FOUND") {
276954
279330
  return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
@@ -276985,6 +279361,7 @@ var init_error_mapping = __esm(() => {
276985
279361
  comments: mapCommentsError,
276986
279362
  lists: mapListsError,
276987
279363
  tables: mapTablesError,
279364
+ toc: mapTocError,
276988
279365
  textMutation: mapTextMutationError,
276989
279366
  create: mapCreateError,
276990
279367
  blocks: mapBlocksError,