ingeniuscliq-core 0.4.23 → 0.4.25
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/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/jsx-runtime.js +5 -0
- package/dist/_virtual/jsx-runtime2.js +3 -0
- package/dist/_virtual/react-jsx-runtime.development.js +3 -0
- package/dist/_virtual/react-jsx-runtime.production.js +3 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +3 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +3 -0
- package/dist/components/common/carousel/CustomCarousel.tsx +6 -6
- package/dist/components/common/carousel/CustomCarouselSection.tsx +12 -12
- package/dist/components/common/form/CustomFormField.tsx +6 -6
- package/dist/components/common/form/FormCheckbox.tsx +5 -5
- package/dist/components/common/form/FormInput.tsx +3 -3
- package/dist/components/common/form/FormSelect.tsx +5 -5
- package/dist/components/common/form/FormTextArea.tsx +3 -3
- package/dist/components/common/form/FormWrapper.tsx +2 -2
- package/dist/components/common/logo/Logo.tsx +3 -3
- package/dist/components/common/pagination/CustomPagination.tsx +5 -5
- package/dist/components/common/select/CustomSelect.tsx +4 -4
- package/dist/components/common/spinner/Spinner.tsx +14 -14
- package/dist/components/common/stepper/Stepper.tsx +9 -9
- package/dist/components/layouts/CoreBaseLayout.tsx +5 -5
- package/dist/components/templates/CoreHomeLayout.tsx +2 -2
- package/dist/components/templates/CorePreviewLayout.tsx +2 -2
- package/dist/components/ui/accordion.tsx +14 -14
- package/dist/components/ui/alert-dialog.tsx +27 -27
- package/dist/components/ui/alert.tsx +5 -5
- package/dist/components/ui/avatar.tsx +11 -11
- package/dist/components/ui/badge.tsx +3 -3
- package/dist/components/ui/breadcrumb.tsx +14 -13
- package/dist/components/ui/button.tsx +4 -4
- package/dist/components/ui/card.tsx +8 -8
- package/dist/components/ui/carousel.tsx +14 -13
- package/dist/components/ui/checkbox.tsx +9 -9
- package/dist/components/ui/dialog.tsx +26 -26
- package/dist/components/ui/dropdown-menu.tsx +39 -37
- package/dist/components/ui/form.tsx +9 -9
- package/dist/components/ui/input.tsx +2 -2
- package/dist/components/ui/label.tsx +6 -6
- package/dist/components/ui/pagination.tsx +17 -15
- package/dist/components/ui/popover.tsx +8 -8
- package/dist/components/ui/radio-group.tsx +10 -10
- package/dist/components/ui/select.tsx +40 -38
- package/dist/components/ui/separator.tsx +5 -5
- package/dist/components/ui/sheet.tsx +27 -27
- package/dist/components/ui/skeleton.tsx +2 -2
- package/dist/components/ui/slider.tsx +9 -9
- package/dist/components/ui/stepper.tsx +34 -34
- package/dist/components/ui/switch.tsx +7 -7
- package/dist/components/ui/table.tsx +9 -9
- package/dist/components/ui/tabs.tsx +13 -13
- package/dist/components/ui/textarea.tsx +2 -2
- package/dist/components/ui/tooltip.tsx +8 -8
- package/dist/helpers/axiosGlobal.js +2 -1
- package/dist/hooks/useNotification.js +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
- package/dist/modules/CoreAuth/context/AuthContext.tsx +1 -1
- package/dist/modules/CoreAuth/index.js +0 -1
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
- package/dist/modules/CoreCustomization/index.js +0 -1
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
- package/dist/modules/CoreOrder/index.js +0 -1
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
- package/dist/modules/CorePayForm/index.js +0 -1
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
- package/dist/modules/CoreProduct/index.js +0 -1
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
- package/dist/modules/CoreShipment/index.js +0 -1
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +814 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +751 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +350 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +137 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +305 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +147 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +118 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +270 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +145 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +79 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +321 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +211 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +267 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +207 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +834 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +299 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +283 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +282 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +223 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1156 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +30 -0
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +554 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +99 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +152 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +187 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +482 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +35 -0
- package/dist/node_modules/@stepperize/core/dist/index.js +3 -0
- package/dist/node_modules/@stepperize/react/dist/index.js +6 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
- package/dist/node_modules/axios/index.js +25 -0
- package/dist/node_modules/axios/lib/adapters/adapters.js +81 -0
- package/dist/node_modules/axios/lib/adapters/fetch.js +229 -0
- package/dist/node_modules/axios/lib/adapters/xhr.js +199 -0
- package/dist/node_modules/axios/lib/axios.js +86 -0
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +133 -0
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +23 -0
- package/dist/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/dist/node_modules/axios/lib/core/Axios.js +238 -0
- package/dist/node_modules/axios/lib/core/AxiosError.js +101 -0
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +312 -0
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +69 -0
- package/dist/node_modules/axios/lib/core/buildFullPath.js +22 -0
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +81 -0
- package/dist/node_modules/axios/lib/core/mergeConfig.js +106 -0
- package/dist/node_modules/axios/lib/core/settle.js +27 -0
- package/dist/node_modules/axios/lib/core/transformData.js +28 -0
- package/dist/node_modules/axios/lib/defaults/index.js +159 -0
- package/dist/node_modules/axios/lib/defaults/transitional.js +7 -0
- package/dist/node_modules/axios/lib/env/data.js +3 -0
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +56 -0
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/dist/node_modules/axios/lib/helpers/bind.js +7 -0
- package/dist/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +15 -0
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +48 -0
- package/dist/node_modules/axios/lib/helpers/cookies.js +43 -0
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +93 -0
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
- package/dist/node_modules/axios/lib/helpers/null.js +4 -0
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +46 -0
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +58 -0
- package/dist/node_modules/axios/lib/helpers/speedometer.js +53 -0
- package/dist/node_modules/axios/lib/helpers/spread.js +28 -0
- package/dist/node_modules/axios/lib/helpers/throttle.js +44 -0
- package/dist/node_modules/axios/lib/helpers/toFormData.js +219 -0
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/dist/node_modules/axios/lib/helpers/trackStream.js +88 -0
- package/dist/node_modules/axios/lib/helpers/validator.js +99 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/dist/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/dist/node_modules/axios/lib/platform/common/utils.js +45 -0
- package/dist/node_modules/axios/lib/platform/index.js +9 -0
- package/dist/node_modules/axios/lib/utils.js +780 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +44 -0
- package/dist/node_modules/clsx/dist/clsx.js +3 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1669 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +37 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +38 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +28 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +363 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +44 -0
- package/dist/node_modules/react/jsx-runtime.js +19 -0
- package/dist/node_modules/react-hook-form/dist/index.esm.js +560 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +167 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
- package/dist/node_modules/sonner/dist/index.js +299 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3035 -0
- package/dist/node_modules/tslib/tslib.es6.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +106 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +77 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +19 -0
- package/dist/node_modules/zustand/esm/react.js +22 -0
- package/dist/node_modules/zustand/esm/vanilla.js +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
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 };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 };
|
|
@@ -0,0 +1,48 @@
|
|
|
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 };
|
|
@@ -0,0 +1,42 @@
|
|
|
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 };
|
|
@@ -0,0 +1,21 @@
|
|
|
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 };
|
|
@@ -0,0 +1,77 @@
|
|
|
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 };
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { __exports as useSyncExternalStoreShim_development } from '../../../_virtual/use-sync-external-store-shim.development.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* use-sync-external-store-shim.development.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
15
|
+
|
|
16
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
17
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
18
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
19
|
+
"production" !== process.env.NODE_ENV &&
|
|
20
|
+
(function () {
|
|
21
|
+
function is(x, y) {
|
|
22
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
23
|
+
}
|
|
24
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
25
|
+
didWarnOld18Alpha ||
|
|
26
|
+
void 0 === React.startTransition ||
|
|
27
|
+
((didWarnOld18Alpha = true),
|
|
28
|
+
console.error(
|
|
29
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
30
|
+
));
|
|
31
|
+
var value = getSnapshot();
|
|
32
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
33
|
+
var cachedValue = getSnapshot();
|
|
34
|
+
objectIs(value, cachedValue) ||
|
|
35
|
+
(console.error(
|
|
36
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
37
|
+
),
|
|
38
|
+
(didWarnUncachedGetSnapshot = true));
|
|
39
|
+
}
|
|
40
|
+
cachedValue = useState({
|
|
41
|
+
inst: { value: value, getSnapshot: getSnapshot }
|
|
42
|
+
});
|
|
43
|
+
var inst = cachedValue[0].inst,
|
|
44
|
+
forceUpdate = cachedValue[1];
|
|
45
|
+
useLayoutEffect(
|
|
46
|
+
function () {
|
|
47
|
+
inst.value = value;
|
|
48
|
+
inst.getSnapshot = getSnapshot;
|
|
49
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
50
|
+
},
|
|
51
|
+
[subscribe, value, getSnapshot]
|
|
52
|
+
);
|
|
53
|
+
useEffect(
|
|
54
|
+
function () {
|
|
55
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
56
|
+
return subscribe(function () {
|
|
57
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
[subscribe]
|
|
61
|
+
);
|
|
62
|
+
useDebugValue(value);
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function checkIfSnapshotChanged(inst) {
|
|
66
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
67
|
+
inst = inst.value;
|
|
68
|
+
try {
|
|
69
|
+
var nextValue = latestGetSnapshot();
|
|
70
|
+
return !objectIs(inst, nextValue);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
76
|
+
return getSnapshot();
|
|
77
|
+
}
|
|
78
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
79
|
+
"function" ===
|
|
80
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
81
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
82
|
+
var React = React__default,
|
|
83
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
84
|
+
useState = React.useState,
|
|
85
|
+
useEffect = React.useEffect,
|
|
86
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
87
|
+
useDebugValue = React.useDebugValue,
|
|
88
|
+
didWarnOld18Alpha = false,
|
|
89
|
+
didWarnUncachedGetSnapshot = false,
|
|
90
|
+
shim =
|
|
91
|
+
"undefined" === typeof window ||
|
|
92
|
+
"undefined" === typeof window.document ||
|
|
93
|
+
"undefined" === typeof window.document.createElement
|
|
94
|
+
? useSyncExternalStore$1
|
|
95
|
+
: useSyncExternalStore$2;
|
|
96
|
+
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
97
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
98
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
99
|
+
"function" ===
|
|
100
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
101
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
102
|
+
})();
|
|
103
|
+
return useSyncExternalStoreShim_development;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { requireUseSyncExternalStoreShim_development as __require };
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { __exports as useSyncExternalStoreShim_production } from '../../../_virtual/use-sync-external-store-shim.production.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* use-sync-external-store-shim.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
15
|
+
|
|
16
|
+
function requireUseSyncExternalStoreShim_production () {
|
|
17
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
18
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
19
|
+
var React = React__default;
|
|
20
|
+
function is(x, y) {
|
|
21
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
22
|
+
}
|
|
23
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
24
|
+
useState = React.useState,
|
|
25
|
+
useEffect = React.useEffect,
|
|
26
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
27
|
+
useDebugValue = React.useDebugValue;
|
|
28
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
29
|
+
var value = getSnapshot(),
|
|
30
|
+
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
31
|
+
inst = _useState[0].inst,
|
|
32
|
+
forceUpdate = _useState[1];
|
|
33
|
+
useLayoutEffect(
|
|
34
|
+
function () {
|
|
35
|
+
inst.value = value;
|
|
36
|
+
inst.getSnapshot = getSnapshot;
|
|
37
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
38
|
+
},
|
|
39
|
+
[subscribe, value, getSnapshot]
|
|
40
|
+
);
|
|
41
|
+
useEffect(
|
|
42
|
+
function () {
|
|
43
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
44
|
+
return subscribe(function () {
|
|
45
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
[subscribe]
|
|
49
|
+
);
|
|
50
|
+
useDebugValue(value);
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
function checkIfSnapshotChanged(inst) {
|
|
54
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
55
|
+
inst = inst.value;
|
|
56
|
+
try {
|
|
57
|
+
var nextValue = latestGetSnapshot();
|
|
58
|
+
return !objectIs(inst, nextValue);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
64
|
+
return getSnapshot();
|
|
65
|
+
}
|
|
66
|
+
var shim =
|
|
67
|
+
"undefined" === typeof window ||
|
|
68
|
+
"undefined" === typeof window.document ||
|
|
69
|
+
"undefined" === typeof window.document.createElement
|
|
70
|
+
? useSyncExternalStore$1
|
|
71
|
+
: useSyncExternalStore$2;
|
|
72
|
+
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
73
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
74
|
+
return useSyncExternalStoreShim_production;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { requireUseSyncExternalStoreShim_production as __require };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __module as shim } from '../../../_virtual/index2.js';
|
|
2
|
+
import { __require as requireUseSyncExternalStoreShim_production } from '../cjs/use-sync-external-store-shim.production.js';
|
|
3
|
+
import { __require as requireUseSyncExternalStoreShim_development } from '../cjs/use-sync-external-store-shim.development.js';
|
|
4
|
+
|
|
5
|
+
var hasRequiredShim;
|
|
6
|
+
|
|
7
|
+
function requireShim () {
|
|
8
|
+
if (hasRequiredShim) return shim.exports;
|
|
9
|
+
hasRequiredShim = 1;
|
|
10
|
+
|
|
11
|
+
if (process.env.NODE_ENV === 'production') {
|
|
12
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
13
|
+
} else {
|
|
14
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
15
|
+
}
|
|
16
|
+
return shim.exports;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { requireShim as __require };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { createStore } from './vanilla.js';
|
|
3
|
+
|
|
4
|
+
const identity = (arg) => arg;
|
|
5
|
+
function useStore(api, selector = identity) {
|
|
6
|
+
const slice = React__default.useSyncExternalStore(
|
|
7
|
+
api.subscribe,
|
|
8
|
+
React__default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
9
|
+
React__default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
10
|
+
);
|
|
11
|
+
React__default.useDebugValue(slice);
|
|
12
|
+
return slice;
|
|
13
|
+
}
|
|
14
|
+
const createImpl = (createState) => {
|
|
15
|
+
const api = createStore(createState);
|
|
16
|
+
const useBoundStore = (selector) => useStore(api, selector);
|
|
17
|
+
Object.assign(useBoundStore, api);
|
|
18
|
+
return useBoundStore;
|
|
19
|
+
};
|
|
20
|
+
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
21
|
+
|
|
22
|
+
export { create, useStore };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const createStoreImpl = (createState) => {
|
|
2
|
+
let state;
|
|
3
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
const setState = (partial, replace) => {
|
|
5
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
6
|
+
if (!Object.is(nextState, state)) {
|
|
7
|
+
const previousState = state;
|
|
8
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
9
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const getState = () => state;
|
|
13
|
+
const getInitialState = () => initialState;
|
|
14
|
+
const subscribe = (listener) => {
|
|
15
|
+
listeners.add(listener);
|
|
16
|
+
return () => listeners.delete(listener);
|
|
17
|
+
};
|
|
18
|
+
const api = { setState, getState, getInitialState, subscribe };
|
|
19
|
+
const initialState = state = createState(setState, getState, api);
|
|
20
|
+
return api;
|
|
21
|
+
};
|
|
22
|
+
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
23
|
+
|
|
24
|
+
export { createStore };
|