@apify/docusaurus-plugin-typedoc-api 4.2.10 → 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.
- package/lib/_virtual/_commonjsHelpers.js +44 -0
- package/lib/_virtual/_commonjsHelpers.js.map +1 -0
- package/lib/node_modules/boolbase/index.js +18 -0
- package/lib/node_modules/boolbase/index.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/api/attributes.js +568 -0
- package/lib/node_modules/cheerio/lib/esm/api/attributes.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/api/css.js +113 -0
- package/lib/node_modules/cheerio/lib/esm/api/css.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/api/forms.js +92 -0
- package/lib/node_modules/cheerio/lib/esm/api/forms.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/api/manipulation.js +807 -0
- package/lib/node_modules/cheerio/lib/esm/api/manipulation.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/api/traversing.js +842 -0
- package/lib/node_modules/cheerio/lib/esm/api/traversing.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/cheerio.js +41 -0
- package/lib/node_modules/cheerio/lib/esm/cheerio.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/index.js +112 -0
- package/lib/node_modules/cheerio/lib/esm/index.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/load.js +110 -0
- package/lib/node_modules/cheerio/lib/esm/load.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/options.js +32 -0
- package/lib/node_modules/cheerio/lib/esm/options.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/parse.js +78 -0
- package/lib/node_modules/cheerio/lib/esm/parse.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/parsers/parse5-adapter.js +57 -0
- package/lib/node_modules/cheerio/lib/esm/parsers/parse5-adapter.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/static.js +191 -0
- package/lib/node_modules/cheerio/lib/esm/static.js.map +1 -0
- package/lib/node_modules/cheerio/lib/esm/utils.js +105 -0
- package/lib/node_modules/cheerio/lib/esm/utils.js.map +1 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Parser.js +381 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Parser.js.map +1 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Tokenizer.js +888 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +1 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js +69 -0
- package/lib/node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js.map +1 -0
- package/lib/node_modules/cheerio-select/lib/esm/helpers.js +22 -0
- package/lib/node_modules/cheerio-select/lib/esm/helpers.js.map +1 -0
- package/lib/node_modules/cheerio-select/lib/esm/index.js +252 -0
- package/lib/node_modules/cheerio-select/lib/esm/index.js.map +1 -0
- package/lib/node_modules/cheerio-select/lib/esm/positionals.js +37 -0
- package/lib/node_modules/cheerio-select/lib/esm/positionals.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/attributes.js +155 -0
- package/lib/node_modules/css-select/lib/esm/attributes.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/compile.js +118 -0
- package/lib/node_modules/css-select/lib/esm/compile.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/general.js +155 -0
- package/lib/node_modules/css-select/lib/esm/general.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/index.js +115 -0
- package/lib/node_modules/css-select/lib/esm/index.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js +38 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/filters.js +151 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/filters.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/index.js +47 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/index.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js +88 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js +85 -0
- package/lib/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js.map +1 -0
- package/lib/node_modules/css-select/lib/esm/sort.js +70 -0
- package/lib/node_modules/css-select/lib/esm/sort.js.map +1 -0
- package/lib/node_modules/css-what/lib/es/index.js +18 -0
- package/lib/node_modules/css-what/lib/es/index.js.map +1 -0
- package/lib/node_modules/css-what/lib/es/parse.js +397 -0
- package/lib/node_modules/css-what/lib/es/parse.js.map +1 -0
- package/lib/node_modules/css-what/lib/es/stringify.js +95 -0
- package/lib/node_modules/css-what/lib/es/stringify.js.map +1 -0
- package/lib/node_modules/css-what/lib/es/types.js +43 -0
- package/lib/node_modules/css-what/lib/es/types.js.map +1 -0
- package/lib/node_modules/dom-serializer/lib/esm/foreignNames.js +7 -0
- package/lib/node_modules/dom-serializer/lib/esm/foreignNames.js.map +1 -0
- package/lib/node_modules/dom-serializer/lib/esm/index.js +146 -0
- package/lib/node_modules/dom-serializer/lib/esm/index.js.map +1 -0
- package/lib/node_modules/domelementtype/lib/esm/index.js +62 -0
- package/lib/node_modules/domelementtype/lib/esm/index.js.map +1 -0
- package/lib/node_modules/domhandler/lib/esm/index.js +166 -0
- package/lib/node_modules/domhandler/lib/esm/index.js.map +1 -0
- package/lib/node_modules/domhandler/lib/esm/node.js +352 -0
- package/lib/node_modules/domhandler/lib/esm/node.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/feeds.js +176 -0
- package/lib/node_modules/domutils/lib/esm/feeds.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/helpers.js +142 -0
- package/lib/node_modules/domutils/lib/esm/helpers.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/index.js +56 -0
- package/lib/node_modules/domutils/lib/esm/index.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/legacy.js +144 -0
- package/lib/node_modules/domutils/lib/esm/legacy.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/manipulation.js +137 -0
- package/lib/node_modules/domutils/lib/esm/manipulation.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/querying.js +149 -0
- package/lib/node_modules/domutils/lib/esm/querying.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/stringify.js +80 -0
- package/lib/node_modules/domutils/lib/esm/stringify.js.map +1 -0
- package/lib/node_modules/domutils/lib/esm/traversal.js +128 -0
- package/lib/node_modules/domutils/lib/esm/traversal.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/decode.js +495 -0
- package/lib/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/decode_codepoint.js +52 -0
- package/lib/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/encode.js +68 -0
- package/lib/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/escape.js +103 -0
- package/lib/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/generated/decode-data-html.js +8 -0
- package/lib/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/generated/decode-data-xml.js +8 -0
- package/lib/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/generated/encode-html.js +264 -0
- package/lib/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/lib/node_modules/entities/lib/esm/index.js +122 -0
- package/lib/node_modules/entities/lib/esm/index.js.map +1 -0
- package/lib/node_modules/nth-check/lib/esm/compile.js +111 -0
- package/lib/node_modules/nth-check/lib/esm/compile.js.map +1 -0
- package/lib/node_modules/nth-check/lib/esm/index.js +73 -0
- package/lib/node_modules/nth-check/lib/esm/index.js.map +1 -0
- package/lib/node_modules/nth-check/lib/esm/parse.js +71 -0
- package/lib/node_modules/nth-check/lib/esm/parse.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/doctype.js +49 -0
- package/lib/node_modules/parse5/dist/common/doctype.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/error-codes.js +66 -0
- package/lib/node_modules/parse5/dist/common/error-codes.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/foreign-content.js +134 -0
- package/lib/node_modules/parse5/dist/common/foreign-content.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/html.js +316 -0
- package/lib/node_modules/parse5/dist/common/html.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/token.js +24 -0
- package/lib/node_modules/parse5/dist/common/token.js.map +1 -0
- package/lib/node_modules/parse5/dist/common/unicode.js +72 -0
- package/lib/node_modules/parse5/dist/common/unicode.js.map +1 -0
- package/lib/node_modules/parse5/dist/index.js +58 -0
- package/lib/node_modules/parse5/dist/index.js.map +1 -0
- package/lib/node_modules/parse5/dist/parser/formatting-element-list.js +115 -0
- package/lib/node_modules/parse5/dist/parser/formatting-element-list.js.map +1 -0
- package/lib/node_modules/parse5/dist/parser/index.js +3387 -0
- package/lib/node_modules/parse5/dist/parser/index.js.map +1 -0
- package/lib/node_modules/parse5/dist/parser/open-element-stack.js +286 -0
- package/lib/node_modules/parse5/dist/parser/open-element-stack.js.map +1 -0
- package/lib/node_modules/parse5/dist/serializer/index.js +160 -0
- package/lib/node_modules/parse5/dist/serializer/index.js.map +1 -0
- package/lib/node_modules/parse5/dist/tokenizer/index.js +3142 -0
- package/lib/node_modules/parse5/dist/tokenizer/index.js.map +1 -0
- package/lib/node_modules/parse5/dist/tokenizer/preprocessor.js +195 -0
- package/lib/node_modules/parse5/dist/tokenizer/preprocessor.js.map +1 -0
- package/lib/node_modules/parse5/dist/tree-adapters/default.js +180 -0
- package/lib/node_modules/parse5/dist/tree-adapters/default.js.map +1 -0
- package/lib/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +218 -0
- package/lib/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js.map +1 -0
- package/lib/packages/plugin/src/components/AnchorLink.js.map +1 -0
- package/lib/packages/plugin/src/components/ApiChangelog.js.map +1 -0
- package/lib/packages/plugin/src/components/ApiDataContext.js.map +1 -0
- package/lib/packages/plugin/src/components/ApiIndex.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/ApiItem.js +97 -2
- package/lib/packages/plugin/src/components/ApiItem.js.map +1 -0
- package/lib/packages/plugin/src/components/ApiItemLayout.js.map +1 -0
- package/lib/packages/plugin/src/components/ApiOptionsLayout.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/ApiPage.js +0 -3
- package/lib/packages/plugin/src/components/ApiPage.js.map +1 -0
- package/lib/packages/plugin/src/components/Breadcrumb.js.map +1 -0
- package/lib/packages/plugin/src/components/Comment.js.map +1 -0
- package/lib/packages/plugin/src/components/CommentBadges.js.map +1 -0
- package/lib/packages/plugin/src/components/DefaultValue.js.map +1 -0
- package/lib/packages/plugin/src/components/Flags.js.map +1 -0
- package/lib/packages/plugin/src/components/Footer.js.map +1 -0
- package/lib/packages/plugin/src/components/Hierarchy.js.map +1 -0
- package/lib/packages/plugin/src/components/Icon.js.map +1 -0
- package/lib/packages/plugin/src/components/Index.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/Markdown.js +0 -2
- package/lib/packages/plugin/src/components/Markdown.js.map +1 -0
- package/lib/packages/plugin/src/components/Member.js.map +1 -0
- package/lib/packages/plugin/src/components/MemberDeclaration.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/MemberGetterSetter.js +0 -1
- package/lib/packages/plugin/src/components/MemberGetterSetter.js.map +1 -0
- package/lib/packages/plugin/src/components/MemberReference.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/MemberSignatureBody.js +2 -7
- package/lib/packages/plugin/src/components/MemberSignatureBody.js.map +1 -0
- package/lib/packages/plugin/src/components/MemberSignatureTitle.js.map +1 -0
- package/lib/packages/plugin/src/components/MemberSignatures.js.map +1 -0
- package/lib/packages/plugin/src/components/MemberSources.js.map +1 -0
- package/lib/packages/plugin/src/components/Members.js.map +1 -0
- package/lib/packages/plugin/src/components/MembersGroup.js.map +1 -0
- package/lib/packages/plugin/src/components/Parameter.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/Reflection.js +0 -1
- package/lib/packages/plugin/src/components/Reflection.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/SourceLink.js +5 -1
- package/lib/packages/plugin/src/components/SourceLink.js.map +1 -0
- package/lib/{components → packages/plugin/src/components}/Type.js +2 -3
- package/lib/packages/plugin/src/components/Type.js.map +1 -0
- package/lib/packages/plugin/src/components/TypeAndParent.js.map +1 -0
- package/lib/packages/plugin/src/components/TypeParameters.js.map +1 -0
- package/lib/packages/plugin/src/components/TypeParametersGeneric.js.map +1 -0
- package/lib/packages/plugin/src/components/VersionBanner.js.map +1 -0
- package/lib/packages/plugin/src/hooks/useBreadcrumbs.js.map +1 -0
- package/lib/packages/plugin/src/hooks/useGitRefName.js.map +1 -0
- package/lib/packages/plugin/src/hooks/useMinimalLayout.js.map +1 -0
- package/lib/packages/plugin/src/hooks/useReflection.js.map +1 -0
- package/lib/packages/plugin/src/hooks/useReflectionMap.js.map +1 -0
- package/lib/{index.js → packages/plugin/src/index.js} +23 -10
- package/lib/packages/plugin/src/index.js.map +1 -0
- package/lib/packages/plugin/src/markdownLoader.js.map +1 -0
- package/lib/{plugin → packages/plugin/src/plugin}/data.js +1 -9
- package/lib/packages/plugin/src/plugin/data.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/consts.js +47 -0
- package/lib/packages/plugin/src/plugin/python/consts.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/index.js +36 -0
- package/lib/packages/plugin/src/plugin/python/index.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/inheritance.js +71 -0
- package/lib/packages/plugin/src/plugin/python/inheritance.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/packageVersions.js +46 -0
- package/lib/packages/plugin/src/plugin/python/packageVersions.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/transformation.js +359 -0
- package/lib/packages/plugin/src/plugin/python/transformation.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/type-parsing/index.js +79 -0
- package/lib/packages/plugin/src/plugin/python/type-parsing/index.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/types.js +2 -0
- package/lib/packages/plugin/src/plugin/python/types.js.map +1 -0
- package/lib/packages/plugin/src/plugin/python/utils.js +106 -0
- package/lib/packages/plugin/src/plugin/python/utils.js.map +1 -0
- package/lib/packages/plugin/src/plugin/sidebar.js.map +1 -0
- package/lib/{plugin → packages/plugin/src/plugin}/structure/0.23.js +0 -2
- package/lib/packages/plugin/src/plugin/structure/0.23.js.map +1 -0
- package/lib/packages/plugin/src/plugin/url.js.map +1 -0
- package/lib/packages/plugin/src/plugin/version.js.map +1 -0
- package/lib/packages/plugin/src/types.js +2 -0
- package/lib/packages/plugin/src/types.js.map +1 -0
- package/lib/packages/plugin/src/utils/helpers.js.map +1 -0
- package/lib/packages/plugin/src/utils/hierarchy.js.map +1 -0
- package/lib/{utils → packages/plugin/src/utils}/icons.js +1 -2
- package/lib/packages/plugin/src/utils/icons.js.map +1 -0
- package/lib/packages/plugin/src/utils/links.js.map +1 -0
- package/lib/packages/plugin/src/utils/markdown.js.map +1 -0
- package/lib/packages/plugin/src/utils/reexports.js +96 -0
- package/lib/packages/plugin/src/utils/reexports.js.map +1 -0
- package/lib/packages/plugin/src/utils/visibility.js.map +1 -0
- package/package.json +3 -2
- package/src/components/ApiItem.tsx +103 -9
- package/src/components/ApiItemLayout.tsx +4 -2
- package/src/components/ApiOptionsLayout.tsx +18 -16
- package/src/components/ApiPage.tsx +0 -2
- package/src/components/DefaultValue.tsx +0 -1
- package/src/components/Flags.tsx +1 -1
- package/src/components/Markdown.tsx +0 -1
- package/src/components/Member.tsx +19 -17
- package/src/components/MemberGetterSetter.tsx +0 -1
- package/src/components/MemberSignatureBody.tsx +42 -38
- package/src/components/MemberSignatureTitle.tsx +18 -15
- package/src/components/Reflection.tsx +1 -1
- package/src/components/SourceLink.tsx +6 -8
- package/src/components/Type.tsx +6 -14
- package/src/components/VersionBanner.tsx +5 -1
- package/src/index.ts +39 -9
- package/src/plugin/data.ts +6 -12
- package/src/plugin/python/consts.ts +50 -0
- package/src/plugin/python/docspec-gen/__init__.py +0 -0
- package/src/plugin/python/docspec-gen/generate_ast.py +73 -0
- package/src/plugin/python/docspec-gen/google_docstring_processor.py +185 -0
- package/src/plugin/python/index.ts +47 -0
- package/src/plugin/python/inheritance.ts +80 -0
- package/src/plugin/python/packageVersions.ts +43 -0
- package/src/plugin/python/transformation.ts +444 -0
- package/src/plugin/python/type-parsing/index.ts +88 -0
- package/src/plugin/python/type-parsing/parse_types.py +82 -0
- package/src/plugin/python/types.ts +83 -0
- package/src/plugin/python/utils.ts +123 -0
- package/src/plugin/structure/0.23.ts +0 -2
- package/src/plugin/version.ts +2 -2
- package/src/types.ts +9 -0
- package/src/utils/icons.ts +4 -3
- package/src/utils/reexports.ts +105 -0
- package/lib/components/AnchorLink.js.map +0 -1
- package/lib/components/ApiChangelog.js.map +0 -1
- package/lib/components/ApiDataContext.js.map +0 -1
- package/lib/components/ApiIndex.js.map +0 -1
- package/lib/components/ApiItem.js.map +0 -1
- package/lib/components/ApiItemLayout.js.map +0 -1
- package/lib/components/ApiOptionsLayout.js.map +0 -1
- package/lib/components/ApiPage.js.map +0 -1
- package/lib/components/Breadcrumb.js.map +0 -1
- package/lib/components/Comment.js.map +0 -1
- package/lib/components/CommentBadges.js.map +0 -1
- package/lib/components/DefaultValue.js.map +0 -1
- package/lib/components/Flags.js.map +0 -1
- package/lib/components/Footer.js.map +0 -1
- package/lib/components/Hierarchy.js.map +0 -1
- package/lib/components/Icon.js.map +0 -1
- package/lib/components/Index.js.map +0 -1
- package/lib/components/Markdown.js.map +0 -1
- package/lib/components/Member.js.map +0 -1
- package/lib/components/MemberDeclaration.js.map +0 -1
- package/lib/components/MemberGetterSetter.js.map +0 -1
- package/lib/components/MemberReference.js.map +0 -1
- package/lib/components/MemberSignatureBody.js.map +0 -1
- package/lib/components/MemberSignatureTitle.js.map +0 -1
- package/lib/components/MemberSignatures.js.map +0 -1
- package/lib/components/MemberSources.js.map +0 -1
- package/lib/components/Members.js.map +0 -1
- package/lib/components/MembersGroup.js.map +0 -1
- package/lib/components/Parameter.js.map +0 -1
- package/lib/components/Reflection.js.map +0 -1
- package/lib/components/SourceLink.js.map +0 -1
- package/lib/components/Type.js.map +0 -1
- package/lib/components/TypeAndParent.js.map +0 -1
- package/lib/components/TypeParameters.js.map +0 -1
- package/lib/components/TypeParametersGeneric.js.map +0 -1
- package/lib/components/VersionBanner.js.map +0 -1
- package/lib/hooks/useBreadcrumbs.js.map +0 -1
- package/lib/hooks/useGitRefName.js.map +0 -1
- package/lib/hooks/useMinimalLayout.js.map +0 -1
- package/lib/hooks/useReflection.js.map +0 -1
- package/lib/hooks/useReflectionMap.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/markdownLoader.js.map +0 -1
- package/lib/plugin/data.js.map +0 -1
- package/lib/plugin/sidebar.js.map +0 -1
- package/lib/plugin/structure/0.23.js.map +0 -1
- package/lib/plugin/url.js.map +0 -1
- package/lib/plugin/version.js.map +0 -1
- package/lib/utils/helpers.js.map +0 -1
- package/lib/utils/hierarchy.js.map +0 -1
- package/lib/utils/icons.js.map +0 -1
- package/lib/utils/links.js.map +0 -1
- package/lib/utils/markdown.js.map +0 -1
- package/lib/utils/visibility.js.map +0 -1
- /package/lib/{types.js → node_modules/cheerio/lib/esm/types.js} +0 -0
- /package/lib/{types.js.map → node_modules/cheerio/lib/esm/types.js.map} +0 -0
- /package/lib/{components → packages/plugin/src/components}/AnchorLink.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/ApiChangelog.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/ApiDataContext.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/ApiIndex.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/ApiItemLayout.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/ApiOptionsLayout.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Breadcrumb.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Comment.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/CommentBadges.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/DefaultValue.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Flags.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Footer.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Hierarchy.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Icon.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Index.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Member.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MemberDeclaration.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MemberReference.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MemberSignatureTitle.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MemberSignatures.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MemberSources.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Members.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/MembersGroup.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/Parameter.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/TypeAndParent.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/TypeParameters.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/TypeParametersGeneric.js +0 -0
- /package/lib/{components → packages/plugin/src/components}/VersionBanner.js +0 -0
- /package/lib/{hooks → packages/plugin/src/hooks}/useBreadcrumbs.js +0 -0
- /package/lib/{hooks → packages/plugin/src/hooks}/useGitRefName.js +0 -0
- /package/lib/{hooks → packages/plugin/src/hooks}/useMinimalLayout.js +0 -0
- /package/lib/{hooks → packages/plugin/src/hooks}/useReflection.js +0 -0
- /package/lib/{hooks → packages/plugin/src/hooks}/useReflectionMap.js +0 -0
- /package/lib/{markdownLoader.js → packages/plugin/src/markdownLoader.js} +0 -0
- /package/lib/{plugin → packages/plugin/src/plugin}/sidebar.js +0 -0
- /package/lib/{plugin → packages/plugin/src/plugin}/url.js +0 -0
- /package/lib/{plugin → packages/plugin/src/plugin}/version.js +0 -0
- /package/lib/{utils → packages/plugin/src/utils}/helpers.js +0 -0
- /package/lib/{utils → packages/plugin/src/utils}/hierarchy.js +0 -0
- /package/lib/{utils → packages/plugin/src/utils}/links.js +0 -0
- /package/lib/{utils → packages/plugin/src/utils}/markdown.js +0 -0
- /package/lib/{utils → packages/plugin/src/utils}/visibility.js +0 -0
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
+
require('../../../../domhandler/lib/esm/index.js');
|
|
10
|
+
const parse = require('../parse.js');
|
|
11
|
+
const _static = require('../static.js');
|
|
12
|
+
const utils = require('../utils.js');
|
|
13
|
+
require('../../../../domutils/lib/esm/index.js');
|
|
14
|
+
const node = require('../../../../domhandler/lib/esm/node.js');
|
|
15
|
+
const manipulation = require('../../../../domutils/lib/esm/manipulation.js');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Methods for modifying the DOM structure.
|
|
19
|
+
*
|
|
20
|
+
* @module cheerio/manipulation
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Create an array of nodes, recursing into arrays and parsing strings if necessary.
|
|
24
|
+
*
|
|
25
|
+
* @private
|
|
26
|
+
* @category Manipulation
|
|
27
|
+
* @param elem - Elements to make an array of.
|
|
28
|
+
* @param clone - Optionally clone nodes.
|
|
29
|
+
* @returns The array of nodes.
|
|
30
|
+
*/
|
|
31
|
+
function _makeDomArray(elem, clone) {
|
|
32
|
+
if (elem == null) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
if (utils.isCheerio(elem)) {
|
|
36
|
+
return clone ? utils.cloneDom(elem.get()) : elem.get();
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(elem)) {
|
|
39
|
+
return elem.reduce((newElems, el) => newElems.concat(this._makeDomArray(el, clone)), []);
|
|
40
|
+
}
|
|
41
|
+
if (typeof elem === 'string') {
|
|
42
|
+
return this._parse(elem, this.options, false, null).children;
|
|
43
|
+
}
|
|
44
|
+
return clone ? utils.cloneDom([elem]) : [elem];
|
|
45
|
+
}
|
|
46
|
+
function _insert(concatenator) {
|
|
47
|
+
return function (...elems) {
|
|
48
|
+
const lastIdx = this.length - 1;
|
|
49
|
+
return utils.domEach(this, (el, i) => {
|
|
50
|
+
if (!node.hasChildren(el)) return;
|
|
51
|
+
const domSrc = typeof elems[0] === 'function' ? elems[0].call(el, i, this._render(el.children)) : elems;
|
|
52
|
+
const dom = this._makeDomArray(domSrc, i < lastIdx);
|
|
53
|
+
concatenator(dom, el.children, el);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Modify an array in-place, removing some number of elements and adding new
|
|
59
|
+
* elements directly following them.
|
|
60
|
+
*
|
|
61
|
+
* @private
|
|
62
|
+
* @category Manipulation
|
|
63
|
+
* @param array - Target array to splice.
|
|
64
|
+
* @param spliceIdx - Index at which to begin changing the array.
|
|
65
|
+
* @param spliceCount - Number of elements to remove from the array.
|
|
66
|
+
* @param newElems - Elements to insert into the array.
|
|
67
|
+
* @param parent - The parent of the node.
|
|
68
|
+
* @returns The spliced array.
|
|
69
|
+
*/
|
|
70
|
+
function uniqueSplice(array, spliceIdx, spliceCount, newElems, parent) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
const spliceArgs = [spliceIdx, spliceCount, ...newElems];
|
|
73
|
+
const prev = spliceIdx === 0 ? null : array[spliceIdx - 1];
|
|
74
|
+
const next = spliceIdx + spliceCount >= array.length ? null : array[spliceIdx + spliceCount];
|
|
75
|
+
/*
|
|
76
|
+
* Before splicing in new elements, ensure they do not already appear in the
|
|
77
|
+
* current array.
|
|
78
|
+
*/
|
|
79
|
+
for (let idx = 0; idx < newElems.length; ++idx) {
|
|
80
|
+
const node = newElems[idx];
|
|
81
|
+
const oldParent = node.parent;
|
|
82
|
+
if (oldParent) {
|
|
83
|
+
const oldSiblings = oldParent.children;
|
|
84
|
+
const prevIdx = oldSiblings.indexOf(node);
|
|
85
|
+
if (prevIdx > -1) {
|
|
86
|
+
oldParent.children.splice(prevIdx, 1);
|
|
87
|
+
if (parent === oldParent && spliceIdx > prevIdx) {
|
|
88
|
+
spliceArgs[0]--;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
node.parent = parent;
|
|
93
|
+
if (node.prev) {
|
|
94
|
+
node.prev.next = (_a = node.next) !== null && _a !== void 0 ? _a : null;
|
|
95
|
+
}
|
|
96
|
+
if (node.next) {
|
|
97
|
+
node.next.prev = (_b = node.prev) !== null && _b !== void 0 ? _b : null;
|
|
98
|
+
}
|
|
99
|
+
node.prev = idx === 0 ? prev : newElems[idx - 1];
|
|
100
|
+
node.next = idx === newElems.length - 1 ? next : newElems[idx + 1];
|
|
101
|
+
}
|
|
102
|
+
if (prev) {
|
|
103
|
+
prev.next = newElems[0];
|
|
104
|
+
}
|
|
105
|
+
if (next) {
|
|
106
|
+
next.prev = newElems[newElems.length - 1];
|
|
107
|
+
}
|
|
108
|
+
return array.splice(...spliceArgs);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Insert every element in the set of matched elements to the end of the target.
|
|
112
|
+
*
|
|
113
|
+
* @category Manipulation
|
|
114
|
+
* @example
|
|
115
|
+
*
|
|
116
|
+
* ```js
|
|
117
|
+
* $('<li class="plum">Plum</li>').appendTo('#fruits');
|
|
118
|
+
* $.html();
|
|
119
|
+
* //=> <ul id="fruits">
|
|
120
|
+
* // <li class="apple">Apple</li>
|
|
121
|
+
* // <li class="orange">Orange</li>
|
|
122
|
+
* // <li class="pear">Pear</li>
|
|
123
|
+
* // <li class="plum">Plum</li>
|
|
124
|
+
* // </ul>
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* @param target - Element to append elements to.
|
|
128
|
+
* @returns The instance itself.
|
|
129
|
+
* @see {@link https://api.jquery.com/appendTo/}
|
|
130
|
+
*/
|
|
131
|
+
function appendTo(target) {
|
|
132
|
+
const appendTarget = utils.isCheerio(target) ? target : this._make(target);
|
|
133
|
+
appendTarget.append(this);
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Insert every element in the set of matched elements to the beginning of the target.
|
|
138
|
+
*
|
|
139
|
+
* @category Manipulation
|
|
140
|
+
* @example
|
|
141
|
+
*
|
|
142
|
+
* ```js
|
|
143
|
+
* $('<li class="plum">Plum</li>').prependTo('#fruits');
|
|
144
|
+
* $.html();
|
|
145
|
+
* //=> <ul id="fruits">
|
|
146
|
+
* // <li class="plum">Plum</li>
|
|
147
|
+
* // <li class="apple">Apple</li>
|
|
148
|
+
* // <li class="orange">Orange</li>
|
|
149
|
+
* // <li class="pear">Pear</li>
|
|
150
|
+
* // </ul>
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @param target - Element to prepend elements to.
|
|
154
|
+
* @returns The instance itself.
|
|
155
|
+
* @see {@link https://api.jquery.com/prependTo/}
|
|
156
|
+
*/
|
|
157
|
+
function prependTo(target) {
|
|
158
|
+
const prependTarget = utils.isCheerio(target) ? target : this._make(target);
|
|
159
|
+
prependTarget.prepend(this);
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Inserts content as the _last_ child of each of the selected elements.
|
|
164
|
+
*
|
|
165
|
+
* @category Manipulation
|
|
166
|
+
* @example
|
|
167
|
+
*
|
|
168
|
+
* ```js
|
|
169
|
+
* $('ul').append('<li class="plum">Plum</li>');
|
|
170
|
+
* $.html();
|
|
171
|
+
* //=> <ul id="fruits">
|
|
172
|
+
* // <li class="apple">Apple</li>
|
|
173
|
+
* // <li class="orange">Orange</li>
|
|
174
|
+
* // <li class="pear">Pear</li>
|
|
175
|
+
* // <li class="plum">Plum</li>
|
|
176
|
+
* // </ul>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @see {@link https://api.jquery.com/append/}
|
|
180
|
+
*/
|
|
181
|
+
const append = _insert((dom, children, parent) => {
|
|
182
|
+
uniqueSplice(children, children.length, 0, dom, parent);
|
|
183
|
+
});
|
|
184
|
+
/**
|
|
185
|
+
* Inserts content as the _first_ child of each of the selected elements.
|
|
186
|
+
*
|
|
187
|
+
* @category Manipulation
|
|
188
|
+
* @example
|
|
189
|
+
*
|
|
190
|
+
* ```js
|
|
191
|
+
* $('ul').prepend('<li class="plum">Plum</li>');
|
|
192
|
+
* $.html();
|
|
193
|
+
* //=> <ul id="fruits">
|
|
194
|
+
* // <li class="plum">Plum</li>
|
|
195
|
+
* // <li class="apple">Apple</li>
|
|
196
|
+
* // <li class="orange">Orange</li>
|
|
197
|
+
* // <li class="pear">Pear</li>
|
|
198
|
+
* // </ul>
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* @see {@link https://api.jquery.com/prepend/}
|
|
202
|
+
*/
|
|
203
|
+
const prepend = _insert((dom, children, parent) => {
|
|
204
|
+
uniqueSplice(children, 0, 0, dom, parent);
|
|
205
|
+
});
|
|
206
|
+
function _wrap(insert) {
|
|
207
|
+
return function (wrapper) {
|
|
208
|
+
const lastIdx = this.length - 1;
|
|
209
|
+
const lastParent = this.parents().last();
|
|
210
|
+
for (let i = 0; i < this.length; i++) {
|
|
211
|
+
const el = this[i];
|
|
212
|
+
const wrap = typeof wrapper === 'function' ? wrapper.call(el, i, el) : typeof wrapper === 'string' && !utils.isHtml(wrapper) ? lastParent.find(wrapper).clone() : wrapper;
|
|
213
|
+
const _this$_makeDomArray = this._makeDomArray(wrap, i < lastIdx),
|
|
214
|
+
_this$_makeDomArray2 = _slicedToArray(_this$_makeDomArray, 1),
|
|
215
|
+
wrapperDom = _this$_makeDomArray2[0];
|
|
216
|
+
if (!wrapperDom || !node.hasChildren(wrapperDom)) continue;
|
|
217
|
+
let elInsertLocation = wrapperDom;
|
|
218
|
+
/*
|
|
219
|
+
* Find the deepest child. Only consider the first tag child of each node
|
|
220
|
+
* (ignore text); stop if no children are found.
|
|
221
|
+
*/
|
|
222
|
+
let j = 0;
|
|
223
|
+
while (j < elInsertLocation.children.length) {
|
|
224
|
+
const child = elInsertLocation.children[j];
|
|
225
|
+
if (node.isTag(child)) {
|
|
226
|
+
elInsertLocation = child;
|
|
227
|
+
j = 0;
|
|
228
|
+
} else {
|
|
229
|
+
j++;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
insert(el, elInsertLocation, [wrapperDom]);
|
|
233
|
+
}
|
|
234
|
+
return this;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* The .wrap() function can take any string or object that could be passed to
|
|
239
|
+
* the $() factory function to specify a DOM structure. This structure may be
|
|
240
|
+
* nested several levels deep, but should contain only one inmost element. A
|
|
241
|
+
* copy of this structure will be wrapped around each of the elements in the set
|
|
242
|
+
* of matched elements. This method returns the original set of elements for
|
|
243
|
+
* chaining purposes.
|
|
244
|
+
*
|
|
245
|
+
* @category Manipulation
|
|
246
|
+
* @example
|
|
247
|
+
*
|
|
248
|
+
* ```js
|
|
249
|
+
* const redFruit = $('<div class="red-fruit"></div>');
|
|
250
|
+
* $('.apple').wrap(redFruit);
|
|
251
|
+
*
|
|
252
|
+
* //=> <ul id="fruits">
|
|
253
|
+
* // <div class="red-fruit">
|
|
254
|
+
* // <li class="apple">Apple</li>
|
|
255
|
+
* // </div>
|
|
256
|
+
* // <li class="orange">Orange</li>
|
|
257
|
+
* // <li class="plum">Plum</li>
|
|
258
|
+
* // </ul>
|
|
259
|
+
*
|
|
260
|
+
* const healthy = $('<div class="healthy"></div>');
|
|
261
|
+
* $('li').wrap(healthy);
|
|
262
|
+
*
|
|
263
|
+
* //=> <ul id="fruits">
|
|
264
|
+
* // <div class="healthy">
|
|
265
|
+
* // <li class="apple">Apple</li>
|
|
266
|
+
* // </div>
|
|
267
|
+
* // <div class="healthy">
|
|
268
|
+
* // <li class="orange">Orange</li>
|
|
269
|
+
* // </div>
|
|
270
|
+
* // <div class="healthy">
|
|
271
|
+
* // <li class="plum">Plum</li>
|
|
272
|
+
* // </div>
|
|
273
|
+
* // </ul>
|
|
274
|
+
* ```
|
|
275
|
+
*
|
|
276
|
+
* @param wrapper - The DOM structure to wrap around each element in the selection.
|
|
277
|
+
* @see {@link https://api.jquery.com/wrap/}
|
|
278
|
+
*/
|
|
279
|
+
const wrap = _wrap((el, elInsertLocation, wrapperDom) => {
|
|
280
|
+
const parent = el.parent;
|
|
281
|
+
if (!parent) return;
|
|
282
|
+
const siblings = parent.children;
|
|
283
|
+
const index = siblings.indexOf(el);
|
|
284
|
+
parse.update([el], elInsertLocation);
|
|
285
|
+
/*
|
|
286
|
+
* The previous operation removed the current element from the `siblings`
|
|
287
|
+
* array, so the `dom` array can be inserted without removing any
|
|
288
|
+
* additional elements.
|
|
289
|
+
*/
|
|
290
|
+
uniqueSplice(siblings, index, 0, wrapperDom, parent);
|
|
291
|
+
});
|
|
292
|
+
/**
|
|
293
|
+
* The .wrapInner() function can take any string or object that could be passed
|
|
294
|
+
* to the $() factory function to specify a DOM structure. This structure may be
|
|
295
|
+
* nested several levels deep, but should contain only one inmost element. The
|
|
296
|
+
* structure will be wrapped around the content of each of the elements in the
|
|
297
|
+
* set of matched elements.
|
|
298
|
+
*
|
|
299
|
+
* @category Manipulation
|
|
300
|
+
* @example
|
|
301
|
+
*
|
|
302
|
+
* ```js
|
|
303
|
+
* const redFruit = $('<div class="red-fruit"></div>');
|
|
304
|
+
* $('.apple').wrapInner(redFruit);
|
|
305
|
+
*
|
|
306
|
+
* //=> <ul id="fruits">
|
|
307
|
+
* // <li class="apple">
|
|
308
|
+
* // <div class="red-fruit">Apple</div>
|
|
309
|
+
* // </li>
|
|
310
|
+
* // <li class="orange">Orange</li>
|
|
311
|
+
* // <li class="pear">Pear</li>
|
|
312
|
+
* // </ul>
|
|
313
|
+
*
|
|
314
|
+
* const healthy = $('<div class="healthy"></div>');
|
|
315
|
+
* $('li').wrapInner(healthy);
|
|
316
|
+
*
|
|
317
|
+
* //=> <ul id="fruits">
|
|
318
|
+
* // <li class="apple">
|
|
319
|
+
* // <div class="healthy">Apple</div>
|
|
320
|
+
* // </li>
|
|
321
|
+
* // <li class="orange">
|
|
322
|
+
* // <div class="healthy">Orange</div>
|
|
323
|
+
* // </li>
|
|
324
|
+
* // <li class="pear">
|
|
325
|
+
* // <div class="healthy">Pear</div>
|
|
326
|
+
* // </li>
|
|
327
|
+
* // </ul>
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* @param wrapper - The DOM structure to wrap around the content of each element
|
|
331
|
+
* in the selection.
|
|
332
|
+
* @returns The instance itself, for chaining.
|
|
333
|
+
* @see {@link https://api.jquery.com/wrapInner/}
|
|
334
|
+
*/
|
|
335
|
+
const wrapInner = _wrap((el, elInsertLocation, wrapperDom) => {
|
|
336
|
+
if (!node.hasChildren(el)) return;
|
|
337
|
+
parse.update(el.children, elInsertLocation);
|
|
338
|
+
parse.update(wrapperDom, el);
|
|
339
|
+
});
|
|
340
|
+
/**
|
|
341
|
+
* The .unwrap() function, removes the parents of the set of matched elements
|
|
342
|
+
* from the DOM, leaving the matched elements in their place.
|
|
343
|
+
*
|
|
344
|
+
* @category Manipulation
|
|
345
|
+
* @example <caption>without selector</caption>
|
|
346
|
+
*
|
|
347
|
+
* ```js
|
|
348
|
+
* const $ = cheerio.load(
|
|
349
|
+
* '<div id=test>\n <div><p>Hello</p></div>\n <div><p>World</p></div>\n</div>'
|
|
350
|
+
* );
|
|
351
|
+
* $('#test p').unwrap();
|
|
352
|
+
*
|
|
353
|
+
* //=> <div id=test>
|
|
354
|
+
* // <p>Hello</p>
|
|
355
|
+
* // <p>World</p>
|
|
356
|
+
* // </div>
|
|
357
|
+
* ```
|
|
358
|
+
*
|
|
359
|
+
* @example <caption>with selector</caption>
|
|
360
|
+
*
|
|
361
|
+
* ```js
|
|
362
|
+
* const $ = cheerio.load(
|
|
363
|
+
* '<div id=test>\n <p>Hello</p>\n <b><p>World</p></b>\n</div>'
|
|
364
|
+
* );
|
|
365
|
+
* $('#test p').unwrap('b');
|
|
366
|
+
*
|
|
367
|
+
* //=> <div id=test>
|
|
368
|
+
* // <p>Hello</p>
|
|
369
|
+
* // <p>World</p>
|
|
370
|
+
* // </div>
|
|
371
|
+
* ```
|
|
372
|
+
*
|
|
373
|
+
* @param selector - A selector to check the parent element against. If an
|
|
374
|
+
* element's parent does not match the selector, the element won't be unwrapped.
|
|
375
|
+
* @returns The instance itself, for chaining.
|
|
376
|
+
* @see {@link https://api.jquery.com/unwrap/}
|
|
377
|
+
*/
|
|
378
|
+
function unwrap(selector) {
|
|
379
|
+
this.parent(selector).not('body').each((_, el) => {
|
|
380
|
+
this._make(el).replaceWith(el.children);
|
|
381
|
+
});
|
|
382
|
+
return this;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The .wrapAll() function can take any string or object that could be passed to
|
|
386
|
+
* the $() function to specify a DOM structure. This structure may be nested
|
|
387
|
+
* several levels deep, but should contain only one inmost element. The
|
|
388
|
+
* structure will be wrapped around all of the elements in the set of matched
|
|
389
|
+
* elements, as a single group.
|
|
390
|
+
*
|
|
391
|
+
* @category Manipulation
|
|
392
|
+
* @example <caption>With markup passed to `wrapAll`</caption>
|
|
393
|
+
*
|
|
394
|
+
* ```js
|
|
395
|
+
* const $ = cheerio.load(
|
|
396
|
+
* '<div class="container"><div class="inner">First</div><div class="inner">Second</div></div>'
|
|
397
|
+
* );
|
|
398
|
+
* $('.inner').wrapAll("<div class='new'></div>");
|
|
399
|
+
*
|
|
400
|
+
* //=> <div class="container">
|
|
401
|
+
* // <div class='new'>
|
|
402
|
+
* // <div class="inner">First</div>
|
|
403
|
+
* // <div class="inner">Second</div>
|
|
404
|
+
* // </div>
|
|
405
|
+
* // </div>
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* @example <caption>With an existing cheerio instance</caption>
|
|
409
|
+
*
|
|
410
|
+
* ```js
|
|
411
|
+
* const $ = cheerio.load(
|
|
412
|
+
* '<span>Span 1</span><strong>Strong</strong><span>Span 2</span>'
|
|
413
|
+
* );
|
|
414
|
+
* const wrap = $('<div><p><em><b></b></em></p></div>');
|
|
415
|
+
* $('span').wrapAll(wrap);
|
|
416
|
+
*
|
|
417
|
+
* //=> <div>
|
|
418
|
+
* // <p>
|
|
419
|
+
* // <em>
|
|
420
|
+
* // <b>
|
|
421
|
+
* // <span>Span 1</span>
|
|
422
|
+
* // <span>Span 2</span>
|
|
423
|
+
* // </b>
|
|
424
|
+
* // </em>
|
|
425
|
+
* // </p>
|
|
426
|
+
* // </div>
|
|
427
|
+
* // <strong>Strong</strong>
|
|
428
|
+
* ```
|
|
429
|
+
*
|
|
430
|
+
* @param wrapper - The DOM structure to wrap around all matched elements in the
|
|
431
|
+
* selection.
|
|
432
|
+
* @returns The instance itself.
|
|
433
|
+
* @see {@link https://api.jquery.com/wrapAll/}
|
|
434
|
+
*/
|
|
435
|
+
function wrapAll(wrapper) {
|
|
436
|
+
const el = this[0];
|
|
437
|
+
if (el) {
|
|
438
|
+
const wrap = this._make(typeof wrapper === 'function' ? wrapper.call(el, 0, el) : wrapper).insertBefore(el);
|
|
439
|
+
// If html is given as wrapper, wrap may contain text elements
|
|
440
|
+
let elInsertLocation;
|
|
441
|
+
for (let i = 0; i < wrap.length; i++) {
|
|
442
|
+
if (wrap[i].type === 'tag') elInsertLocation = wrap[i];
|
|
443
|
+
}
|
|
444
|
+
let j = 0;
|
|
445
|
+
/*
|
|
446
|
+
* Find the deepest child. Only consider the first tag child of each node
|
|
447
|
+
* (ignore text); stop if no children are found.
|
|
448
|
+
*/
|
|
449
|
+
while (elInsertLocation && j < elInsertLocation.children.length) {
|
|
450
|
+
const child = elInsertLocation.children[j];
|
|
451
|
+
if (child.type === 'tag') {
|
|
452
|
+
elInsertLocation = child;
|
|
453
|
+
j = 0;
|
|
454
|
+
} else {
|
|
455
|
+
j++;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
if (elInsertLocation) this._make(elInsertLocation).append(this);
|
|
459
|
+
}
|
|
460
|
+
return this;
|
|
461
|
+
}
|
|
462
|
+
/* eslint-disable jsdoc/check-param-names*/
|
|
463
|
+
/**
|
|
464
|
+
* Insert content next to each element in the set of matched elements.
|
|
465
|
+
*
|
|
466
|
+
* @category Manipulation
|
|
467
|
+
* @example
|
|
468
|
+
*
|
|
469
|
+
* ```js
|
|
470
|
+
* $('.apple').after('<li class="plum">Plum</li>');
|
|
471
|
+
* $.html();
|
|
472
|
+
* //=> <ul id="fruits">
|
|
473
|
+
* // <li class="apple">Apple</li>
|
|
474
|
+
* // <li class="plum">Plum</li>
|
|
475
|
+
* // <li class="orange">Orange</li>
|
|
476
|
+
* // <li class="pear">Pear</li>
|
|
477
|
+
* // </ul>
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @param content - HTML string, DOM element, array of DOM elements or Cheerio
|
|
481
|
+
* to insert after each element in the set of matched elements.
|
|
482
|
+
* @returns The instance itself.
|
|
483
|
+
* @see {@link https://api.jquery.com/after/}
|
|
484
|
+
*/
|
|
485
|
+
function after(...elems) {
|
|
486
|
+
const lastIdx = this.length - 1;
|
|
487
|
+
return utils.domEach(this, (el, i) => {
|
|
488
|
+
const parent = el.parent;
|
|
489
|
+
if (!node.hasChildren(el) || !parent) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
const siblings = parent.children;
|
|
493
|
+
const index = siblings.indexOf(el);
|
|
494
|
+
// If not found, move on
|
|
495
|
+
/* istanbul ignore next */
|
|
496
|
+
if (index < 0) return;
|
|
497
|
+
const domSrc = typeof elems[0] === 'function' ? elems[0].call(el, i, this._render(el.children)) : elems;
|
|
498
|
+
const dom = this._makeDomArray(domSrc, i < lastIdx);
|
|
499
|
+
// Add element after `this` element
|
|
500
|
+
uniqueSplice(siblings, index + 1, 0, dom, parent);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
/* eslint-enable jsdoc/check-param-names*/
|
|
504
|
+
/**
|
|
505
|
+
* Insert every element in the set of matched elements after the target.
|
|
506
|
+
*
|
|
507
|
+
* @category Manipulation
|
|
508
|
+
* @example
|
|
509
|
+
*
|
|
510
|
+
* ```js
|
|
511
|
+
* $('<li class="plum">Plum</li>').insertAfter('.apple');
|
|
512
|
+
* $.html();
|
|
513
|
+
* //=> <ul id="fruits">
|
|
514
|
+
* // <li class="apple">Apple</li>
|
|
515
|
+
* // <li class="plum">Plum</li>
|
|
516
|
+
* // <li class="orange">Orange</li>
|
|
517
|
+
* // <li class="pear">Pear</li>
|
|
518
|
+
* // </ul>
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @param target - Element to insert elements after.
|
|
522
|
+
* @returns The set of newly inserted elements.
|
|
523
|
+
* @see {@link https://api.jquery.com/insertAfter/}
|
|
524
|
+
*/
|
|
525
|
+
function insertAfter(target) {
|
|
526
|
+
if (typeof target === 'string') {
|
|
527
|
+
target = this._make(target);
|
|
528
|
+
}
|
|
529
|
+
this.remove();
|
|
530
|
+
const clones = [];
|
|
531
|
+
this._makeDomArray(target).forEach(el => {
|
|
532
|
+
const clonedSelf = this.clone().toArray();
|
|
533
|
+
const parent = el.parent;
|
|
534
|
+
if (!parent) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
const siblings = parent.children;
|
|
538
|
+
const index = siblings.indexOf(el);
|
|
539
|
+
// If not found, move on
|
|
540
|
+
/* istanbul ignore next */
|
|
541
|
+
if (index < 0) return;
|
|
542
|
+
// Add cloned `this` element(s) after target element
|
|
543
|
+
uniqueSplice(siblings, index + 1, 0, clonedSelf, parent);
|
|
544
|
+
clones.push(...clonedSelf);
|
|
545
|
+
});
|
|
546
|
+
return this._make(clones);
|
|
547
|
+
}
|
|
548
|
+
/* eslint-disable jsdoc/check-param-names*/
|
|
549
|
+
/**
|
|
550
|
+
* Insert content previous to each element in the set of matched elements.
|
|
551
|
+
*
|
|
552
|
+
* @category Manipulation
|
|
553
|
+
* @example
|
|
554
|
+
*
|
|
555
|
+
* ```js
|
|
556
|
+
* $('.apple').before('<li class="plum">Plum</li>');
|
|
557
|
+
* $.html();
|
|
558
|
+
* //=> <ul id="fruits">
|
|
559
|
+
* // <li class="plum">Plum</li>
|
|
560
|
+
* // <li class="apple">Apple</li>
|
|
561
|
+
* // <li class="orange">Orange</li>
|
|
562
|
+
* // <li class="pear">Pear</li>
|
|
563
|
+
* // </ul>
|
|
564
|
+
* ```
|
|
565
|
+
*
|
|
566
|
+
* @param content - HTML string, DOM element, array of DOM elements or Cheerio
|
|
567
|
+
* to insert before each element in the set of matched elements.
|
|
568
|
+
* @returns The instance itself.
|
|
569
|
+
* @see {@link https://api.jquery.com/before/}
|
|
570
|
+
*/
|
|
571
|
+
function before(...elems) {
|
|
572
|
+
const lastIdx = this.length - 1;
|
|
573
|
+
return utils.domEach(this, (el, i) => {
|
|
574
|
+
const parent = el.parent;
|
|
575
|
+
if (!node.hasChildren(el) || !parent) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const siblings = parent.children;
|
|
579
|
+
const index = siblings.indexOf(el);
|
|
580
|
+
// If not found, move on
|
|
581
|
+
/* istanbul ignore next */
|
|
582
|
+
if (index < 0) return;
|
|
583
|
+
const domSrc = typeof elems[0] === 'function' ? elems[0].call(el, i, this._render(el.children)) : elems;
|
|
584
|
+
const dom = this._makeDomArray(domSrc, i < lastIdx);
|
|
585
|
+
// Add element before `el` element
|
|
586
|
+
uniqueSplice(siblings, index, 0, dom, parent);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
/* eslint-enable jsdoc/check-param-names*/
|
|
590
|
+
/**
|
|
591
|
+
* Insert every element in the set of matched elements before the target.
|
|
592
|
+
*
|
|
593
|
+
* @category Manipulation
|
|
594
|
+
* @example
|
|
595
|
+
*
|
|
596
|
+
* ```js
|
|
597
|
+
* $('<li class="plum">Plum</li>').insertBefore('.apple');
|
|
598
|
+
* $.html();
|
|
599
|
+
* //=> <ul id="fruits">
|
|
600
|
+
* // <li class="plum">Plum</li>
|
|
601
|
+
* // <li class="apple">Apple</li>
|
|
602
|
+
* // <li class="orange">Orange</li>
|
|
603
|
+
* // <li class="pear">Pear</li>
|
|
604
|
+
* // </ul>
|
|
605
|
+
* ```
|
|
606
|
+
*
|
|
607
|
+
* @param target - Element to insert elements before.
|
|
608
|
+
* @returns The set of newly inserted elements.
|
|
609
|
+
* @see {@link https://api.jquery.com/insertBefore/}
|
|
610
|
+
*/
|
|
611
|
+
function insertBefore(target) {
|
|
612
|
+
const targetArr = this._make(target);
|
|
613
|
+
this.remove();
|
|
614
|
+
const clones = [];
|
|
615
|
+
utils.domEach(targetArr, el => {
|
|
616
|
+
const clonedSelf = this.clone().toArray();
|
|
617
|
+
const parent = el.parent;
|
|
618
|
+
if (!parent) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
const siblings = parent.children;
|
|
622
|
+
const index = siblings.indexOf(el);
|
|
623
|
+
// If not found, move on
|
|
624
|
+
/* istanbul ignore next */
|
|
625
|
+
if (index < 0) return;
|
|
626
|
+
// Add cloned `this` element(s) after target element
|
|
627
|
+
uniqueSplice(siblings, index, 0, clonedSelf, parent);
|
|
628
|
+
clones.push(...clonedSelf);
|
|
629
|
+
});
|
|
630
|
+
return this._make(clones);
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Removes the set of matched elements from the DOM and all their children.
|
|
634
|
+
* `selector` filters the set of matched elements to be removed.
|
|
635
|
+
*
|
|
636
|
+
* @category Manipulation
|
|
637
|
+
* @example
|
|
638
|
+
*
|
|
639
|
+
* ```js
|
|
640
|
+
* $('.pear').remove();
|
|
641
|
+
* $.html();
|
|
642
|
+
* //=> <ul id="fruits">
|
|
643
|
+
* // <li class="apple">Apple</li>
|
|
644
|
+
* // <li class="orange">Orange</li>
|
|
645
|
+
* // </ul>
|
|
646
|
+
* ```
|
|
647
|
+
*
|
|
648
|
+
* @param selector - Optional selector for elements to remove.
|
|
649
|
+
* @returns The instance itself.
|
|
650
|
+
* @see {@link https://api.jquery.com/remove/}
|
|
651
|
+
*/
|
|
652
|
+
function remove(selector) {
|
|
653
|
+
// Filter if we have selector
|
|
654
|
+
const elems = selector ? this.filter(selector) : this;
|
|
655
|
+
utils.domEach(elems, el => {
|
|
656
|
+
manipulation.removeElement(el);
|
|
657
|
+
el.prev = el.next = el.parent = null;
|
|
658
|
+
});
|
|
659
|
+
return this;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Replaces matched elements with `content`.
|
|
663
|
+
*
|
|
664
|
+
* @category Manipulation
|
|
665
|
+
* @example
|
|
666
|
+
*
|
|
667
|
+
* ```js
|
|
668
|
+
* const plum = $('<li class="plum">Plum</li>');
|
|
669
|
+
* $('.pear').replaceWith(plum);
|
|
670
|
+
* $.html();
|
|
671
|
+
* //=> <ul id="fruits">
|
|
672
|
+
* // <li class="apple">Apple</li>
|
|
673
|
+
* // <li class="orange">Orange</li>
|
|
674
|
+
* // <li class="plum">Plum</li>
|
|
675
|
+
* // </ul>
|
|
676
|
+
* ```
|
|
677
|
+
*
|
|
678
|
+
* @param content - Replacement for matched elements.
|
|
679
|
+
* @returns The instance itself.
|
|
680
|
+
* @see {@link https://api.jquery.com/replaceWith/}
|
|
681
|
+
*/
|
|
682
|
+
function replaceWith(content) {
|
|
683
|
+
return utils.domEach(this, (el, i) => {
|
|
684
|
+
const parent = el.parent;
|
|
685
|
+
if (!parent) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const siblings = parent.children;
|
|
689
|
+
const cont = typeof content === 'function' ? content.call(el, i, el) : content;
|
|
690
|
+
const dom = this._makeDomArray(cont);
|
|
691
|
+
/*
|
|
692
|
+
* In the case that `dom` contains nodes that already exist in other
|
|
693
|
+
* structures, ensure those nodes are properly removed.
|
|
694
|
+
*/
|
|
695
|
+
parse.update(dom, null);
|
|
696
|
+
const index = siblings.indexOf(el);
|
|
697
|
+
// Completely remove old element
|
|
698
|
+
uniqueSplice(siblings, index, 1, dom, parent);
|
|
699
|
+
if (!dom.includes(el)) {
|
|
700
|
+
el.parent = el.prev = el.next = null;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Empties an element, removing all its children.
|
|
706
|
+
*
|
|
707
|
+
* @category Manipulation
|
|
708
|
+
* @example
|
|
709
|
+
*
|
|
710
|
+
* ```js
|
|
711
|
+
* $('ul').empty();
|
|
712
|
+
* $.html();
|
|
713
|
+
* //=> <ul id="fruits"></ul>
|
|
714
|
+
* ```
|
|
715
|
+
*
|
|
716
|
+
* @returns The instance itself.
|
|
717
|
+
* @see {@link https://api.jquery.com/empty/}
|
|
718
|
+
*/
|
|
719
|
+
function empty() {
|
|
720
|
+
return utils.domEach(this, el => {
|
|
721
|
+
if (!node.hasChildren(el)) return;
|
|
722
|
+
el.children.forEach(child => {
|
|
723
|
+
child.next = child.prev = child.parent = null;
|
|
724
|
+
});
|
|
725
|
+
el.children.length = 0;
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
function html(str) {
|
|
729
|
+
if (str === undefined) {
|
|
730
|
+
const el = this[0];
|
|
731
|
+
if (!el || !node.hasChildren(el)) return null;
|
|
732
|
+
return this._render(el.children);
|
|
733
|
+
}
|
|
734
|
+
return utils.domEach(this, el => {
|
|
735
|
+
if (!node.hasChildren(el)) return;
|
|
736
|
+
el.children.forEach(child => {
|
|
737
|
+
child.next = child.prev = child.parent = null;
|
|
738
|
+
});
|
|
739
|
+
const content = utils.isCheerio(str) ? str.toArray() : this._parse(`${str}`, this.options, false, el).children;
|
|
740
|
+
parse.update(content, el);
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Turns the collection to a string. Alias for `.html()`.
|
|
745
|
+
*
|
|
746
|
+
* @category Manipulation
|
|
747
|
+
* @returns The rendered document.
|
|
748
|
+
*/
|
|
749
|
+
function toString() {
|
|
750
|
+
return this._render(this);
|
|
751
|
+
}
|
|
752
|
+
function text(str) {
|
|
753
|
+
// If `str` is undefined, act as a "getter"
|
|
754
|
+
if (str === undefined) {
|
|
755
|
+
return _static.text(this);
|
|
756
|
+
}
|
|
757
|
+
if (typeof str === 'function') {
|
|
758
|
+
// Function support
|
|
759
|
+
return utils.domEach(this, (el, i) => this._make(el).text(str.call(el, i, _static.text([el]))));
|
|
760
|
+
}
|
|
761
|
+
// Append text node to each selected elements
|
|
762
|
+
return utils.domEach(this, el => {
|
|
763
|
+
if (!node.hasChildren(el)) return;
|
|
764
|
+
el.children.forEach(child => {
|
|
765
|
+
child.next = child.prev = child.parent = null;
|
|
766
|
+
});
|
|
767
|
+
const textNode = new node.Text(`${str}`);
|
|
768
|
+
parse.update(textNode, el);
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Clone the cheerio object.
|
|
773
|
+
*
|
|
774
|
+
* @category Manipulation
|
|
775
|
+
* @example
|
|
776
|
+
*
|
|
777
|
+
* ```js
|
|
778
|
+
* const moreFruit = $('#fruits').clone();
|
|
779
|
+
* ```
|
|
780
|
+
*
|
|
781
|
+
* @returns The cloned object.
|
|
782
|
+
* @see {@link https://api.jquery.com/clone/}
|
|
783
|
+
*/
|
|
784
|
+
function clone() {
|
|
785
|
+
return this._make(utils.cloneDom(this.get()));
|
|
786
|
+
}
|
|
787
|
+
exports._makeDomArray = _makeDomArray;
|
|
788
|
+
exports.after = after;
|
|
789
|
+
exports.append = append;
|
|
790
|
+
exports.appendTo = appendTo;
|
|
791
|
+
exports.before = before;
|
|
792
|
+
exports.clone = clone;
|
|
793
|
+
exports.empty = empty;
|
|
794
|
+
exports.html = html;
|
|
795
|
+
exports.insertAfter = insertAfter;
|
|
796
|
+
exports.insertBefore = insertBefore;
|
|
797
|
+
exports.prepend = prepend;
|
|
798
|
+
exports.prependTo = prependTo;
|
|
799
|
+
exports.remove = remove;
|
|
800
|
+
exports.replaceWith = replaceWith;
|
|
801
|
+
exports.text = text;
|
|
802
|
+
exports.toString = toString;
|
|
803
|
+
exports.unwrap = unwrap;
|
|
804
|
+
exports.wrap = wrap;
|
|
805
|
+
exports.wrapAll = wrapAll;
|
|
806
|
+
exports.wrapInner = wrapInner;
|
|
807
|
+
//# sourceMappingURL=manipulation.js.map
|