@mintlify/common 1.0.1138 → 1.0.1140
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/api-reference/parseApiTargetFromMetadata.d.ts +0 -0
- package/dist/api-reference/parseApiTargetFromMetadata.js +0 -0
- package/dist/apiStaticExportBasePaths.d.ts +0 -0
- package/dist/apiStaticExportBasePaths.js +0 -0
- package/dist/asyncapi/checkForExternalRefs.d.ts +0 -0
- package/dist/asyncapi/checkForExternalRefs.js +0 -0
- package/dist/asyncapi/getAsyncApiChannelMetadata.d.ts +0 -0
- package/dist/asyncapi/getAsyncApiChannelMetadata.js +0 -0
- package/dist/asyncapi/getAsyncApiDocumentFromUrl.d.ts +0 -0
- package/dist/asyncapi/getAsyncApiDocumentFromUrl.js +0 -0
- package/dist/asyncapi/getEnumValues.d.ts +0 -0
- package/dist/asyncapi/getEnumValues.js +0 -0
- package/dist/asyncapi/index.d.ts +0 -0
- package/dist/asyncapi/index.js +0 -0
- package/dist/asyncapi/parseAsyncApiString.d.ts +0 -0
- package/dist/asyncapi/parseAsyncApiString.js +0 -0
- package/dist/asyncapi/parser/extractSchemaProperties.d.ts +0 -0
- package/dist/asyncapi/parser/extractSchemaProperties.js +0 -0
- package/dist/asyncapi/parser/getBindingsData.d.ts +0 -0
- package/dist/asyncapi/parser/getBindingsData.js +0 -0
- package/dist/asyncapi/parser/getChannelData.d.ts +0 -0
- package/dist/asyncapi/parser/getChannelData.js +0 -0
- package/dist/asyncapi/parser/getExamplesData.d.ts +0 -0
- package/dist/asyncapi/parser/getExamplesData.js +0 -0
- package/dist/asyncapi/parser/getExtensionsData.d.ts +0 -0
- package/dist/asyncapi/parser/getExtensionsData.js +0 -0
- package/dist/asyncapi/parser/getMessagesData.d.ts +0 -0
- package/dist/asyncapi/parser/getMessagesData.js +0 -0
- package/dist/asyncapi/parser/getOperationsData.d.ts +0 -0
- package/dist/asyncapi/parser/getOperationsData.js +0 -0
- package/dist/asyncapi/parser/getParametersData.d.ts +0 -0
- package/dist/asyncapi/parser/getParametersData.js +0 -0
- package/dist/asyncapi/parser/getSecuritySchemesData.d.ts +0 -0
- package/dist/asyncapi/parser/getSecuritySchemesData.js +0 -0
- package/dist/asyncapi/parser/getServersData.d.ts +0 -0
- package/dist/asyncapi/parser/getServersData.js +0 -0
- package/dist/asyncapi/prepAsyncApiFrontmatter.d.ts +0 -0
- package/dist/asyncapi/prepAsyncApiFrontmatter.js +0 -0
- package/dist/asyncapi/validateAsyncApi.d.ts +0 -0
- package/dist/asyncapi/validateAsyncApi.js +0 -0
- package/dist/basePaths.d.ts +0 -0
- package/dist/basePaths.js +0 -0
- package/dist/camelToSentenceCase.d.ts +0 -0
- package/dist/camelToSentenceCase.js +0 -0
- package/dist/colors.d.ts +0 -0
- package/dist/colors.js +0 -0
- package/dist/css/index.d.ts +0 -0
- package/dist/css/index.js +0 -0
- package/dist/css/tailwind.d.ts +0 -0
- package/dist/css/tailwind.js +0 -0
- package/dist/divisions/generatePathToBoostDict.d.ts +0 -0
- package/dist/divisions/generatePathToBoostDict.js +0 -0
- package/dist/divisions/generatePathToHiddenDict.d.ts +0 -0
- package/dist/divisions/generatePathToHiddenDict.js +0 -0
- package/dist/divisions/generatePathToHiddenFromSearchDict.d.ts +0 -0
- package/dist/divisions/generatePathToHiddenFromSearchDict.js +0 -0
- package/dist/divisions/generatePathToLanguageDict.d.ts +0 -0
- package/dist/divisions/generatePathToLanguageDict.js +0 -0
- package/dist/divisions/generatePathToProductDict.d.ts +0 -0
- package/dist/divisions/generatePathToProductDict.js +0 -0
- package/dist/divisions/generatePathToPublicDict.d.ts +0 -0
- package/dist/divisions/generatePathToPublicDict.js +0 -0
- package/dist/divisions/generatePathToVersionDict.d.ts +0 -0
- package/dist/divisions/generatePathToVersionDict.js +0 -0
- package/dist/divisions/generatePathToVersionDictForDocsConfig.d.ts +0 -0
- package/dist/divisions/generatePathToVersionDictForDocsConfig.js +0 -0
- package/dist/divisions/index.d.ts +0 -0
- package/dist/divisions/index.js +0 -0
- package/dist/divisions/iterateObjectArrayProperty.d.ts +0 -0
- package/dist/divisions/iterateObjectArrayProperty.js +0 -0
- package/dist/entitlements/index.d.ts +0 -0
- package/dist/entitlements/index.js +0 -0
- package/dist/exponentialBackoff.d.ts +0 -0
- package/dist/exponentialBackoff.js +0 -0
- package/dist/frontmatter/index.d.ts +0 -0
- package/dist/frontmatter/index.js +0 -0
- package/dist/frontmatter/parseFrontmatter.d.ts +0 -0
- package/dist/frontmatter/parseFrontmatter.js +0 -0
- package/dist/fs/addBasePath.d.ts +0 -0
- package/dist/fs/addBasePath.js +0 -0
- package/dist/fs/createPathArr.d.ts +0 -0
- package/dist/fs/createPathArr.js +0 -0
- package/dist/fs/index.d.ts +0 -0
- package/dist/fs/index.js +0 -0
- package/dist/fs/normalizeRelativePath.d.ts +0 -0
- package/dist/fs/normalizeRelativePath.js +0 -0
- package/dist/fs/optionallySlash.d.ts +0 -0
- package/dist/fs/optionallySlash.js +0 -0
- package/dist/fs/removeBasePath.d.ts +0 -0
- package/dist/fs/removeBasePath.js +0 -0
- package/dist/fs/removeLeadingSlash.d.ts +0 -0
- package/dist/fs/removeLeadingSlash.js +0 -0
- package/dist/fs/toPosixPath.d.ts +0 -0
- package/dist/fs/toPosixPath.js +0 -0
- package/dist/getDisplayDomain.d.ts +0 -0
- package/dist/getDisplayDomain.js +0 -0
- package/dist/getFileCategory.d.ts +0 -0
- package/dist/getFileCategory.js +0 -0
- package/dist/getRelativeRecordName.d.ts +0 -0
- package/dist/getRelativeRecordName.js +0 -0
- package/dist/getRelativeRecordName.test.d.ts +0 -0
- package/dist/getRelativeRecordName.test.js +0 -0
- package/dist/getSecurityOptionsForAuthMethod.d.ts +0 -0
- package/dist/getSecurityOptionsForAuthMethod.js +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/isAbsoluteUrl.d.ts +0 -0
- package/dist/isAbsoluteUrl.js +0 -0
- package/dist/isAllowedRedirectUri.d.ts +0 -0
- package/dist/isAllowedRedirectUri.js +0 -0
- package/dist/isAllowedRedirectUri.test.d.ts +0 -0
- package/dist/isAllowedRedirectUri.test.js +0 -0
- package/dist/isDocsConfig.d.ts +0 -0
- package/dist/isDocsConfig.js +0 -0
- package/dist/isOrgLessThanTwoWeeksOld.d.ts +0 -0
- package/dist/isOrgLessThanTwoWeeksOld.js +0 -0
- package/dist/isValidEmail.d.ts +0 -0
- package/dist/isValidEmail.js +0 -0
- package/dist/isWildcardRedirect.d.ts +0 -0
- package/dist/isWildcardRedirect.js +0 -0
- package/dist/knownMcpClients.d.ts +0 -0
- package/dist/knownMcpClients.js +0 -0
- package/dist/knownMcpClients.test.d.ts +0 -0
- package/dist/knownMcpClients.test.js +0 -0
- package/dist/live-preview.d.ts +0 -0
- package/dist/live-preview.js +0 -0
- package/dist/mdx/astUtils.d.ts +0 -0
- package/dist/mdx/astUtils.js +0 -0
- package/dist/mdx/componentIds.d.ts +0 -0
- package/dist/mdx/componentIds.js +0 -0
- package/dist/mdx/getCodeStyling.d.ts +0 -0
- package/dist/mdx/getCodeStyling.js +0 -0
- package/dist/mdx/getMDXOptions.d.ts +0 -0
- package/dist/mdx/getMDXOptions.js +0 -0
- package/dist/mdx/getS3ImageUri.d.ts +0 -0
- package/dist/mdx/getS3ImageUri.js +0 -0
- package/dist/mdx/index.d.ts +0 -0
- package/dist/mdx/index.js +0 -0
- package/dist/mdx/lib/findExportedNode.d.ts +0 -0
- package/dist/mdx/lib/findExportedNode.js +0 -0
- package/dist/mdx/lib/index.d.ts +0 -0
- package/dist/mdx/lib/index.js +0 -0
- package/dist/mdx/lib/mdx-utils.d.ts +0 -0
- package/dist/mdx/lib/mdx-utils.js +0 -0
- package/dist/mdx/lib/remark-utils.d.ts +0 -0
- package/dist/mdx/lib/remark-utils.js +0 -0
- package/dist/mdx/plugins/index.d.ts +0 -0
- package/dist/mdx/plugins/index.js +0 -0
- package/dist/mdx/plugins/rehype/index.d.ts +0 -0
- package/dist/mdx/plugins/rehype/index.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/buildMetaAttributes.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/buildMetaAttributes.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/index.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/index.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/parseMetaString.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks/parseMetaString.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeDynamicTailwindCss.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeDynamicTailwindCss.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeKeyboardSymbols.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeKeyboardSymbols.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeListItemText.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeListItemText.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/findParentSchema.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/findParentSchema.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/index.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/index.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/insertSchema.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/insertSchema.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractExamples.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeMdxExtractExamples.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeOptimizedVideo.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeOptimizedVideo.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeParamFieldIds.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeParamFieldIds.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeRawComponents.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeRawComponents.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeTable.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeTable.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeUnicodeIds.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeUnicodeIds.js +0 -0
- package/dist/mdx/plugins/rehype/rehypeZoomImages.d.ts +0 -0
- package/dist/mdx/plugins/rehype/rehypeZoomImages.js +0 -0
- package/dist/mdx/plugins/rehype/segment.d.ts +0 -0
- package/dist/mdx/plugins/rehype/segment.js +0 -0
- package/dist/mdx/plugins/remark/index.d.ts +0 -0
- package/dist/mdx/plugins/remark/index.js +0 -0
- package/dist/mdx/plugins/remark/remark-mdx-style-string-to-object.d.ts +0 -0
- package/dist/mdx/plugins/remark/remark-mdx-style-string-to-object.js +0 -0
- package/dist/mdx/plugins/remark/remarkComponentIds.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkComponentIds.js +0 -0
- package/dist/mdx/plugins/remark/remarkExpandContent.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkExpandContent.js +0 -0
- package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.js +0 -0
- package/dist/mdx/plugins/remark/remarkExtractMultiView.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkExtractMultiView.js +0 -0
- package/dist/mdx/plugins/remark/remarkExtractTableOfContents.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkExtractTableOfContents.js +0 -0
- package/dist/mdx/plugins/remark/remarkFileTree.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkFileTree.js +0 -0
- package/dist/mdx/plugins/remark/remarkFrames.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkFrames.js +0 -0
- package/dist/mdx/plugins/remark/remarkMapExplicitAnchors.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMapExplicitAnchors.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxClientComponentBoundaries.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxClientComponentBoundaries.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxExtractPanel.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxExtractPanel.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxInjectSnippets.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxInjectSnippets.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveJs.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveJs.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/createCommentNode.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/createCommentNode.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.js +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnusedVariables.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnusedVariables.js +0 -0
- package/dist/mdx/plugins/remark/remarkMermaid.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkMermaid.js +0 -0
- package/dist/mdx/plugins/remark/remarkNoCopyLanguage.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkNoCopyLanguage.js +0 -0
- package/dist/mdx/plugins/remark/remarkPrompt.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkPrompt.js +0 -0
- package/dist/mdx/plugins/remark/remarkRemoveImports.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkRemoveImports.js +0 -0
- package/dist/mdx/plugins/remark/remarkResolveRelativeLinks.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkResolveRelativeLinks.js +0 -0
- package/dist/mdx/plugins/remark/remarkSplitCodeGroup.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkSplitCodeGroup.js +0 -0
- package/dist/mdx/plugins/remark/remarkSplitTabs.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkSplitTabs.js +0 -0
- package/dist/mdx/plugins/remark/remarkTitleMarkdown.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkTitleMarkdown.js +0 -0
- package/dist/mdx/plugins/remark/remarkUnwrapInlineJsx.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkUnwrapInlineJsx.js +0 -0
- package/dist/mdx/plugins/remark/remarkUnwrapJsxHeadings.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkUnwrapJsxHeadings.js +0 -0
- package/dist/mdx/plugins/remark/remarkValidateAccordions.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkValidateAccordions.js +0 -0
- package/dist/mdx/plugins/remark/remarkValidateApiExamples.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkValidateApiExamples.js +0 -0
- package/dist/mdx/plugins/remark/remarkValidateSteps.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkValidateSteps.js +0 -0
- package/dist/mdx/plugins/remark/remarkValidateTabs.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkValidateTabs.js +0 -0
- package/dist/mdx/plugins/remark/remarkValidateVisibility.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkValidateVisibility.js +0 -0
- package/dist/mdx/plugins/remark/remarkVideo.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkVideo.js +0 -0
- package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.d.ts +0 -0
- package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.js +0 -0
- package/dist/mdx/plugins/remark/variation.d.ts +0 -0
- package/dist/mdx/plugins/remark/variation.js +0 -0
- package/dist/mdx/preprocessCustomHeadingIds.d.ts +0 -0
- package/dist/mdx/preprocessCustomHeadingIds.js +0 -0
- package/dist/mdx/preprocessCustomHeadingIds.test.d.ts +0 -0
- package/dist/mdx/preprocessCustomHeadingIds.test.js +0 -0
- package/dist/mdx/preprocessMdxFragmentCode.d.ts +0 -0
- package/dist/mdx/preprocessMdxFragmentCode.js +0 -0
- package/dist/mdx/preprocessMdxFragmentCode.test.d.ts +0 -0
- package/dist/mdx/preprocessMdxFragmentCode.test.js +0 -0
- package/dist/mdx/remark.d.ts +0 -0
- package/dist/mdx/remark.js +0 -0
- package/dist/mdx/replaceVariables.d.ts +0 -0
- package/dist/mdx/replaceVariables.js +0 -0
- package/dist/mdx/server-only/getMdx/snippets.d.ts +0 -0
- package/dist/mdx/server-only/getMdx/snippets.js +0 -0
- package/dist/mdx/server-only/getMdx.d.ts +0 -0
- package/dist/mdx/server-only/getMdx.js +0 -0
- package/dist/mdx/server-only/getSerializeExtras.d.ts +0 -0
- package/dist/mdx/server-only/getSerializeExtras.js +0 -0
- package/dist/mdx/server-only/index.d.ts +0 -0
- package/dist/mdx/server-only/index.js +0 -0
- package/dist/mdx/snippets/buildImportMap.d.ts +0 -0
- package/dist/mdx/snippets/buildImportMap.js +0 -0
- package/dist/mdx/snippets/constants.d.ts +0 -0
- package/dist/mdx/snippets/constants.js +0 -0
- package/dist/mdx/snippets/extractImportSources.d.ts +0 -0
- package/dist/mdx/snippets/extractImportSources.js +0 -0
- package/dist/mdx/snippets/findAndRemoveExports.d.ts +0 -0
- package/dist/mdx/snippets/findAndRemoveExports.js +0 -0
- package/dist/mdx/snippets/findAndRemoveImports.d.ts +0 -0
- package/dist/mdx/snippets/findAndRemoveImports.js +0 -0
- package/dist/mdx/snippets/getExportMap.d.ts +0 -0
- package/dist/mdx/snippets/getExportMap.js +0 -0
- package/dist/mdx/snippets/getJsxEsmTree.d.ts +0 -0
- package/dist/mdx/snippets/getJsxEsmTree.js +0 -0
- package/dist/mdx/snippets/hasImports.d.ts +0 -0
- package/dist/mdx/snippets/hasImports.js +0 -0
- package/dist/mdx/snippets/index.d.ts +0 -0
- package/dist/mdx/snippets/index.js +0 -0
- package/dist/mdx/snippets/isImportedAsSnippet.d.ts +0 -0
- package/dist/mdx/snippets/isImportedAsSnippet.js +0 -0
- package/dist/mdx/snippets/isJsxOrTsx.d.ts +0 -0
- package/dist/mdx/snippets/isJsxOrTsx.js +0 -0
- package/dist/mdx/snippets/isSnippetExtension.d.ts +0 -0
- package/dist/mdx/snippets/isSnippetExtension.js +0 -0
- package/dist/mdx/snippets/nodeIncludesExport.d.ts +0 -0
- package/dist/mdx/snippets/nodeIncludesExport.js +0 -0
- package/dist/mdx/snippets/removeExports.d.ts +0 -0
- package/dist/mdx/snippets/removeExports.js +0 -0
- package/dist/mdx/snippets/resolveAllImports.d.ts +0 -0
- package/dist/mdx/snippets/resolveAllImports.js +0 -0
- package/dist/mdx/snippets/resolveImport/addExportPrefix.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/addExportPrefix.js +0 -0
- package/dist/mdx/snippets/resolveImport/containsRegularFunction.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/containsRegularFunction.js +0 -0
- package/dist/mdx/snippets/resolveImport/exportCollision.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/exportCollision.js +0 -0
- package/dist/mdx/snippets/resolveImport/findExport.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/findExport.js +0 -0
- package/dist/mdx/snippets/resolveImport/index.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/index.js +0 -0
- package/dist/mdx/snippets/resolveImport/injectToTopOfFile.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/injectToTopOfFile.js +0 -0
- package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.d.ts +0 -0
- package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.js +0 -0
- package/dist/mdx/snippets/resolveImportPath.d.ts +0 -0
- package/dist/mdx/snippets/resolveImportPath.js +0 -0
- package/dist/mdx/snippets/stripTsxTypes.d.ts +0 -0
- package/dist/mdx/snippets/stripTsxTypes.js +0 -0
- package/dist/mdx/titleMarkdown.d.ts +0 -0
- package/dist/mdx/titleMarkdown.js +0 -0
- package/dist/mdx/utils.d.ts +0 -0
- package/dist/mdx/utils.js +0 -0
- package/dist/mintIgnore.d.ts +6 -2
- package/dist/mintIgnore.js +28 -4
- package/dist/navigation/accessiblePagesTraversal.test.d.ts +0 -0
- package/dist/navigation/accessiblePagesTraversal.test.js +0 -0
- package/dist/navigation/activeDivisionMatching.test.d.ts +0 -0
- package/dist/navigation/activeDivisionMatching.test.js +0 -0
- package/dist/navigation/checkNavAccess.d.ts +0 -0
- package/dist/navigation/checkNavAccess.js +0 -0
- package/dist/navigation/decoratedNavigationConfig.d.ts +0 -0
- package/dist/navigation/decoratedNavigationConfig.js +0 -0
- package/dist/navigation/filterDivisions.d.ts +0 -0
- package/dist/navigation/filterDivisions.js +0 -0
- package/dist/navigation/filterDivisions.test.d.ts +0 -0
- package/dist/navigation/filterDivisions.test.js +0 -0
- package/dist/navigation/firstHrefDivisionScoping.test.d.ts +0 -0
- package/dist/navigation/firstHrefDivisionScoping.test.js +0 -0
- package/dist/navigation/generatePathToBreadcrumbsMap.d.ts +0 -0
- package/dist/navigation/generatePathToBreadcrumbsMap.js +0 -0
- package/dist/navigation/generatePathToBreadcrumbsMapForDocsConfig.d.ts +0 -0
- package/dist/navigation/generatePathToBreadcrumbsMapForDocsConfig.js +0 -0
- package/dist/navigation/getAllPathsInDecoratedNav.d.ts +0 -0
- package/dist/navigation/getAllPathsInDecoratedNav.js +0 -0
- package/dist/navigation/getAllPathsInDocsNav.d.ts +0 -0
- package/dist/navigation/getAllPathsInDocsNav.js +0 -0
- package/dist/navigation/getFirstPageFromNavConfig.d.ts +0 -0
- package/dist/navigation/getFirstPageFromNavConfig.js +0 -0
- package/dist/navigation/getFirstPageFromNavigation.d.ts +0 -0
- package/dist/navigation/getFirstPageFromNavigation.js +0 -0
- package/dist/navigation/getScopedNavForPath.test.d.ts +0 -0
- package/dist/navigation/getScopedNavForPath.test.js +0 -0
- package/dist/navigation/getVersionOrLanguageFromPath.d.ts +0 -0
- package/dist/navigation/getVersionOrLanguageFromPath.js +0 -0
- package/dist/navigation/getVersionOrLanguageFromPath.test.d.ts +0 -0
- package/dist/navigation/getVersionOrLanguageFromPath.test.js +0 -0
- package/dist/navigation/index.d.ts +0 -0
- package/dist/navigation/index.js +0 -0
- package/dist/navigation/isCommonPage.d.ts +0 -0
- package/dist/navigation/isCommonPage.js +0 -0
- package/dist/navigation/isCommonPage.test.d.ts +0 -0
- package/dist/navigation/isCommonPage.test.js +0 -0
- package/dist/navigation/isGroup.d.ts +0 -0
- package/dist/navigation/isGroup.js +0 -0
- package/dist/navigation/isPage.d.ts +0 -0
- package/dist/navigation/isPage.js +0 -0
- package/dist/navigation/pathsDifferByOneSegment.test.d.ts +0 -0
- package/dist/navigation/pathsDifferByOneSegment.test.js +0 -0
- package/dist/navigation/prioritize-default-division-item.d.ts +0 -0
- package/dist/navigation/prioritize-default-division-item.js +0 -0
- package/dist/navigation/scopeNavDictCache.test.d.ts +0 -0
- package/dist/navigation/scopeNavDictCache.test.js +0 -0
- package/dist/navigation/scopeNavStateFlip.test.d.ts +0 -0
- package/dist/navigation/scopeNavStateFlip.test.js +0 -0
- package/dist/navigation/scopeNavToPath.d.ts +0 -0
- package/dist/navigation/scopeNavToPath.js +0 -0
- package/dist/navigation/scopeNavToPath.test.d.ts +0 -0
- package/dist/navigation/scopeNavToPath.test.js +0 -0
- package/dist/navigation/scopeOffPathDivisions.test.d.ts +0 -0
- package/dist/navigation/scopeOffPathDivisions.test.js +0 -0
- package/dist/navigation/scopeProductNav.test.d.ts +0 -0
- package/dist/navigation/scopeProductNav.test.js +0 -0
- package/dist/navigation/updateFirstHrefInDivision.d.ts +0 -0
- package/dist/navigation/updateFirstHrefInDivision.js +0 -0
- package/dist/navigation/updateFirstHrefInDivision.test.d.ts +0 -0
- package/dist/navigation/updateFirstHrefInDivision.test.js +0 -0
- package/dist/navigation/versionLanguageResolution.test.d.ts +0 -0
- package/dist/navigation/versionLanguageResolution.test.js +0 -0
- package/dist/openapi/buildOpenApiMetaTag.d.ts +0 -0
- package/dist/openapi/buildOpenApiMetaTag.js +0 -0
- package/dist/openapi/content-registry.test.d.ts +0 -0
- package/dist/openapi/content-registry.test.js +0 -0
- package/dist/openapi/contentRegistry.d.ts +0 -0
- package/dist/openapi/contentRegistry.js +0 -0
- package/dist/openapi/endpointRef.d.ts +0 -0
- package/dist/openapi/endpointRef.js +0 -0
- package/dist/openapi/fetchYamlDocument.d.ts +0 -0
- package/dist/openapi/fetchYamlDocument.js +0 -0
- package/dist/openapi/filenameUtils.d.ts +0 -0
- package/dist/openapi/filenameUtils.js +0 -0
- package/dist/openapi/findNavGroup.d.ts +0 -0
- package/dist/openapi/findNavGroup.js +0 -0
- package/dist/openapi/findOpenApiPath.d.ts +0 -0
- package/dist/openapi/findOpenApiPath.js +0 -0
- package/dist/openapi/generateOpenApiPages.d.ts +0 -0
- package/dist/openapi/generateOpenApiPages.js +0 -0
- package/dist/openapi/getMatchingOpenApiFile.d.ts +0 -0
- package/dist/openapi/getMatchingOpenApiFile.js +0 -0
- package/dist/openapi/getOpenApiDocumentFromUrl.d.ts +0 -0
- package/dist/openapi/getOpenApiDocumentFromUrl.js +0 -0
- package/dist/openapi/getOpenApiOperationMethodAndEndpoint.d.ts +0 -0
- package/dist/openapi/getOpenApiOperationMethodAndEndpoint.js +0 -0
- package/dist/openapi/getOpenApiTitleAndDescription.d.ts +0 -0
- package/dist/openapi/getOpenApiTitleAndDescription.js +0 -0
- package/dist/openapi/getTagDisplayName.d.ts +0 -0
- package/dist/openapi/getTagDisplayName.js +0 -0
- package/dist/openapi/index.d.ts +0 -0
- package/dist/openapi/index.js +0 -0
- package/dist/openapi/openApiFrontmatterIsOriginalFileLocation.d.ts +0 -0
- package/dist/openapi/openApiFrontmatterIsOriginalFileLocation.js +0 -0
- package/dist/openapi/overlay/applyOverlay.d.ts +0 -0
- package/dist/openapi/overlay/applyOverlay.js +0 -0
- package/dist/openapi/overlay/errors.d.ts +0 -0
- package/dist/openapi/overlay/errors.js +0 -0
- package/dist/openapi/overlay/jsonValue.d.ts +0 -0
- package/dist/openapi/overlay/jsonValue.js +0 -0
- package/dist/openapi/overlay/mergeValue.d.ts +0 -0
- package/dist/openapi/overlay/mergeValue.js +0 -0
- package/dist/openapi/overlay/overlayRegistry.d.ts +0 -0
- package/dist/openapi/overlay/overlayRegistry.js +0 -0
- package/dist/openapi/parseApiString.d.ts +0 -0
- package/dist/openapi/parseApiString.js +0 -0
- package/dist/openapi/parseOpenApiString.d.ts +0 -0
- package/dist/openapi/parseOpenApiString.js +0 -0
- package/dist/openapi/truncateCircularReferences.d.ts +0 -0
- package/dist/openapi/truncateCircularReferences.js +0 -0
- package/dist/openapi/validate.d.ts +0 -0
- package/dist/openapi/validate.js +0 -0
- package/dist/optionallyRemoveLeadingSlash.d.ts +0 -0
- package/dist/optionallyRemoveLeadingSlash.js +0 -0
- package/dist/parse-inline-style.d.ts +0 -0
- package/dist/parse-inline-style.js +0 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.d.ts +0 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.test.d.ts +0 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.test.js +0 -0
- package/dist/rss/constants.d.ts +0 -0
- package/dist/rss/constants.js +0 -0
- package/dist/rss/dates.d.ts +0 -0
- package/dist/rss/dates.js +0 -0
- package/dist/rss/encodeContentAsHtml.d.ts +0 -0
- package/dist/rss/encodeContentAsHtml.js +0 -0
- package/dist/rss/enhanceSnippetsWithImportNames.d.ts +0 -0
- package/dist/rss/enhanceSnippetsWithImportNames.js +0 -0
- package/dist/rss/getV4FeedUpdates.d.ts +0 -0
- package/dist/rss/getV4FeedUpdates.js +0 -0
- package/dist/rss/index.d.ts +0 -0
- package/dist/rss/index.js +0 -0
- package/dist/rss/processUpdateNode.d.ts +0 -0
- package/dist/rss/processUpdateNode.js +0 -0
- package/dist/rss/resolveSnippets.d.ts +0 -0
- package/dist/rss/resolveSnippets.js +0 -0
- package/dist/schema/common.d.ts +0 -0
- package/dist/schema/common.js +0 -0
- package/dist/sdk/index.d.ts +0 -0
- package/dist/sdk/index.js +0 -0
- package/dist/sdk/parseSdkString.d.ts +0 -0
- package/dist/sdk/parseSdkString.js +0 -0
- package/dist/search/highlight.d.ts +7 -0
- package/dist/search/highlight.js +400 -0
- package/dist/search/highlight.test.d.ts +1 -0
- package/dist/search/highlight.test.js +176 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +1 -0
- package/dist/secureCompare.d.ts +0 -0
- package/dist/secureCompare.js +0 -0
- package/dist/services/aws.d.ts +0 -0
- package/dist/services/aws.js +0 -0
- package/dist/slug/addTrailingSlash.d.ts +0 -0
- package/dist/slug/addTrailingSlash.js +0 -0
- package/dist/slug/getDecoratedNavPageAndSlug.d.ts +0 -0
- package/dist/slug/getDecoratedNavPageAndSlug.js +0 -0
- package/dist/slug/index.d.ts +0 -0
- package/dist/slug/index.js +0 -0
- package/dist/slug/pagePathToSlug.d.ts +0 -0
- package/dist/slug/pagePathToSlug.js +0 -0
- package/dist/slug/replaceSlashIndex.d.ts +0 -0
- package/dist/slug/replaceSlashIndex.js +0 -0
- package/dist/slug/slugToTitle.d.ts +0 -0
- package/dist/slug/slugToTitle.js +0 -0
- package/dist/slugify.d.ts +0 -0
- package/dist/slugify.js +0 -0
- package/dist/title.d.ts +0 -0
- package/dist/title.js +0 -0
- package/dist/topologicalSort.d.ts +0 -0
- package/dist/topologicalSort.js +0 -0
- package/dist/truncateAtWordBoundary.d.ts +0 -0
- package/dist/truncateAtWordBoundary.js +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/AnalyticsEvent.d.ts +0 -0
- package/dist/types/AnalyticsEvent.js +0 -0
- package/dist/types/asyncapi.d.ts +0 -0
- package/dist/types/asyncapi.js +0 -0
- package/dist/types/guards.d.ts +0 -0
- package/dist/types/guards.js +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.js +0 -0
- package/dist/types/mdx/ChangelogFilter.d.ts +0 -0
- package/dist/types/mdx/ChangelogFilter.js +0 -0
- package/dist/types/mdx/MdxCodeExampleData.d.ts +0 -0
- package/dist/types/mdx/MdxCodeExampleData.js +0 -0
- package/dist/types/mdx/MdxExtracts.d.ts +0 -0
- package/dist/types/mdx/MdxExtracts.js +0 -0
- package/dist/types/mdx/MultiViewItemType.d.ts +0 -0
- package/dist/types/mdx/MultiViewItemType.js +0 -0
- package/dist/types/mdx/PanelType.d.ts +0 -0
- package/dist/types/mdx/PanelType.js +0 -0
- package/dist/types/mdx/TableOfContentsSectionType.d.ts +0 -0
- package/dist/types/mdx/TableOfContentsSectionType.js +0 -0
- package/dist/types/mdx/index.d.ts +0 -0
- package/dist/types/mdx/index.js +0 -0
- package/dist/types/mdx/snippets/import.d.ts +0 -0
- package/dist/types/mdx/snippets/import.js +0 -0
- package/dist/types/openapi.d.ts +0 -0
- package/dist/types/openapi.js +0 -0
- package/dist/types/rss.d.ts +0 -0
- package/dist/types/rss.js +0 -0
- package/dist/validateCustomDomainBasePath.d.ts +0 -0
- package/dist/validateCustomDomainBasePath.js +0 -0
- package/dist/validateCustomDomainBasePath.test.d.ts +0 -0
- package/dist/validateCustomDomainBasePath.test.js +0 -0
- package/dist/validateRedirectUrl.d.ts +0 -0
- package/dist/validateRedirectUrl.js +0 -0
- package/package.json +2 -2
|
File without changes
|
package/dist/openapi/index.d.ts
CHANGED
|
File without changes
|
package/dist/openapi/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/openapi/validate.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/rss/constants.d.ts
CHANGED
|
File without changes
|
package/dist/rss/constants.js
CHANGED
|
File without changes
|
package/dist/rss/dates.d.ts
CHANGED
|
File without changes
|
package/dist/rss/dates.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/rss/index.d.ts
CHANGED
|
File without changes
|
package/dist/rss/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/schema/common.d.ts
CHANGED
|
File without changes
|
package/dist/schema/common.js
CHANGED
|
File without changes
|
package/dist/sdk/index.d.ts
CHANGED
|
File without changes
|
package/dist/sdk/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getHighlightedText(text: string, query: string): string;
|
|
2
|
+
export type HighlightSnippetOptions = {
|
|
3
|
+
leadingContext?: number;
|
|
4
|
+
maxLength?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function stripDuplicatedTitleLine(content: string, header: string): string;
|
|
7
|
+
export declare function getHighlightedSnippet(text: string, query: string, options?: HighlightSnippetOptions): string;
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
const STOP_WORDS = new Set([
|
|
2
|
+
'i',
|
|
3
|
+
'me',
|
|
4
|
+
'my',
|
|
5
|
+
'myself',
|
|
6
|
+
'we',
|
|
7
|
+
'our',
|
|
8
|
+
'ours',
|
|
9
|
+
'ourselves',
|
|
10
|
+
'you',
|
|
11
|
+
'your',
|
|
12
|
+
'yours',
|
|
13
|
+
'yourself',
|
|
14
|
+
'yourselves',
|
|
15
|
+
'he',
|
|
16
|
+
'him',
|
|
17
|
+
'his',
|
|
18
|
+
'himself',
|
|
19
|
+
'she',
|
|
20
|
+
'her',
|
|
21
|
+
'hers',
|
|
22
|
+
'herself',
|
|
23
|
+
'it',
|
|
24
|
+
'its',
|
|
25
|
+
'itself',
|
|
26
|
+
'they',
|
|
27
|
+
'them',
|
|
28
|
+
'their',
|
|
29
|
+
'theirs',
|
|
30
|
+
'themselves',
|
|
31
|
+
'what',
|
|
32
|
+
'which',
|
|
33
|
+
'who',
|
|
34
|
+
'whom',
|
|
35
|
+
'this',
|
|
36
|
+
'that',
|
|
37
|
+
'these',
|
|
38
|
+
'those',
|
|
39
|
+
'am',
|
|
40
|
+
'is',
|
|
41
|
+
'are',
|
|
42
|
+
'was',
|
|
43
|
+
'were',
|
|
44
|
+
'be',
|
|
45
|
+
'been',
|
|
46
|
+
'being',
|
|
47
|
+
'have',
|
|
48
|
+
'has',
|
|
49
|
+
'had',
|
|
50
|
+
'having',
|
|
51
|
+
'do',
|
|
52
|
+
'does',
|
|
53
|
+
'did',
|
|
54
|
+
'doing',
|
|
55
|
+
'a',
|
|
56
|
+
'an',
|
|
57
|
+
'the',
|
|
58
|
+
'and',
|
|
59
|
+
'but',
|
|
60
|
+
'if',
|
|
61
|
+
'or',
|
|
62
|
+
'because',
|
|
63
|
+
'as',
|
|
64
|
+
'until',
|
|
65
|
+
'while',
|
|
66
|
+
'of',
|
|
67
|
+
'at',
|
|
68
|
+
'by',
|
|
69
|
+
'for',
|
|
70
|
+
'with',
|
|
71
|
+
'about',
|
|
72
|
+
'against',
|
|
73
|
+
'between',
|
|
74
|
+
'into',
|
|
75
|
+
'through',
|
|
76
|
+
'during',
|
|
77
|
+
'before',
|
|
78
|
+
'after',
|
|
79
|
+
'above',
|
|
80
|
+
'below',
|
|
81
|
+
'to',
|
|
82
|
+
'from',
|
|
83
|
+
'up',
|
|
84
|
+
'down',
|
|
85
|
+
'in',
|
|
86
|
+
'out',
|
|
87
|
+
'on',
|
|
88
|
+
'off',
|
|
89
|
+
'over',
|
|
90
|
+
'under',
|
|
91
|
+
'again',
|
|
92
|
+
'further',
|
|
93
|
+
'then',
|
|
94
|
+
'once',
|
|
95
|
+
'here',
|
|
96
|
+
'there',
|
|
97
|
+
'when',
|
|
98
|
+
'where',
|
|
99
|
+
'why',
|
|
100
|
+
'how',
|
|
101
|
+
'all',
|
|
102
|
+
'any',
|
|
103
|
+
'both',
|
|
104
|
+
'each',
|
|
105
|
+
'few',
|
|
106
|
+
'more',
|
|
107
|
+
'most',
|
|
108
|
+
'other',
|
|
109
|
+
'some',
|
|
110
|
+
'such',
|
|
111
|
+
'no',
|
|
112
|
+
'nor',
|
|
113
|
+
'not',
|
|
114
|
+
'only',
|
|
115
|
+
'own',
|
|
116
|
+
'same',
|
|
117
|
+
'so',
|
|
118
|
+
'than',
|
|
119
|
+
'too',
|
|
120
|
+
'very',
|
|
121
|
+
's',
|
|
122
|
+
't',
|
|
123
|
+
'can',
|
|
124
|
+
'will',
|
|
125
|
+
'just',
|
|
126
|
+
'don',
|
|
127
|
+
'should',
|
|
128
|
+
'now',
|
|
129
|
+
"aren't",
|
|
130
|
+
"it's",
|
|
131
|
+
"don't",
|
|
132
|
+
'get',
|
|
133
|
+
]);
|
|
134
|
+
const MAX_QUERY_WORDS = 20;
|
|
135
|
+
const HIGHLIGHT_TIMEOUT_MS = 100;
|
|
136
|
+
const PRE_TAG = '<mark><b>';
|
|
137
|
+
const POST_TAG = '</b></mark>';
|
|
138
|
+
function escapeHtml(str) {
|
|
139
|
+
return str
|
|
140
|
+
.replace(/&/g, '&')
|
|
141
|
+
.replace(/</g, '<')
|
|
142
|
+
.replace(/>/g, '>')
|
|
143
|
+
.replace(/"/g, '"');
|
|
144
|
+
}
|
|
145
|
+
// Server-side search results arrive pre-wrapped with <mark><b>…</b></mark>
|
|
146
|
+
// highlight tags. We re-highlight on the client now, so strip them here —
|
|
147
|
+
// otherwise escapeHtml below would turn them into visible <mark> text.
|
|
148
|
+
const SERVER_HIGHLIGHT_TAGS = /<\/?(?:mark|b)\b[^>]*>/gi;
|
|
149
|
+
function stripServerHighlightTags(text) {
|
|
150
|
+
return text.replace(SERVER_HIGHLIGHT_TAGS, '');
|
|
151
|
+
}
|
|
152
|
+
function isStopWord(word) {
|
|
153
|
+
return STOP_WORDS.has(word.toLowerCase());
|
|
154
|
+
}
|
|
155
|
+
function chunkByNonStopWords(words) {
|
|
156
|
+
const groups = [];
|
|
157
|
+
let current = [];
|
|
158
|
+
for (const w of words) {
|
|
159
|
+
if (!w)
|
|
160
|
+
continue;
|
|
161
|
+
if (isStopWord(w)) {
|
|
162
|
+
if (current.length > 0) {
|
|
163
|
+
groups.push(current);
|
|
164
|
+
current = [];
|
|
165
|
+
}
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
current.push(w);
|
|
169
|
+
}
|
|
170
|
+
if (current.length > 0)
|
|
171
|
+
groups.push(current);
|
|
172
|
+
return groups;
|
|
173
|
+
}
|
|
174
|
+
function findAllCaseInsensitive(text, search) {
|
|
175
|
+
const lower = text.toLowerCase();
|
|
176
|
+
const searchLower = search.toLowerCase();
|
|
177
|
+
const indices = [];
|
|
178
|
+
let start = 0;
|
|
179
|
+
while (start <= lower.length - searchLower.length) {
|
|
180
|
+
const idx = lower.indexOf(searchLower, start);
|
|
181
|
+
if (idx === -1)
|
|
182
|
+
break;
|
|
183
|
+
indices.push(idx);
|
|
184
|
+
start = idx + 1;
|
|
185
|
+
}
|
|
186
|
+
return indices;
|
|
187
|
+
}
|
|
188
|
+
function generateQueryVariations(query) {
|
|
189
|
+
const cleanedQuery = query.replace(/[?,.!\n"]/g, '');
|
|
190
|
+
const queryWords = cleanedQuery.split(/\s+/).filter(Boolean).slice(0, MAX_QUERY_WORDS);
|
|
191
|
+
const groups = chunkByNonStopWords(queryWords);
|
|
192
|
+
const multiToken = [];
|
|
193
|
+
for (const group of groups) {
|
|
194
|
+
if (group.length > 1)
|
|
195
|
+
multiToken.push(group.join(' '));
|
|
196
|
+
}
|
|
197
|
+
const groupStarts = groups
|
|
198
|
+
.map((g) => cleanedQuery.indexOf(g.join(' ')))
|
|
199
|
+
.filter((i) => i >= 0)
|
|
200
|
+
.sort((a, b) => a - b);
|
|
201
|
+
for (let i = 0; i < groupStarts.length - 1; i++) {
|
|
202
|
+
const span = cleanedQuery.slice(groupStarts[i], groupStarts[i + 1]).trim();
|
|
203
|
+
const nonStopCount = span.split(/\s+/).filter((w) => !isStopWord(w)).length;
|
|
204
|
+
if (nonStopCount > 1) {
|
|
205
|
+
if (span.split(/\s+/).length > 1)
|
|
206
|
+
multiToken.push(span);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (groupStarts.length > 0) {
|
|
210
|
+
const tail = cleanedQuery.slice(groupStarts[groupStarts.length - 1]).trim();
|
|
211
|
+
if (tail)
|
|
212
|
+
multiToken.push(tail);
|
|
213
|
+
}
|
|
214
|
+
for (let len = queryWords.length - 1; len > 0; len--) {
|
|
215
|
+
for (let skip = 0; skip <= queryWords.length - len; skip++) {
|
|
216
|
+
const sub = queryWords
|
|
217
|
+
.slice(skip, skip + len)
|
|
218
|
+
.map((w) => w.trim())
|
|
219
|
+
.join(' ');
|
|
220
|
+
const nonStopCount = sub.split(/\s+/).filter((w) => !isStopWord(w)).length;
|
|
221
|
+
if (len > 2 || nonStopCount >= 1) {
|
|
222
|
+
multiToken.push(sub);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const variations = [query, cleanedQuery, ...multiToken].filter((x) => x.trim().length > 0);
|
|
227
|
+
const seen = new Set();
|
|
228
|
+
const unique = [];
|
|
229
|
+
for (const v of variations) {
|
|
230
|
+
if (!seen.has(v)) {
|
|
231
|
+
seen.add(v);
|
|
232
|
+
unique.push(v);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const numWords = queryWords.length;
|
|
236
|
+
unique.sort((a, b) => {
|
|
237
|
+
if (numWords >= MAX_QUERY_WORDS)
|
|
238
|
+
return b.trim().length - a.trim().length;
|
|
239
|
+
const aWords = a.split(/\s+/).filter(Boolean).length;
|
|
240
|
+
const bWords = b.split(/\s+/).filter(Boolean).length;
|
|
241
|
+
if (bWords !== aWords)
|
|
242
|
+
return bWords - aWords;
|
|
243
|
+
return b.trim().length - a.trim().length;
|
|
244
|
+
});
|
|
245
|
+
return unique;
|
|
246
|
+
}
|
|
247
|
+
function computeMergedSpans(text, matchedQueries) {
|
|
248
|
+
var _a;
|
|
249
|
+
const spans = [];
|
|
250
|
+
const isWordChar = /\w/;
|
|
251
|
+
for (const q of matchedQueries) {
|
|
252
|
+
const trimmed = q.trim();
|
|
253
|
+
if (!trimmed)
|
|
254
|
+
continue;
|
|
255
|
+
const isSingleWord = !/\s/.test(trimmed);
|
|
256
|
+
for (const idx of findAllCaseInsensitive(text, trimmed)) {
|
|
257
|
+
const end = idx + trimmed.length;
|
|
258
|
+
if (isSingleWord) {
|
|
259
|
+
const beforeOk = idx === 0 || !isWordChar.test((_a = text[idx - 1]) !== null && _a !== void 0 ? _a : '');
|
|
260
|
+
if (!beforeOk)
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
spans.push({ start: idx, end });
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
spans.sort((a, b) => a.start - b.start || b.end - a.end);
|
|
267
|
+
const mergedSpans = [];
|
|
268
|
+
for (const span of spans) {
|
|
269
|
+
const last = mergedSpans[mergedSpans.length - 1];
|
|
270
|
+
if (last && span.start <= last.end) {
|
|
271
|
+
last.end = Math.max(last.end, span.end);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
mergedSpans.push({ start: span.start, end: span.end });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return mergedSpans;
|
|
278
|
+
}
|
|
279
|
+
function renderSpans(text, mergedSpans) {
|
|
280
|
+
let result = '';
|
|
281
|
+
let cursor = 0;
|
|
282
|
+
for (const span of mergedSpans) {
|
|
283
|
+
result += escapeHtml(text.slice(cursor, span.start));
|
|
284
|
+
const original = text.slice(span.start, span.end);
|
|
285
|
+
if (original)
|
|
286
|
+
result += `${PRE_TAG}${escapeHtml(original)}${POST_TAG}`;
|
|
287
|
+
cursor = span.end;
|
|
288
|
+
}
|
|
289
|
+
result += escapeHtml(text.slice(cursor));
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
function renderHighlightedSpans(text, matchedQueries) {
|
|
293
|
+
return renderSpans(text, computeMergedSpans(text, matchedQueries));
|
|
294
|
+
}
|
|
295
|
+
const VARIATIONS_CACHE_LIMIT = 64;
|
|
296
|
+
const variationsCache = new Map();
|
|
297
|
+
function getCachedVariations(query) {
|
|
298
|
+
const cached = variationsCache.get(query);
|
|
299
|
+
if (cached)
|
|
300
|
+
return cached;
|
|
301
|
+
const variations = generateQueryVariations(query);
|
|
302
|
+
variationsCache.set(query, variations);
|
|
303
|
+
if (variationsCache.size > VARIATIONS_CACHE_LIMIT) {
|
|
304
|
+
const oldestKey = variationsCache.keys().next().value;
|
|
305
|
+
if (oldestKey !== undefined)
|
|
306
|
+
variationsCache.delete(oldestKey);
|
|
307
|
+
}
|
|
308
|
+
return variations;
|
|
309
|
+
}
|
|
310
|
+
function getMatchedQueries(text, query) {
|
|
311
|
+
const deadline = Date.now() + HIGHLIGHT_TIMEOUT_MS;
|
|
312
|
+
const variations = getCachedVariations(query);
|
|
313
|
+
const matchedQueries = [];
|
|
314
|
+
for (const variation of variations) {
|
|
315
|
+
if (Date.now() > deadline)
|
|
316
|
+
return [];
|
|
317
|
+
const trimmed = variation.trim();
|
|
318
|
+
if (matchedQueries.some((q) => q.trim() === trimmed))
|
|
319
|
+
continue;
|
|
320
|
+
if (findAllCaseInsensitive(text, variation).length > 0) {
|
|
321
|
+
matchedQueries.push(variation);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return matchedQueries;
|
|
325
|
+
}
|
|
326
|
+
export function getHighlightedText(text, query) {
|
|
327
|
+
const stripped = stripServerHighlightTags(text);
|
|
328
|
+
if (!stripped || !query)
|
|
329
|
+
return escapeHtml(stripped);
|
|
330
|
+
const matchedQueries = getMatchedQueries(stripped, query);
|
|
331
|
+
if (matchedQueries.length === 0)
|
|
332
|
+
return escapeHtml(stripped);
|
|
333
|
+
return renderHighlightedSpans(stripped, matchedQueries);
|
|
334
|
+
}
|
|
335
|
+
const ELLIPSIS = '…';
|
|
336
|
+
const SNIPPET_LEADING_CONTEXT = 24;
|
|
337
|
+
const SNIPPET_MAX_LENGTH = 240;
|
|
338
|
+
const SNIPPET_BOUNDARY_LOOKAROUND = 12;
|
|
339
|
+
function snapStartToWordBoundary(text, index, lookaround) {
|
|
340
|
+
if (index <= 0)
|
|
341
|
+
return 0;
|
|
342
|
+
const earliest = Math.max(0, index - lookaround);
|
|
343
|
+
const previousSpace = text.lastIndexOf(' ', index - 1);
|
|
344
|
+
return previousSpace >= earliest ? previousSpace + 1 : index;
|
|
345
|
+
}
|
|
346
|
+
function snapEndToWordBoundary(text, index, lookaround) {
|
|
347
|
+
if (index >= text.length)
|
|
348
|
+
return text.length;
|
|
349
|
+
const latest = Math.min(text.length, index + lookaround);
|
|
350
|
+
const nextSpace = text.indexOf(' ', index);
|
|
351
|
+
return nextSpace !== -1 && nextSpace < latest ? nextSpace : index;
|
|
352
|
+
}
|
|
353
|
+
function leadingWindow(text, maxLength) {
|
|
354
|
+
if (text.length <= maxLength)
|
|
355
|
+
return escapeHtml(text);
|
|
356
|
+
const end = snapEndToWordBoundary(text, maxLength, SNIPPET_BOUNDARY_LOOKAROUND);
|
|
357
|
+
return `${escapeHtml(text.slice(0, end))} ${ELLIPSIS}`;
|
|
358
|
+
}
|
|
359
|
+
export function stripDuplicatedTitleLine(content, header) {
|
|
360
|
+
const newlineIdx = content.indexOf('\n');
|
|
361
|
+
if (newlineIdx < 0 || !header)
|
|
362
|
+
return content;
|
|
363
|
+
const normalize = (value) => stripServerHighlightTags(value).replace(/\s+/g, ' ').trim();
|
|
364
|
+
return normalize(content.slice(0, newlineIdx)) === normalize(header)
|
|
365
|
+
? content.slice(newlineIdx + 1)
|
|
366
|
+
: content;
|
|
367
|
+
}
|
|
368
|
+
export function getHighlightedSnippet(text, query, options) {
|
|
369
|
+
var _a, _b;
|
|
370
|
+
const stripped = stripServerHighlightTags(text);
|
|
371
|
+
const leadingContext = (_a = options === null || options === void 0 ? void 0 : options.leadingContext) !== null && _a !== void 0 ? _a : SNIPPET_LEADING_CONTEXT;
|
|
372
|
+
const maxLength = (_b = options === null || options === void 0 ? void 0 : options.maxLength) !== null && _b !== void 0 ? _b : SNIPPET_MAX_LENGTH;
|
|
373
|
+
if (!stripped || !query)
|
|
374
|
+
return leadingWindow(stripped, maxLength);
|
|
375
|
+
const matchedQueries = getMatchedQueries(stripped, query);
|
|
376
|
+
if (matchedQueries.length === 0)
|
|
377
|
+
return leadingWindow(stripped, maxLength);
|
|
378
|
+
const mergedSpans = computeMergedSpans(stripped, matchedQueries);
|
|
379
|
+
const firstMatch = mergedSpans[0];
|
|
380
|
+
if (!firstMatch)
|
|
381
|
+
return leadingWindow(stripped, maxLength);
|
|
382
|
+
let windowStart = firstMatch.start <= leadingContext ? 0 : firstMatch.start - leadingContext;
|
|
383
|
+
let windowEnd = Math.min(stripped.length, Math.max(firstMatch.end, windowStart + maxLength));
|
|
384
|
+
windowStart = snapStartToWordBoundary(stripped, windowStart, SNIPPET_BOUNDARY_LOOKAROUND);
|
|
385
|
+
windowEnd = snapEndToWordBoundary(stripped, windowEnd, SNIPPET_BOUNDARY_LOOKAROUND);
|
|
386
|
+
const windowed = stripped.slice(windowStart, windowEnd);
|
|
387
|
+
const windowedSpans = [];
|
|
388
|
+
for (const span of mergedSpans) {
|
|
389
|
+
if (span.end <= windowStart || span.start >= windowEnd)
|
|
390
|
+
continue;
|
|
391
|
+
windowedSpans.push({
|
|
392
|
+
start: Math.max(0, span.start - windowStart),
|
|
393
|
+
end: Math.min(windowed.length, span.end - windowStart),
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
const body = renderSpans(windowed, windowedSpans);
|
|
397
|
+
const lead = windowStart > 0 ? `${ELLIPSIS} ` : '';
|
|
398
|
+
const trail = windowEnd < stripped.length ? ` ${ELLIPSIS}` : '';
|
|
399
|
+
return `${lead}${body}${trail}`;
|
|
400
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|