@superdoc-dev/cli 0.3.0-next.34 → 0.3.0-next.36
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.
- package/dist/index.js +1063 -47
- package/package.json +8 -8
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
|
|
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
|
};
|
|
@@ -10510,8 +10563,8 @@ var init_schemas = __esm(() => {
|
|
|
10510
10563
|
...objectSchema({
|
|
10511
10564
|
target: tableAddressSchema,
|
|
10512
10565
|
nodeId: { type: "string" },
|
|
10513
|
-
|
|
10514
|
-
}, ["
|
|
10566
|
+
rowIndex: { type: "integer", minimum: 1 }
|
|
10567
|
+
}, ["rowIndex"]),
|
|
10515
10568
|
oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
|
|
10516
10569
|
},
|
|
10517
10570
|
output: tableMutationResultSchema,
|
|
@@ -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),
|
|
@@ -14399,6 +14548,16 @@ function validateCellOrTableScopedCellLocator(input, operationName) {
|
|
|
14399
14548
|
}
|
|
14400
14549
|
}
|
|
14401
14550
|
}
|
|
14551
|
+
function normalizeTablesSplitInput(input) {
|
|
14552
|
+
const legacy = input.atRowIndex;
|
|
14553
|
+
if (legacy === undefined)
|
|
14554
|
+
return input;
|
|
14555
|
+
if (input.rowIndex !== undefined && input.rowIndex !== legacy) {
|
|
14556
|
+
throw new DocumentApiValidationError("INVALID_TARGET", "tables.split: cannot provide both rowIndex and atRowIndex with different values.", { fields: ["rowIndex", "atRowIndex"] });
|
|
14557
|
+
}
|
|
14558
|
+
const { atRowIndex: _legacy, ...rest } = input;
|
|
14559
|
+
return { ...rest, rowIndex: legacy };
|
|
14560
|
+
}
|
|
14402
14561
|
function executeTableLocatorOp(operationName, adapter, input, options) {
|
|
14403
14562
|
validateTableLocator(input, operationName);
|
|
14404
14563
|
return adapter(input, normalizeMutationOptions(options));
|
|
@@ -14414,8 +14573,165 @@ function executeCellOrTableScopedCellLocatorOp(operationName, adapter, input, op
|
|
|
14414
14573
|
function executeDocumentLevelTableOp(adapter, input, options) {
|
|
14415
14574
|
return adapter(input, normalizeMutationOptions(options));
|
|
14416
14575
|
}
|
|
14576
|
+
function validateStyleOptionsPatch(options, operationName) {
|
|
14577
|
+
const keys = Object.keys(options);
|
|
14578
|
+
for (const key of keys) {
|
|
14579
|
+
if (!VALID_STYLE_OPTION_FLAGS.has(key)) {
|
|
14580
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: unrecognized style option flag "${key}".`, { field: "styleOptions", value: key });
|
|
14581
|
+
}
|
|
14582
|
+
if (typeof options[key] !== "boolean") {
|
|
14583
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: style option "${key}" must be a boolean.`, { field: `styleOptions.${key}` });
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
14586
|
+
}
|
|
14587
|
+
function validateBorderSpec(spec, fieldPath, operationName) {
|
|
14588
|
+
if (typeof spec !== "object" || spec === null) {
|
|
14589
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath} must be a border spec object.`);
|
|
14590
|
+
}
|
|
14591
|
+
if (typeof spec.lineStyle !== "string" || spec.lineStyle.length === 0) {
|
|
14592
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.lineStyle must be a non-empty string.`, {
|
|
14593
|
+
field: `${fieldPath}.lineStyle`
|
|
14594
|
+
});
|
|
14595
|
+
}
|
|
14596
|
+
if (typeof spec.lineWeightPt !== "number" || !Number.isFinite(spec.lineWeightPt) || spec.lineWeightPt <= 0) {
|
|
14597
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.lineWeightPt must be a positive number.`, { field: `${fieldPath}.lineWeightPt` });
|
|
14598
|
+
}
|
|
14599
|
+
if (typeof spec.color !== "string" || spec.color.length === 0) {
|
|
14600
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a non-empty string.`, {
|
|
14601
|
+
field: `${fieldPath}.color`
|
|
14602
|
+
});
|
|
14603
|
+
}
|
|
14604
|
+
if (!TABLE_BORDER_COLOR_PATTERN.test(spec.color)) {
|
|
14605
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, {
|
|
14606
|
+
field: `${fieldPath}.color`
|
|
14607
|
+
});
|
|
14608
|
+
}
|
|
14609
|
+
}
|
|
14610
|
+
function validateBorderPatchEdge(value, edgeName, operationName) {
|
|
14611
|
+
if (value === undefined || value === null)
|
|
14612
|
+
return;
|
|
14613
|
+
validateBorderSpec(value, `edges.${edgeName}`, operationName);
|
|
14614
|
+
}
|
|
14615
|
+
function executeTablesApplyStyle(operationName, adapter, input, options) {
|
|
14616
|
+
validateTableLocator(input, operationName);
|
|
14617
|
+
const hasStyleId = input.styleId !== undefined;
|
|
14618
|
+
const hasOptions = input.styleOptions !== undefined;
|
|
14619
|
+
if (!hasStyleId && !hasOptions) {
|
|
14620
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} requires at least one of styleId or styleOptions.`);
|
|
14621
|
+
}
|
|
14622
|
+
if (hasStyleId && typeof input.styleId !== "string") {
|
|
14623
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleId must be a string.`, {
|
|
14624
|
+
field: "styleId"
|
|
14625
|
+
});
|
|
14626
|
+
}
|
|
14627
|
+
if (hasStyleId && input.styleId === "") {
|
|
14628
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleId must be a non-empty string. Use tables.clearStyle to remove a style.`, { field: "styleId" });
|
|
14629
|
+
}
|
|
14630
|
+
if (hasOptions) {
|
|
14631
|
+
if (typeof input.styleOptions !== "object" || input.styleOptions === null || Array.isArray(input.styleOptions)) {
|
|
14632
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleOptions must be a plain object.`, {
|
|
14633
|
+
field: "styleOptions"
|
|
14634
|
+
});
|
|
14635
|
+
}
|
|
14636
|
+
const optionKeys = Object.keys(input.styleOptions);
|
|
14637
|
+
if (!hasStyleId && optionKeys.length === 0) {
|
|
14638
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: styleOptions must contain at least one flag when styleId is absent.`, { field: "styleOptions" });
|
|
14639
|
+
}
|
|
14640
|
+
if (optionKeys.length > 0) {
|
|
14641
|
+
validateStyleOptionsPatch(input.styleOptions, operationName);
|
|
14642
|
+
}
|
|
14643
|
+
}
|
|
14644
|
+
return adapter(input, normalizeMutationOptions(options));
|
|
14645
|
+
}
|
|
14646
|
+
function executeTablesSetBorders(operationName, adapter, input, options) {
|
|
14647
|
+
validateTableLocator(input, operationName);
|
|
14648
|
+
if (!("mode" in input) || input.mode !== "applyTo" && input.mode !== "edges") {
|
|
14649
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: mode must be "applyTo" or "edges".`, {
|
|
14650
|
+
field: "mode"
|
|
14651
|
+
});
|
|
14652
|
+
}
|
|
14653
|
+
if (input.mode === "applyTo") {
|
|
14654
|
+
if (!VALID_APPLY_TO_VALUES.has(input.applyTo)) {
|
|
14655
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: applyTo must be one of: ${[...VALID_APPLY_TO_VALUES].join(", ")}.`, { field: "applyTo" });
|
|
14656
|
+
}
|
|
14657
|
+
if (input.border === undefined) {
|
|
14658
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: border is required when mode is "applyTo".`, { field: "border" });
|
|
14659
|
+
}
|
|
14660
|
+
if (input.border !== null) {
|
|
14661
|
+
validateBorderSpec(input.border, "border", operationName);
|
|
14662
|
+
}
|
|
14663
|
+
}
|
|
14664
|
+
if (input.mode === "edges") {
|
|
14665
|
+
if (!input.edges || typeof input.edges !== "object") {
|
|
14666
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: edges is required when mode is "edges".`, { field: "edges" });
|
|
14667
|
+
}
|
|
14668
|
+
const edgeKeys = Object.keys(input.edges);
|
|
14669
|
+
const definedKeys = edgeKeys.filter((k) => VALID_BORDER_EDGE_KEYS.has(k) && input.edges[k] !== undefined);
|
|
14670
|
+
if (definedKeys.length === 0) {
|
|
14671
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: edges must contain at least one defined edge.`, { field: "edges" });
|
|
14672
|
+
}
|
|
14673
|
+
for (const key of edgeKeys) {
|
|
14674
|
+
if (!VALID_BORDER_EDGE_KEYS.has(key)) {
|
|
14675
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: unrecognized edge "${key}".`, {
|
|
14676
|
+
field: `edges.${key}`
|
|
14677
|
+
});
|
|
14678
|
+
}
|
|
14679
|
+
validateBorderPatchEdge(input.edges[key], key, operationName);
|
|
14680
|
+
}
|
|
14681
|
+
}
|
|
14682
|
+
return adapter(input, normalizeMutationOptions(options));
|
|
14683
|
+
}
|
|
14684
|
+
function executeTablesSetTableOptions(operationName, adapter, input, options) {
|
|
14685
|
+
validateTableLocator(input, operationName);
|
|
14686
|
+
const hasMargins = input.defaultCellMargins !== undefined;
|
|
14687
|
+
const hasSpacing = input.cellSpacingPt !== undefined;
|
|
14688
|
+
if (!hasMargins && !hasSpacing) {
|
|
14689
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} requires at least one of defaultCellMargins or cellSpacingPt.`);
|
|
14690
|
+
}
|
|
14691
|
+
if (hasMargins) {
|
|
14692
|
+
if (typeof input.defaultCellMargins !== "object" || input.defaultCellMargins === null || Array.isArray(input.defaultCellMargins)) {
|
|
14693
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: defaultCellMargins must be a plain object with topPt, rightPt, bottomPt, leftPt.`, { field: "defaultCellMargins" });
|
|
14694
|
+
}
|
|
14695
|
+
const m = input.defaultCellMargins;
|
|
14696
|
+
const sides = ["topPt", "rightPt", "bottomPt", "leftPt"];
|
|
14697
|
+
for (const side of sides) {
|
|
14698
|
+
if (typeof m[side] !== "number" || !Number.isFinite(m[side]) || m[side] < 0) {
|
|
14699
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: defaultCellMargins.${side} must be a non-negative number.`, { field: `defaultCellMargins.${side}` });
|
|
14700
|
+
}
|
|
14701
|
+
}
|
|
14702
|
+
}
|
|
14703
|
+
if (hasSpacing && input.cellSpacingPt !== null) {
|
|
14704
|
+
if (typeof input.cellSpacingPt !== "number" || !Number.isFinite(input.cellSpacingPt) || input.cellSpacingPt < 0) {
|
|
14705
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: cellSpacingPt must be a non-negative number or null.`, { field: "cellSpacingPt" });
|
|
14706
|
+
}
|
|
14707
|
+
}
|
|
14708
|
+
return adapter(input, normalizeMutationOptions(options));
|
|
14709
|
+
}
|
|
14710
|
+
var VALID_STYLE_OPTION_FLAGS, TABLE_BORDER_COLOR_PATTERN, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS;
|
|
14417
14711
|
var init_tables = __esm(() => {
|
|
14418
14712
|
init_errors2();
|
|
14713
|
+
VALID_STYLE_OPTION_FLAGS = new Set([
|
|
14714
|
+
"headerRow",
|
|
14715
|
+
"lastRow",
|
|
14716
|
+
"totalRow",
|
|
14717
|
+
"firstColumn",
|
|
14718
|
+
"lastColumn",
|
|
14719
|
+
"bandedRows",
|
|
14720
|
+
"bandedColumns"
|
|
14721
|
+
]);
|
|
14722
|
+
TABLE_BORDER_COLOR_PATTERN = /^([0-9A-Fa-f]{6}|auto)$/u;
|
|
14723
|
+
VALID_APPLY_TO_VALUES = new Set([
|
|
14724
|
+
"all",
|
|
14725
|
+
"outside",
|
|
14726
|
+
"inside",
|
|
14727
|
+
"top",
|
|
14728
|
+
"bottom",
|
|
14729
|
+
"left",
|
|
14730
|
+
"right",
|
|
14731
|
+
"insideH",
|
|
14732
|
+
"insideV"
|
|
14733
|
+
]);
|
|
14734
|
+
VALID_BORDER_EDGE_KEYS = new Set(["top", "bottom", "left", "right", "insideH", "insideV"]);
|
|
14419
14735
|
});
|
|
14420
14736
|
|
|
14421
14737
|
// ../../packages/document-api/src/header-footers/header-footers.ts
|
|
@@ -14612,7 +14928,7 @@ function assertObject(value, fieldName) {
|
|
|
14612
14928
|
});
|
|
14613
14929
|
}
|
|
14614
14930
|
}
|
|
14615
|
-
function
|
|
14931
|
+
function validateBorderSpec2(value, fieldName) {
|
|
14616
14932
|
assertObject(value, fieldName);
|
|
14617
14933
|
if (!hasAnyDefined(value, ["style", "size", "space", "color", "shadow", "frame"])) {
|
|
14618
14934
|
throw new DocumentApiValidationError("INVALID_INPUT", `${fieldName} must include at least one of style, size, space, color, shadow, or frame.`, { field: fieldName, value });
|
|
@@ -14646,13 +14962,13 @@ function validatePageBorders(value, fieldName) {
|
|
|
14646
14962
|
if (value.zOrder !== undefined)
|
|
14647
14963
|
assertOneOf3(value.zOrder, `${fieldName}.zOrder`, PAGE_BORDER_Z_ORDER_VALUES);
|
|
14648
14964
|
if (value.top !== undefined)
|
|
14649
|
-
|
|
14965
|
+
validateBorderSpec2(value.top, `${fieldName}.top`);
|
|
14650
14966
|
if (value.right !== undefined)
|
|
14651
|
-
|
|
14967
|
+
validateBorderSpec2(value.right, `${fieldName}.right`);
|
|
14652
14968
|
if (value.bottom !== undefined)
|
|
14653
|
-
|
|
14969
|
+
validateBorderSpec2(value.bottom, `${fieldName}.bottom`);
|
|
14654
14970
|
if (value.left !== undefined)
|
|
14655
|
-
|
|
14971
|
+
validateBorderSpec2(value.left, `${fieldName}.left`);
|
|
14656
14972
|
}
|
|
14657
14973
|
function normalizeSectionsListQuery(query2) {
|
|
14658
14974
|
const limit = query2?.limit ?? DEFAULT_SECTIONS_LIST_LIMIT;
|
|
@@ -16379,7 +16695,8 @@ function createDocumentApi(adapters) {
|
|
|
16379
16695
|
return executeTableLocatorOp("tables.move", adapters.tables.move.bind(adapters.tables), input, options);
|
|
16380
16696
|
},
|
|
16381
16697
|
split(input, options) {
|
|
16382
|
-
|
|
16698
|
+
const normalized = normalizeTablesSplitInput(input);
|
|
16699
|
+
return executeRowLocatorOp("tables.split", adapters.tables.split.bind(adapters.tables), normalized, options);
|
|
16383
16700
|
},
|
|
16384
16701
|
convertToText(input, options) {
|
|
16385
16702
|
return executeTableLocatorOp("tables.convertToText", adapters.tables.convertToText.bind(adapters.tables), input, options);
|
|
@@ -16474,6 +16791,15 @@ function createDocumentApi(adapters) {
|
|
|
16474
16791
|
clearCellSpacing(input, options) {
|
|
16475
16792
|
return executeTableLocatorOp("tables.clearCellSpacing", adapters.tables.clearCellSpacing.bind(adapters.tables), input, options);
|
|
16476
16793
|
},
|
|
16794
|
+
applyStyle(input, options) {
|
|
16795
|
+
return executeTablesApplyStyle("tables.applyStyle", adapters.tables.applyStyle.bind(adapters.tables), input, options);
|
|
16796
|
+
},
|
|
16797
|
+
setBorders(input, options) {
|
|
16798
|
+
return executeTablesSetBorders("tables.setBorders", adapters.tables.setBorders.bind(adapters.tables), input, options);
|
|
16799
|
+
},
|
|
16800
|
+
setTableOptions(input, options) {
|
|
16801
|
+
return executeTablesSetTableOptions("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
|
|
16802
|
+
},
|
|
16477
16803
|
get(input) {
|
|
16478
16804
|
return adapters.tables.get(input);
|
|
16479
16805
|
},
|
|
@@ -39367,7 +39693,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
|
|
|
39367
39693
|
emptyOptions2 = {};
|
|
39368
39694
|
});
|
|
39369
39695
|
|
|
39370
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
39696
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-htgbtdmP.es.js
|
|
39371
39697
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
39372
39698
|
const fieldValue = extension$1.config[field];
|
|
39373
39699
|
if (typeof fieldValue === "function")
|
|
@@ -43261,6 +43587,9 @@ function buildDispatchTable2(api) {
|
|
|
43261
43587
|
"tables.setCellPadding": (input, options) => api.tables.setCellPadding(input, options),
|
|
43262
43588
|
"tables.setCellSpacing": (input, options) => api.tables.setCellSpacing(input, options),
|
|
43263
43589
|
"tables.clearCellSpacing": (input, options) => api.tables.clearCellSpacing(input, options),
|
|
43590
|
+
"tables.applyStyle": (input, options) => api.tables.applyStyle(input, options),
|
|
43591
|
+
"tables.setBorders": (input, options) => api.tables.setBorders(input, options),
|
|
43592
|
+
"tables.setTableOptions": (input, options) => api.tables.setTableOptions(input, options),
|
|
43264
43593
|
"tables.get": (input) => api.tables.get(input),
|
|
43265
43594
|
"tables.getCells": (input) => api.tables.getCells(input),
|
|
43266
43595
|
"tables.getProperties": (input) => api.tables.getProperties(input),
|
|
@@ -43545,6 +43874,18 @@ function validateCellOrTableScopedCellLocator2(input, operationName) {
|
|
|
43545
43874
|
throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName}: rowIndex and columnIndex are required when target is a table.`, { fields: ["rowIndex", "columnIndex"] });
|
|
43546
43875
|
}
|
|
43547
43876
|
}
|
|
43877
|
+
function normalizeTablesSplitInput2(input) {
|
|
43878
|
+
const legacy = input.atRowIndex;
|
|
43879
|
+
if (legacy === undefined)
|
|
43880
|
+
return input;
|
|
43881
|
+
if (input.rowIndex !== undefined && input.rowIndex !== legacy)
|
|
43882
|
+
throw new DocumentApiValidationError2("INVALID_TARGET", "tables.split: cannot provide both rowIndex and atRowIndex with different values.", { fields: ["rowIndex", "atRowIndex"] });
|
|
43883
|
+
const { atRowIndex: _legacy, ...rest } = input;
|
|
43884
|
+
return {
|
|
43885
|
+
...rest,
|
|
43886
|
+
rowIndex: legacy
|
|
43887
|
+
};
|
|
43888
|
+
}
|
|
43548
43889
|
function executeTableLocatorOp2(operationName, adapter, input, options) {
|
|
43549
43890
|
validateTableLocator2(input, operationName);
|
|
43550
43891
|
return adapter(input, normalizeMutationOptions2(options));
|
|
@@ -43560,6 +43901,107 @@ function executeCellOrTableScopedCellLocatorOp2(operationName, adapter, input, o
|
|
|
43560
43901
|
function executeDocumentLevelTableOp2(adapter, input, options) {
|
|
43561
43902
|
return adapter(input, normalizeMutationOptions2(options));
|
|
43562
43903
|
}
|
|
43904
|
+
function validateStyleOptionsPatch2(options, operationName) {
|
|
43905
|
+
const keys$1 = Object.keys(options);
|
|
43906
|
+
for (const key of keys$1) {
|
|
43907
|
+
if (!VALID_STYLE_OPTION_FLAGS2.has(key))
|
|
43908
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: unrecognized style option flag "${key}".`, {
|
|
43909
|
+
field: "styleOptions",
|
|
43910
|
+
value: key
|
|
43911
|
+
});
|
|
43912
|
+
if (typeof options[key] !== "boolean")
|
|
43913
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: style option "${key}" must be a boolean.`, { field: `styleOptions.${key}` });
|
|
43914
|
+
}
|
|
43915
|
+
}
|
|
43916
|
+
function validateBorderSpec$1(spec, fieldPath, operationName) {
|
|
43917
|
+
if (typeof spec !== "object" || spec === null)
|
|
43918
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath} must be a border spec object.`);
|
|
43919
|
+
if (typeof spec.lineStyle !== "string" || spec.lineStyle.length === 0)
|
|
43920
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.lineStyle must be a non-empty string.`, { field: `${fieldPath}.lineStyle` });
|
|
43921
|
+
if (typeof spec.lineWeightPt !== "number" || !Number.isFinite(spec.lineWeightPt) || spec.lineWeightPt <= 0)
|
|
43922
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.lineWeightPt must be a positive number.`, { field: `${fieldPath}.lineWeightPt` });
|
|
43923
|
+
if (typeof spec.color !== "string" || spec.color.length === 0)
|
|
43924
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a non-empty string.`, { field: `${fieldPath}.color` });
|
|
43925
|
+
if (!TABLE_BORDER_COLOR_PATTERN2.test(spec.color))
|
|
43926
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, { field: `${fieldPath}.color` });
|
|
43927
|
+
}
|
|
43928
|
+
function validateBorderPatchEdge2(value, edgeName, operationName) {
|
|
43929
|
+
if (value === undefined || value === null)
|
|
43930
|
+
return;
|
|
43931
|
+
validateBorderSpec$1(value, `edges.${edgeName}`, operationName);
|
|
43932
|
+
}
|
|
43933
|
+
function executeTablesApplyStyle2(operationName, adapter, input, options) {
|
|
43934
|
+
validateTableLocator2(input, operationName);
|
|
43935
|
+
const hasStyleId = input.styleId !== undefined;
|
|
43936
|
+
const hasOptions = input.styleOptions !== undefined;
|
|
43937
|
+
if (!hasStyleId && !hasOptions)
|
|
43938
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} requires at least one of styleId or styleOptions.`);
|
|
43939
|
+
if (hasStyleId && typeof input.styleId !== "string")
|
|
43940
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleId must be a string.`, { field: "styleId" });
|
|
43941
|
+
if (hasStyleId && input.styleId === "")
|
|
43942
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleId must be a non-empty string. Use tables.clearStyle to remove a style.`, { field: "styleId" });
|
|
43943
|
+
if (hasOptions) {
|
|
43944
|
+
if (typeof input.styleOptions !== "object" || input.styleOptions === null || Array.isArray(input.styleOptions))
|
|
43945
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleOptions must be a plain object.`, { field: "styleOptions" });
|
|
43946
|
+
const optionKeys = Object.keys(input.styleOptions);
|
|
43947
|
+
if (!hasStyleId && optionKeys.length === 0)
|
|
43948
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: styleOptions must contain at least one flag when styleId is absent.`, { field: "styleOptions" });
|
|
43949
|
+
if (optionKeys.length > 0)
|
|
43950
|
+
validateStyleOptionsPatch2(input.styleOptions, operationName);
|
|
43951
|
+
}
|
|
43952
|
+
return adapter(input, normalizeMutationOptions2(options));
|
|
43953
|
+
}
|
|
43954
|
+
function executeTablesSetBorders2(operationName, adapter, input, options) {
|
|
43955
|
+
validateTableLocator2(input, operationName);
|
|
43956
|
+
if (!("mode" in input) || input.mode !== "applyTo" && input.mode !== "edges")
|
|
43957
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: mode must be "applyTo" or "edges".`, { field: "mode" });
|
|
43958
|
+
if (input.mode === "applyTo") {
|
|
43959
|
+
if (!VALID_APPLY_TO_VALUES2.has(input.applyTo))
|
|
43960
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: applyTo must be one of: ${[...VALID_APPLY_TO_VALUES2].join(", ")}.`, { field: "applyTo" });
|
|
43961
|
+
if (input.border === undefined)
|
|
43962
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: border is required when mode is "applyTo".`, { field: "border" });
|
|
43963
|
+
if (input.border !== null)
|
|
43964
|
+
validateBorderSpec$1(input.border, "border", operationName);
|
|
43965
|
+
}
|
|
43966
|
+
if (input.mode === "edges") {
|
|
43967
|
+
if (!input.edges || typeof input.edges !== "object")
|
|
43968
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: edges is required when mode is "edges".`, { field: "edges" });
|
|
43969
|
+
const edgeKeys = Object.keys(input.edges);
|
|
43970
|
+
if (edgeKeys.filter((k) => VALID_BORDER_EDGE_KEYS2.has(k) && input.edges[k] !== undefined).length === 0)
|
|
43971
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: edges must contain at least one defined edge.`, { field: "edges" });
|
|
43972
|
+
for (const key of edgeKeys) {
|
|
43973
|
+
if (!VALID_BORDER_EDGE_KEYS2.has(key))
|
|
43974
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: unrecognized edge "${key}".`, { field: `edges.${key}` });
|
|
43975
|
+
validateBorderPatchEdge2(input.edges[key], key, operationName);
|
|
43976
|
+
}
|
|
43977
|
+
}
|
|
43978
|
+
return adapter(input, normalizeMutationOptions2(options));
|
|
43979
|
+
}
|
|
43980
|
+
function executeTablesSetTableOptions2(operationName, adapter, input, options) {
|
|
43981
|
+
validateTableLocator2(input, operationName);
|
|
43982
|
+
const hasMargins = input.defaultCellMargins !== undefined;
|
|
43983
|
+
const hasSpacing = input.cellSpacingPt !== undefined;
|
|
43984
|
+
if (!hasMargins && !hasSpacing)
|
|
43985
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} requires at least one of defaultCellMargins or cellSpacingPt.`);
|
|
43986
|
+
if (hasMargins) {
|
|
43987
|
+
if (typeof input.defaultCellMargins !== "object" || input.defaultCellMargins === null || Array.isArray(input.defaultCellMargins))
|
|
43988
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: defaultCellMargins must be a plain object with topPt, rightPt, bottomPt, leftPt.`, { field: "defaultCellMargins" });
|
|
43989
|
+
const m = input.defaultCellMargins;
|
|
43990
|
+
for (const side of [
|
|
43991
|
+
"topPt",
|
|
43992
|
+
"rightPt",
|
|
43993
|
+
"bottomPt",
|
|
43994
|
+
"leftPt"
|
|
43995
|
+
])
|
|
43996
|
+
if (typeof m[side] !== "number" || !Number.isFinite(m[side]) || m[side] < 0)
|
|
43997
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: defaultCellMargins.${side} must be a non-negative number.`, { field: `defaultCellMargins.${side}` });
|
|
43998
|
+
}
|
|
43999
|
+
if (hasSpacing && input.cellSpacingPt !== null) {
|
|
44000
|
+
if (typeof input.cellSpacingPt !== "number" || !Number.isFinite(input.cellSpacingPt) || input.cellSpacingPt < 0)
|
|
44001
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: cellSpacingPt must be a non-negative number or null.`, { field: "cellSpacingPt" });
|
|
44002
|
+
}
|
|
44003
|
+
return adapter(input, normalizeMutationOptions2(options));
|
|
44004
|
+
}
|
|
43563
44005
|
function assertOneOf$1(value, fieldName, allowed) {
|
|
43564
44006
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
43565
44007
|
throw new DocumentApiValidationError2("INVALID_INPUT", `${fieldName} must be one of: ${allowed.join(", ")}.`, {
|
|
@@ -43728,7 +44170,7 @@ function assertObject2(value, fieldName) {
|
|
|
43728
44170
|
value
|
|
43729
44171
|
});
|
|
43730
44172
|
}
|
|
43731
|
-
function
|
|
44173
|
+
function validateBorderSpec3(value, fieldName) {
|
|
43732
44174
|
assertObject2(value, fieldName);
|
|
43733
44175
|
if (!hasAnyDefined2(value, [
|
|
43734
44176
|
"style",
|
|
@@ -43777,13 +44219,13 @@ function validatePageBorders2(value, fieldName) {
|
|
|
43777
44219
|
if (value.zOrder !== undefined)
|
|
43778
44220
|
assertOneOf4(value.zOrder, `${fieldName}.zOrder`, PAGE_BORDER_Z_ORDER_VALUES2);
|
|
43779
44221
|
if (value.top !== undefined)
|
|
43780
|
-
|
|
44222
|
+
validateBorderSpec3(value.top, `${fieldName}.top`);
|
|
43781
44223
|
if (value.right !== undefined)
|
|
43782
|
-
|
|
44224
|
+
validateBorderSpec3(value.right, `${fieldName}.right`);
|
|
43783
44225
|
if (value.bottom !== undefined)
|
|
43784
|
-
|
|
44226
|
+
validateBorderSpec3(value.bottom, `${fieldName}.bottom`);
|
|
43785
44227
|
if (value.left !== undefined)
|
|
43786
|
-
|
|
44228
|
+
validateBorderSpec3(value.left, `${fieldName}.left`);
|
|
43787
44229
|
}
|
|
43788
44230
|
function normalizeSectionsListQuery2(query2) {
|
|
43789
44231
|
const limit = query2?.limit ?? DEFAULT_SECTIONS_LIST_LIMIT2;
|
|
@@ -45301,7 +45743,8 @@ function createDocumentApi2(adapters) {
|
|
|
45301
45743
|
return executeTableLocatorOp2("tables.move", adapters.tables.move.bind(adapters.tables), input, options);
|
|
45302
45744
|
},
|
|
45303
45745
|
split(input, options) {
|
|
45304
|
-
|
|
45746
|
+
const normalized = normalizeTablesSplitInput2(input);
|
|
45747
|
+
return executeRowLocatorOp2("tables.split", adapters.tables.split.bind(adapters.tables), normalized, options);
|
|
45305
45748
|
},
|
|
45306
45749
|
convertToText(input, options) {
|
|
45307
45750
|
return executeTableLocatorOp2("tables.convertToText", adapters.tables.convertToText.bind(adapters.tables), input, options);
|
|
@@ -45396,6 +45839,15 @@ function createDocumentApi2(adapters) {
|
|
|
45396
45839
|
clearCellSpacing(input, options) {
|
|
45397
45840
|
return executeTableLocatorOp2("tables.clearCellSpacing", adapters.tables.clearCellSpacing.bind(adapters.tables), input, options);
|
|
45398
45841
|
},
|
|
45842
|
+
applyStyle(input, options) {
|
|
45843
|
+
return executeTablesApplyStyle2("tables.applyStyle", adapters.tables.applyStyle.bind(adapters.tables), input, options);
|
|
45844
|
+
},
|
|
45845
|
+
setBorders(input, options) {
|
|
45846
|
+
return executeTablesSetBorders2("tables.setBorders", adapters.tables.setBorders.bind(adapters.tables), input, options);
|
|
45847
|
+
},
|
|
45848
|
+
setTableOptions(input, options) {
|
|
45849
|
+
return executeTablesSetTableOptions2("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
|
|
45850
|
+
},
|
|
45399
45851
|
get(input) {
|
|
45400
45852
|
return adapters.tables.get(input);
|
|
45401
45853
|
},
|
|
@@ -71241,7 +71693,7 @@ var isRegExp = (value) => {
|
|
|
71241
71693
|
tracked: false,
|
|
71242
71694
|
carrier: runAttributeCarrier2(runPropertyKey ?? key),
|
|
71243
71695
|
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) => ({
|
|
71696
|
+
}), 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
71697
|
handlerName,
|
|
71246
71698
|
handler: (params) => {
|
|
71247
71699
|
const { nodes } = params;
|
|
@@ -85272,7 +85724,7 @@ var isRegExp = (value) => {
|
|
|
85272
85724
|
state.kern = kernNode.attributes["w:val"];
|
|
85273
85725
|
}
|
|
85274
85726
|
}, SuperConverter;
|
|
85275
|
-
var
|
|
85727
|
+
var init_SuperConverter_htgbtdmP_es = __esm(() => {
|
|
85276
85728
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
85277
85729
|
init_jszip_ChlR43oI_es();
|
|
85278
85730
|
init_xml_js_BtmJ6bNs_es();
|
|
@@ -90776,6 +91228,59 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
90776
91228
|
referenceDocPath: "tables/clear-cell-spacing.mdx",
|
|
90777
91229
|
referenceGroup: "tables"
|
|
90778
91230
|
},
|
|
91231
|
+
"tables.applyStyle": {
|
|
91232
|
+
memberPath: "tables.applyStyle",
|
|
91233
|
+
description: "Apply a table style and/or style options in one call.",
|
|
91234
|
+
expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.",
|
|
91235
|
+
requiresDocumentContext: true,
|
|
91236
|
+
metadata: mutationOperation2({
|
|
91237
|
+
idempotency: "conditional",
|
|
91238
|
+
supportsDryRun: true,
|
|
91239
|
+
supportsTrackedMode: false,
|
|
91240
|
+
possibleFailureCodes: [
|
|
91241
|
+
"NO_OP",
|
|
91242
|
+
"INVALID_TARGET",
|
|
91243
|
+
"INVALID_INPUT"
|
|
91244
|
+
],
|
|
91245
|
+
throws: T_NOT_FOUND_COMMAND2
|
|
91246
|
+
}),
|
|
91247
|
+
referenceDocPath: "tables/apply-style.mdx",
|
|
91248
|
+
referenceGroup: "tables"
|
|
91249
|
+
},
|
|
91250
|
+
"tables.setBorders": {
|
|
91251
|
+
memberPath: "tables.setBorders",
|
|
91252
|
+
description: "Set borders on a table using a target set or per-edge patch.",
|
|
91253
|
+
expectedResult: "Returns a TableMutationResult receipt. Does not perform NO_OP detection.",
|
|
91254
|
+
requiresDocumentContext: true,
|
|
91255
|
+
metadata: mutationOperation2({
|
|
91256
|
+
idempotency: "idempotent",
|
|
91257
|
+
supportsDryRun: true,
|
|
91258
|
+
supportsTrackedMode: false,
|
|
91259
|
+
possibleFailureCodes: ["INVALID_TARGET", "INVALID_INPUT"],
|
|
91260
|
+
throws: T_NOT_FOUND_COMMAND2
|
|
91261
|
+
}),
|
|
91262
|
+
referenceDocPath: "tables/set-borders.mdx",
|
|
91263
|
+
referenceGroup: "tables"
|
|
91264
|
+
},
|
|
91265
|
+
"tables.setTableOptions": {
|
|
91266
|
+
memberPath: "tables.setTableOptions",
|
|
91267
|
+
description: "Set table-level default cell margins and/or cell spacing.",
|
|
91268
|
+
expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the provided values already match current direct formatting.",
|
|
91269
|
+
requiresDocumentContext: true,
|
|
91270
|
+
metadata: mutationOperation2({
|
|
91271
|
+
idempotency: "conditional",
|
|
91272
|
+
supportsDryRun: true,
|
|
91273
|
+
supportsTrackedMode: false,
|
|
91274
|
+
possibleFailureCodes: [
|
|
91275
|
+
"NO_OP",
|
|
91276
|
+
"INVALID_TARGET",
|
|
91277
|
+
"INVALID_INPUT"
|
|
91278
|
+
],
|
|
91279
|
+
throws: T_NOT_FOUND_COMMAND2
|
|
91280
|
+
}),
|
|
91281
|
+
referenceDocPath: "tables/set-table-options.mdx",
|
|
91282
|
+
referenceGroup: "tables"
|
|
91283
|
+
},
|
|
90779
91284
|
"tables.get": {
|
|
90780
91285
|
memberPath: "tables.get",
|
|
90781
91286
|
description: "Retrieve table structure and dimensions by locator.",
|
|
@@ -90803,7 +91308,7 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
90803
91308
|
"tables.getProperties": {
|
|
90804
91309
|
memberPath: "tables.getProperties",
|
|
90805
91310
|
description: "Retrieve layout and style properties of a table.",
|
|
90806
|
-
expectedResult: "Returns a TablesGetPropertiesOutput with
|
|
91311
|
+
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
91312
|
requiresDocumentContext: true,
|
|
90808
91313
|
metadata: readOperation2({
|
|
90809
91314
|
idempotency: "idempotent",
|
|
@@ -95128,6 +95633,21 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
95128
95633
|
"planEngine"
|
|
95129
95634
|
]);
|
|
95130
95635
|
objectSchema2({});
|
|
95636
|
+
nullableTableBorderSpecSchema2 = { oneOf: [objectSchema2({
|
|
95637
|
+
lineStyle: { type: "string" },
|
|
95638
|
+
lineWeightPt: {
|
|
95639
|
+
type: "number",
|
|
95640
|
+
exclusiveMinimum: 0
|
|
95641
|
+
},
|
|
95642
|
+
color: {
|
|
95643
|
+
type: "string",
|
|
95644
|
+
pattern: "^([0-9A-Fa-f]{6}|auto)$"
|
|
95645
|
+
}
|
|
95646
|
+
}, [
|
|
95647
|
+
"lineStyle",
|
|
95648
|
+
"lineWeightPt",
|
|
95649
|
+
"color"
|
|
95650
|
+
]), { type: "null" }] };
|
|
95131
95651
|
sdFragmentSchema2 = { oneOf: [{ type: "object" }, {
|
|
95132
95652
|
type: "array",
|
|
95133
95653
|
items: { type: "object" }
|
|
@@ -97257,11 +97777,11 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
97257
97777
|
}, ["destination"]) }, { ...objectSchema2({
|
|
97258
97778
|
target: tableAddressSchema2,
|
|
97259
97779
|
nodeId: { type: "string" },
|
|
97260
|
-
|
|
97780
|
+
rowIndex: {
|
|
97261
97781
|
type: "integer",
|
|
97262
97782
|
minimum: 1
|
|
97263
97783
|
}
|
|
97264
|
-
}, ["
|
|
97784
|
+
}, ["rowIndex"]) }, { ...objectSchema2({
|
|
97265
97785
|
target: tableAddressSchema2,
|
|
97266
97786
|
nodeId: { type: "string" },
|
|
97267
97787
|
delimiter: { enum: [
|
|
@@ -97530,7 +98050,82 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
97530
98050
|
type: "number",
|
|
97531
98051
|
minimum: 0
|
|
97532
98052
|
}
|
|
97533
|
-
}, ["spacingPt"]) }, objectSchema2({
|
|
98053
|
+
}, ["spacingPt"]) }, { ...objectSchema2({
|
|
98054
|
+
target: blockNodeAddressSchema2,
|
|
98055
|
+
nodeId: { type: "string" },
|
|
98056
|
+
styleId: { type: "string" },
|
|
98057
|
+
styleOptions: objectSchema2({
|
|
98058
|
+
headerRow: { type: "boolean" },
|
|
98059
|
+
lastRow: { type: "boolean" },
|
|
98060
|
+
totalRow: { type: "boolean" },
|
|
98061
|
+
firstColumn: { type: "boolean" },
|
|
98062
|
+
lastColumn: { type: "boolean" },
|
|
98063
|
+
bandedRows: { type: "boolean" },
|
|
98064
|
+
bandedColumns: { type: "boolean" }
|
|
98065
|
+
})
|
|
98066
|
+
}) }, { ...objectSchema2({
|
|
98067
|
+
target: blockNodeAddressSchema2,
|
|
98068
|
+
nodeId: { type: "string" },
|
|
98069
|
+
mode: { const: "applyTo" },
|
|
98070
|
+
applyTo: { enum: [
|
|
98071
|
+
"all",
|
|
98072
|
+
"outside",
|
|
98073
|
+
"inside",
|
|
98074
|
+
"top",
|
|
98075
|
+
"bottom",
|
|
98076
|
+
"left",
|
|
98077
|
+
"right",
|
|
98078
|
+
"insideH",
|
|
98079
|
+
"insideV"
|
|
98080
|
+
] },
|
|
98081
|
+
border: nullableTableBorderSpecSchema2
|
|
98082
|
+
}, [
|
|
98083
|
+
"mode",
|
|
98084
|
+
"applyTo",
|
|
98085
|
+
"border"
|
|
98086
|
+
]) }, { ...objectSchema2({
|
|
98087
|
+
target: blockNodeAddressSchema2,
|
|
98088
|
+
nodeId: { type: "string" },
|
|
98089
|
+
mode: { const: "edges" },
|
|
98090
|
+
edges: objectSchema2({
|
|
98091
|
+
top: nullableTableBorderSpecSchema2,
|
|
98092
|
+
bottom: nullableTableBorderSpecSchema2,
|
|
98093
|
+
left: nullableTableBorderSpecSchema2,
|
|
98094
|
+
right: nullableTableBorderSpecSchema2,
|
|
98095
|
+
insideH: nullableTableBorderSpecSchema2,
|
|
98096
|
+
insideV: nullableTableBorderSpecSchema2
|
|
98097
|
+
})
|
|
98098
|
+
}, ["mode", "edges"]) }, { ...objectSchema2({
|
|
98099
|
+
target: blockNodeAddressSchema2,
|
|
98100
|
+
nodeId: { type: "string" },
|
|
98101
|
+
defaultCellMargins: objectSchema2({
|
|
98102
|
+
topPt: {
|
|
98103
|
+
type: "number",
|
|
98104
|
+
minimum: 0
|
|
98105
|
+
},
|
|
98106
|
+
rightPt: {
|
|
98107
|
+
type: "number",
|
|
98108
|
+
minimum: 0
|
|
98109
|
+
},
|
|
98110
|
+
bottomPt: {
|
|
98111
|
+
type: "number",
|
|
98112
|
+
minimum: 0
|
|
98113
|
+
},
|
|
98114
|
+
leftPt: {
|
|
98115
|
+
type: "number",
|
|
98116
|
+
minimum: 0
|
|
98117
|
+
}
|
|
98118
|
+
}, [
|
|
98119
|
+
"topPt",
|
|
98120
|
+
"rightPt",
|
|
98121
|
+
"bottomPt",
|
|
98122
|
+
"leftPt"
|
|
98123
|
+
]),
|
|
98124
|
+
cellSpacingPt: { oneOf: [{
|
|
98125
|
+
type: "number",
|
|
98126
|
+
minimum: 0
|
|
98127
|
+
}, { type: "null" }] }
|
|
98128
|
+
}) }, objectSchema2({
|
|
97534
98129
|
nodeId: { type: "string" },
|
|
97535
98130
|
address: tableAddressSchema2,
|
|
97536
98131
|
rows: {
|
|
@@ -97617,7 +98212,22 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
97617
98212
|
lastColumn: { type: "boolean" },
|
|
97618
98213
|
bandedRows: { type: "boolean" },
|
|
97619
98214
|
bandedColumns: { type: "boolean" }
|
|
97620
|
-
})
|
|
98215
|
+
}),
|
|
98216
|
+
borders: objectSchema2({
|
|
98217
|
+
top: nullableTableBorderSpecSchema2,
|
|
98218
|
+
bottom: nullableTableBorderSpecSchema2,
|
|
98219
|
+
left: nullableTableBorderSpecSchema2,
|
|
98220
|
+
right: nullableTableBorderSpecSchema2,
|
|
98221
|
+
insideH: nullableTableBorderSpecSchema2,
|
|
98222
|
+
insideV: nullableTableBorderSpecSchema2
|
|
98223
|
+
}),
|
|
98224
|
+
defaultCellMargins: objectSchema2({
|
|
98225
|
+
topPt: { type: "number" },
|
|
98226
|
+
rightPt: { type: "number" },
|
|
98227
|
+
bottomPt: { type: "number" },
|
|
98228
|
+
leftPt: { type: "number" }
|
|
98229
|
+
}),
|
|
98230
|
+
cellSpacingPt: { type: "number" }
|
|
97621
98231
|
}, ["nodeId", "address"]), objectSchema2({
|
|
97622
98232
|
explicitDefaultStyleId: { type: ["string", "null"] },
|
|
97623
98233
|
effectiveDefaultStyleId: { type: ["string", "null"] },
|
|
@@ -98915,6 +99525,35 @@ var init_SuperConverter_O12Ha0Iv_es = __esm(() => {
|
|
|
98915
99525
|
SUPPORTED_DELETE_NODE_TYPES2 = new Set(DELETABLE_BLOCK_NODE_TYPES2);
|
|
98916
99526
|
REJECTED_DELETE_NODE_TYPES2 = new Set(["tableRow", "tableCell"]);
|
|
98917
99527
|
VALID_BLOCK_NODE_TYPES2 = new Set(BLOCK_NODE_TYPES2);
|
|
99528
|
+
VALID_STYLE_OPTION_FLAGS2 = new Set([
|
|
99529
|
+
"headerRow",
|
|
99530
|
+
"lastRow",
|
|
99531
|
+
"totalRow",
|
|
99532
|
+
"firstColumn",
|
|
99533
|
+
"lastColumn",
|
|
99534
|
+
"bandedRows",
|
|
99535
|
+
"bandedColumns"
|
|
99536
|
+
]);
|
|
99537
|
+
TABLE_BORDER_COLOR_PATTERN2 = /^([0-9A-Fa-f]{6}|auto)$/u;
|
|
99538
|
+
VALID_APPLY_TO_VALUES2 = new Set([
|
|
99539
|
+
"all",
|
|
99540
|
+
"outside",
|
|
99541
|
+
"inside",
|
|
99542
|
+
"top",
|
|
99543
|
+
"bottom",
|
|
99544
|
+
"left",
|
|
99545
|
+
"right",
|
|
99546
|
+
"insideH",
|
|
99547
|
+
"insideV"
|
|
99548
|
+
]);
|
|
99549
|
+
VALID_BORDER_EDGE_KEYS2 = new Set([
|
|
99550
|
+
"top",
|
|
99551
|
+
"bottom",
|
|
99552
|
+
"left",
|
|
99553
|
+
"right",
|
|
99554
|
+
"insideH",
|
|
99555
|
+
"insideV"
|
|
99556
|
+
]);
|
|
98918
99557
|
HEADER_FOOTER_KINDS$1 = ["header", "footer"];
|
|
98919
99558
|
HEADER_FOOTER_VARIANTS$1 = [
|
|
98920
99559
|
"default",
|
|
@@ -147687,7 +148326,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
147687
148326
|
init_remark_gfm_z_sDF4ss_es();
|
|
147688
148327
|
});
|
|
147689
148328
|
|
|
147690
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
148329
|
+
// ../../packages/superdoc/dist/chunks/src-D2teG0gz.es.js
|
|
147691
148330
|
function deleteProps(obj, propOrProps) {
|
|
147692
148331
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
147693
148332
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -165852,7 +166491,7 @@ function tablesSplitAdapter(editor, input2, options) {
|
|
|
165852
166491
|
rejectTrackedMode("tables.split", options);
|
|
165853
166492
|
const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.split");
|
|
165854
166493
|
const tableNode = candidate.node;
|
|
165855
|
-
if (input2.
|
|
166494
|
+
if (input2.rowIndex <= 0 || input2.rowIndex >= tableNode.childCount)
|
|
165856
166495
|
return toTableFailure("INVALID_TARGET", "Split row index must be between 1 and rowCount-1.");
|
|
165857
166496
|
if (options?.dryRun)
|
|
165858
166497
|
return buildTableSuccess(address2);
|
|
@@ -165861,7 +166500,7 @@ function tablesSplitAdapter(editor, input2, options) {
|
|
|
165861
166500
|
const tablePos = candidate.pos;
|
|
165862
166501
|
const schema = editor.state.schema;
|
|
165863
166502
|
const secondTableRows = [];
|
|
165864
|
-
for (let i4 = input2.
|
|
166503
|
+
for (let i4 = input2.rowIndex;i4 < tableNode.childCount; i4++)
|
|
165865
166504
|
secondTableRows.push(tableNode.child(i4));
|
|
165866
166505
|
let rowPos = tablePos + 1;
|
|
165867
166506
|
const rowPositions = [];
|
|
@@ -165870,7 +166509,7 @@ function tablesSplitAdapter(editor, input2, options) {
|
|
|
165870
166509
|
rowPos += tableNode.child(i4).nodeSize;
|
|
165871
166510
|
}
|
|
165872
166511
|
const mapFrom = tr.mapping.maps.length;
|
|
165873
|
-
for (let i4 = tableNode.childCount - 1;i4 >= input2.
|
|
166512
|
+
for (let i4 = tableNode.childCount - 1;i4 >= input2.rowIndex; i4--) {
|
|
165874
166513
|
const rp = tr.mapping.slice(mapFrom).map(rowPositions[i4]);
|
|
165875
166514
|
const rEnd = tr.mapping.slice(mapFrom).map(rowPositions[i4] + tableNode.child(i4).nodeSize);
|
|
165876
166515
|
tr.delete(rp, rEnd);
|
|
@@ -166937,6 +167576,316 @@ function tablesClearCellSpacingAdapter(editor, input2, options) {
|
|
|
166937
167576
|
return toTableFailure("INVALID_TARGET", "Cell spacing removal could not be applied.");
|
|
166938
167577
|
}
|
|
166939
167578
|
}
|
|
167579
|
+
function readTableLookAsState(tblLook) {
|
|
167580
|
+
if (!tblLook)
|
|
167581
|
+
return;
|
|
167582
|
+
const result = {};
|
|
167583
|
+
let hasAny = false;
|
|
167584
|
+
for (const [xmlKey, apiFlag] of Object.entries(XML_KEY_TO_STYLE_OPTION))
|
|
167585
|
+
if (xmlKey in tblLook && typeof tblLook[xmlKey] === "boolean") {
|
|
167586
|
+
const rawValue = tblLook[xmlKey];
|
|
167587
|
+
result[apiFlag] = INVERTED_FLAGS.has(apiFlag) ? !rawValue : rawValue;
|
|
167588
|
+
hasAny = true;
|
|
167589
|
+
}
|
|
167590
|
+
return hasAny ? result : undefined;
|
|
167591
|
+
}
|
|
167592
|
+
function writeTableLook(currentLook, patch3) {
|
|
167593
|
+
const result = currentLook ? { ...currentLook } : { ...WORD_DEFAULT_TBL_LOOK };
|
|
167594
|
+
for (const [apiFlag, value] of Object.entries(patch3)) {
|
|
167595
|
+
if (value === undefined)
|
|
167596
|
+
continue;
|
|
167597
|
+
const normalizedFlag = apiFlag;
|
|
167598
|
+
const xmlKey = resolveStyleOptionFlag(normalizedFlag);
|
|
167599
|
+
result[xmlKey] = INVERTED_FLAGS.has(normalizedFlag) ? !value : value;
|
|
167600
|
+
}
|
|
167601
|
+
delete result.val;
|
|
167602
|
+
return result;
|
|
167603
|
+
}
|
|
167604
|
+
function normalizeBorderSpecFromApi(spec) {
|
|
167605
|
+
return {
|
|
167606
|
+
val: spec.lineStyle,
|
|
167607
|
+
size: Math.round(spec.lineWeightPt * 8),
|
|
167608
|
+
color: spec.color
|
|
167609
|
+
};
|
|
167610
|
+
}
|
|
167611
|
+
function normalizeBorderSpecToApi(border) {
|
|
167612
|
+
const rawColor = typeof border.color === "string" ? border.color : "auto";
|
|
167613
|
+
const color2 = rawColor === "auto" ? "auto" : rawColor.toUpperCase();
|
|
167614
|
+
return {
|
|
167615
|
+
lineStyle: String(border.val ?? "single"),
|
|
167616
|
+
lineWeightPt: typeof border.size === "number" ? border.size / 8 : 0,
|
|
167617
|
+
color: color2
|
|
167618
|
+
};
|
|
167619
|
+
}
|
|
167620
|
+
function isClearedBorder(border) {
|
|
167621
|
+
return border.val === "none" || border.val === "nil";
|
|
167622
|
+
}
|
|
167623
|
+
function readBorderEdge(border) {
|
|
167624
|
+
if (!border || typeof border !== "object")
|
|
167625
|
+
return;
|
|
167626
|
+
const b$1 = border;
|
|
167627
|
+
if (isClearedBorder(b$1))
|
|
167628
|
+
return null;
|
|
167629
|
+
return normalizeBorderSpecToApi(b$1);
|
|
167630
|
+
}
|
|
167631
|
+
function readBordersAsState(borders) {
|
|
167632
|
+
if (!borders || typeof borders !== "object")
|
|
167633
|
+
return;
|
|
167634
|
+
const b$1 = borders;
|
|
167635
|
+
const result = {};
|
|
167636
|
+
let hasAny = false;
|
|
167637
|
+
for (const edge of [
|
|
167638
|
+
"top",
|
|
167639
|
+
"bottom",
|
|
167640
|
+
"left",
|
|
167641
|
+
"right",
|
|
167642
|
+
"insideH",
|
|
167643
|
+
"insideV"
|
|
167644
|
+
])
|
|
167645
|
+
if (edge in b$1) {
|
|
167646
|
+
const value = readBorderEdge(b$1[edge]);
|
|
167647
|
+
if (value !== undefined) {
|
|
167648
|
+
result[edge] = value;
|
|
167649
|
+
hasAny = true;
|
|
167650
|
+
}
|
|
167651
|
+
}
|
|
167652
|
+
return hasAny ? result : undefined;
|
|
167653
|
+
}
|
|
167654
|
+
function readCellMarginEntry(cellMargins, keys$1) {
|
|
167655
|
+
for (const key$1 of keys$1) {
|
|
167656
|
+
const entry = cellMargins[key$1];
|
|
167657
|
+
if (entry && typeof entry.value === "number")
|
|
167658
|
+
return entry;
|
|
167659
|
+
}
|
|
167660
|
+
}
|
|
167661
|
+
function readCellMarginsAsState(cellMargins) {
|
|
167662
|
+
if (!cellMargins || typeof cellMargins !== "object")
|
|
167663
|
+
return;
|
|
167664
|
+
const cm = cellMargins;
|
|
167665
|
+
const result = {};
|
|
167666
|
+
let hasAny = false;
|
|
167667
|
+
for (const { keys: keys$1, apiKey } of TABLE_MARGIN_KEY_GROUPS) {
|
|
167668
|
+
const entry = readCellMarginEntry(cm, keys$1);
|
|
167669
|
+
if (entry && typeof entry.value === "number") {
|
|
167670
|
+
result[apiKey] = entry.value / POINTS_TO_TWIPS;
|
|
167671
|
+
hasAny = true;
|
|
167672
|
+
}
|
|
167673
|
+
}
|
|
167674
|
+
return hasAny ? result : undefined;
|
|
167675
|
+
}
|
|
167676
|
+
function readCellSpacingPt(spacing) {
|
|
167677
|
+
if (!spacing || typeof spacing !== "object")
|
|
167678
|
+
return;
|
|
167679
|
+
const s2 = spacing;
|
|
167680
|
+
if (typeof s2.value !== "number")
|
|
167681
|
+
return;
|
|
167682
|
+
return s2.value / POINTS_TO_TWIPS;
|
|
167683
|
+
}
|
|
167684
|
+
function expandApplyToEdges(applyTo) {
|
|
167685
|
+
switch (applyTo) {
|
|
167686
|
+
case "all":
|
|
167687
|
+
return [
|
|
167688
|
+
"top",
|
|
167689
|
+
"bottom",
|
|
167690
|
+
"left",
|
|
167691
|
+
"right",
|
|
167692
|
+
"insideH",
|
|
167693
|
+
"insideV"
|
|
167694
|
+
];
|
|
167695
|
+
case "outside":
|
|
167696
|
+
return [
|
|
167697
|
+
"top",
|
|
167698
|
+
"bottom",
|
|
167699
|
+
"left",
|
|
167700
|
+
"right"
|
|
167701
|
+
];
|
|
167702
|
+
case "inside":
|
|
167703
|
+
return ["insideH", "insideV"];
|
|
167704
|
+
default:
|
|
167705
|
+
return [applyTo];
|
|
167706
|
+
}
|
|
167707
|
+
}
|
|
167708
|
+
function buildOoxmlBorderPatch(currentBorders, edgePatch) {
|
|
167709
|
+
const result = { ...currentBorders };
|
|
167710
|
+
const edges = Object.entries(edgePatch);
|
|
167711
|
+
for (const [edge, value] of edges) {
|
|
167712
|
+
if (value === undefined)
|
|
167713
|
+
continue;
|
|
167714
|
+
result[edge] = value === null ? { ...CLEARED_BORDER_OOXML } : normalizeBorderSpecFromApi(value);
|
|
167715
|
+
}
|
|
167716
|
+
return result;
|
|
167717
|
+
}
|
|
167718
|
+
function isStylePatchSatisfied(currentTableProps, input2) {
|
|
167719
|
+
if (input2.styleId !== undefined) {
|
|
167720
|
+
if (currentTableProps.tableStyleId !== input2.styleId)
|
|
167721
|
+
return false;
|
|
167722
|
+
}
|
|
167723
|
+
if (input2.styleOptions) {
|
|
167724
|
+
const currentLook = currentTableProps.tblLook ?? {};
|
|
167725
|
+
for (const [apiFlag, value] of Object.entries(input2.styleOptions)) {
|
|
167726
|
+
if (value === undefined)
|
|
167727
|
+
continue;
|
|
167728
|
+
const normalizedFlag = apiFlag;
|
|
167729
|
+
const xmlKey = resolveStyleOptionFlag(normalizedFlag);
|
|
167730
|
+
const expectedXmlValue = INVERTED_FLAGS.has(normalizedFlag) ? !value : value;
|
|
167731
|
+
if (!(xmlKey in currentLook) || currentLook[xmlKey] !== expectedXmlValue)
|
|
167732
|
+
return false;
|
|
167733
|
+
}
|
|
167734
|
+
}
|
|
167735
|
+
return true;
|
|
167736
|
+
}
|
|
167737
|
+
function isTableOptionsSatisfied(currentTableProps, input2) {
|
|
167738
|
+
if (input2.defaultCellMargins !== undefined) {
|
|
167739
|
+
const cm = currentTableProps.cellMargins;
|
|
167740
|
+
if (!cm)
|
|
167741
|
+
return false;
|
|
167742
|
+
const m$1 = input2.defaultCellMargins;
|
|
167743
|
+
const pairs = [
|
|
167744
|
+
[["marginTop"], m$1.topPt],
|
|
167745
|
+
[["marginRight", "marginEnd"], m$1.rightPt],
|
|
167746
|
+
[["marginBottom"], m$1.bottomPt],
|
|
167747
|
+
[["marginLeft", "marginStart"], m$1.leftPt]
|
|
167748
|
+
];
|
|
167749
|
+
for (const [ooxmlKeys, ptValue] of pairs) {
|
|
167750
|
+
const entry = readCellMarginEntry(cm, ooxmlKeys);
|
|
167751
|
+
if (!entry || entry.value !== Math.round(ptValue * POINTS_TO_TWIPS))
|
|
167752
|
+
return false;
|
|
167753
|
+
}
|
|
167754
|
+
}
|
|
167755
|
+
if (input2.cellSpacingPt !== undefined) {
|
|
167756
|
+
const spacing = currentTableProps.tableCellSpacing;
|
|
167757
|
+
if (input2.cellSpacingPt === null) {
|
|
167758
|
+
if (spacing !== undefined && spacing !== null)
|
|
167759
|
+
return false;
|
|
167760
|
+
} else if (!spacing || spacing.value !== Math.round(input2.cellSpacingPt * POINTS_TO_TWIPS))
|
|
167761
|
+
return false;
|
|
167762
|
+
}
|
|
167763
|
+
return true;
|
|
167764
|
+
}
|
|
167765
|
+
function tablesApplyStyleAdapter(editor, input2, options) {
|
|
167766
|
+
rejectTrackedMode("tables.applyStyle", options);
|
|
167767
|
+
const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.applyStyle");
|
|
167768
|
+
if (options?.dryRun)
|
|
167769
|
+
return buildTableSuccess(address2);
|
|
167770
|
+
try {
|
|
167771
|
+
const currentAttrs = candidate.node.attrs;
|
|
167772
|
+
const currentTableProps = currentAttrs.tableProperties ?? {};
|
|
167773
|
+
if (isStylePatchSatisfied(currentTableProps, input2))
|
|
167774
|
+
return toTableFailure("NO_OP", "tables.applyStyle did not produce a change.");
|
|
167775
|
+
const updatedTableProps = { ...currentTableProps };
|
|
167776
|
+
if (input2.styleId !== undefined)
|
|
167777
|
+
updatedTableProps.tableStyleId = input2.styleId;
|
|
167778
|
+
if (input2.styleOptions)
|
|
167779
|
+
updatedTableProps.tblLook = writeTableLook(asRecord2(updatedTableProps.tblLook), input2.styleOptions);
|
|
167780
|
+
const tr = editor.state.tr;
|
|
167781
|
+
tr.setNodeMarkup(candidate.pos, null, {
|
|
167782
|
+
...currentAttrs,
|
|
167783
|
+
tableProperties: updatedTableProps,
|
|
167784
|
+
...syncExtractedTableAttrs(updatedTableProps)
|
|
167785
|
+
});
|
|
167786
|
+
applyDirectMutationMeta(tr);
|
|
167787
|
+
editor.dispatch(tr);
|
|
167788
|
+
clearIndexCache(editor);
|
|
167789
|
+
return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
|
|
167790
|
+
} catch {
|
|
167791
|
+
return toTableFailure("INVALID_TARGET", "Table style application could not be applied.");
|
|
167792
|
+
}
|
|
167793
|
+
}
|
|
167794
|
+
function tablesSetBordersAdapter(editor, input2, options) {
|
|
167795
|
+
rejectTrackedMode("tables.setBorders", options);
|
|
167796
|
+
const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.setBorders");
|
|
167797
|
+
if (options?.dryRun)
|
|
167798
|
+
return buildTableSuccess(address2);
|
|
167799
|
+
try {
|
|
167800
|
+
let edgePatch;
|
|
167801
|
+
if (input2.mode === "applyTo") {
|
|
167802
|
+
const edges = expandApplyToEdges(input2.applyTo);
|
|
167803
|
+
edgePatch = {};
|
|
167804
|
+
for (const edge of edges)
|
|
167805
|
+
edgePatch[edge] = input2.border;
|
|
167806
|
+
} else
|
|
167807
|
+
edgePatch = input2.edges;
|
|
167808
|
+
const tr = editor.state.tr;
|
|
167809
|
+
const currentAttrs = candidate.node.attrs;
|
|
167810
|
+
const currentTableProps = { ...currentAttrs.tableProperties ?? {} };
|
|
167811
|
+
currentTableProps.borders = buildOoxmlBorderPatch(currentTableProps.borders ?? {}, edgePatch);
|
|
167812
|
+
tr.setNodeMarkup(candidate.pos, null, {
|
|
167813
|
+
...currentAttrs,
|
|
167814
|
+
tableProperties: currentTableProps,
|
|
167815
|
+
...syncExtractedTableAttrs(currentTableProps)
|
|
167816
|
+
});
|
|
167817
|
+
const patchEntries = Object.entries(edgePatch);
|
|
167818
|
+
for (const [edge, value] of patchEntries) {
|
|
167819
|
+
if (value === undefined)
|
|
167820
|
+
continue;
|
|
167821
|
+
if (!isBoundaryEdge(edge))
|
|
167822
|
+
continue;
|
|
167823
|
+
const ooxmlSpec = value === null ? { ...CLEARED_BORDER_OOXML } : normalizeBorderSpecFromApi(value);
|
|
167824
|
+
applyTableEdgeToCellBorders(tr, candidate.pos, candidate.node, edge, ooxmlSpec);
|
|
167825
|
+
}
|
|
167826
|
+
applyDirectMutationMeta(tr);
|
|
167827
|
+
editor.dispatch(tr);
|
|
167828
|
+
clearIndexCache(editor);
|
|
167829
|
+
return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
|
|
167830
|
+
} catch {
|
|
167831
|
+
return toTableFailure("INVALID_TARGET", "Table border update could not be applied.");
|
|
167832
|
+
}
|
|
167833
|
+
}
|
|
167834
|
+
function tablesSetTableOptionsAdapter(editor, input2, options) {
|
|
167835
|
+
rejectTrackedMode("tables.setTableOptions", options);
|
|
167836
|
+
const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.setTableOptions");
|
|
167837
|
+
if (options?.dryRun)
|
|
167838
|
+
return buildTableSuccess(address2);
|
|
167839
|
+
try {
|
|
167840
|
+
const currentAttrs = candidate.node.attrs;
|
|
167841
|
+
const currentTableProps = currentAttrs.tableProperties ?? {};
|
|
167842
|
+
if (isTableOptionsSatisfied(currentTableProps, input2))
|
|
167843
|
+
return toTableFailure("NO_OP", "tables.setTableOptions did not produce a change.");
|
|
167844
|
+
const updatedTableProps = { ...currentTableProps };
|
|
167845
|
+
if (input2.defaultCellMargins !== undefined) {
|
|
167846
|
+
const m$1 = input2.defaultCellMargins;
|
|
167847
|
+
updatedTableProps.cellMargins = {
|
|
167848
|
+
marginTop: {
|
|
167849
|
+
value: Math.round(m$1.topPt * POINTS_TO_TWIPS),
|
|
167850
|
+
type: "dxa"
|
|
167851
|
+
},
|
|
167852
|
+
marginRight: {
|
|
167853
|
+
value: Math.round(m$1.rightPt * POINTS_TO_TWIPS),
|
|
167854
|
+
type: "dxa"
|
|
167855
|
+
},
|
|
167856
|
+
marginBottom: {
|
|
167857
|
+
value: Math.round(m$1.bottomPt * POINTS_TO_TWIPS),
|
|
167858
|
+
type: "dxa"
|
|
167859
|
+
},
|
|
167860
|
+
marginLeft: {
|
|
167861
|
+
value: Math.round(m$1.leftPt * POINTS_TO_TWIPS),
|
|
167862
|
+
type: "dxa"
|
|
167863
|
+
}
|
|
167864
|
+
};
|
|
167865
|
+
}
|
|
167866
|
+
if (input2.cellSpacingPt !== undefined)
|
|
167867
|
+
if (input2.cellSpacingPt === null) {
|
|
167868
|
+
delete updatedTableProps.tableCellSpacing;
|
|
167869
|
+
delete updatedTableProps.tblCellSpacing;
|
|
167870
|
+
} else
|
|
167871
|
+
updatedTableProps.tableCellSpacing = {
|
|
167872
|
+
value: Math.round(input2.cellSpacingPt * POINTS_TO_TWIPS),
|
|
167873
|
+
type: "dxa"
|
|
167874
|
+
};
|
|
167875
|
+
const tr = editor.state.tr;
|
|
167876
|
+
tr.setNodeMarkup(candidate.pos, null, {
|
|
167877
|
+
...currentAttrs,
|
|
167878
|
+
tableProperties: updatedTableProps,
|
|
167879
|
+
...syncExtractedTableAttrs(updatedTableProps)
|
|
167880
|
+
});
|
|
167881
|
+
applyDirectMutationMeta(tr);
|
|
167882
|
+
editor.dispatch(tr);
|
|
167883
|
+
clearIndexCache(editor);
|
|
167884
|
+
return buildTableSuccess(resolvePostMutationTableAddress(editor, candidate.pos, address2.nodeId, tr));
|
|
167885
|
+
} catch {
|
|
167886
|
+
return toTableFailure("INVALID_TARGET", "Table options could not be applied.");
|
|
167887
|
+
}
|
|
167888
|
+
}
|
|
166940
167889
|
function resolveCreatedTable(editor, tableId) {
|
|
166941
167890
|
const index2 = getBlockIndex(editor);
|
|
166942
167891
|
const resolved = index2.byId.get(`table:${tableId}`);
|
|
@@ -167165,16 +168114,18 @@ function tablesGetPropertiesAdapter(editor, input2) {
|
|
|
167165
168114
|
if (preferredWidth != null)
|
|
167166
168115
|
result.preferredWidth = preferredWidth;
|
|
167167
168116
|
}
|
|
167168
|
-
const
|
|
167169
|
-
if (
|
|
167170
|
-
result.styleOptions =
|
|
167171
|
-
|
|
167172
|
-
|
|
167173
|
-
|
|
167174
|
-
|
|
167175
|
-
|
|
167176
|
-
|
|
167177
|
-
|
|
168117
|
+
const styleOptions = readTableLookAsState(resolveTableLook(tp));
|
|
168118
|
+
if (styleOptions)
|
|
168119
|
+
result.styleOptions = styleOptions;
|
|
168120
|
+
const borders = readBordersAsState(tp.borders);
|
|
168121
|
+
if (borders)
|
|
168122
|
+
result.borders = borders;
|
|
168123
|
+
const defaultCellMargins = readCellMarginsAsState(tp.cellMargins);
|
|
168124
|
+
if (defaultCellMargins)
|
|
168125
|
+
result.defaultCellMargins = defaultCellMargins;
|
|
168126
|
+
const cellSpacingPt = readCellSpacingPt(tp.tableCellSpacing);
|
|
168127
|
+
if (cellSpacingPt !== undefined)
|
|
168128
|
+
result.cellSpacingPt = cellSpacingPt;
|
|
167178
168129
|
return result;
|
|
167179
168130
|
}
|
|
167180
168131
|
function getConverterForStyles(editor) {
|
|
@@ -168659,6 +169610,15 @@ function tablesSetCellSpacingWrapper(editor, input2, options) {
|
|
|
168659
169610
|
function tablesClearCellSpacingWrapper(editor, input2, options) {
|
|
168660
169611
|
return executeTableCommand(editor, "tables.clearCellSpacing", tablesClearCellSpacingAdapter, input2, options);
|
|
168661
169612
|
}
|
|
169613
|
+
function tablesApplyStyleWrapper(editor, input2, options) {
|
|
169614
|
+
return executeTableCommand(editor, "tables.applyStyle", tablesApplyStyleAdapter, input2, options);
|
|
169615
|
+
}
|
|
169616
|
+
function tablesSetBordersWrapper(editor, input2, options) {
|
|
169617
|
+
return executeTableCommand(editor, "tables.setBorders", tablesSetBordersAdapter, input2, options);
|
|
169618
|
+
}
|
|
169619
|
+
function tablesSetTableOptionsWrapper(editor, input2, options) {
|
|
169620
|
+
return executeTableCommand(editor, "tables.setTableOptions", tablesSetTableOptionsAdapter, input2, options);
|
|
169621
|
+
}
|
|
168662
169622
|
function isCollabHistory(editor) {
|
|
168663
169623
|
return Boolean(editor.options.collaborationProvider && editor.options.ydoc);
|
|
168664
169624
|
}
|
|
@@ -179131,6 +180091,9 @@ function assembleDocumentApiAdapters(editor) {
|
|
|
179131
180091
|
setCellPadding: (input2, options) => tablesSetCellPaddingWrapper(editor, input2, options),
|
|
179132
180092
|
setCellSpacing: (input2, options) => tablesSetCellSpacingWrapper(editor, input2, options),
|
|
179133
180093
|
clearCellSpacing: (input2, options) => tablesClearCellSpacingWrapper(editor, input2, options),
|
|
180094
|
+
applyStyle: (input2, options) => tablesApplyStyleWrapper(editor, input2, options),
|
|
180095
|
+
setBorders: (input2, options) => tablesSetBordersWrapper(editor, input2, options),
|
|
180096
|
+
setTableOptions: (input2, options) => tablesSetTableOptionsWrapper(editor, input2, options),
|
|
179134
180097
|
get: (input2) => tablesGetAdapter(editor, input2),
|
|
179135
180098
|
getCells: (input2) => tablesGetCellsAdapter(editor, input2),
|
|
179136
180099
|
getProperties: (input2) => tablesGetPropertiesAdapter(editor, input2),
|
|
@@ -208478,7 +209441,7 @@ var Node$13 = class Node$14 {
|
|
|
208478
209441
|
return;
|
|
208479
209442
|
const candidate = run2.pmEnd;
|
|
208480
209443
|
return typeof candidate === "number" ? candidate : undefined;
|
|
208481
|
-
}, 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) => {
|
|
209444
|
+
}, 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) => {
|
|
208482
209445
|
if (!path2.includes(".")) {
|
|
208483
209446
|
target[path2] = value;
|
|
208484
209447
|
return;
|
|
@@ -227508,9 +228471,9 @@ var Node$13 = class Node$14 {
|
|
|
227508
228471
|
return false;
|
|
227509
228472
|
return Boolean(checker(attrs));
|
|
227510
228473
|
}, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
|
|
227511
|
-
var
|
|
228474
|
+
var init_src_D2teG0gz_es = __esm(() => {
|
|
227512
228475
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
227513
|
-
|
|
228476
|
+
init_SuperConverter_htgbtdmP_es();
|
|
227514
228477
|
init_jszip_ChlR43oI_es();
|
|
227515
228478
|
init_uuid_qzgm05fK_es();
|
|
227516
228479
|
init_constants_ep1_Gwqi_es();
|
|
@@ -235476,6 +236439,37 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
235476
236439
|
bandedColumns: "noVBand"
|
|
235477
236440
|
};
|
|
235478
236441
|
INVERTED_FLAGS = new Set(["bandedRows", "bandedColumns"]);
|
|
236442
|
+
XML_KEY_TO_STYLE_OPTION = {
|
|
236443
|
+
firstRow: "headerRow",
|
|
236444
|
+
lastRow: "lastRow",
|
|
236445
|
+
firstColumn: "firstColumn",
|
|
236446
|
+
lastColumn: "lastColumn",
|
|
236447
|
+
noHBand: "bandedRows",
|
|
236448
|
+
noVBand: "bandedColumns"
|
|
236449
|
+
};
|
|
236450
|
+
CLEARED_BORDER_OOXML = {
|
|
236451
|
+
val: "none",
|
|
236452
|
+
size: 0,
|
|
236453
|
+
color: "auto"
|
|
236454
|
+
};
|
|
236455
|
+
TABLE_MARGIN_KEY_GROUPS = [
|
|
236456
|
+
{
|
|
236457
|
+
keys: ["marginTop"],
|
|
236458
|
+
apiKey: "topPt"
|
|
236459
|
+
},
|
|
236460
|
+
{
|
|
236461
|
+
keys: ["marginRight", "marginEnd"],
|
|
236462
|
+
apiKey: "rightPt"
|
|
236463
|
+
},
|
|
236464
|
+
{
|
|
236465
|
+
keys: ["marginBottom"],
|
|
236466
|
+
apiKey: "bottomPt"
|
|
236467
|
+
},
|
|
236468
|
+
{
|
|
236469
|
+
keys: ["marginLeft", "marginStart"],
|
|
236470
|
+
apiKey: "leftPt"
|
|
236471
|
+
}
|
|
236472
|
+
];
|
|
235479
236473
|
TABLE_ADAPTER_DISPATCH = {
|
|
235480
236474
|
"tables.delete": (e, i4, o) => tablesDeleteAdapter(e, i4, o),
|
|
235481
236475
|
"tables.clearContents": (e, i4, o) => tablesClearContentsAdapter(e, i4, o),
|
|
@@ -260782,8 +261776,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
260782
261776
|
|
|
260783
261777
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
260784
261778
|
var init_super_editor_es = __esm(() => {
|
|
260785
|
-
|
|
260786
|
-
|
|
261779
|
+
init_src_D2teG0gz_es();
|
|
261780
|
+
init_SuperConverter_htgbtdmP_es();
|
|
260787
261781
|
init_jszip_ChlR43oI_es();
|
|
260788
261782
|
init_xml_js_BtmJ6bNs_es();
|
|
260789
261783
|
init_constants_ep1_Gwqi_es();
|
|
@@ -317442,7 +318436,7 @@ function buildAllMetadata() {
|
|
|
317442
318436
|
return [operationId, metadata];
|
|
317443
318437
|
}));
|
|
317444
318438
|
}
|
|
317445
|
-
function deriveOptionSpecs(params4) {
|
|
318439
|
+
function deriveOptionSpecs(operationId, params4) {
|
|
317446
318440
|
const specs = [];
|
|
317447
318441
|
for (const param of params4) {
|
|
317448
318442
|
if (param.kind === "doc" && param.name !== "doc")
|
|
@@ -317453,9 +318447,17 @@ function deriveOptionSpecs(params4) {
|
|
|
317453
318447
|
type: optionType
|
|
317454
318448
|
});
|
|
317455
318449
|
}
|
|
318450
|
+
const aliases = OPTION_FLAG_ALIASES[operationId];
|
|
318451
|
+
if (aliases) {
|
|
318452
|
+
for (const spec of specs) {
|
|
318453
|
+
if (aliases[spec.name]) {
|
|
318454
|
+
spec.aliases = aliases[spec.name];
|
|
318455
|
+
}
|
|
318456
|
+
}
|
|
318457
|
+
}
|
|
317456
318458
|
return specs;
|
|
317457
318459
|
}
|
|
317458
|
-
var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, INSERT_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, CLI_OPERATION_OPTION_SPECS;
|
|
318460
|
+
var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, INSERT_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, OPTION_FLAG_ALIASES, CLI_OPERATION_OPTION_SPECS;
|
|
317459
318461
|
var init_operation_params = __esm(() => {
|
|
317460
318462
|
init_src();
|
|
317461
318463
|
init_operation_set();
|
|
@@ -317744,7 +318746,13 @@ var init_operation_params = __esm(() => {
|
|
|
317744
318746
|
}
|
|
317745
318747
|
};
|
|
317746
318748
|
CLI_OPERATION_METADATA = buildAllMetadata();
|
|
317747
|
-
|
|
318749
|
+
OPTION_FLAG_ALIASES = {
|
|
318750
|
+
"doc.tables.split": { "row-index": ["at-row-index"] }
|
|
318751
|
+
};
|
|
318752
|
+
CLI_OPERATION_OPTION_SPECS = Object.fromEntries(CLI_OPERATION_IDS.map((operationId) => [
|
|
318753
|
+
operationId,
|
|
318754
|
+
deriveOptionSpecs(operationId, CLI_OPERATION_METADATA[operationId].params)
|
|
318755
|
+
]));
|
|
317748
318756
|
});
|
|
317749
318757
|
|
|
317750
318758
|
// src/cli/response-schemas.ts
|
|
@@ -319812,6 +320820,13 @@ async function preflightCallContext(operationId, input2, context) {
|
|
|
319812
320820
|
throw new CliError("NO_ACTIVE_DOCUMENT", `call: ${operationId} requires an active session or input.sessionId.`);
|
|
319813
320821
|
}
|
|
319814
320822
|
}
|
|
320823
|
+
function normalizeLegacyInput(operationId, input2) {
|
|
320824
|
+
if (operationId === "doc.tables.split" && input2.atRowIndex !== undefined) {
|
|
320825
|
+
const { atRowIndex, ...rest } = input2;
|
|
320826
|
+
return rest.rowIndex !== undefined ? rest : { ...rest, rowIndex: atRowIndex };
|
|
320827
|
+
}
|
|
320828
|
+
return input2;
|
|
320829
|
+
}
|
|
319815
320830
|
async function executeOperation(request) {
|
|
319816
320831
|
let input2;
|
|
319817
320832
|
const baseContext = request.context;
|
|
@@ -319836,6 +320851,7 @@ async function executeOperation(request) {
|
|
|
319836
320851
|
}
|
|
319837
320852
|
input2 = pruneUndefinedDeep(request.input) ?? {};
|
|
319838
320853
|
}
|
|
320854
|
+
input2 = normalizeLegacyInput(request.operationId, input2);
|
|
319839
320855
|
validateOperationInputData(request.operationId, input2, commandName);
|
|
319840
320856
|
await preflightCallContext(request.operationId, input2, baseContext);
|
|
319841
320857
|
const effectiveContext = applySessionInputToContext(baseContext, input2);
|