@superdoc-dev/cli 0.3.0-next.33 → 0.3.0-next.35

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 +1013 -37
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -3481,6 +3481,51 @@ var init_operation_definitions = __esm(() => {
3481
3481
  referenceDocPath: "tables/clear-cell-spacing.mdx",
3482
3482
  referenceGroup: "tables"
3483
3483
  },
3484
+ "tables.applyStyle": {
3485
+ memberPath: "tables.applyStyle",
3486
+ description: "Apply a table style and/or style options in one call.",
3487
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.",
3488
+ requiresDocumentContext: true,
3489
+ metadata: mutationOperation({
3490
+ idempotency: "conditional",
3491
+ supportsDryRun: true,
3492
+ supportsTrackedMode: false,
3493
+ possibleFailureCodes: ["NO_OP", "INVALID_TARGET", "INVALID_INPUT"],
3494
+ throws: T_NOT_FOUND_COMMAND
3495
+ }),
3496
+ referenceDocPath: "tables/apply-style.mdx",
3497
+ referenceGroup: "tables"
3498
+ },
3499
+ "tables.setBorders": {
3500
+ memberPath: "tables.setBorders",
3501
+ description: "Set borders on a table using a target set or per-edge patch.",
3502
+ expectedResult: "Returns a TableMutationResult receipt. Does not perform NO_OP detection.",
3503
+ requiresDocumentContext: true,
3504
+ metadata: mutationOperation({
3505
+ idempotency: "idempotent",
3506
+ supportsDryRun: true,
3507
+ supportsTrackedMode: false,
3508
+ possibleFailureCodes: ["INVALID_TARGET", "INVALID_INPUT"],
3509
+ throws: T_NOT_FOUND_COMMAND
3510
+ }),
3511
+ referenceDocPath: "tables/set-borders.mdx",
3512
+ referenceGroup: "tables"
3513
+ },
3514
+ "tables.setTableOptions": {
3515
+ memberPath: "tables.setTableOptions",
3516
+ description: "Set table-level default cell margins and/or cell spacing.",
3517
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the provided values already match current direct formatting.",
3518
+ requiresDocumentContext: true,
3519
+ metadata: mutationOperation({
3520
+ idempotency: "conditional",
3521
+ supportsDryRun: true,
3522
+ supportsTrackedMode: false,
3523
+ possibleFailureCodes: ["NO_OP", "INVALID_TARGET", "INVALID_INPUT"],
3524
+ throws: T_NOT_FOUND_COMMAND
3525
+ }),
3526
+ referenceDocPath: "tables/set-table-options.mdx",
3527
+ referenceGroup: "tables"
3528
+ },
3484
3529
  "tables.get": {
3485
3530
  memberPath: "tables.get",
3486
3531
  description: "Retrieve table structure and dimensions by locator.",
@@ -3508,7 +3553,7 @@ var init_operation_definitions = __esm(() => {
3508
3553
  "tables.getProperties": {
3509
3554
  memberPath: "tables.getProperties",
3510
3555
  description: "Retrieve layout and style properties of a table.",
3511
- expectedResult: "Returns a TablesGetPropertiesOutput with the table layout, style, border, and shading properties.",
3556
+ expectedResult: "Returns a TablesGetPropertiesOutput with direct table layout and style state, including style options, borders, default cell margins, and cell spacing when explicitly set.",
3512
3557
  requiresDocumentContext: true,
3513
3558
  metadata: readOperation({
3514
3559
  idempotency: "idempotent",
@@ -7730,7 +7775,7 @@ function buildInternalContractSchemas() {
7730
7775
  operations
7731
7776
  };
7732
7777
  }
7733
- var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
7778
+ var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern = "^([0-9A-Fa-f]{6}|auto)$", tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
7734
7779
  var init_schemas = __esm(() => {
7735
7780
  init_command_catalog();
7736
7781
  init_types2();
@@ -8453,6 +8498,14 @@ var init_schemas = __esm(() => {
8453
8498
  planEngine: planEngineCapabilitiesSchema
8454
8499
  }, ["global", "format", "operations", "planEngine"]);
8455
8500
  strictEmptyObjectSchema = objectSchema({});
8501
+ tableBorderSpecSchema = objectSchema({
8502
+ lineStyle: { type: "string" },
8503
+ lineWeightPt: { type: "number", exclusiveMinimum: 0 },
8504
+ color: { type: "string", pattern: tableBorderColorPattern }
8505
+ }, ["lineStyle", "lineWeightPt", "color"]);
8506
+ nullableTableBorderSpecSchema = {
8507
+ oneOf: [tableBorderSpecSchema, { type: "null" }]
8508
+ };
8456
8509
  sdFragmentSchema = {
8457
8510
  oneOf: [{ type: "object" }, { type: "array", items: { type: "object" } }]
8458
8511
  };
@@ -10891,6 +10944,84 @@ var init_schemas = __esm(() => {
10891
10944
  success: tableMutationSuccessSchema,
10892
10945
  failure: tableMutationFailureSchema
10893
10946
  },
10947
+ "tables.applyStyle": {
10948
+ input: {
10949
+ ...objectSchema({
10950
+ target: blockNodeAddressSchema,
10951
+ nodeId: { type: "string" },
10952
+ styleId: { type: "string" },
10953
+ styleOptions: objectSchema({
10954
+ headerRow: { type: "boolean" },
10955
+ lastRow: { type: "boolean" },
10956
+ totalRow: { type: "boolean" },
10957
+ firstColumn: { type: "boolean" },
10958
+ lastColumn: { type: "boolean" },
10959
+ bandedRows: { type: "boolean" },
10960
+ bandedColumns: { type: "boolean" }
10961
+ })
10962
+ }),
10963
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
10964
+ },
10965
+ output: tableMutationResultSchema,
10966
+ success: tableMutationSuccessSchema,
10967
+ failure: tableMutationFailureSchema
10968
+ },
10969
+ "tables.setBorders": {
10970
+ input: {
10971
+ oneOf: [
10972
+ {
10973
+ ...objectSchema({
10974
+ target: blockNodeAddressSchema,
10975
+ nodeId: { type: "string" },
10976
+ mode: { const: "applyTo" },
10977
+ applyTo: {
10978
+ enum: ["all", "outside", "inside", "top", "bottom", "left", "right", "insideH", "insideV"]
10979
+ },
10980
+ border: nullableTableBorderSpecSchema
10981
+ }, ["mode", "applyTo", "border"]),
10982
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
10983
+ },
10984
+ {
10985
+ ...objectSchema({
10986
+ target: blockNodeAddressSchema,
10987
+ nodeId: { type: "string" },
10988
+ mode: { const: "edges" },
10989
+ edges: objectSchema({
10990
+ top: nullableTableBorderSpecSchema,
10991
+ bottom: nullableTableBorderSpecSchema,
10992
+ left: nullableTableBorderSpecSchema,
10993
+ right: nullableTableBorderSpecSchema,
10994
+ insideH: nullableTableBorderSpecSchema,
10995
+ insideV: nullableTableBorderSpecSchema
10996
+ })
10997
+ }, ["mode", "edges"]),
10998
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
10999
+ }
11000
+ ]
11001
+ },
11002
+ output: tableMutationResultSchema,
11003
+ success: tableMutationSuccessSchema,
11004
+ failure: tableMutationFailureSchema
11005
+ },
11006
+ "tables.setTableOptions": {
11007
+ input: {
11008
+ ...objectSchema({
11009
+ target: blockNodeAddressSchema,
11010
+ nodeId: { type: "string" },
11011
+ defaultCellMargins: objectSchema({
11012
+ topPt: { type: "number", minimum: 0 },
11013
+ rightPt: { type: "number", minimum: 0 },
11014
+ bottomPt: { type: "number", minimum: 0 },
11015
+ leftPt: { type: "number", minimum: 0 }
11016
+ }, ["topPt", "rightPt", "bottomPt", "leftPt"]),
11017
+ cellSpacingPt: { oneOf: [{ type: "number", minimum: 0 }, { type: "null" }] }
11018
+ }),
11019
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
11020
+ },
11021
+ output: tableMutationResultSchema,
11022
+ success: tableMutationSuccessSchema,
11023
+ failure: tableMutationFailureSchema
11024
+ },
10894
11025
  "tables.get": {
10895
11026
  input: tableLocatorSchema,
10896
11027
  output: objectSchema({
@@ -10943,7 +11074,22 @@ var init_schemas = __esm(() => {
10943
11074
  lastColumn: { type: "boolean" },
10944
11075
  bandedRows: { type: "boolean" },
10945
11076
  bandedColumns: { type: "boolean" }
10946
- })
11077
+ }),
11078
+ borders: objectSchema({
11079
+ top: nullableTableBorderSpecSchema,
11080
+ bottom: nullableTableBorderSpecSchema,
11081
+ left: nullableTableBorderSpecSchema,
11082
+ right: nullableTableBorderSpecSchema,
11083
+ insideH: nullableTableBorderSpecSchema,
11084
+ insideV: nullableTableBorderSpecSchema
11085
+ }),
11086
+ defaultCellMargins: objectSchema({
11087
+ topPt: { type: "number" },
11088
+ rightPt: { type: "number" },
11089
+ bottomPt: { type: "number" },
11090
+ leftPt: { type: "number" }
11091
+ }),
11092
+ cellSpacingPt: { type: "number" }
10947
11093
  }, ["nodeId", "address"])
10948
11094
  },
10949
11095
  "tables.getStyles": {
@@ -14077,6 +14223,9 @@ function buildDispatchTable(api) {
14077
14223
  "tables.setCellPadding": (input, options) => api.tables.setCellPadding(input, options),
14078
14224
  "tables.setCellSpacing": (input, options) => api.tables.setCellSpacing(input, options),
14079
14225
  "tables.clearCellSpacing": (input, options) => api.tables.clearCellSpacing(input, options),
14226
+ "tables.applyStyle": (input, options) => api.tables.applyStyle(input, options),
14227
+ "tables.setBorders": (input, options) => api.tables.setBorders(input, options),
14228
+ "tables.setTableOptions": (input, options) => api.tables.setTableOptions(input, options),
14080
14229
  "tables.get": (input) => api.tables.get(input),
14081
14230
  "tables.getCells": (input) => api.tables.getCells(input),
14082
14231
  "tables.getProperties": (input) => api.tables.getProperties(input),
@@ -14414,8 +14563,165 @@ function executeCellOrTableScopedCellLocatorOp(operationName, adapter, input, op
14414
14563
  function executeDocumentLevelTableOp(adapter, input, options) {
14415
14564
  return adapter(input, normalizeMutationOptions(options));
14416
14565
  }
14566
+ function validateStyleOptionsPatch(options, operationName) {
14567
+ const keys = Object.keys(options);
14568
+ for (const key of keys) {
14569
+ if (!VALID_STYLE_OPTION_FLAGS.has(key)) {
14570
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: unrecognized style option flag "${key}".`, { field: "styleOptions", value: key });
14571
+ }
14572
+ if (typeof options[key] !== "boolean") {
14573
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: style option "${key}" must be a boolean.`, { field: `styleOptions.${key}` });
14574
+ }
14575
+ }
14576
+ }
14577
+ function validateBorderSpec(spec, fieldPath, operationName) {
14578
+ if (typeof spec !== "object" || spec === null) {
14579
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath} must be a border spec object.`);
14580
+ }
14581
+ if (typeof spec.lineStyle !== "string" || spec.lineStyle.length === 0) {
14582
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.lineStyle must be a non-empty string.`, {
14583
+ field: `${fieldPath}.lineStyle`
14584
+ });
14585
+ }
14586
+ if (typeof spec.lineWeightPt !== "number" || !Number.isFinite(spec.lineWeightPt) || spec.lineWeightPt <= 0) {
14587
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.lineWeightPt must be a positive number.`, { field: `${fieldPath}.lineWeightPt` });
14588
+ }
14589
+ if (typeof spec.color !== "string" || spec.color.length === 0) {
14590
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a non-empty string.`, {
14591
+ field: `${fieldPath}.color`
14592
+ });
14593
+ }
14594
+ if (!TABLE_BORDER_COLOR_PATTERN.test(spec.color)) {
14595
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, {
14596
+ field: `${fieldPath}.color`
14597
+ });
14598
+ }
14599
+ }
14600
+ function validateBorderPatchEdge(value, edgeName, operationName) {
14601
+ if (value === undefined || value === null)
14602
+ return;
14603
+ validateBorderSpec(value, `edges.${edgeName}`, operationName);
14604
+ }
14605
+ function executeTablesApplyStyle(operationName, adapter, input, options) {
14606
+ validateTableLocator(input, operationName);
14607
+ const hasStyleId = input.styleId !== undefined;
14608
+ const hasOptions = input.styleOptions !== undefined;
14609
+ if (!hasStyleId && !hasOptions) {
14610
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} requires at least one of styleId or styleOptions.`);
14611
+ }
14612
+ if (hasStyleId && typeof input.styleId !== "string") {
14613
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleId must be a string.`, {
14614
+ field: "styleId"
14615
+ });
14616
+ }
14617
+ if (hasStyleId && input.styleId === "") {
14618
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleId must be a non-empty string. Use tables.clearStyle to remove a style.`, { field: "styleId" });
14619
+ }
14620
+ if (hasOptions) {
14621
+ if (typeof input.styleOptions !== "object" || input.styleOptions === null || Array.isArray(input.styleOptions)) {
14622
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleOptions must be a plain object.`, {
14623
+ field: "styleOptions"
14624
+ });
14625
+ }
14626
+ const optionKeys = Object.keys(input.styleOptions);
14627
+ if (!hasStyleId && optionKeys.length === 0) {
14628
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleOptions must contain at least one flag when styleId is absent.`, { field: "styleOptions" });
14629
+ }
14630
+ if (optionKeys.length > 0) {
14631
+ validateStyleOptionsPatch(input.styleOptions, operationName);
14632
+ }
14633
+ }
14634
+ return adapter(input, normalizeMutationOptions(options));
14635
+ }
14636
+ function executeTablesSetBorders(operationName, adapter, input, options) {
14637
+ validateTableLocator(input, operationName);
14638
+ if (!("mode" in input) || input.mode !== "applyTo" && input.mode !== "edges") {
14639
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: mode must be "applyTo" or "edges".`, {
14640
+ field: "mode"
14641
+ });
14642
+ }
14643
+ if (input.mode === "applyTo") {
14644
+ if (!VALID_APPLY_TO_VALUES.has(input.applyTo)) {
14645
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: applyTo must be one of: ${[...VALID_APPLY_TO_VALUES].join(", ")}.`, { field: "applyTo" });
14646
+ }
14647
+ if (input.border === undefined) {
14648
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: border is required when mode is "applyTo".`, { field: "border" });
14649
+ }
14650
+ if (input.border !== null) {
14651
+ validateBorderSpec(input.border, "border", operationName);
14652
+ }
14653
+ }
14654
+ if (input.mode === "edges") {
14655
+ if (!input.edges || typeof input.edges !== "object") {
14656
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: edges is required when mode is "edges".`, { field: "edges" });
14657
+ }
14658
+ const edgeKeys = Object.keys(input.edges);
14659
+ const definedKeys = edgeKeys.filter((k) => VALID_BORDER_EDGE_KEYS.has(k) && input.edges[k] !== undefined);
14660
+ if (definedKeys.length === 0) {
14661
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: edges must contain at least one defined edge.`, { field: "edges" });
14662
+ }
14663
+ for (const key of edgeKeys) {
14664
+ if (!VALID_BORDER_EDGE_KEYS.has(key)) {
14665
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: unrecognized edge "${key}".`, {
14666
+ field: `edges.${key}`
14667
+ });
14668
+ }
14669
+ validateBorderPatchEdge(input.edges[key], key, operationName);
14670
+ }
14671
+ }
14672
+ return adapter(input, normalizeMutationOptions(options));
14673
+ }
14674
+ function executeTablesSetTableOptions(operationName, adapter, input, options) {
14675
+ validateTableLocator(input, operationName);
14676
+ const hasMargins = input.defaultCellMargins !== undefined;
14677
+ const hasSpacing = input.cellSpacingPt !== undefined;
14678
+ if (!hasMargins && !hasSpacing) {
14679
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} requires at least one of defaultCellMargins or cellSpacingPt.`);
14680
+ }
14681
+ if (hasMargins) {
14682
+ if (typeof input.defaultCellMargins !== "object" || input.defaultCellMargins === null || Array.isArray(input.defaultCellMargins)) {
14683
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: defaultCellMargins must be a plain object with topPt, rightPt, bottomPt, leftPt.`, { field: "defaultCellMargins" });
14684
+ }
14685
+ const m = input.defaultCellMargins;
14686
+ const sides = ["topPt", "rightPt", "bottomPt", "leftPt"];
14687
+ for (const side of sides) {
14688
+ if (typeof m[side] !== "number" || !Number.isFinite(m[side]) || m[side] < 0) {
14689
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: defaultCellMargins.${side} must be a non-negative number.`, { field: `defaultCellMargins.${side}` });
14690
+ }
14691
+ }
14692
+ }
14693
+ if (hasSpacing && input.cellSpacingPt !== null) {
14694
+ if (typeof input.cellSpacingPt !== "number" || !Number.isFinite(input.cellSpacingPt) || input.cellSpacingPt < 0) {
14695
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: cellSpacingPt must be a non-negative number or null.`, { field: "cellSpacingPt" });
14696
+ }
14697
+ }
14698
+ return adapter(input, normalizeMutationOptions(options));
14699
+ }
14700
+ var VALID_STYLE_OPTION_FLAGS, TABLE_BORDER_COLOR_PATTERN, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS;
14417
14701
  var init_tables = __esm(() => {
14418
14702
  init_errors2();
14703
+ VALID_STYLE_OPTION_FLAGS = new Set([
14704
+ "headerRow",
14705
+ "lastRow",
14706
+ "totalRow",
14707
+ "firstColumn",
14708
+ "lastColumn",
14709
+ "bandedRows",
14710
+ "bandedColumns"
14711
+ ]);
14712
+ TABLE_BORDER_COLOR_PATTERN = /^([0-9A-Fa-f]{6}|auto)$/u;
14713
+ VALID_APPLY_TO_VALUES = new Set([
14714
+ "all",
14715
+ "outside",
14716
+ "inside",
14717
+ "top",
14718
+ "bottom",
14719
+ "left",
14720
+ "right",
14721
+ "insideH",
14722
+ "insideV"
14723
+ ]);
14724
+ VALID_BORDER_EDGE_KEYS = new Set(["top", "bottom", "left", "right", "insideH", "insideV"]);
14419
14725
  });
14420
14726
 
14421
14727
  // ../../packages/document-api/src/header-footers/header-footers.ts
@@ -14612,7 +14918,7 @@ function assertObject(value, fieldName) {
14612
14918
  });
14613
14919
  }
14614
14920
  }
14615
- function validateBorderSpec(value, fieldName) {
14921
+ function validateBorderSpec2(value, fieldName) {
14616
14922
  assertObject(value, fieldName);
14617
14923
  if (!hasAnyDefined(value, ["style", "size", "space", "color", "shadow", "frame"])) {
14618
14924
  throw new DocumentApiValidationError("INVALID_INPUT", `${fieldName} must include at least one of style, size, space, color, shadow, or frame.`, { field: fieldName, value });
@@ -14646,13 +14952,13 @@ function validatePageBorders(value, fieldName) {
14646
14952
  if (value.zOrder !== undefined)
14647
14953
  assertOneOf3(value.zOrder, `${fieldName}.zOrder`, PAGE_BORDER_Z_ORDER_VALUES);
14648
14954
  if (value.top !== undefined)
14649
- validateBorderSpec(value.top, `${fieldName}.top`);
14955
+ validateBorderSpec2(value.top, `${fieldName}.top`);
14650
14956
  if (value.right !== undefined)
14651
- validateBorderSpec(value.right, `${fieldName}.right`);
14957
+ validateBorderSpec2(value.right, `${fieldName}.right`);
14652
14958
  if (value.bottom !== undefined)
14653
- validateBorderSpec(value.bottom, `${fieldName}.bottom`);
14959
+ validateBorderSpec2(value.bottom, `${fieldName}.bottom`);
14654
14960
  if (value.left !== undefined)
14655
- validateBorderSpec(value.left, `${fieldName}.left`);
14961
+ validateBorderSpec2(value.left, `${fieldName}.left`);
14656
14962
  }
14657
14963
  function normalizeSectionsListQuery(query2) {
14658
14964
  const limit = query2?.limit ?? DEFAULT_SECTIONS_LIST_LIMIT;
@@ -16474,6 +16780,15 @@ function createDocumentApi(adapters) {
16474
16780
  clearCellSpacing(input, options) {
16475
16781
  return executeTableLocatorOp("tables.clearCellSpacing", adapters.tables.clearCellSpacing.bind(adapters.tables), input, options);
16476
16782
  },
16783
+ applyStyle(input, options) {
16784
+ return executeTablesApplyStyle("tables.applyStyle", adapters.tables.applyStyle.bind(adapters.tables), input, options);
16785
+ },
16786
+ setBorders(input, options) {
16787
+ return executeTablesSetBorders("tables.setBorders", adapters.tables.setBorders.bind(adapters.tables), input, options);
16788
+ },
16789
+ setTableOptions(input, options) {
16790
+ return executeTablesSetTableOptions("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
16791
+ },
16477
16792
  get(input) {
16478
16793
  return adapters.tables.get(input);
16479
16794
  },
@@ -39367,7 +39682,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
39367
39682
  emptyOptions2 = {};
39368
39683
  });
39369
39684
 
39370
- // ../../packages/superdoc/dist/chunks/SuperConverter-BrfbGHMj.es.js
39685
+ // ../../packages/superdoc/dist/chunks/SuperConverter-hJPjNp5G.es.js
39371
39686
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
39372
39687
  const fieldValue = extension$1.config[field];
39373
39688
  if (typeof fieldValue === "function")
@@ -43261,6 +43576,9 @@ function buildDispatchTable2(api) {
43261
43576
  "tables.setCellPadding": (input, options) => api.tables.setCellPadding(input, options),
43262
43577
  "tables.setCellSpacing": (input, options) => api.tables.setCellSpacing(input, options),
43263
43578
  "tables.clearCellSpacing": (input, options) => api.tables.clearCellSpacing(input, options),
43579
+ "tables.applyStyle": (input, options) => api.tables.applyStyle(input, options),
43580
+ "tables.setBorders": (input, options) => api.tables.setBorders(input, options),
43581
+ "tables.setTableOptions": (input, options) => api.tables.setTableOptions(input, options),
43264
43582
  "tables.get": (input) => api.tables.get(input),
43265
43583
  "tables.getCells": (input) => api.tables.getCells(input),
43266
43584
  "tables.getProperties": (input) => api.tables.getProperties(input),
@@ -43560,6 +43878,107 @@ function executeCellOrTableScopedCellLocatorOp2(operationName, adapter, input, o
43560
43878
  function executeDocumentLevelTableOp2(adapter, input, options) {
43561
43879
  return adapter(input, normalizeMutationOptions2(options));
43562
43880
  }
43881
+ function validateStyleOptionsPatch2(options, operationName) {
43882
+ const keys$1 = Object.keys(options);
43883
+ for (const key of keys$1) {
43884
+ if (!VALID_STYLE_OPTION_FLAGS2.has(key))
43885
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: unrecognized style option flag "${key}".`, {
43886
+ field: "styleOptions",
43887
+ value: key
43888
+ });
43889
+ if (typeof options[key] !== "boolean")
43890
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: style option "${key}" must be a boolean.`, { field: `styleOptions.${key}` });
43891
+ }
43892
+ }
43893
+ function validateBorderSpec$1(spec, fieldPath, operationName) {
43894
+ if (typeof spec !== "object" || spec === null)
43895
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath} must be a border spec object.`);
43896
+ if (typeof spec.lineStyle !== "string" || spec.lineStyle.length === 0)
43897
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.lineStyle must be a non-empty string.`, { field: `${fieldPath}.lineStyle` });
43898
+ if (typeof spec.lineWeightPt !== "number" || !Number.isFinite(spec.lineWeightPt) || spec.lineWeightPt <= 0)
43899
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.lineWeightPt must be a positive number.`, { field: `${fieldPath}.lineWeightPt` });
43900
+ if (typeof spec.color !== "string" || spec.color.length === 0)
43901
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a non-empty string.`, { field: `${fieldPath}.color` });
43902
+ if (!TABLE_BORDER_COLOR_PATTERN2.test(spec.color))
43903
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, { field: `${fieldPath}.color` });
43904
+ }
43905
+ function validateBorderPatchEdge2(value, edgeName, operationName) {
43906
+ if (value === undefined || value === null)
43907
+ return;
43908
+ validateBorderSpec$1(value, `edges.${edgeName}`, operationName);
43909
+ }
43910
+ function executeTablesApplyStyle2(operationName, adapter, input, options) {
43911
+ validateTableLocator2(input, operationName);
43912
+ const hasStyleId = input.styleId !== undefined;
43913
+ const hasOptions = input.styleOptions !== undefined;
43914
+ if (!hasStyleId && !hasOptions)
43915
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} requires at least one of styleId or styleOptions.`);
43916
+ if (hasStyleId && typeof input.styleId !== "string")
43917
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleId must be a string.`, { field: "styleId" });
43918
+ if (hasStyleId && input.styleId === "")
43919
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleId must be a non-empty string. Use tables.clearStyle to remove a style.`, { field: "styleId" });
43920
+ if (hasOptions) {
43921
+ if (typeof input.styleOptions !== "object" || input.styleOptions === null || Array.isArray(input.styleOptions))
43922
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleOptions must be a plain object.`, { field: "styleOptions" });
43923
+ const optionKeys = Object.keys(input.styleOptions);
43924
+ if (!hasStyleId && optionKeys.length === 0)
43925
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleOptions must contain at least one flag when styleId is absent.`, { field: "styleOptions" });
43926
+ if (optionKeys.length > 0)
43927
+ validateStyleOptionsPatch2(input.styleOptions, operationName);
43928
+ }
43929
+ return adapter(input, normalizeMutationOptions2(options));
43930
+ }
43931
+ function executeTablesSetBorders2(operationName, adapter, input, options) {
43932
+ validateTableLocator2(input, operationName);
43933
+ if (!("mode" in input) || input.mode !== "applyTo" && input.mode !== "edges")
43934
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: mode must be "applyTo" or "edges".`, { field: "mode" });
43935
+ if (input.mode === "applyTo") {
43936
+ if (!VALID_APPLY_TO_VALUES2.has(input.applyTo))
43937
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: applyTo must be one of: ${[...VALID_APPLY_TO_VALUES2].join(", ")}.`, { field: "applyTo" });
43938
+ if (input.border === undefined)
43939
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: border is required when mode is "applyTo".`, { field: "border" });
43940
+ if (input.border !== null)
43941
+ validateBorderSpec$1(input.border, "border", operationName);
43942
+ }
43943
+ if (input.mode === "edges") {
43944
+ if (!input.edges || typeof input.edges !== "object")
43945
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: edges is required when mode is "edges".`, { field: "edges" });
43946
+ const edgeKeys = Object.keys(input.edges);
43947
+ if (edgeKeys.filter((k) => VALID_BORDER_EDGE_KEYS2.has(k) && input.edges[k] !== undefined).length === 0)
43948
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: edges must contain at least one defined edge.`, { field: "edges" });
43949
+ for (const key of edgeKeys) {
43950
+ if (!VALID_BORDER_EDGE_KEYS2.has(key))
43951
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: unrecognized edge "${key}".`, { field: `edges.${key}` });
43952
+ validateBorderPatchEdge2(input.edges[key], key, operationName);
43953
+ }
43954
+ }
43955
+ return adapter(input, normalizeMutationOptions2(options));
43956
+ }
43957
+ function executeTablesSetTableOptions2(operationName, adapter, input, options) {
43958
+ validateTableLocator2(input, operationName);
43959
+ const hasMargins = input.defaultCellMargins !== undefined;
43960
+ const hasSpacing = input.cellSpacingPt !== undefined;
43961
+ if (!hasMargins && !hasSpacing)
43962
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} requires at least one of defaultCellMargins or cellSpacingPt.`);
43963
+ if (hasMargins) {
43964
+ if (typeof input.defaultCellMargins !== "object" || input.defaultCellMargins === null || Array.isArray(input.defaultCellMargins))
43965
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: defaultCellMargins must be a plain object with topPt, rightPt, bottomPt, leftPt.`, { field: "defaultCellMargins" });
43966
+ const m = input.defaultCellMargins;
43967
+ for (const side of [
43968
+ "topPt",
43969
+ "rightPt",
43970
+ "bottomPt",
43971
+ "leftPt"
43972
+ ])
43973
+ if (typeof m[side] !== "number" || !Number.isFinite(m[side]) || m[side] < 0)
43974
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: defaultCellMargins.${side} must be a non-negative number.`, { field: `defaultCellMargins.${side}` });
43975
+ }
43976
+ if (hasSpacing && input.cellSpacingPt !== null) {
43977
+ if (typeof input.cellSpacingPt !== "number" || !Number.isFinite(input.cellSpacingPt) || input.cellSpacingPt < 0)
43978
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: cellSpacingPt must be a non-negative number or null.`, { field: "cellSpacingPt" });
43979
+ }
43980
+ return adapter(input, normalizeMutationOptions2(options));
43981
+ }
43563
43982
  function assertOneOf$1(value, fieldName, allowed) {
43564
43983
  if (typeof value !== "string" || !allowed.includes(value))
43565
43984
  throw new DocumentApiValidationError2("INVALID_INPUT", `${fieldName} must be one of: ${allowed.join(", ")}.`, {
@@ -43728,7 +44147,7 @@ function assertObject2(value, fieldName) {
43728
44147
  value
43729
44148
  });
43730
44149
  }
43731
- function validateBorderSpec2(value, fieldName) {
44150
+ function validateBorderSpec3(value, fieldName) {
43732
44151
  assertObject2(value, fieldName);
43733
44152
  if (!hasAnyDefined2(value, [
43734
44153
  "style",
@@ -43777,13 +44196,13 @@ function validatePageBorders2(value, fieldName) {
43777
44196
  if (value.zOrder !== undefined)
43778
44197
  assertOneOf4(value.zOrder, `${fieldName}.zOrder`, PAGE_BORDER_Z_ORDER_VALUES2);
43779
44198
  if (value.top !== undefined)
43780
- validateBorderSpec2(value.top, `${fieldName}.top`);
44199
+ validateBorderSpec3(value.top, `${fieldName}.top`);
43781
44200
  if (value.right !== undefined)
43782
- validateBorderSpec2(value.right, `${fieldName}.right`);
44201
+ validateBorderSpec3(value.right, `${fieldName}.right`);
43783
44202
  if (value.bottom !== undefined)
43784
- validateBorderSpec2(value.bottom, `${fieldName}.bottom`);
44203
+ validateBorderSpec3(value.bottom, `${fieldName}.bottom`);
43785
44204
  if (value.left !== undefined)
43786
- validateBorderSpec2(value.left, `${fieldName}.left`);
44205
+ validateBorderSpec3(value.left, `${fieldName}.left`);
43787
44206
  }
43788
44207
  function normalizeSectionsListQuery2(query2) {
43789
44208
  const limit = query2?.limit ?? DEFAULT_SECTIONS_LIST_LIMIT2;
@@ -45396,6 +45815,15 @@ function createDocumentApi2(adapters) {
45396
45815
  clearCellSpacing(input, options) {
45397
45816
  return executeTableLocatorOp2("tables.clearCellSpacing", adapters.tables.clearCellSpacing.bind(adapters.tables), input, options);
45398
45817
  },
45818
+ applyStyle(input, options) {
45819
+ return executeTablesApplyStyle2("tables.applyStyle", adapters.tables.applyStyle.bind(adapters.tables), input, options);
45820
+ },
45821
+ setBorders(input, options) {
45822
+ return executeTablesSetBorders2("tables.setBorders", adapters.tables.setBorders.bind(adapters.tables), input, options);
45823
+ },
45824
+ setTableOptions(input, options) {
45825
+ return executeTablesSetTableOptions2("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
45826
+ },
45399
45827
  get(input) {
45400
45828
  return adapters.tables.get(input);
45401
45829
  },
@@ -71241,7 +71669,7 @@ var isRegExp = (value) => {
71241
71669
  tracked: false,
71242
71670
  carrier: runAttributeCarrier2(runPropertyKey ?? key),
71243
71671
  schema
71244
- }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, LEGACY_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES2, SNAPSHOT_VERSION2 = "sd-diff-snapshot/v1", PAYLOAD_VERSION2 = "sd-diff-payload/v1", HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, PATCH_FIELDS2, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$216) => ({
71672
+ }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, LEGACY_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES2, SNAPSHOT_VERSION2 = "sd-diff-snapshot/v1", PAYLOAD_VERSION2 = "sd-diff-payload/v1", VALID_STYLE_OPTION_FLAGS2, TABLE_BORDER_COLOR_PATTERN2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, PATCH_FIELDS2, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$216) => ({
71245
71673
  handlerName,
71246
71674
  handler: (params) => {
71247
71675
  const { nodes } = params;
@@ -80381,7 +80809,7 @@ var isRegExp = (value) => {
80381
80809
  updateNumberingProperties(numberingProperties, node3, pos, editor, tr);
80382
80810
  });
80383
80811
  return true;
80384
- }, NUMBERING_PART_ID = "word/numbering.xml", NUMBERING_XMLNS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", numberingPartDescriptor, generateNewListDefinition$1 = ({ numId, listType, level, start, text: text$2, fmt, editor, markerFontFamily }) => {
80812
+ }, NUMBERING_PART_ID = "word/numbering.xml", NUMBERING_ROOT_ATTRS, numberingPartDescriptor, generateNewListDefinition$1 = ({ numId, listType, level, start, text: text$2, fmt, editor, markerFontFamily }) => {
80385
80813
  let resultDefs;
80386
80814
  mutateNumbering(editor, "list-numbering-helpers:generateNewListDefinition", (numbering) => {
80387
80815
  const result = generateNewListDefinition(numbering, {
@@ -85272,7 +85700,7 @@ var isRegExp = (value) => {
85272
85700
  state.kern = kernNode.attributes["w:val"];
85273
85701
  }
85274
85702
  }, SuperConverter;
85275
- var init_SuperConverter_BrfbGHMj_es = __esm(() => {
85703
+ var init_SuperConverter_hJPjNp5G_es = __esm(() => {
85276
85704
  init_rolldown_runtime_B2q5OVn9_es();
85277
85705
  init_jszip_ChlR43oI_es();
85278
85706
  init_xml_js_BtmJ6bNs_es();
@@ -90776,6 +91204,59 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
90776
91204
  referenceDocPath: "tables/clear-cell-spacing.mdx",
90777
91205
  referenceGroup: "tables"
90778
91206
  },
91207
+ "tables.applyStyle": {
91208
+ memberPath: "tables.applyStyle",
91209
+ description: "Apply a table style and/or style options in one call.",
91210
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.",
91211
+ requiresDocumentContext: true,
91212
+ metadata: mutationOperation2({
91213
+ idempotency: "conditional",
91214
+ supportsDryRun: true,
91215
+ supportsTrackedMode: false,
91216
+ possibleFailureCodes: [
91217
+ "NO_OP",
91218
+ "INVALID_TARGET",
91219
+ "INVALID_INPUT"
91220
+ ],
91221
+ throws: T_NOT_FOUND_COMMAND2
91222
+ }),
91223
+ referenceDocPath: "tables/apply-style.mdx",
91224
+ referenceGroup: "tables"
91225
+ },
91226
+ "tables.setBorders": {
91227
+ memberPath: "tables.setBorders",
91228
+ description: "Set borders on a table using a target set or per-edge patch.",
91229
+ expectedResult: "Returns a TableMutationResult receipt. Does not perform NO_OP detection.",
91230
+ requiresDocumentContext: true,
91231
+ metadata: mutationOperation2({
91232
+ idempotency: "idempotent",
91233
+ supportsDryRun: true,
91234
+ supportsTrackedMode: false,
91235
+ possibleFailureCodes: ["INVALID_TARGET", "INVALID_INPUT"],
91236
+ throws: T_NOT_FOUND_COMMAND2
91237
+ }),
91238
+ referenceDocPath: "tables/set-borders.mdx",
91239
+ referenceGroup: "tables"
91240
+ },
91241
+ "tables.setTableOptions": {
91242
+ memberPath: "tables.setTableOptions",
91243
+ description: "Set table-level default cell margins and/or cell spacing.",
91244
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the provided values already match current direct formatting.",
91245
+ requiresDocumentContext: true,
91246
+ metadata: mutationOperation2({
91247
+ idempotency: "conditional",
91248
+ supportsDryRun: true,
91249
+ supportsTrackedMode: false,
91250
+ possibleFailureCodes: [
91251
+ "NO_OP",
91252
+ "INVALID_TARGET",
91253
+ "INVALID_INPUT"
91254
+ ],
91255
+ throws: T_NOT_FOUND_COMMAND2
91256
+ }),
91257
+ referenceDocPath: "tables/set-table-options.mdx",
91258
+ referenceGroup: "tables"
91259
+ },
90779
91260
  "tables.get": {
90780
91261
  memberPath: "tables.get",
90781
91262
  description: "Retrieve table structure and dimensions by locator.",
@@ -90803,7 +91284,7 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
90803
91284
  "tables.getProperties": {
90804
91285
  memberPath: "tables.getProperties",
90805
91286
  description: "Retrieve layout and style properties of a table.",
90806
- expectedResult: "Returns a TablesGetPropertiesOutput with the table layout, style, border, and shading properties.",
91287
+ expectedResult: "Returns a TablesGetPropertiesOutput with direct table layout and style state, including style options, borders, default cell margins, and cell spacing when explicitly set.",
90807
91288
  requiresDocumentContext: true,
90808
91289
  metadata: readOperation2({
90809
91290
  idempotency: "idempotent",
@@ -95128,6 +95609,21 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
95128
95609
  "planEngine"
95129
95610
  ]);
95130
95611
  objectSchema2({});
95612
+ nullableTableBorderSpecSchema2 = { oneOf: [objectSchema2({
95613
+ lineStyle: { type: "string" },
95614
+ lineWeightPt: {
95615
+ type: "number",
95616
+ exclusiveMinimum: 0
95617
+ },
95618
+ color: {
95619
+ type: "string",
95620
+ pattern: "^([0-9A-Fa-f]{6}|auto)$"
95621
+ }
95622
+ }, [
95623
+ "lineStyle",
95624
+ "lineWeightPt",
95625
+ "color"
95626
+ ]), { type: "null" }] };
95131
95627
  sdFragmentSchema2 = { oneOf: [{ type: "object" }, {
95132
95628
  type: "array",
95133
95629
  items: { type: "object" }
@@ -97530,7 +98026,82 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
97530
98026
  type: "number",
97531
98027
  minimum: 0
97532
98028
  }
97533
- }, ["spacingPt"]) }, objectSchema2({
98029
+ }, ["spacingPt"]) }, { ...objectSchema2({
98030
+ target: blockNodeAddressSchema2,
98031
+ nodeId: { type: "string" },
98032
+ styleId: { type: "string" },
98033
+ styleOptions: objectSchema2({
98034
+ headerRow: { type: "boolean" },
98035
+ lastRow: { type: "boolean" },
98036
+ totalRow: { type: "boolean" },
98037
+ firstColumn: { type: "boolean" },
98038
+ lastColumn: { type: "boolean" },
98039
+ bandedRows: { type: "boolean" },
98040
+ bandedColumns: { type: "boolean" }
98041
+ })
98042
+ }) }, { ...objectSchema2({
98043
+ target: blockNodeAddressSchema2,
98044
+ nodeId: { type: "string" },
98045
+ mode: { const: "applyTo" },
98046
+ applyTo: { enum: [
98047
+ "all",
98048
+ "outside",
98049
+ "inside",
98050
+ "top",
98051
+ "bottom",
98052
+ "left",
98053
+ "right",
98054
+ "insideH",
98055
+ "insideV"
98056
+ ] },
98057
+ border: nullableTableBorderSpecSchema2
98058
+ }, [
98059
+ "mode",
98060
+ "applyTo",
98061
+ "border"
98062
+ ]) }, { ...objectSchema2({
98063
+ target: blockNodeAddressSchema2,
98064
+ nodeId: { type: "string" },
98065
+ mode: { const: "edges" },
98066
+ edges: objectSchema2({
98067
+ top: nullableTableBorderSpecSchema2,
98068
+ bottom: nullableTableBorderSpecSchema2,
98069
+ left: nullableTableBorderSpecSchema2,
98070
+ right: nullableTableBorderSpecSchema2,
98071
+ insideH: nullableTableBorderSpecSchema2,
98072
+ insideV: nullableTableBorderSpecSchema2
98073
+ })
98074
+ }, ["mode", "edges"]) }, { ...objectSchema2({
98075
+ target: blockNodeAddressSchema2,
98076
+ nodeId: { type: "string" },
98077
+ defaultCellMargins: objectSchema2({
98078
+ topPt: {
98079
+ type: "number",
98080
+ minimum: 0
98081
+ },
98082
+ rightPt: {
98083
+ type: "number",
98084
+ minimum: 0
98085
+ },
98086
+ bottomPt: {
98087
+ type: "number",
98088
+ minimum: 0
98089
+ },
98090
+ leftPt: {
98091
+ type: "number",
98092
+ minimum: 0
98093
+ }
98094
+ }, [
98095
+ "topPt",
98096
+ "rightPt",
98097
+ "bottomPt",
98098
+ "leftPt"
98099
+ ]),
98100
+ cellSpacingPt: { oneOf: [{
98101
+ type: "number",
98102
+ minimum: 0
98103
+ }, { type: "null" }] }
98104
+ }) }, objectSchema2({
97534
98105
  nodeId: { type: "string" },
97535
98106
  address: tableAddressSchema2,
97536
98107
  rows: {
@@ -97617,7 +98188,22 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
97617
98188
  lastColumn: { type: "boolean" },
97618
98189
  bandedRows: { type: "boolean" },
97619
98190
  bandedColumns: { type: "boolean" }
97620
- })
98191
+ }),
98192
+ borders: objectSchema2({
98193
+ top: nullableTableBorderSpecSchema2,
98194
+ bottom: nullableTableBorderSpecSchema2,
98195
+ left: nullableTableBorderSpecSchema2,
98196
+ right: nullableTableBorderSpecSchema2,
98197
+ insideH: nullableTableBorderSpecSchema2,
98198
+ insideV: nullableTableBorderSpecSchema2
98199
+ }),
98200
+ defaultCellMargins: objectSchema2({
98201
+ topPt: { type: "number" },
98202
+ rightPt: { type: "number" },
98203
+ bottomPt: { type: "number" },
98204
+ leftPt: { type: "number" }
98205
+ }),
98206
+ cellSpacingPt: { type: "number" }
97621
98207
  }, ["nodeId", "address"]), objectSchema2({
97622
98208
  explicitDefaultStyleId: { type: ["string", "null"] },
97623
98209
  effectiveDefaultStyleId: { type: ["string", "null"] },
@@ -98915,6 +99501,35 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
98915
99501
  SUPPORTED_DELETE_NODE_TYPES2 = new Set(DELETABLE_BLOCK_NODE_TYPES2);
98916
99502
  REJECTED_DELETE_NODE_TYPES2 = new Set(["tableRow", "tableCell"]);
98917
99503
  VALID_BLOCK_NODE_TYPES2 = new Set(BLOCK_NODE_TYPES2);
99504
+ VALID_STYLE_OPTION_FLAGS2 = new Set([
99505
+ "headerRow",
99506
+ "lastRow",
99507
+ "totalRow",
99508
+ "firstColumn",
99509
+ "lastColumn",
99510
+ "bandedRows",
99511
+ "bandedColumns"
99512
+ ]);
99513
+ TABLE_BORDER_COLOR_PATTERN2 = /^([0-9A-Fa-f]{6}|auto)$/u;
99514
+ VALID_APPLY_TO_VALUES2 = new Set([
99515
+ "all",
99516
+ "outside",
99517
+ "inside",
99518
+ "top",
99519
+ "bottom",
99520
+ "left",
99521
+ "right",
99522
+ "insideH",
99523
+ "insideV"
99524
+ ]);
99525
+ VALID_BORDER_EDGE_KEYS2 = new Set([
99526
+ "top",
99527
+ "bottom",
99528
+ "left",
99529
+ "right",
99530
+ "insideH",
99531
+ "insideV"
99532
+ ]);
98918
99533
  HEADER_FOOTER_KINDS$1 = ["header", "footer"];
98919
99534
  HEADER_FOOTER_VARIANTS$1 = [
98920
99535
  "default",
@@ -114205,6 +114820,12 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
114205
114820
  }
114206
114821
  ]
114207
114822
  };
114823
+ NUMBERING_ROOT_ATTRS = {
114824
+ "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
114825
+ "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml",
114826
+ "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
114827
+ "mc:Ignorable": "w15"
114828
+ };
114208
114829
  numberingPartDescriptor = {
114209
114830
  id: NUMBERING_PART_ID,
114210
114831
  ensurePart() {
@@ -114217,7 +114838,7 @@ var init_SuperConverter_BrfbGHMj_es = __esm(() => {
114217
114838
  elements: [{
114218
114839
  type: "element",
114219
114840
  name: "w:numbering",
114220
- attributes: { "xmlns:w": NUMBERING_XMLNS },
114841
+ attributes: { ...NUMBERING_ROOT_ATTRS },
114221
114842
  elements: []
114222
114843
  }]
114223
114844
  };
@@ -147681,7 +148302,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
147681
148302
  init_remark_gfm_z_sDF4ss_es();
147682
148303
  });
147683
148304
 
147684
- // ../../packages/superdoc/dist/chunks/src-DsoBnhF3.es.js
148305
+ // ../../packages/superdoc/dist/chunks/src-99pz_-W7.es.js
147685
148306
  function deleteProps(obj, propOrProps) {
147686
148307
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
147687
148308
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -166931,6 +167552,316 @@ function tablesClearCellSpacingAdapter(editor, input2, options) {
166931
167552
  return toTableFailure("INVALID_TARGET", "Cell spacing removal could not be applied.");
166932
167553
  }
166933
167554
  }
167555
+ function readTableLookAsState(tblLook) {
167556
+ if (!tblLook)
167557
+ return;
167558
+ const result = {};
167559
+ let hasAny = false;
167560
+ for (const [xmlKey, apiFlag] of Object.entries(XML_KEY_TO_STYLE_OPTION))
167561
+ if (xmlKey in tblLook && typeof tblLook[xmlKey] === "boolean") {
167562
+ const rawValue = tblLook[xmlKey];
167563
+ result[apiFlag] = INVERTED_FLAGS.has(apiFlag) ? !rawValue : rawValue;
167564
+ hasAny = true;
167565
+ }
167566
+ return hasAny ? result : undefined;
167567
+ }
167568
+ function writeTableLook(currentLook, patch3) {
167569
+ const result = currentLook ? { ...currentLook } : { ...WORD_DEFAULT_TBL_LOOK };
167570
+ for (const [apiFlag, value] of Object.entries(patch3)) {
167571
+ if (value === undefined)
167572
+ continue;
167573
+ const normalizedFlag = apiFlag;
167574
+ const xmlKey = resolveStyleOptionFlag(normalizedFlag);
167575
+ result[xmlKey] = INVERTED_FLAGS.has(normalizedFlag) ? !value : value;
167576
+ }
167577
+ delete result.val;
167578
+ return result;
167579
+ }
167580
+ function normalizeBorderSpecFromApi(spec) {
167581
+ return {
167582
+ val: spec.lineStyle,
167583
+ size: Math.round(spec.lineWeightPt * 8),
167584
+ color: spec.color
167585
+ };
167586
+ }
167587
+ function normalizeBorderSpecToApi(border) {
167588
+ const rawColor = typeof border.color === "string" ? border.color : "auto";
167589
+ const color2 = rawColor === "auto" ? "auto" : rawColor.toUpperCase();
167590
+ return {
167591
+ lineStyle: String(border.val ?? "single"),
167592
+ lineWeightPt: typeof border.size === "number" ? border.size / 8 : 0,
167593
+ color: color2
167594
+ };
167595
+ }
167596
+ function isClearedBorder(border) {
167597
+ return border.val === "none" || border.val === "nil";
167598
+ }
167599
+ function readBorderEdge(border) {
167600
+ if (!border || typeof border !== "object")
167601
+ return;
167602
+ const b$1 = border;
167603
+ if (isClearedBorder(b$1))
167604
+ return null;
167605
+ return normalizeBorderSpecToApi(b$1);
167606
+ }
167607
+ function readBordersAsState(borders) {
167608
+ if (!borders || typeof borders !== "object")
167609
+ return;
167610
+ const b$1 = borders;
167611
+ const result = {};
167612
+ let hasAny = false;
167613
+ for (const edge of [
167614
+ "top",
167615
+ "bottom",
167616
+ "left",
167617
+ "right",
167618
+ "insideH",
167619
+ "insideV"
167620
+ ])
167621
+ if (edge in b$1) {
167622
+ const value = readBorderEdge(b$1[edge]);
167623
+ if (value !== undefined) {
167624
+ result[edge] = value;
167625
+ hasAny = true;
167626
+ }
167627
+ }
167628
+ return hasAny ? result : undefined;
167629
+ }
167630
+ function readCellMarginEntry(cellMargins, keys$1) {
167631
+ for (const key$1 of keys$1) {
167632
+ const entry = cellMargins[key$1];
167633
+ if (entry && typeof entry.value === "number")
167634
+ return entry;
167635
+ }
167636
+ }
167637
+ function readCellMarginsAsState(cellMargins) {
167638
+ if (!cellMargins || typeof cellMargins !== "object")
167639
+ return;
167640
+ const cm = cellMargins;
167641
+ const result = {};
167642
+ let hasAny = false;
167643
+ for (const { keys: keys$1, apiKey } of TABLE_MARGIN_KEY_GROUPS) {
167644
+ const entry = readCellMarginEntry(cm, keys$1);
167645
+ if (entry && typeof entry.value === "number") {
167646
+ result[apiKey] = entry.value / POINTS_TO_TWIPS;
167647
+ hasAny = true;
167648
+ }
167649
+ }
167650
+ return hasAny ? result : undefined;
167651
+ }
167652
+ function readCellSpacingPt(spacing) {
167653
+ if (!spacing || typeof spacing !== "object")
167654
+ return;
167655
+ const s2 = spacing;
167656
+ if (typeof s2.value !== "number")
167657
+ return;
167658
+ return s2.value / POINTS_TO_TWIPS;
167659
+ }
167660
+ function expandApplyToEdges(applyTo) {
167661
+ switch (applyTo) {
167662
+ case "all":
167663
+ return [
167664
+ "top",
167665
+ "bottom",
167666
+ "left",
167667
+ "right",
167668
+ "insideH",
167669
+ "insideV"
167670
+ ];
167671
+ case "outside":
167672
+ return [
167673
+ "top",
167674
+ "bottom",
167675
+ "left",
167676
+ "right"
167677
+ ];
167678
+ case "inside":
167679
+ return ["insideH", "insideV"];
167680
+ default:
167681
+ return [applyTo];
167682
+ }
167683
+ }
167684
+ function buildOoxmlBorderPatch(currentBorders, edgePatch) {
167685
+ const result = { ...currentBorders };
167686
+ const edges = Object.entries(edgePatch);
167687
+ for (const [edge, value] of edges) {
167688
+ if (value === undefined)
167689
+ continue;
167690
+ result[edge] = value === null ? { ...CLEARED_BORDER_OOXML } : normalizeBorderSpecFromApi(value);
167691
+ }
167692
+ return result;
167693
+ }
167694
+ function isStylePatchSatisfied(currentTableProps, input2) {
167695
+ if (input2.styleId !== undefined) {
167696
+ if (currentTableProps.tableStyleId !== input2.styleId)
167697
+ return false;
167698
+ }
167699
+ if (input2.styleOptions) {
167700
+ const currentLook = currentTableProps.tblLook ?? {};
167701
+ for (const [apiFlag, value] of Object.entries(input2.styleOptions)) {
167702
+ if (value === undefined)
167703
+ continue;
167704
+ const normalizedFlag = apiFlag;
167705
+ const xmlKey = resolveStyleOptionFlag(normalizedFlag);
167706
+ const expectedXmlValue = INVERTED_FLAGS.has(normalizedFlag) ? !value : value;
167707
+ if (!(xmlKey in currentLook) || currentLook[xmlKey] !== expectedXmlValue)
167708
+ return false;
167709
+ }
167710
+ }
167711
+ return true;
167712
+ }
167713
+ function isTableOptionsSatisfied(currentTableProps, input2) {
167714
+ if (input2.defaultCellMargins !== undefined) {
167715
+ const cm = currentTableProps.cellMargins;
167716
+ if (!cm)
167717
+ return false;
167718
+ const m$1 = input2.defaultCellMargins;
167719
+ const pairs = [
167720
+ [["marginTop"], m$1.topPt],
167721
+ [["marginRight", "marginEnd"], m$1.rightPt],
167722
+ [["marginBottom"], m$1.bottomPt],
167723
+ [["marginLeft", "marginStart"], m$1.leftPt]
167724
+ ];
167725
+ for (const [ooxmlKeys, ptValue] of pairs) {
167726
+ const entry = readCellMarginEntry(cm, ooxmlKeys);
167727
+ if (!entry || entry.value !== Math.round(ptValue * POINTS_TO_TWIPS))
167728
+ return false;
167729
+ }
167730
+ }
167731
+ if (input2.cellSpacingPt !== undefined) {
167732
+ const spacing = currentTableProps.tableCellSpacing;
167733
+ if (input2.cellSpacingPt === null) {
167734
+ if (spacing !== undefined && spacing !== null)
167735
+ return false;
167736
+ } else if (!spacing || spacing.value !== Math.round(input2.cellSpacingPt * POINTS_TO_TWIPS))
167737
+ return false;
167738
+ }
167739
+ return true;
167740
+ }
167741
+ function tablesApplyStyleAdapter(editor, input2, options) {
167742
+ rejectTrackedMode("tables.applyStyle", options);
167743
+ const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.applyStyle");
167744
+ if (options?.dryRun)
167745
+ return buildTableSuccess(address2);
167746
+ try {
167747
+ const currentAttrs = candidate.node.attrs;
167748
+ const currentTableProps = currentAttrs.tableProperties ?? {};
167749
+ if (isStylePatchSatisfied(currentTableProps, input2))
167750
+ return toTableFailure("NO_OP", "tables.applyStyle did not produce a change.");
167751
+ const updatedTableProps = { ...currentTableProps };
167752
+ if (input2.styleId !== undefined)
167753
+ updatedTableProps.tableStyleId = input2.styleId;
167754
+ if (input2.styleOptions)
167755
+ updatedTableProps.tblLook = writeTableLook(asRecord2(updatedTableProps.tblLook), input2.styleOptions);
167756
+ const tr = editor.state.tr;
167757
+ tr.setNodeMarkup(candidate.pos, null, {
167758
+ ...currentAttrs,
167759
+ tableProperties: updatedTableProps,
167760
+ ...syncExtractedTableAttrs(updatedTableProps)
167761
+ });
167762
+ applyDirectMutationMeta(tr);
167763
+ editor.dispatch(tr);
167764
+ clearIndexCache(editor);
167765
+ return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
167766
+ } catch {
167767
+ return toTableFailure("INVALID_TARGET", "Table style application could not be applied.");
167768
+ }
167769
+ }
167770
+ function tablesSetBordersAdapter(editor, input2, options) {
167771
+ rejectTrackedMode("tables.setBorders", options);
167772
+ const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.setBorders");
167773
+ if (options?.dryRun)
167774
+ return buildTableSuccess(address2);
167775
+ try {
167776
+ let edgePatch;
167777
+ if (input2.mode === "applyTo") {
167778
+ const edges = expandApplyToEdges(input2.applyTo);
167779
+ edgePatch = {};
167780
+ for (const edge of edges)
167781
+ edgePatch[edge] = input2.border;
167782
+ } else
167783
+ edgePatch = input2.edges;
167784
+ const tr = editor.state.tr;
167785
+ const currentAttrs = candidate.node.attrs;
167786
+ const currentTableProps = { ...currentAttrs.tableProperties ?? {} };
167787
+ currentTableProps.borders = buildOoxmlBorderPatch(currentTableProps.borders ?? {}, edgePatch);
167788
+ tr.setNodeMarkup(candidate.pos, null, {
167789
+ ...currentAttrs,
167790
+ tableProperties: currentTableProps,
167791
+ ...syncExtractedTableAttrs(currentTableProps)
167792
+ });
167793
+ const patchEntries = Object.entries(edgePatch);
167794
+ for (const [edge, value] of patchEntries) {
167795
+ if (value === undefined)
167796
+ continue;
167797
+ if (!isBoundaryEdge(edge))
167798
+ continue;
167799
+ const ooxmlSpec = value === null ? { ...CLEARED_BORDER_OOXML } : normalizeBorderSpecFromApi(value);
167800
+ applyTableEdgeToCellBorders(tr, candidate.pos, candidate.node, edge, ooxmlSpec);
167801
+ }
167802
+ applyDirectMutationMeta(tr);
167803
+ editor.dispatch(tr);
167804
+ clearIndexCache(editor);
167805
+ return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
167806
+ } catch {
167807
+ return toTableFailure("INVALID_TARGET", "Table border update could not be applied.");
167808
+ }
167809
+ }
167810
+ function tablesSetTableOptionsAdapter(editor, input2, options) {
167811
+ rejectTrackedMode("tables.setTableOptions", options);
167812
+ const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.setTableOptions");
167813
+ if (options?.dryRun)
167814
+ return buildTableSuccess(address2);
167815
+ try {
167816
+ const currentAttrs = candidate.node.attrs;
167817
+ const currentTableProps = currentAttrs.tableProperties ?? {};
167818
+ if (isTableOptionsSatisfied(currentTableProps, input2))
167819
+ return toTableFailure("NO_OP", "tables.setTableOptions did not produce a change.");
167820
+ const updatedTableProps = { ...currentTableProps };
167821
+ if (input2.defaultCellMargins !== undefined) {
167822
+ const m$1 = input2.defaultCellMargins;
167823
+ updatedTableProps.cellMargins = {
167824
+ marginTop: {
167825
+ value: Math.round(m$1.topPt * POINTS_TO_TWIPS),
167826
+ type: "dxa"
167827
+ },
167828
+ marginRight: {
167829
+ value: Math.round(m$1.rightPt * POINTS_TO_TWIPS),
167830
+ type: "dxa"
167831
+ },
167832
+ marginBottom: {
167833
+ value: Math.round(m$1.bottomPt * POINTS_TO_TWIPS),
167834
+ type: "dxa"
167835
+ },
167836
+ marginLeft: {
167837
+ value: Math.round(m$1.leftPt * POINTS_TO_TWIPS),
167838
+ type: "dxa"
167839
+ }
167840
+ };
167841
+ }
167842
+ if (input2.cellSpacingPt !== undefined)
167843
+ if (input2.cellSpacingPt === null) {
167844
+ delete updatedTableProps.tableCellSpacing;
167845
+ delete updatedTableProps.tblCellSpacing;
167846
+ } else
167847
+ updatedTableProps.tableCellSpacing = {
167848
+ value: Math.round(input2.cellSpacingPt * POINTS_TO_TWIPS),
167849
+ type: "dxa"
167850
+ };
167851
+ const tr = editor.state.tr;
167852
+ tr.setNodeMarkup(candidate.pos, null, {
167853
+ ...currentAttrs,
167854
+ tableProperties: updatedTableProps,
167855
+ ...syncExtractedTableAttrs(updatedTableProps)
167856
+ });
167857
+ applyDirectMutationMeta(tr);
167858
+ editor.dispatch(tr);
167859
+ clearIndexCache(editor);
167860
+ return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
167861
+ } catch {
167862
+ return toTableFailure("INVALID_TARGET", "Table options could not be applied.");
167863
+ }
167864
+ }
166934
167865
  function resolveCreatedTable(editor, tableId) {
166935
167866
  const index2 = getBlockIndex(editor);
166936
167867
  const resolved = index2.byId.get(`table:${tableId}`);
@@ -167159,16 +168090,18 @@ function tablesGetPropertiesAdapter(editor, input2) {
167159
168090
  if (preferredWidth != null)
167160
168091
  result.preferredWidth = preferredWidth;
167161
168092
  }
167162
- const look = resolveTableLook(tp);
167163
- if (look)
167164
- result.styleOptions = {
167165
- headerRow: look.firstRow === true,
167166
- lastRow: look.lastRow === true,
167167
- firstColumn: look.firstColumn === true,
167168
- lastColumn: look.lastColumn === true,
167169
- bandedRows: look.noHBand !== true,
167170
- bandedColumns: look.noVBand !== true
167171
- };
168093
+ const styleOptions = readTableLookAsState(resolveTableLook(tp));
168094
+ if (styleOptions)
168095
+ result.styleOptions = styleOptions;
168096
+ const borders = readBordersAsState(tp.borders);
168097
+ if (borders)
168098
+ result.borders = borders;
168099
+ const defaultCellMargins = readCellMarginsAsState(tp.cellMargins);
168100
+ if (defaultCellMargins)
168101
+ result.defaultCellMargins = defaultCellMargins;
168102
+ const cellSpacingPt = readCellSpacingPt(tp.tableCellSpacing);
168103
+ if (cellSpacingPt !== undefined)
168104
+ result.cellSpacingPt = cellSpacingPt;
167172
168105
  return result;
167173
168106
  }
167174
168107
  function getConverterForStyles(editor) {
@@ -168653,6 +169586,15 @@ function tablesSetCellSpacingWrapper(editor, input2, options) {
168653
169586
  function tablesClearCellSpacingWrapper(editor, input2, options) {
168654
169587
  return executeTableCommand(editor, "tables.clearCellSpacing", tablesClearCellSpacingAdapter, input2, options);
168655
169588
  }
169589
+ function tablesApplyStyleWrapper(editor, input2, options) {
169590
+ return executeTableCommand(editor, "tables.applyStyle", tablesApplyStyleAdapter, input2, options);
169591
+ }
169592
+ function tablesSetBordersWrapper(editor, input2, options) {
169593
+ return executeTableCommand(editor, "tables.setBorders", tablesSetBordersAdapter, input2, options);
169594
+ }
169595
+ function tablesSetTableOptionsWrapper(editor, input2, options) {
169596
+ return executeTableCommand(editor, "tables.setTableOptions", tablesSetTableOptionsAdapter, input2, options);
169597
+ }
168656
169598
  function isCollabHistory(editor) {
168657
169599
  return Boolean(editor.options.collaborationProvider && editor.options.ydoc);
168658
169600
  }
@@ -179125,6 +180067,9 @@ function assembleDocumentApiAdapters(editor) {
179125
180067
  setCellPadding: (input2, options) => tablesSetCellPaddingWrapper(editor, input2, options),
179126
180068
  setCellSpacing: (input2, options) => tablesSetCellSpacingWrapper(editor, input2, options),
179127
180069
  clearCellSpacing: (input2, options) => tablesClearCellSpacingWrapper(editor, input2, options),
180070
+ applyStyle: (input2, options) => tablesApplyStyleWrapper(editor, input2, options),
180071
+ setBorders: (input2, options) => tablesSetBordersWrapper(editor, input2, options),
180072
+ setTableOptions: (input2, options) => tablesSetTableOptionsWrapper(editor, input2, options),
179128
180073
  get: (input2) => tablesGetAdapter(editor, input2),
179129
180074
  getCells: (input2) => tablesGetCellsAdapter(editor, input2),
179130
180075
  getProperties: (input2) => tablesGetPropertiesAdapter(editor, input2),
@@ -208472,7 +209417,7 @@ var Node$13 = class Node$14 {
208472
209417
  return;
208473
209418
  const candidate = run2.pmEnd;
208474
209419
  return typeof candidate === "number" ? candidate : undefined;
208475
- }, engines_exports, 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, BULLET_FORMATS$1, LOCK_MODE_TO_SDT_LOCK, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, CSS_NAMED_COLORS, HEADING_STYLE_DEPTH, BULLET_FORMATS, MARK_PRIORITY, remarkProcessor, DEFAULT_UNFLATTEN_LISTS = true, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, 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", CONTENT_CAPABILITIES, INLINE_CAPABILITIES, SDT_LOCK_TO_LOCK_MODE, STUB_WHERE, EMPTY_RESOLUTION, CONTAINER_NODE_TYPES, VALID_EDGE_NODE_TYPES3, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, PARAGRAPH_NODE_TYPES, TEXT_STYLE_CHARACTER_STYLE_ATTR = "styleId", DIRECT_FORMATTING_MARK_NAMES, ALIGNMENT_TO_JUSTIFICATION, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, DOCX_HEX_ID_LENGTH = 8, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS$1 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", 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$1, FOOTER_FILE_PATTERN$1, HISTORY_UNSAFE_OPS, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, VOLATILE_PARAGRAPH_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, setNestedValue = (target, path2, value) => {
209420
+ }, engines_exports, 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, BULLET_FORMATS$1, LOCK_MODE_TO_SDT_LOCK, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, CSS_NAMED_COLORS, HEADING_STYLE_DEPTH, BULLET_FORMATS, MARK_PRIORITY, remarkProcessor, DEFAULT_UNFLATTEN_LISTS = true, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, 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", CONTENT_CAPABILITIES, INLINE_CAPABILITIES, SDT_LOCK_TO_LOCK_MODE, STUB_WHERE, EMPTY_RESOLUTION, CONTAINER_NODE_TYPES, VALID_EDGE_NODE_TYPES3, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, PARAGRAPH_NODE_TYPES, TEXT_STYLE_CHARACTER_STYLE_ATTR = "styleId", DIRECT_FORMATTING_MARK_NAMES, ALIGNMENT_TO_JUSTIFICATION, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, DOCX_HEX_ID_LENGTH = 8, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS$1 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", 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$1, FOOTER_FILE_PATTERN$1, HISTORY_UNSAFE_OPS, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, VOLATILE_PARAGRAPH_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, setNestedValue = (target, path2, value) => {
208476
209421
  if (!path2.includes(".")) {
208477
209422
  target[path2] = value;
208478
209423
  return;
@@ -227502,9 +228447,9 @@ var Node$13 = class Node$14 {
227502
228447
  return false;
227503
228448
  return Boolean(checker(attrs));
227504
228449
  }, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
227505
- var init_src_DsoBnhF3_es = __esm(() => {
228450
+ var init_src_99pz__W7_es = __esm(() => {
227506
228451
  init_rolldown_runtime_B2q5OVn9_es();
227507
- init_SuperConverter_BrfbGHMj_es();
228452
+ init_SuperConverter_hJPjNp5G_es();
227508
228453
  init_jszip_ChlR43oI_es();
227509
228454
  init_uuid_qzgm05fK_es();
227510
228455
  init_constants_ep1_Gwqi_es();
@@ -235470,6 +236415,37 @@ function print() { __p += __j.call(arguments, '') }
235470
236415
  bandedColumns: "noVBand"
235471
236416
  };
235472
236417
  INVERTED_FLAGS = new Set(["bandedRows", "bandedColumns"]);
236418
+ XML_KEY_TO_STYLE_OPTION = {
236419
+ firstRow: "headerRow",
236420
+ lastRow: "lastRow",
236421
+ firstColumn: "firstColumn",
236422
+ lastColumn: "lastColumn",
236423
+ noHBand: "bandedRows",
236424
+ noVBand: "bandedColumns"
236425
+ };
236426
+ CLEARED_BORDER_OOXML = {
236427
+ val: "none",
236428
+ size: 0,
236429
+ color: "auto"
236430
+ };
236431
+ TABLE_MARGIN_KEY_GROUPS = [
236432
+ {
236433
+ keys: ["marginTop"],
236434
+ apiKey: "topPt"
236435
+ },
236436
+ {
236437
+ keys: ["marginRight", "marginEnd"],
236438
+ apiKey: "rightPt"
236439
+ },
236440
+ {
236441
+ keys: ["marginBottom"],
236442
+ apiKey: "bottomPt"
236443
+ },
236444
+ {
236445
+ keys: ["marginLeft", "marginStart"],
236446
+ apiKey: "leftPt"
236447
+ }
236448
+ ];
235473
236449
  TABLE_ADAPTER_DISPATCH = {
235474
236450
  "tables.delete": (e, i4, o) => tablesDeleteAdapter(e, i4, o),
235475
236451
  "tables.clearContents": (e, i4, o) => tablesClearContentsAdapter(e, i4, o),
@@ -260776,8 +261752,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
260776
261752
 
260777
261753
  // ../../packages/superdoc/dist/super-editor.es.js
260778
261754
  var init_super_editor_es = __esm(() => {
260779
- init_src_DsoBnhF3_es();
260780
- init_SuperConverter_BrfbGHMj_es();
261755
+ init_src_99pz__W7_es();
261756
+ init_SuperConverter_hJPjNp5G_es();
260781
261757
  init_jszip_ChlR43oI_es();
260782
261758
  init_xml_js_BtmJ6bNs_es();
260783
261759
  init_constants_ep1_Gwqi_es();