@apify/docusaurus-plugin-typedoc-api 4.2.9 → 4.2.11-0

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 (367) hide show
  1. package/lib/_virtual/_commonjsHelpers.js +44 -0
  2. package/lib/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/lib/node_modules/boolbase/index.js +18 -0
  4. package/lib/node_modules/boolbase/index.js.map +1 -0
  5. package/lib/node_modules/cheerio/lib/esm/api/attributes.js +568 -0
  6. package/lib/node_modules/cheerio/lib/esm/api/attributes.js.map +1 -0
  7. package/lib/node_modules/cheerio/lib/esm/api/css.js +113 -0
  8. package/lib/node_modules/cheerio/lib/esm/api/css.js.map +1 -0
  9. package/lib/node_modules/cheerio/lib/esm/api/forms.js +92 -0
  10. package/lib/node_modules/cheerio/lib/esm/api/forms.js.map +1 -0
  11. package/lib/node_modules/cheerio/lib/esm/api/manipulation.js +807 -0
  12. package/lib/node_modules/cheerio/lib/esm/api/manipulation.js.map +1 -0
  13. package/lib/node_modules/cheerio/lib/esm/api/traversing.js +842 -0
  14. package/lib/node_modules/cheerio/lib/esm/api/traversing.js.map +1 -0
  15. package/lib/node_modules/cheerio/lib/esm/cheerio.js +41 -0
  16. package/lib/node_modules/cheerio/lib/esm/cheerio.js.map +1 -0
  17. package/lib/node_modules/cheerio/lib/esm/index.js +112 -0
  18. package/lib/node_modules/cheerio/lib/esm/index.js.map +1 -0
  19. package/lib/node_modules/cheerio/lib/esm/load.js +110 -0
  20. package/lib/node_modules/cheerio/lib/esm/load.js.map +1 -0
  21. package/lib/node_modules/cheerio/lib/esm/options.js +32 -0
  22. package/lib/node_modules/cheerio/lib/esm/options.js.map +1 -0
  23. package/lib/node_modules/cheerio/lib/esm/parse.js +78 -0
  24. package/lib/node_modules/cheerio/lib/esm/parse.js.map +1 -0
  25. package/lib/node_modules/cheerio/lib/esm/parsers/parse5-adapter.js +57 -0
  26. package/lib/node_modules/cheerio/lib/esm/parsers/parse5-adapter.js.map +1 -0
  27. package/lib/node_modules/cheerio/lib/esm/static.js +191 -0
  28. package/lib/node_modules/cheerio/lib/esm/static.js.map +1 -0
  29. package/lib/node_modules/cheerio/lib/esm/utils.js +105 -0
  30. package/lib/node_modules/cheerio/lib/esm/utils.js.map +1 -0
  31. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Parser.js +381 -0
  32. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Parser.js.map +1 -0
  33. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Tokenizer.js +888 -0
  34. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +1 -0
  35. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js +69 -0
  36. package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js.map +1 -0
  37. package/lib/node_modules/cheerio-select/lib/esm/helpers.js +22 -0
  38. package/lib/node_modules/cheerio-select/lib/esm/helpers.js.map +1 -0
  39. package/lib/node_modules/cheerio-select/lib/esm/index.js +252 -0
  40. package/lib/node_modules/cheerio-select/lib/esm/index.js.map +1 -0
  41. package/lib/node_modules/cheerio-select/lib/esm/positionals.js +37 -0
  42. package/lib/node_modules/cheerio-select/lib/esm/positionals.js.map +1 -0
  43. package/lib/node_modules/css-select/lib/esm/attributes.js +155 -0
  44. package/lib/node_modules/css-select/lib/esm/attributes.js.map +1 -0
  45. package/lib/node_modules/css-select/lib/esm/compile.js +118 -0
  46. package/lib/node_modules/css-select/lib/esm/compile.js.map +1 -0
  47. package/lib/node_modules/css-select/lib/esm/general.js +155 -0
  48. package/lib/node_modules/css-select/lib/esm/general.js.map +1 -0
  49. package/lib/node_modules/css-select/lib/esm/index.js +115 -0
  50. package/lib/node_modules/css-select/lib/esm/index.js.map +1 -0
  51. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js +38 -0
  52. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js.map +1 -0
  53. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/filters.js +151 -0
  54. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/filters.js.map +1 -0
  55. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/index.js +47 -0
  56. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/index.js.map +1 -0
  57. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js +88 -0
  58. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js.map +1 -0
  59. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js +85 -0
  60. package/lib/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js.map +1 -0
  61. package/lib/node_modules/css-select/lib/esm/sort.js +70 -0
  62. package/lib/node_modules/css-select/lib/esm/sort.js.map +1 -0
  63. package/lib/node_modules/css-what/lib/es/index.js +18 -0
  64. package/lib/node_modules/css-what/lib/es/index.js.map +1 -0
  65. package/lib/node_modules/css-what/lib/es/parse.js +397 -0
  66. package/lib/node_modules/css-what/lib/es/parse.js.map +1 -0
  67. package/lib/node_modules/css-what/lib/es/stringify.js +95 -0
  68. package/lib/node_modules/css-what/lib/es/stringify.js.map +1 -0
  69. package/lib/node_modules/css-what/lib/es/types.js +43 -0
  70. package/lib/node_modules/css-what/lib/es/types.js.map +1 -0
  71. package/lib/node_modules/dom-serializer/lib/esm/foreignNames.js +7 -0
  72. package/lib/node_modules/dom-serializer/lib/esm/foreignNames.js.map +1 -0
  73. package/lib/node_modules/dom-serializer/lib/esm/index.js +146 -0
  74. package/lib/node_modules/dom-serializer/lib/esm/index.js.map +1 -0
  75. package/lib/node_modules/domelementtype/lib/esm/index.js +62 -0
  76. package/lib/node_modules/domelementtype/lib/esm/index.js.map +1 -0
  77. package/lib/node_modules/domhandler/lib/esm/index.js +166 -0
  78. package/lib/node_modules/domhandler/lib/esm/index.js.map +1 -0
  79. package/lib/node_modules/domhandler/lib/esm/node.js +352 -0
  80. package/lib/node_modules/domhandler/lib/esm/node.js.map +1 -0
  81. package/lib/node_modules/domutils/lib/esm/feeds.js +176 -0
  82. package/lib/node_modules/domutils/lib/esm/feeds.js.map +1 -0
  83. package/lib/node_modules/domutils/lib/esm/helpers.js +142 -0
  84. package/lib/node_modules/domutils/lib/esm/helpers.js.map +1 -0
  85. package/lib/node_modules/domutils/lib/esm/index.js +56 -0
  86. package/lib/node_modules/domutils/lib/esm/index.js.map +1 -0
  87. package/lib/node_modules/domutils/lib/esm/legacy.js +144 -0
  88. package/lib/node_modules/domutils/lib/esm/legacy.js.map +1 -0
  89. package/lib/node_modules/domutils/lib/esm/manipulation.js +137 -0
  90. package/lib/node_modules/domutils/lib/esm/manipulation.js.map +1 -0
  91. package/lib/node_modules/domutils/lib/esm/querying.js +149 -0
  92. package/lib/node_modules/domutils/lib/esm/querying.js.map +1 -0
  93. package/lib/node_modules/domutils/lib/esm/stringify.js +80 -0
  94. package/lib/node_modules/domutils/lib/esm/stringify.js.map +1 -0
  95. package/lib/node_modules/domutils/lib/esm/traversal.js +128 -0
  96. package/lib/node_modules/domutils/lib/esm/traversal.js.map +1 -0
  97. package/lib/node_modules/entities/lib/esm/decode.js +495 -0
  98. package/lib/node_modules/entities/lib/esm/decode.js.map +1 -0
  99. package/lib/node_modules/entities/lib/esm/decode_codepoint.js +52 -0
  100. package/lib/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
  101. package/lib/node_modules/entities/lib/esm/encode.js +68 -0
  102. package/lib/node_modules/entities/lib/esm/encode.js.map +1 -0
  103. package/lib/node_modules/entities/lib/esm/escape.js +103 -0
  104. package/lib/node_modules/entities/lib/esm/escape.js.map +1 -0
  105. package/lib/node_modules/entities/lib/esm/generated/decode-data-html.js +8 -0
  106. package/lib/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
  107. package/lib/node_modules/entities/lib/esm/generated/decode-data-xml.js +8 -0
  108. package/lib/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
  109. package/lib/node_modules/entities/lib/esm/generated/encode-html.js +264 -0
  110. package/lib/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
  111. package/lib/node_modules/entities/lib/esm/index.js +122 -0
  112. package/lib/node_modules/entities/lib/esm/index.js.map +1 -0
  113. package/lib/node_modules/nth-check/lib/esm/compile.js +111 -0
  114. package/lib/node_modules/nth-check/lib/esm/compile.js.map +1 -0
  115. package/lib/node_modules/nth-check/lib/esm/index.js +73 -0
  116. package/lib/node_modules/nth-check/lib/esm/index.js.map +1 -0
  117. package/lib/node_modules/nth-check/lib/esm/parse.js +71 -0
  118. package/lib/node_modules/nth-check/lib/esm/parse.js.map +1 -0
  119. package/lib/node_modules/parse5/dist/common/doctype.js +49 -0
  120. package/lib/node_modules/parse5/dist/common/doctype.js.map +1 -0
  121. package/lib/node_modules/parse5/dist/common/error-codes.js +66 -0
  122. package/lib/node_modules/parse5/dist/common/error-codes.js.map +1 -0
  123. package/lib/node_modules/parse5/dist/common/foreign-content.js +134 -0
  124. package/lib/node_modules/parse5/dist/common/foreign-content.js.map +1 -0
  125. package/lib/node_modules/parse5/dist/common/html.js +316 -0
  126. package/lib/node_modules/parse5/dist/common/html.js.map +1 -0
  127. package/lib/node_modules/parse5/dist/common/token.js +24 -0
  128. package/lib/node_modules/parse5/dist/common/token.js.map +1 -0
  129. package/lib/node_modules/parse5/dist/common/unicode.js +72 -0
  130. package/lib/node_modules/parse5/dist/common/unicode.js.map +1 -0
  131. package/lib/node_modules/parse5/dist/index.js +58 -0
  132. package/lib/node_modules/parse5/dist/index.js.map +1 -0
  133. package/lib/node_modules/parse5/dist/parser/formatting-element-list.js +115 -0
  134. package/lib/node_modules/parse5/dist/parser/formatting-element-list.js.map +1 -0
  135. package/lib/node_modules/parse5/dist/parser/index.js +3387 -0
  136. package/lib/node_modules/parse5/dist/parser/index.js.map +1 -0
  137. package/lib/node_modules/parse5/dist/parser/open-element-stack.js +286 -0
  138. package/lib/node_modules/parse5/dist/parser/open-element-stack.js.map +1 -0
  139. package/lib/node_modules/parse5/dist/serializer/index.js +160 -0
  140. package/lib/node_modules/parse5/dist/serializer/index.js.map +1 -0
  141. package/lib/node_modules/parse5/dist/tokenizer/index.js +3142 -0
  142. package/lib/node_modules/parse5/dist/tokenizer/index.js.map +1 -0
  143. package/lib/node_modules/parse5/dist/tokenizer/preprocessor.js +195 -0
  144. package/lib/node_modules/parse5/dist/tokenizer/preprocessor.js.map +1 -0
  145. package/lib/node_modules/parse5/dist/tree-adapters/default.js +180 -0
  146. package/lib/node_modules/parse5/dist/tree-adapters/default.js.map +1 -0
  147. package/lib/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +218 -0
  148. package/lib/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js.map +1 -0
  149. package/lib/packages/plugin/src/components/AnchorLink.js.map +1 -0
  150. package/lib/packages/plugin/src/components/ApiChangelog.js.map +1 -0
  151. package/lib/packages/plugin/src/components/ApiDataContext.js.map +1 -0
  152. package/lib/packages/plugin/src/components/ApiIndex.js.map +1 -0
  153. package/lib/{components → packages/plugin/src/components}/ApiItem.js +97 -2
  154. package/lib/packages/plugin/src/components/ApiItem.js.map +1 -0
  155. package/lib/packages/plugin/src/components/ApiItemLayout.js.map +1 -0
  156. package/lib/packages/plugin/src/components/ApiOptionsLayout.js.map +1 -0
  157. package/lib/{components → packages/plugin/src/components}/ApiPage.js +0 -3
  158. package/lib/packages/plugin/src/components/ApiPage.js.map +1 -0
  159. package/lib/packages/plugin/src/components/Breadcrumb.js.map +1 -0
  160. package/lib/packages/plugin/src/components/Comment.js.map +1 -0
  161. package/lib/packages/plugin/src/components/CommentBadges.js.map +1 -0
  162. package/lib/{components → packages/plugin/src/components}/DefaultValue.js +4 -4
  163. package/lib/packages/plugin/src/components/DefaultValue.js.map +1 -0
  164. package/lib/packages/plugin/src/components/Flags.js.map +1 -0
  165. package/lib/packages/plugin/src/components/Footer.js.map +1 -0
  166. package/lib/packages/plugin/src/components/Hierarchy.js.map +1 -0
  167. package/lib/packages/plugin/src/components/Icon.js.map +1 -0
  168. package/lib/packages/plugin/src/components/Index.js.map +1 -0
  169. package/lib/{components → packages/plugin/src/components}/Markdown.js +0 -2
  170. package/lib/packages/plugin/src/components/Markdown.js.map +1 -0
  171. package/lib/packages/plugin/src/components/Member.js.map +1 -0
  172. package/lib/packages/plugin/src/components/MemberDeclaration.js.map +1 -0
  173. package/lib/{components → packages/plugin/src/components}/MemberGetterSetter.js +0 -1
  174. package/lib/packages/plugin/src/components/MemberGetterSetter.js.map +1 -0
  175. package/lib/packages/plugin/src/components/MemberReference.js.map +1 -0
  176. package/lib/{components → packages/plugin/src/components}/MemberSignatureBody.js +2 -7
  177. package/lib/packages/plugin/src/components/MemberSignatureBody.js.map +1 -0
  178. package/lib/packages/plugin/src/components/MemberSignatureTitle.js.map +1 -0
  179. package/lib/packages/plugin/src/components/MemberSignatures.js.map +1 -0
  180. package/lib/packages/plugin/src/components/MemberSources.js.map +1 -0
  181. package/lib/packages/plugin/src/components/Members.js.map +1 -0
  182. package/lib/packages/plugin/src/components/MembersGroup.js.map +1 -0
  183. package/lib/packages/plugin/src/components/Parameter.js.map +1 -0
  184. package/lib/{components → packages/plugin/src/components}/Reflection.js +0 -1
  185. package/lib/packages/plugin/src/components/Reflection.js.map +1 -0
  186. package/lib/{components → packages/plugin/src/components}/SourceLink.js +5 -1
  187. package/lib/packages/plugin/src/components/SourceLink.js.map +1 -0
  188. package/lib/{components → packages/plugin/src/components}/Type.js +2 -3
  189. package/lib/packages/plugin/src/components/Type.js.map +1 -0
  190. package/lib/packages/plugin/src/components/TypeAndParent.js.map +1 -0
  191. package/lib/packages/plugin/src/components/TypeParameters.js.map +1 -0
  192. package/lib/packages/plugin/src/components/TypeParametersGeneric.js.map +1 -0
  193. package/lib/packages/plugin/src/components/VersionBanner.js.map +1 -0
  194. package/lib/packages/plugin/src/hooks/useBreadcrumbs.js.map +1 -0
  195. package/lib/packages/plugin/src/hooks/useGitRefName.js.map +1 -0
  196. package/lib/packages/plugin/src/hooks/useMinimalLayout.js.map +1 -0
  197. package/lib/packages/plugin/src/hooks/useReflection.js.map +1 -0
  198. package/lib/packages/plugin/src/hooks/useReflectionMap.js.map +1 -0
  199. package/lib/{index.js → packages/plugin/src/index.js} +23 -10
  200. package/lib/packages/plugin/src/index.js.map +1 -0
  201. package/lib/packages/plugin/src/markdownLoader.js.map +1 -0
  202. package/lib/{plugin → packages/plugin/src/plugin}/data.js +1 -9
  203. package/lib/packages/plugin/src/plugin/data.js.map +1 -0
  204. package/lib/packages/plugin/src/plugin/python/consts.js +47 -0
  205. package/lib/packages/plugin/src/plugin/python/consts.js.map +1 -0
  206. package/lib/packages/plugin/src/plugin/python/index.js +36 -0
  207. package/lib/packages/plugin/src/plugin/python/index.js.map +1 -0
  208. package/lib/packages/plugin/src/plugin/python/inheritance.js +71 -0
  209. package/lib/packages/plugin/src/plugin/python/inheritance.js.map +1 -0
  210. package/lib/packages/plugin/src/plugin/python/packageVersions.js +46 -0
  211. package/lib/packages/plugin/src/plugin/python/packageVersions.js.map +1 -0
  212. package/lib/packages/plugin/src/plugin/python/transformation.js +359 -0
  213. package/lib/packages/plugin/src/plugin/python/transformation.js.map +1 -0
  214. package/lib/packages/plugin/src/plugin/python/type-parsing/index.js +79 -0
  215. package/lib/packages/plugin/src/plugin/python/type-parsing/index.js.map +1 -0
  216. package/lib/packages/plugin/src/plugin/python/types.js +2 -0
  217. package/lib/packages/plugin/src/plugin/python/types.js.map +1 -0
  218. package/lib/packages/plugin/src/plugin/python/utils.js +106 -0
  219. package/lib/packages/plugin/src/plugin/python/utils.js.map +1 -0
  220. package/lib/packages/plugin/src/plugin/sidebar.js.map +1 -0
  221. package/lib/{plugin → packages/plugin/src/plugin}/structure/0.23.js +0 -2
  222. package/lib/packages/plugin/src/plugin/structure/0.23.js.map +1 -0
  223. package/lib/packages/plugin/src/plugin/url.js.map +1 -0
  224. package/lib/packages/plugin/src/plugin/version.js.map +1 -0
  225. package/lib/packages/plugin/src/types.js +2 -0
  226. package/lib/packages/plugin/src/types.js.map +1 -0
  227. package/lib/packages/plugin/src/utils/helpers.js.map +1 -0
  228. package/lib/packages/plugin/src/utils/hierarchy.js.map +1 -0
  229. package/lib/{utils → packages/plugin/src/utils}/icons.js +4 -3
  230. package/lib/packages/plugin/src/utils/icons.js.map +1 -0
  231. package/lib/packages/plugin/src/utils/links.js.map +1 -0
  232. package/lib/packages/plugin/src/utils/markdown.js.map +1 -0
  233. package/lib/packages/plugin/src/utils/reexports.js +96 -0
  234. package/lib/packages/plugin/src/utils/reexports.js.map +1 -0
  235. package/lib/packages/plugin/src/utils/visibility.js.map +1 -0
  236. package/package.json +4 -3
  237. package/src/components/ApiItem.tsx +103 -9
  238. package/src/components/ApiItemLayout.tsx +4 -2
  239. package/src/components/ApiOptionsLayout.tsx +18 -16
  240. package/src/components/ApiPage.tsx +0 -2
  241. package/src/components/DefaultValue.tsx +2 -7
  242. package/src/components/Flags.tsx +1 -1
  243. package/src/components/Markdown.tsx +0 -1
  244. package/src/components/Member.tsx +19 -17
  245. package/src/components/MemberGetterSetter.tsx +0 -1
  246. package/src/components/MemberSignatureBody.tsx +42 -38
  247. package/src/components/MemberSignatureTitle.tsx +18 -15
  248. package/src/components/Reflection.tsx +1 -1
  249. package/src/components/SourceLink.tsx +6 -8
  250. package/src/components/Type.tsx +6 -14
  251. package/src/components/VersionBanner.tsx +5 -1
  252. package/src/index.ts +39 -9
  253. package/src/plugin/data.ts +6 -12
  254. package/src/plugin/python/consts.ts +50 -0
  255. package/src/plugin/python/docspec-gen/__init__.py +0 -0
  256. package/src/plugin/python/docspec-gen/generate_ast.py +73 -0
  257. package/src/plugin/python/docspec-gen/google_docstring_processor.py +185 -0
  258. package/src/plugin/python/index.ts +47 -0
  259. package/src/plugin/python/inheritance.ts +80 -0
  260. package/src/plugin/python/packageVersions.ts +43 -0
  261. package/src/plugin/python/transformation.ts +444 -0
  262. package/src/plugin/python/type-parsing/index.ts +88 -0
  263. package/src/plugin/python/type-parsing/parse_types.py +82 -0
  264. package/src/plugin/python/types.ts +83 -0
  265. package/src/plugin/python/utils.ts +123 -0
  266. package/src/plugin/structure/0.23.ts +0 -2
  267. package/src/plugin/version.ts +2 -2
  268. package/src/types.ts +9 -0
  269. package/src/utils/icons.ts +4 -2
  270. package/src/utils/reexports.ts +105 -0
  271. package/lib/components/AnchorLink.js.map +0 -1
  272. package/lib/components/ApiChangelog.js.map +0 -1
  273. package/lib/components/ApiDataContext.js.map +0 -1
  274. package/lib/components/ApiIndex.js.map +0 -1
  275. package/lib/components/ApiItem.js.map +0 -1
  276. package/lib/components/ApiItemLayout.js.map +0 -1
  277. package/lib/components/ApiOptionsLayout.js.map +0 -1
  278. package/lib/components/ApiPage.js.map +0 -1
  279. package/lib/components/Breadcrumb.js.map +0 -1
  280. package/lib/components/Comment.js.map +0 -1
  281. package/lib/components/CommentBadges.js.map +0 -1
  282. package/lib/components/DefaultValue.js.map +0 -1
  283. package/lib/components/Flags.js.map +0 -1
  284. package/lib/components/Footer.js.map +0 -1
  285. package/lib/components/Hierarchy.js.map +0 -1
  286. package/lib/components/Icon.js.map +0 -1
  287. package/lib/components/Index.js.map +0 -1
  288. package/lib/components/Markdown.js.map +0 -1
  289. package/lib/components/Member.js.map +0 -1
  290. package/lib/components/MemberDeclaration.js.map +0 -1
  291. package/lib/components/MemberGetterSetter.js.map +0 -1
  292. package/lib/components/MemberReference.js.map +0 -1
  293. package/lib/components/MemberSignatureBody.js.map +0 -1
  294. package/lib/components/MemberSignatureTitle.js.map +0 -1
  295. package/lib/components/MemberSignatures.js.map +0 -1
  296. package/lib/components/MemberSources.js.map +0 -1
  297. package/lib/components/Members.js.map +0 -1
  298. package/lib/components/MembersGroup.js.map +0 -1
  299. package/lib/components/Parameter.js.map +0 -1
  300. package/lib/components/Reflection.js.map +0 -1
  301. package/lib/components/SourceLink.js.map +0 -1
  302. package/lib/components/Type.js.map +0 -1
  303. package/lib/components/TypeAndParent.js.map +0 -1
  304. package/lib/components/TypeParameters.js.map +0 -1
  305. package/lib/components/TypeParametersGeneric.js.map +0 -1
  306. package/lib/components/VersionBanner.js.map +0 -1
  307. package/lib/hooks/useBreadcrumbs.js.map +0 -1
  308. package/lib/hooks/useGitRefName.js.map +0 -1
  309. package/lib/hooks/useMinimalLayout.js.map +0 -1
  310. package/lib/hooks/useReflection.js.map +0 -1
  311. package/lib/hooks/useReflectionMap.js.map +0 -1
  312. package/lib/index.js.map +0 -1
  313. package/lib/markdownLoader.js.map +0 -1
  314. package/lib/plugin/data.js.map +0 -1
  315. package/lib/plugin/sidebar.js.map +0 -1
  316. package/lib/plugin/structure/0.23.js.map +0 -1
  317. package/lib/plugin/url.js.map +0 -1
  318. package/lib/plugin/version.js.map +0 -1
  319. package/lib/utils/helpers.js.map +0 -1
  320. package/lib/utils/hierarchy.js.map +0 -1
  321. package/lib/utils/icons.js.map +0 -1
  322. package/lib/utils/links.js.map +0 -1
  323. package/lib/utils/markdown.js.map +0 -1
  324. package/lib/utils/visibility.js.map +0 -1
  325. /package/lib/{types.js → node_modules/cheerio/lib/esm/types.js} +0 -0
  326. /package/lib/{types.js.map → node_modules/cheerio/lib/esm/types.js.map} +0 -0
  327. /package/lib/{components → packages/plugin/src/components}/AnchorLink.js +0 -0
  328. /package/lib/{components → packages/plugin/src/components}/ApiChangelog.js +0 -0
  329. /package/lib/{components → packages/plugin/src/components}/ApiDataContext.js +0 -0
  330. /package/lib/{components → packages/plugin/src/components}/ApiIndex.js +0 -0
  331. /package/lib/{components → packages/plugin/src/components}/ApiItemLayout.js +0 -0
  332. /package/lib/{components → packages/plugin/src/components}/ApiOptionsLayout.js +0 -0
  333. /package/lib/{components → packages/plugin/src/components}/Breadcrumb.js +0 -0
  334. /package/lib/{components → packages/plugin/src/components}/Comment.js +0 -0
  335. /package/lib/{components → packages/plugin/src/components}/CommentBadges.js +0 -0
  336. /package/lib/{components → packages/plugin/src/components}/Flags.js +0 -0
  337. /package/lib/{components → packages/plugin/src/components}/Footer.js +0 -0
  338. /package/lib/{components → packages/plugin/src/components}/Hierarchy.js +0 -0
  339. /package/lib/{components → packages/plugin/src/components}/Icon.js +0 -0
  340. /package/lib/{components → packages/plugin/src/components}/Index.js +0 -0
  341. /package/lib/{components → packages/plugin/src/components}/Member.js +0 -0
  342. /package/lib/{components → packages/plugin/src/components}/MemberDeclaration.js +0 -0
  343. /package/lib/{components → packages/plugin/src/components}/MemberReference.js +0 -0
  344. /package/lib/{components → packages/plugin/src/components}/MemberSignatureTitle.js +0 -0
  345. /package/lib/{components → packages/plugin/src/components}/MemberSignatures.js +0 -0
  346. /package/lib/{components → packages/plugin/src/components}/MemberSources.js +0 -0
  347. /package/lib/{components → packages/plugin/src/components}/Members.js +0 -0
  348. /package/lib/{components → packages/plugin/src/components}/MembersGroup.js +0 -0
  349. /package/lib/{components → packages/plugin/src/components}/Parameter.js +0 -0
  350. /package/lib/{components → packages/plugin/src/components}/TypeAndParent.js +0 -0
  351. /package/lib/{components → packages/plugin/src/components}/TypeParameters.js +0 -0
  352. /package/lib/{components → packages/plugin/src/components}/TypeParametersGeneric.js +0 -0
  353. /package/lib/{components → packages/plugin/src/components}/VersionBanner.js +0 -0
  354. /package/lib/{hooks → packages/plugin/src/hooks}/useBreadcrumbs.js +0 -0
  355. /package/lib/{hooks → packages/plugin/src/hooks}/useGitRefName.js +0 -0
  356. /package/lib/{hooks → packages/plugin/src/hooks}/useMinimalLayout.js +0 -0
  357. /package/lib/{hooks → packages/plugin/src/hooks}/useReflection.js +0 -0
  358. /package/lib/{hooks → packages/plugin/src/hooks}/useReflectionMap.js +0 -0
  359. /package/lib/{markdownLoader.js → packages/plugin/src/markdownLoader.js} +0 -0
  360. /package/lib/{plugin → packages/plugin/src/plugin}/sidebar.js +0 -0
  361. /package/lib/{plugin → packages/plugin/src/plugin}/url.js +0 -0
  362. /package/lib/{plugin → packages/plugin/src/plugin}/version.js +0 -0
  363. /package/lib/{utils → packages/plugin/src/utils}/helpers.js +0 -0
  364. /package/lib/{utils → packages/plugin/src/utils}/hierarchy.js +0 -0
  365. /package/lib/{utils → packages/plugin/src/utils}/links.js +0 -0
  366. /package/lib/{utils → packages/plugin/src/utils}/markdown.js +0 -0
  367. /package/lib/{utils → packages/plugin/src/utils}/visibility.js +0 -0
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ require('../../../domhandler/lib/esm/index.js');
4
+ const node = require('../../../domhandler/lib/esm/node.js');
5
+
6
+ /**
7
+ * Given an array of nodes, remove any member that is contained by another
8
+ * member.
9
+ *
10
+ * @category Helpers
11
+ * @param nodes Nodes to filter.
12
+ * @returns Remaining nodes that aren't contained by other nodes.
13
+ */
14
+ function removeSubsets(nodes) {
15
+ let idx = nodes.length;
16
+ /*
17
+ * Check if each node (or one of its ancestors) is already contained in the
18
+ * array.
19
+ */
20
+ while (--idx >= 0) {
21
+ const node = nodes[idx];
22
+ /*
23
+ * Remove the node if it is not unique.
24
+ * We are going through the array from the end, so we only
25
+ * have to check nodes that preceed the node under consideration in the array.
26
+ */
27
+ if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
28
+ nodes.splice(idx, 1);
29
+ continue;
30
+ }
31
+ for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
32
+ if (nodes.includes(ancestor)) {
33
+ nodes.splice(idx, 1);
34
+ break;
35
+ }
36
+ }
37
+ }
38
+ return nodes;
39
+ }
40
+ /**
41
+ * @category Helpers
42
+ * @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}
43
+ */
44
+ exports.DocumentPosition = void 0;
45
+ (function (DocumentPosition) {
46
+ DocumentPosition[DocumentPosition["DISCONNECTED"] = 1] = "DISCONNECTED";
47
+ DocumentPosition[DocumentPosition["PRECEDING"] = 2] = "PRECEDING";
48
+ DocumentPosition[DocumentPosition["FOLLOWING"] = 4] = "FOLLOWING";
49
+ DocumentPosition[DocumentPosition["CONTAINS"] = 8] = "CONTAINS";
50
+ DocumentPosition[DocumentPosition["CONTAINED_BY"] = 16] = "CONTAINED_BY";
51
+ })(exports.DocumentPosition || (exports.DocumentPosition = {}));
52
+ /**
53
+ * Compare the position of one node against another node in any other document,
54
+ * returning a bitmask with the values from {@link DocumentPosition}.
55
+ *
56
+ * Document order:
57
+ * > There is an ordering, document order, defined on all the nodes in the
58
+ * > document corresponding to the order in which the first character of the
59
+ * > XML representation of each node occurs in the XML representation of the
60
+ * > document after expansion of general entities. Thus, the document element
61
+ * > node will be the first node. Element nodes occur before their children.
62
+ * > Thus, document order orders element nodes in order of the occurrence of
63
+ * > their start-tag in the XML (after expansion of entities). The attribute
64
+ * > nodes of an element occur after the element and before its children. The
65
+ * > relative order of attribute nodes is implementation-dependent.
66
+ *
67
+ * Source:
68
+ * http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
69
+ *
70
+ * @category Helpers
71
+ * @param nodeA The first node to use in the comparison
72
+ * @param nodeB The second node to use in the comparison
73
+ * @returns A bitmask describing the input nodes' relative position.
74
+ *
75
+ * See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
76
+ * a description of these values.
77
+ */
78
+ function compareDocumentPosition(nodeA, nodeB) {
79
+ const aParents = [];
80
+ const bParents = [];
81
+ if (nodeA === nodeB) {
82
+ return 0;
83
+ }
84
+ let current = node.hasChildren(nodeA) ? nodeA : nodeA.parent;
85
+ while (current) {
86
+ aParents.unshift(current);
87
+ current = current.parent;
88
+ }
89
+ current = node.hasChildren(nodeB) ? nodeB : nodeB.parent;
90
+ while (current) {
91
+ bParents.unshift(current);
92
+ current = current.parent;
93
+ }
94
+ const maxIdx = Math.min(aParents.length, bParents.length);
95
+ let idx = 0;
96
+ while (idx < maxIdx && aParents[idx] === bParents[idx]) {
97
+ idx++;
98
+ }
99
+ if (idx === 0) {
100
+ return exports.DocumentPosition.DISCONNECTED;
101
+ }
102
+ const sharedParent = aParents[idx - 1];
103
+ const siblings = sharedParent.children;
104
+ const aSibling = aParents[idx];
105
+ const bSibling = bParents[idx];
106
+ if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
107
+ if (sharedParent === nodeB) {
108
+ return exports.DocumentPosition.FOLLOWING | exports.DocumentPosition.CONTAINED_BY;
109
+ }
110
+ return exports.DocumentPosition.FOLLOWING;
111
+ }
112
+ if (sharedParent === nodeA) {
113
+ return exports.DocumentPosition.PRECEDING | exports.DocumentPosition.CONTAINS;
114
+ }
115
+ return exports.DocumentPosition.PRECEDING;
116
+ }
117
+ /**
118
+ * Sort an array of nodes based on their relative position in the document,
119
+ * removing any duplicate nodes. If the array contains nodes that do not belong
120
+ * to the same document, sort order is unspecified.
121
+ *
122
+ * @category Helpers
123
+ * @param nodes Array of DOM nodes.
124
+ * @returns Collection of unique nodes, sorted in document order.
125
+ */
126
+ function uniqueSort(nodes) {
127
+ nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
128
+ nodes.sort((a, b) => {
129
+ const relative = compareDocumentPosition(a, b);
130
+ if (relative & exports.DocumentPosition.PRECEDING) {
131
+ return -1;
132
+ } else if (relative & exports.DocumentPosition.FOLLOWING) {
133
+ return 1;
134
+ }
135
+ return 0;
136
+ });
137
+ return nodes;
138
+ }
139
+ exports.compareDocumentPosition = compareDocumentPosition;
140
+ exports.removeSubsets = removeSubsets;
141
+ exports.uniqueSort = uniqueSort;
142
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../../../node_modules/domutils/lib/esm/helpers.js"],"sourcesContent":null,"names":["DocumentPosition","hasChildren"],"mappings":";;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AAC3B;AACA;AACA;AACA;AACA,IAAI,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;AACvB,QAAQ,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA,QAA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AAC;AACrB,SAAS;AACT,QAAQ,OAAO,CAAC,CAAC;AACjB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,KAAK,CAAC;AACjB;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ const stringify = require('./stringify.js');
4
+ const traversal = require('./traversal.js');
5
+ const manipulation = require('./manipulation.js');
6
+ const querying = require('./querying.js');
7
+ const legacy = require('./legacy.js');
8
+ const helpers = require('./helpers.js');
9
+ const feeds = require('./feeds.js');
10
+ require('../../../domhandler/lib/esm/index.js');
11
+ const node = require('../../../domhandler/lib/esm/node.js');
12
+ exports.getInnerHTML = stringify.getInnerHTML;
13
+ exports.getOuterHTML = stringify.getOuterHTML;
14
+ exports.getText = stringify.getText;
15
+ exports.innerText = stringify.innerText;
16
+ exports.textContent = stringify.textContent;
17
+ exports.getAttributeValue = traversal.getAttributeValue;
18
+ exports.getChildren = traversal.getChildren;
19
+ exports.getName = traversal.getName;
20
+ exports.getParent = traversal.getParent;
21
+ exports.getSiblings = traversal.getSiblings;
22
+ exports.hasAttrib = traversal.hasAttrib;
23
+ exports.nextElementSibling = traversal.nextElementSibling;
24
+ exports.prevElementSibling = traversal.prevElementSibling;
25
+ exports.append = manipulation.append;
26
+ exports.appendChild = manipulation.appendChild;
27
+ exports.prepend = manipulation.prepend;
28
+ exports.prependChild = manipulation.prependChild;
29
+ exports.removeElement = manipulation.removeElement;
30
+ exports.replaceElement = manipulation.replaceElement;
31
+ exports.existsOne = querying.existsOne;
32
+ exports.filter = querying.filter;
33
+ exports.find = querying.find;
34
+ exports.findAll = querying.findAll;
35
+ exports.findOne = querying.findOne;
36
+ exports.findOneChild = querying.findOneChild;
37
+ exports.getElementById = legacy.getElementById;
38
+ exports.getElements = legacy.getElements;
39
+ exports.getElementsByTagName = legacy.getElementsByTagName;
40
+ exports.getElementsByTagType = legacy.getElementsByTagType;
41
+ exports.testElement = legacy.testElement;
42
+ Object.defineProperty(exports, "DocumentPosition", {
43
+ enumerable: true,
44
+ get: () => helpers.DocumentPosition
45
+ });
46
+ exports.compareDocumentPosition = helpers.compareDocumentPosition;
47
+ exports.removeSubsets = helpers.removeSubsets;
48
+ exports.uniqueSort = helpers.uniqueSort;
49
+ exports.getFeed = feeds.getFeed;
50
+ exports.hasChildren = node.hasChildren;
51
+ exports.isCDATA = node.isCDATA;
52
+ exports.isComment = node.isComment;
53
+ exports.isDocument = node.isDocument;
54
+ exports.isTag = node.isTag;
55
+ exports.isText = node.isText;
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ require('../../../domhandler/lib/esm/index.js');
4
+ const querying = require('./querying.js');
5
+ const node = require('../../../domhandler/lib/esm/node.js');
6
+
7
+ /**
8
+ * A map of functions to check nodes against.
9
+ */
10
+ const Checks = {
11
+ tag_name(name) {
12
+ if (typeof name === "function") {
13
+ return elem => node.isTag(elem) && name(elem.name);
14
+ } else if (name === "*") {
15
+ return node.isTag;
16
+ }
17
+ return elem => node.isTag(elem) && elem.name === name;
18
+ },
19
+ tag_type(type) {
20
+ if (typeof type === "function") {
21
+ return elem => type(elem.type);
22
+ }
23
+ return elem => elem.type === type;
24
+ },
25
+ tag_contains(data) {
26
+ if (typeof data === "function") {
27
+ return elem => node.isText(elem) && data(elem.data);
28
+ }
29
+ return elem => node.isText(elem) && elem.data === data;
30
+ }
31
+ };
32
+ /**
33
+ * Returns a function to check whether a node has an attribute with a particular
34
+ * value.
35
+ *
36
+ * @param attrib Attribute to check.
37
+ * @param value Attribute value to look for.
38
+ * @returns A function to check whether the a node has an attribute with a
39
+ * particular value.
40
+ */
41
+ function getAttribCheck(attrib, value) {
42
+ if (typeof value === "function") {
43
+ return elem => node.isTag(elem) && value(elem.attribs[attrib]);
44
+ }
45
+ return elem => node.isTag(elem) && elem.attribs[attrib] === value;
46
+ }
47
+ /**
48
+ * Returns a function that returns `true` if either of the input functions
49
+ * returns `true` for a node.
50
+ *
51
+ * @param a First function to combine.
52
+ * @param b Second function to combine.
53
+ * @returns A function taking a node and returning `true` if either of the input
54
+ * functions returns `true` for the node.
55
+ */
56
+ function combineFuncs(a, b) {
57
+ return elem => a(elem) || b(elem);
58
+ }
59
+ /**
60
+ * Returns a function that executes all checks in `options` and returns `true`
61
+ * if any of them match a node.
62
+ *
63
+ * @param options An object describing nodes to look for.
64
+ * @returns A function that executes all checks in `options` and returns `true`
65
+ * if any of them match a node.
66
+ */
67
+ function compileTest(options) {
68
+ const funcs = Object.keys(options).map(key => {
69
+ const value = options[key];
70
+ return Object.prototype.hasOwnProperty.call(Checks, key) ? Checks[key](value) : getAttribCheck(key, value);
71
+ });
72
+ return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
73
+ }
74
+ /**
75
+ * Checks whether a node matches the description in `options`.
76
+ *
77
+ * @category Legacy Query Functions
78
+ * @param options An object describing nodes to look for.
79
+ * @param node The element to test.
80
+ * @returns Whether the element matches the description in `options`.
81
+ */
82
+ function testElement(options, node) {
83
+ const test = compileTest(options);
84
+ return test ? test(node) : true;
85
+ }
86
+ /**
87
+ * Returns all nodes that match `options`.
88
+ *
89
+ * @category Legacy Query Functions
90
+ * @param options An object describing nodes to look for.
91
+ * @param nodes Nodes to search through.
92
+ * @param recurse Also consider child nodes.
93
+ * @param limit Maximum number of nodes to return.
94
+ * @returns All nodes that match `options`.
95
+ */
96
+ function getElements(options, nodes, recurse, limit = Infinity) {
97
+ const test = compileTest(options);
98
+ return test ? querying.filter(test, nodes, recurse, limit) : [];
99
+ }
100
+ /**
101
+ * Returns the node with the supplied ID.
102
+ *
103
+ * @category Legacy Query Functions
104
+ * @param id The unique ID attribute value to look for.
105
+ * @param nodes Nodes to search through.
106
+ * @param recurse Also consider child nodes.
107
+ * @returns The node with the supplied ID.
108
+ */
109
+ function getElementById(id, nodes, recurse = true) {
110
+ if (!Array.isArray(nodes)) nodes = [nodes];
111
+ return querying.findOne(getAttribCheck("id", id), nodes, recurse);
112
+ }
113
+ /**
114
+ * Returns all nodes with the supplied `tagName`.
115
+ *
116
+ * @category Legacy Query Functions
117
+ * @param tagName Tag name to search for.
118
+ * @param nodes Nodes to search through.
119
+ * @param recurse Also consider child nodes.
120
+ * @param limit Maximum number of nodes to return.
121
+ * @returns All nodes with the supplied `tagName`.
122
+ */
123
+ function getElementsByTagName(tagName, nodes, recurse = true, limit = Infinity) {
124
+ return querying.filter(Checks["tag_name"](tagName), nodes, recurse, limit);
125
+ }
126
+ /**
127
+ * Returns all nodes with the supplied `type`.
128
+ *
129
+ * @category Legacy Query Functions
130
+ * @param type Element type to look for.
131
+ * @param nodes Nodes to search through.
132
+ * @param recurse Also consider child nodes.
133
+ * @param limit Maximum number of nodes to return.
134
+ * @returns All nodes with the supplied `type`.
135
+ */
136
+ function getElementsByTagType(type, nodes, recurse = true, limit = Infinity) {
137
+ return querying.filter(Checks["tag_type"](type), nodes, recurse, limit);
138
+ }
139
+ exports.getElementById = getElementById;
140
+ exports.getElements = getElements;
141
+ exports.getElementsByTagName = getElementsByTagName;
142
+ exports.getElementsByTagType = getElementsByTagType;
143
+ exports.testElement = testElement;
144
+ //# sourceMappingURL=legacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy.js","sources":["../../../../../../../node_modules/domutils/lib/esm/legacy.js"],"sourcesContent":null,"names":["isTag","isText","filter","findOne"],"mappings":";;;;;;AAEA;AACA;AACA;AACA,MAAM,MAAM,GAAG;AACf,IAAI,QAAQ,CAAC,IAAI,EAAE;AACnB,QAAQ,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACxC,YAAY,OAAO,CAAC,IAAI,KAAKA,UAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5D,SAAS;A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AAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;AAC3D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B,QAAQ,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AACxB,IAAI,OAAOC,gBAAO,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE;AACvF,IAAI,OAAOD,eAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE;AACpF,IAAI,OAAOA,eAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnE;;;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,137 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Remove an element from the dom
5
+ *
6
+ * @category Manipulation
7
+ * @param elem The element to be removed
8
+ */
9
+ function removeElement(elem) {
10
+ if (elem.prev) elem.prev.next = elem.next;
11
+ if (elem.next) elem.next.prev = elem.prev;
12
+ if (elem.parent) {
13
+ const childs = elem.parent.children;
14
+ const childsIndex = childs.lastIndexOf(elem);
15
+ if (childsIndex >= 0) {
16
+ childs.splice(childsIndex, 1);
17
+ }
18
+ }
19
+ elem.next = null;
20
+ elem.prev = null;
21
+ elem.parent = null;
22
+ }
23
+ /**
24
+ * Replace an element in the dom
25
+ *
26
+ * @category Manipulation
27
+ * @param elem The element to be replaced
28
+ * @param replacement The element to be added
29
+ */
30
+ function replaceElement(elem, replacement) {
31
+ const prev = replacement.prev = elem.prev;
32
+ if (prev) {
33
+ prev.next = replacement;
34
+ }
35
+ const next = replacement.next = elem.next;
36
+ if (next) {
37
+ next.prev = replacement;
38
+ }
39
+ const parent = replacement.parent = elem.parent;
40
+ if (parent) {
41
+ const childs = parent.children;
42
+ childs[childs.lastIndexOf(elem)] = replacement;
43
+ elem.parent = null;
44
+ }
45
+ }
46
+ /**
47
+ * Append a child to an element.
48
+ *
49
+ * @category Manipulation
50
+ * @param parent The element to append to.
51
+ * @param child The element to be added as a child.
52
+ */
53
+ function appendChild(parent, child) {
54
+ removeElement(child);
55
+ child.next = null;
56
+ child.parent = parent;
57
+ if (parent.children.push(child) > 1) {
58
+ const sibling = parent.children[parent.children.length - 2];
59
+ sibling.next = child;
60
+ child.prev = sibling;
61
+ } else {
62
+ child.prev = null;
63
+ }
64
+ }
65
+ /**
66
+ * Append an element after another.
67
+ *
68
+ * @category Manipulation
69
+ * @param elem The element to append after.
70
+ * @param next The element be added.
71
+ */
72
+ function append(elem, next) {
73
+ removeElement(next);
74
+ const parent = elem.parent;
75
+ const currNext = elem.next;
76
+ next.next = currNext;
77
+ next.prev = elem;
78
+ elem.next = next;
79
+ next.parent = parent;
80
+ if (currNext) {
81
+ currNext.prev = next;
82
+ if (parent) {
83
+ const childs = parent.children;
84
+ childs.splice(childs.lastIndexOf(currNext), 0, next);
85
+ }
86
+ } else if (parent) {
87
+ parent.children.push(next);
88
+ }
89
+ }
90
+ /**
91
+ * Prepend a child to an element.
92
+ *
93
+ * @category Manipulation
94
+ * @param parent The element to prepend before.
95
+ * @param child The element to be added as a child.
96
+ */
97
+ function prependChild(parent, child) {
98
+ removeElement(child);
99
+ child.parent = parent;
100
+ child.prev = null;
101
+ if (parent.children.unshift(child) !== 1) {
102
+ const sibling = parent.children[1];
103
+ sibling.prev = child;
104
+ child.next = sibling;
105
+ } else {
106
+ child.next = null;
107
+ }
108
+ }
109
+ /**
110
+ * Prepend an element before another.
111
+ *
112
+ * @category Manipulation
113
+ * @param elem The element to prepend before.
114
+ * @param prev The element be added.
115
+ */
116
+ function prepend(elem, prev) {
117
+ removeElement(prev);
118
+ const parent = elem.parent;
119
+ if (parent) {
120
+ const childs = parent.children;
121
+ childs.splice(childs.indexOf(elem), 0, prev);
122
+ }
123
+ if (elem.prev) {
124
+ elem.prev.next = prev;
125
+ }
126
+ prev.parent = parent;
127
+ prev.prev = elem.prev;
128
+ prev.next = elem;
129
+ elem.prev = prev;
130
+ }
131
+ exports.append = append;
132
+ exports.appendChild = appendChild;
133
+ exports.prepend = prepend;
134
+ exports.prependChild = prependChild;
135
+ exports.removeElement = removeElement;
136
+ exports.replaceElement = replaceElement;
137
+ //# sourceMappingURL=manipulation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manipulation.js","sources":["../../../../../../../node_modules/domutils/lib/esm/manipulation.js"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAE;AACpC,IAAI,IAAI,IAAI,CAAC,IAAI;AACjB,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACnC,IAAI,IAAI,IAAI,CAAC,IAAI;AACjB,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACnC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,QAAQ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5C,QAAQ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M,CAAC;AACzB,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AAC1B,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB;;;;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ require('../../../domhandler/lib/esm/index.js');
4
+ const node = require('../../../domhandler/lib/esm/node.js');
5
+
6
+ /**
7
+ * Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one.
8
+ *
9
+ * @category Querying
10
+ * @param test Function to test nodes on.
11
+ * @param node Node to search. Will be included in the result set if it matches.
12
+ * @param recurse Also consider child nodes.
13
+ * @param limit Maximum number of nodes to return.
14
+ * @returns All nodes passing `test`.
15
+ */
16
+ function filter(test, node, recurse = true, limit = Infinity) {
17
+ return find(test, Array.isArray(node) ? node : [node], recurse, limit);
18
+ }
19
+ /**
20
+ * Search an array of nodes and their children for nodes passing a test function.
21
+ *
22
+ * @category Querying
23
+ * @param test Function to test nodes on.
24
+ * @param nodes Array of nodes to search.
25
+ * @param recurse Also consider child nodes.
26
+ * @param limit Maximum number of nodes to return.
27
+ * @returns All nodes passing `test`.
28
+ */
29
+ function find(test, nodes, recurse, limit) {
30
+ const result = [];
31
+ /** Stack of the arrays we are looking at. */
32
+ const nodeStack = [nodes];
33
+ /** Stack of the indices within the arrays. */
34
+ const indexStack = [0];
35
+ for (;;) {
36
+ // First, check if the current array has any more elements to look at.
37
+ if (indexStack[0] >= nodeStack[0].length) {
38
+ // If we have no more arrays to look at, we are done.
39
+ if (indexStack.length === 1) {
40
+ return result;
41
+ }
42
+ // Otherwise, remove the current array from the stack.
43
+ nodeStack.shift();
44
+ indexStack.shift();
45
+ // Loop back to the start to continue with the next array.
46
+ continue;
47
+ }
48
+ const elem = nodeStack[0][indexStack[0]++];
49
+ if (test(elem)) {
50
+ result.push(elem);
51
+ if (--limit <= 0) return result;
52
+ }
53
+ if (recurse && node.hasChildren(elem) && elem.children.length > 0) {
54
+ /*
55
+ * Add the children to the stack. We are depth-first, so this is
56
+ * the next array we look at.
57
+ */
58
+ indexStack.unshift(0);
59
+ nodeStack.unshift(elem.children);
60
+ }
61
+ }
62
+ }
63
+ /**
64
+ * Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`.
65
+ *
66
+ * @category Querying
67
+ * @param test Function to test nodes on.
68
+ * @param nodes Array of nodes to search.
69
+ * @returns The first node in the array that passes `test`.
70
+ * @deprecated Use `Array.prototype.find` directly.
71
+ */
72
+ function findOneChild(test, nodes) {
73
+ return nodes.find(test);
74
+ }
75
+ /**
76
+ * Finds one element in a tree that passes a test.
77
+ *
78
+ * @category Querying
79
+ * @param test Function to test nodes on.
80
+ * @param nodes Node or array of nodes to search.
81
+ * @param recurse Also consider child nodes.
82
+ * @returns The first node that passes `test`.
83
+ */
84
+ function findOne(test, nodes, recurse = true) {
85
+ let elem = null;
86
+ for (let i = 0; i < nodes.length && !elem; i++) {
87
+ const node$1 = nodes[i];
88
+ if (!node.isTag(node$1)) {
89
+ continue;
90
+ } else if (test(node$1)) {
91
+ elem = node$1;
92
+ } else if (recurse && node$1.children.length > 0) {
93
+ elem = findOne(test, node$1.children, true);
94
+ }
95
+ }
96
+ return elem;
97
+ }
98
+ /**
99
+ * Checks if a tree of nodes contains at least one node passing a test.
100
+ *
101
+ * @category Querying
102
+ * @param test Function to test nodes on.
103
+ * @param nodes Array of nodes to search.
104
+ * @returns Whether a tree of nodes contains at least one node passing the test.
105
+ */
106
+ function existsOne(test, nodes) {
107
+ return nodes.some(checked => node.isTag(checked) && (test(checked) || existsOne(test, checked.children)));
108
+ }
109
+ /**
110
+ * Search an array of nodes and their children for elements passing a test function.
111
+ *
112
+ * Same as `find`, but limited to elements and with less options, leading to reduced complexity.
113
+ *
114
+ * @category Querying
115
+ * @param test Function to test nodes on.
116
+ * @param nodes Array of nodes to search.
117
+ * @returns All nodes passing `test`.
118
+ */
119
+ function findAll(test, nodes) {
120
+ const result = [];
121
+ const nodeStack = [nodes];
122
+ const indexStack = [0];
123
+ for (;;) {
124
+ if (indexStack[0] >= nodeStack[0].length) {
125
+ if (nodeStack.length === 1) {
126
+ return result;
127
+ }
128
+ // Otherwise, remove the current array from the stack.
129
+ nodeStack.shift();
130
+ indexStack.shift();
131
+ // Loop back to the start to continue with the next array.
132
+ continue;
133
+ }
134
+ const elem = nodeStack[0][indexStack[0]++];
135
+ if (!node.isTag(elem)) continue;
136
+ if (test(elem)) result.push(elem);
137
+ if (elem.children.length > 0) {
138
+ indexStack.unshift(0);
139
+ nodeStack.unshift(elem.children);
140
+ }
141
+ }
142
+ }
143
+ exports.existsOne = existsOne;
144
+ exports.filter = filter;
145
+ exports.find = find;
146
+ exports.findAll = findAll;
147
+ exports.findOne = findOne;
148
+ exports.findOneChild = findOneChild;
149
+ //# sourceMappingURL=querying.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"querying.js","sources":["../../../../../../../node_modules/domutils/lib/esm/querying.js"],"sourcesContent":null,"names":["hasChildren","node","isTag"],"mappings":";;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE;AACrE,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3E,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;AAClD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB;AACA,IAAI,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,CAAC;A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