ingeniuscliq-core 0.4.18 → 0.4.20

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 (273) hide show
  1. package/dist/components/common/carousel/CustomCarousel.d.ts +1 -1
  2. package/dist/components/common/carousel/CustomCarousel.d.ts.map +1 -1
  3. package/dist/components/common/carousel/CustomCarouselSection.d.ts +1 -1
  4. package/dist/components/common/carousel/CustomCarouselSection.d.ts.map +1 -1
  5. package/dist/components/common/form/FormCheckbox.d.ts +1 -1
  6. package/dist/components/common/form/FormCheckbox.d.ts.map +1 -1
  7. package/dist/components/common/form/FormInput.d.ts +1 -1
  8. package/dist/components/common/form/FormInput.d.ts.map +1 -1
  9. package/dist/components/common/form/FormSelect.d.ts +1 -1
  10. package/dist/components/common/form/FormSelect.d.ts.map +1 -1
  11. package/dist/components/common/form/FormTextArea.d.ts +1 -1
  12. package/dist/components/common/form/FormTextArea.d.ts.map +1 -1
  13. package/dist/components/common/form/FormWrapper.d.ts +1 -1
  14. package/dist/components/common/form/FormWrapper.d.ts.map +1 -1
  15. package/dist/components/common/logo/Logo.d.ts +1 -1
  16. package/dist/components/common/logo/Logo.d.ts.map +1 -1
  17. package/dist/components/common/pagination/CustomPagination.d.ts +1 -1
  18. package/dist/components/common/pagination/CustomPagination.d.ts.map +1 -1
  19. package/dist/components/common/select/CustomSelect.d.ts +1 -1
  20. package/dist/components/common/select/CustomSelect.d.ts.map +1 -1
  21. package/dist/components/common/spinner/Spinner.d.ts +1 -1
  22. package/dist/components/common/spinner/Spinner.d.ts.map +1 -1
  23. package/dist/components/common/stepper/Stepper.d.ts +1 -1
  24. package/dist/components/common/stepper/Stepper.d.ts.map +1 -1
  25. package/dist/components/common/stepper/Stepper.tsx +1 -1
  26. package/dist/components/layouts/CoreBaseLayout.d.ts +1 -1
  27. package/dist/components/layouts/CoreBaseLayout.d.ts.map +1 -1
  28. package/dist/components/templates/CoreHomeLayout.d.ts +1 -1
  29. package/dist/components/templates/CoreHomeLayout.d.ts.map +1 -1
  30. package/dist/components/templates/CorePreviewLayout.d.ts +1 -1
  31. package/dist/components/templates/CorePreviewLayout.d.ts.map +1 -1
  32. package/dist/components/ui/accordion.tsx +9 -9
  33. package/dist/components/ui/alert-dialog.d.ts +2 -2
  34. package/dist/components/ui/alert-dialog.tsx +16 -16
  35. package/dist/components/ui/alert.d.ts +3 -3
  36. package/dist/components/ui/alert.d.ts.map +1 -1
  37. package/dist/components/ui/alert.tsx +1 -1
  38. package/dist/components/ui/avatar.tsx +7 -7
  39. package/dist/components/ui/badge.d.ts +4 -4
  40. package/dist/components/ui/badge.d.ts.map +1 -1
  41. package/dist/components/ui/badge.tsx +1 -1
  42. package/dist/components/ui/breadcrumb.d.ts +2 -2
  43. package/dist/components/ui/breadcrumb.tsx +3 -4
  44. package/dist/components/ui/button.d.ts +4 -4
  45. package/dist/components/ui/button.d.ts.map +1 -1
  46. package/dist/components/ui/button.tsx +2 -2
  47. package/dist/components/ui/carousel.tsx +2 -3
  48. package/dist/components/ui/checkbox.tsx +5 -5
  49. package/dist/components/ui/dialog.d.ts +2 -2
  50. package/dist/components/ui/dialog.tsx +15 -15
  51. package/dist/components/ui/dropdown-menu.d.ts +1 -1
  52. package/dist/components/ui/dropdown-menu.tsx +27 -29
  53. package/dist/components/ui/form.d.ts +1 -1
  54. package/dist/components/ui/form.d.ts.map +1 -1
  55. package/dist/components/ui/form.tsx +2 -2
  56. package/dist/components/ui/label.d.ts +1 -1
  57. package/dist/components/ui/label.d.ts.map +1 -1
  58. package/dist/components/ui/label.tsx +4 -4
  59. package/dist/components/ui/pagination.d.ts +5 -5
  60. package/dist/components/ui/pagination.tsx +2 -4
  61. package/dist/components/ui/popover.tsx +7 -7
  62. package/dist/components/ui/radio-group.tsx +7 -7
  63. package/dist/components/ui/select.tsx +25 -27
  64. package/dist/components/ui/separator.tsx +3 -3
  65. package/dist/components/ui/sheet.d.ts +5 -5
  66. package/dist/components/ui/sheet.d.ts.map +1 -1
  67. package/dist/components/ui/sheet.tsx +16 -16
  68. package/dist/components/ui/skeleton.d.ts +1 -1
  69. package/dist/components/ui/skeleton.d.ts.map +1 -1
  70. package/dist/components/ui/slider.tsx +6 -6
  71. package/dist/components/ui/stepper.tsx +4 -4
  72. package/dist/components/ui/switch.tsx +4 -4
  73. package/dist/components/ui/tabs.tsx +9 -9
  74. package/dist/components/ui/tooltip.tsx +6 -6
  75. package/dist/helpers/axiosGlobal.js +1 -2
  76. package/dist/hooks/useLanguage.js +2 -5
  77. package/dist/hooks/useNotification.js +1 -1
  78. package/dist/i18n/config.js +1 -5
  79. package/dist/lib/utils.js +1 -1
  80. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts +2 -2
  81. package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
  82. package/dist/modules/CoreAuth/context/AuthContext.d.ts +2 -2
  83. package/dist/modules/CoreAuth/context/AuthContext.d.ts.map +1 -1
  84. package/dist/modules/CoreAuth/hooks/useAuth.d.ts +3 -3
  85. package/dist/modules/CoreAuth/index.js +1 -0
  86. package/dist/modules/CoreAuth/stores/authStore.d.ts +2 -2
  87. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +8 -8
  88. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
  89. package/dist/modules/CoreCustomization/index.js +1 -0
  90. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
  91. package/dist/modules/CoreOrder/index.js +1 -0
  92. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +2 -2
  93. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
  94. package/dist/modules/CorePayForm/index.js +1 -0
  95. package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +8 -8
  96. package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
  97. package/dist/modules/CoreProduct/index.js +1 -0
  98. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +6 -6
  99. package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
  100. package/dist/modules/CoreShipment/index.js +1 -0
  101. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +4 -4
  102. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
  103. package/package.json +21 -13
  104. package/src/commands/common/constants.js +10 -0
  105. package/src/commands/helpers/index.js +15 -0
  106. package/src/commands/helpers/strings.js +4 -0
  107. package/src/commands/templates/locale.js +14 -0
  108. package/src/commands/templates/service.js +12 -0
  109. package/src/commands/templates/type.js +10 -0
  110. package/README.md +0 -417
  111. package/dist/_virtual/index.js +0 -5
  112. package/dist/_virtual/index2.js +0 -3
  113. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
  114. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
  115. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
  116. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
  117. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
  118. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  119. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
  120. package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
  121. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
  122. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
  123. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
  124. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  125. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
  126. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
  127. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
  128. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
  129. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
  130. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
  131. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
  132. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
  133. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
  134. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
  135. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
  136. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
  137. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
  138. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
  139. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
  140. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
  141. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
  142. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  143. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
  144. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
  145. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
  146. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
  147. package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
  148. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
  149. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
  150. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
  151. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
  152. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
  153. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
  154. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
  155. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
  156. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
  157. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  158. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  159. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
  160. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
  161. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
  162. package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
  163. package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
  164. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
  165. package/dist/node_modules/axios/index.js +0 -25
  166. package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
  167. package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
  168. package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
  169. package/dist/node_modules/axios/lib/axios.js +0 -86
  170. package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
  171. package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
  172. package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
  173. package/dist/node_modules/axios/lib/core/Axios.js +0 -238
  174. package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
  175. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
  176. package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
  177. package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
  178. package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  179. package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
  180. package/dist/node_modules/axios/lib/core/settle.js +0 -27
  181. package/dist/node_modules/axios/lib/core/transformData.js +0 -28
  182. package/dist/node_modules/axios/lib/defaults/index.js +0 -159
  183. package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
  184. package/dist/node_modules/axios/lib/env/data.js +0 -3
  185. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
  186. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  187. package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
  188. package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
  189. package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  190. package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
  191. package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
  192. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
  193. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  194. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  195. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  196. package/dist/node_modules/axios/lib/helpers/null.js +0 -4
  197. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  198. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  199. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
  200. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
  201. package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
  202. package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
  203. package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
  204. package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
  205. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  206. package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
  207. package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
  208. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  209. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  210. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
  211. package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
  212. package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
  213. package/dist/node_modules/axios/lib/platform/index.js +0 -9
  214. package/dist/node_modules/axios/lib/utils.js +0 -780
  215. package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
  216. package/dist/node_modules/clsx/dist/clsx.js +0 -3
  217. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
  218. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
  219. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
  220. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
  221. package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
  222. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
  223. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
  224. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
  225. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
  226. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
  227. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
  228. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
  229. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
  230. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
  231. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
  232. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
  233. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
  234. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
  235. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
  236. package/dist/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -210
  237. package/dist/node_modules/react-i18next/dist/es/context.js +0 -18
  238. package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
  239. package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -7
  240. package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -12
  241. package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -27
  242. package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -157
  243. package/dist/node_modules/react-i18next/dist/es/utils.js +0 -63
  244. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
  245. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
  246. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
  247. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
  248. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
  249. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  250. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  251. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
  252. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
  253. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
  254. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
  255. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
  256. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
  257. package/dist/node_modules/sonner/dist/index.js +0 -299
  258. package/dist/node_modules/tslib/tslib.es6.js +0 -56
  259. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
  260. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
  261. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
  262. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  263. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
  264. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
  265. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
  266. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
  267. package/dist/node_modules/zustand/esm/react.js +0 -22
  268. package/dist/node_modules/zustand/esm/vanilla.js +0 -24
  269. /package/src/{core/commands → commands}/create-core-module.js +0 -0
  270. /package/src/{core/commands → commands}/create-module.js +0 -0
  271. /package/src/{core/commands → commands}/create-template.js +0 -0
  272. /package/src/{core/commands → commands}/rollback-core-module.js +0 -0
  273. /package/src/{core/commands → commands}/rollback-module.js +0 -0
