@gobolt/genesis 0.2.20 → 0.3.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/README.md +10 -11
- package/dist/_virtual/index5.cjs +4 -4
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.cjs +4 -4
- package/dist/_virtual/index6.js +4 -4
- package/dist/_virtual/index7.cjs +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.cjs +3 -0
- package/dist/_virtual/index8.js +4 -0
- package/dist/_virtual/utilities.cjs +3 -0
- package/dist/_virtual/utilities.js +4 -0
- package/dist/components/Avatar/styles.d.ts +2 -2
- package/dist/components/Badge/Badge.cjs +3 -3
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +1 -0
- package/dist/components/Badge/styles.cjs +9 -10
- package/dist/components/Badge/styles.d.ts +5 -6
- package/dist/components/Badge/styles.js +9 -10
- package/dist/components/Breadcrumb/styles.cjs +3 -1
- package/dist/components/Breadcrumb/styles.d.ts +4 -4
- package/dist/components/Breadcrumb/styles.js +3 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/icon-button-styles.d.ts +2 -2
- package/dist/components/Button/styles.d.ts +4 -4
- package/dist/components/Card/styles.d.ts +2 -2
- package/dist/components/Chat/Chat.cjs +247 -0
- package/dist/components/Chat/Chat.d.ts +18 -0
- package/dist/components/Chat/Chat.js +248 -0
- package/dist/components/Chat/Message.cjs +96 -0
- package/dist/components/Chat/Message.d.ts +8 -0
- package/dist/components/Chat/Message.js +97 -0
- package/dist/components/Chat/__stories__/Chat.stories.d.ts +19 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Checkbox/styles.d.ts +2 -2
- package/dist/components/Dashboard/__stories__/charts/LineChart.d.ts +2 -2
- package/dist/components/Dashboard/styles.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.cjs +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/DatePicker/DatePicker.js +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.cjs +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +2 -2
- package/dist/components/ErrorBoundary/ErrorBoundary.cjs +2 -2
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/dist/components/ErrorBoundary/styles.d.ts +2 -2
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.cjs +12 -4
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +1 -1
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +12 -4
- package/dist/components/Filters/__stories__/Filters.stories.d.ts +0 -2
- package/dist/components/Filters/__stories__/mock.d.ts +5 -0
- package/dist/components/Filters/styles.d.ts +4 -4
- package/dist/components/Form/Form.cjs +2 -2
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Glyph/custom/UnitNumber.cjs +51 -0
- package/dist/components/Glyph/custom/UnitNumber.d.ts +5 -0
- package/dist/components/Glyph/custom/UnitNumber.js +52 -0
- package/dist/components/Glyph/custom/__stories__/UnitNumber.stories.d.ts +7 -0
- package/dist/components/Glyph/index.d.ts +2 -0
- package/dist/components/Glyph/styles.d.ts +2 -2
- package/dist/components/Input/Input.cjs +19 -2
- package/dist/components/Input/Input.d.ts +7 -3
- package/dist/components/Input/Input.js +19 -2
- package/dist/components/Input/styles.cjs +43 -12
- package/dist/components/Input/styles.d.ts +5 -4
- package/dist/components/Input/styles.js +43 -12
- package/dist/components/Layout/Content/ResponsiveContent.d.ts +2 -2
- package/dist/components/Layout/Content/styles.d.ts +2 -2
- package/dist/components/Message/Message.cjs +21 -11
- package/dist/components/Message/Message.js +21 -11
- package/dist/components/Notification/Notification.cjs +11 -6
- package/dist/components/Notification/Notification.js +11 -6
- package/dist/components/Notification/NotificationBadge/NotificationBadge.cjs +19 -10
- package/dist/components/Notification/NotificationBadge/NotificationBadge.js +19 -10
- package/dist/components/Notification/NotificationBadge/icons/ASN.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/ASN.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/ASN.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Appointment.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Appointment.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Appointment.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Inventory.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Inventory.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Inventory.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Parcel.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Parcel.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Parcel.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Product.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Product.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Product.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Route.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Route.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Route.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Shipment.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/Shipment.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/Shipment.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/ShoppingCart.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/ShoppingCart.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/ShoppingCart.js +2 -2
- package/dist/components/Notification/NotificationBadge/icons/System.cjs +2 -2
- package/dist/components/Notification/NotificationBadge/icons/System.d.ts +1 -1
- package/dist/components/Notification/NotificationBadge/icons/System.js +2 -2
- package/dist/components/Notification/NotificationRightChevron.cjs +2 -2
- package/dist/components/Notification/NotificationRightChevron.d.ts +1 -1
- package/dist/components/Notification/NotificationRightChevron.js +2 -2
- package/dist/components/Notification/styles.d.ts +2 -2
- package/dist/components/Popover/styles.d.ts +2 -2
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Progress/styles.d.ts +2 -2
- package/dist/components/Radio/Radio.cjs +3 -3
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/states/RadioChecked.cjs +2 -2
- package/dist/components/Radio/states/RadioChecked.d.ts +1 -1
- package/dist/components/Radio/states/RadioChecked.js +2 -2
- package/dist/components/Radio/states/RadioCheckedDisabled.cjs +2 -2
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +1 -1
- package/dist/components/Radio/states/RadioCheckedDisabled.js +2 -2
- package/dist/components/Radio/states/RadioCheckedFocussed.cjs +2 -2
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +1 -1
- package/dist/components/Radio/states/RadioCheckedFocussed.js +2 -2
- package/dist/components/Radio/states/RadioCheckedHover.cjs +2 -2
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +1 -1
- package/dist/components/Radio/states/RadioCheckedHover.js +2 -2
- package/dist/components/Radio/states/RadioUnchecked.cjs +2 -2
- package/dist/components/Radio/states/RadioUnchecked.d.ts +1 -1
- package/dist/components/Radio/states/RadioUnchecked.js +2 -2
- package/dist/components/Radio/states/RadioUncheckedDisabled.cjs +2 -2
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +1 -1
- package/dist/components/Radio/states/RadioUncheckedDisabled.js +2 -2
- package/dist/components/Radio/states/RadioUncheckedFocussed.cjs +2 -2
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +1 -1
- package/dist/components/Radio/states/RadioUncheckedFocussed.js +2 -2
- package/dist/components/Radio/states/RadioUncheckedHover.cjs +2 -2
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +1 -1
- package/dist/components/Radio/states/RadioUncheckedHover.js +2 -2
- package/dist/components/Row/Row.cjs +2 -2
- package/dist/components/Row/Row.d.ts +1 -1
- package/dist/components/Row/Row.js +2 -2
- package/dist/components/Row/RowActions/RowActions.d.ts +2 -2
- package/dist/components/Row/RowLabelValue/RowLabelValue.cjs +1 -1
- package/dist/components/Row/RowLabelValue/RowLabelValue.d.ts +2 -2
- package/dist/components/Row/RowLabelValue/RowLabelValue.js +1 -1
- package/dist/components/Row/RowLabelValue/styles.d.ts +2 -2
- package/dist/components/Row/styles.d.ts +2 -2
- package/dist/components/SegmentedControls/styles.d.ts +2 -2
- package/dist/components/Select/Select.cjs +187 -51
- package/dist/components/Select/Select.d.ts +10 -3
- package/dist/components/Select/Select.js +189 -53
- package/dist/components/Select/SelectTrigger.cjs +131 -0
- package/dist/components/Select/SelectTrigger.d.ts +23 -0
- package/dist/components/Select/SelectTrigger.js +132 -0
- package/dist/components/Select/__stories__/Select.stories.d.ts +4 -3
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/Switch/styles.d.ts +2 -2
- package/dist/components/Table/Table.cjs +21 -2
- package/dist/components/Table/Table.d.ts +7 -3
- package/dist/components/Table/Table.js +21 -2
- package/dist/components/Table/TableControls/CustomPagination.cjs +321 -0
- package/dist/components/Table/TableControls/CustomPagination.d.ts +13 -0
- package/dist/components/Table/TableControls/CustomPagination.js +321 -0
- package/dist/components/Table/TableControls/PaginationNumber.cjs +44 -0
- package/dist/components/Table/TableControls/PaginationNumber.d.ts +7 -0
- package/dist/components/Table/TableControls/PaginationNumber.js +45 -0
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.cjs +74 -39
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.d.ts +3 -1
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +74 -39
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.cjs +8 -6
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.js +8 -6
- package/dist/components/Table/TableControls/TableControls.cjs +3 -1
- package/dist/components/Table/TableControls/TableControls.js +3 -1
- package/dist/components/Table/TableControls/__stories__/CustomPaginationStandalone.stories.d.ts +9 -0
- package/dist/components/Table/TableControls/__stories__/PaginationNumber.stories.d.ts +7 -0
- package/dist/components/Table/TableControls/styles.d.ts +2 -2
- package/dist/components/Table/TablePagination.cjs +51 -0
- package/dist/components/Table/TablePagination.d.ts +13 -0
- package/dist/components/Table/TablePagination.js +52 -0
- package/dist/components/Table/TableWithControls/TableWithControls.cjs +2 -2
- package/dist/components/Table/TableWithControls/TableWithControls.js +2 -2
- package/dist/components/Table/TableWithControls/useTableWithControls.cjs +19 -19
- package/dist/components/Table/TableWithControls/useTableWithControls.js +20 -20
- package/dist/components/Table/__mocks__/table-mocks.cjs +241 -9
- package/dist/components/Table/__mocks__/table-mocks.d.ts +1 -1
- package/dist/components/Table/__mocks__/table-mocks.js +241 -9
- package/dist/components/Table/__stories__/GenesisTable.stories.d.ts +3 -1
- package/dist/components/Table/__stories__/Table.stories.d.ts +4 -4
- package/dist/components/Table/index.d.ts +2 -1
- package/dist/components/Table/styles.cjs +54 -25
- package/dist/components/Table/styles.d.ts +25 -4
- package/dist/components/Table/styles.js +54 -25
- package/dist/components/Tabs/styles.d.ts +2 -2
- package/dist/components/Tile/styles.d.ts +2 -2
- package/dist/components/Toast/Toast.cjs +20 -10
- package/dist/components/Toast/Toast.js +20 -10
- package/dist/components/Tooltip/Tooltip.cjs +4 -4
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Tooltip/styles.cjs +18 -2
- package/dist/components/Tooltip/styles.d.ts +2 -2
- package/dist/components/Tooltip/styles.js +18 -2
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/styles.cjs +4 -2
- package/dist/components/Typography/styles.d.ts +4 -4
- package/dist/components/Typography/styles.js +4 -2
- package/dist/components/index.d.ts +4 -2
- package/dist/components/shared/DropdownChevron.cjs +3 -3
- package/dist/components/shared/DropdownChevron.d.ts +1 -1
- package/dist/components/shared/DropdownChevron.js +3 -3
- package/dist/genesis/GenesisThemeDemo.d.ts +2 -2
- package/dist/genesis/styles.d.ts +3 -3
- package/dist/index.cjs +6 -4
- package/dist/index.js +52 -50
- package/dist/node_modules/@socket.io/component-emitter/lib/esm/index.cjs +72 -0
- package/dist/node_modules/@socket.io/component-emitter/lib/esm/index.js +73 -0
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs +67 -0
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +68 -0
- package/dist/node_modules/@ungap/structured-clone/esm/index.cjs +11 -0
- package/dist/node_modules/@ungap/structured-clone/esm/index.js +11 -0
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs +134 -0
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +135 -0
- package/dist/node_modules/@ungap/structured-clone/esm/types.cjs +21 -0
- package/dist/node_modules/@ungap/structured-clone/esm/types.js +22 -0
- package/dist/node_modules/antd/es/typography/hooks/useCopyClick.cjs +1 -1
- package/dist/node_modules/antd/es/typography/hooks/useCopyClick.js +1 -1
- package/dist/node_modules/bail/index.cjs +7 -0
- package/dist/node_modules/bail/index.js +8 -0
- package/dist/node_modules/comma-separated-tokens/index.cjs +9 -0
- package/dist/node_modules/comma-separated-tokens/index.js +10 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.cjs +16 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.js +17 -0
- package/dist/node_modules/devlop/lib/default.cjs +7 -0
- package/dist/node_modules/devlop/lib/default.js +8 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.cjs +8 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js +9 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.cjs +23 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js +24 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.cjs +60 -0
- package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js +61 -0
- package/dist/node_modules/engine.io-client/build/esm/globals.cjs +25 -0
- package/dist/node_modules/engine.io-client/build/esm/globals.js +26 -0
- package/dist/node_modules/engine.io-client/build/esm/socket.cjs +575 -0
- package/dist/node_modules/engine.io-client/build/esm/socket.js +576 -0
- package/dist/node_modules/engine.io-client/build/esm/transport.cjs +137 -0
- package/dist/node_modules/engine.io-client/build/esm/transport.js +138 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/index.cjs +10 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/index.js +11 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.cjs +248 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +249 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/polling.cjs +134 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +135 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/websocket.cjs +101 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js +102 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.cjs +66 -0
- package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +67 -0
- package/dist/node_modules/engine.io-client/build/esm/util.cjs +52 -0
- package/dist/node_modules/engine.io-client/build/esm/util.js +53 -0
- package/dist/node_modules/engine.io-parser/build/esm/commons.cjs +17 -0
- package/dist/node_modules/engine.io-parser/build/esm/commons.js +18 -0
- package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.cjs +27 -0
- package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +28 -0
- package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.cjs +55 -0
- package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +56 -0
- package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.cjs +56 -0
- package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +57 -0
- package/dist/node_modules/engine.io-parser/build/esm/index.cjs +151 -0
- package/dist/node_modules/engine.io-parser/build/esm/index.js +152 -0
- package/dist/node_modules/estree-util-is-identifier-name/lib/index.cjs +10 -0
- package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +11 -0
- package/dist/node_modules/extend/index.cjs +93 -0
- package/dist/node_modules/extend/index.js +94 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +389 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +390 -0
- package/dist/node_modules/hast-util-whitespace/lib/index.cjs +9 -0
- package/dist/node_modules/hast-util-whitespace/lib/index.js +10 -0
- package/dist/node_modules/html-url-attributes/lib/index.cjs +25 -0
- package/dist/node_modules/html-url-attributes/lib/index.js +26 -0
- package/dist/node_modules/inline-style-parser/index.cjs +140 -0
- package/dist/node_modules/inline-style-parser/index.js +141 -0
- package/dist/node_modules/is-plain-obj/index.cjs +9 -0
- package/dist/node_modules/is-plain-obj/index.js +10 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.cjs +718 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.js +719 -0
- package/dist/node_modules/mdast-util-to-hast/lib/footer.cjs +114 -0
- package/dist/node_modules/mdast-util-to-hast/lib/footer.js +115 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.cjs +7 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.cjs +23 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +24 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.cjs +40 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +41 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.cjs +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +11 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.cjs +18 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +19 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.cjs +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +16 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.cjs +58 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +59 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.cjs +14 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.cjs +23 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +24 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.cjs +17 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +18 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.cjs +63 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +64 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.cjs +25 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +26 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.cjs +7 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.cjs +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +14 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.cjs +34 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +35 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.cjs +38 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +39 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.cjs +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +9 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.cjs +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/index.cjs +14 -0
- package/dist/node_modules/mdast-util-to-hast/lib/index.js +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/revert.cjs +28 -0
- package/dist/node_modules/mdast-util-to-hast/lib/revert.js +29 -0
- package/dist/node_modules/mdast-util-to-hast/lib/state.cjs +147 -0
- package/dist/node_modules/mdast-util-to-hast/lib/state.js +148 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.cjs +37 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.js +38 -0
- package/dist/node_modules/micromark/lib/constructs.cjs +92 -0
- package/dist/node_modules/micromark/lib/constructs.js +93 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs +319 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.js +320 -0
- package/dist/node_modules/micromark/lib/initialize/content.cjs +52 -0
- package/dist/node_modules/micromark/lib/initialize/content.js +53 -0
- package/dist/node_modules/micromark/lib/initialize/document.cjs +185 -0
- package/dist/node_modules/micromark/lib/initialize/document.js +186 -0
- package/dist/node_modules/micromark/lib/initialize/flow.cjs +41 -0
- package/dist/node_modules/micromark/lib/initialize/flow.js +42 -0
- package/dist/node_modules/micromark/lib/initialize/text.cjs +141 -0
- package/dist/node_modules/micromark/lib/initialize/text.js +142 -0
- package/dist/node_modules/micromark/lib/parse.cjs +33 -0
- package/dist/node_modules/micromark/lib/parse.js +34 -0
- package/dist/node_modules/micromark/lib/postprocess.cjs +8 -0
- package/dist/node_modules/micromark/lib/postprocess.js +9 -0
- package/dist/node_modules/micromark/lib/preprocess.cjs +79 -0
- package/dist/node_modules/micromark/lib/preprocess.js +80 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +134 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.js +135 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.cjs +102 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +103 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.cjs +17 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.cjs +60 -0
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +61 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.cjs +27 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +28 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.cjs +67 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +68 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +185 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +186 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +66 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +67 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.cjs +115 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +116 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.cjs +74 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.js +75 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.cjs +93 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.js +94 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.cjs +22 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +23 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +94 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +95 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +382 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +383 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.cjs +308 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +309 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +234 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +235 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +32 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +33 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +23 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +24 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.cjs +16 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +17 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.cjs +134 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.js +135 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +94 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +95 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.cjs +41 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +42 -0
- package/dist/node_modules/micromark-factory-destination/index.cjs +93 -0
- package/dist/node_modules/micromark-factory-destination/index.js +94 -0
- package/dist/node_modules/micromark-factory-label/index.cjs +62 -0
- package/dist/node_modules/micromark-factory-label/index.js +63 -0
- package/dist/node_modules/micromark-factory-space/index.cjs +23 -0
- package/dist/node_modules/micromark-factory-space/index.js +24 -0
- package/dist/node_modules/micromark-factory-title/index.cjs +64 -0
- package/dist/node_modules/micromark-factory-title/index.js +65 -0
- package/dist/node_modules/micromark-factory-whitespace/index.cjs +21 -0
- package/dist/node_modules/micromark-factory-whitespace/index.js +22 -0
- package/dist/node_modules/micromark-util-character/index.cjs +43 -0
- package/dist/node_modules/micromark-util-character/index.js +44 -0
- package/dist/node_modules/micromark-util-chunked/index.cjs +35 -0
- package/dist/node_modules/micromark-util-chunked/index.js +36 -0
- package/dist/node_modules/micromark-util-classify-character/index.cjs +11 -0
- package/dist/node_modules/micromark-util-classify-character/index.js +12 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.cjs +40 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.js +41 -0
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.cjs +18 -0
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +19 -0
- package/dist/node_modules/micromark-util-decode-string/index.cjs +20 -0
- package/dist/node_modules/micromark-util-decode-string/index.js +21 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.cjs +68 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.js +69 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.cjs +5 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.js +6 -0
- package/dist/node_modules/micromark-util-resolve-all/index.cjs +14 -0
- package/dist/node_modules/micromark-util-resolve-all/index.js +15 -0
- package/dist/node_modules/micromark-util-sanitize-uri/index.cjs +40 -0
- package/dist/node_modules/micromark-util-sanitize-uri/index.js +41 -0
- package/dist/node_modules/micromark-util-subtokenize/index.cjs +156 -0
- package/dist/node_modules/micromark-util-subtokenize/index.js +157 -0
- package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.cjs +193 -0
- package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +194 -0
- package/dist/node_modules/property-information/index.cjs +12 -0
- package/dist/node_modules/property-information/index.js +13 -0
- package/dist/node_modules/property-information/lib/aria.cjs +60 -0
- package/dist/node_modules/property-information/lib/aria.js +61 -0
- package/dist/node_modules/property-information/lib/find.cjs +39 -0
- package/dist/node_modules/property-information/lib/find.js +40 -0
- package/dist/node_modules/property-information/lib/hast-to-react.cjs +21 -0
- package/dist/node_modules/property-information/lib/hast-to-react.js +22 -0
- package/dist/node_modules/property-information/lib/html.cjs +367 -0
- package/dist/node_modules/property-information/lib/html.js +368 -0
- package/dist/node_modules/property-information/lib/normalize.cjs +5 -0
- package/dist/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/node_modules/property-information/lib/svg.cjs +565 -0
- package/dist/node_modules/property-information/lib/svg.js +566 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +6 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +5 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/node_modules/property-information/lib/util/create.cjs +24 -0
- package/dist/node_modules/property-information/lib/util/create.js +25 -0
- package/dist/node_modules/property-information/lib/util/defined-info.cjs +40 -0
- package/dist/node_modules/property-information/lib/util/defined-info.js +41 -0
- package/dist/node_modules/property-information/lib/util/info.cjs +28 -0
- package/dist/node_modules/property-information/lib/util/info.js +29 -0
- package/dist/node_modules/property-information/lib/util/merge.cjs +12 -0
- package/dist/node_modules/property-information/lib/util/merge.js +13 -0
- package/dist/node_modules/property-information/lib/util/schema.cjs +24 -0
- package/dist/node_modules/property-information/lib/util/schema.js +25 -0
- package/dist/node_modules/property-information/lib/util/types.cjs +19 -0
- package/dist/node_modules/property-information/lib/util/types.js +20 -0
- package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
- package/dist/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/node_modules/property-information/lib/xml.cjs +10 -0
- package/dist/node_modules/property-information/lib/xml.js +11 -0
- package/dist/node_modules/property-information/lib/xmlns.cjs +10 -0
- package/dist/node_modules/property-information/lib/xmlns.js +11 -0
- package/dist/node_modules/react-icons/hi/index.cjs +32 -0
- package/dist/node_modules/react-icons/hi/index.js +33 -1
- package/dist/node_modules/react-icons/pi/index.cjs +4 -0
- package/dist/node_modules/react-icons/pi/index.js +5 -1
- package/dist/node_modules/react-markdown/lib/index.cjs +148 -0
- package/dist/node_modules/react-markdown/lib/index.js +149 -0
- package/dist/node_modules/remark-parse/lib/index.cjs +18 -0
- package/dist/node_modules/remark-parse/lib/index.js +19 -0
- package/dist/node_modules/remark-rehype/lib/index.cjs +20 -0
- package/dist/node_modules/remark-rehype/lib/index.js +21 -0
- package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.cjs +31 -0
- package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js +32 -0
- package/dist/node_modules/socket.io-client/build/esm/index.cjs +58 -0
- package/dist/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/dist/node_modules/socket.io-client/build/esm/manager.cjs +363 -0
- package/dist/node_modules/socket.io-client/build/esm/manager.js +364 -0
- package/dist/node_modules/socket.io-client/build/esm/on.cjs +8 -0
- package/dist/node_modules/socket.io-client/build/esm/on.js +9 -0
- package/dist/node_modules/socket.io-client/build/esm/socket.cjs +777 -0
- package/dist/node_modules/socket.io-client/build/esm/socket.js +778 -0
- package/dist/node_modules/socket.io-client/build/esm/url.cjs +48 -0
- package/dist/node_modules/socket.io-client/build/esm/url.js +49 -0
- package/dist/node_modules/socket.io-parser/build/esm/binary.cjs +64 -0
- package/dist/node_modules/socket.io-parser/build/esm/binary.js +65 -0
- package/dist/node_modules/socket.io-parser/build/esm/index.cjs +261 -0
- package/dist/node_modules/socket.io-parser/build/esm/index.js +263 -0
- package/dist/node_modules/socket.io-parser/build/esm/is-binary.cjs +38 -0
- package/dist/node_modules/socket.io-parser/build/esm/is-binary.js +39 -0
- package/dist/node_modules/space-separated-tokens/index.cjs +5 -0
- package/dist/node_modules/space-separated-tokens/index.js +6 -0
- package/dist/node_modules/style-to-js/cjs/index.cjs +30 -0
- package/dist/node_modules/style-to-js/cjs/index.js +31 -0
- package/dist/node_modules/style-to-js/cjs/utilities.cjs +41 -0
- package/dist/node_modules/style-to-js/cjs/utilities.js +42 -0
- package/dist/node_modules/style-to-object/cjs/index.cjs +37 -0
- package/dist/node_modules/style-to-object/cjs/index.js +38 -0
- package/dist/node_modules/trim-lines/index.cjs +40 -0
- package/dist/node_modules/trim-lines/index.js +41 -0
- package/dist/node_modules/trough/lib/index.cjs +85 -0
- package/dist/node_modules/trough/lib/index.js +86 -0
- package/dist/node_modules/unified/lib/callable-instance.cjs +29 -0
- package/dist/node_modules/unified/lib/callable-instance.js +30 -0
- package/dist/node_modules/unified/lib/index.cjs +635 -0
- package/dist/node_modules/unified/lib/index.js +636 -0
- package/dist/node_modules/unist-util-is/lib/index.cjs +92 -0
- package/dist/node_modules/unist-util-is/lib/index.js +93 -0
- package/dist/node_modules/unist-util-position/lib/index.cjs +26 -0
- package/dist/node_modules/unist-util-position/lib/index.js +27 -0
- package/dist/node_modules/unist-util-stringify-position/lib/index.cjs +26 -0
- package/dist/node_modules/unist-util-stringify-position/lib/index.js +27 -0
- package/dist/node_modules/unist-util-visit/lib/index.cjs +26 -0
- package/dist/node_modules/unist-util-visit/lib/index.js +28 -0
- package/dist/node_modules/unist-util-visit-parents/lib/color.cjs +5 -0
- package/dist/node_modules/unist-util-visit-parents/lib/color.js +6 -0
- package/dist/node_modules/unist-util-visit-parents/lib/index.cjs +82 -0
- package/dist/node_modules/unist-util-visit-parents/lib/index.js +83 -0
- package/dist/node_modules/vfile/lib/index.cjs +461 -0
- package/dist/node_modules/vfile/lib/index.js +462 -0
- package/dist/node_modules/vfile/lib/minpath.browser.cjs +213 -0
- package/dist/node_modules/vfile/lib/minpath.browser.js +214 -0
- package/dist/node_modules/vfile/lib/minproc.browser.cjs +6 -0
- package/dist/node_modules/vfile/lib/minproc.browser.js +7 -0
- package/dist/node_modules/vfile/lib/minurl.browser.cjs +45 -0
- package/dist/node_modules/vfile/lib/minurl.browser.js +46 -0
- package/dist/node_modules/vfile/lib/minurl.shared.cjs +8 -0
- package/dist/node_modules/vfile/lib/minurl.shared.js +9 -0
- package/dist/node_modules/vfile-message/lib/index.cjs +137 -0
- package/dist/node_modules/vfile-message/lib/index.js +138 -0
- package/dist/providers/BreakpointProvider.cjs +4 -2
- package/dist/providers/BreakpointProvider.d.ts +2 -2
- package/dist/providers/BreakpointProvider.js +4 -2
- package/dist/providers/GenesisProvider.cjs +1 -1
- package/dist/providers/GenesisProvider.d.ts +2 -2
- package/dist/providers/GenesisProvider.js +1 -1
- package/dist/providers/ToastProvider.cjs +3 -3
- package/dist/providers/ToastProvider.js +3 -3
- package/dist/providers/useGenesis.cjs +1 -1
- package/dist/providers/useGenesis.js +1 -1
- package/dist/styles/global-styles.cjs +1 -1
- package/dist/styles/global-styles.js +1 -1
- package/dist/styles/theme/genesis-theme.cjs +19 -8
- package/dist/styles/theme/genesis-theme.js +20 -9
- package/dist/styles/theme/genesis-theme.types.d.ts +7 -1
- package/dist/utils/icon-util.cjs +57 -48
- package/dist/utils/icon-util.js +58 -49
- package/dist/utils/styled.d.ts +1 -6
- package/dist/utils/user-util.cjs +2 -2
- package/dist/utils/user-util.js +2 -2
- package/package.json +11 -2
- package/dist/components/Select/MultiSelectCount.cjs +0 -48
- package/dist/components/Select/MultiSelectCount.d.ts +0 -13
- package/dist/components/Select/MultiSelectCount.js +0 -49
- package/dist/components/Select/__stories__/MultiSelectCount.stories.d.ts +0 -8
- package/dist/components/Select/styles.cjs +0 -238
- package/dist/components/Select/styles.d.ts +0 -41
- package/dist/components/Select/styles.js +0 -239
- package/dist/node_modules/@ant-design/icons/es/icons/ClockCircleFilled.cjs +0 -35
- package/dist/node_modules/@ant-design/icons/es/icons/ClockCircleFilled.js +0 -17
- package/dist/node_modules/@ant-design/icons/es/icons/MinusCircleFilled.cjs +0 -35
- package/dist/node_modules/@ant-design/icons/es/icons/MinusCircleFilled.js +0 -17
- package/dist/node_modules/@ant-design/icons-svg/es/asn/ClockCircleFilled.cjs +0 -3
- package/dist/node_modules/@ant-design/icons-svg/es/asn/ClockCircleFilled.js +0 -4
- package/dist/node_modules/@ant-design/icons-svg/es/asn/MinusCircleFilled.cjs +0 -3
- package/dist/node_modules/@ant-design/icons-svg/es/asn/MinusCircleFilled.js +0 -4
- package/dist/node_modules/debounce/index.cjs +0 -83
- package/dist/node_modules/debounce/index.js +0 -84
- package/dist/utils/styled.cjs +0 -10
- package/dist/utils/styled.js +0 -11
- /package/dist/components/{Select/__tests__/Select.test.d.ts → Table/TableControls/__tests__/CustomPagination.test.d.ts} +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import "../../../engine.io-parser/build/esm/encodePacket.browser.js";
|
|
2
|
+
import { decodePacket } from "../../../engine.io-parser/build/esm/decodePacket.browser.js";
|
|
3
|
+
import "../../../engine.io-parser/build/esm/commons.js";
|
|
4
|
+
import { Emitter } from "../../../@socket.io/component-emitter/lib/esm/index.js";
|
|
5
|
+
import { installTimerFunctions } from "./util.js";
|
|
6
|
+
import { encode } from "./contrib/parseqs.js";
|
|
7
|
+
class TransportError extends Error {
|
|
8
|
+
constructor(reason, description, context) {
|
|
9
|
+
super(reason);
|
|
10
|
+
this.description = description;
|
|
11
|
+
this.context = context;
|
|
12
|
+
this.type = "TransportError";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class Transport extends Emitter {
|
|
16
|
+
/**
|
|
17
|
+
* Transport abstract constructor.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} opts - options
|
|
20
|
+
* @protected
|
|
21
|
+
*/
|
|
22
|
+
constructor(opts) {
|
|
23
|
+
super();
|
|
24
|
+
this.writable = false;
|
|
25
|
+
installTimerFunctions(this, opts);
|
|
26
|
+
this.opts = opts;
|
|
27
|
+
this.query = opts.query;
|
|
28
|
+
this.socket = opts.socket;
|
|
29
|
+
this.supportsBinary = !opts.forceBase64;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Emits an error.
|
|
33
|
+
*
|
|
34
|
+
* @param {String} reason
|
|
35
|
+
* @param description
|
|
36
|
+
* @param context - the error context
|
|
37
|
+
* @return {Transport} for chaining
|
|
38
|
+
* @protected
|
|
39
|
+
*/
|
|
40
|
+
onError(reason, description, context) {
|
|
41
|
+
super.emitReserved("error", new TransportError(reason, description, context));
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Opens the transport.
|
|
46
|
+
*/
|
|
47
|
+
open() {
|
|
48
|
+
this.readyState = "opening";
|
|
49
|
+
this.doOpen();
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Closes the transport.
|
|
54
|
+
*/
|
|
55
|
+
close() {
|
|
56
|
+
if (this.readyState === "opening" || this.readyState === "open") {
|
|
57
|
+
this.doClose();
|
|
58
|
+
this.onClose();
|
|
59
|
+
}
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Sends multiple packets.
|
|
64
|
+
*
|
|
65
|
+
* @param {Array} packets
|
|
66
|
+
*/
|
|
67
|
+
send(packets) {
|
|
68
|
+
if (this.readyState === "open") {
|
|
69
|
+
this.write(packets);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Called upon open
|
|
74
|
+
*
|
|
75
|
+
* @protected
|
|
76
|
+
*/
|
|
77
|
+
onOpen() {
|
|
78
|
+
this.readyState = "open";
|
|
79
|
+
this.writable = true;
|
|
80
|
+
super.emitReserved("open");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Called with data.
|
|
84
|
+
*
|
|
85
|
+
* @param {String} data
|
|
86
|
+
* @protected
|
|
87
|
+
*/
|
|
88
|
+
onData(data) {
|
|
89
|
+
const packet = decodePacket(data, this.socket.binaryType);
|
|
90
|
+
this.onPacket(packet);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Called with a decoded packet.
|
|
94
|
+
*
|
|
95
|
+
* @protected
|
|
96
|
+
*/
|
|
97
|
+
onPacket(packet) {
|
|
98
|
+
super.emitReserved("packet", packet);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Called upon close.
|
|
102
|
+
*
|
|
103
|
+
* @protected
|
|
104
|
+
*/
|
|
105
|
+
onClose(details) {
|
|
106
|
+
this.readyState = "closed";
|
|
107
|
+
super.emitReserved("close", details);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Pauses the transport, in order not to lose packets during an upgrade.
|
|
111
|
+
*
|
|
112
|
+
* @param onPause
|
|
113
|
+
*/
|
|
114
|
+
pause(onPause) {
|
|
115
|
+
}
|
|
116
|
+
createUri(schema, query = {}) {
|
|
117
|
+
return schema + "://" + this._hostname() + this._port() + this.opts.path + this._query(query);
|
|
118
|
+
}
|
|
119
|
+
_hostname() {
|
|
120
|
+
const hostname = this.opts.hostname;
|
|
121
|
+
return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
|
|
122
|
+
}
|
|
123
|
+
_port() {
|
|
124
|
+
if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
|
|
125
|
+
return ":" + this.opts.port;
|
|
126
|
+
} else {
|
|
127
|
+
return "";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
_query(query) {
|
|
131
|
+
const encodedQuery = encode(query);
|
|
132
|
+
return encodedQuery.length ? "?" + encodedQuery : "";
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
Transport,
|
|
137
|
+
TransportError
|
|
138
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var pollingXhr = require("./polling-xhr.cjs");
|
|
3
|
+
var websocket = require("./websocket.cjs");
|
|
4
|
+
var webtransport = require("./webtransport.cjs");
|
|
5
|
+
const transports = {
|
|
6
|
+
websocket: websocket.WS,
|
|
7
|
+
webtransport: webtransport.WT,
|
|
8
|
+
polling: pollingXhr.XHR
|
|
9
|
+
};
|
|
10
|
+
exports.transports = transports;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var polling = require("./polling.cjs");
|
|
3
|
+
var index = require("../../../../@socket.io/component-emitter/lib/esm/index.cjs");
|
|
4
|
+
var util = require("../util.cjs");
|
|
5
|
+
var globals = require("../globals.cjs");
|
|
6
|
+
var hasCors = require("../contrib/has-cors.cjs");
|
|
7
|
+
function empty() {
|
|
8
|
+
}
|
|
9
|
+
class BaseXHR extends polling.Polling {
|
|
10
|
+
/**
|
|
11
|
+
* XHR Polling constructor.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} opts
|
|
14
|
+
* @package
|
|
15
|
+
*/
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
super(opts);
|
|
18
|
+
if (typeof location !== "undefined") {
|
|
19
|
+
const isSSL = "https:" === location.protocol;
|
|
20
|
+
let port = location.port;
|
|
21
|
+
if (!port) {
|
|
22
|
+
port = isSSL ? "443" : "80";
|
|
23
|
+
}
|
|
24
|
+
this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Sends data.
|
|
29
|
+
*
|
|
30
|
+
* @param {String} data to send.
|
|
31
|
+
* @param {Function} called upon flush.
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
doWrite(data, fn) {
|
|
35
|
+
const req = this.request({
|
|
36
|
+
method: "POST",
|
|
37
|
+
data
|
|
38
|
+
});
|
|
39
|
+
req.on("success", fn);
|
|
40
|
+
req.on("error", (xhrStatus, context) => {
|
|
41
|
+
this.onError("xhr post error", xhrStatus, context);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Starts a poll cycle.
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
doPoll() {
|
|
50
|
+
const req = this.request();
|
|
51
|
+
req.on("data", this.onData.bind(this));
|
|
52
|
+
req.on("error", (xhrStatus, context) => {
|
|
53
|
+
this.onError("xhr poll error", xhrStatus, context);
|
|
54
|
+
});
|
|
55
|
+
this.pollXhr = req;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class Request extends index.Emitter {
|
|
59
|
+
/**
|
|
60
|
+
* Request constructor
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} options
|
|
63
|
+
* @package
|
|
64
|
+
*/
|
|
65
|
+
constructor(createRequest, uri, opts) {
|
|
66
|
+
super();
|
|
67
|
+
this.createRequest = createRequest;
|
|
68
|
+
util.installTimerFunctions(this, opts);
|
|
69
|
+
this._opts = opts;
|
|
70
|
+
this._method = opts.method || "GET";
|
|
71
|
+
this._uri = uri;
|
|
72
|
+
this._data = void 0 !== opts.data ? opts.data : null;
|
|
73
|
+
this._create();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Creates the XHR object and sends the request.
|
|
77
|
+
*
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
_create() {
|
|
81
|
+
var _a;
|
|
82
|
+
const opts = util.pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
83
|
+
opts.xdomain = !!this._opts.xd;
|
|
84
|
+
const xhr = this._xhr = this.createRequest(opts);
|
|
85
|
+
try {
|
|
86
|
+
xhr.open(this._method, this._uri, true);
|
|
87
|
+
try {
|
|
88
|
+
if (this._opts.extraHeaders) {
|
|
89
|
+
xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
|
|
90
|
+
for (let i in this._opts.extraHeaders) {
|
|
91
|
+
if (this._opts.extraHeaders.hasOwnProperty(i)) {
|
|
92
|
+
xhr.setRequestHeader(i, this._opts.extraHeaders[i]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {
|
|
97
|
+
}
|
|
98
|
+
if ("POST" === this._method) {
|
|
99
|
+
try {
|
|
100
|
+
xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
|
|
101
|
+
} catch (e) {
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
xhr.setRequestHeader("Accept", "*/*");
|
|
106
|
+
} catch (e) {
|
|
107
|
+
}
|
|
108
|
+
(_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);
|
|
109
|
+
if ("withCredentials" in xhr) {
|
|
110
|
+
xhr.withCredentials = this._opts.withCredentials;
|
|
111
|
+
}
|
|
112
|
+
if (this._opts.requestTimeout) {
|
|
113
|
+
xhr.timeout = this._opts.requestTimeout;
|
|
114
|
+
}
|
|
115
|
+
xhr.onreadystatechange = () => {
|
|
116
|
+
var _a2;
|
|
117
|
+
if (xhr.readyState === 3) {
|
|
118
|
+
(_a2 = this._opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.parseCookies(
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
xhr.getResponseHeader("set-cookie")
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
if (4 !== xhr.readyState)
|
|
124
|
+
return;
|
|
125
|
+
if (200 === xhr.status || 1223 === xhr.status) {
|
|
126
|
+
this._onLoad();
|
|
127
|
+
} else {
|
|
128
|
+
this.setTimeoutFn(() => {
|
|
129
|
+
this._onError(typeof xhr.status === "number" ? xhr.status : 0);
|
|
130
|
+
}, 0);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
xhr.send(this._data);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
this.setTimeoutFn(() => {
|
|
136
|
+
this._onError(e);
|
|
137
|
+
}, 0);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (typeof document !== "undefined") {
|
|
141
|
+
this._index = Request.requestsCount++;
|
|
142
|
+
Request.requests[this._index] = this;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Called upon error.
|
|
147
|
+
*
|
|
148
|
+
* @private
|
|
149
|
+
*/
|
|
150
|
+
_onError(err) {
|
|
151
|
+
this.emitReserved("error", err, this._xhr);
|
|
152
|
+
this._cleanup(true);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Cleans up house.
|
|
156
|
+
*
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
_cleanup(fromError) {
|
|
160
|
+
if ("undefined" === typeof this._xhr || null === this._xhr) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this._xhr.onreadystatechange = empty;
|
|
164
|
+
if (fromError) {
|
|
165
|
+
try {
|
|
166
|
+
this._xhr.abort();
|
|
167
|
+
} catch (e) {
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (typeof document !== "undefined") {
|
|
171
|
+
delete Request.requests[this._index];
|
|
172
|
+
}
|
|
173
|
+
this._xhr = null;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Called upon load.
|
|
177
|
+
*
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
_onLoad() {
|
|
181
|
+
const data = this._xhr.responseText;
|
|
182
|
+
if (data !== null) {
|
|
183
|
+
this.emitReserved("data", data);
|
|
184
|
+
this.emitReserved("success");
|
|
185
|
+
this._cleanup();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Aborts the request.
|
|
190
|
+
*
|
|
191
|
+
* @package
|
|
192
|
+
*/
|
|
193
|
+
abort() {
|
|
194
|
+
this._cleanup();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
Request.requestsCount = 0;
|
|
198
|
+
Request.requests = {};
|
|
199
|
+
if (typeof document !== "undefined") {
|
|
200
|
+
if (typeof attachEvent === "function") {
|
|
201
|
+
attachEvent("onunload", unloadHandler);
|
|
202
|
+
} else if (typeof addEventListener === "function") {
|
|
203
|
+
const terminationEvent = "onpagehide" in globals.globalThisShim ? "pagehide" : "unload";
|
|
204
|
+
addEventListener(terminationEvent, unloadHandler, false);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function unloadHandler() {
|
|
208
|
+
for (let i in Request.requests) {
|
|
209
|
+
if (Request.requests.hasOwnProperty(i)) {
|
|
210
|
+
Request.requests[i].abort();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const hasXHR2 = function() {
|
|
215
|
+
const xhr = newRequest({
|
|
216
|
+
xdomain: false
|
|
217
|
+
});
|
|
218
|
+
return xhr && xhr.responseType !== null;
|
|
219
|
+
}();
|
|
220
|
+
class XHR extends BaseXHR {
|
|
221
|
+
constructor(opts) {
|
|
222
|
+
super(opts);
|
|
223
|
+
const forceBase64 = opts && opts.forceBase64;
|
|
224
|
+
this.supportsBinary = hasXHR2 && !forceBase64;
|
|
225
|
+
}
|
|
226
|
+
request(opts = {}) {
|
|
227
|
+
Object.assign(opts, { xd: this.xd }, this.opts);
|
|
228
|
+
return new Request(newRequest, this.uri(), opts);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function newRequest(opts) {
|
|
232
|
+
const xdomain = opts.xdomain;
|
|
233
|
+
try {
|
|
234
|
+
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCors.hasCORS)) {
|
|
235
|
+
return new XMLHttpRequest();
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
}
|
|
239
|
+
if (!xdomain) {
|
|
240
|
+
try {
|
|
241
|
+
return new globals.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
|
|
242
|
+
} catch (e) {
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.BaseXHR = BaseXHR;
|
|
247
|
+
exports.Request = Request;
|
|
248
|
+
exports.XHR = XHR;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Polling } from "./polling.js";
|
|
2
|
+
import { Emitter } from "../../../../@socket.io/component-emitter/lib/esm/index.js";
|
|
3
|
+
import { installTimerFunctions, pick } from "../util.js";
|
|
4
|
+
import { globalThisShim } from "../globals.js";
|
|
5
|
+
import { hasCORS } from "../contrib/has-cors.js";
|
|
6
|
+
function empty() {
|
|
7
|
+
}
|
|
8
|
+
class BaseXHR extends Polling {
|
|
9
|
+
/**
|
|
10
|
+
* XHR Polling constructor.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} opts
|
|
13
|
+
* @package
|
|
14
|
+
*/
|
|
15
|
+
constructor(opts) {
|
|
16
|
+
super(opts);
|
|
17
|
+
if (typeof location !== "undefined") {
|
|
18
|
+
const isSSL = "https:" === location.protocol;
|
|
19
|
+
let port = location.port;
|
|
20
|
+
if (!port) {
|
|
21
|
+
port = isSSL ? "443" : "80";
|
|
22
|
+
}
|
|
23
|
+
this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sends data.
|
|
28
|
+
*
|
|
29
|
+
* @param {String} data to send.
|
|
30
|
+
* @param {Function} called upon flush.
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
doWrite(data, fn) {
|
|
34
|
+
const req = this.request({
|
|
35
|
+
method: "POST",
|
|
36
|
+
data
|
|
37
|
+
});
|
|
38
|
+
req.on("success", fn);
|
|
39
|
+
req.on("error", (xhrStatus, context) => {
|
|
40
|
+
this.onError("xhr post error", xhrStatus, context);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Starts a poll cycle.
|
|
45
|
+
*
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
doPoll() {
|
|
49
|
+
const req = this.request();
|
|
50
|
+
req.on("data", this.onData.bind(this));
|
|
51
|
+
req.on("error", (xhrStatus, context) => {
|
|
52
|
+
this.onError("xhr poll error", xhrStatus, context);
|
|
53
|
+
});
|
|
54
|
+
this.pollXhr = req;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class Request extends Emitter {
|
|
58
|
+
/**
|
|
59
|
+
* Request constructor
|
|
60
|
+
*
|
|
61
|
+
* @param {Object} options
|
|
62
|
+
* @package
|
|
63
|
+
*/
|
|
64
|
+
constructor(createRequest, uri, opts) {
|
|
65
|
+
super();
|
|
66
|
+
this.createRequest = createRequest;
|
|
67
|
+
installTimerFunctions(this, opts);
|
|
68
|
+
this._opts = opts;
|
|
69
|
+
this._method = opts.method || "GET";
|
|
70
|
+
this._uri = uri;
|
|
71
|
+
this._data = void 0 !== opts.data ? opts.data : null;
|
|
72
|
+
this._create();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates the XHR object and sends the request.
|
|
76
|
+
*
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
_create() {
|
|
80
|
+
var _a;
|
|
81
|
+
const opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
82
|
+
opts.xdomain = !!this._opts.xd;
|
|
83
|
+
const xhr = this._xhr = this.createRequest(opts);
|
|
84
|
+
try {
|
|
85
|
+
xhr.open(this._method, this._uri, true);
|
|
86
|
+
try {
|
|
87
|
+
if (this._opts.extraHeaders) {
|
|
88
|
+
xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
|
|
89
|
+
for (let i in this._opts.extraHeaders) {
|
|
90
|
+
if (this._opts.extraHeaders.hasOwnProperty(i)) {
|
|
91
|
+
xhr.setRequestHeader(i, this._opts.extraHeaders[i]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} catch (e) {
|
|
96
|
+
}
|
|
97
|
+
if ("POST" === this._method) {
|
|
98
|
+
try {
|
|
99
|
+
xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
|
|
100
|
+
} catch (e) {
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
xhr.setRequestHeader("Accept", "*/*");
|
|
105
|
+
} catch (e) {
|
|
106
|
+
}
|
|
107
|
+
(_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);
|
|
108
|
+
if ("withCredentials" in xhr) {
|
|
109
|
+
xhr.withCredentials = this._opts.withCredentials;
|
|
110
|
+
}
|
|
111
|
+
if (this._opts.requestTimeout) {
|
|
112
|
+
xhr.timeout = this._opts.requestTimeout;
|
|
113
|
+
}
|
|
114
|
+
xhr.onreadystatechange = () => {
|
|
115
|
+
var _a2;
|
|
116
|
+
if (xhr.readyState === 3) {
|
|
117
|
+
(_a2 = this._opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.parseCookies(
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
xhr.getResponseHeader("set-cookie")
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
if (4 !== xhr.readyState)
|
|
123
|
+
return;
|
|
124
|
+
if (200 === xhr.status || 1223 === xhr.status) {
|
|
125
|
+
this._onLoad();
|
|
126
|
+
} else {
|
|
127
|
+
this.setTimeoutFn(() => {
|
|
128
|
+
this._onError(typeof xhr.status === "number" ? xhr.status : 0);
|
|
129
|
+
}, 0);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
xhr.send(this._data);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
this.setTimeoutFn(() => {
|
|
135
|
+
this._onError(e);
|
|
136
|
+
}, 0);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (typeof document !== "undefined") {
|
|
140
|
+
this._index = Request.requestsCount++;
|
|
141
|
+
Request.requests[this._index] = this;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Called upon error.
|
|
146
|
+
*
|
|
147
|
+
* @private
|
|
148
|
+
*/
|
|
149
|
+
_onError(err) {
|
|
150
|
+
this.emitReserved("error", err, this._xhr);
|
|
151
|
+
this._cleanup(true);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Cleans up house.
|
|
155
|
+
*
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
_cleanup(fromError) {
|
|
159
|
+
if ("undefined" === typeof this._xhr || null === this._xhr) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this._xhr.onreadystatechange = empty;
|
|
163
|
+
if (fromError) {
|
|
164
|
+
try {
|
|
165
|
+
this._xhr.abort();
|
|
166
|
+
} catch (e) {
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (typeof document !== "undefined") {
|
|
170
|
+
delete Request.requests[this._index];
|
|
171
|
+
}
|
|
172
|
+
this._xhr = null;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Called upon load.
|
|
176
|
+
*
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
_onLoad() {
|
|
180
|
+
const data = this._xhr.responseText;
|
|
181
|
+
if (data !== null) {
|
|
182
|
+
this.emitReserved("data", data);
|
|
183
|
+
this.emitReserved("success");
|
|
184
|
+
this._cleanup();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Aborts the request.
|
|
189
|
+
*
|
|
190
|
+
* @package
|
|
191
|
+
*/
|
|
192
|
+
abort() {
|
|
193
|
+
this._cleanup();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
Request.requestsCount = 0;
|
|
197
|
+
Request.requests = {};
|
|
198
|
+
if (typeof document !== "undefined") {
|
|
199
|
+
if (typeof attachEvent === "function") {
|
|
200
|
+
attachEvent("onunload", unloadHandler);
|
|
201
|
+
} else if (typeof addEventListener === "function") {
|
|
202
|
+
const terminationEvent = "onpagehide" in globalThisShim ? "pagehide" : "unload";
|
|
203
|
+
addEventListener(terminationEvent, unloadHandler, false);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function unloadHandler() {
|
|
207
|
+
for (let i in Request.requests) {
|
|
208
|
+
if (Request.requests.hasOwnProperty(i)) {
|
|
209
|
+
Request.requests[i].abort();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const hasXHR2 = function() {
|
|
214
|
+
const xhr = newRequest({
|
|
215
|
+
xdomain: false
|
|
216
|
+
});
|
|
217
|
+
return xhr && xhr.responseType !== null;
|
|
218
|
+
}();
|
|
219
|
+
class XHR extends BaseXHR {
|
|
220
|
+
constructor(opts) {
|
|
221
|
+
super(opts);
|
|
222
|
+
const forceBase64 = opts && opts.forceBase64;
|
|
223
|
+
this.supportsBinary = hasXHR2 && !forceBase64;
|
|
224
|
+
}
|
|
225
|
+
request(opts = {}) {
|
|
226
|
+
Object.assign(opts, { xd: this.xd }, this.opts);
|
|
227
|
+
return new Request(newRequest, this.uri(), opts);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function newRequest(opts) {
|
|
231
|
+
const xdomain = opts.xdomain;
|
|
232
|
+
try {
|
|
233
|
+
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
|
234
|
+
return new XMLHttpRequest();
|
|
235
|
+
}
|
|
236
|
+
} catch (e) {
|
|
237
|
+
}
|
|
238
|
+
if (!xdomain) {
|
|
239
|
+
try {
|
|
240
|
+
return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
|
|
241
|
+
} catch (e) {
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export {
|
|
246
|
+
BaseXHR,
|
|
247
|
+
Request,
|
|
248
|
+
XHR
|
|
249
|
+
};
|