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,299 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import 'react-dom';
|
|
3
|
-
|
|
4
|
-
function __insertCSS(code) {
|
|
5
|
-
if (typeof document == 'undefined') return
|
|
6
|
-
let head = document.head || document.getElementsByTagName('head')[0];
|
|
7
|
-
let style = document.createElement('style');
|
|
8
|
-
style.type = 'text/css';
|
|
9
|
-
head.appendChild(style)
|
|
10
|
-
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
|
|
11
|
-
}
|
|
12
|
-
Array(12).fill(0);
|
|
13
|
-
|
|
14
|
-
let toastsCounter = 1;
|
|
15
|
-
class Observer {
|
|
16
|
-
constructor(){
|
|
17
|
-
// We use arrow functions to maintain the correct `this` reference
|
|
18
|
-
this.subscribe = (subscriber)=>{
|
|
19
|
-
this.subscribers.push(subscriber);
|
|
20
|
-
return ()=>{
|
|
21
|
-
const index = this.subscribers.indexOf(subscriber);
|
|
22
|
-
this.subscribers.splice(index, 1);
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
this.publish = (data)=>{
|
|
26
|
-
this.subscribers.forEach((subscriber)=>subscriber(data));
|
|
27
|
-
};
|
|
28
|
-
this.addToast = (data)=>{
|
|
29
|
-
this.publish(data);
|
|
30
|
-
this.toasts = [
|
|
31
|
-
...this.toasts,
|
|
32
|
-
data
|
|
33
|
-
];
|
|
34
|
-
};
|
|
35
|
-
this.create = (data)=>{
|
|
36
|
-
var _data_id;
|
|
37
|
-
const { message, ...rest } = data;
|
|
38
|
-
const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
39
|
-
const alreadyExists = this.toasts.find((toast)=>{
|
|
40
|
-
return toast.id === id;
|
|
41
|
-
});
|
|
42
|
-
const dismissible = data.dismissible === undefined ? true : data.dismissible;
|
|
43
|
-
if (this.dismissedToasts.has(id)) {
|
|
44
|
-
this.dismissedToasts.delete(id);
|
|
45
|
-
}
|
|
46
|
-
if (alreadyExists) {
|
|
47
|
-
this.toasts = this.toasts.map((toast)=>{
|
|
48
|
-
if (toast.id === id) {
|
|
49
|
-
this.publish({
|
|
50
|
-
...toast,
|
|
51
|
-
...data,
|
|
52
|
-
id,
|
|
53
|
-
title: message
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
...toast,
|
|
57
|
-
...data,
|
|
58
|
-
id,
|
|
59
|
-
dismissible,
|
|
60
|
-
title: message
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
return toast;
|
|
64
|
-
});
|
|
65
|
-
} else {
|
|
66
|
-
this.addToast({
|
|
67
|
-
title: message,
|
|
68
|
-
...rest,
|
|
69
|
-
dismissible,
|
|
70
|
-
id
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return id;
|
|
74
|
-
};
|
|
75
|
-
this.dismiss = (id)=>{
|
|
76
|
-
if (id) {
|
|
77
|
-
this.dismissedToasts.add(id);
|
|
78
|
-
requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({
|
|
79
|
-
id,
|
|
80
|
-
dismiss: true
|
|
81
|
-
})));
|
|
82
|
-
} else {
|
|
83
|
-
this.toasts.forEach((toast)=>{
|
|
84
|
-
this.subscribers.forEach((subscriber)=>subscriber({
|
|
85
|
-
id: toast.id,
|
|
86
|
-
dismiss: true
|
|
87
|
-
}));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return id;
|
|
91
|
-
};
|
|
92
|
-
this.message = (message, data)=>{
|
|
93
|
-
return this.create({
|
|
94
|
-
...data,
|
|
95
|
-
message
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
this.error = (message, data)=>{
|
|
99
|
-
return this.create({
|
|
100
|
-
...data,
|
|
101
|
-
message,
|
|
102
|
-
type: 'error'
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
this.success = (message, data)=>{
|
|
106
|
-
return this.create({
|
|
107
|
-
...data,
|
|
108
|
-
type: 'success',
|
|
109
|
-
message
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
this.info = (message, data)=>{
|
|
113
|
-
return this.create({
|
|
114
|
-
...data,
|
|
115
|
-
type: 'info',
|
|
116
|
-
message
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
this.warning = (message, data)=>{
|
|
120
|
-
return this.create({
|
|
121
|
-
...data,
|
|
122
|
-
type: 'warning',
|
|
123
|
-
message
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
this.loading = (message, data)=>{
|
|
127
|
-
return this.create({
|
|
128
|
-
...data,
|
|
129
|
-
type: 'loading',
|
|
130
|
-
message
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
this.promise = (promise, data)=>{
|
|
134
|
-
if (!data) {
|
|
135
|
-
// Nothing to show
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
let id = undefined;
|
|
139
|
-
if (data.loading !== undefined) {
|
|
140
|
-
id = this.create({
|
|
141
|
-
...data,
|
|
142
|
-
promise,
|
|
143
|
-
type: 'loading',
|
|
144
|
-
message: data.loading,
|
|
145
|
-
description: typeof data.description !== 'function' ? data.description : undefined
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
const p = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
149
|
-
let shouldDismiss = id !== undefined;
|
|
150
|
-
let result;
|
|
151
|
-
const originalPromise = p.then(async (response)=>{
|
|
152
|
-
result = [
|
|
153
|
-
'resolve',
|
|
154
|
-
response
|
|
155
|
-
];
|
|
156
|
-
const isReactElementResponse = React__default.isValidElement(response);
|
|
157
|
-
if (isReactElementResponse) {
|
|
158
|
-
shouldDismiss = false;
|
|
159
|
-
this.create({
|
|
160
|
-
id,
|
|
161
|
-
type: 'default',
|
|
162
|
-
message: response
|
|
163
|
-
});
|
|
164
|
-
} else if (isHttpResponse(response) && !response.ok) {
|
|
165
|
-
shouldDismiss = false;
|
|
166
|
-
const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
167
|
-
const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
168
|
-
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
169
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
170
|
-
message: promiseData
|
|
171
|
-
};
|
|
172
|
-
this.create({
|
|
173
|
-
id,
|
|
174
|
-
type: 'error',
|
|
175
|
-
description,
|
|
176
|
-
...toastSettings
|
|
177
|
-
});
|
|
178
|
-
} else if (response instanceof Error) {
|
|
179
|
-
shouldDismiss = false;
|
|
180
|
-
const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;
|
|
181
|
-
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
182
|
-
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
183
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
184
|
-
message: promiseData
|
|
185
|
-
};
|
|
186
|
-
this.create({
|
|
187
|
-
id,
|
|
188
|
-
type: 'error',
|
|
189
|
-
description,
|
|
190
|
-
...toastSettings
|
|
191
|
-
});
|
|
192
|
-
} else if (data.success !== undefined) {
|
|
193
|
-
shouldDismiss = false;
|
|
194
|
-
const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;
|
|
195
|
-
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
196
|
-
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
197
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
198
|
-
message: promiseData
|
|
199
|
-
};
|
|
200
|
-
this.create({
|
|
201
|
-
id,
|
|
202
|
-
type: 'success',
|
|
203
|
-
description,
|
|
204
|
-
...toastSettings
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}).catch(async (error)=>{
|
|
208
|
-
result = [
|
|
209
|
-
'reject',
|
|
210
|
-
error
|
|
211
|
-
];
|
|
212
|
-
if (data.error !== undefined) {
|
|
213
|
-
shouldDismiss = false;
|
|
214
|
-
const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;
|
|
215
|
-
const description = typeof data.description === 'function' ? await data.description(error) : data.description;
|
|
216
|
-
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
217
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
218
|
-
message: promiseData
|
|
219
|
-
};
|
|
220
|
-
this.create({
|
|
221
|
-
id,
|
|
222
|
-
type: 'error',
|
|
223
|
-
description,
|
|
224
|
-
...toastSettings
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}).finally(()=>{
|
|
228
|
-
if (shouldDismiss) {
|
|
229
|
-
// Toast is still in load state (and will be indefinitely — dismiss it)
|
|
230
|
-
this.dismiss(id);
|
|
231
|
-
id = undefined;
|
|
232
|
-
}
|
|
233
|
-
data.finally == null ? void 0 : data.finally.call(data);
|
|
234
|
-
});
|
|
235
|
-
const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
236
|
-
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
237
|
-
// cannot Object.assign on undefined
|
|
238
|
-
return {
|
|
239
|
-
unwrap
|
|
240
|
-
};
|
|
241
|
-
} else {
|
|
242
|
-
return Object.assign(id, {
|
|
243
|
-
unwrap
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
this.custom = (jsx, data)=>{
|
|
248
|
-
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
249
|
-
this.create({
|
|
250
|
-
jsx: jsx(id),
|
|
251
|
-
id,
|
|
252
|
-
...data
|
|
253
|
-
});
|
|
254
|
-
return id;
|
|
255
|
-
};
|
|
256
|
-
this.getActiveToasts = ()=>{
|
|
257
|
-
return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));
|
|
258
|
-
};
|
|
259
|
-
this.subscribers = [];
|
|
260
|
-
this.toasts = [];
|
|
261
|
-
this.dismissedToasts = new Set();
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const ToastState = new Observer();
|
|
265
|
-
// bind this to the toast function
|
|
266
|
-
const toastFunction = (message, data)=>{
|
|
267
|
-
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
268
|
-
ToastState.addToast({
|
|
269
|
-
title: message,
|
|
270
|
-
...data,
|
|
271
|
-
id
|
|
272
|
-
});
|
|
273
|
-
return id;
|
|
274
|
-
};
|
|
275
|
-
const isHttpResponse = (data)=>{
|
|
276
|
-
return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';
|
|
277
|
-
};
|
|
278
|
-
const basicToast = toastFunction;
|
|
279
|
-
const getHistory = ()=>ToastState.toasts;
|
|
280
|
-
const getToasts = ()=>ToastState.getActiveToasts();
|
|
281
|
-
// We use `Object.assign` to maintain the correct types as we would lose them otherwise
|
|
282
|
-
const toast = Object.assign(basicToast, {
|
|
283
|
-
success: ToastState.success,
|
|
284
|
-
info: ToastState.info,
|
|
285
|
-
warning: ToastState.warning,
|
|
286
|
-
error: ToastState.error,
|
|
287
|
-
custom: ToastState.custom,
|
|
288
|
-
message: ToastState.message,
|
|
289
|
-
promise: ToastState.promise,
|
|
290
|
-
dismiss: ToastState.dismiss,
|
|
291
|
-
loading: ToastState.loading
|
|
292
|
-
}, {
|
|
293
|
-
getHistory,
|
|
294
|
-
getToasts
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
298
|
-
|
|
299
|
-
export { toast };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var __assign = function() {
|
|
19
|
-
__assign = Object.assign || function __assign(t) {
|
|
20
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
-
s = arguments[i];
|
|
22
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function __rest(s, e) {
|
|
30
|
-
var t = {};
|
|
31
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
32
|
-
t[p] = s[p];
|
|
33
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
34
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
35
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
36
|
-
t[p[i]] = s[p[i]];
|
|
37
|
-
}
|
|
38
|
-
return t;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function __spreadArray(to, from, pack) {
|
|
42
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
43
|
-
if (ar || !(i in from)) {
|
|
44
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
45
|
-
ar[i] = from[i];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
52
|
-
var e = new Error(message);
|
|
53
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export { __assign, __rest, __spreadArray };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assigns a value for a given ref, no matter of the ref format
|
|
3
|
-
* @param {RefObject} ref - a callback function or ref object
|
|
4
|
-
* @param value - a new value
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/theKashey/use-callback-ref#assignref
|
|
7
|
-
* @example
|
|
8
|
-
* const refObject = useRef();
|
|
9
|
-
* const refFn = (ref) => {....}
|
|
10
|
-
*
|
|
11
|
-
* assignRef(refObject, "refValue");
|
|
12
|
-
* assignRef(refFn, "refValue");
|
|
13
|
-
*/
|
|
14
|
-
function assignRef(ref, value) {
|
|
15
|
-
if (typeof ref === 'function') {
|
|
16
|
-
ref(value);
|
|
17
|
-
}
|
|
18
|
-
else if (ref) {
|
|
19
|
-
ref.current = value;
|
|
20
|
-
}
|
|
21
|
-
return ref;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { assignRef };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { assignRef } from './assignRef.js';
|
|
3
|
-
import { useCallbackRef } from './useRef.js';
|
|
4
|
-
|
|
5
|
-
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
6
|
-
var currentValues = new WeakMap();
|
|
7
|
-
/**
|
|
8
|
-
* Merges two or more refs together providing a single interface to set their value
|
|
9
|
-
* @param {RefObject|Ref} refs
|
|
10
|
-
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
11
|
-
*
|
|
12
|
-
* @see {@link mergeRefs} a version without buit-in memoization
|
|
13
|
-
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
|
|
14
|
-
* @example
|
|
15
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
16
|
-
* const ownRef = useRef();
|
|
17
|
-
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
|
|
18
|
-
* return <div ref={domRef}>...</div>
|
|
19
|
-
* }
|
|
20
|
-
*/
|
|
21
|
-
function useMergeRefs(refs, defaultValue) {
|
|
22
|
-
var callbackRef = useCallbackRef(null, function (newValue) {
|
|
23
|
-
return refs.forEach(function (ref) { return assignRef(ref, newValue); });
|
|
24
|
-
});
|
|
25
|
-
// handle refs changes - added or removed
|
|
26
|
-
useIsomorphicLayoutEffect(function () {
|
|
27
|
-
var oldValue = currentValues.get(callbackRef);
|
|
28
|
-
if (oldValue) {
|
|
29
|
-
var prevRefs_1 = new Set(oldValue);
|
|
30
|
-
var nextRefs_1 = new Set(refs);
|
|
31
|
-
var current_1 = callbackRef.current;
|
|
32
|
-
prevRefs_1.forEach(function (ref) {
|
|
33
|
-
if (!nextRefs_1.has(ref)) {
|
|
34
|
-
assignRef(ref, null);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
nextRefs_1.forEach(function (ref) {
|
|
38
|
-
if (!prevRefs_1.has(ref)) {
|
|
39
|
-
assignRef(ref, current_1);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
currentValues.set(callbackRef, refs);
|
|
44
|
-
}, [refs]);
|
|
45
|
-
return callbackRef;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { useMergeRefs };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* creates a MutableRef with ref change callback
|
|
5
|
-
* @param initialValue - initial ref value
|
|
6
|
-
* @param {Function} callback - a callback to run when value changes
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
|
|
10
|
-
* ref.current = 1;
|
|
11
|
-
* // prints 0 -> 1
|
|
12
|
-
*
|
|
13
|
-
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
|
14
|
-
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
|
|
15
|
-
* @returns {MutableRefObject}
|
|
16
|
-
*/
|
|
17
|
-
function useCallbackRef(initialValue, callback) {
|
|
18
|
-
var ref = useState(function () { return ({
|
|
19
|
-
// value
|
|
20
|
-
value: initialValue,
|
|
21
|
-
// last callback
|
|
22
|
-
callback: callback,
|
|
23
|
-
// "memoized" public interface
|
|
24
|
-
facade: {
|
|
25
|
-
get current() {
|
|
26
|
-
return ref.value;
|
|
27
|
-
},
|
|
28
|
-
set current(value) {
|
|
29
|
-
var last = ref.value;
|
|
30
|
-
if (last !== value) {
|
|
31
|
-
ref.value = value;
|
|
32
|
-
ref.callback(value, last);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
}); })[0];
|
|
37
|
-
// update callback
|
|
38
|
-
ref.callback = callback;
|
|
39
|
-
return ref.facade;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { useCallbackRef };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __rest, __assign } from '../../../tslib/tslib.es6.js';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
var SideCar = function (_a) {
|
|
5
|
-
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
6
|
-
if (!sideCar) {
|
|
7
|
-
throw new Error('Sidecar: please provide `sideCar` property to import the right car');
|
|
8
|
-
}
|
|
9
|
-
var Target = sideCar.read();
|
|
10
|
-
if (!Target) {
|
|
11
|
-
throw new Error('Sidecar medium not found');
|
|
12
|
-
}
|
|
13
|
-
return React.createElement(Target, __assign({}, rest));
|
|
14
|
-
};
|
|
15
|
-
SideCar.isSideCarExport = true;
|
|
16
|
-
function exportSidecar(medium, exported) {
|
|
17
|
-
medium.useMedium(exported);
|
|
18
|
-
return SideCar;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { exportSidecar };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { __assign } from '../../../tslib/tslib.es6.js';
|
|
2
|
-
|
|
3
|
-
function ItoI(a) {
|
|
4
|
-
return a;
|
|
5
|
-
}
|
|
6
|
-
function innerCreateMedium(defaults, middleware) {
|
|
7
|
-
if (middleware === void 0) { middleware = ItoI; }
|
|
8
|
-
var buffer = [];
|
|
9
|
-
var assigned = false;
|
|
10
|
-
var medium = {
|
|
11
|
-
read: function () {
|
|
12
|
-
if (assigned) {
|
|
13
|
-
throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
|
|
14
|
-
}
|
|
15
|
-
if (buffer.length) {
|
|
16
|
-
return buffer[buffer.length - 1];
|
|
17
|
-
}
|
|
18
|
-
return defaults;
|
|
19
|
-
},
|
|
20
|
-
useMedium: function (data) {
|
|
21
|
-
var item = middleware(data, assigned);
|
|
22
|
-
buffer.push(item);
|
|
23
|
-
return function () {
|
|
24
|
-
buffer = buffer.filter(function (x) { return x !== item; });
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
assignSyncMedium: function (cb) {
|
|
28
|
-
assigned = true;
|
|
29
|
-
while (buffer.length) {
|
|
30
|
-
var cbs = buffer;
|
|
31
|
-
buffer = [];
|
|
32
|
-
cbs.forEach(cb);
|
|
33
|
-
}
|
|
34
|
-
buffer = {
|
|
35
|
-
push: function (x) { return cb(x); },
|
|
36
|
-
filter: function () { return buffer; },
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
assignMedium: function (cb) {
|
|
40
|
-
assigned = true;
|
|
41
|
-
var pendingQueue = [];
|
|
42
|
-
if (buffer.length) {
|
|
43
|
-
var cbs = buffer;
|
|
44
|
-
buffer = [];
|
|
45
|
-
cbs.forEach(cb);
|
|
46
|
-
pendingQueue = buffer;
|
|
47
|
-
}
|
|
48
|
-
var executeQueue = function () {
|
|
49
|
-
var cbs = pendingQueue;
|
|
50
|
-
pendingQueue = [];
|
|
51
|
-
cbs.forEach(cb);
|
|
52
|
-
};
|
|
53
|
-
var cycle = function () { return Promise.resolve().then(executeQueue); };
|
|
54
|
-
cycle();
|
|
55
|
-
buffer = {
|
|
56
|
-
push: function (x) {
|
|
57
|
-
pendingQueue.push(x);
|
|
58
|
-
cycle();
|
|
59
|
-
},
|
|
60
|
-
filter: function (filter) {
|
|
61
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
62
|
-
return buffer;
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
return medium;
|
|
68
|
-
}
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
70
|
-
function createSidecarMedium(options) {
|
|
71
|
-
if (options === void 0) { options = {}; }
|
|
72
|
-
var medium = innerCreateMedium(null);
|
|
73
|
-
medium.options = __assign({ async: true, ssr: false }, options);
|
|
74
|
-
return medium;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { createSidecarMedium };
|