@sparrowengg/integrations-templates-frontend 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/index10.js +2 -2
- package/dist/cjs/_virtual/index7.js +2 -2
- package/dist/cjs/authentication/constants/index.js +10 -0
- package/dist/cjs/authentication/constants/index.js.map +1 -0
- package/dist/cjs/authentication/index.js +40 -47
- package/dist/cjs/authentication/index.js.map +1 -1
- package/dist/cjs/commons/components/theme-wrapper.js +24 -0
- package/dist/cjs/commons/components/theme-wrapper.js.map +1 -0
- package/dist/cjs/contact-import/components/contact-import-mapping.js +6 -4
- package/dist/cjs/contact-import/components/contact-import-mapping.js.map +1 -1
- package/dist/cjs/contact-import/index.js +34 -52
- package/dist/cjs/contact-import/index.js.map +1 -1
- package/dist/cjs/integration-template/index.js +1 -1
- package/dist/cjs/integration-template/index.js.map +1 -1
- package/dist/cjs/mapping/components/custom-date-menu.js +2 -2
- package/dist/cjs/mapping/components/custom-date-menu.js.map +1 -1
- package/dist/cjs/node_modules/@internationalized/date/dist/CalendarDate.js +156 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/GregorianCalendar.js +139 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/conversion.js +159 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/manipulation.js +229 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/queries.js +22 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/queries.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/string.js +36 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/string.js.map +1 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js +19 -0
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js.map +1 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-utils.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +18 -18
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js +9 -6
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js +40 -15
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js +156 -138
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js +60 -85
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js +32 -21
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js +91 -92
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js +326 -247
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js +26 -5
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +201 -207
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +303 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js +40 -24
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js +205 -258
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js +23 -26
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js +47 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js +847 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js +298 -255
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js +279 -265
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js +31 -9
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js +125 -116
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js +54 -80
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js +273 -225
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js +211 -208
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js +88 -69
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js +140 -111
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js +186 -137
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js +480 -526
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +27 -14
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +58 -40
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +32 -16
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +24 -9
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js +30 -17
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js +54 -46
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js +48 -20
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +15 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +12 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js +26 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +25 -5
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +14 -9
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js +12 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/cjs/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -1
- package/dist/cjs/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -1
- package/dist/cjs/node_modules/@swc/helpers/esm/_class_private_field_init.js +1 -2
- package/dist/cjs/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -1
- package/dist/cjs/node_modules/domhandler/lib/index.js +176 -0
- package/dist/cjs/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/domhandler/lib/node.js +485 -0
- package/dist/cjs/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/cjs/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/lib/server/html-to-dom.js +3 -3
- package/dist/cjs/node_modules/html-react-parser/lib/index.js +1 -1
- package/dist/cjs/node_modules/htmlparser2/lib/Parser.js +531 -0
- package/dist/cjs/node_modules/htmlparser2/lib/Parser.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/lib/Tokenizer.js +789 -0
- package/dist/cjs/node_modules/htmlparser2/lib/Tokenizer.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/lib/index.js +131 -0
- package/dist/cjs/node_modules/htmlparser2/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +111 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +240 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +202 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +150 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/index.js +56 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +164 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +150 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +168 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +106 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +135 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode.js +549 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +82 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/encode.js +89 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/encode.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/escape.js +128 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/escape.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js +12 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js +12 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js +15 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/index.js +138 -0
- package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/react-is/index.js +1 -1
- package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/es/_virtual/index10.js +2 -2
- package/dist/es/_virtual/index7.js +2 -2
- package/dist/es/authentication/constants/index.js +8 -0
- package/dist/es/authentication/constants/index.js.map +1 -0
- package/dist/es/authentication/index.js +40 -47
- package/dist/es/authentication/index.js.map +1 -1
- package/dist/es/commons/components/theme-wrapper.js +20 -0
- package/dist/es/commons/components/theme-wrapper.js.map +1 -0
- package/dist/es/contact-import/components/contact-import-mapping.js +6 -4
- package/dist/es/contact-import/components/contact-import-mapping.js.map +1 -1
- package/dist/es/contact-import/index.js +34 -52
- package/dist/es/contact-import/index.js.map +1 -1
- package/dist/es/integration-template/index.js +1 -1
- package/dist/es/integration-template/index.js.map +1 -1
- package/dist/es/mapping/components/custom-date-menu.js +1 -1
- package/dist/es/node_modules/@internationalized/date/dist/CalendarDate.js +153 -0
- package/dist/es/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/GregorianCalendar.js +133 -0
- package/dist/es/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/conversion.js +152 -0
- package/dist/es/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/manipulation.js +219 -0
- package/dist/es/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/queries.js +18 -0
- package/dist/es/node_modules/@internationalized/date/dist/queries.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/string.js +31 -0
- package/dist/es/node_modules/@internationalized/date/dist/string.js.map +1 -0
- package/dist/es/node_modules/@internationalized/date/dist/utils.js +17 -0
- package/dist/es/node_modules/@internationalized/date/dist/utils.js.map +1 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-utils.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +3 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +7 -7
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +18 -18
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js +9 -6
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js +22 -16
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js +143 -144
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js +63 -88
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js +13 -21
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js +72 -93
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js +298 -241
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js +8 -6
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +189 -215
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +254 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js +22 -25
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js +190 -262
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js +11 -14
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js +25 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js +796 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js +268 -244
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js +257 -262
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js +13 -10
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js +110 -121
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js +37 -83
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js +250 -221
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js +200 -216
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js +71 -71
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js +126 -116
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js +171 -141
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js +453 -518
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +9 -15
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +42 -43
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +15 -18
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +5 -9
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js +12 -18
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js +37 -48
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -21
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js +5 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +15 -4
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +12 -4
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js +25 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js +5 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +29 -9
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +3 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +14 -9
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js +5 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js +13 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +8 -8
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/es/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +1 -1
- package/dist/es/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -1
- package/dist/es/node_modules/@swc/helpers/esm/_class_private_field_init.js +2 -2
- package/dist/es/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -1
- package/dist/es/node_modules/domhandler/lib/index.js +174 -0
- package/dist/es/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/es/node_modules/domhandler/lib/node.js +481 -0
- package/dist/es/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/es/node_modules/html-dom-parser/lib/server/html-to-dom.js +3 -3
- package/dist/es/node_modules/html-react-parser/lib/index.js +1 -1
- package/dist/es/node_modules/htmlparser2/lib/Parser.js +527 -0
- package/dist/es/node_modules/htmlparser2/lib/Parser.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/lib/Tokenizer.js +787 -0
- package/dist/es/node_modules/htmlparser2/lib/Tokenizer.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/lib/index.js +129 -0
- package/dist/es/node_modules/htmlparser2/lib/index.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +107 -0
- package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +238 -0
- package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +198 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +148 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/index.js +54 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +160 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +146 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +164 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +102 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +131 -0
- package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode.js +547 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +80 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/encode.js +85 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/encode.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/escape.js +126 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/escape.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js +10 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js +10 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js +13 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/index.js +136 -0
- package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/index.js.map +1 -0
- package/dist/es/node_modules/react-is/index.js +1 -1
- package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/index.d.ts +44 -12
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../../../../../node_modules/htmlparser2/node_modules/domutils/lib/helpers.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uniqueSort = exports.compareDocumentPosition = exports.DocumentPosition = exports.removeSubsets = void 0;\nvar domhandler_1 = require(\"domhandler\");\n/**\n * Given an array of nodes, remove any member that is contained by another\n * member.\n *\n * @category Helpers\n * @param nodes Nodes to filter.\n * @returns Remaining nodes that aren't contained by other nodes.\n */\nfunction removeSubsets(nodes) {\n var idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n var node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are going through the array from the end, so we only\n * have to check nodes that preceed the node under consideration in the array.\n */\n if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {\n nodes.splice(idx, 1);\n continue;\n }\n for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n if (nodes.includes(ancestor)) {\n nodes.splice(idx, 1);\n break;\n }\n }\n }\n return nodes;\n}\nexports.removeSubsets = removeSubsets;\n/**\n * @category Helpers\n * @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}\n */\nvar DocumentPosition;\n(function (DocumentPosition) {\n DocumentPosition[DocumentPosition[\"DISCONNECTED\"] = 1] = \"DISCONNECTED\";\n DocumentPosition[DocumentPosition[\"PRECEDING\"] = 2] = \"PRECEDING\";\n DocumentPosition[DocumentPosition[\"FOLLOWING\"] = 4] = \"FOLLOWING\";\n DocumentPosition[DocumentPosition[\"CONTAINS\"] = 8] = \"CONTAINS\";\n DocumentPosition[DocumentPosition[\"CONTAINED_BY\"] = 16] = \"CONTAINED_BY\";\n})(DocumentPosition = exports.DocumentPosition || (exports.DocumentPosition = {}));\n/**\n * Compare the position of one node against another node in any other document,\n * returning a bitmask with the values from {@link DocumentPosition}.\n *\n * Document order:\n * > There is an ordering, document order, defined on all the nodes in the\n * > document corresponding to the order in which the first character of the\n * > XML representation of each node occurs in the XML representation of the\n * > document after expansion of general entities. Thus, the document element\n * > node will be the first node. Element nodes occur before their children.\n * > Thus, document order orders element nodes in order of the occurrence of\n * > their start-tag in the XML (after expansion of entities). The attribute\n * > nodes of an element occur after the element and before its children. The\n * > relative order of attribute nodes is implementation-dependent.\n *\n * Source:\n * http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order\n *\n * @category Helpers\n * @param nodeA The first node to use in the comparison\n * @param nodeB The second node to use in the comparison\n * @returns A bitmask describing the input nodes' relative position.\n *\n * See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for\n * a description of these values.\n */\nfunction compareDocumentPosition(nodeA, nodeB) {\n var aParents = [];\n var bParents = [];\n if (nodeA === nodeB) {\n return 0;\n }\n var current = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;\n while (current) {\n aParents.unshift(current);\n current = current.parent;\n }\n current = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;\n while (current) {\n bParents.unshift(current);\n current = current.parent;\n }\n var maxIdx = Math.min(aParents.length, bParents.length);\n var idx = 0;\n while (idx < maxIdx && aParents[idx] === bParents[idx]) {\n idx++;\n }\n if (idx === 0) {\n return DocumentPosition.DISCONNECTED;\n }\n var sharedParent = aParents[idx - 1];\n var siblings = sharedParent.children;\n var aSibling = aParents[idx];\n var bSibling = bParents[idx];\n if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {\n if (sharedParent === nodeB) {\n return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;\n }\n return DocumentPosition.FOLLOWING;\n }\n if (sharedParent === nodeA) {\n return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;\n }\n return DocumentPosition.PRECEDING;\n}\nexports.compareDocumentPosition = compareDocumentPosition;\n/**\n * Sort an array of nodes based on their relative position in the document,\n * removing any duplicate nodes. If the array contains nodes that do not belong\n * to the same document, sort order is unspecified.\n *\n * @category Helpers\n * @param nodes Array of DOM nodes.\n * @returns Collection of unique nodes, sorted in document order.\n */\nfunction uniqueSort(nodes) {\n nodes = nodes.filter(function (node, i, arr) { return !arr.includes(node, i + 1); });\n nodes.sort(function (a, b) {\n var relative = compareDocumentPosition(a, b);\n if (relative & DocumentPosition.PRECEDING) {\n return -1;\n }\n else if (relative & DocumentPosition.FOLLOWING) {\n return 1;\n }\n return 0;\n });\n return nodes;\n}\nexports.uniqueSort = uniqueSort;\n//# sourceMappingURL=helpers.js.map"],"names":["require$$0"],"mappings":";;;;;;;CACA,MAAM,CAAC,cAAc,CAAA,OAAA,EAAU,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAA,OAAA,CAAA,UAAA,GAAqB,OAAkC,CAAA,uBAAA,GAAA,OAAA,CAAA,gBAAA,GAA2B,OAAwB,CAAA,aAAA,GAAA,KAAK,CAAC,CAAC;CACjH,IAAI,YAAY,GAAGA,eAAqB,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;CACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,KAAI,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AAC3B;AACA;AACA;AACA;AACA,KAAI,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;AACvB,SAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAQ,IAAI,GAAG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AC;AACjB,MAAK,CAAC,CAAC;KACH,OAAO,KAAK,CAAC;EAChB;AACD,CAAA,OAAA,CAAA,UAAA,GAAqB,UAAU,CAAC;AAChC,CAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _commonjsHelpers = require('../../../../../_virtual/_commonjsHelpers.js');
|
|
4
|
+
var index = require('../../../../../_virtual/index8.js');
|
|
5
|
+
require('./stringify.js');
|
|
6
|
+
require('./traversal.js');
|
|
7
|
+
require('./manipulation.js');
|
|
8
|
+
require('./querying.js');
|
|
9
|
+
require('./legacy.js');
|
|
10
|
+
require('./helpers.js');
|
|
11
|
+
require('./feeds.js');
|
|
12
|
+
require('../../../../domhandler/lib/index.js');
|
|
13
|
+
var stringify = require('../../../../../_virtual/stringify.js');
|
|
14
|
+
var traversal = require('../../../../../_virtual/traversal.js');
|
|
15
|
+
var manipulation = require('../../../../../_virtual/manipulation.js');
|
|
16
|
+
var querying = require('../../../../../_virtual/querying.js');
|
|
17
|
+
var legacy = require('../../../../../_virtual/legacy.js');
|
|
18
|
+
var helpers = require('../../../../../_virtual/helpers.js');
|
|
19
|
+
var feeds = require('../../../../../_virtual/feeds.js');
|
|
20
|
+
var index$1 = require('../../../../../_virtual/index3.js');
|
|
21
|
+
|
|
22
|
+
(function (exports) {
|
|
23
|
+
var __createBinding = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __exportStar = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__exportStar) || function(m, exports) {
|
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.hasChildren = exports.isDocument = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;
|
|
39
|
+
__exportStar(stringify.__exports, exports);
|
|
40
|
+
__exportStar(traversal.__exports, exports);
|
|
41
|
+
__exportStar(manipulation.__exports, exports);
|
|
42
|
+
__exportStar(querying.__exports, exports);
|
|
43
|
+
__exportStar(legacy.__exports, exports);
|
|
44
|
+
__exportStar(helpers.__exports, exports);
|
|
45
|
+
__exportStar(feeds.__exports, exports);
|
|
46
|
+
/** @deprecated Use these methods from `domhandler` directly. */
|
|
47
|
+
var domhandler_1 = index$1.__exports;
|
|
48
|
+
Object.defineProperty(exports, "isTag", { enumerable: true, get: function () { return domhandler_1.isTag; } });
|
|
49
|
+
Object.defineProperty(exports, "isCDATA", { enumerable: true, get: function () { return domhandler_1.isCDATA; } });
|
|
50
|
+
Object.defineProperty(exports, "isText", { enumerable: true, get: function () { return domhandler_1.isText; } });
|
|
51
|
+
Object.defineProperty(exports, "isComment", { enumerable: true, get: function () { return domhandler_1.isComment; } });
|
|
52
|
+
Object.defineProperty(exports, "isDocument", { enumerable: true, get: function () { return domhandler_1.isDocument; } });
|
|
53
|
+
Object.defineProperty(exports, "hasChildren", { enumerable: true, get: function () { return domhandler_1.hasChildren; } });
|
|
54
|
+
|
|
55
|
+
} (index.__exports));
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../../node_modules/htmlparser2/node_modules/domutils/lib/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasChildren = exports.isDocument = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;\n__exportStar(require(\"./stringify.js\"), exports);\n__exportStar(require(\"./traversal.js\"), exports);\n__exportStar(require(\"./manipulation.js\"), exports);\n__exportStar(require(\"./querying.js\"), exports);\n__exportStar(require(\"./legacy.js\"), exports);\n__exportStar(require(\"./helpers.js\"), exports);\n__exportStar(require(\"./feeds.js\"), exports);\n/** @deprecated Use these methods from `domhandler` directly. */\nvar domhandler_1 = require(\"domhandler\");\nObject.defineProperty(exports, \"isTag\", { enumerable: true, get: function () { return domhandler_1.isTag; } });\nObject.defineProperty(exports, \"isCDATA\", { enumerable: true, get: function () { return domhandler_1.isCDATA; } });\nObject.defineProperty(exports, \"isText\", { enumerable: true, get: function () { return domhandler_1.isText; } });\nObject.defineProperty(exports, \"isComment\", { enumerable: true, get: function () { return domhandler_1.isComment; } });\nObject.defineProperty(exports, \"isDocument\", { enumerable: true, get: function () { return domhandler_1.isDocument; } });\nObject.defineProperty(exports, \"hasChildren\", { enumerable: true, get: function () { return domhandler_1.hasChildren; } });\n//# sourceMappingURL=index.js.map"],"names":["this","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7"],"mappings":";;;;;;;;;;;;;;;;;;;;;;CAC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EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;CACvH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;CACzH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3H,CAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var legacy = require('../../../../../_virtual/legacy.js');
|
|
6
|
+
require('../../../../domhandler/lib/index.js');
|
|
7
|
+
require('./querying.js');
|
|
8
|
+
var querying = require('../../../../../_virtual/querying.js');
|
|
9
|
+
var index = require('../../../../../_virtual/index3.js');
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(legacy.__exports, "__esModule", { value: true });
|
|
12
|
+
legacy.__exports.getElementsByTagType = legacy.__exports.getElementsByTagName = legacy.__exports.getElementById = legacy.__exports.getElements = legacy.__exports.testElement = void 0;
|
|
13
|
+
var domhandler_1 = index.__exports;
|
|
14
|
+
var querying_js_1 = querying.__exports;
|
|
15
|
+
/**
|
|
16
|
+
* A map of functions to check nodes against.
|
|
17
|
+
*/
|
|
18
|
+
var Checks = {
|
|
19
|
+
tag_name: function (name) {
|
|
20
|
+
if (typeof name === "function") {
|
|
21
|
+
return function (elem) { return (0, domhandler_1.isTag)(elem) && name(elem.name); };
|
|
22
|
+
}
|
|
23
|
+
else if (name === "*") {
|
|
24
|
+
return domhandler_1.isTag;
|
|
25
|
+
}
|
|
26
|
+
return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.name === name; };
|
|
27
|
+
},
|
|
28
|
+
tag_type: function (type) {
|
|
29
|
+
if (typeof type === "function") {
|
|
30
|
+
return function (elem) { return type(elem.type); };
|
|
31
|
+
}
|
|
32
|
+
return function (elem) { return elem.type === type; };
|
|
33
|
+
},
|
|
34
|
+
tag_contains: function (data) {
|
|
35
|
+
if (typeof data === "function") {
|
|
36
|
+
return function (elem) { return (0, domhandler_1.isText)(elem) && data(elem.data); };
|
|
37
|
+
}
|
|
38
|
+
return function (elem) { return (0, domhandler_1.isText)(elem) && elem.data === data; };
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Returns a function to check whether a node has an attribute with a particular
|
|
43
|
+
* value.
|
|
44
|
+
*
|
|
45
|
+
* @param attrib Attribute to check.
|
|
46
|
+
* @param value Attribute value to look for.
|
|
47
|
+
* @returns A function to check whether the a node has an attribute with a
|
|
48
|
+
* particular value.
|
|
49
|
+
*/
|
|
50
|
+
function getAttribCheck(attrib, value) {
|
|
51
|
+
if (typeof value === "function") {
|
|
52
|
+
return function (elem) { return (0, domhandler_1.isTag)(elem) && value(elem.attribs[attrib]); };
|
|
53
|
+
}
|
|
54
|
+
return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value; };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns a function that returns `true` if either of the input functions
|
|
58
|
+
* returns `true` for a node.
|
|
59
|
+
*
|
|
60
|
+
* @param a First function to combine.
|
|
61
|
+
* @param b Second function to combine.
|
|
62
|
+
* @returns A function taking a node and returning `true` if either of the input
|
|
63
|
+
* functions returns `true` for the node.
|
|
64
|
+
*/
|
|
65
|
+
function combineFuncs(a, b) {
|
|
66
|
+
return function (elem) { return a(elem) || b(elem); };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Returns a function that executes all checks in `options` and returns `true`
|
|
70
|
+
* if any of them match a node.
|
|
71
|
+
*
|
|
72
|
+
* @param options An object describing nodes to look for.
|
|
73
|
+
* @returns A function that executes all checks in `options` and returns `true`
|
|
74
|
+
* if any of them match a node.
|
|
75
|
+
*/
|
|
76
|
+
function compileTest(options) {
|
|
77
|
+
var funcs = Object.keys(options).map(function (key) {
|
|
78
|
+
var value = options[key];
|
|
79
|
+
return Object.prototype.hasOwnProperty.call(Checks, key)
|
|
80
|
+
? Checks[key](value)
|
|
81
|
+
: getAttribCheck(key, value);
|
|
82
|
+
});
|
|
83
|
+
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Checks whether a node matches the description in `options`.
|
|
87
|
+
*
|
|
88
|
+
* @category Legacy Query Functions
|
|
89
|
+
* @param options An object describing nodes to look for.
|
|
90
|
+
* @param node The element to test.
|
|
91
|
+
* @returns Whether the element matches the description in `options`.
|
|
92
|
+
*/
|
|
93
|
+
function testElement(options, node) {
|
|
94
|
+
var test = compileTest(options);
|
|
95
|
+
return test ? test(node) : true;
|
|
96
|
+
}
|
|
97
|
+
legacy.__exports.testElement = testElement;
|
|
98
|
+
/**
|
|
99
|
+
* Returns all nodes that match `options`.
|
|
100
|
+
*
|
|
101
|
+
* @category Legacy Query Functions
|
|
102
|
+
* @param options An object describing nodes to look for.
|
|
103
|
+
* @param nodes Nodes to search through.
|
|
104
|
+
* @param recurse Also consider child nodes.
|
|
105
|
+
* @param limit Maximum number of nodes to return.
|
|
106
|
+
* @returns All nodes that match `options`.
|
|
107
|
+
*/
|
|
108
|
+
function getElements(options, nodes, recurse, limit) {
|
|
109
|
+
if (limit === void 0) { limit = Infinity; }
|
|
110
|
+
var test = compileTest(options);
|
|
111
|
+
return test ? (0, querying_js_1.filter)(test, nodes, recurse, limit) : [];
|
|
112
|
+
}
|
|
113
|
+
legacy.__exports.getElements = getElements;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the node with the supplied ID.
|
|
116
|
+
*
|
|
117
|
+
* @category Legacy Query Functions
|
|
118
|
+
* @param id The unique ID attribute value to look for.
|
|
119
|
+
* @param nodes Nodes to search through.
|
|
120
|
+
* @param recurse Also consider child nodes.
|
|
121
|
+
* @returns The node with the supplied ID.
|
|
122
|
+
*/
|
|
123
|
+
function getElementById(id, nodes, recurse) {
|
|
124
|
+
if (recurse === void 0) { recurse = true; }
|
|
125
|
+
if (!Array.isArray(nodes))
|
|
126
|
+
nodes = [nodes];
|
|
127
|
+
return (0, querying_js_1.findOne)(getAttribCheck("id", id), nodes, recurse);
|
|
128
|
+
}
|
|
129
|
+
legacy.__exports.getElementById = getElementById;
|
|
130
|
+
/**
|
|
131
|
+
* Returns all nodes with the supplied `tagName`.
|
|
132
|
+
*
|
|
133
|
+
* @category Legacy Query Functions
|
|
134
|
+
* @param tagName Tag name to search for.
|
|
135
|
+
* @param nodes Nodes to search through.
|
|
136
|
+
* @param recurse Also consider child nodes.
|
|
137
|
+
* @param limit Maximum number of nodes to return.
|
|
138
|
+
* @returns All nodes with the supplied `tagName`.
|
|
139
|
+
*/
|
|
140
|
+
function getElementsByTagName(tagName, nodes, recurse, limit) {
|
|
141
|
+
if (recurse === void 0) { recurse = true; }
|
|
142
|
+
if (limit === void 0) { limit = Infinity; }
|
|
143
|
+
return (0, querying_js_1.filter)(Checks["tag_name"](tagName), nodes, recurse, limit);
|
|
144
|
+
}
|
|
145
|
+
legacy.__exports.getElementsByTagName = getElementsByTagName;
|
|
146
|
+
/**
|
|
147
|
+
* Returns all nodes with the supplied `type`.
|
|
148
|
+
*
|
|
149
|
+
* @category Legacy Query Functions
|
|
150
|
+
* @param type Element type to look for.
|
|
151
|
+
* @param nodes Nodes to search through.
|
|
152
|
+
* @param recurse Also consider child nodes.
|
|
153
|
+
* @param limit Maximum number of nodes to return.
|
|
154
|
+
* @returns All nodes with the supplied `type`.
|
|
155
|
+
*/
|
|
156
|
+
function getElementsByTagType(type, nodes, recurse, limit) {
|
|
157
|
+
if (recurse === void 0) { recurse = true; }
|
|
158
|
+
if (limit === void 0) { limit = Infinity; }
|
|
159
|
+
return (0, querying_js_1.filter)(Checks["tag_type"](type), nodes, recurse, limit);
|
|
160
|
+
}
|
|
161
|
+
legacy.__exports.getElementsByTagType = getElementsByTagType;
|
|
162
|
+
|
|
163
|
+
exports.default = legacy.__exports;
|
|
164
|
+
//# sourceMappingURL=legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.js","sources":["../../../../../../../../../node_modules/htmlparser2/node_modules/domutils/lib/legacy.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0;\nvar domhandler_1 = require(\"domhandler\");\nvar querying_js_1 = require(\"./querying.js\");\n/**\n * A map of functions to check nodes against.\n */\nvar Checks = {\n tag_name: function (name) {\n if (typeof name === \"function\") {\n return function (elem) { return (0, domhandler_1.isTag)(elem) && name(elem.name); };\n }\n else if (name === \"*\") {\n return domhandler_1.isTag;\n }\n return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.name === name; };\n },\n tag_type: function (type) {\n if (typeof type === \"function\") {\n return function (elem) { return type(elem.type); };\n }\n return function (elem) { return elem.type === type; };\n },\n tag_contains: function (data) {\n if (typeof data === \"function\") {\n return function (elem) { return (0, domhandler_1.isText)(elem) && data(elem.data); };\n }\n return function (elem) { return (0, domhandler_1.isText)(elem) && elem.data === data; };\n },\n};\n/**\n * Returns a function to check whether a node has an attribute with a particular\n * value.\n *\n * @param attrib Attribute to check.\n * @param value Attribute value to look for.\n * @returns A function to check whether the a node has an attribute with a\n * particular value.\n */\nfunction getAttribCheck(attrib, value) {\n if (typeof value === \"function\") {\n return function (elem) { return (0, domhandler_1.isTag)(elem) && value(elem.attribs[attrib]); };\n }\n return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value; };\n}\n/**\n * Returns a function that returns `true` if either of the input functions\n * returns `true` for a node.\n *\n * @param a First function to combine.\n * @param b Second function to combine.\n * @returns A function taking a node and returning `true` if either of the input\n * functions returns `true` for the node.\n */\nfunction combineFuncs(a, b) {\n return function (elem) { return a(elem) || b(elem); };\n}\n/**\n * Returns a function that executes all checks in `options` and returns `true`\n * if any of them match a node.\n *\n * @param options An object describing nodes to look for.\n * @returns A function that executes all checks in `options` and returns `true`\n * if any of them match a node.\n */\nfunction compileTest(options) {\n var funcs = Object.keys(options).map(function (key) {\n var value = options[key];\n return Object.prototype.hasOwnProperty.call(Checks, key)\n ? Checks[key](value)\n : getAttribCheck(key, value);\n });\n return funcs.length === 0 ? null : funcs.reduce(combineFuncs);\n}\n/**\n * Checks whether a node matches the description in `options`.\n *\n * @category Legacy Query Functions\n * @param options An object describing nodes to look for.\n * @param node The element to test.\n * @returns Whether the element matches the description in `options`.\n */\nfunction testElement(options, node) {\n var test = compileTest(options);\n return test ? test(node) : true;\n}\nexports.testElement = testElement;\n/**\n * Returns all nodes that match `options`.\n *\n * @category Legacy Query Functions\n * @param options An object describing nodes to look for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes that match `options`.\n */\nfunction getElements(options, nodes, recurse, limit) {\n if (limit === void 0) { limit = Infinity; }\n var test = compileTest(options);\n return test ? (0, querying_js_1.filter)(test, nodes, recurse, limit) : [];\n}\nexports.getElements = getElements;\n/**\n * Returns the node with the supplied ID.\n *\n * @category Legacy Query Functions\n * @param id The unique ID attribute value to look for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @returns The node with the supplied ID.\n */\nfunction getElementById(id, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n if (!Array.isArray(nodes))\n nodes = [nodes];\n return (0, querying_js_1.findOne)(getAttribCheck(\"id\", id), nodes, recurse);\n}\nexports.getElementById = getElementById;\n/**\n * Returns all nodes with the supplied `tagName`.\n *\n * @category Legacy Query Functions\n * @param tagName Tag name to search for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes with the supplied `tagName`.\n */\nfunction getElementsByTagName(tagName, nodes, recurse, limit) {\n if (recurse === void 0) { recurse = true; }\n if (limit === void 0) { limit = Infinity; }\n return (0, querying_js_1.filter)(Checks[\"tag_name\"](tagName), nodes, recurse, limit);\n}\nexports.getElementsByTagName = getElementsByTagName;\n/**\n * Returns all nodes with the supplied `type`.\n *\n * @category Legacy Query Functions\n * @param type Element type to look for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes with the supplied `type`.\n */\nfunction getElementsByTagType(type, nodes, recurse, limit) {\n if (recurse === void 0) { recurse = true; }\n if (limit === void 0) { limit = Infinity; }\n return (0, querying_js_1.filter)(Checks[\"tag_type\"](type), nodes, recurse, limit);\n}\nexports.getElementsByTagType = getElementsByTagType;\n//# sourceMappingURL=legacy.js.map"],"names":["legacy","require$$0","require$$1"],"mappings":";;;;;;;;;;AACA,MAAM,CAAC,cAAc,CAACA,gBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAClCA,gBAAA,CAAA,oBAAA,GAA+BA,gBAAA,CAAA,oBAAA,GAAyBA,gBAAA,CAAA,cAAA,GAAsBA,gBAAA,CAAA,WAAA,GAAsBA,gBAAA,CAAA,WAAA,GAAG,KAAK,EAAE;AAC1I,IAAI,YAAY,GAAGC,eAAqB,CAAC;AACzC,IAAI,aAAa,GAAGC,kBAAwB,CAAC;AAC7C;AACA;AACA;AACA,IAAI,MAAM,GAAG;AACb,IAAI,QAAQ,EAAE,UAAU,IAAI,EAAE;AAC9B,QAAQ,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACxC,YAAY,OAAO,UAAU,IAAI,EAAE,EAAE,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,E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AAI,CAAC,EAAE;AAC/C,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,EAAE;AAC/C,IAAI,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACzF,CAAC;AAC2BA,gBAAA,CAAA,oBAAA,GAAG,qBAAqB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;AAC3D,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAAC,EAAE;AAC/C,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,QAAQ,CAAC,EAAE;AAC/C,IAAI,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACtF,CAAC;AAC2BA,gBAAA,CAAA,oBAAA,GAAG,oBAAoB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var manipulation = require('../../../../../_virtual/manipulation.js');
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(manipulation.__exports, "__esModule", { value: true });
|
|
8
|
+
manipulation.__exports.prepend = manipulation.__exports.prependChild = manipulation.__exports.append = manipulation.__exports.appendChild = manipulation.__exports.replaceElement = manipulation.__exports.removeElement = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Remove an element from the dom
|
|
11
|
+
*
|
|
12
|
+
* @category Manipulation
|
|
13
|
+
* @param elem The element to be removed
|
|
14
|
+
*/
|
|
15
|
+
function removeElement(elem) {
|
|
16
|
+
if (elem.prev)
|
|
17
|
+
elem.prev.next = elem.next;
|
|
18
|
+
if (elem.next)
|
|
19
|
+
elem.next.prev = elem.prev;
|
|
20
|
+
if (elem.parent) {
|
|
21
|
+
var childs = elem.parent.children;
|
|
22
|
+
var childsIndex = childs.lastIndexOf(elem);
|
|
23
|
+
if (childsIndex >= 0) {
|
|
24
|
+
childs.splice(childsIndex, 1);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
elem.next = null;
|
|
28
|
+
elem.prev = null;
|
|
29
|
+
elem.parent = null;
|
|
30
|
+
}
|
|
31
|
+
manipulation.__exports.removeElement = removeElement;
|
|
32
|
+
/**
|
|
33
|
+
* Replace an element in the dom
|
|
34
|
+
*
|
|
35
|
+
* @category Manipulation
|
|
36
|
+
* @param elem The element to be replaced
|
|
37
|
+
* @param replacement The element to be added
|
|
38
|
+
*/
|
|
39
|
+
function replaceElement(elem, replacement) {
|
|
40
|
+
var prev = (replacement.prev = elem.prev);
|
|
41
|
+
if (prev) {
|
|
42
|
+
prev.next = replacement;
|
|
43
|
+
}
|
|
44
|
+
var next = (replacement.next = elem.next);
|
|
45
|
+
if (next) {
|
|
46
|
+
next.prev = replacement;
|
|
47
|
+
}
|
|
48
|
+
var parent = (replacement.parent = elem.parent);
|
|
49
|
+
if (parent) {
|
|
50
|
+
var childs = parent.children;
|
|
51
|
+
childs[childs.lastIndexOf(elem)] = replacement;
|
|
52
|
+
elem.parent = null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
manipulation.__exports.replaceElement = replaceElement;
|
|
56
|
+
/**
|
|
57
|
+
* Append a child to an element.
|
|
58
|
+
*
|
|
59
|
+
* @category Manipulation
|
|
60
|
+
* @param parent The element to append to.
|
|
61
|
+
* @param child The element to be added as a child.
|
|
62
|
+
*/
|
|
63
|
+
function appendChild(parent, child) {
|
|
64
|
+
removeElement(child);
|
|
65
|
+
child.next = null;
|
|
66
|
+
child.parent = parent;
|
|
67
|
+
if (parent.children.push(child) > 1) {
|
|
68
|
+
var sibling = parent.children[parent.children.length - 2];
|
|
69
|
+
sibling.next = child;
|
|
70
|
+
child.prev = sibling;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
child.prev = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
manipulation.__exports.appendChild = appendChild;
|
|
77
|
+
/**
|
|
78
|
+
* Append an element after another.
|
|
79
|
+
*
|
|
80
|
+
* @category Manipulation
|
|
81
|
+
* @param elem The element to append after.
|
|
82
|
+
* @param next The element be added.
|
|
83
|
+
*/
|
|
84
|
+
function append(elem, next) {
|
|
85
|
+
removeElement(next);
|
|
86
|
+
var parent = elem.parent;
|
|
87
|
+
var currNext = elem.next;
|
|
88
|
+
next.next = currNext;
|
|
89
|
+
next.prev = elem;
|
|
90
|
+
elem.next = next;
|
|
91
|
+
next.parent = parent;
|
|
92
|
+
if (currNext) {
|
|
93
|
+
currNext.prev = next;
|
|
94
|
+
if (parent) {
|
|
95
|
+
var childs = parent.children;
|
|
96
|
+
childs.splice(childs.lastIndexOf(currNext), 0, next);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (parent) {
|
|
100
|
+
parent.children.push(next);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
manipulation.__exports.append = append;
|
|
104
|
+
/**
|
|
105
|
+
* Prepend a child to an element.
|
|
106
|
+
*
|
|
107
|
+
* @category Manipulation
|
|
108
|
+
* @param parent The element to prepend before.
|
|
109
|
+
* @param child The element to be added as a child.
|
|
110
|
+
*/
|
|
111
|
+
function prependChild(parent, child) {
|
|
112
|
+
removeElement(child);
|
|
113
|
+
child.parent = parent;
|
|
114
|
+
child.prev = null;
|
|
115
|
+
if (parent.children.unshift(child) !== 1) {
|
|
116
|
+
var sibling = parent.children[1];
|
|
117
|
+
sibling.prev = child;
|
|
118
|
+
child.next = sibling;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
child.next = null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
manipulation.__exports.prependChild = prependChild;
|
|
125
|
+
/**
|
|
126
|
+
* Prepend an element before another.
|
|
127
|
+
*
|
|
128
|
+
* @category Manipulation
|
|
129
|
+
* @param elem The element to prepend before.
|
|
130
|
+
* @param prev The element be added.
|
|
131
|
+
*/
|
|
132
|
+
function prepend(elem, prev) {
|
|
133
|
+
removeElement(prev);
|
|
134
|
+
var parent = elem.parent;
|
|
135
|
+
if (parent) {
|
|
136
|
+
var childs = parent.children;
|
|
137
|
+
childs.splice(childs.indexOf(elem), 0, prev);
|
|
138
|
+
}
|
|
139
|
+
if (elem.prev) {
|
|
140
|
+
elem.prev.next = prev;
|
|
141
|
+
}
|
|
142
|
+
prev.parent = parent;
|
|
143
|
+
prev.prev = elem.prev;
|
|
144
|
+
prev.next = elem;
|
|
145
|
+
elem.prev = prev;
|
|
146
|
+
}
|
|
147
|
+
manipulation.__exports.prepend = prepend;
|
|
148
|
+
|
|
149
|
+
exports.default = manipulation.__exports;
|
|
150
|
+
//# sourceMappingURL=manipulation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manipulation.js","sources":["../../../../../../../../../node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepend = exports.prependChild = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0;\n/**\n * Remove an element from the dom\n *\n * @category Manipulation\n * @param elem The element to be removed\n */\nfunction removeElement(elem) {\n if (elem.prev)\n elem.prev.next = elem.next;\n if (elem.next)\n elem.next.prev = elem.prev;\n if (elem.parent) {\n var childs = elem.parent.children;\n var childsIndex = childs.lastIndexOf(elem);\n if (childsIndex >= 0) {\n childs.splice(childsIndex, 1);\n }\n }\n elem.next = null;\n elem.prev = null;\n elem.parent = null;\n}\nexports.removeElement = removeElement;\n/**\n * Replace an element in the dom\n *\n * @category Manipulation\n * @param elem The element to be replaced\n * @param replacement The element to be added\n */\nfunction replaceElement(elem, replacement) {\n var prev = (replacement.prev = elem.prev);\n if (prev) {\n prev.next = replacement;\n }\n var next = (replacement.next = elem.next);\n if (next) {\n next.prev = replacement;\n }\n var parent = (replacement.parent = elem.parent);\n if (parent) {\n var childs = parent.children;\n childs[childs.lastIndexOf(elem)] = replacement;\n elem.parent = null;\n }\n}\nexports.replaceElement = replaceElement;\n/**\n * Append a child to an element.\n *\n * @category Manipulation\n * @param parent The element to append to.\n * @param child The element to be added as a child.\n */\nfunction appendChild(parent, child) {\n removeElement(child);\n child.next = null;\n child.parent = parent;\n if (parent.children.push(child) > 1) {\n var sibling = parent.children[parent.children.length - 2];\n sibling.next = child;\n child.prev = sibling;\n }\n else {\n child.prev = null;\n }\n}\nexports.appendChild = appendChild;\n/**\n * Append an element after another.\n *\n * @category Manipulation\n * @param elem The element to append after.\n * @param next The element be added.\n */\nfunction append(elem, next) {\n removeElement(next);\n var parent = elem.parent;\n var currNext = elem.next;\n next.next = currNext;\n next.prev = elem;\n elem.next = next;\n next.parent = parent;\n if (currNext) {\n currNext.prev = next;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.lastIndexOf(currNext), 0, next);\n }\n }\n else if (parent) {\n parent.children.push(next);\n }\n}\nexports.append = append;\n/**\n * Prepend a child to an element.\n *\n * @category Manipulation\n * @param parent The element to prepend before.\n * @param child The element to be added as a child.\n */\nfunction prependChild(parent, child) {\n removeElement(child);\n child.parent = parent;\n child.prev = null;\n if (parent.children.unshift(child) !== 1) {\n var sibling = parent.children[1];\n sibling.prev = child;\n child.next = sibling;\n }\n else {\n child.next = null;\n }\n}\nexports.prependChild = prependChild;\n/**\n * Prepend an element before another.\n *\n * @category Manipulation\n * @param elem The element to prepend before.\n * @param prev The element be added.\n */\nfunction prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}\nexports.prepend = prepend;\n//# sourceMappingURL=manipulation.js.map"],"names":["manipulation"],"mappings":";;;;;;AACA,MAAM,CAAC,cAAc,CAACA,sBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9DA,sBAAA,CAAA,OAAe,GAAGA,sBAAA,CAAA,YAAoB,GAAGA,sBAAA,CAAA,MAAc,GAAGA,sBAAA,CAAA,WAAmB,GAAGA,sBAAA,CAAA,cAAsB,GAAGA,sBAAA,CAAA,aAAqB,GAAG,KAAK,EAAE;AACxI;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,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,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC1C,QAAQ,IAAI,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACnD,QAAQ,IAAI,WAAW,IAAI,CAAC,EAAE;AAC9B,YAAY,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC1C,SAAS;AACT,KAAK;AACL,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACvB,CAAC;AACoB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,CAAC;AACrB,CAAC;AACcA,sBAAA,CAAA,OAAA,GAAG,OAAO;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var querying = require('../../../../../_virtual/querying.js');
|
|
6
|
+
require('../../../../domhandler/lib/index.js');
|
|
7
|
+
var index = require('../../../../../_virtual/index3.js');
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(querying.__exports, "__esModule", { value: true });
|
|
10
|
+
querying.__exports.findAll = querying.__exports.existsOne = querying.__exports.findOne = querying.__exports.findOneChild = querying.__exports.find = querying.__exports.filter = void 0;
|
|
11
|
+
var domhandler_1 = index.__exports;
|
|
12
|
+
/**
|
|
13
|
+
* Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one.
|
|
14
|
+
*
|
|
15
|
+
* @category Querying
|
|
16
|
+
* @param test Function to test nodes on.
|
|
17
|
+
* @param node Node to search. Will be included in the result set if it matches.
|
|
18
|
+
* @param recurse Also consider child nodes.
|
|
19
|
+
* @param limit Maximum number of nodes to return.
|
|
20
|
+
* @returns All nodes passing `test`.
|
|
21
|
+
*/
|
|
22
|
+
function filter(test, node, recurse, limit) {
|
|
23
|
+
if (recurse === void 0) { recurse = true; }
|
|
24
|
+
if (limit === void 0) { limit = Infinity; }
|
|
25
|
+
return find(test, Array.isArray(node) ? node : [node], recurse, limit);
|
|
26
|
+
}
|
|
27
|
+
querying.__exports.filter = filter;
|
|
28
|
+
/**
|
|
29
|
+
* Search an array of nodes and their children for nodes passing a test function.
|
|
30
|
+
*
|
|
31
|
+
* @category Querying
|
|
32
|
+
* @param test Function to test nodes on.
|
|
33
|
+
* @param nodes Array of nodes to search.
|
|
34
|
+
* @param recurse Also consider child nodes.
|
|
35
|
+
* @param limit Maximum number of nodes to return.
|
|
36
|
+
* @returns All nodes passing `test`.
|
|
37
|
+
*/
|
|
38
|
+
function find(test, nodes, recurse, limit) {
|
|
39
|
+
var result = [];
|
|
40
|
+
/** Stack of the arrays we are looking at. */
|
|
41
|
+
var nodeStack = [nodes];
|
|
42
|
+
/** Stack of the indices within the arrays. */
|
|
43
|
+
var indexStack = [0];
|
|
44
|
+
for (;;) {
|
|
45
|
+
// First, check if the current array has any more elements to look at.
|
|
46
|
+
if (indexStack[0] >= nodeStack[0].length) {
|
|
47
|
+
// If we have no more arrays to look at, we are done.
|
|
48
|
+
if (indexStack.length === 1) {
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
// Otherwise, remove the current array from the stack.
|
|
52
|
+
nodeStack.shift();
|
|
53
|
+
indexStack.shift();
|
|
54
|
+
// Loop back to the start to continue with the next array.
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
var elem = nodeStack[0][indexStack[0]++];
|
|
58
|
+
if (test(elem)) {
|
|
59
|
+
result.push(elem);
|
|
60
|
+
if (--limit <= 0)
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {
|
|
64
|
+
/*
|
|
65
|
+
* Add the children to the stack. We are depth-first, so this is
|
|
66
|
+
* the next array we look at.
|
|
67
|
+
*/
|
|
68
|
+
indexStack.unshift(0);
|
|
69
|
+
nodeStack.unshift(elem.children);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
querying.__exports.find = find;
|
|
74
|
+
/**
|
|
75
|
+
* Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`.
|
|
76
|
+
*
|
|
77
|
+
* @category Querying
|
|
78
|
+
* @param test Function to test nodes on.
|
|
79
|
+
* @param nodes Array of nodes to search.
|
|
80
|
+
* @returns The first node in the array that passes `test`.
|
|
81
|
+
* @deprecated Use `Array.prototype.find` directly.
|
|
82
|
+
*/
|
|
83
|
+
function findOneChild(test, nodes) {
|
|
84
|
+
return nodes.find(test);
|
|
85
|
+
}
|
|
86
|
+
querying.__exports.findOneChild = findOneChild;
|
|
87
|
+
/**
|
|
88
|
+
* Finds one element in a tree that passes a test.
|
|
89
|
+
*
|
|
90
|
+
* @category Querying
|
|
91
|
+
* @param test Function to test nodes on.
|
|
92
|
+
* @param nodes Node or array of nodes to search.
|
|
93
|
+
* @param recurse Also consider child nodes.
|
|
94
|
+
* @returns The first node that passes `test`.
|
|
95
|
+
*/
|
|
96
|
+
function findOne(test, nodes, recurse) {
|
|
97
|
+
if (recurse === void 0) { recurse = true; }
|
|
98
|
+
var elem = null;
|
|
99
|
+
for (var i = 0; i < nodes.length && !elem; i++) {
|
|
100
|
+
var node = nodes[i];
|
|
101
|
+
if (!(0, domhandler_1.isTag)(node)) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
else if (test(node)) {
|
|
105
|
+
elem = node;
|
|
106
|
+
}
|
|
107
|
+
else if (recurse && node.children.length > 0) {
|
|
108
|
+
elem = findOne(test, node.children, true);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return elem;
|
|
112
|
+
}
|
|
113
|
+
querying.__exports.findOne = findOne;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if a tree of nodes contains at least one node passing a test.
|
|
116
|
+
*
|
|
117
|
+
* @category Querying
|
|
118
|
+
* @param test Function to test nodes on.
|
|
119
|
+
* @param nodes Array of nodes to search.
|
|
120
|
+
* @returns Whether a tree of nodes contains at least one node passing the test.
|
|
121
|
+
*/
|
|
122
|
+
function existsOne(test, nodes) {
|
|
123
|
+
return nodes.some(function (checked) {
|
|
124
|
+
return (0, domhandler_1.isTag)(checked) &&
|
|
125
|
+
(test(checked) || existsOne(test, checked.children));
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
querying.__exports.existsOne = existsOne;
|
|
129
|
+
/**
|
|
130
|
+
* Search an array of nodes and their children for elements passing a test function.
|
|
131
|
+
*
|
|
132
|
+
* Same as `find`, but limited to elements and with less options, leading to reduced complexity.
|
|
133
|
+
*
|
|
134
|
+
* @category Querying
|
|
135
|
+
* @param test Function to test nodes on.
|
|
136
|
+
* @param nodes Array of nodes to search.
|
|
137
|
+
* @returns All nodes passing `test`.
|
|
138
|
+
*/
|
|
139
|
+
function findAll(test, nodes) {
|
|
140
|
+
var result = [];
|
|
141
|
+
var nodeStack = [nodes];
|
|
142
|
+
var indexStack = [0];
|
|
143
|
+
for (;;) {
|
|
144
|
+
if (indexStack[0] >= nodeStack[0].length) {
|
|
145
|
+
if (nodeStack.length === 1) {
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
// Otherwise, remove the current array from the stack.
|
|
149
|
+
nodeStack.shift();
|
|
150
|
+
indexStack.shift();
|
|
151
|
+
// Loop back to the start to continue with the next array.
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
var elem = nodeStack[0][indexStack[0]++];
|
|
155
|
+
if (!(0, domhandler_1.isTag)(elem))
|
|
156
|
+
continue;
|
|
157
|
+
if (test(elem))
|
|
158
|
+
result.push(elem);
|
|
159
|
+
if (elem.children.length > 0) {
|
|
160
|
+
indexStack.unshift(0);
|
|
161
|
+
nodeStack.unshift(elem.children);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
querying.__exports.findAll = findAll;
|
|
166
|
+
|
|
167
|
+
exports.default = querying.__exports;
|
|
168
|
+
//# sourceMappingURL=querying.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"querying.js","sources":["../../../../../../../../../node_modules/htmlparser2/node_modules/domutils/lib/querying.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0;\nvar domhandler_1 = require(\"domhandler\");\n/**\n * Search a node and its children for nodes passing a test function. If `node` is not an array, it will be wrapped in one.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param node Node to search. Will be included in the result set if it matches.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes passing `test`.\n */\nfunction filter(test, node, recurse, limit) {\n if (recurse === void 0) { recurse = true; }\n if (limit === void 0) { limit = Infinity; }\n return find(test, Array.isArray(node) ? node : [node], recurse, limit);\n}\nexports.filter = filter;\n/**\n * Search an array of nodes and their children for nodes passing a test function.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes passing `test`.\n */\nfunction find(test, nodes, recurse, limit) {\n var result = [];\n /** Stack of the arrays we are looking at. */\n var nodeStack = [nodes];\n /** Stack of the indices within the arrays. */\n var indexStack = [0];\n for (;;) {\n // First, check if the current array has any more elements to look at.\n if (indexStack[0] >= nodeStack[0].length) {\n // If we have no more arrays to look at, we are done.\n if (indexStack.length === 1) {\n return result;\n }\n // Otherwise, remove the current array from the stack.\n nodeStack.shift();\n indexStack.shift();\n // Loop back to the start to continue with the next array.\n continue;\n }\n var elem = nodeStack[0][indexStack[0]++];\n if (test(elem)) {\n result.push(elem);\n if (--limit <= 0)\n return result;\n }\n if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {\n /*\n * Add the children to the stack. We are depth-first, so this is\n * the next array we look at.\n */\n indexStack.unshift(0);\n nodeStack.unshift(elem.children);\n }\n }\n}\nexports.find = find;\n/**\n * Finds the first element inside of an array that matches a test function. This is an alias for `Array.prototype.find`.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns The first node in the array that passes `test`.\n * @deprecated Use `Array.prototype.find` directly.\n */\nfunction findOneChild(test, nodes) {\n return nodes.find(test);\n}\nexports.findOneChild = findOneChild;\n/**\n * Finds one element in a tree that passes a test.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param nodes Node or array of nodes to search.\n * @param recurse Also consider child nodes.\n * @returns The first node that passes `test`.\n */\nfunction findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var node = nodes[i];\n if (!(0, domhandler_1.isTag)(node)) {\n continue;\n }\n else if (test(node)) {\n elem = node;\n }\n else if (recurse && node.children.length > 0) {\n elem = findOne(test, node.children, true);\n }\n }\n return elem;\n}\nexports.findOne = findOne;\n/**\n * Checks if a tree of nodes contains at least one node passing a test.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns Whether a tree of nodes contains at least one node passing the test.\n */\nfunction existsOne(test, nodes) {\n return nodes.some(function (checked) {\n return (0, domhandler_1.isTag)(checked) &&\n (test(checked) || existsOne(test, checked.children));\n });\n}\nexports.existsOne = existsOne;\n/**\n * Search an array of nodes and their children for elements passing a test function.\n *\n * Same as `find`, but limited to elements and with less options, leading to reduced complexity.\n *\n * @category Querying\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns All nodes passing `test`.\n */\nfunction findAll(test, nodes) {\n var result = [];\n var nodeStack = [nodes];\n var indexStack = [0];\n for (;;) {\n if (indexStack[0] >= nodeStack[0].length) {\n if (nodeStack.length === 1) {\n return result;\n }\n // Otherwise, remove the current array from the stack.\n nodeStack.shift();\n indexStack.shift();\n // Loop back to the start to continue with the next array.\n continue;\n }\n var elem = nodeStack[0][indexStack[0]++];\n if (!(0, domhandler_1.isTag)(elem))\n continue;\n if (test(elem))\n result.push(elem);\n if (elem.children.length > 0) {\n indexStack.unshift(0);\n nodeStack.unshift(elem.children);\n }\n }\n}\nexports.findAll = findAll;\n//# sourceMappingURL=querying.js.map"],"names":["querying","require$$0"],"mappings":";;;;;;;;AACA,MAAM,CAAC,cAAc,CAACA,kBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9DA,kBAAA,CAAA,OAAe,GAAGA,kBAAA,CAAA,SAAiB,GAAGA,kBAAA,CAAA,OAAe,GAAGA,kBAAA,CAAA,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