ingeniuscliq-core 0.4.19 → 0.4.21
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/components/common/carousel/CustomCarousel.d.ts +1 -1
- package/dist/components/common/carousel/CustomCarousel.d.ts.map +1 -1
- package/dist/components/common/carousel/CustomCarouselSection.d.ts +1 -1
- package/dist/components/common/carousel/CustomCarouselSection.d.ts.map +1 -1
- package/dist/components/common/form/FormCheckbox.d.ts +1 -1
- package/dist/components/common/form/FormCheckbox.d.ts.map +1 -1
- package/dist/components/common/form/FormInput.d.ts +1 -1
- package/dist/components/common/form/FormInput.d.ts.map +1 -1
- package/dist/components/common/form/FormSelect.d.ts +1 -1
- package/dist/components/common/form/FormSelect.d.ts.map +1 -1
- package/dist/components/common/form/FormTextArea.d.ts +1 -1
- package/dist/components/common/form/FormTextArea.d.ts.map +1 -1
- package/dist/components/common/form/FormWrapper.d.ts +1 -1
- package/dist/components/common/form/FormWrapper.d.ts.map +1 -1
- package/dist/components/common/logo/Logo.d.ts +1 -1
- package/dist/components/common/logo/Logo.d.ts.map +1 -1
- package/dist/components/common/pagination/CustomPagination.d.ts +1 -1
- package/dist/components/common/pagination/CustomPagination.d.ts.map +1 -1
- package/dist/components/common/select/CustomSelect.d.ts +1 -1
- package/dist/components/common/select/CustomSelect.d.ts.map +1 -1
- package/dist/components/common/spinner/Spinner.d.ts +1 -1
- package/dist/components/common/spinner/Spinner.d.ts.map +1 -1
- package/dist/components/common/stepper/Stepper.d.ts +1 -1
- package/dist/components/common/stepper/Stepper.d.ts.map +1 -1
- package/dist/components/common/stepper/Stepper.tsx +1 -1
- package/dist/components/layouts/CoreBaseLayout.d.ts +1 -1
- package/dist/components/layouts/CoreBaseLayout.d.ts.map +1 -1
- package/dist/components/templates/CoreHomeLayout.d.ts +1 -1
- package/dist/components/templates/CoreHomeLayout.d.ts.map +1 -1
- package/dist/components/templates/CorePreviewLayout.d.ts +1 -1
- package/dist/components/templates/CorePreviewLayout.d.ts.map +1 -1
- package/dist/components/ui/accordion.tsx +9 -9
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog.tsx +16 -16
- package/dist/components/ui/alert.d.ts +3 -3
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.tsx +1 -1
- package/dist/components/ui/avatar.tsx +7 -7
- package/dist/components/ui/badge.d.ts +4 -4
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.tsx +1 -1
- package/dist/components/ui/breadcrumb.d.ts +2 -2
- package/dist/components/ui/breadcrumb.tsx +3 -4
- package/dist/components/ui/button.d.ts +4 -4
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.tsx +2 -2
- package/dist/components/ui/carousel.tsx +2 -3
- package/dist/components/ui/checkbox.tsx +5 -5
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/dialog.tsx +15 -15
- package/dist/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.tsx +27 -29
- package/dist/components/ui/form.d.ts +1 -1
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.tsx +2 -2
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.tsx +4 -4
- package/dist/components/ui/pagination.d.ts +5 -5
- package/dist/components/ui/pagination.tsx +2 -4
- package/dist/components/ui/popover.tsx +7 -7
- package/dist/components/ui/radio-group.tsx +7 -7
- package/dist/components/ui/select.tsx +25 -27
- package/dist/components/ui/separator.tsx +3 -3
- package/dist/components/ui/sheet.d.ts +5 -5
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.tsx +16 -16
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.tsx +6 -6
- package/dist/components/ui/stepper.tsx +4 -4
- package/dist/components/ui/switch.tsx +4 -4
- package/dist/components/ui/tabs.tsx +9 -9
- package/dist/components/ui/tooltip.tsx +6 -6
- package/dist/helpers/axiosGlobal.js +1 -2
- package/dist/hooks/useLanguage.js +2 -5
- package/dist/hooks/useNotification.js +1 -1
- package/dist/i18n/config.js +1 -5
- package/dist/lib/utils.js +1 -1
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts +2 -2
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
- package/dist/modules/CoreAuth/context/AuthContext.d.ts +2 -2
- package/dist/modules/CoreAuth/context/AuthContext.d.ts.map +1 -1
- package/dist/modules/CoreAuth/hooks/useAuth.d.ts +3 -3
- package/dist/modules/CoreAuth/index.js +1 -0
- package/dist/modules/CoreAuth/stores/authStore.d.ts +2 -2
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +8 -8
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts.map +1 -1
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +30 -16
- package/dist/modules/CoreCustomization/index.js +1 -0
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts.map +1 -1
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +15 -8
- package/dist/modules/CoreOrder/index.js +1 -0
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +2 -2
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts.map +1 -1
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +15 -8
- package/dist/modules/CorePayForm/index.js +1 -0
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +8 -8
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts.map +1 -1
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +34 -13
- package/dist/modules/CoreProduct/index.js +1 -0
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +6 -6
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +34 -13
- package/dist/modules/CoreShipment/index.js +1 -0
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +4 -4
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +12 -5
- package/package.json +21 -13
- package/src/commands/common/constants.js +10 -0
- package/src/commands/helpers/index.js +15 -0
- package/src/commands/helpers/strings.js +4 -0
- package/src/commands/templates/locale.js +14 -0
- package/src/commands/templates/service.js +12 -0
- package/src/commands/templates/type.js +10 -0
- package/README.md +0 -417
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
- package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
- package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
- package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
- package/dist/node_modules/axios/index.js +0 -25
- package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
- package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
- package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
- package/dist/node_modules/axios/lib/axios.js +0 -86
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
- package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/dist/node_modules/axios/lib/core/Axios.js +0 -238
- package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
- package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
- package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
- package/dist/node_modules/axios/lib/core/settle.js +0 -27
- package/dist/node_modules/axios/lib/core/transformData.js +0 -28
- package/dist/node_modules/axios/lib/defaults/index.js +0 -159
- package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
- package/dist/node_modules/axios/lib/env/data.js +0 -3
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
- package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
- package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
- package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
- package/dist/node_modules/axios/lib/helpers/null.js +0 -4
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
- package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
- package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
- package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
- package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
- package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
- package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
- package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
- package/dist/node_modules/axios/lib/platform/index.js +0 -9
- package/dist/node_modules/axios/lib/utils.js +0 -780
- package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
- package/dist/node_modules/clsx/dist/clsx.js +0 -3
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
- package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
- package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
- package/dist/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -210
- package/dist/node_modules/react-i18next/dist/es/context.js +0 -18
- package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -7
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -12
- package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -27
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -157
- package/dist/node_modules/react-i18next/dist/es/utils.js +0 -63
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
- package/dist/node_modules/sonner/dist/index.js +0 -299
- package/dist/node_modules/tslib/tslib.es6.js +0 -56
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
- package/dist/node_modules/zustand/esm/react.js +0 -22
- package/dist/node_modules/zustand/esm/vanilla.js +0 -24
- /package/src/{core/commands → commands}/create-core-module.js +0 -0
- /package/src/{core/commands → commands}/create-module.js +0 -0
- /package/src/{core/commands → commands}/create-template.js +0 -0
- /package/src/{core/commands → commands}/rollback-core-module.js +0 -0
- /package/src/{core/commands → commands}/rollback-module.js +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// src/visually-hidden.tsx
|
|
6
|
-
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
7
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
8
|
-
position: "absolute",
|
|
9
|
-
border: 0,
|
|
10
|
-
width: 1,
|
|
11
|
-
height: 1,
|
|
12
|
-
padding: 0,
|
|
13
|
-
margin: -1,
|
|
14
|
-
overflow: "hidden",
|
|
15
|
-
clip: "rect(0, 0, 0, 0)",
|
|
16
|
-
whiteSpace: "nowrap",
|
|
17
|
-
wordWrap: "normal"
|
|
18
|
-
});
|
|
19
|
-
var NAME = "VisuallyHidden";
|
|
20
|
-
var VisuallyHidden = React.forwardRef(
|
|
21
|
-
(props, forwardedRef) => {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
Primitive.span,
|
|
24
|
-
{
|
|
25
|
-
...props,
|
|
26
|
-
ref: forwardedRef,
|
|
27
|
-
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
VisuallyHidden.displayName = NAME;
|
|
33
|
-
var Root = VisuallyHidden;
|
|
34
|
-
|
|
35
|
-
export { Root, VISUALLY_HIDDEN_STYLES, VisuallyHidden };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
function e(...e){return {getAll:()=>e,get:n=>e.find(e=>e.id===n),getIndex:n=>e.findIndex(e=>e.id===n),getByIndex:n=>e[n],getFirst:()=>e[0],getLast:()=>e[e.length-1],getNext:n=>e[e.findIndex(e=>e.id===n)+1],getPrev:n=>e[e.findIndex(e=>e.id===n)-1],getNeighbors(n){const t=e.findIndex(e=>e.id===n);return {prev:t>0?e[t-1]:null,next:t<e.length-1?e[t+1]:null}}}}function n(e,n){return Math.max(e.findIndex(e=>e.id===n),0)}function t(e,n){return e.reduce((e,t)=>(e[t.id]=n?.[t.id]??null,e),{})}function r(e,n,t){return {switch(e){const t=e[n.id];return t?.(n)},when(n,r,i){const d=e[t];return (Array.isArray(n)?d.id===n[0]&&n.slice(1).every(Boolean):d.id===n)?r?.(d):i?.(d)},match(n,t){const r=e.find(e=>e.id===n);if(!r)return null;const i=t[n];return i?.(r)??null}}}async function i(e,n){const t=await e();return !n||false!==t}var d=async({stepper:e,direction:n,callback:t,before:r,targetId:d})=>{(!r||await i(t,true))&&("next"===n?e.next():"prev"===n?e.prev():"goTo"===n&&d&&e.goTo(d),r||await i(t,false));},o=(e,n,t)=>{n<0&&s({steps:e,newIndex:n,direction:"next",reason:"it is the first step"}),n>=e.length&&s({steps:e,newIndex:n,direction:"prev",reason:"it is the last step"}),t(n);},s=({steps:e,newIndex:n,direction:t,reason:r})=>{const i=e[n]?.id??`index ${n}`;throw new Error(`Cannot navigate ${t} from step "${i}": ${r}`)};
|
|
2
|
-
|
|
3
|
-
export { d as executeTransition, r as generateCommonStepperUseFns, e as generateStepperUtils, t as getInitialMetadata, n as getInitialStepIndex, o as updateStepIndex };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { generateStepperUtils as e, getInitialStepIndex as n, getInitialMetadata as t, generateCommonStepperUseFns as r, executeTransition as d, updateStepIndex as o } from '../../core/dist/index.js';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
var s=(...s)=>{const c=React.createContext(null),p=e(...s),l=e=>{const{initialStep:c,initialMetadata:p}=e??{},l=React.useMemo(()=>n(s,c),[c]),[d$1,f]=React.useState(l),[b,u]=React.useState(()=>t(s,p)),v=React.useMemo(()=>{const e=s[d$1],n$1=d$1===s.length-1;return {all:s,current:e,isLast:n$1,isFirst:0===d$1,metadata:b,setMetadata(e,t){u(a=>a[e]===t?a:{...a,[e]:t});},getMetadata:e=>b[e],resetMetadata(e){u(t(s,e?p:void 0));},next(){o(s,d$1+1,e=>{f(e);});},prev(){o(s,d$1-1,e=>{f(e);});},get:e=>s.find(t=>t.id===e),goTo(e){const t=s.findIndex(t=>t.id===e);if(-1===t)throw new Error(`Step with id "${e}" not found.`);o(s,t,e=>{f(e);});},reset(){o(s,n(s,c),e=>{f(e);});},async beforeNext(e){await d({stepper:v,direction:"next",callback:e,before:true});},async afterNext(e){this.next(),await d({stepper:v,direction:"next",callback:e,before:false});},async beforePrev(e){await d({stepper:v,direction:"prev",callback:e,before:true});},async afterPrev(e){this.prev(),await d({stepper:v,direction:"prev",callback:e,before:false});},async beforeGoTo(e,t){await d({stepper:v,direction:"goTo",callback:t,before:true,targetId:e});},async afterGoTo(e,t){this.goTo(e),await d({stepper:v,direction:"goTo",callback:t,before:false,targetId:e});},...r(s,e,d$1)}},[d$1,b]);return v};return {steps:s,utils:p,Scoped:({initialStep:e,initialMetadata:t,children:a})=>React.createElement(c.Provider,{value:l({initialStep:e,initialMetadata:t})},a),useStepper:(e={})=>React.useContext(c)??l(e)}};
|
|
5
|
-
|
|
6
|
-
export { s as defineStepper };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
var getDefaultParent = function (originalTarget) {
|
|
2
|
-
if (typeof document === 'undefined') {
|
|
3
|
-
return null;
|
|
4
|
-
}
|
|
5
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
6
|
-
return sampleTarget.ownerDocument.body;
|
|
7
|
-
};
|
|
8
|
-
var counterMap = new WeakMap();
|
|
9
|
-
var uncontrolledNodes = new WeakMap();
|
|
10
|
-
var markerMap = {};
|
|
11
|
-
var lockCount = 0;
|
|
12
|
-
var unwrapHost = function (node) {
|
|
13
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
14
|
-
};
|
|
15
|
-
var correctTargets = function (parent, targets) {
|
|
16
|
-
return targets
|
|
17
|
-
.map(function (target) {
|
|
18
|
-
if (parent.contains(target)) {
|
|
19
|
-
return target;
|
|
20
|
-
}
|
|
21
|
-
var correctedTarget = unwrapHost(target);
|
|
22
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
23
|
-
return correctedTarget;
|
|
24
|
-
}
|
|
25
|
-
console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
|
|
26
|
-
return null;
|
|
27
|
-
})
|
|
28
|
-
.filter(function (x) { return Boolean(x); });
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
32
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
33
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
34
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
35
|
-
* @param {String} [controlAttribute] - html Attribute to control
|
|
36
|
-
* @return {Undo} undo command
|
|
37
|
-
*/
|
|
38
|
-
var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
|
|
39
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
40
|
-
if (!markerMap[markerName]) {
|
|
41
|
-
markerMap[markerName] = new WeakMap();
|
|
42
|
-
}
|
|
43
|
-
var markerCounter = markerMap[markerName];
|
|
44
|
-
var hiddenNodes = [];
|
|
45
|
-
var elementsToKeep = new Set();
|
|
46
|
-
var elementsToStop = new Set(targets);
|
|
47
|
-
var keep = function (el) {
|
|
48
|
-
if (!el || elementsToKeep.has(el)) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
elementsToKeep.add(el);
|
|
52
|
-
keep(el.parentNode);
|
|
53
|
-
};
|
|
54
|
-
targets.forEach(keep);
|
|
55
|
-
var deep = function (parent) {
|
|
56
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
Array.prototype.forEach.call(parent.children, function (node) {
|
|
60
|
-
if (elementsToKeep.has(node)) {
|
|
61
|
-
deep(node);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
try {
|
|
65
|
-
var attr = node.getAttribute(controlAttribute);
|
|
66
|
-
var alreadyHidden = attr !== null && attr !== 'false';
|
|
67
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
68
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
69
|
-
counterMap.set(node, counterValue);
|
|
70
|
-
markerCounter.set(node, markerValue);
|
|
71
|
-
hiddenNodes.push(node);
|
|
72
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
73
|
-
uncontrolledNodes.set(node, true);
|
|
74
|
-
}
|
|
75
|
-
if (markerValue === 1) {
|
|
76
|
-
node.setAttribute(markerName, 'true');
|
|
77
|
-
}
|
|
78
|
-
if (!alreadyHidden) {
|
|
79
|
-
node.setAttribute(controlAttribute, 'true');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
console.error('aria-hidden: cannot operate on ', node, e);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
deep(parentNode);
|
|
89
|
-
elementsToKeep.clear();
|
|
90
|
-
lockCount++;
|
|
91
|
-
return function () {
|
|
92
|
-
hiddenNodes.forEach(function (node) {
|
|
93
|
-
var counterValue = counterMap.get(node) - 1;
|
|
94
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
95
|
-
counterMap.set(node, counterValue);
|
|
96
|
-
markerCounter.set(node, markerValue);
|
|
97
|
-
if (!counterValue) {
|
|
98
|
-
if (!uncontrolledNodes.has(node)) {
|
|
99
|
-
node.removeAttribute(controlAttribute);
|
|
100
|
-
}
|
|
101
|
-
uncontrolledNodes.delete(node);
|
|
102
|
-
}
|
|
103
|
-
if (!markerValue) {
|
|
104
|
-
node.removeAttribute(markerName);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
lockCount--;
|
|
108
|
-
if (!lockCount) {
|
|
109
|
-
// clear
|
|
110
|
-
counterMap = new WeakMap();
|
|
111
|
-
counterMap = new WeakMap();
|
|
112
|
-
uncontrolledNodes = new WeakMap();
|
|
113
|
-
markerMap = {};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
119
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
120
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
121
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
122
|
-
* @return {Undo} undo command
|
|
123
|
-
*/
|
|
124
|
-
var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
125
|
-
if (markerName === void 0) { markerName = 'data-aria-hidden'; }
|
|
126
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
127
|
-
var activeParentNode = getDefaultParent(originalTarget);
|
|
128
|
-
if (!activeParentNode) {
|
|
129
|
-
return function () { return null; };
|
|
130
|
-
}
|
|
131
|
-
// we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10
|
|
132
|
-
// and script elements, as they have no impact on accessibility.
|
|
133
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script')));
|
|
134
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export { hideOthers };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import axios from './lib/axios.js';
|
|
2
|
-
|
|
3
|
-
// This module is intended to unwrap Axios default export as named.
|
|
4
|
-
// Keep top-level export same with static properties
|
|
5
|
-
// so that it can keep same with es module or cjs
|
|
6
|
-
const {
|
|
7
|
-
Axios,
|
|
8
|
-
AxiosError,
|
|
9
|
-
CanceledError,
|
|
10
|
-
isCancel,
|
|
11
|
-
CancelToken,
|
|
12
|
-
VERSION,
|
|
13
|
-
all,
|
|
14
|
-
Cancel,
|
|
15
|
-
isAxiosError,
|
|
16
|
-
spread,
|
|
17
|
-
toFormData,
|
|
18
|
-
AxiosHeaders,
|
|
19
|
-
HttpStatusCode,
|
|
20
|
-
formToJSON,
|
|
21
|
-
getAdapter,
|
|
22
|
-
mergeConfig
|
|
23
|
-
} = axios;
|
|
24
|
-
|
|
25
|
-
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import utils from '../utils.js';
|
|
2
|
-
import httpAdapter from '../helpers/null.js';
|
|
3
|
-
import xhrAdapter from './xhr.js';
|
|
4
|
-
import fetchAdapter from './fetch.js';
|
|
5
|
-
import AxiosError from '../core/AxiosError.js';
|
|
6
|
-
|
|
7
|
-
const knownAdapters = {
|
|
8
|
-
http: httpAdapter,
|
|
9
|
-
xhr: xhrAdapter,
|
|
10
|
-
fetch: fetchAdapter
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
|
14
|
-
if (fn) {
|
|
15
|
-
try {
|
|
16
|
-
Object.defineProperty(fn, 'name', {value});
|
|
17
|
-
} catch (e) {
|
|
18
|
-
// eslint-disable-next-line no-empty
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(fn, 'adapterName', {value});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const renderReason = (reason) => `- ${reason}`;
|
|
25
|
-
|
|
26
|
-
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
|
27
|
-
|
|
28
|
-
const adapters = {
|
|
29
|
-
getAdapter: (adapters) => {
|
|
30
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
|
31
|
-
|
|
32
|
-
const {length} = adapters;
|
|
33
|
-
let nameOrAdapter;
|
|
34
|
-
let adapter;
|
|
35
|
-
|
|
36
|
-
const rejectedReasons = {};
|
|
37
|
-
|
|
38
|
-
for (let i = 0; i < length; i++) {
|
|
39
|
-
nameOrAdapter = adapters[i];
|
|
40
|
-
let id;
|
|
41
|
-
|
|
42
|
-
adapter = nameOrAdapter;
|
|
43
|
-
|
|
44
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
45
|
-
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
46
|
-
|
|
47
|
-
if (adapter === undefined) {
|
|
48
|
-
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (adapter) {
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
rejectedReasons[id || '#' + i] = adapter;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (!adapter) {
|
|
60
|
-
|
|
61
|
-
const reasons = Object.entries(rejectedReasons)
|
|
62
|
-
.map(([id, state]) => `adapter ${id} ` +
|
|
63
|
-
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
let s = length ?
|
|
67
|
-
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
|
|
68
|
-
'as no adapter specified';
|
|
69
|
-
|
|
70
|
-
throw new AxiosError(
|
|
71
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
72
|
-
'ERR_NOT_SUPPORT'
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return adapter;
|
|
77
|
-
},
|
|
78
|
-
adapters: knownAdapters
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { adapters as default };
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import platform from '../platform/index.js';
|
|
2
|
-
import utils from '../utils.js';
|
|
3
|
-
import AxiosError from '../core/AxiosError.js';
|
|
4
|
-
import composeSignals from '../helpers/composeSignals.js';
|
|
5
|
-
import { trackStream } from '../helpers/trackStream.js';
|
|
6
|
-
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
7
|
-
import { progressEventDecorator, progressEventReducer, asyncDecorator } from '../helpers/progressEventReducer.js';
|
|
8
|
-
import resolveConfig from '../helpers/resolveConfig.js';
|
|
9
|
-
import settle from '../core/settle.js';
|
|
10
|
-
|
|
11
|
-
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
12
|
-
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
13
|
-
|
|
14
|
-
// used only inside the fetch adapter
|
|
15
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
16
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
17
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const test = (fn, ...args) => {
|
|
21
|
-
try {
|
|
22
|
-
return !!fn(...args);
|
|
23
|
-
} catch (e) {
|
|
24
|
-
return false
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
29
|
-
let duplexAccessed = false;
|
|
30
|
-
|
|
31
|
-
const hasContentType = new Request(platform.origin, {
|
|
32
|
-
body: new ReadableStream(),
|
|
33
|
-
method: 'POST',
|
|
34
|
-
get duplex() {
|
|
35
|
-
duplexAccessed = true;
|
|
36
|
-
return 'half';
|
|
37
|
-
},
|
|
38
|
-
}).headers.has('Content-Type');
|
|
39
|
-
|
|
40
|
-
return duplexAccessed && !hasContentType;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
44
|
-
|
|
45
|
-
const supportsResponseStream = isReadableStreamSupported &&
|
|
46
|
-
test(() => utils.isReadableStream(new Response('').body));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const resolvers = {
|
|
50
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
isFetchSupported && (((res) => {
|
|
54
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
55
|
-
!resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :
|
|
56
|
-
(_, config) => {
|
|
57
|
-
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
})(new Response));
|
|
61
|
-
|
|
62
|
-
const getBodyLength = async (body) => {
|
|
63
|
-
if (body == null) {
|
|
64
|
-
return 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if(utils.isBlob(body)) {
|
|
68
|
-
return body.size;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if(utils.isSpecCompliantForm(body)) {
|
|
72
|
-
const _request = new Request(platform.origin, {
|
|
73
|
-
method: 'POST',
|
|
74
|
-
body,
|
|
75
|
-
});
|
|
76
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
|
80
|
-
return body.byteLength;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if(utils.isURLSearchParams(body)) {
|
|
84
|
-
body = body + '';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if(utils.isString(body)) {
|
|
88
|
-
return (await encodeText(body)).byteLength;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const resolveBodyLength = async (headers, body) => {
|
|
93
|
-
const length = utils.toFiniteNumber(headers.getContentLength());
|
|
94
|
-
|
|
95
|
-
return length == null ? getBodyLength(body) : length;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const fetchAdapter = isFetchSupported && (async (config) => {
|
|
99
|
-
let {
|
|
100
|
-
url,
|
|
101
|
-
method,
|
|
102
|
-
data,
|
|
103
|
-
signal,
|
|
104
|
-
cancelToken,
|
|
105
|
-
timeout,
|
|
106
|
-
onDownloadProgress,
|
|
107
|
-
onUploadProgress,
|
|
108
|
-
responseType,
|
|
109
|
-
headers,
|
|
110
|
-
withCredentials = 'same-origin',
|
|
111
|
-
fetchOptions
|
|
112
|
-
} = resolveConfig(config);
|
|
113
|
-
|
|
114
|
-
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
115
|
-
|
|
116
|
-
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
117
|
-
|
|
118
|
-
let request;
|
|
119
|
-
|
|
120
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
121
|
-
composedSignal.unsubscribe();
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
let requestContentLength;
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
if (
|
|
128
|
-
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
129
|
-
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
130
|
-
) {
|
|
131
|
-
let _request = new Request(url, {
|
|
132
|
-
method: 'POST',
|
|
133
|
-
body: data,
|
|
134
|
-
duplex: "half"
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
let contentTypeHeader;
|
|
138
|
-
|
|
139
|
-
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
140
|
-
headers.setContentType(contentTypeHeader);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (_request.body) {
|
|
144
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
145
|
-
requestContentLength,
|
|
146
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (!utils.isString(withCredentials)) {
|
|
154
|
-
withCredentials = withCredentials ? 'include' : 'omit';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Cloudflare Workers throws when credentials are defined
|
|
158
|
-
// see https://github.com/cloudflare/workerd/issues/902
|
|
159
|
-
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
160
|
-
request = new Request(url, {
|
|
161
|
-
...fetchOptions,
|
|
162
|
-
signal: composedSignal,
|
|
163
|
-
method: method.toUpperCase(),
|
|
164
|
-
headers: headers.normalize().toJSON(),
|
|
165
|
-
body: data,
|
|
166
|
-
duplex: "half",
|
|
167
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
let response = await fetch(request, fetchOptions);
|
|
171
|
-
|
|
172
|
-
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
173
|
-
|
|
174
|
-
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
175
|
-
const options = {};
|
|
176
|
-
|
|
177
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
178
|
-
options[prop] = response[prop];
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
|
|
182
|
-
|
|
183
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
184
|
-
responseContentLength,
|
|
185
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
186
|
-
) || [];
|
|
187
|
-
|
|
188
|
-
response = new Response(
|
|
189
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
190
|
-
flush && flush();
|
|
191
|
-
unsubscribe && unsubscribe();
|
|
192
|
-
}),
|
|
193
|
-
options
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
responseType = responseType || 'text';
|
|
198
|
-
|
|
199
|
-
let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);
|
|
200
|
-
|
|
201
|
-
!isStreamResponse && unsubscribe && unsubscribe();
|
|
202
|
-
|
|
203
|
-
return await new Promise((resolve, reject) => {
|
|
204
|
-
settle(resolve, reject, {
|
|
205
|
-
data: responseData,
|
|
206
|
-
headers: AxiosHeaders.from(response.headers),
|
|
207
|
-
status: response.status,
|
|
208
|
-
statusText: response.statusText,
|
|
209
|
-
config,
|
|
210
|
-
request
|
|
211
|
-
});
|
|
212
|
-
})
|
|
213
|
-
} catch (err) {
|
|
214
|
-
unsubscribe && unsubscribe();
|
|
215
|
-
|
|
216
|
-
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
217
|
-
throw Object.assign(
|
|
218
|
-
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
219
|
-
{
|
|
220
|
-
cause: err.cause || err
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
throw AxiosError.from(err, err && err.code, config, request);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
export { fetchAdapter as default };
|