@@ -1,167 +0,0 @@
1
- import { __spreadArray } from '../../../tslib/tslib.es6.js';
2
- import * as React from 'react';
3
- import { RemoveScrollBar } from '../../../react-remove-scroll-bar/dist/es2015/component.js';
4
- import { styleSingleton } from '../../../react-style-singleton/dist/es2015/component.js';
5
- import { nonPassive } from './aggresiveCapture.js';
6
- import { locationCouldBeScrolled, handleScroll } from './handleScroll.js';
7
-
8
- var getTouchXY = function (event) {
9
- return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
10
- };
11
- var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
12
- var extractRef = function (ref) {
13
- return ref && 'current' in ref ? ref.current : ref;
14
- };
15
- var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
16
- var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
17
- var idCounter = 0;
18
- var lockStack = [];
19
- function RemoveScrollSideCar(props) {
20
- var shouldPreventQueue = React.useRef([]);
21
- var touchStartRef = React.useRef([0, 0]);
22
- var activeAxis = React.useRef();
23
- var id = React.useState(idCounter++)[0];
24
- var Style = React.useState(styleSingleton)[0];
25
- var lastProps = React.useRef(props);
26
- React.useEffect(function () {
27
- lastProps.current = props;
28
- }, [props]);
29
- React.useEffect(function () {
30
- if (props.inert) {
31
- document.body.classList.add("block-interactivity-".concat(id));
32
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
33
- allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
34
- return function () {
35
- document.body.classList.remove("block-interactivity-".concat(id));
36
- allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
37
- };
38
- }
39
- return;
40
- }, [props.inert, props.lockRef.current, props.shards]);
41
- var shouldCancelEvent = React.useCallback(function (event, parent) {
42
- if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
43
- return !lastProps.current.allowPinchZoom;
44
- }
45
- var touch = getTouchXY(event);
46
- var touchStart = touchStartRef.current;
47
- var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
48
- var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
49
- var currentAxis;
50
- var target = event.target;
51
- var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
52
- // allow horizontal touch move on Range inputs. They will not cause any scroll
53
- if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
54
- return false;
55
- }
56
- // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
57
- var selection = window.getSelection();
58
- var anchorNode = selection && selection.anchorNode;
59
- var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
60
- if (isTouchingSelection) {
61
- return false;
62
- }
63
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
64
- if (!canBeScrolledInMainDirection) {
65
- return true;
66
- }
67
- if (canBeScrolledInMainDirection) {
68
- currentAxis = moveDirection;
69
- }
70
- else {
71
- currentAxis = moveDirection === 'v' ? 'h' : 'v';
72
- canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
73
- // other axis might be not scrollable
74
- }
75
- if (!canBeScrolledInMainDirection) {
76
- return false;
77
- }
78
- if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
79
- activeAxis.current = currentAxis;
80
- }
81
- if (!currentAxis) {
82
- return true;
83
- }
84
- var cancelingAxis = activeAxis.current || currentAxis;
85
- return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY);
86
- }, []);
87
- var shouldPrevent = React.useCallback(function (_event) {
88
- var event = _event;
89
- if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
90
- // not the last active
91
- return;
92
- }
93
- var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
94
- var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];
95
- // self event, and should be canceled
96
- if (sourceEvent && sourceEvent.should) {
97
- if (event.cancelable) {
98
- event.preventDefault();
99
- }
100
- return;
101
- }
102
- // outside or shard event
103
- if (!sourceEvent) {
104
- var shardNodes = (lastProps.current.shards || [])
105
- .map(extractRef)
106
- .filter(Boolean)
107
- .filter(function (node) { return node.contains(event.target); });
108
- var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
109
- if (shouldStop) {
110
- if (event.cancelable) {
111
- event.preventDefault();
112
- }
113
- }
114
- }
115
- }, []);
116
- var shouldCancel = React.useCallback(function (name, delta, target, should) {
117
- var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };
118
- shouldPreventQueue.current.push(event);
119
- setTimeout(function () {
120
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
121
- }, 1);
122
- }, []);
123
- var scrollTouchStart = React.useCallback(function (event) {
124
- touchStartRef.current = getTouchXY(event);
125
- activeAxis.current = undefined;
126
- }, []);
127
- var scrollWheel = React.useCallback(function (event) {
128
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
129
- }, []);
130
- var scrollTouchMove = React.useCallback(function (event) {
131
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
132
- }, []);
133
- React.useEffect(function () {
134
- lockStack.push(Style);
135
- props.setCallbacks({
136
- onScrollCapture: scrollWheel,
137
- onWheelCapture: scrollWheel,
138
- onTouchMoveCapture: scrollTouchMove,
139
- });
140
- document.addEventListener('wheel', shouldPrevent, nonPassive);
141
- document.addEventListener('touchmove', shouldPrevent, nonPassive);
142
- document.addEventListener('touchstart', scrollTouchStart, nonPassive);
143
- return function () {
144
- lockStack = lockStack.filter(function (inst) { return inst !== Style; });
145
- document.removeEventListener('wheel', shouldPrevent, nonPassive);
146
- document.removeEventListener('touchmove', shouldPrevent, nonPassive);
147
- document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
148
- };
149
- }, []);
150
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
151
- return (React.createElement(React.Fragment, null,
152
- inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
153
- removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));
154
- }
155
- function getOutermostShadowParent(node) {
156
- var shadowParent = null;
157
- while (node !== null) {
158
- if (node instanceof ShadowRoot) {
159
- shadowParent = node.host;
160
- node = node.host;
161
- }
162
- node = node.parentNode;
163
- }
164
- return shadowParent;
165
- }
166
-
167
- export { RemoveScrollSideCar, getDeltaXY, getTouchXY };
@@ -1,38 +0,0 @@
1
- import { __rest, __assign } from '../../../tslib/tslib.es6.js';
2
- import * as React from 'react';
3
- import { zeroRightClassName, fullWidthClassName } from '../../../react-remove-scroll-bar/dist/es2015/constants.js';
4
- import { effectCar } from './medium.js';
5
- import { useMergeRefs } from '../../../use-callback-ref/dist/es2015/useMergeRef.js';
6
-
7
- var nothing = function () {
8
- return;
9
- };
10
- /**
11
- * Removes scrollbar from the page and contain the scroll within the Lock
12
- */
13
- var RemoveScroll = React.forwardRef(function (props, parentRef) {
14
- var ref = React.useRef(null);
15
- var _a = React.useState({
16
- onScrollCapture: nothing,
17
- onWheelCapture: nothing,
18
- onTouchMoveCapture: nothing,
19
- }), callbacks = _a[0], setCallbacks = _a[1];
20
- var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
21
- var SideCar = sideCar;
22
- var containerRef = useMergeRefs([ref, parentRef]);
23
- var containerProps = __assign(__assign({}, rest), callbacks);
24
- return (React.createElement(React.Fragment, null,
25
- enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),
26
- forwardProps ? (React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
27
- });
28
- RemoveScroll.defaultProps = {
29
- enabled: true,
30
- removeScrollBar: true,
31
- inert: false,
32
- };
33
- RemoveScroll.classNames = {
34
- fullWidth: fullWidthClassName,
35
- zeroRight: zeroRightClassName,
36
- };
37
-
38
- export { RemoveScroll };
@@ -1,21 +0,0 @@
1
- var passiveSupported = false;
2
- if (typeof window !== 'undefined') {
3
- try {
4
- var options = Object.defineProperty({}, 'passive', {
5
- get: function () {
6
- passiveSupported = true;
7
- return true;
8
- },
9
- });
10
- // @ts-ignore
11
- window.addEventListener('test', options, options);
12
- // @ts-ignore
13
- window.removeEventListener('test', options, options);
14
- }
15
- catch (err) {
16
- passiveSupported = false;
17
- }
18
- }
19
- var nonPassive = passiveSupported ? { passive: false } : false;
20
-
21
- export { nonPassive };
@@ -1,110 +0,0 @@
1
- var alwaysContainsScroll = function (node) {
2
- // textarea will always _contain_ scroll inside self. It only can be hidden
3
- return node.tagName === 'TEXTAREA';
4
- };
5
- var elementCanBeScrolled = function (node, overflow) {
6
- if (!(node instanceof Element)) {
7
- return false;
8
- }
9
- var styles = window.getComputedStyle(node);
10
- return (
11
- // not-not-scrollable
12
- styles[overflow] !== 'hidden' &&
13
- // contains scroll inside self
14
- !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
15
- };
16
- var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
17
- var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
18
- var locationCouldBeScrolled = function (axis, node) {
19
- var ownerDocument = node.ownerDocument;
20
- var current = node;
21
- do {
22
- // Skip over shadow root
23
- if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
24
- current = current.host;
25
- }
26
- var isScrollable = elementCouldBeScrolled(axis, current);
27
- if (isScrollable) {
28
- var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
29
- if (scrollHeight > clientHeight) {
30
- return true;
31
- }
32
- }
33
- current = current.parentNode;
34
- } while (current && current !== ownerDocument.body);
35
- return false;
36
- };
37
- var getVScrollVariables = function (_a) {
38
- var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
39
- return [
40
- scrollTop,
41
- scrollHeight,
42
- clientHeight,
43
- ];
44
- };
45
- var getHScrollVariables = function (_a) {
46
- var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
47
- return [
48
- scrollLeft,
49
- scrollWidth,
50
- clientWidth,
51
- ];
52
- };
53
- var elementCouldBeScrolled = function (axis, node) {
54
- return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
55
- };
56
- var getScrollVariables = function (axis, node) {
57
- return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
58
- };
59
- var getDirectionFactor = function (axis, direction) {
60
- /**
61
- * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
62
- * and then increasingly negative as you scroll towards the end of the content.
63
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
64
- */
65
- return axis === 'h' && direction === 'rtl' ? -1 : 1;
66
- };
67
- var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
68
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
69
- var delta = directionFactor * sourceDelta;
70
- // find scrollable target
71
- var target = event.target;
72
- var targetInLock = endTarget.contains(target);
73
- var shouldCancelScroll = false;
74
- var isDeltaPositive = delta > 0;
75
- var availableScroll = 0;
76
- var availableScrollTop = 0;
77
- do {
78
- if (!target) {
79
- break;
80
- }
81
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
82
- var elementScroll = scroll_1 - capacity - directionFactor * position;
83
- if (position || elementScroll) {
84
- if (elementCouldBeScrolled(axis, target)) {
85
- availableScroll += elementScroll;
86
- availableScrollTop += position;
87
- }
88
- }
89
- var parent_1 = target.parentNode;
90
- // we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
91
- // this is the same logic used in focus-lock
92
- target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
93
- } while (
94
- // portaled content
95
- (!targetInLock && target !== document.body) ||
96
- // self content
97
- (targetInLock && (endTarget.contains(target) || endTarget === target)));
98
- // handle epsilon around 0 (non standard zoom levels)
99
- if (isDeltaPositive &&
100
- ((Math.abs(availableScroll) < 1) || (false))) {
101
- shouldCancelScroll = true;
102
- }
103
- else if (!isDeltaPositive &&
104
- ((Math.abs(availableScrollTop) < 1) || (false))) {
105
- shouldCancelScroll = true;
106
- }
107
- return shouldCancelScroll;
108
- };
109
-
110
- export { handleScroll, locationCouldBeScrolled };
@@ -1,5 +0,0 @@
1
- import { createSidecarMedium } from '../../../use-sidecar/dist/es2015/medium.js';
2
-
3
- var effectCar = createSidecarMedium();
4
-
5
- export { effectCar };
@@ -1,7 +0,0 @@
1
- import { RemoveScrollSideCar } from './SideEffect.js';
2
- import { effectCar } from './medium.js';
3
- import { exportSidecar } from '../../../use-sidecar/dist/es2015/exports.js';
4
-
5
- const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
6
-
7
- export { SideCar as default };
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
- import { styleSingleton } from '../../../react-style-singleton/dist/es2015/component.js';
3
- import { noScrollbarsClassName, zeroRightClassName, fullWidthClassName, removedBarSizeVariable } from './constants.js';
4
- import { getGapWidth } from './utils.js';
5
-
6
- var Style = styleSingleton();
7
- var lockAttribute = 'data-scroll-locked';
8
- // important tip - once we measure scrollBar width and remove them
9
- // we could not repeat this operation
10
- // thus we are using style-singleton - only the first "yet correct" style will be applied.
11
- var getStyles = function (_a, allowRelative, gapMode, important) {
12
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
13
- if (gapMode === void 0) { gapMode = 'margin'; }
14
- return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
15
- allowRelative && "position: relative ".concat(important, ";"),
16
- gapMode === 'margin' &&
17
- "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
18
- gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
19
- ]
20
- .filter(Boolean)
21
- .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
22
- };
23
- var getCurrentUseCounter = function () {
24
- var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);
25
- return isFinite(counter) ? counter : 0;
26
- };
27
- var useLockAttribute = function () {
28
- React.useEffect(function () {
29
- document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
30
- return function () {
31
- var newCounter = getCurrentUseCounter() - 1;
32
- if (newCounter <= 0) {
33
- document.body.removeAttribute(lockAttribute);
34
- }
35
- else {
36
- document.body.setAttribute(lockAttribute, newCounter.toString());
37
- }
38
- };
39
- }, []);
40
- };
41
- /**
42
- * Removes page scrollbar and blocks page scroll when mounted
43
- */
44
- var RemoveScrollBar = function (_a) {
45
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;
46
- useLockAttribute();
47
- /*
48
- gap will be measured on every component mount
49
- however it will be used only by the "first" invocation
50
- due to singleton nature of <Style
51
- */
52
- var gap = React.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
53
- return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
54
- };
55
-
56
- export { RemoveScrollBar, lockAttribute, useLockAttribute };
@@ -1,10 +0,0 @@
1
- var zeroRightClassName = 'right-scroll-bar-position';
2
- var fullWidthClassName = 'width-before-scroll-bar';
3
- var noScrollbarsClassName = 'with-scroll-bars-hidden';
4
- /**
5
- * Name of a CSS variable containing the amount of "hidden" scrollbar
6
- * ! might be undefined ! use will fallback!
7
- */
8
- var removedBarSizeVariable = '--removed-body-scroll-bar-size';
9
-
10
- export { fullWidthClassName, noScrollbarsClassName, removedBarSizeVariable, zeroRightClassName };
@@ -1,31 +0,0 @@
1
- var zeroGap = {
2
- left: 0,
3
- top: 0,
4
- right: 0,
5
- gap: 0,
6
- };
7
- var parse = function (x) { return parseInt(x || '', 10) || 0; };
8
- var getOffset = function (gapMode) {
9
- var cs = window.getComputedStyle(document.body);
10
- var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
11
- var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
12
- var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
13
- return [parse(left), parse(top), parse(right)];
14
- };
15
- var getGapWidth = function (gapMode) {
16
- if (gapMode === void 0) { gapMode = 'margin'; }
17
- if (typeof window === 'undefined') {
18
- return zeroGap;
19
- }
20
- var offsets = getOffset(gapMode);
21
- var documentWidth = document.documentElement.clientWidth;
22
- var windowWidth = window.innerWidth;
23
- return {
24
- left: offsets[0],
25
- top: offsets[1],
26
- right: offsets[2],
27
- gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
28
- };
29
- };
30
-
31
- export { getGapWidth, zeroGap };
@@ -1,19 +0,0 @@
1
- import { styleHookSingleton } from './hook.js';
2
-
3
- /**
4
- * create a Component to add styles on demand
5
- * - styles are added when first instance is mounted
6
- * - styles are removed when the last instance is unmounted
7
- * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
8
- */
9
- var styleSingleton = function () {
10
- var useStyle = styleHookSingleton();
11
- var Sheet = function (_a) {
12
- var styles = _a.styles, dynamic = _a.dynamic;
13
- useStyle(styles, dynamic);
14
- return null;
15
- };
16
- return Sheet;
17
- };
18
-
19
- export { styleSingleton };
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { stylesheetSingleton } from './singleton.js';
3
-
4
- /**
5
- * creates a hook to control style singleton
6
- * @see {@link styleSingleton} for a safer component version
7
- * @example
8
- * ```tsx
9
- * const useStyle = styleHookSingleton();
10
- * ///
11
- * useStyle('body { overflow: hidden}');
12
- */
13
- var styleHookSingleton = function () {
14
- var sheet = stylesheetSingleton();
15
- return function (styles, isDynamic) {
16
- React.useEffect(function () {
17
- sheet.add(styles);
18
- return function () {
19
- sheet.remove();
20
- };
21
- }, [styles && isDynamic]);
22
- };
23
- };
24
-
25
- export { styleHookSingleton };
@@ -1,51 +0,0 @@
1
- import { getNonce } from '../../../get-nonce/dist/es2015/index.js';
2
-
3
- function makeStyleTag() {
4
- if (!document)
5
- return null;
6
- var tag = document.createElement('style');
7
- tag.type = 'text/css';
8
- var nonce = getNonce();
9
- if (nonce) {
10
- tag.setAttribute('nonce', nonce);
11
- }
12
- return tag;
13
- }
14
- function injectStyles(tag, css) {
15
- // @ts-ignore
16
- if (tag.styleSheet) {
17
- // @ts-ignore
18
- tag.styleSheet.cssText = css;
19
- }
20
- else {
21
- tag.appendChild(document.createTextNode(css));
22
- }
23
- }
24
- function insertStyleTag(tag) {
25
- var head = document.head || document.getElementsByTagName('head')[0];
26
- head.appendChild(tag);
27
- }
28
- var stylesheetSingleton = function () {
29
- var counter = 0;
30
- var stylesheet = null;
31
- return {
32
- add: function (style) {
33
- if (counter == 0) {
34
- if ((stylesheet = makeStyleTag())) {
35
- injectStyles(stylesheet, style);
36
- insertStyleTag(stylesheet);
37
- }
38
- }
39
- counter++;
40
- },
41
- remove: function () {
42
- counter--;
43
- if (!counter && stylesheet) {
44
- stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
45
- stylesheet = null;
46
- }
47
- },
48
- };
49
- };
50
-
51
- export { stylesheetSingleton };