@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.
Files changed (544) hide show
  1. package/dist/api-reference/parseApiTargetFromMetadata.d.ts +0 -0
  2. package/dist/api-reference/parseApiTargetFromMetadata.js +0 -0
  3. package/dist/apiStaticExportBasePaths.d.ts +0 -0
  4. package/dist/apiStaticExportBasePaths.js +0 -0
  5. package/dist/asyncapi/checkForExternalRefs.d.ts +0 -0
  6. package/dist/asyncapi/checkForExternalRefs.js +0 -0
  7. package/dist/asyncapi/getAsyncApiChannelMetadata.d.ts +0 -0
  8. package/dist/asyncapi/getAsyncApiChannelMetadata.js +0 -0
  9. package/dist/asyncapi/getAsyncApiDocumentFromUrl.d.ts +0 -0
  10. package/dist/asyncapi/getAsyncApiDocumentFromUrl.js +0 -0
  11. package/dist/asyncapi/getEnumValues.d.ts +0 -0
  12. package/dist/asyncapi/getEnumValues.js +0 -0
  13. package/dist/asyncapi/index.d.ts +0 -0
  14. package/dist/asyncapi/index.js +0 -0
  15. package/dist/asyncapi/parseAsyncApiString.d.ts +0 -0
  16. package/dist/asyncapi/parseAsyncApiString.js +0 -0
  17. package/dist/asyncapi/parser/extractSchemaProperties.d.ts +0 -0
  18. package/dist/asyncapi/parser/extractSchemaProperties.js +0 -0
  19. package/dist/asyncapi/parser/getBindingsData.d.ts +0 -0
  20. package/dist/asyncapi/parser/getBindingsData.js +0 -0
  21. package/dist/asyncapi/parser/getChannelData.d.ts +0 -0
  22. package/dist/asyncapi/parser/getChannelData.js +0 -0
  23. package/dist/asyncapi/parser/getExamplesData.d.ts +0 -0
  24. package/dist/asyncapi/parser/getExamplesData.js +0 -0
  25. package/dist/asyncapi/parser/getExtensionsData.d.ts +0 -0
  26. package/dist/asyncapi/parser/getExtensionsData.js +0 -0
  27. package/dist/asyncapi/parser/getMessagesData.d.ts +0 -0
  28. package/dist/asyncapi/parser/getMessagesData.js +0 -0
  29. package/dist/asyncapi/parser/getOperationsData.d.ts +0 -0
  30. package/dist/asyncapi/parser/getOperationsData.js +0 -0
  31. package/dist/asyncapi/parser/getParametersData.d.ts +0 -0
  32. package/dist/asyncapi/parser/getParametersData.js +0 -0
  33. package/dist/asyncapi/parser/getSecuritySchemesData.d.ts +0 -0
  34. package/dist/asyncapi/parser/getSecuritySchemesData.js +0 -0
  35. package/dist/asyncapi/parser/getServersData.d.ts +0 -0
  36. package/dist/asyncapi/parser/getServersData.js +0 -0
  37. package/dist/asyncapi/prepAsyncApiFrontmatter.d.ts +0 -0
  38. package/dist/asyncapi/prepAsyncApiFrontmatter.js +0 -0
  39. package/dist/asyncapi/validateAsyncApi.d.ts +0 -0
  40. package/dist/asyncapi/validateAsyncApi.js +0 -0
  41. package/dist/basePaths.d.ts +0 -0
  42. package/dist/basePaths.js +0 -0
  43. package/dist/camelToSentenceCase.d.ts +0 -0
  44. package/dist/camelToSentenceCase.js +0 -0
  45. package/dist/colors.d.ts +0 -0
  46. package/dist/colors.js +0 -0
  47. package/dist/css/index.d.ts +0 -0
  48. package/dist/css/index.js +0 -0
  49. package/dist/css/tailwind.d.ts +0 -0
  50. package/dist/css/tailwind.js +0 -0
  51. package/dist/divisions/generatePathToBoostDict.d.ts +0 -0
  52. package/dist/divisions/generatePathToBoostDict.js +0 -0
  53. package/dist/divisions/generatePathToHiddenDict.d.ts +0 -0
  54. package/dist/divisions/generatePathToHiddenDict.js +0 -0
  55. package/dist/divisions/generatePathToHiddenFromSearchDict.d.ts +0 -0
  56. package/dist/divisions/generatePathToHiddenFromSearchDict.js +0 -0
  57. package/dist/divisions/generatePathToLanguageDict.d.ts +0 -0
  58. package/dist/divisions/generatePathToLanguageDict.js +0 -0
  59. package/dist/divisions/generatePathToProductDict.d.ts +0 -0
  60. package/dist/divisions/generatePathToProductDict.js +0 -0
  61. package/dist/divisions/generatePathToPublicDict.d.ts +0 -0
  62. package/dist/divisions/generatePathToPublicDict.js +0 -0
  63. package/dist/divisions/generatePathToVersionDict.d.ts +0 -0
  64. package/dist/divisions/generatePathToVersionDict.js +0 -0
  65. package/dist/divisions/generatePathToVersionDictForDocsConfig.d.ts +0 -0
  66. package/dist/divisions/generatePathToVersionDictForDocsConfig.js +0 -0
  67. package/dist/divisions/index.d.ts +0 -0
  68. package/dist/divisions/index.js +0 -0
  69. package/dist/divisions/iterateObjectArrayProperty.d.ts +0 -0
  70. package/dist/divisions/iterateObjectArrayProperty.js +0 -0
  71. package/dist/entitlements/index.d.ts +0 -0
  72. package/dist/entitlements/index.js +0 -0
  73. package/dist/exponentialBackoff.d.ts +0 -0
  74. package/dist/exponentialBackoff.js +0 -0
  75. package/dist/frontmatter/index.d.ts +0 -0
  76. package/dist/frontmatter/index.js +0 -0
  77. package/dist/frontmatter/parseFrontmatter.d.ts +0 -0
  78. package/dist/frontmatter/parseFrontmatter.js +0 -0
  79. package/dist/fs/addBasePath.d.ts +0 -0
  80. package/dist/fs/addBasePath.js +0 -0
  81. package/dist/fs/createPathArr.d.ts +0 -0
  82. package/dist/fs/createPathArr.js +0 -0
  83. package/dist/fs/index.d.ts +0 -0
  84. package/dist/fs/index.js +0 -0
  85. package/dist/fs/normalizeRelativePath.d.ts +0 -0
  86. package/dist/fs/normalizeRelativePath.js +0 -0
  87. package/dist/fs/optionallySlash.d.ts +0 -0
  88. package/dist/fs/optionallySlash.js +0 -0
  89. package/dist/fs/removeBasePath.d.ts +0 -0
  90. package/dist/fs/removeBasePath.js +0 -0
  91. package/dist/fs/removeLeadingSlash.d.ts +0 -0
  92. package/dist/fs/removeLeadingSlash.js +0 -0
  93. package/dist/fs/toPosixPath.d.ts +0 -0
  94. package/dist/fs/toPosixPath.js +0 -0
  95. package/dist/getDisplayDomain.d.ts +0 -0
  96. package/dist/getDisplayDomain.js +0 -0
  97. package/dist/getFileCategory.d.ts +0 -0
  98. package/dist/getFileCategory.js +0 -0
  99. package/dist/getRelativeRecordName.d.ts +0 -0
  100. package/dist/getRelativeRecordName.js +0 -0
  101. package/dist/getRelativeRecordName.test.d.ts +0 -0
  102. package/dist/getRelativeRecordName.test.js +0 -0
  103. package/dist/getSecurityOptionsForAuthMethod.d.ts +0 -0
  104. package/dist/getSecurityOptionsForAuthMethod.js +0 -0
  105. package/dist/index.d.ts +1 -0
  106. package/dist/index.js +1 -0
  107. package/dist/isAbsoluteUrl.d.ts +0 -0
  108. package/dist/isAbsoluteUrl.js +0 -0
  109. package/dist/isAllowedRedirectUri.d.ts +0 -0
  110. package/dist/isAllowedRedirectUri.js +0 -0
  111. package/dist/isAllowedRedirectUri.test.d.ts +0 -0
  112. package/dist/isAllowedRedirectUri.test.js +0 -0
  113. package/dist/isDocsConfig.d.ts +0 -0
  114. package/dist/isDocsConfig.js +0 -0
  115. package/dist/isOrgLessThanTwoWeeksOld.d.ts +0 -0
  116. package/dist/isOrgLessThanTwoWeeksOld.js +0 -0
  117. package/dist/isValidEmail.d.ts +0 -0
  118. package/dist/isValidEmail.js +0 -0
  119. package/dist/isWildcardRedirect.d.ts +0 -0
  120. package/dist/isWildcardRedirect.js +0 -0
  121. package/dist/knownMcpClients.d.ts +0 -0
  122. package/dist/knownMcpClients.js +0 -0
  123. package/dist/knownMcpClients.test.d.ts +0 -0
  124. package/dist/knownMcpClients.test.js +0 -0
  125. package/dist/live-preview.d.ts +0 -0
  126. package/dist/live-preview.js +0 -0
  127. package/dist/mdx/astUtils.d.ts +0 -0
  128. package/dist/mdx/astUtils.js +0 -0
  129. package/dist/mdx/componentIds.d.ts +0 -0
  130. package/dist/mdx/componentIds.js +0 -0
  131. package/dist/mdx/getCodeStyling.d.ts +0 -0
  132. package/dist/mdx/getCodeStyling.js +0 -0
  133. package/dist/mdx/getMDXOptions.d.ts +0 -0
  134. package/dist/mdx/getMDXOptions.js +0 -0
  135. package/dist/mdx/getS3ImageUri.d.ts +0 -0
  136. package/dist/mdx/getS3ImageUri.js +0 -0
  137. package/dist/mdx/index.d.ts +0 -0
  138. package/dist/mdx/index.js +0 -0
  139. package/dist/mdx/lib/findExportedNode.d.ts +0 -0
  140. package/dist/mdx/lib/findExportedNode.js +0 -0
  141. package/dist/mdx/lib/index.d.ts +0 -0
  142. package/dist/mdx/lib/index.js +0 -0
  143. package/dist/mdx/lib/mdx-utils.d.ts +0 -0
  144. package/dist/mdx/lib/mdx-utils.js +0 -0
  145. package/dist/mdx/lib/remark-utils.d.ts +0 -0
  146. package/dist/mdx/lib/remark-utils.js +0 -0
  147. package/dist/mdx/plugins/index.d.ts +0 -0
  148. package/dist/mdx/plugins/index.js +0 -0
  149. package/dist/mdx/plugins/rehype/index.d.ts +0 -0
  150. package/dist/mdx/plugins/rehype/index.js +0 -0
  151. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/buildMetaAttributes.d.ts +0 -0
  152. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/buildMetaAttributes.js +0 -0
  153. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/index.d.ts +0 -0
  154. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/index.js +0 -0
  155. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.d.ts +0 -0
  156. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.js +0 -0
  157. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/parseMetaString.d.ts +0 -0
  158. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/parseMetaString.js +0 -0
  159. package/dist/mdx/plugins/rehype/rehypeDynamicTailwindCss.d.ts +0 -0
  160. package/dist/mdx/plugins/rehype/rehypeDynamicTailwindCss.js +0 -0
  161. package/dist/mdx/plugins/rehype/rehypeKeyboardSymbols.d.ts +0 -0
  162. package/dist/mdx/plugins/rehype/rehypeKeyboardSymbols.js +0 -0
  163. package/dist/mdx/plugins/rehype/rehypeListItemText.d.ts +0 -0
  164. package/dist/mdx/plugins/rehype/rehypeListItemText.js +0 -0
  165. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/findParentSchema.d.ts +0 -0
  166. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/findParentSchema.js +0 -0
  167. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/index.d.ts +0 -0
  168. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/index.js +0 -0
  169. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/insertSchema.d.ts +0 -0
  170. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/insertSchema.js +0 -0
  171. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.d.ts +0 -0
  172. package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.js +0 -0
  173. package/dist/mdx/plugins/rehype/rehypeMdxExtractExamples.d.ts +0 -0
  174. package/dist/mdx/plugins/rehype/rehypeMdxExtractExamples.js +0 -0
  175. package/dist/mdx/plugins/rehype/rehypeOptimizedVideo.d.ts +0 -0
  176. package/dist/mdx/plugins/rehype/rehypeOptimizedVideo.js +0 -0
  177. package/dist/mdx/plugins/rehype/rehypeParamFieldIds.d.ts +0 -0
  178. package/dist/mdx/plugins/rehype/rehypeParamFieldIds.js +0 -0
  179. package/dist/mdx/plugins/rehype/rehypeRawComponents.d.ts +0 -0
  180. package/dist/mdx/plugins/rehype/rehypeRawComponents.js +0 -0
  181. package/dist/mdx/plugins/rehype/rehypeTable.d.ts +0 -0
  182. package/dist/mdx/plugins/rehype/rehypeTable.js +0 -0
  183. package/dist/mdx/plugins/rehype/rehypeUnicodeIds.d.ts +0 -0
  184. package/dist/mdx/plugins/rehype/rehypeUnicodeIds.js +0 -0
  185. package/dist/mdx/plugins/rehype/rehypeZoomImages.d.ts +0 -0
  186. package/dist/mdx/plugins/rehype/rehypeZoomImages.js +0 -0
  187. package/dist/mdx/plugins/rehype/segment.d.ts +0 -0
  188. package/dist/mdx/plugins/rehype/segment.js +0 -0
  189. package/dist/mdx/plugins/remark/index.d.ts +0 -0
  190. package/dist/mdx/plugins/remark/index.js +0 -0
  191. package/dist/mdx/plugins/remark/remark-mdx-style-string-to-object.d.ts +0 -0
  192. package/dist/mdx/plugins/remark/remark-mdx-style-string-to-object.js +0 -0
  193. package/dist/mdx/plugins/remark/remarkComponentIds.d.ts +0 -0
  194. package/dist/mdx/plugins/remark/remarkComponentIds.js +0 -0
  195. package/dist/mdx/plugins/remark/remarkExpandContent.d.ts +0 -0
  196. package/dist/mdx/plugins/remark/remarkExpandContent.js +0 -0
  197. package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.d.ts +0 -0
  198. package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.js +0 -0
  199. package/dist/mdx/plugins/remark/remarkExtractMultiView.d.ts +0 -0
  200. package/dist/mdx/plugins/remark/remarkExtractMultiView.js +0 -0
  201. package/dist/mdx/plugins/remark/remarkExtractTableOfContents.d.ts +0 -0
  202. package/dist/mdx/plugins/remark/remarkExtractTableOfContents.js +0 -0
  203. package/dist/mdx/plugins/remark/remarkFileTree.d.ts +0 -0
  204. package/dist/mdx/plugins/remark/remarkFileTree.js +0 -0
  205. package/dist/mdx/plugins/remark/remarkFrames.d.ts +0 -0
  206. package/dist/mdx/plugins/remark/remarkFrames.js +0 -0
  207. package/dist/mdx/plugins/remark/remarkMapExplicitAnchors.d.ts +0 -0
  208. package/dist/mdx/plugins/remark/remarkMapExplicitAnchors.js +0 -0
  209. package/dist/mdx/plugins/remark/remarkMdxClientComponentBoundaries.d.ts +0 -0
  210. package/dist/mdx/plugins/remark/remarkMdxClientComponentBoundaries.js +0 -0
  211. package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.d.ts +0 -0
  212. package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.js +0 -0
  213. package/dist/mdx/plugins/remark/remarkMdxExtractPanel.d.ts +0 -0
  214. package/dist/mdx/plugins/remark/remarkMdxExtractPanel.js +0 -0
  215. package/dist/mdx/plugins/remark/remarkMdxInjectSnippets.d.ts +0 -0
  216. package/dist/mdx/plugins/remark/remarkMdxInjectSnippets.js +0 -0
  217. package/dist/mdx/plugins/remark/remarkMdxRemoveJs.d.ts +0 -0
  218. package/dist/mdx/plugins/remark/remarkMdxRemoveJs.js +0 -0
  219. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/createCommentNode.d.ts +0 -0
  220. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/createCommentNode.js +0 -0
  221. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.d.ts +0 -0
  222. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.js +0 -0
  223. package/dist/mdx/plugins/remark/remarkMdxRemoveUnusedVariables.d.ts +0 -0
  224. package/dist/mdx/plugins/remark/remarkMdxRemoveUnusedVariables.js +0 -0
  225. package/dist/mdx/plugins/remark/remarkMermaid.d.ts +0 -0
  226. package/dist/mdx/plugins/remark/remarkMermaid.js +0 -0
  227. package/dist/mdx/plugins/remark/remarkNoCopyLanguage.d.ts +0 -0
  228. package/dist/mdx/plugins/remark/remarkNoCopyLanguage.js +0 -0
  229. package/dist/mdx/plugins/remark/remarkPrompt.d.ts +0 -0
  230. package/dist/mdx/plugins/remark/remarkPrompt.js +0 -0
  231. package/dist/mdx/plugins/remark/remarkRemoveImports.d.ts +0 -0
  232. package/dist/mdx/plugins/remark/remarkRemoveImports.js +0 -0
  233. package/dist/mdx/plugins/remark/remarkResolveRelativeLinks.d.ts +0 -0
  234. package/dist/mdx/plugins/remark/remarkResolveRelativeLinks.js +0 -0
  235. package/dist/mdx/plugins/remark/remarkSplitCodeGroup.d.ts +0 -0
  236. package/dist/mdx/plugins/remark/remarkSplitCodeGroup.js +0 -0
  237. package/dist/mdx/plugins/remark/remarkSplitTabs.d.ts +0 -0
  238. package/dist/mdx/plugins/remark/remarkSplitTabs.js +0 -0
  239. package/dist/mdx/plugins/remark/remarkTitleMarkdown.d.ts +0 -0
  240. package/dist/mdx/plugins/remark/remarkTitleMarkdown.js +0 -0
  241. package/dist/mdx/plugins/remark/remarkUnwrapInlineJsx.d.ts +0 -0
  242. package/dist/mdx/plugins/remark/remarkUnwrapInlineJsx.js +0 -0
  243. package/dist/mdx/plugins/remark/remarkUnwrapJsxHeadings.d.ts +0 -0
  244. package/dist/mdx/plugins/remark/remarkUnwrapJsxHeadings.js +0 -0
  245. package/dist/mdx/plugins/remark/remarkValidateAccordions.d.ts +0 -0
  246. package/dist/mdx/plugins/remark/remarkValidateAccordions.js +0 -0
  247. package/dist/mdx/plugins/remark/remarkValidateApiExamples.d.ts +0 -0
  248. package/dist/mdx/plugins/remark/remarkValidateApiExamples.js +0 -0
  249. package/dist/mdx/plugins/remark/remarkValidateSteps.d.ts +0 -0
  250. package/dist/mdx/plugins/remark/remarkValidateSteps.js +0 -0
  251. package/dist/mdx/plugins/remark/remarkValidateTabs.d.ts +0 -0
  252. package/dist/mdx/plugins/remark/remarkValidateTabs.js +0 -0
  253. package/dist/mdx/plugins/remark/remarkValidateVisibility.d.ts +0 -0
  254. package/dist/mdx/plugins/remark/remarkValidateVisibility.js +0 -0
  255. package/dist/mdx/plugins/remark/remarkVideo.d.ts +0 -0
  256. package/dist/mdx/plugins/remark/remarkVideo.js +0 -0
  257. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.d.ts +0 -0
  258. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.js +0 -0
  259. package/dist/mdx/plugins/remark/variation.d.ts +0 -0
  260. package/dist/mdx/plugins/remark/variation.js +0 -0
  261. package/dist/mdx/preprocessCustomHeadingIds.d.ts +0 -0
  262. package/dist/mdx/preprocessCustomHeadingIds.js +0 -0
  263. package/dist/mdx/preprocessCustomHeadingIds.test.d.ts +0 -0
  264. package/dist/mdx/preprocessCustomHeadingIds.test.js +0 -0
  265. package/dist/mdx/preprocessMdxFragmentCode.d.ts +0 -0
  266. package/dist/mdx/preprocessMdxFragmentCode.js +0 -0
  267. package/dist/mdx/preprocessMdxFragmentCode.test.d.ts +0 -0
  268. package/dist/mdx/preprocessMdxFragmentCode.test.js +0 -0
  269. package/dist/mdx/remark.d.ts +0 -0
  270. package/dist/mdx/remark.js +0 -0
  271. package/dist/mdx/replaceVariables.d.ts +0 -0
  272. package/dist/mdx/replaceVariables.js +0 -0
  273. package/dist/mdx/server-only/getMdx/snippets.d.ts +0 -0
  274. package/dist/mdx/server-only/getMdx/snippets.js +0 -0
  275. package/dist/mdx/server-only/getMdx.d.ts +0 -0
  276. package/dist/mdx/server-only/getMdx.js +0 -0
  277. package/dist/mdx/server-only/getSerializeExtras.d.ts +0 -0
  278. package/dist/mdx/server-only/getSerializeExtras.js +0 -0
  279. package/dist/mdx/server-only/index.d.ts +0 -0
  280. package/dist/mdx/server-only/index.js +0 -0
  281. package/dist/mdx/snippets/buildImportMap.d.ts +0 -0
  282. package/dist/mdx/snippets/buildImportMap.js +0 -0
  283. package/dist/mdx/snippets/constants.d.ts +0 -0
  284. package/dist/mdx/snippets/constants.js +0 -0
  285. package/dist/mdx/snippets/extractImportSources.d.ts +0 -0
  286. package/dist/mdx/snippets/extractImportSources.js +0 -0
  287. package/dist/mdx/snippets/findAndRemoveExports.d.ts +0 -0
  288. package/dist/mdx/snippets/findAndRemoveExports.js +0 -0
  289. package/dist/mdx/snippets/findAndRemoveImports.d.ts +0 -0
  290. package/dist/mdx/snippets/findAndRemoveImports.js +0 -0
  291. package/dist/mdx/snippets/getExportMap.d.ts +0 -0
  292. package/dist/mdx/snippets/getExportMap.js +0 -0
  293. package/dist/mdx/snippets/getJsxEsmTree.d.ts +0 -0
  294. package/dist/mdx/snippets/getJsxEsmTree.js +0 -0
  295. package/dist/mdx/snippets/hasImports.d.ts +0 -0
  296. package/dist/mdx/snippets/hasImports.js +0 -0
  297. package/dist/mdx/snippets/index.d.ts +0 -0
  298. package/dist/mdx/snippets/index.js +0 -0
  299. package/dist/mdx/snippets/isImportedAsSnippet.d.ts +0 -0
  300. package/dist/mdx/snippets/isImportedAsSnippet.js +0 -0
  301. package/dist/mdx/snippets/isJsxOrTsx.d.ts +0 -0
  302. package/dist/mdx/snippets/isJsxOrTsx.js +0 -0
  303. package/dist/mdx/snippets/isSnippetExtension.d.ts +0 -0
  304. package/dist/mdx/snippets/isSnippetExtension.js +0 -0
  305. package/dist/mdx/snippets/nodeIncludesExport.d.ts +0 -0
  306. package/dist/mdx/snippets/nodeIncludesExport.js +0 -0
  307. package/dist/mdx/snippets/removeExports.d.ts +0 -0
  308. package/dist/mdx/snippets/removeExports.js +0 -0
  309. package/dist/mdx/snippets/resolveAllImports.d.ts +0 -0
  310. package/dist/mdx/snippets/resolveAllImports.js +0 -0
  311. package/dist/mdx/snippets/resolveImport/addExportPrefix.d.ts +0 -0
  312. package/dist/mdx/snippets/resolveImport/addExportPrefix.js +0 -0
  313. package/dist/mdx/snippets/resolveImport/containsRegularFunction.d.ts +0 -0
  314. package/dist/mdx/snippets/resolveImport/containsRegularFunction.js +0 -0
  315. package/dist/mdx/snippets/resolveImport/exportCollision.d.ts +0 -0
  316. package/dist/mdx/snippets/resolveImport/exportCollision.js +0 -0
  317. package/dist/mdx/snippets/resolveImport/findExport.d.ts +0 -0
  318. package/dist/mdx/snippets/resolveImport/findExport.js +0 -0
  319. package/dist/mdx/snippets/resolveImport/index.d.ts +0 -0
  320. package/dist/mdx/snippets/resolveImport/index.js +0 -0
  321. package/dist/mdx/snippets/resolveImport/injectToTopOfFile.d.ts +0 -0
  322. package/dist/mdx/snippets/resolveImport/injectToTopOfFile.js +0 -0
  323. package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.d.ts +0 -0
  324. package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.js +0 -0
  325. package/dist/mdx/snippets/resolveImportPath.d.ts +0 -0
  326. package/dist/mdx/snippets/resolveImportPath.js +0 -0
  327. package/dist/mdx/snippets/stripTsxTypes.d.ts +0 -0
  328. package/dist/mdx/snippets/stripTsxTypes.js +0 -0
  329. package/dist/mdx/titleMarkdown.d.ts +0 -0
  330. package/dist/mdx/titleMarkdown.js +0 -0
  331. package/dist/mdx/utils.d.ts +0 -0
  332. package/dist/mdx/utils.js +0 -0
  333. package/dist/mintIgnore.d.ts +6 -2
  334. package/dist/mintIgnore.js +28 -4
  335. package/dist/navigation/accessiblePagesTraversal.test.d.ts +0 -0
  336. package/dist/navigation/accessiblePagesTraversal.test.js +0 -0
  337. package/dist/navigation/activeDivisionMatching.test.d.ts +0 -0
  338. package/dist/navigation/activeDivisionMatching.test.js +0 -0
  339. package/dist/navigation/checkNavAccess.d.ts +0 -0
  340. package/dist/navigation/checkNavAccess.js +0 -0
  341. package/dist/navigation/decoratedNavigationConfig.d.ts +0 -0
  342. package/dist/navigation/decoratedNavigationConfig.js +0 -0
  343. package/dist/navigation/filterDivisions.d.ts +0 -0
  344. package/dist/navigation/filterDivisions.js +0 -0
  345. package/dist/navigation/filterDivisions.test.d.ts +0 -0
  346. package/dist/navigation/filterDivisions.test.js +0 -0
  347. package/dist/navigation/firstHrefDivisionScoping.test.d.ts +0 -0
  348. package/dist/navigation/firstHrefDivisionScoping.test.js +0 -0
  349. package/dist/navigation/generatePathToBreadcrumbsMap.d.ts +0 -0
  350. package/dist/navigation/generatePathToBreadcrumbsMap.js +0 -0
  351. package/dist/navigation/generatePathToBreadcrumbsMapForDocsConfig.d.ts +0 -0
  352. package/dist/navigation/generatePathToBreadcrumbsMapForDocsConfig.js +0 -0
  353. package/dist/navigation/getAllPathsInDecoratedNav.d.ts +0 -0
  354. package/dist/navigation/getAllPathsInDecoratedNav.js +0 -0
  355. package/dist/navigation/getAllPathsInDocsNav.d.ts +0 -0
  356. package/dist/navigation/getAllPathsInDocsNav.js +0 -0
  357. package/dist/navigation/getFirstPageFromNavConfig.d.ts +0 -0
  358. package/dist/navigation/getFirstPageFromNavConfig.js +0 -0
  359. package/dist/navigation/getFirstPageFromNavigation.d.ts +0 -0
  360. package/dist/navigation/getFirstPageFromNavigation.js +0 -0
  361. package/dist/navigation/getScopedNavForPath.test.d.ts +0 -0
  362. package/dist/navigation/getScopedNavForPath.test.js +0 -0
  363. package/dist/navigation/getVersionOrLanguageFromPath.d.ts +0 -0
  364. package/dist/navigation/getVersionOrLanguageFromPath.js +0 -0
  365. package/dist/navigation/getVersionOrLanguageFromPath.test.d.ts +0 -0
  366. package/dist/navigation/getVersionOrLanguageFromPath.test.js +0 -0
  367. package/dist/navigation/index.d.ts +0 -0
  368. package/dist/navigation/index.js +0 -0
  369. package/dist/navigation/isCommonPage.d.ts +0 -0
  370. package/dist/navigation/isCommonPage.js +0 -0
  371. package/dist/navigation/isCommonPage.test.d.ts +0 -0
  372. package/dist/navigation/isCommonPage.test.js +0 -0
  373. package/dist/navigation/isGroup.d.ts +0 -0
  374. package/dist/navigation/isGroup.js +0 -0
  375. package/dist/navigation/isPage.d.ts +0 -0
  376. package/dist/navigation/isPage.js +0 -0
  377. package/dist/navigation/pathsDifferByOneSegment.test.d.ts +0 -0
  378. package/dist/navigation/pathsDifferByOneSegment.test.js +0 -0
  379. package/dist/navigation/prioritize-default-division-item.d.ts +0 -0
  380. package/dist/navigation/prioritize-default-division-item.js +0 -0
  381. package/dist/navigation/scopeNavDictCache.test.d.ts +0 -0
  382. package/dist/navigation/scopeNavDictCache.test.js +0 -0
  383. package/dist/navigation/scopeNavStateFlip.test.d.ts +0 -0
  384. package/dist/navigation/scopeNavStateFlip.test.js +0 -0
  385. package/dist/navigation/scopeNavToPath.d.ts +0 -0
  386. package/dist/navigation/scopeNavToPath.js +0 -0
  387. package/dist/navigation/scopeNavToPath.test.d.ts +0 -0
  388. package/dist/navigation/scopeNavToPath.test.js +0 -0
  389. package/dist/navigation/scopeOffPathDivisions.test.d.ts +0 -0
  390. package/dist/navigation/scopeOffPathDivisions.test.js +0 -0
  391. package/dist/navigation/scopeProductNav.test.d.ts +0 -0
  392. package/dist/navigation/scopeProductNav.test.js +0 -0
  393. package/dist/navigation/updateFirstHrefInDivision.d.ts +0 -0
  394. package/dist/navigation/updateFirstHrefInDivision.js +0 -0
  395. package/dist/navigation/updateFirstHrefInDivision.test.d.ts +0 -0
  396. package/dist/navigation/updateFirstHrefInDivision.test.js +0 -0
  397. package/dist/navigation/versionLanguageResolution.test.d.ts +0 -0
  398. package/dist/navigation/versionLanguageResolution.test.js +0 -0
  399. package/dist/openapi/buildOpenApiMetaTag.d.ts +0 -0
  400. package/dist/openapi/buildOpenApiMetaTag.js +0 -0
  401. package/dist/openapi/content-registry.test.d.ts +0 -0
  402. package/dist/openapi/content-registry.test.js +0 -0
  403. package/dist/openapi/contentRegistry.d.ts +0 -0
  404. package/dist/openapi/contentRegistry.js +0 -0
  405. package/dist/openapi/endpointRef.d.ts +0 -0
  406. package/dist/openapi/endpointRef.js +0 -0
  407. package/dist/openapi/fetchYamlDocument.d.ts +0 -0
  408. package/dist/openapi/fetchYamlDocument.js +0 -0
  409. package/dist/openapi/filenameUtils.d.ts +0 -0
  410. package/dist/openapi/filenameUtils.js +0 -0
  411. package/dist/openapi/findNavGroup.d.ts +0 -0
  412. package/dist/openapi/findNavGroup.js +0 -0
  413. package/dist/openapi/findOpenApiPath.d.ts +0 -0
  414. package/dist/openapi/findOpenApiPath.js +0 -0
  415. package/dist/openapi/generateOpenApiPages.d.ts +0 -0
  416. package/dist/openapi/generateOpenApiPages.js +0 -0
  417. package/dist/openapi/getMatchingOpenApiFile.d.ts +0 -0
  418. package/dist/openapi/getMatchingOpenApiFile.js +0 -0
  419. package/dist/openapi/getOpenApiDocumentFromUrl.d.ts +0 -0
  420. package/dist/openapi/getOpenApiDocumentFromUrl.js +0 -0
  421. package/dist/openapi/getOpenApiOperationMethodAndEndpoint.d.ts +0 -0
  422. package/dist/openapi/getOpenApiOperationMethodAndEndpoint.js +0 -0
  423. package/dist/openapi/getOpenApiTitleAndDescription.d.ts +0 -0
  424. package/dist/openapi/getOpenApiTitleAndDescription.js +0 -0
  425. package/dist/openapi/getTagDisplayName.d.ts +0 -0
  426. package/dist/openapi/getTagDisplayName.js +0 -0
  427. package/dist/openapi/index.d.ts +0 -0
  428. package/dist/openapi/index.js +0 -0
  429. package/dist/openapi/openApiFrontmatterIsOriginalFileLocation.d.ts +0 -0
  430. package/dist/openapi/openApiFrontmatterIsOriginalFileLocation.js +0 -0
  431. package/dist/openapi/overlay/applyOverlay.d.ts +0 -0
  432. package/dist/openapi/overlay/applyOverlay.js +0 -0
  433. package/dist/openapi/overlay/errors.d.ts +0 -0
  434. package/dist/openapi/overlay/errors.js +0 -0
  435. package/dist/openapi/overlay/jsonValue.d.ts +0 -0
  436. package/dist/openapi/overlay/jsonValue.js +0 -0
  437. package/dist/openapi/overlay/mergeValue.d.ts +0 -0
  438. package/dist/openapi/overlay/mergeValue.js +0 -0
  439. package/dist/openapi/overlay/overlayRegistry.d.ts +0 -0
  440. package/dist/openapi/overlay/overlayRegistry.js +0 -0
  441. package/dist/openapi/parseApiString.d.ts +0 -0
  442. package/dist/openapi/parseApiString.js +0 -0
  443. package/dist/openapi/parseOpenApiString.d.ts +0 -0
  444. package/dist/openapi/parseOpenApiString.js +0 -0
  445. package/dist/openapi/truncateCircularReferences.d.ts +0 -0
  446. package/dist/openapi/truncateCircularReferences.js +0 -0
  447. package/dist/openapi/validate.d.ts +0 -0
  448. package/dist/openapi/validate.js +0 -0
  449. package/dist/optionallyRemoveLeadingSlash.d.ts +0 -0
  450. package/dist/optionallyRemoveLeadingSlash.js +0 -0
  451. package/dist/parse-inline-style.d.ts +0 -0
  452. package/dist/parse-inline-style.js +0 -0
  453. package/dist/paths/isEqualIgnoringLeadingSlash.d.ts +0 -0
  454. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -0
  455. package/dist/paths/isEqualIgnoringLeadingSlash.test.d.ts +0 -0
  456. package/dist/paths/isEqualIgnoringLeadingSlash.test.js +0 -0
  457. package/dist/rss/constants.d.ts +0 -0
  458. package/dist/rss/constants.js +0 -0
  459. package/dist/rss/dates.d.ts +0 -0
  460. package/dist/rss/dates.js +0 -0
  461. package/dist/rss/encodeContentAsHtml.d.ts +0 -0
  462. package/dist/rss/encodeContentAsHtml.js +0 -0
  463. package/dist/rss/enhanceSnippetsWithImportNames.d.ts +0 -0
  464. package/dist/rss/enhanceSnippetsWithImportNames.js +0 -0
  465. package/dist/rss/getV4FeedUpdates.d.ts +0 -0
  466. package/dist/rss/getV4FeedUpdates.js +0 -0
  467. package/dist/rss/index.d.ts +0 -0
  468. package/dist/rss/index.js +0 -0
  469. package/dist/rss/processUpdateNode.d.ts +0 -0
  470. package/dist/rss/processUpdateNode.js +0 -0
  471. package/dist/rss/resolveSnippets.d.ts +0 -0
  472. package/dist/rss/resolveSnippets.js +0 -0
  473. package/dist/schema/common.d.ts +0 -0
  474. package/dist/schema/common.js +0 -0
  475. package/dist/sdk/index.d.ts +0 -0
  476. package/dist/sdk/index.js +0 -0
  477. package/dist/sdk/parseSdkString.d.ts +0 -0
  478. package/dist/sdk/parseSdkString.js +0 -0
  479. package/dist/search/highlight.d.ts +7 -0
  480. package/dist/search/highlight.js +400 -0
  481. package/dist/search/highlight.test.d.ts +1 -0
  482. package/dist/search/highlight.test.js +176 -0
  483. package/dist/search/index.d.ts +1 -0
  484. package/dist/search/index.js +1 -0
  485. package/dist/secureCompare.d.ts +0 -0
  486. package/dist/secureCompare.js +0 -0
  487. package/dist/services/aws.d.ts +0 -0
  488. package/dist/services/aws.js +0 -0
  489. package/dist/slug/addTrailingSlash.d.ts +0 -0
  490. package/dist/slug/addTrailingSlash.js +0 -0
  491. package/dist/slug/getDecoratedNavPageAndSlug.d.ts +0 -0
  492. package/dist/slug/getDecoratedNavPageAndSlug.js +0 -0
  493. package/dist/slug/index.d.ts +0 -0
  494. package/dist/slug/index.js +0 -0
  495. package/dist/slug/pagePathToSlug.d.ts +0 -0
  496. package/dist/slug/pagePathToSlug.js +0 -0
  497. package/dist/slug/replaceSlashIndex.d.ts +0 -0
  498. package/dist/slug/replaceSlashIndex.js +0 -0
  499. package/dist/slug/slugToTitle.d.ts +0 -0
  500. package/dist/slug/slugToTitle.js +0 -0
  501. package/dist/slugify.d.ts +0 -0
  502. package/dist/slugify.js +0 -0
  503. package/dist/title.d.ts +0 -0
  504. package/dist/title.js +0 -0
  505. package/dist/topologicalSort.d.ts +0 -0
  506. package/dist/topologicalSort.js +0 -0
  507. package/dist/truncateAtWordBoundary.d.ts +0 -0
  508. package/dist/truncateAtWordBoundary.js +0 -0
  509. package/dist/tsconfig.build.tsbuildinfo +1 -1
  510. package/dist/types/AnalyticsEvent.d.ts +0 -0
  511. package/dist/types/AnalyticsEvent.js +0 -0
  512. package/dist/types/asyncapi.d.ts +0 -0
  513. package/dist/types/asyncapi.js +0 -0
  514. package/dist/types/guards.d.ts +0 -0
  515. package/dist/types/guards.js +0 -0
  516. package/dist/types/index.d.ts +0 -0
  517. package/dist/types/index.js +0 -0
  518. package/dist/types/mdx/ChangelogFilter.d.ts +0 -0
  519. package/dist/types/mdx/ChangelogFilter.js +0 -0
  520. package/dist/types/mdx/MdxCodeExampleData.d.ts +0 -0
  521. package/dist/types/mdx/MdxCodeExampleData.js +0 -0
  522. package/dist/types/mdx/MdxExtracts.d.ts +0 -0
  523. package/dist/types/mdx/MdxExtracts.js +0 -0
  524. package/dist/types/mdx/MultiViewItemType.d.ts +0 -0
  525. package/dist/types/mdx/MultiViewItemType.js +0 -0
  526. package/dist/types/mdx/PanelType.d.ts +0 -0
  527. package/dist/types/mdx/PanelType.js +0 -0
  528. package/dist/types/mdx/TableOfContentsSectionType.d.ts +0 -0
  529. package/dist/types/mdx/TableOfContentsSectionType.js +0 -0
  530. package/dist/types/mdx/index.d.ts +0 -0
  531. package/dist/types/mdx/index.js +0 -0
  532. package/dist/types/mdx/snippets/import.d.ts +0 -0
  533. package/dist/types/mdx/snippets/import.js +0 -0
  534. package/dist/types/openapi.d.ts +0 -0
  535. package/dist/types/openapi.js +0 -0
  536. package/dist/types/rss.d.ts +0 -0
  537. package/dist/types/rss.js +0 -0
  538. package/dist/validateCustomDomainBasePath.d.ts +0 -0
  539. package/dist/validateCustomDomainBasePath.js +0 -0
  540. package/dist/validateCustomDomainBasePath.test.d.ts +0 -0
  541. package/dist/validateCustomDomainBasePath.test.js +0 -0
  542. package/dist/validateRedirectUrl.d.ts +0 -0
  543. package/dist/validateRedirectUrl.js +0 -0
  544. package/package.json +2 -2
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
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/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
File without changes
package/dist/rss/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
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, '&amp;')
141
+ .replace(/</g, '&lt;')
142
+ .replace(/>/g, '&gt;')
143
+ .replace(/"/g, '&quot;');
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 &lt;mark&gt; 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 {};