ingeniuscliq-core 0.4.25 → 0.4.27

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.
Files changed (231) hide show
  1. package/dist/components/common/carousel/CustomCarousel.js +26 -0
  2. package/dist/components/common/carousel/CustomCarouselSection.js +41 -0
  3. package/dist/components/common/form/CustomFormField.js +29 -0
  4. package/dist/components/common/form/{FormCheckbox.tsx → FormCheckbox.js} +7 -7
  5. package/dist/components/common/form/{FormInput.tsx → FormInput.js} +5 -5
  6. package/dist/components/common/form/{FormSelect.tsx → FormSelect.js} +7 -7
  7. package/dist/components/common/form/{FormTextArea.tsx → FormTextArea.js} +5 -5
  8. package/dist/components/common/form/{FormWrapper.tsx → FormWrapper.js} +2 -2
  9. package/dist/components/common/logo/{Logo.tsx → Logo.js} +3 -3
  10. package/dist/components/common/pagination/{CustomPagination.tsx → CustomPagination.js} +6 -6
  11. package/dist/components/common/select/CustomSelect.js +27 -0
  12. package/dist/components/common/spinner/Spinner.js +32 -0
  13. package/dist/components/common/stepper/{Stepper.tsx → Stepper.js} +9 -9
  14. package/dist/components/layouts/CoreBaseLayout.js +19 -0
  15. package/dist/components/templates/CoreHomeLayout.js +8 -0
  16. package/dist/components/templates/{CorePreviewLayout.tsx → CorePreviewLayout.js} +3 -3
  17. package/dist/components/ui/accordion.js +44 -0
  18. package/dist/components/ui/{alert-dialog.tsx → alert-dialog.js} +28 -28
  19. package/dist/components/ui/{alert.tsx → alert.js} +5 -5
  20. package/dist/components/ui/{avatar.tsx → avatar.js} +11 -11
  21. package/dist/components/ui/{badge.tsx → badge.js} +3 -3
  22. package/dist/components/ui/{breadcrumb.tsx → breadcrumb.js} +13 -14
  23. package/dist/components/ui/{button.tsx → button.js} +4 -4
  24. package/dist/components/ui/{card.tsx → card.js} +8 -8
  25. package/dist/components/ui/{carousel.tsx → carousel.js} +14 -15
  26. package/dist/components/ui/{checkbox.tsx → checkbox.js} +9 -9
  27. package/dist/components/ui/{dialog.tsx → dialog.js} +26 -26
  28. package/dist/components/ui/{dropdown-menu.tsx → dropdown-menu.js} +37 -39
  29. package/dist/components/ui/{form.tsx → form.js} +10 -10
  30. package/dist/components/ui/{input.tsx → input.js} +2 -2
  31. package/dist/components/ui/{label.tsx → label.js} +6 -6
  32. package/dist/components/ui/{pagination.tsx → pagination.js} +16 -18
  33. package/dist/components/ui/{popover.tsx → popover.js} +8 -8
  34. package/dist/components/ui/radio-group.js +34 -0
  35. package/dist/components/ui/{select.tsx → select.js} +38 -40
  36. package/dist/components/ui/{separator.tsx → separator.js} +5 -5
  37. package/dist/components/ui/{sheet.tsx → sheet.js} +27 -27
  38. package/dist/components/ui/{skeleton.tsx → skeleton.js} +2 -2
  39. package/dist/components/ui/{slider.tsx → slider.js} +9 -9
  40. package/dist/components/ui/{stepper.tsx → stepper.js} +35 -35
  41. package/dist/components/ui/{switch.tsx → switch.js} +7 -7
  42. package/dist/components/ui/{table.tsx → table.js} +9 -9
  43. package/dist/components/ui/{tabs.tsx → tabs.js} +13 -13
  44. package/dist/components/ui/{textarea.tsx → textarea.js} +2 -2
  45. package/dist/components/ui/{tooltip.tsx → tooltip.js} +8 -8
  46. package/dist/helpers/axiosGlobal.js +1 -2
  47. package/dist/hooks/useNotification.js +1 -1
  48. package/dist/index.js +45 -45
  49. package/dist/lib/utils.js +2 -2
  50. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  51. package/dist/modules/CoreAuth/context/{AuthContext.tsx → AuthContext.js} +1 -1
  52. package/dist/modules/CoreAuth/index.js +2 -1
  53. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  54. package/dist/modules/CoreCustomization/index.js +1 -0
  55. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  56. package/dist/modules/CoreOrder/index.js +1 -0
  57. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  58. package/dist/modules/CorePayForm/index.js +1 -0
  59. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  60. package/dist/modules/CoreProduct/index.js +1 -0
  61. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  62. package/dist/modules/CoreShipment/index.js +1 -0
  63. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  64. package/package.json +2 -7
  65. package/dist/_virtual/index.js +0 -5
  66. package/dist/_virtual/index2.js +0 -3
  67. package/dist/_virtual/jsx-runtime.js +0 -5
  68. package/dist/_virtual/jsx-runtime2.js +0 -3
  69. package/dist/_virtual/react-jsx-runtime.development.js +0 -3
  70. package/dist/_virtual/react-jsx-runtime.production.js +0 -3
  71. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
  72. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
  73. package/dist/components/common/carousel/CustomCarousel.tsx +0 -26
  74. package/dist/components/common/carousel/CustomCarouselSection.tsx +0 -41
  75. package/dist/components/common/form/CustomFormField.tsx +0 -29
  76. package/dist/components/common/select/CustomSelect.tsx +0 -27
  77. package/dist/components/common/spinner/Spinner.tsx +0 -32
  78. package/dist/components/layouts/CoreBaseLayout.tsx +0 -19
  79. package/dist/components/templates/CoreHomeLayout.tsx +0 -8
  80. package/dist/components/ui/accordion.tsx +0 -44
  81. package/dist/components/ui/radio-group.tsx +0 -34
  82. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
  83. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
  84. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
  85. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  86. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
  87. package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
  88. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
  89. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
  90. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
  91. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  92. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
  93. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
  94. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
  95. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
  96. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
  97. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
  98. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
  99. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
  100. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
  101. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
  102. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
  103. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
  104. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
  105. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
  106. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
  107. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
  108. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
  109. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  110. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
  111. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
  112. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
  113. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
  114. package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
  115. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
  116. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
  117. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
  118. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
  119. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
  120. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
  121. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
  122. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
  123. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
  124. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  125. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  126. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
  127. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
  128. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
  129. package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
  130. package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
  131. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
  132. package/dist/node_modules/axios/index.js +0 -25
  133. package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
  134. package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
  135. package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
  136. package/dist/node_modules/axios/lib/axios.js +0 -86
  137. package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
  138. package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
  139. package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
  140. package/dist/node_modules/axios/lib/core/Axios.js +0 -238
  141. package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
  142. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
  143. package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
  144. package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
  145. package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  146. package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
  147. package/dist/node_modules/axios/lib/core/settle.js +0 -27
  148. package/dist/node_modules/axios/lib/core/transformData.js +0 -28
  149. package/dist/node_modules/axios/lib/defaults/index.js +0 -159
  150. package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
  151. package/dist/node_modules/axios/lib/env/data.js +0 -3
  152. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
  153. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  154. package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
  155. package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
  156. package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  157. package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
  158. package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
  159. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
  160. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  161. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  162. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  163. package/dist/node_modules/axios/lib/helpers/null.js +0 -4
  164. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  165. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  166. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
  167. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
  168. package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
  169. package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
  170. package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
  171. package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
  172. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  173. package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
  174. package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
  175. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  176. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  177. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
  178. package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
  179. package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
  180. package/dist/node_modules/axios/lib/platform/index.js +0 -9
  181. package/dist/node_modules/axios/lib/utils.js +0 -780
  182. package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
  183. package/dist/node_modules/clsx/dist/clsx.js +0 -3
  184. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
  185. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
  186. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
  187. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
  188. package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
  189. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
  190. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
  191. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
  192. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
  193. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
  194. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
  195. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
  196. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
  197. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
  198. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
  199. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
  200. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
  201. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
  202. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -363
  203. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -44
  204. package/dist/node_modules/react/jsx-runtime.js +0 -19
  205. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
  206. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
  207. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
  208. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
  209. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
  210. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
  211. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  212. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  213. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
  214. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
  215. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
  216. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
  217. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
  218. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
  219. package/dist/node_modules/sonner/dist/index.js +0 -299
  220. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -3035
  221. package/dist/node_modules/tslib/tslib.es6.js +0 -56
  222. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
  223. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
  224. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
  225. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  226. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
  227. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
  228. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
  229. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
  230. package/dist/node_modules/zustand/esm/react.js +0 -22
  231. package/dist/node_modules/zustand/esm/vanilla.js +0 -24
@@ -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 };
@@ -1,106 +0,0 @@
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 };
@@ -1,77 +0,0 @@
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 };
@@ -1,19 +0,0 @@
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 };
@@ -1,22 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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 };