@superdoc-dev/cli 0.8.0-next.37 → 0.8.0-next.39
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 +738 -200
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -8401,7 +8401,7 @@ function buildInternalContractSchemas() {
|
|
|
8401
8401
|
operations
|
|
8402
8402
|
};
|
|
8403
8403
|
}
|
|
8404
|
-
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, storyLocatorSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, 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;
|
|
8404
|
+
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, storyLocatorSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, 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, refListQueryProperties, 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;
|
|
8405
8405
|
var init_schemas = __esm(() => {
|
|
8406
8406
|
init_command_catalog();
|
|
8407
8407
|
init_types2();
|
|
@@ -8455,7 +8455,8 @@ var init_schemas = __esm(() => {
|
|
|
8455
8455
|
}, ["blockId", "range"]),
|
|
8456
8456
|
TextTarget: objectSchema({
|
|
8457
8457
|
kind: { const: "text" },
|
|
8458
|
-
segments: { type: "array", items: ref("TextSegment"), minItems: 1 }
|
|
8458
|
+
segments: { type: "array", items: ref("TextSegment"), minItems: 1 },
|
|
8459
|
+
story: ref("StoryLocator")
|
|
8459
8460
|
}, ["kind", "segments"]),
|
|
8460
8461
|
SelectionEdgeNodeAddress: objectSchema({
|
|
8461
8462
|
kind: { const: "block" },
|
|
@@ -9478,10 +9479,11 @@ var init_schemas = __esm(() => {
|
|
|
9478
9479
|
}, ["success", "failure"]);
|
|
9479
9480
|
ccListResultSchema = objectSchema({ items: { type: "array", items: { type: "object" } }, total: { type: "integer" } }, ["items", "total"]);
|
|
9480
9481
|
ccInfoSchema = { type: "object", description: "ContentControlInfo" };
|
|
9481
|
-
|
|
9482
|
+
refListQueryProperties = {
|
|
9482
9483
|
limit: { type: "integer", minimum: 1 },
|
|
9483
9484
|
offset: { type: "integer", minimum: 0 }
|
|
9484
|
-
}
|
|
9485
|
+
};
|
|
9486
|
+
refListQuerySchema = objectSchema(refListQueryProperties);
|
|
9485
9487
|
discoveryOutputSchema = { type: "object" };
|
|
9486
9488
|
receiptFailureSchema = objectSchema({
|
|
9487
9489
|
code: { type: "string" },
|
|
@@ -9492,7 +9494,12 @@ var init_schemas = __esm(() => {
|
|
|
9492
9494
|
"success",
|
|
9493
9495
|
"failure"
|
|
9494
9496
|
]);
|
|
9495
|
-
bookmarkAddressSchema = objectSchema({
|
|
9497
|
+
bookmarkAddressSchema = objectSchema({
|
|
9498
|
+
kind: { const: "entity" },
|
|
9499
|
+
entityType: { const: "bookmark" },
|
|
9500
|
+
name: { type: "string" },
|
|
9501
|
+
story: ref("StoryLocator")
|
|
9502
|
+
}, ["kind", "entityType", "name"]);
|
|
9496
9503
|
bookmarkMutation = refMutationSchemas({ bookmark: bookmarkAddressSchema }, ["bookmark"]);
|
|
9497
9504
|
footnoteAddressSchema = objectSchema({ kind: { const: "entity" }, entityType: { const: "footnote" }, noteId: { type: "string" } }, ["kind", "entityType", "noteId"]);
|
|
9498
9505
|
footnoteConfigScopeSchema = {
|
|
@@ -12860,7 +12867,10 @@ var init_schemas = __esm(() => {
|
|
|
12860
12867
|
},
|
|
12861
12868
|
...buildContentControlSchemas(),
|
|
12862
12869
|
"bookmarks.list": {
|
|
12863
|
-
input:
|
|
12870
|
+
input: objectSchema({
|
|
12871
|
+
...refListQueryProperties,
|
|
12872
|
+
in: storyLocatorSchema
|
|
12873
|
+
}),
|
|
12864
12874
|
output: discoveryOutputSchema
|
|
12865
12875
|
},
|
|
12866
12876
|
"bookmarks.get": {
|
|
@@ -17987,8 +17997,14 @@ function validateBookmarkTarget(target, operationName) {
|
|
|
17987
17997
|
if (t.kind !== "entity" || t.entityType !== "bookmark" || typeof t.name !== "string") {
|
|
17988
17998
|
throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} target must be a BookmarkAddress with kind 'entity', entityType 'bookmark', and a string name.`, { target });
|
|
17989
17999
|
}
|
|
18000
|
+
if (t.story !== undefined) {
|
|
18001
|
+
validateStoryLocator(t.story, `${operationName}.target.story`);
|
|
18002
|
+
}
|
|
17990
18003
|
}
|
|
17991
18004
|
function executeBookmarksList(adapter, query2) {
|
|
18005
|
+
if (query2?.in !== undefined) {
|
|
18006
|
+
validateStoryLocator(query2.in, "bookmarks.list.in");
|
|
18007
|
+
}
|
|
17992
18008
|
return adapter.list(query2);
|
|
17993
18009
|
}
|
|
17994
18010
|
function executeBookmarksGet(adapter, input) {
|
|
@@ -18015,6 +18031,7 @@ function executeBookmarksRemove(adapter, input, options) {
|
|
|
18015
18031
|
var init_bookmarks = __esm(() => {
|
|
18016
18032
|
init_errors2();
|
|
18017
18033
|
init_validation_primitives();
|
|
18034
|
+
init_story_validator();
|
|
18018
18035
|
});
|
|
18019
18036
|
|
|
18020
18037
|
// ../../packages/document-api/src/protection/protection.ts
|
|
@@ -65806,7 +65823,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
65806
65823
|
emptyOptions2 = {};
|
|
65807
65824
|
});
|
|
65808
65825
|
|
|
65809
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
65826
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DklB-kc9.es.js
|
|
65810
65827
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
65811
65828
|
const fieldValue = extension$1.config[field];
|
|
65812
65829
|
if (typeof fieldValue === "function")
|
|
@@ -72136,8 +72153,12 @@ function validateBookmarkTarget2(target, operationName) {
|
|
|
72136
72153
|
const t = target;
|
|
72137
72154
|
if (t.kind !== "entity" || t.entityType !== "bookmark" || typeof t.name !== "string")
|
|
72138
72155
|
throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} target must be a BookmarkAddress with kind 'entity', entityType 'bookmark', and a string name.`, { target });
|
|
72156
|
+
if (t.story !== undefined)
|
|
72157
|
+
validateStoryLocator2(t.story, `${operationName}.target.story`);
|
|
72139
72158
|
}
|
|
72140
72159
|
function executeBookmarksList2(adapter, query2) {
|
|
72160
|
+
if (query2?.in !== undefined)
|
|
72161
|
+
validateStoryLocator2(query2.in, "bookmarks.list.in");
|
|
72141
72162
|
return adapter.list(query2);
|
|
72142
72163
|
}
|
|
72143
72164
|
function executeBookmarksGet2(adapter, input) {
|
|
@@ -103720,7 +103741,7 @@ var isRegExp = (value) => {
|
|
|
103720
103741
|
tracked: false,
|
|
103721
103742
|
carrier: runAttributeCarrier2(runPropertyKey ?? key),
|
|
103722
103743
|
schema
|
|
103723
|
-
}), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, 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, trackChangeWordRevisionIdsSchema2, 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, SELECTION_CURRENT_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, 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, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$217) => ({
|
|
103744
|
+
}), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, 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, trackChangeWordRevisionIdsSchema2, 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, refListQueryProperties2, 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, SELECTION_CURRENT_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, 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, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$217) => ({
|
|
103724
103745
|
handlerName,
|
|
103725
103746
|
handler: (params3) => {
|
|
103726
103747
|
const { nodes } = params3;
|
|
@@ -118267,7 +118288,7 @@ var isRegExp = (value) => {
|
|
|
118267
118288
|
state.kern = kernNode.attributes["w:val"];
|
|
118268
118289
|
}
|
|
118269
118290
|
}, SuperConverter;
|
|
118270
|
-
var
|
|
118291
|
+
var init_SuperConverter_DklB_kc9_es = __esm(() => {
|
|
118271
118292
|
init_rolldown_runtime_Bg48TavK_es();
|
|
118272
118293
|
init_jszip_C49i9kUs_es();
|
|
118273
118294
|
init_xml_js_CqGKpaft_es();
|
|
@@ -127540,7 +127561,8 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
127540
127561
|
type: "array",
|
|
127541
127562
|
items: ref2("TextSegment"),
|
|
127542
127563
|
minItems: 1
|
|
127543
|
-
}
|
|
127564
|
+
},
|
|
127565
|
+
story: ref2("StoryLocator")
|
|
127544
127566
|
}, ["kind", "segments"]), objectSchema2({
|
|
127545
127567
|
kind: { const: "block" },
|
|
127546
127568
|
nodeType: { enum: [...SELECTION_EDGE_NODE_TYPES2] },
|
|
@@ -128914,7 +128936,7 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
128914
128936
|
type: "object",
|
|
128915
128937
|
description: "ContentControlInfo"
|
|
128916
128938
|
};
|
|
128917
|
-
|
|
128939
|
+
refListQueryProperties2 = {
|
|
128918
128940
|
limit: {
|
|
128919
128941
|
type: "integer",
|
|
128920
128942
|
minimum: 1
|
|
@@ -128923,7 +128945,8 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
128923
128945
|
type: "integer",
|
|
128924
128946
|
minimum: 0
|
|
128925
128947
|
}
|
|
128926
|
-
}
|
|
128948
|
+
};
|
|
128949
|
+
objectSchema2(refListQueryProperties2);
|
|
128927
128950
|
refFailureSchema2 = objectSchema2({
|
|
128928
128951
|
success: { const: false },
|
|
128929
128952
|
failure: objectSchema2({
|
|
@@ -128935,7 +128958,8 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
128935
128958
|
bookmarkAddressSchema2 = objectSchema2({
|
|
128936
128959
|
kind: { const: "entity" },
|
|
128937
128960
|
entityType: { const: "bookmark" },
|
|
128938
|
-
name: { type: "string" }
|
|
128961
|
+
name: { type: "string" },
|
|
128962
|
+
story: ref2("StoryLocator")
|
|
128939
128963
|
}, [
|
|
128940
128964
|
"kind",
|
|
128941
128965
|
"entityType",
|
|
@@ -132532,7 +132556,10 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
132532
132556
|
]), objectSchema2({
|
|
132533
132557
|
success: { const: false },
|
|
132534
132558
|
failure: receiptFailureSchemaFor2("headerFooters.parts.delete")
|
|
132535
|
-
}, ["success", "failure"]), { ...buildContentControlSchemas2() }, objectSchema2({
|
|
132559
|
+
}, ["success", "failure"]), { ...buildContentControlSchemas2() }, objectSchema2({
|
|
132560
|
+
...refListQueryProperties2,
|
|
132561
|
+
in: storyLocatorSchema2
|
|
132562
|
+
}), objectSchema2({ target: bookmarkAddressSchema2 }, ["target"]), objectSchema2({
|
|
132536
132563
|
name: { type: "string" },
|
|
132537
132564
|
at: textTargetSchema2,
|
|
132538
132565
|
tableColumn: objectSchema2({
|
|
@@ -155862,7 +155889,7 @@ var init_SuperConverter_Dchjy0My_es = __esm(() => {
|
|
|
155862
155889
|
};
|
|
155863
155890
|
});
|
|
155864
155891
|
|
|
155865
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
155892
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-lTVVsGdE.es.js
|
|
155866
155893
|
function parseSizeUnit(val = "0") {
|
|
155867
155894
|
const length3 = val.toString() || "0";
|
|
155868
155895
|
const value = Number.parseFloat(length3);
|
|
@@ -158498,8 +158525,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
158498
158525
|
}
|
|
158499
158526
|
};
|
|
158500
158527
|
};
|
|
158501
|
-
var
|
|
158502
|
-
|
|
158528
|
+
var init_create_headless_toolbar_lTVVsGdE_es = __esm(() => {
|
|
158529
|
+
init_SuperConverter_DklB_kc9_es();
|
|
158503
158530
|
init_constants_DrU4EASo_es();
|
|
158504
158531
|
init_dist_B8HfvhaK_es();
|
|
158505
158532
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
@@ -207186,7 +207213,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
207186
207213
|
init_remark_gfm_BhnWr3yf_es();
|
|
207187
207214
|
});
|
|
207188
207215
|
|
|
207189
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
207216
|
+
// ../../packages/superdoc/dist/chunks/src-BA9o3DfT.es.js
|
|
207190
207217
|
function deleteProps(obj, propOrProps) {
|
|
207191
207218
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
207192
207219
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -207248,21 +207275,35 @@ function computeTabStops$1(context) {
|
|
|
207248
207275
|
const hanging = paragraphIndent.hanging ?? 0;
|
|
207249
207276
|
const effectiveMinIndent = Math.max(0, leftIndent - hanging);
|
|
207250
207277
|
const clearPositions = explicitStops.filter((stop) => stop.val === "clear").map((stop) => stop.pos);
|
|
207251
|
-
const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent)
|
|
207278
|
+
const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent).map((stop) => ({
|
|
207279
|
+
...stop,
|
|
207280
|
+
source: "explicit"
|
|
207281
|
+
}));
|
|
207252
207282
|
const maxExplicit = filteredExplicitStops.reduce((max$2, stop) => Math.max(max$2, stop.pos), 0);
|
|
207253
207283
|
const stops = [...filteredExplicitStops];
|
|
207254
|
-
const
|
|
207284
|
+
const hasStartAlignedExplicit = filteredExplicitStops.some((stop) => stop.val === "start");
|
|
207285
|
+
const hasExplicitStops = filteredExplicitStops.length > 0;
|
|
207286
|
+
const hasClearAtLeftIndent = clearPositions.some((clearPos) => Math.abs(clearPos - leftIndent) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207287
|
+
if (!hasExplicitStops && !hasClearAtLeftIndent && hanging > 0 && leftIndent > effectiveMinIndent)
|
|
207288
|
+
stops.push({
|
|
207289
|
+
val: "start",
|
|
207290
|
+
pos: leftIndent,
|
|
207291
|
+
leader: "none",
|
|
207292
|
+
source: "default"
|
|
207293
|
+
});
|
|
207294
|
+
const defaultStart = !hasStartAlignedExplicit ? 0 : Math.max(maxExplicit, leftIndent);
|
|
207255
207295
|
let pos = defaultStart;
|
|
207256
207296
|
const targetLimit = Math.max(defaultStart, leftIndent, maxExplicit) + 14400;
|
|
207257
207297
|
while (pos < targetLimit) {
|
|
207258
207298
|
pos += defaultTabInterval;
|
|
207259
|
-
const
|
|
207260
|
-
const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) <
|
|
207261
|
-
if (!
|
|
207299
|
+
const hasExistingStop = stops.some((s2) => Math.abs(s2.pos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207300
|
+
const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
|
|
207301
|
+
if (!hasExistingStop && !hasClearStop && pos >= leftIndent)
|
|
207262
207302
|
stops.push({
|
|
207263
207303
|
val: "start",
|
|
207264
207304
|
pos,
|
|
207265
|
-
leader: "none"
|
|
207305
|
+
leader: "none",
|
|
207306
|
+
source: "default"
|
|
207266
207307
|
});
|
|
207267
207308
|
}
|
|
207268
207309
|
return stops.sort((a2, b$1) => a2.pos - b$1.pos);
|
|
@@ -207474,12 +207515,13 @@ function getFragmentZIndex(block) {
|
|
|
207474
207515
|
return resolveFloatingZIndex(block.anchor?.behindDoc === true, raw);
|
|
207475
207516
|
}
|
|
207476
207517
|
function shouldApplyJustify(params$1) {
|
|
207477
|
-
const { alignment: alignment$1, hasExplicitPositioning, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
|
|
207518
|
+
const { alignment: alignment$1, hasExplicitPositioning, hasExplicitTabStops, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
|
|
207519
|
+
const lineHasExplicitTabStops = hasExplicitTabStops ?? hasExplicitPositioning ?? false;
|
|
207478
207520
|
if (alignment$1 !== "justify" && alignment$1 !== "both")
|
|
207479
207521
|
return false;
|
|
207480
207522
|
if (skipJustifyOverride === true)
|
|
207481
207523
|
return false;
|
|
207482
|
-
if (
|
|
207524
|
+
if (lineHasExplicitTabStops)
|
|
207483
207525
|
return false;
|
|
207484
207526
|
if (isLastLineOfParagraph && !paragraphEndsWithLineBreak)
|
|
207485
207527
|
return false;
|
|
@@ -243386,6 +243428,86 @@ function headerFootersPartsDeleteAdapter(editor, input2, options) {
|
|
|
243386
243428
|
partPath
|
|
243387
243429
|
};
|
|
243388
243430
|
}
|
|
243431
|
+
function isSpecialEntry(entry) {
|
|
243432
|
+
return SPECIAL_NOTE_TYPES.has(entry.type ?? "");
|
|
243433
|
+
}
|
|
243434
|
+
function normalizeNoteId(entry) {
|
|
243435
|
+
return String(entry.id ?? "");
|
|
243436
|
+
}
|
|
243437
|
+
function findNoteEntryById(entries2, noteId) {
|
|
243438
|
+
if (!Array.isArray(entries2))
|
|
243439
|
+
return;
|
|
243440
|
+
let fallback;
|
|
243441
|
+
for (const entry of entries2) {
|
|
243442
|
+
if (String(entry.id ?? "") !== noteId)
|
|
243443
|
+
continue;
|
|
243444
|
+
if (!isSpecialEntry(entry))
|
|
243445
|
+
return entry;
|
|
243446
|
+
fallback ??= entry;
|
|
243447
|
+
}
|
|
243448
|
+
return fallback;
|
|
243449
|
+
}
|
|
243450
|
+
function enumerateEffectiveNoteEntries(entries2) {
|
|
243451
|
+
if (!Array.isArray(entries2))
|
|
243452
|
+
return [];
|
|
243453
|
+
const orderedIds = [];
|
|
243454
|
+
const effectiveById = /* @__PURE__ */ new Map;
|
|
243455
|
+
for (const entry of entries2) {
|
|
243456
|
+
const noteId = normalizeNoteId(entry);
|
|
243457
|
+
if (!effectiveById.has(noteId)) {
|
|
243458
|
+
orderedIds.push(noteId);
|
|
243459
|
+
effectiveById.set(noteId, entry);
|
|
243460
|
+
continue;
|
|
243461
|
+
}
|
|
243462
|
+
if (isSpecialEntry(effectiveById.get(noteId)) && !isSpecialEntry(entry))
|
|
243463
|
+
effectiveById.set(noteId, entry);
|
|
243464
|
+
}
|
|
243465
|
+
return orderedIds.map((noteId) => effectiveById.get(noteId));
|
|
243466
|
+
}
|
|
243467
|
+
function normalizeStory(locator) {
|
|
243468
|
+
if (!locator || locator.storyType === "body")
|
|
243469
|
+
return;
|
|
243470
|
+
return locator;
|
|
243471
|
+
}
|
|
243472
|
+
function buildBookmarkAddress(name, story) {
|
|
243473
|
+
const normalizedStory = normalizeStory(story);
|
|
243474
|
+
return normalizedStory ? {
|
|
243475
|
+
kind: "entity",
|
|
243476
|
+
entityType: "bookmark",
|
|
243477
|
+
name,
|
|
243478
|
+
story: normalizedStory
|
|
243479
|
+
} : {
|
|
243480
|
+
kind: "entity",
|
|
243481
|
+
entityType: "bookmark",
|
|
243482
|
+
name
|
|
243483
|
+
};
|
|
243484
|
+
}
|
|
243485
|
+
function findAllBookmarksInDocument(editor) {
|
|
243486
|
+
return collectFromDocumentStories(editor, {
|
|
243487
|
+
collectFromDoc: collectBookmarksFromDoc,
|
|
243488
|
+
collectFromPmJson: collectBookmarksFromPmJson
|
|
243489
|
+
});
|
|
243490
|
+
}
|
|
243491
|
+
function findAllBookmarkMarkersInDocument(editor) {
|
|
243492
|
+
return collectFromDocumentStories(editor, {
|
|
243493
|
+
collectFromDoc: collectBookmarkMarkersFromDoc,
|
|
243494
|
+
collectFromPmJson: collectBookmarkMarkersFromPmJson
|
|
243495
|
+
});
|
|
243496
|
+
}
|
|
243497
|
+
function collectFromDocumentStories(editor, collector) {
|
|
243498
|
+
const results = [];
|
|
243499
|
+
const seenStoryKeys = /* @__PURE__ */ new Set;
|
|
243500
|
+
const converter = editor.converter;
|
|
243501
|
+
seenStoryKeys.add(BODY_STORY_KEY);
|
|
243502
|
+
collector.collectFromDoc(editor.state.doc, BODY_STORY_KEY, results);
|
|
243503
|
+
collectFromHeaderFooterEditors(editor, converter?.headerEditors, results, seenStoryKeys, collector);
|
|
243504
|
+
collectFromHeaderFooterEditors(editor, converter?.footerEditors, results, seenStoryKeys, collector);
|
|
243505
|
+
collectFromHeaderFooterCache(editor, converter?.headers, results, seenStoryKeys, collector);
|
|
243506
|
+
collectFromHeaderFooterCache(editor, converter?.footers, results, seenStoryKeys, collector);
|
|
243507
|
+
collectFromNotes(editor, converter?.footnotes, "footnote", results, seenStoryKeys, collector);
|
|
243508
|
+
collectFromNotes(editor, converter?.endnotes, "endnote", results, seenStoryKeys, collector);
|
|
243509
|
+
return results;
|
|
243510
|
+
}
|
|
243389
243511
|
function findAllBookmarks(doc$12) {
|
|
243390
243512
|
const results = [];
|
|
243391
243513
|
const endPositions = collectBookmarkEndPositions(doc$12);
|
|
@@ -243418,6 +243540,163 @@ function collectBookmarkEndPositions(doc$12) {
|
|
|
243418
243540
|
});
|
|
243419
243541
|
return map$12;
|
|
243420
243542
|
}
|
|
243543
|
+
function collectBookmarksFromDoc(doc$12, storyKey, results) {
|
|
243544
|
+
doc$12.descendants((node3) => {
|
|
243545
|
+
if (node3.type.name === "bookmarkStart")
|
|
243546
|
+
results.push({
|
|
243547
|
+
name: readBookmarkName(node3.attrs),
|
|
243548
|
+
bookmarkId: readBookmarkId(node3.attrs),
|
|
243549
|
+
storyKey
|
|
243550
|
+
});
|
|
243551
|
+
return true;
|
|
243552
|
+
});
|
|
243553
|
+
}
|
|
243554
|
+
function collectBookmarkMarkersFromDoc(doc$12, storyKey, results) {
|
|
243555
|
+
doc$12.descendants((node3) => {
|
|
243556
|
+
if (!isBookmarkMarkerType(node3.type.name))
|
|
243557
|
+
return true;
|
|
243558
|
+
const bookmarkId = readBookmarkId(node3.attrs);
|
|
243559
|
+
if (bookmarkId)
|
|
243560
|
+
results.push({
|
|
243561
|
+
bookmarkId,
|
|
243562
|
+
storyKey,
|
|
243563
|
+
markerType: node3.type.name
|
|
243564
|
+
});
|
|
243565
|
+
return true;
|
|
243566
|
+
});
|
|
243567
|
+
}
|
|
243568
|
+
function collectFromHeaderFooterEditors(hostEditor, editors, results, seenStoryKeys, collector) {
|
|
243569
|
+
if (!Array.isArray(editors))
|
|
243570
|
+
return;
|
|
243571
|
+
for (const entry of editors) {
|
|
243572
|
+
const refId = typeof entry?.id === "string" && entry.id.length > 0 ? entry.id : null;
|
|
243573
|
+
const storyEditor = entry?.editor;
|
|
243574
|
+
if (!refId || !storyEditor?.state?.doc)
|
|
243575
|
+
continue;
|
|
243576
|
+
const storyKey = buildStoryKey({
|
|
243577
|
+
kind: "story",
|
|
243578
|
+
storyType: "headerFooterPart",
|
|
243579
|
+
refId
|
|
243580
|
+
});
|
|
243581
|
+
if (seenStoryKeys.has(storyKey))
|
|
243582
|
+
continue;
|
|
243583
|
+
seenStoryKeys.add(storyKey);
|
|
243584
|
+
collectFromLiveOrDoc(hostEditor, storyKey, storyEditor.state.doc, results, collector);
|
|
243585
|
+
}
|
|
243586
|
+
}
|
|
243587
|
+
function collectFromHeaderFooterCache(hostEditor, collection, results, seenStoryKeys, collector) {
|
|
243588
|
+
if (!collection || typeof collection !== "object")
|
|
243589
|
+
return;
|
|
243590
|
+
for (const [refId, pmJson] of Object.entries(collection)) {
|
|
243591
|
+
if (typeof refId !== "string" || refId.length === 0)
|
|
243592
|
+
continue;
|
|
243593
|
+
const storyKey = buildStoryKey({
|
|
243594
|
+
kind: "story",
|
|
243595
|
+
storyType: "headerFooterPart",
|
|
243596
|
+
refId
|
|
243597
|
+
});
|
|
243598
|
+
if (seenStoryKeys.has(storyKey))
|
|
243599
|
+
continue;
|
|
243600
|
+
seenStoryKeys.add(storyKey);
|
|
243601
|
+
collectFromLiveOrPmJson(hostEditor, storyKey, pmJson, results, collector);
|
|
243602
|
+
}
|
|
243603
|
+
}
|
|
243604
|
+
function collectFromNotes(hostEditor, notes, storyType, results, seenStoryKeys, collector) {
|
|
243605
|
+
for (const note of enumerateEffectiveNoteEntries(notes)) {
|
|
243606
|
+
const noteId = note?.id != null ? String(note.id) : "";
|
|
243607
|
+
if (!noteId)
|
|
243608
|
+
continue;
|
|
243609
|
+
const pmJson = getNotePmJson(note);
|
|
243610
|
+
if (!pmJson)
|
|
243611
|
+
continue;
|
|
243612
|
+
const storyKey = buildStoryKey({
|
|
243613
|
+
kind: "story",
|
|
243614
|
+
storyType,
|
|
243615
|
+
noteId
|
|
243616
|
+
});
|
|
243617
|
+
if (seenStoryKeys.has(storyKey))
|
|
243618
|
+
continue;
|
|
243619
|
+
seenStoryKeys.add(storyKey);
|
|
243620
|
+
collectFromLiveOrPmJson(hostEditor, storyKey, pmJson, results, collector);
|
|
243621
|
+
}
|
|
243622
|
+
}
|
|
243623
|
+
function collectFromLiveOrDoc(hostEditor, storyKey, fallbackDoc, results, collector) {
|
|
243624
|
+
const liveDoc = resolveLiveStorySessionRuntime(hostEditor, storyKey)?.editor?.state?.doc;
|
|
243625
|
+
collector.collectFromDoc(liveDoc ?? fallbackDoc, storyKey, results);
|
|
243626
|
+
}
|
|
243627
|
+
function collectFromLiveOrPmJson(hostEditor, storyKey, fallbackPmJson, results, collector) {
|
|
243628
|
+
const liveDoc = resolveLiveStorySessionRuntime(hostEditor, storyKey)?.editor?.state?.doc;
|
|
243629
|
+
if (liveDoc) {
|
|
243630
|
+
collector.collectFromDoc(liveDoc, storyKey, results);
|
|
243631
|
+
return;
|
|
243632
|
+
}
|
|
243633
|
+
collector.collectFromPmJson(fallbackPmJson, storyKey, results);
|
|
243634
|
+
}
|
|
243635
|
+
function getNotePmJson(note) {
|
|
243636
|
+
if (Array.isArray(note.content))
|
|
243637
|
+
return {
|
|
243638
|
+
type: "doc",
|
|
243639
|
+
content: note.content.length > 0 ? note.content : [{ type: "paragraph" }]
|
|
243640
|
+
};
|
|
243641
|
+
if (note.doc && typeof note.doc === "object")
|
|
243642
|
+
return note.doc;
|
|
243643
|
+
return null;
|
|
243644
|
+
}
|
|
243645
|
+
function collectBookmarksFromPmJson(pmJson, storyKey, results) {
|
|
243646
|
+
if (!isObjectRecord4(pmJson))
|
|
243647
|
+
return;
|
|
243648
|
+
visitPmJson(pmJson, (node3) => {
|
|
243649
|
+
if (node3.type !== "bookmarkStart")
|
|
243650
|
+
return;
|
|
243651
|
+
const name = readBookmarkName(node3.attrs);
|
|
243652
|
+
const bookmarkId = readBookmarkId(node3.attrs);
|
|
243653
|
+
results.push({
|
|
243654
|
+
name,
|
|
243655
|
+
bookmarkId,
|
|
243656
|
+
storyKey
|
|
243657
|
+
});
|
|
243658
|
+
});
|
|
243659
|
+
}
|
|
243660
|
+
function collectBookmarkMarkersFromPmJson(pmJson, storyKey, results) {
|
|
243661
|
+
if (!isObjectRecord4(pmJson))
|
|
243662
|
+
return;
|
|
243663
|
+
visitPmJson(pmJson, (node3) => {
|
|
243664
|
+
if (!isBookmarkMarkerType(node3.type))
|
|
243665
|
+
return;
|
|
243666
|
+
const bookmarkId = readBookmarkId(node3.attrs);
|
|
243667
|
+
if (bookmarkId)
|
|
243668
|
+
results.push({
|
|
243669
|
+
bookmarkId,
|
|
243670
|
+
storyKey,
|
|
243671
|
+
markerType: node3.type
|
|
243672
|
+
});
|
|
243673
|
+
});
|
|
243674
|
+
}
|
|
243675
|
+
function visitPmJson(node3, visitor) {
|
|
243676
|
+
visitor(node3);
|
|
243677
|
+
const content3 = node3.content;
|
|
243678
|
+
if (!Array.isArray(content3))
|
|
243679
|
+
return;
|
|
243680
|
+
for (const child of content3)
|
|
243681
|
+
if (isObjectRecord4(child))
|
|
243682
|
+
visitPmJson(child, visitor);
|
|
243683
|
+
}
|
|
243684
|
+
function isObjectRecord4(value) {
|
|
243685
|
+
return typeof value === "object" && value !== null;
|
|
243686
|
+
}
|
|
243687
|
+
function isBookmarkMarkerType(type) {
|
|
243688
|
+
return type === "bookmarkStart" || type === "bookmarkEnd";
|
|
243689
|
+
}
|
|
243690
|
+
function readBookmarkId(attrs) {
|
|
243691
|
+
if (!isObjectRecord4(attrs) || attrs.id == null)
|
|
243692
|
+
return "";
|
|
243693
|
+
return String(attrs.id);
|
|
243694
|
+
}
|
|
243695
|
+
function readBookmarkName(attrs) {
|
|
243696
|
+
if (!isObjectRecord4(attrs) || typeof attrs.name !== "string")
|
|
243697
|
+
return "";
|
|
243698
|
+
return attrs.name;
|
|
243699
|
+
}
|
|
243421
243700
|
function resolveBookmarkTarget(doc$12, target) {
|
|
243422
243701
|
const found2 = findAllBookmarks(doc$12).find((b$1) => b$1.name === target.name);
|
|
243423
243702
|
if (!found2)
|
|
@@ -243439,17 +243718,13 @@ function nodePositionToPosition(doc$12, pos) {
|
|
|
243439
243718
|
offset: pos
|
|
243440
243719
|
};
|
|
243441
243720
|
}
|
|
243442
|
-
function extractBookmarkInfo(doc$12, resolved) {
|
|
243721
|
+
function extractBookmarkInfo(doc$12, resolved, story) {
|
|
243443
243722
|
const from$1 = nodePositionToPosition(doc$12, resolved.pos);
|
|
243444
243723
|
const to = resolved.endPos !== null ? nodePositionToPosition(doc$12, resolved.endPos) : from$1;
|
|
243445
243724
|
const colFirst = resolved.node.attrs?.colFirst;
|
|
243446
243725
|
const colLast = resolved.node.attrs?.colLast;
|
|
243447
243726
|
const info = {
|
|
243448
|
-
address:
|
|
243449
|
-
kind: "entity",
|
|
243450
|
-
entityType: "bookmark",
|
|
243451
|
-
name: resolved.name
|
|
243452
|
-
},
|
|
243727
|
+
address: buildBookmarkAddress(resolved.name, story),
|
|
243453
243728
|
name: resolved.name,
|
|
243454
243729
|
bookmarkId: resolved.bookmarkId,
|
|
243455
243730
|
range: {
|
|
@@ -243464,17 +243739,13 @@ function extractBookmarkInfo(doc$12, resolved) {
|
|
|
243464
243739
|
};
|
|
243465
243740
|
return info;
|
|
243466
243741
|
}
|
|
243467
|
-
function buildBookmarkDiscoveryItem(doc$12, resolved, evaluatedRevision) {
|
|
243742
|
+
function buildBookmarkDiscoveryItem(doc$12, resolved, evaluatedRevision, story, idScope) {
|
|
243468
243743
|
const from$1 = nodePositionToPosition(doc$12, resolved.pos);
|
|
243469
243744
|
const to = resolved.endPos !== null ? nodePositionToPosition(doc$12, resolved.endPos) : from$1;
|
|
243470
243745
|
const colFirst = resolved.node.attrs?.colFirst;
|
|
243471
243746
|
const colLast = resolved.node.attrs?.colLast;
|
|
243472
243747
|
const domain2 = {
|
|
243473
|
-
address:
|
|
243474
|
-
kind: "entity",
|
|
243475
|
-
entityType: "bookmark",
|
|
243476
|
-
name: resolved.name
|
|
243477
|
-
},
|
|
243748
|
+
address: buildBookmarkAddress(resolved.name, story),
|
|
243478
243749
|
name: resolved.name,
|
|
243479
243750
|
bookmarkId: resolved.bookmarkId,
|
|
243480
243751
|
range: {
|
|
@@ -243488,7 +243759,7 @@ function buildBookmarkDiscoveryItem(doc$12, resolved, evaluatedRevision) {
|
|
|
243488
243759
|
colLast
|
|
243489
243760
|
};
|
|
243490
243761
|
const handle3 = buildResolvedHandle(resolved.name, "stable", "node");
|
|
243491
|
-
return buildDiscoveryItem(`bookmark:${resolved.name}:${evaluatedRevision}`, handle3, domain2);
|
|
243762
|
+
return buildDiscoveryItem(`${idScope ? `bookmark:${encodeURIComponent(idScope)}:` : "bookmark:"}${encodeURIComponent(resolved.name)}:${encodeURIComponent(evaluatedRevision)}`, handle3, domain2);
|
|
243492
243763
|
}
|
|
243493
243764
|
function bookmarkSuccess(address2) {
|
|
243494
243765
|
return {
|
|
@@ -243518,22 +243789,106 @@ function parseBookmarkId(raw) {
|
|
|
243518
243789
|
const parsed = Number.parseInt(raw, 10);
|
|
243519
243790
|
return Number.isInteger(parsed) && parsed >= 0 ? parsed : null;
|
|
243520
243791
|
}
|
|
243521
|
-
function allocateBookmarkId(
|
|
243792
|
+
function allocateBookmarkId(editor) {
|
|
243793
|
+
const entries2 = findAllBookmarkMarkersInDocument(editor);
|
|
243522
243794
|
let maxId = -1;
|
|
243523
|
-
|
|
243524
|
-
|
|
243525
|
-
return true;
|
|
243526
|
-
const id2 = parseBookmarkId(node3.attrs?.id);
|
|
243795
|
+
for (const entry of entries2) {
|
|
243796
|
+
const id2 = parseBookmarkId(entry.bookmarkId);
|
|
243527
243797
|
if (id2 !== null && id2 > maxId)
|
|
243528
243798
|
maxId = id2;
|
|
243529
|
-
|
|
243530
|
-
});
|
|
243799
|
+
}
|
|
243531
243800
|
return String(maxId + 1);
|
|
243532
243801
|
}
|
|
243802
|
+
function bookmarkExistsAnywhere(editor, name, exclude, preCollected) {
|
|
243803
|
+
return (preCollected ?? findAllBookmarksInDocument(editor)).some((bookmark) => {
|
|
243804
|
+
if (bookmark.name !== name)
|
|
243805
|
+
return false;
|
|
243806
|
+
if (!exclude)
|
|
243807
|
+
return true;
|
|
243808
|
+
return !(bookmark.storyKey === exclude.storyKey && bookmark.bookmarkId === exclude.bookmarkId);
|
|
243809
|
+
});
|
|
243810
|
+
}
|
|
243811
|
+
function collectBookmarkStorySnapshots(editor, entries2) {
|
|
243812
|
+
return [...new Set(entries2.map((entry) => entry.storyKey))].flatMap((storyKey) => {
|
|
243813
|
+
const locator = storyKey === "body" ? undefined : parseStoryKey(storyKey);
|
|
243814
|
+
try {
|
|
243815
|
+
const runtime = resolveStoryRuntime(editor, locator);
|
|
243816
|
+
return [{
|
|
243817
|
+
storyKey,
|
|
243818
|
+
runtime,
|
|
243819
|
+
revision: getRevision(runtime.editor)
|
|
243820
|
+
}];
|
|
243821
|
+
} catch (error3) {
|
|
243822
|
+
if (error3 instanceof DocumentApiAdapterError && error3.code === "STORY_NOT_FOUND")
|
|
243823
|
+
return [];
|
|
243824
|
+
throw error3;
|
|
243825
|
+
}
|
|
243826
|
+
});
|
|
243827
|
+
}
|
|
243828
|
+
function buildDocumentBookmarkRevision(hostRevision, snapshots) {
|
|
243829
|
+
if (snapshots.length === 0)
|
|
243830
|
+
return hostRevision;
|
|
243831
|
+
if (snapshots.length === 1 && snapshots[0]?.storyKey === "body")
|
|
243832
|
+
return hostRevision;
|
|
243833
|
+
return `${BOOKMARK_SCAN_REVISION_PREFIX}${[...snapshots].sort((left$1, right$1) => left$1.storyKey.localeCompare(right$1.storyKey)).map((snapshot2) => `${snapshot2.storyKey}@${snapshot2.revision}`).join("|")}`;
|
|
243834
|
+
}
|
|
243835
|
+
function getDocumentBookmarkRevision(editor, preCollected) {
|
|
243836
|
+
return buildDocumentBookmarkRevision(getRevision(editor), collectBookmarkStorySnapshots(editor, preCollected ?? findAllBookmarksInDocument(editor)));
|
|
243837
|
+
}
|
|
243838
|
+
function expectedRevisionMatchesStory(storyEditor, expectedRevision) {
|
|
243839
|
+
return expectedRevision === getRevision(storyEditor);
|
|
243840
|
+
}
|
|
243841
|
+
function expectedRevisionMatchesDocumentScan(hostEditor, expectedRevision) {
|
|
243842
|
+
return expectedRevision.startsWith("bookmark-scan:") && expectedRevision === getDocumentBookmarkRevision(hostEditor);
|
|
243843
|
+
}
|
|
243844
|
+
function checkBookmarkRevision(hostEditor, storyEditor, expectedRevision) {
|
|
243845
|
+
if (expectedRevision === undefined)
|
|
243846
|
+
return;
|
|
243847
|
+
if (expectedRevisionMatchesStory(storyEditor, expectedRevision))
|
|
243848
|
+
return;
|
|
243849
|
+
if (expectedRevisionMatchesDocumentScan(hostEditor, expectedRevision))
|
|
243850
|
+
return;
|
|
243851
|
+
checkRevision(storyEditor, expectedRevision);
|
|
243852
|
+
}
|
|
243853
|
+
function resolveBookmarkMutationStory(editor, target) {
|
|
243854
|
+
if (target.story)
|
|
243855
|
+
return target.story;
|
|
243856
|
+
const matches2 = findAllBookmarksInDocument(editor).filter((bookmark) => bookmark.name === target.name);
|
|
243857
|
+
if (matches2.length > 1)
|
|
243858
|
+
throw new DocumentApiAdapterError("INVALID_INPUT", `Bookmark name "${target.name}" exists in multiple stories. Pass target.story to disambiguate the mutation.`);
|
|
243859
|
+
const entry = matches2[0];
|
|
243860
|
+
if (!entry)
|
|
243861
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Bookmark with name "${target.name}" not found.`);
|
|
243862
|
+
return entry.storyKey === "body" ? undefined : parseStoryKey(entry.storyKey);
|
|
243863
|
+
}
|
|
243533
243864
|
function bookmarksListWrapper(editor, query2) {
|
|
243534
|
-
|
|
243535
|
-
|
|
243536
|
-
const
|
|
243865
|
+
if (query2?.in)
|
|
243866
|
+
return listBookmarksFromStory(editor, query2.in, query2);
|
|
243867
|
+
const entries2 = findAllBookmarksInDocument(editor);
|
|
243868
|
+
const hostRevision = getRevision(editor);
|
|
243869
|
+
const snapshots = collectBookmarkStorySnapshots(editor, entries2);
|
|
243870
|
+
const { total, items: paged } = paginate(snapshots.flatMap(({ storyKey, runtime, revision }) => {
|
|
243871
|
+
const doc$12 = runtime.editor.state.doc;
|
|
243872
|
+
return findAllBookmarks(doc$12).map((bookmark) => buildBookmarkDiscoveryItem(doc$12, bookmark, revision, runtime.locator, storyKey));
|
|
243873
|
+
}), query2?.offset, query2?.limit);
|
|
243874
|
+
const effectiveLimit = query2?.limit ?? total;
|
|
243875
|
+
return buildDiscoveryResult({
|
|
243876
|
+
evaluatedRevision: buildDocumentBookmarkRevision(hostRevision, snapshots),
|
|
243877
|
+
total,
|
|
243878
|
+
items: paged,
|
|
243879
|
+
page: {
|
|
243880
|
+
limit: effectiveLimit,
|
|
243881
|
+
offset: query2?.offset ?? 0,
|
|
243882
|
+
returned: paged.length
|
|
243883
|
+
}
|
|
243884
|
+
});
|
|
243885
|
+
}
|
|
243886
|
+
function listBookmarksFromStory(editor, storyLocator, query2) {
|
|
243887
|
+
const runtime = resolveStoryRuntime(editor, storyLocator);
|
|
243888
|
+
const storyEditor = runtime.editor;
|
|
243889
|
+
const doc$12 = storyEditor.state.doc;
|
|
243890
|
+
const revision = getRevision(storyEditor);
|
|
243891
|
+
const { total, items: paged } = paginate(findAllBookmarks(doc$12).map((bookmark) => buildBookmarkDiscoveryItem(doc$12, bookmark, revision, runtime.locator)), query2?.offset, query2?.limit);
|
|
243537
243892
|
return buildDiscoveryResult({
|
|
243538
243893
|
evaluatedRevision: revision,
|
|
243539
243894
|
total,
|
|
@@ -243546,100 +243901,128 @@ function bookmarksListWrapper(editor, query2) {
|
|
|
243546
243901
|
});
|
|
243547
243902
|
}
|
|
243548
243903
|
function bookmarksGetWrapper(editor, input2) {
|
|
243549
|
-
|
|
243550
|
-
|
|
243904
|
+
if (input2.target.story) {
|
|
243905
|
+
const runtime$1 = resolveStoryRuntime(editor, input2.target.story);
|
|
243906
|
+
const resolved$1 = resolveBookmarkTarget(runtime$1.editor.state.doc, input2.target);
|
|
243907
|
+
return extractBookmarkInfo(runtime$1.editor.state.doc, resolved$1, runtime$1.locator);
|
|
243908
|
+
}
|
|
243909
|
+
const entry = findAllBookmarksInDocument(editor).find((bookmark) => bookmark.name === input2.target.name);
|
|
243910
|
+
if (!entry)
|
|
243911
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Bookmark with name "${input2.target.name}" not found.`);
|
|
243912
|
+
const runtime = resolveStoryRuntime(editor, entry.storyKey === "body" ? undefined : parseStoryKey(entry.storyKey));
|
|
243913
|
+
const resolved = resolveBookmarkTarget(runtime.editor.state.doc, input2.target);
|
|
243914
|
+
return extractBookmarkInfo(runtime.editor.state.doc, resolved, runtime.locator);
|
|
243551
243915
|
}
|
|
243552
243916
|
function bookmarksInsertWrapper(editor, input2, options) {
|
|
243553
243917
|
rejectTrackedMode("bookmarks.insert", options);
|
|
243554
|
-
|
|
243555
|
-
|
|
243556
|
-
const address2 =
|
|
243557
|
-
|
|
243558
|
-
|
|
243559
|
-
|
|
243560
|
-
|
|
243561
|
-
|
|
243918
|
+
const runtime = resolveWriteStoryRuntime(editor, input2.at.story);
|
|
243919
|
+
const storyEditor = runtime.editor;
|
|
243920
|
+
const address2 = buildBookmarkAddress(input2.name, runtime.locator);
|
|
243921
|
+
try {
|
|
243922
|
+
checkBookmarkRevision(editor, storyEditor, options?.expectedRevision);
|
|
243923
|
+
const allBookmarks = findAllBookmarksInDocument(editor);
|
|
243924
|
+
if (bookmarkExistsAnywhere(editor, input2.name, undefined, allBookmarks))
|
|
243925
|
+
return bookmarkFailure("NO_OP", `Bookmark with name "${input2.name}" already exists.`);
|
|
243926
|
+
if (options?.dryRun)
|
|
243927
|
+
return bookmarkSuccess(address2);
|
|
243928
|
+
const bookmarkStartType = storyEditor.schema.nodes.bookmarkStart;
|
|
243929
|
+
const bookmarkEndType = storyEditor.schema.nodes.bookmarkEnd;
|
|
243930
|
+
if (!bookmarkStartType || !bookmarkEndType)
|
|
243931
|
+
throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", "bookmarks.insert requires bookmarkStart and bookmarkEnd node types in the schema.");
|
|
243932
|
+
const resolved = resolveInlineInsertPosition(storyEditor, input2.at, "bookmarks.insert");
|
|
243933
|
+
if (!receiptApplied$6(executeDomainCommand(storyEditor, () => {
|
|
243934
|
+
const bookmarkId = allocateBookmarkId(editor);
|
|
243935
|
+
const startAttrs = {
|
|
243936
|
+
name: input2.name,
|
|
243937
|
+
id: bookmarkId
|
|
243938
|
+
};
|
|
243939
|
+
if (input2.tableColumn) {
|
|
243940
|
+
startAttrs.colFirst = input2.tableColumn.colFirst;
|
|
243941
|
+
startAttrs.colLast = input2.tableColumn.colLast;
|
|
243942
|
+
}
|
|
243943
|
+
const startNode = bookmarkStartType.create(startAttrs);
|
|
243944
|
+
const endNode = bookmarkEndType.create({ id: bookmarkId });
|
|
243945
|
+
const { tr } = storyEditor.state;
|
|
243946
|
+
tr.insert(resolved.to, endNode);
|
|
243947
|
+
tr.insert(resolved.from, startNode);
|
|
243948
|
+
storyEditor.dispatch(tr);
|
|
243949
|
+
clearIndexCache(storyEditor);
|
|
243950
|
+
return true;
|
|
243951
|
+
})))
|
|
243952
|
+
return bookmarkFailure("NO_OP", "Insert operation produced no change.");
|
|
243953
|
+
if (runtime.commit)
|
|
243954
|
+
runtime.commit(editor);
|
|
243562
243955
|
return bookmarkSuccess(address2);
|
|
243563
|
-
|
|
243564
|
-
|
|
243565
|
-
|
|
243566
|
-
throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", "bookmarks.insert requires bookmarkStart and bookmarkEnd node types in the schema.");
|
|
243567
|
-
const resolved = resolveInlineInsertPosition(editor, input2.at, "bookmarks.insert");
|
|
243568
|
-
if (!receiptApplied$6(executeDomainCommand(editor, () => {
|
|
243569
|
-
const bookmarkId = allocateBookmarkId(editor.state.doc);
|
|
243570
|
-
const startAttrs = {
|
|
243571
|
-
name: input2.name,
|
|
243572
|
-
id: bookmarkId
|
|
243573
|
-
};
|
|
243574
|
-
if (input2.tableColumn) {
|
|
243575
|
-
startAttrs.colFirst = input2.tableColumn.colFirst;
|
|
243576
|
-
startAttrs.colLast = input2.tableColumn.colLast;
|
|
243577
|
-
}
|
|
243578
|
-
const startNode = bookmarkStartType.create(startAttrs);
|
|
243579
|
-
const endNode = bookmarkEndType.create({ id: bookmarkId });
|
|
243580
|
-
const { tr } = editor.state;
|
|
243581
|
-
tr.insert(resolved.to, endNode);
|
|
243582
|
-
tr.insert(resolved.from, startNode);
|
|
243583
|
-
editor.dispatch(tr);
|
|
243584
|
-
clearIndexCache(editor);
|
|
243585
|
-
return true;
|
|
243586
|
-
}, { expectedRevision: options?.expectedRevision })))
|
|
243587
|
-
return bookmarkFailure("NO_OP", "Insert operation produced no change.");
|
|
243588
|
-
return bookmarkSuccess(address2);
|
|
243956
|
+
} finally {
|
|
243957
|
+
disposeEphemeralWriteRuntime(runtime);
|
|
243958
|
+
}
|
|
243589
243959
|
}
|
|
243590
243960
|
function bookmarksRenameWrapper(editor, input2, options) {
|
|
243591
243961
|
rejectTrackedMode("bookmarks.rename", options);
|
|
243592
|
-
const
|
|
243593
|
-
|
|
243594
|
-
|
|
243595
|
-
|
|
243596
|
-
|
|
243597
|
-
|
|
243598
|
-
|
|
243599
|
-
|
|
243600
|
-
|
|
243601
|
-
|
|
243602
|
-
|
|
243962
|
+
const runtime = resolveWriteStoryRuntime(editor, resolveBookmarkMutationStory(editor, input2.target));
|
|
243963
|
+
const storyEditor = runtime.editor;
|
|
243964
|
+
try {
|
|
243965
|
+
checkBookmarkRevision(editor, storyEditor, options?.expectedRevision);
|
|
243966
|
+
const resolved = resolveBookmarkTarget(storyEditor.state.doc, input2.target);
|
|
243967
|
+
if (resolved.name === input2.newName)
|
|
243968
|
+
return bookmarkFailure("NO_OP", "New name is identical to current name.");
|
|
243969
|
+
if (bookmarkExistsAnywhere(editor, input2.newName, {
|
|
243970
|
+
storyKey: runtime.storyKey,
|
|
243971
|
+
bookmarkId: resolved.bookmarkId
|
|
243972
|
+
}))
|
|
243973
|
+
throw new DocumentApiAdapterError("INVALID_INPUT", `bookmarks.rename: a bookmark with name "${input2.newName}" already exists.`);
|
|
243974
|
+
const newAddress = buildBookmarkAddress(input2.newName, runtime.locator);
|
|
243975
|
+
if (options?.dryRun)
|
|
243976
|
+
return bookmarkSuccess(newAddress);
|
|
243977
|
+
if (!receiptApplied$6(executeDomainCommand(storyEditor, () => {
|
|
243978
|
+
const { tr } = storyEditor.state;
|
|
243979
|
+
tr.setNodeMarkup(resolved.pos, undefined, {
|
|
243980
|
+
...resolved.node.attrs,
|
|
243981
|
+
name: input2.newName
|
|
243982
|
+
});
|
|
243983
|
+
storyEditor.dispatch(tr);
|
|
243984
|
+
clearIndexCache(storyEditor);
|
|
243985
|
+
return true;
|
|
243986
|
+
})))
|
|
243987
|
+
return bookmarkFailure("NO_OP", "Rename operation produced no change.");
|
|
243988
|
+
if (runtime.commit)
|
|
243989
|
+
runtime.commit(editor);
|
|
243603
243990
|
return bookmarkSuccess(newAddress);
|
|
243604
|
-
|
|
243605
|
-
|
|
243606
|
-
|
|
243607
|
-
...resolved.node.attrs,
|
|
243608
|
-
name: input2.newName
|
|
243609
|
-
});
|
|
243610
|
-
editor.dispatch(tr);
|
|
243611
|
-
clearIndexCache(editor);
|
|
243612
|
-
return true;
|
|
243613
|
-
}, { expectedRevision: options?.expectedRevision })))
|
|
243614
|
-
return bookmarkFailure("NO_OP", "Rename operation produced no change.");
|
|
243615
|
-
return bookmarkSuccess(newAddress);
|
|
243991
|
+
} finally {
|
|
243992
|
+
disposeEphemeralWriteRuntime(runtime);
|
|
243993
|
+
}
|
|
243616
243994
|
}
|
|
243617
243995
|
function bookmarksRemoveWrapper(editor, input2, options) {
|
|
243618
243996
|
rejectTrackedMode("bookmarks.remove", options);
|
|
243619
|
-
const
|
|
243620
|
-
const
|
|
243621
|
-
|
|
243622
|
-
|
|
243623
|
-
|
|
243624
|
-
|
|
243625
|
-
|
|
243997
|
+
const runtime = resolveWriteStoryRuntime(editor, resolveBookmarkMutationStory(editor, input2.target));
|
|
243998
|
+
const storyEditor = runtime.editor;
|
|
243999
|
+
try {
|
|
244000
|
+
checkBookmarkRevision(editor, storyEditor, options?.expectedRevision);
|
|
244001
|
+
const resolved = resolveBookmarkTarget(storyEditor.state.doc, input2.target);
|
|
244002
|
+
const address2 = buildBookmarkAddress(resolved.name, runtime.locator);
|
|
244003
|
+
if (options?.dryRun)
|
|
244004
|
+
return bookmarkSuccess(address2);
|
|
244005
|
+
if (!receiptApplied$6(executeDomainCommand(storyEditor, () => {
|
|
244006
|
+
const { tr } = storyEditor.state;
|
|
244007
|
+
if (resolved.endPos !== null && resolved.endPos > resolved.pos) {
|
|
244008
|
+
const endNode = tr.doc.nodeAt(resolved.endPos);
|
|
244009
|
+
if (endNode)
|
|
244010
|
+
tr.delete(resolved.endPos, resolved.endPos + endNode.nodeSize);
|
|
244011
|
+
}
|
|
244012
|
+
const startNode = tr.doc.nodeAt(resolved.pos);
|
|
244013
|
+
if (startNode)
|
|
244014
|
+
tr.delete(resolved.pos, resolved.pos + startNode.nodeSize);
|
|
244015
|
+
storyEditor.dispatch(tr);
|
|
244016
|
+
clearIndexCache(storyEditor);
|
|
244017
|
+
return true;
|
|
244018
|
+
})))
|
|
244019
|
+
return bookmarkFailure("NO_OP", "Remove operation produced no change.");
|
|
244020
|
+
if (runtime.commit)
|
|
244021
|
+
runtime.commit(editor);
|
|
243626
244022
|
return bookmarkSuccess(address2);
|
|
243627
|
-
|
|
243628
|
-
|
|
243629
|
-
|
|
243630
|
-
const endNode = tr.doc.nodeAt(resolved.endPos);
|
|
243631
|
-
if (endNode)
|
|
243632
|
-
tr.delete(resolved.endPos, resolved.endPos + endNode.nodeSize);
|
|
243633
|
-
}
|
|
243634
|
-
const startNode = tr.doc.nodeAt(resolved.pos);
|
|
243635
|
-
if (startNode)
|
|
243636
|
-
tr.delete(resolved.pos, resolved.pos + startNode.nodeSize);
|
|
243637
|
-
editor.dispatch(tr);
|
|
243638
|
-
clearIndexCache(editor);
|
|
243639
|
-
return true;
|
|
243640
|
-
}, { expectedRevision: options?.expectedRevision })))
|
|
243641
|
-
return bookmarkFailure("NO_OP", "Remove operation produced no change.");
|
|
243642
|
-
return bookmarkSuccess(address2);
|
|
244023
|
+
} finally {
|
|
244024
|
+
disposeEphemeralWriteRuntime(runtime);
|
|
244025
|
+
}
|
|
243643
244026
|
}
|
|
243644
244027
|
function getConverter$12(editor) {
|
|
243645
244028
|
return editor.converter ?? undefined;
|
|
@@ -244037,22 +244420,6 @@ function findMarkerPositions(editor, id2) {
|
|
|
244037
244420
|
end: end$1
|
|
244038
244421
|
};
|
|
244039
244422
|
}
|
|
244040
|
-
function isSpecialEntry(entry) {
|
|
244041
|
-
return SPECIAL_NOTE_TYPES.has(entry.type ?? "");
|
|
244042
|
-
}
|
|
244043
|
-
function findNoteEntryById(entries2, noteId) {
|
|
244044
|
-
if (!Array.isArray(entries2))
|
|
244045
|
-
return;
|
|
244046
|
-
let fallback;
|
|
244047
|
-
for (const entry of entries2) {
|
|
244048
|
-
if (String(entry.id ?? "") !== noteId)
|
|
244049
|
-
continue;
|
|
244050
|
-
if (!isSpecialEntry(entry))
|
|
244051
|
-
return entry;
|
|
244052
|
-
fallback ??= entry;
|
|
244053
|
-
}
|
|
244054
|
-
return fallback;
|
|
244055
|
-
}
|
|
244056
244423
|
function getConverterStore(editor) {
|
|
244057
244424
|
return editor.converter ?? {};
|
|
244058
244425
|
}
|
|
@@ -257580,7 +257947,12 @@ function sliceRunsForLine(block, line) {
|
|
|
257580
257947
|
function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
|
|
257581
257948
|
const ctx$1 = getMeasurementContext();
|
|
257582
257949
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
257583
|
-
const justify = getJustifyAdjustment(
|
|
257950
|
+
const justify = getJustifyAdjustment({
|
|
257951
|
+
block,
|
|
257952
|
+
line,
|
|
257953
|
+
availableWidthOverride: availableWidth,
|
|
257954
|
+
alignmentOverride
|
|
257955
|
+
});
|
|
257584
257956
|
const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
|
|
257585
257957
|
const renderedLineWidth = alignment$1 === "justify" && justify.extraPerSpace !== 0 ? availableWidth : line.width;
|
|
257586
257958
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
@@ -257712,7 +258084,12 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
|
|
|
257712
258084
|
function findCharacterAtX(block, line, x, pmStart, availableWidthOverride, alignmentOverride) {
|
|
257713
258085
|
const ctx$1 = getMeasurementContext();
|
|
257714
258086
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
257715
|
-
const justify = getJustifyAdjustment(
|
|
258087
|
+
const justify = getJustifyAdjustment({
|
|
258088
|
+
block,
|
|
258089
|
+
line,
|
|
258090
|
+
availableWidthOverride: availableWidth,
|
|
258091
|
+
alignmentOverride
|
|
258092
|
+
});
|
|
257716
258093
|
const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
|
|
257717
258094
|
const renderedLineWidth = alignment$1 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
|
|
257718
258095
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
@@ -264728,7 +265105,7 @@ function computeAnchorMap(bookmarks, layout, blocks2) {
|
|
|
264728
265105
|
});
|
|
264729
265106
|
return anchorMap;
|
|
264730
265107
|
}
|
|
264731
|
-
async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks, pageGeometryHelper, painterHost, scrollContainer, zoom, scrollPageIntoView, waitForPageMount, getActiveEditor, timeoutMs }) {
|
|
265108
|
+
async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks, resolveAnchorPosition, pageGeometryHelper, painterHost, scrollContainer, zoom, scrollPageIntoView, waitForPageMount, getActiveEditor, timeoutMs }) {
|
|
264732
265109
|
if (!anchor)
|
|
264733
265110
|
return false;
|
|
264734
265111
|
if (!layout)
|
|
@@ -264736,7 +265113,7 @@ async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks
|
|
|
264736
265113
|
const normalized = anchor.startsWith("#") ? anchor.slice(1) : anchor;
|
|
264737
265114
|
if (!normalized)
|
|
264738
265115
|
return false;
|
|
264739
|
-
const pmPos = bookmarks.get(normalized);
|
|
265116
|
+
const pmPos = bookmarks.get(normalized) ?? resolveAnchorPosition?.(normalized) ?? null;
|
|
264740
265117
|
if (pmPos == null)
|
|
264741
265118
|
return false;
|
|
264742
265119
|
let pageIndex = (selectionToRects(layout, blocks2, measures, pmPos, pmPos + 1, pageGeometryHelper) ?? [])[0]?.pageIndex ?? null;
|
|
@@ -267063,6 +267440,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
267063
267440
|
const clampedTarget = Math.min(target, maxAbsWidth);
|
|
267064
267441
|
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
|
|
267065
267442
|
currentLine.width = roundValue(currentLine.width + tabAdvance);
|
|
267443
|
+
if (stop?.source === "explicit")
|
|
267444
|
+
currentLine.hasExplicitTabStops = true;
|
|
267066
267445
|
run2.width = tabAdvance;
|
|
267067
267446
|
currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lastFontSize);
|
|
267068
267447
|
currentLine.toRun = runIndex;
|
|
@@ -267821,6 +268200,8 @@ async function measureParagraphBlock(block, maxWidth) {
|
|
|
267821
268200
|
const clampedTarget = Math.min(target, maxAbsWidth);
|
|
267822
268201
|
const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
|
|
267823
268202
|
currentLine.width = roundValue(currentLine.width + tabAdvance);
|
|
268203
|
+
if (stop?.source === "explicit")
|
|
268204
|
+
currentLine.hasExplicitTabStops = true;
|
|
267824
268205
|
currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
|
|
267825
268206
|
currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lineHeightFontSize(run2));
|
|
267826
268207
|
currentLine.toRun = runIndex;
|
|
@@ -268909,7 +269290,7 @@ var Node$13 = class Node$14 {
|
|
|
268909
269290
|
"iPhone",
|
|
268910
269291
|
"iPod"
|
|
268911
269292
|
].includes(navigator.platform);
|
|
268912
|
-
}, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
|
|
269293
|
+
}, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
|
|
268913
269294
|
if (!run2 || typeof run2 !== "object")
|
|
268914
269295
|
return false;
|
|
268915
269296
|
return typeof run2.src === "string";
|
|
@@ -273524,20 +273905,23 @@ var Node$13 = class Node$14 {
|
|
|
273524
273905
|
segments,
|
|
273525
273906
|
ranges: []
|
|
273526
273907
|
};
|
|
273908
|
+
const sorted = [...segments].sort((a2, b$1) => a2.from - b$1.from);
|
|
273527
273909
|
const ranges = [];
|
|
273528
|
-
let active =
|
|
273529
|
-
|
|
273530
|
-
|
|
273531
|
-
|
|
273532
|
-
|
|
273533
|
-
|
|
273534
|
-
|
|
273535
|
-
};
|
|
273536
|
-
return;
|
|
273537
|
-
}
|
|
273910
|
+
let active = {
|
|
273911
|
+
from: sorted[0].from,
|
|
273912
|
+
to: sorted[0].to,
|
|
273913
|
+
internal: !!sorted[0].attrs?.internal
|
|
273914
|
+
};
|
|
273915
|
+
for (let i4 = 1;i4 < sorted.length; i4 += 1) {
|
|
273916
|
+
const seg = sorted[i4];
|
|
273538
273917
|
if (seg.from <= active.to) {
|
|
273539
|
-
|
|
273540
|
-
|
|
273918
|
+
if (seg.to > active.to)
|
|
273919
|
+
active.to = seg.to;
|
|
273920
|
+
continue;
|
|
273921
|
+
}
|
|
273922
|
+
if (!(doc$12.textBetween(active.to, seg.from, "", "").length > 0)) {
|
|
273923
|
+
active.to = seg.to;
|
|
273924
|
+
continue;
|
|
273541
273925
|
}
|
|
273542
273926
|
ranges.push(active);
|
|
273543
273927
|
active = {
|
|
@@ -273545,9 +273929,8 @@ var Node$13 = class Node$14 {
|
|
|
273545
273929
|
to: seg.to,
|
|
273546
273930
|
internal: !!seg.attrs?.internal
|
|
273547
273931
|
};
|
|
273548
|
-
}
|
|
273549
|
-
|
|
273550
|
-
ranges.push(active);
|
|
273932
|
+
}
|
|
273933
|
+
ranges.push(active);
|
|
273551
273934
|
return {
|
|
273552
273935
|
segments,
|
|
273553
273936
|
ranges
|
|
@@ -282840,7 +283223,7 @@ var Node$13 = class Node$14 {
|
|
|
282840
283223
|
return () => {};
|
|
282841
283224
|
const handle3 = setInterval(callback, intervalMs);
|
|
282842
283225
|
return () => clearInterval(handle3);
|
|
282843
|
-
}, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2,
|
|
283226
|
+
}, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.29.1", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, cloneExtensionInstance = (extension3) => {
|
|
282844
283227
|
const extensionLike = extension3;
|
|
282845
283228
|
const config2 = extensionLike?.config;
|
|
282846
283229
|
const ExtensionCtor = extensionLike?.constructor;
|
|
@@ -289269,19 +289652,6 @@ menclose::after {
|
|
|
289269
289652
|
return false;
|
|
289270
289653
|
const code7 = char.charCodeAt(0);
|
|
289271
289654
|
return code7 >= 48 && code7 <= 57 || code7 >= 65 && code7 <= 90 || code7 >= 97 && code7 <= 122 || char === "'";
|
|
289272
|
-
}, lineContainsManualTabWithoutSegments = (block, line) => {
|
|
289273
|
-
if (block.kind !== "paragraph")
|
|
289274
|
-
return false;
|
|
289275
|
-
if (line.segments?.some((seg) => seg.x !== undefined))
|
|
289276
|
-
return false;
|
|
289277
|
-
const fromRun = line.fromRun ?? 0;
|
|
289278
|
-
const toRun = line.toRun ?? fromRun;
|
|
289279
|
-
for (let runIndex = fromRun;runIndex <= toRun; runIndex += 1) {
|
|
289280
|
-
const run2 = block.runs[runIndex];
|
|
289281
|
-
if (run2 && isTabRun$1(run2))
|
|
289282
|
-
return true;
|
|
289283
|
-
}
|
|
289284
|
-
return false;
|
|
289285
289655
|
}, capitalizeText$3 = (text5) => {
|
|
289286
289656
|
if (!text5)
|
|
289287
289657
|
return text5;
|
|
@@ -289308,7 +289678,7 @@ menclose::after {
|
|
|
289308
289678
|
if (SPACE_CHARS$1.has(text5[i4]))
|
|
289309
289679
|
spaces += 1;
|
|
289310
289680
|
return spaces;
|
|
289311
|
-
}, getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride) => {
|
|
289681
|
+
}, getJustifyAdjustment = ({ block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride }) => {
|
|
289312
289682
|
if (block.kind !== "paragraph")
|
|
289313
289683
|
return {
|
|
289314
289684
|
extraPerSpace: 0,
|
|
@@ -289320,7 +289690,6 @@ menclose::after {
|
|
|
289320
289690
|
totalSpaces: 0
|
|
289321
289691
|
};
|
|
289322
289692
|
const alignment$1 = alignmentOverride ?? block.attrs?.alignment;
|
|
289323
|
-
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined) ?? false;
|
|
289324
289693
|
const lastRunIndex = block.runs.length - 1;
|
|
289325
289694
|
const lastRun = block.runs[lastRunIndex];
|
|
289326
289695
|
const lastRunLength = getRunCharacterLength(lastRun);
|
|
@@ -289328,7 +289697,8 @@ menclose::after {
|
|
|
289328
289697
|
const derivedEndsWithLineBreak = lastRun ? lastRun.kind === "lineBreak" : false;
|
|
289329
289698
|
if (!shouldApplyJustify({
|
|
289330
289699
|
alignment: alignment$1,
|
|
289331
|
-
hasExplicitPositioning,
|
|
289700
|
+
hasExplicitPositioning: line.segments?.some((seg) => seg.x !== undefined) ?? false,
|
|
289701
|
+
hasExplicitTabStops: line.hasExplicitTabStops === true,
|
|
289332
289702
|
isLastLineOfParagraph: isLastLineOfParagraph ?? derivedIsLastLine,
|
|
289333
289703
|
paragraphEndsWithLineBreak: paragraphEndsWithLineBreak ?? derivedEndsWithLineBreak,
|
|
289334
289704
|
skipJustifyOverride
|
|
@@ -290130,7 +290500,8 @@ menclose::after {
|
|
|
290130
290500
|
}).map((stop) => ({
|
|
290131
290501
|
pos: twipsToPx$1(stop.pos),
|
|
290132
290502
|
val: stop.val,
|
|
290133
|
-
leader: stop.leader
|
|
290503
|
+
leader: stop.leader,
|
|
290504
|
+
source: stop.source
|
|
290134
290505
|
}));
|
|
290135
290506
|
}, getNextTabStopPx$1 = (currentX, tabStops, startIndex) => {
|
|
290136
290507
|
let index2 = startIndex;
|
|
@@ -290320,6 +290691,8 @@ menclose::after {
|
|
|
290320
290691
|
const clampedTarget = Number.isFinite(maxAbsWidth) ? Math.min(target, maxAbsWidth) : target;
|
|
290321
290692
|
const relativeTarget = clampedTarget - effectiveIndent;
|
|
290322
290693
|
lineWidth = Math.max(lineWidth, relativeTarget);
|
|
290694
|
+
if (stop?.source === "explicit")
|
|
290695
|
+
line.hasExplicitTabStops = true;
|
|
290323
290696
|
let currentLeader = null;
|
|
290324
290697
|
if (stop?.leader && stop.leader !== "none") {
|
|
290325
290698
|
currentLeader = {
|
|
@@ -296410,7 +296783,8 @@ menclose::after {
|
|
|
296410
296783
|
}).map((stop) => ({
|
|
296411
296784
|
pos: twipsToPx(stop.pos),
|
|
296412
296785
|
val: stop.val,
|
|
296413
|
-
leader: stop.leader
|
|
296786
|
+
leader: stop.leader,
|
|
296787
|
+
source: stop.source
|
|
296414
296788
|
}));
|
|
296415
296789
|
}, getNextTabStopPx = (currentX, tabStops, startIndex) => {
|
|
296416
296790
|
let index2 = startIndex;
|
|
@@ -298068,12 +298442,12 @@ menclose::after {
|
|
|
298068
298442
|
return;
|
|
298069
298443
|
console.log(...args$1);
|
|
298070
298444
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
|
|
298071
|
-
var
|
|
298445
|
+
var init_src_BA9o3DfT_es = __esm(() => {
|
|
298072
298446
|
init_rolldown_runtime_Bg48TavK_es();
|
|
298073
|
-
|
|
298447
|
+
init_SuperConverter_DklB_kc9_es();
|
|
298074
298448
|
init_jszip_C49i9kUs_es();
|
|
298075
298449
|
init_uuid_qzgm05fK_es();
|
|
298076
|
-
|
|
298450
|
+
init_create_headless_toolbar_lTVVsGdE_es();
|
|
298077
298451
|
init_constants_DrU4EASo_es();
|
|
298078
298452
|
init_dist_B8HfvhaK_es();
|
|
298079
298453
|
init_unified_Dsuw2be5_es();
|
|
@@ -321963,8 +322337,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
321963
322337
|
KIND_ORDER = ["header", "footer"];
|
|
321964
322338
|
HEADER_FILE_PATTERN2 = /header(\d+)\.xml$/;
|
|
321965
322339
|
FOOTER_FILE_PATTERN2 = /footer(\d+)\.xml$/;
|
|
321966
|
-
SETTINGS_PART = SETTINGS_PART_PATH;
|
|
321967
322340
|
SPECIAL_NOTE_TYPES = new Set(["separator", "continuationSeparator"]);
|
|
322341
|
+
SETTINGS_PART = SETTINGS_PART_PATH;
|
|
321968
322342
|
RESTART_POLICY_TO_OOXML = {
|
|
321969
322343
|
continuous: "continuous",
|
|
321970
322344
|
eachSection: "eachSect",
|
|
@@ -328012,14 +328386,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
328012
328386
|
el.appendChild(barEl);
|
|
328013
328387
|
});
|
|
328014
328388
|
const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
|
|
328015
|
-
const manualTabWithoutSegments = runsForLine.some((run2) => run2.kind === "tab") && !hasExplicitPositioning;
|
|
328016
328389
|
const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
|
|
328017
328390
|
const justifyShouldApply = shouldApplyJustify({
|
|
328018
328391
|
alignment: block.attrs?.alignment,
|
|
328019
328392
|
hasExplicitPositioning: hasExplicitPositioning ?? false,
|
|
328393
|
+
hasExplicitTabStops: line.hasExplicitTabStops === true,
|
|
328020
328394
|
isLastLineOfParagraph: false,
|
|
328021
328395
|
paragraphEndsWithLineBreak: false,
|
|
328022
|
-
skipJustifyOverride: skipJustify
|
|
328396
|
+
skipJustifyOverride: skipJustify
|
|
328023
328397
|
});
|
|
328024
328398
|
const countSpaces$1 = (text5) => {
|
|
328025
328399
|
let count2 = 0;
|
|
@@ -334218,6 +334592,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334218
334592
|
if (target.kind === "block")
|
|
334219
334593
|
return await this.#navigateToBlock(target);
|
|
334220
334594
|
if (target.kind === "entity") {
|
|
334595
|
+
if (target.entityType === "bookmark")
|
|
334596
|
+
return await this.#navigateToBookmark(target);
|
|
334221
334597
|
if (target.entityType === "comment")
|
|
334222
334598
|
return await this.#navigateToComment(target.entityId);
|
|
334223
334599
|
if (target.entityType === "trackedChange")
|
|
@@ -334295,6 +334671,28 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334295
334671
|
});
|
|
334296
334672
|
return true;
|
|
334297
334673
|
}
|
|
334674
|
+
async#navigateToBookmark(target) {
|
|
334675
|
+
const editor = this.#editor;
|
|
334676
|
+
if (!editor)
|
|
334677
|
+
return false;
|
|
334678
|
+
let storyKey = resolveStoryKeyFromAddress(target.story);
|
|
334679
|
+
if (!storyKey) {
|
|
334680
|
+
const entry = findAllBookmarksInDocument(editor).find((bookmark) => bookmark.name === target.name);
|
|
334681
|
+
if (!entry)
|
|
334682
|
+
return false;
|
|
334683
|
+
storyKey = entry.storyKey;
|
|
334684
|
+
}
|
|
334685
|
+
if (!storyKey || storyKey === "body") {
|
|
334686
|
+
this.exitActiveStorySurface();
|
|
334687
|
+
return await this.goToAnchor(target.name);
|
|
334688
|
+
}
|
|
334689
|
+
if (this.#navigateToActiveStoryBookmark(target.name, storyKey))
|
|
334690
|
+
return true;
|
|
334691
|
+
const activatedStoryKey = await this.#activateBookmarkStorySurface(storyKey);
|
|
334692
|
+
if (activatedStoryKey)
|
|
334693
|
+
return this.#navigateToActiveStoryBookmark(target.name, activatedStoryKey);
|
|
334694
|
+
return false;
|
|
334695
|
+
}
|
|
334298
334696
|
async#navigateToTrackedChange(entityId, storyKey, preferredPageIndex) {
|
|
334299
334697
|
const editor = this.#editor;
|
|
334300
334698
|
if (!editor)
|
|
@@ -334396,6 +334794,135 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334396
334794
|
}
|
|
334397
334795
|
return this.#getActiveTrackedChangeStorySurface()?.storyKey === storyKey;
|
|
334398
334796
|
}
|
|
334797
|
+
async#activateBookmarkStorySurface(storyKey) {
|
|
334798
|
+
let locator = null;
|
|
334799
|
+
try {
|
|
334800
|
+
locator = parseStoryKey(storyKey);
|
|
334801
|
+
} catch {
|
|
334802
|
+
return null;
|
|
334803
|
+
}
|
|
334804
|
+
if (!locator || locator.storyType === "body")
|
|
334805
|
+
return null;
|
|
334806
|
+
if (locator.storyType === "footnote" || locator.storyType === "endnote")
|
|
334807
|
+
return this.#activateBookmarkNoteStorySurface(locator);
|
|
334808
|
+
if (locator.storyType === "headerFooterPart" || locator.storyType === "headerFooterSlot")
|
|
334809
|
+
return this.#activateBookmarkHeaderFooterSurface(locator);
|
|
334810
|
+
return null;
|
|
334811
|
+
}
|
|
334812
|
+
async#activateBookmarkNoteStorySurface(locator) {
|
|
334813
|
+
const targetContext = this.#buildNoteLayoutContext({
|
|
334814
|
+
storyType: locator.storyType,
|
|
334815
|
+
noteId: locator.noteId
|
|
334816
|
+
});
|
|
334817
|
+
if ((this.#headerFooterSession?.session?.mode ?? "body") !== "body")
|
|
334818
|
+
this.#headerFooterSession?.exitMode();
|
|
334819
|
+
const firstPageIndex = targetContext?.firstPageIndex ?? 0;
|
|
334820
|
+
const hostWidthPx = targetContext?.hostWidthPx ?? Math.max(1, this.#visibleHost?.clientWidth ?? 1);
|
|
334821
|
+
this.#scrollPageIntoView(firstPageIndex);
|
|
334822
|
+
const totalPageCount = this.#layoutState.layout?.pages?.length ?? 1;
|
|
334823
|
+
const pageNumber = Math.max(1, firstPageIndex + 1);
|
|
334824
|
+
this.#ensureStorySessionManager().activate(locator, {
|
|
334825
|
+
commitPolicy: "onExit",
|
|
334826
|
+
preferHiddenHost: true,
|
|
334827
|
+
hostWidthPx,
|
|
334828
|
+
editorContext: {
|
|
334829
|
+
currentPageNumber: pageNumber,
|
|
334830
|
+
totalPageCount: Math.max(1, totalPageCount),
|
|
334831
|
+
surfaceKind: locator.storyType === "endnote" ? "endnote" : "note"
|
|
334832
|
+
}
|
|
334833
|
+
});
|
|
334834
|
+
const storyKey = buildStoryKey(locator);
|
|
334835
|
+
return await this.#waitForTrackedChangeStorySurface(storyKey) ? storyKey : null;
|
|
334836
|
+
}
|
|
334837
|
+
async#activateBookmarkHeaderFooterSurface(locator) {
|
|
334838
|
+
const region = this.#findHeaderFooterRegionForBookmarkLocator(locator);
|
|
334839
|
+
const expectedRefId = locator.storyType === "headerFooterPart" ? locator.refId : region ? this.#resolveBookmarkHeaderFooterRefId(region, locator) : null;
|
|
334840
|
+
if (!region || !expectedRefId)
|
|
334841
|
+
return null;
|
|
334842
|
+
this.#scrollPageIntoView(region.pageIndex);
|
|
334843
|
+
await this.#waitForPageMount(region.pageIndex, { timeout: PresentationEditor2.ANCHOR_NAV_TIMEOUT_MS });
|
|
334844
|
+
if (!await this.#headerFooterSession?.activateRegion(region, { initialSelection: "defer" }))
|
|
334845
|
+
return null;
|
|
334846
|
+
return buildStoryKey({
|
|
334847
|
+
kind: "story",
|
|
334848
|
+
storyType: "headerFooterPart",
|
|
334849
|
+
refId: expectedRefId
|
|
334850
|
+
});
|
|
334851
|
+
}
|
|
334852
|
+
#resolveBookmarkHeaderFooterRefId(region, locator) {
|
|
334853
|
+
if (region.headerFooterRefId)
|
|
334854
|
+
return region.headerFooterRefId;
|
|
334855
|
+
const page = this.#layoutState.layout?.pages?.[region.pageIndex];
|
|
334856
|
+
if (!page)
|
|
334857
|
+
return null;
|
|
334858
|
+
const refCollection = locator.headerFooterKind === "header" ? page.sectionRefs?.headerRefs : page.sectionRefs?.footerRefs;
|
|
334859
|
+
if (!refCollection)
|
|
334860
|
+
return null;
|
|
334861
|
+
const normalizedRegionVariant = region.sectionType ? normalizeVariant(region.sectionType) : null;
|
|
334862
|
+
const candidates = [
|
|
334863
|
+
region.sectionType,
|
|
334864
|
+
normalizedRegionVariant,
|
|
334865
|
+
locator.variant
|
|
334866
|
+
].filter((variant) => typeof variant === "string" && variant.length > 0);
|
|
334867
|
+
for (const variant of candidates) {
|
|
334868
|
+
const refId = refCollection[variant];
|
|
334869
|
+
if (typeof refId === "string" && refId.length > 0)
|
|
334870
|
+
return refId;
|
|
334871
|
+
}
|
|
334872
|
+
return null;
|
|
334873
|
+
}
|
|
334874
|
+
#findHeaderFooterRegionForBookmarkLocator(locator) {
|
|
334875
|
+
const manager = this.#headerFooterSession;
|
|
334876
|
+
if (!manager)
|
|
334877
|
+
return null;
|
|
334878
|
+
const searchRegions = locator.storyType === "headerFooterSlot" ? locator.headerFooterKind === "header" ? manager.headerRegions : manager.footerRegions : new Map([...manager.headerRegions.entries(), ...manager.footerRegions.entries()]);
|
|
334879
|
+
for (const region of searchRegions.values()) {
|
|
334880
|
+
if (locator.storyType === "headerFooterPart") {
|
|
334881
|
+
if (region.headerFooterRefId === locator.refId)
|
|
334882
|
+
return region;
|
|
334883
|
+
continue;
|
|
334884
|
+
}
|
|
334885
|
+
if (region.sectionId !== locator.section.sectionId)
|
|
334886
|
+
continue;
|
|
334887
|
+
if (region.sectionType && normalizeVariant(region.sectionType) !== locator.variant)
|
|
334888
|
+
continue;
|
|
334889
|
+
return region;
|
|
334890
|
+
}
|
|
334891
|
+
if (locator.storyType === "headerFooterPart") {
|
|
334892
|
+
const layout = this.#layoutState.layout;
|
|
334893
|
+
if (!layout)
|
|
334894
|
+
return null;
|
|
334895
|
+
for (let pageIndex = 0;pageIndex < layout.pages.length; pageIndex += 1) {
|
|
334896
|
+
const page = layout.pages[pageIndex];
|
|
334897
|
+
if (Object.values(page.sectionRefs?.headerRefs ?? {}).includes(locator.refId))
|
|
334898
|
+
return manager.getRegionForPage("header", pageIndex) ?? manager.findRegionForPage("header", pageIndex);
|
|
334899
|
+
if (Object.values(page.sectionRefs?.footerRefs ?? {}).includes(locator.refId))
|
|
334900
|
+
return manager.getRegionForPage("footer", pageIndex) ?? manager.findRegionForPage("footer", pageIndex);
|
|
334901
|
+
}
|
|
334902
|
+
}
|
|
334903
|
+
return null;
|
|
334904
|
+
}
|
|
334905
|
+
#navigateToActiveStoryBookmark(name, storyKey) {
|
|
334906
|
+
const activeSurface = this.#getActiveTrackedChangeStorySurface();
|
|
334907
|
+
if (!activeSurface || activeSurface.storyKey !== storyKey)
|
|
334908
|
+
return false;
|
|
334909
|
+
let resolved;
|
|
334910
|
+
try {
|
|
334911
|
+
resolved = resolveBookmarkTarget(activeSurface.editor.state.doc, {
|
|
334912
|
+
kind: "entity",
|
|
334913
|
+
entityType: "bookmark",
|
|
334914
|
+
name
|
|
334915
|
+
});
|
|
334916
|
+
} catch {
|
|
334917
|
+
return false;
|
|
334918
|
+
}
|
|
334919
|
+
activeSurface.editor.commands?.setTextSelection?.({
|
|
334920
|
+
from: resolved.pos,
|
|
334921
|
+
to: resolved.pos
|
|
334922
|
+
});
|
|
334923
|
+
this.#focusAndRevealActiveStorySelection(activeSurface.editor);
|
|
334924
|
+
return true;
|
|
334925
|
+
}
|
|
334399
334926
|
#navigateToActiveStoryTrackedChange(entityId, storyKey) {
|
|
334400
334927
|
const activeSurface = this.#getActiveTrackedChangeStorySurface();
|
|
334401
334928
|
if (!activeSurface || activeSurface.storyKey !== storyKey)
|
|
@@ -334458,6 +334985,17 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
334458
334985
|
blocks: this.#layoutState.blocks,
|
|
334459
334986
|
measures: this.#layoutState.measures,
|
|
334460
334987
|
bookmarks: this.#layoutState.bookmarks,
|
|
334988
|
+
resolveAnchorPosition: (name) => {
|
|
334989
|
+
try {
|
|
334990
|
+
return resolveBookmarkTarget(this.#editor.state.doc, {
|
|
334991
|
+
kind: "entity",
|
|
334992
|
+
entityType: "bookmark",
|
|
334993
|
+
name
|
|
334994
|
+
}).pos;
|
|
334995
|
+
} catch {
|
|
334996
|
+
return null;
|
|
334997
|
+
}
|
|
334998
|
+
},
|
|
334461
334999
|
pageGeometryHelper: this.#pageGeometryHelper ?? undefined,
|
|
334462
335000
|
painterHost: this.#painterHost,
|
|
334463
335001
|
scrollContainer: this.#scrollContainer ?? this.#visibleHost,
|
|
@@ -335294,11 +335832,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
335294
335832
|
];
|
|
335295
335833
|
});
|
|
335296
335834
|
|
|
335297
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
335835
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-C-uFDEFx.es.js
|
|
335298
335836
|
var ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
335299
|
-
var
|
|
335300
|
-
|
|
335301
|
-
|
|
335837
|
+
var init_create_super_doc_ui_C_uFDEFx_es = __esm(() => {
|
|
335838
|
+
init_SuperConverter_DklB_kc9_es();
|
|
335839
|
+
init_create_headless_toolbar_lTVVsGdE_es();
|
|
335302
335840
|
ALL_TOOLBAR_COMMAND_IDS = Object.keys(createToolbarRegistry());
|
|
335303
335841
|
EMPTY_ACTIVE_IDS = Object.freeze([]);
|
|
335304
335842
|
});
|
|
@@ -335316,16 +335854,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
335316
335854
|
|
|
335317
335855
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
335318
335856
|
var init_super_editor_es = __esm(() => {
|
|
335319
|
-
|
|
335320
|
-
|
|
335857
|
+
init_src_BA9o3DfT_es();
|
|
335858
|
+
init_SuperConverter_DklB_kc9_es();
|
|
335321
335859
|
init_jszip_C49i9kUs_es();
|
|
335322
335860
|
init_xml_js_CqGKpaft_es();
|
|
335323
|
-
|
|
335861
|
+
init_create_headless_toolbar_lTVVsGdE_es();
|
|
335324
335862
|
init_constants_DrU4EASo_es();
|
|
335325
335863
|
init_dist_B8HfvhaK_es();
|
|
335326
335864
|
init_unified_Dsuw2be5_es();
|
|
335327
335865
|
init_DocxZipper_CUX64E5K_es();
|
|
335328
|
-
|
|
335866
|
+
init_create_super_doc_ui_C_uFDEFx_es();
|
|
335329
335867
|
init_ui_CGB3qmy3_es();
|
|
335330
335868
|
init_eventemitter3_BJrNoN9D_es();
|
|
335331
335869
|
init_errors_C_DoKMoN_es();
|