@layers-app/shared 0.2.6 → 0.2.8-test

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 (186) hide show
  1. package/dist/assets/svg/socials/instagram.svg.js +3 -3
  2. package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
  3. package/dist/components/AliasTextInput/AliasTextInput.js +21 -20
  4. package/dist/components/AppContainer/AppContainer.js +3 -3
  5. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -1
  7. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppSidebarButton.js +4 -4
  9. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +40 -32
  11. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  12. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +41 -33
  13. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  14. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +58 -49
  15. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  16. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +151 -51
  17. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  18. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  19. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  20. package/dist/components/AppContainer/hooks/useAppContainer.js +46 -43
  21. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  22. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
  23. package/dist/components/AppContainer/types.d.ts +2 -1
  24. package/dist/components/AppContainer/types.d.ts.map +1 -1
  25. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  26. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  27. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  29. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  30. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  31. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  32. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  33. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  34. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  35. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  36. package/dist/components/EmojiPicker/EmojiPicker.js +28 -29
  37. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  38. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  39. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  40. package/dist/components/FeatureProgress/FeatureProgress.d.ts +11 -0
  41. package/dist/components/FeatureProgress/FeatureProgress.d.ts.map +1 -0
  42. package/dist/components/FeatureProgress/FeatureProgress.js +148 -0
  43. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +81 -0
  44. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts +2 -0
  45. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts.map +1 -0
  46. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.js +88 -0
  47. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts +9 -0
  48. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts.map +1 -0
  49. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.js +35 -0
  50. package/dist/components/FeatureProgress/constants.d.ts +4 -0
  51. package/dist/components/FeatureProgress/constants.d.ts.map +1 -0
  52. package/dist/components/FeatureProgress/constants.js +4 -0
  53. package/dist/components/FeatureProgress/index.d.ts +3 -0
  54. package/dist/components/FeatureProgress/index.d.ts.map +1 -0
  55. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  56. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  57. package/dist/components/FilePicker/FilePicker.js +247 -229
  58. package/dist/components/FilePicker/FilePicker.module.css.js +12 -10
  59. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  60. package/dist/components/FilePicker/FilePickerGallery.js +59 -33
  61. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  62. package/dist/components/FilePicker/FilePickerGiphy.js +38 -38
  63. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  64. package/dist/components/FilePicker/FilePickerLink.js +18 -15
  65. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  66. package/dist/components/FilePicker/FilePickerUnsplash.js +39 -39
  67. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  68. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  69. package/dist/components/FilePicker/api/giphyApi.js +10 -10
  70. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  71. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  72. package/dist/components/FilePicker/coverCollections.js +164 -0
  73. package/dist/components/FilePicker/index.d.ts +1 -0
  74. package/dist/components/FilePicker/index.d.ts.map +1 -1
  75. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  76. package/dist/components/FormViewer/components/OneSlideLayput.js +39 -37
  77. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  78. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  79. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  80. package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.js +42 -42
  81. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  82. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  83. package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts.map +1 -1
  84. package/dist/components/FormViewer/hooks/useCreateFormContext.js +10 -10
  85. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  86. package/dist/components/FormViewer/store/formStoreApi.js +13 -13
  87. package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -1
  88. package/dist/components/ImageCropper/ImageCropper.js +185 -183
  89. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  90. package/dist/components/ImageCropper/index.d.ts +1 -1
  91. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  92. package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -1
  93. package/dist/components/ImageCropper/useCropInteraction.js +13 -2
  94. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
  95. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +7 -7
  96. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +1 -1
  97. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -1
  98. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +3 -1
  99. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +1 -1
  100. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -1
  101. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +3 -1
  102. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  103. package/dist/components/LanguagePicker/LanguagePicker.js +45 -35
  104. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +6 -4
  105. package/dist/components/Loaders/styles.module.css.js +6 -6
  106. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  107. package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -1
  108. package/dist/components/MediaLibrary/MediaLibraryRow.js +16 -4
  109. package/dist/components/NavMenu/NavMenu.d.ts +2 -1
  110. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  111. package/dist/components/NavMenu/NavMenu.module.css.js +16 -16
  112. package/dist/components/NavMenu/components/NavMenuItem.d.ts +2 -1
  113. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  114. package/dist/components/NavMenu/components/NavMenuItem.js +128 -106
  115. package/dist/components/NavMenu/types.d.ts +1 -0
  116. package/dist/components/NavMenu/types.d.ts.map +1 -1
  117. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  118. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  119. package/dist/components/Notification/Notification.module.css.js +1 -1
  120. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  121. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  122. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  123. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +17 -0
  124. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -0
  125. package/dist/components/OnboardingTour/OnboardingTourFooter.js +40 -0
  126. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +13 -0
  127. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -0
  128. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +164 -0
  129. package/dist/components/OnboardingTour/index.d.ts +4 -0
  130. package/dist/components/OnboardingTour/index.d.ts.map +1 -0
  131. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +14 -0
  132. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -0
  133. package/dist/components/OnboardingTour/useOnboardingTour.js +50 -0
  134. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  135. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  136. package/dist/components/SocialLinkRow/index.d.ts.map +1 -1
  137. package/dist/components/SocialLinkRow/index.js +80 -58
  138. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  139. package/dist/components/TimezonePicker/index.d.ts.map +1 -1
  140. package/dist/components/TimezonePicker/index.js +42 -41
  141. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  142. package/dist/components/UserAvatar/index.js +11 -10
  143. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  144. package/dist/components/WorkspaceMenu/WorkspaceItem.js +21 -21
  145. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  146. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +74 -74
  147. package/dist/components/table/FrontTable.d.ts.map +1 -1
  148. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  149. package/dist/helpers/getFileIcons.js +1 -1
  150. package/dist/helpers/getFileType.d.ts +1 -1
  151. package/dist/helpers/getFileType.d.ts.map +1 -1
  152. package/dist/helpers/platform.d.ts +14 -0
  153. package/dist/helpers/platform.d.ts.map +1 -0
  154. package/dist/helpers/platform.js +33 -0
  155. package/dist/helpers/showFeatureFeedback.d.ts +16 -0
  156. package/dist/helpers/showFeatureFeedback.d.ts.map +1 -0
  157. package/dist/helpers/showFeatureFeedback.js +109 -0
  158. package/dist/helpers/showFeatureFeedback.module.css.js +9 -0
  159. package/dist/helpers/showNotifications.d.ts.map +1 -1
  160. package/dist/helpers/showNotifications.js +81 -113
  161. package/dist/helpers/showNotifications.module.css.js +10 -10
  162. package/dist/hooks/useFeatureFeedback.d.ts +23 -0
  163. package/dist/hooks/useFeatureFeedback.d.ts.map +1 -0
  164. package/dist/hooks/useFeatureFeedback.js +45 -0
  165. package/dist/hooks/usePlatform.d.ts +3 -0
  166. package/dist/hooks/usePlatform.d.ts.map +1 -0
  167. package/dist/hooks/usePlatform.js +10 -0
  168. package/dist/index.css +1 -1
  169. package/dist/index.d.ts +8 -0
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +373 -334
  172. package/dist/lang/locales/ui_en.json.js +15 -15
  173. package/dist/lang/locales/ui_es.json.js +13 -13
  174. package/dist/lang/locales/ui_ru.json.js +12 -12
  175. package/dist/lib/contentImport/lexicalSerializer.js +59 -47
  176. package/dist/lib/contentImport/utils.d.ts.map +1 -1
  177. package/dist/lib/layersVisitData.d.ts +13 -0
  178. package/dist/lib/layersVisitData.d.ts.map +1 -0
  179. package/dist/lib/layersVisitData.js +37 -0
  180. package/dist/store/featureProgress.d.ts +39 -0
  181. package/dist/store/featureProgress.d.ts.map +1 -0
  182. package/dist/store/featureProgress.js +68 -0
  183. package/dist/store/plansModal.d.ts.map +1 -1
  184. package/dist/store/plansModal.js +8 -6
  185. package/docs/README.md +499 -499
  186. package/package.json +75 -74
@@ -1 +1 @@
1
- {"version":3,"file":"formStore.d.ts","sourceRoot":"","sources":["../../../../src/components/FormViewer/store/formStore.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACT,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AACvE,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,CAAC;AACxD,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;CACxD;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD7hO,CAAC"}
@@ -6,11 +6,11 @@ const O = (e) => {
6
6
  ...t,
7
7
  ...n
8
8
  }));
9
- }, m = () => e.getState().config, s = () => {
10
- e.getState().onConfigChange?.(m());
9
+ }, l = () => e.getState().config, s = () => {
10
+ e.getState().onConfigChange?.(l());
11
11
  }, u = (n) => {
12
12
  e.setState({ layout: n });
13
- }, S = (n) => {
13
+ }, m = (n) => {
14
14
  e.setState((t) => ({
15
15
  ...t,
16
16
  config: {
@@ -122,7 +122,7 @@ const O = (e) => {
122
122
  steps: o
123
123
  }
124
124
  };
125
- }), h(n.id), s();
125
+ }), S(n.id), s();
126
126
  }, A = (n) => {
127
127
  e.setState((i) => ({
128
128
  ...i,
@@ -130,7 +130,7 @@ const O = (e) => {
130
130
  ...i.config,
131
131
  steps: i.config.steps.filter((o) => o.id !== n) || []
132
132
  }
133
- })), E(e.getState()) === n && l(), s();
133
+ })), E(e.getState()) === n && h(), s();
134
134
  }, F = (n, t) => {
135
135
  n === "list" ? e.setState((i) => ({
136
136
  ...i,
@@ -291,7 +291,7 @@ const O = (e) => {
291
291
  ...o,
292
292
  initialConfigSnapshot: n
293
293
  })), t || s();
294
- }, h = (n) => {
294
+ }, S = (n) => {
295
295
  e.setState((t) => {
296
296
  const i = [
297
297
  ...t.activeStep.history.slice(0, t.activeStep.current + 1),
@@ -324,10 +324,10 @@ const O = (e) => {
324
324
  )
325
325
  }
326
326
  }));
327
- }, l = () => {
327
+ }, h = () => {
328
328
  e.setState({
329
329
  activeStep: {
330
- history: [],
330
+ history: [null],
331
331
  current: 0
332
332
  }
333
333
  });
@@ -343,7 +343,7 @@ const O = (e) => {
343
343
  })), s();
344
344
  },
345
345
  setLayout: u,
346
- patchSettingsData: S,
346
+ patchSettingsData: m,
347
347
  patchThemeData: C,
348
348
  patchContainerTheme: y,
349
349
  patchTitleProperties: b,
@@ -363,19 +363,19 @@ const O = (e) => {
363
363
  removeCondition: V,
364
364
  setIsMobile: _,
365
365
  setConfig: $,
366
- setActiveStepId: h,
366
+ setActiveStepId: S,
367
367
  setFormLayout: (n) => {
368
- S({ layout: n }), s();
368
+ m({ layout: n }), s();
369
369
  },
370
370
  scrollToControl: (n) => {
371
371
  const t = document.querySelector(`[data-control-id='${n}']`);
372
372
  t && t.scrollIntoView({ behavior: "smooth", block: "center" });
373
373
  },
374
- getConfig: m,
374
+ getConfig: l,
375
375
  setProps: r,
376
376
  forwardActiveStep: z,
377
377
  backActiveStep: j,
378
- resetActiveStep: l
378
+ resetActiveStep: h
379
379
  };
380
380
  };
381
381
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCropper.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCropper/ImageCropper.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AASD,eAAO,MAAM,YAAY,GAAI,oFAQ1B,iBAAiB,4CAuiBnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ImageCropper.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCropper/ImageCropper.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AASD,eAAO,MAAM,YAAY,GAAI,oFAQ1B,iBAAiB,4CAqjBnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,250 +1,252 @@
1
- import { jsxs as X, jsx as g, Fragment as T } from "react/jsx-runtime";
2
- import { useRef as R, useState as E, useMemo as he, useEffect as q, useCallback as C } from "react";
3
- import { Box as se } from "@mantine/core";
4
- import { useElementSize as re } from "@mantine/hooks";
5
- import r from "./ImageCropper.module.css.js";
6
- const ge = ({
7
- src: z,
8
- variant: Y = "square",
9
- aspectRatio: c = 1,
10
- minSize: f = 50,
11
- maxSize: v,
12
- onCropComplete: F,
13
- onCropDataChange: O
1
+ import { jsxs as b, jsx as a, Fragment as O } from "react/jsx-runtime";
2
+ import { useRef as ne, useState as H, useMemo as ce, useEffect as j, useCallback as G } from "react";
3
+ import { Box as oe } from "@mantine/core";
4
+ import { useElementSize as ae } from "@mantine/hooks";
5
+ import h from "./ImageCropper.module.css.js";
6
+ const fe = ({
7
+ src: ie,
8
+ variant: I = "square",
9
+ aspectRatio: o = 1,
10
+ minSize: m = 50,
11
+ maxSize: X,
12
+ onCropComplete: J,
13
+ onCropDataChange: K
14
14
  }) => {
15
15
  const {
16
- ref: ee,
17
- width: M,
18
- height: L
19
- } = re(), $ = R(null), j = R(null), [H, te] = E(!1), [m, ne] = E({ width: 0, height: 0 }), o = he(() => {
20
- if (!H || M === 0 || L === 0 || m.width === 0)
21
- return { x: 0, y: 0, width: M, height: L };
22
- const i = M / L, h = m.width / m.height;
23
- if (h > i) {
24
- const d = M / h;
16
+ ref: he,
17
+ width: v,
18
+ height: M
19
+ } = ae(), W = ne(null), Q = ne(null), [Y, se] = H(!1), [f, de] = H({ width: 0, height: 0 }), r = ce(() => {
20
+ if (!Y || v === 0 || M === 0 || f.width === 0)
21
+ return { x: 0, y: 0, width: v, height: M };
22
+ const n = v / M, i = f.width / f.height;
23
+ if (i > n) {
24
+ const s = v / i;
25
25
  return {
26
26
  x: 0,
27
- y: (L - d) / 2,
28
- width: M,
29
- height: d
27
+ y: (M - s) / 2,
28
+ width: v,
29
+ height: s
30
30
  };
31
31
  } else {
32
- const d = L * h;
32
+ const s = M * i;
33
33
  return {
34
- x: (M - d) / 2,
34
+ x: (v - s) / 2,
35
35
  y: 0,
36
- width: d,
37
- height: L
36
+ width: s,
37
+ height: M
38
38
  };
39
39
  }
40
- }, [H, M, L, m]), [t, G] = E({
40
+ }, [Y, v, M, f]), [t, U] = H({
41
41
  x: 0,
42
42
  y: 0,
43
43
  width: 200,
44
44
  height: 200
45
- }), [W, K] = E(!1), [D, Q] = E(!1), [w, U] = E(null), [J, V] = E({ x: 0, y: 0 }), [e, Z] = E({
45
+ }), [P, Z] = H(!1), [T, _] = H(!1), [l, S] = H(null), [V, R] = H({ x: 0, y: 0 }), [e, z] = H({
46
46
  x: 0,
47
47
  y: 0,
48
48
  width: 0,
49
49
  height: 0
50
50
  });
51
- q(() => {
52
- if (!H || M === 0 || L === 0 || o.width === 0)
51
+ j(() => {
52
+ if (!Y || v === 0 || M === 0 || r.width === 0)
53
53
  return;
54
- let i, h, d = Math.min(o.width, o.height) * 0.8;
55
- v && (d = Math.min(d, v)), c >= 1 ? (i = d, h = d / c) : (h = d, i = d * c);
56
- const u = o.x + (o.width - i) / 2, b = o.y + (o.height - h) / 2;
57
- G({ x: u, y: b, width: i, height: h });
54
+ let n, i, s = Math.min(r.width, r.height) * 0.8;
55
+ X && (s = Math.min(s, X)), o >= 1 ? (n = s, i = s / o) : (i = s, n = s * o);
56
+ const u = r.x + (r.width - n) / 2, k = r.y + (r.height - i) / 2;
57
+ U({ x: u, y: k, width: n, height: i });
58
58
  }, [
59
- H,
60
- c,
61
- M,
62
- L,
59
+ Y,
63
60
  o,
64
- v
61
+ v,
62
+ M,
63
+ r,
64
+ X
65
65
  ]);
66
- const ie = C(() => {
67
- $.current && (ne({
68
- width: $.current.naturalWidth,
69
- height: $.current.naturalHeight
70
- }), te(!0));
71
- }, []), _ = C(
72
- (i) => {
73
- i.preventDefault(), i.stopPropagation();
74
- const h = "touches" in i ? i.touches[0].clientX : i.clientX, d = "touches" in i ? i.touches[0].clientY : i.clientY;
75
- K(!0), V({ x: h, y: d }), Z({ ...t });
66
+ const re = G(() => {
67
+ W.current && (de({
68
+ width: W.current.naturalWidth,
69
+ height: W.current.naturalHeight
70
+ }), se(!0));
71
+ }, []), ee = G(
72
+ (n) => {
73
+ n.preventDefault(), n.stopPropagation();
74
+ const i = "touches" in n ? n.touches[0].clientX : n.clientX, s = "touches" in n ? n.touches[0].clientY : n.clientY;
75
+ Z(!0), R({ x: i, y: s }), z({ ...t });
76
76
  },
77
77
  [t]
78
- ), A = C(
79
- (i) => (h) => {
80
- h.preventDefault(), h.stopPropagation();
81
- const d = "touches" in h ? h.touches[0].clientX : h.clientX, u = "touches" in h ? h.touches[0].clientY : h.clientY;
82
- Q(!0), U(i), V({ x: d, y: u }), Z({ ...t });
78
+ ), q = G(
79
+ (n) => (i) => {
80
+ i.preventDefault(), i.stopPropagation();
81
+ const s = "touches" in i ? i.touches[0].clientX : i.clientX, u = "touches" in i ? i.touches[0].clientY : i.clientY;
82
+ _(!0), S(n), R({ x: s, y: u }), z({ ...t });
83
83
  },
84
84
  [t]
85
85
  );
86
- q(() => {
87
- const i = (d) => {
88
- if (!W && !D) return;
89
- const u = "touches" in d ? d.touches[0].clientX : d.clientX, b = "touches" in d ? d.touches[0].clientY : d.clientY, y = u - J.x, k = b - J.y, p = o.x, x = o.y, N = o.x + o.width, I = o.y + o.height;
90
- if (W) {
91
- let a = e.x + y, l = e.y + k;
92
- a = Math.max(p, Math.min(a, N - t.width)), l = Math.max(x, Math.min(l, I - t.height)), G((n) => ({ ...n, x: a, y: l }));
86
+ j(() => {
87
+ const n = (s) => {
88
+ if (!P && !T) return;
89
+ const u = "touches" in s ? s.touches[0].clientX : s.clientX, k = "touches" in s ? s.touches[0].clientY : s.clientY, y = u - V.x, D = k - V.y, B = r.x, L = r.y, N = r.x + r.width, A = r.y + r.height;
90
+ if (P) {
91
+ let g = e.x + y, w = e.y + D;
92
+ g = Math.max(B, Math.min(g, N - t.width)), w = Math.max(L, Math.min(w, A - t.height)), U((d) => ({ ...d, x: g, y: w }));
93
93
  }
94
- if (D && w) {
95
- let a = e.x, l = e.y, n = e.width, s = e.height;
96
- switch (w) {
94
+ if (T && l) {
95
+ let g = e.x, w = e.y, d = e.width, c = e.height;
96
+ switch (l) {
97
97
  case "se":
98
- n = Math.max(f, e.width + y), s = n / c;
98
+ d = Math.max(m, e.width + y), c = d / o;
99
99
  break;
100
100
  case "sw":
101
- n = Math.max(f, e.width - y), s = n / c, a = e.x + e.width - n;
101
+ d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d;
102
102
  break;
103
103
  case "ne":
104
- n = Math.max(f, e.width + y), s = n / c, l = e.y + e.height - s;
104
+ d = Math.max(m, e.width + y), c = d / o, w = e.y + e.height - c;
105
105
  break;
106
106
  case "nw":
107
- n = Math.max(f, e.width - y), s = n / c, a = e.x + e.width - n, l = e.y + e.height - s;
107
+ d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d, w = e.y + e.height - c;
108
108
  break;
109
109
  case "e":
110
- n = Math.max(f, e.width + y), s = n / c, l = e.y + (e.height - s) / 2;
110
+ d = Math.max(m, e.width + y), c = d / o, w = e.y + (e.height - c) / 2;
111
111
  break;
112
112
  case "w":
113
- n = Math.max(f, e.width - y), s = n / c, a = e.x + e.width - n, l = e.y + (e.height - s) / 2;
113
+ d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d, w = e.y + (e.height - c) / 2;
114
114
  break;
115
115
  case "s":
116
- s = Math.max(f, e.height + k), n = s * c, a = e.x + (e.width - n) / 2;
116
+ c = Math.max(m, e.height + D), d = c * o, g = e.x + (e.width - d) / 2;
117
117
  break;
118
118
  case "n":
119
- s = Math.max(f, e.height - k), n = s * c, a = e.x + (e.width - n) / 2, l = e.y + e.height - s;
119
+ c = Math.max(m, e.height - D), d = c * o, g = e.x + (e.width - d) / 2, w = e.y + e.height - c;
120
120
  break;
121
121
  }
122
- v && (c >= 1 ? n > v && (n = v, s = n / c, w.includes("w") && (a = e.x + e.width - n), w.includes("n") && (l = e.y + e.height - s), (w === "e" || w === "w") && (l = e.y + (e.height - s) / 2), (w === "n" || w === "s") && (a = e.x + (e.width - n) / 2)) : s > v && (s = v, n = s * c, w.includes("w") && (a = e.x + e.width - n), w.includes("n") && (l = e.y + e.height - s), (w === "e" || w === "w") && (l = e.y + (e.height - s) / 2), (w === "n" || w === "s") && (a = e.x + (e.width - n) / 2))), a < p && (n += a - p, s = n / c, a = p), l < x && (s += l - x, n = s * c, l = x), a + n > N && (n = N - a, s = n / c), l + s > I && (s = I - l, n = s * c), n >= f && s >= f && G({ x: a, y: l, width: n, height: s });
122
+ const p = l.includes("w") ? e.x + e.width : l.includes("e") ? e.x : e.x + e.width / 2, $ = l.includes("n") ? e.y + e.height : l.includes("s") ? e.y : e.y + e.height / 2;
123
+ let x, E;
124
+ l.includes("w") ? x = p - B : l.includes("e") ? x = N - p : x = Math.min(p - B, N - p) * 2, l.includes("n") ? E = $ - L : l.includes("s") ? E = A - $ : E = Math.min($ - L, A - $) * 2, X && (o >= 1 ? x = Math.min(x, X) : E = Math.min(E, X)), x / o < E ? E = x / o : x = E * o, d > x && (d = x, c = d / o), l.includes("w") ? g = p - d : l.includes("e") ? g = p : g = p - d / 2, l.includes("n") ? w = $ - c : l.includes("s") ? w = $ : w = $ - c / 2, d >= m && c >= m && U({ x: g, y: w, width: d, height: c });
123
125
  }
124
- }, h = () => {
125
- K(!1), Q(!1), U(null);
126
+ }, i = () => {
127
+ Z(!1), _(!1), S(null);
126
128
  };
127
- return (W || D) && (window.addEventListener("mousemove", i), window.addEventListener("mouseup", h), window.addEventListener("touchmove", i), window.addEventListener("touchend", h)), () => {
128
- window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", h), window.removeEventListener("touchmove", i), window.removeEventListener("touchend", h);
129
+ return (P || T) && (window.addEventListener("mousemove", n), window.addEventListener("mouseup", i), window.addEventListener("touchmove", n), window.addEventListener("touchend", i)), () => {
130
+ window.removeEventListener("mousemove", n), window.removeEventListener("mouseup", i), window.removeEventListener("touchmove", n), window.removeEventListener("touchend", i);
129
131
  };
130
132
  }, [
131
- W,
132
- D,
133
- w,
134
- J,
133
+ P,
134
+ T,
135
+ l,
136
+ V,
135
137
  e,
136
- o,
138
+ r,
137
139
  t.width,
138
140
  t.height,
139
- c,
140
- f,
141
- v
142
- ]), q(() => {
143
- if (O && H && o.width > 0) {
144
- const i = m.width / o.width, h = m.height / o.height;
145
- O({
146
- x: (t.x - o.x) * i,
147
- y: (t.y - o.y) * h,
148
- width: t.width * i,
149
- height: t.height * h,
150
- scale: i
141
+ o,
142
+ m,
143
+ X
144
+ ]), j(() => {
145
+ if (K && Y && r.width > 0) {
146
+ const n = f.width / r.width, i = f.height / r.height;
147
+ K({
148
+ x: (t.x - r.x) * n,
149
+ y: (t.y - r.y) * i,
150
+ width: t.width * n,
151
+ height: t.height * i,
152
+ scale: n
151
153
  });
152
154
  }
153
- }, [t, m, o, H, O]);
154
- const S = C(() => new Promise((i, h) => {
155
- if (!$.current || !j.current) {
156
- h(new Error("Image or canvas not ready"));
155
+ }, [t, f, r, Y, K]);
156
+ const te = G(() => new Promise((n, i) => {
157
+ if (!W.current || !Q.current) {
158
+ i(new Error("Image or canvas not ready"));
157
159
  return;
158
160
  }
159
- const d = j.current, u = d.getContext("2d");
161
+ const s = Q.current, u = s.getContext("2d");
160
162
  if (!u) {
161
- h(new Error("Could not get canvas context"));
163
+ i(new Error("Could not get canvas context"));
162
164
  return;
163
165
  }
164
- const b = m.width / o.width, y = m.height / o.height, k = (t.x - o.x) * b, p = (t.y - o.y) * y, x = t.width * b, N = t.height * y;
165
- d.width = x, d.height = N, Y === "rounded" && (u.beginPath(), u.arc(
166
- x / 2,
166
+ const k = f.width / r.width, y = f.height / r.height, D = (t.x - r.x) * k, B = (t.y - r.y) * y, L = t.width * k, N = t.height * y;
167
+ s.width = L, s.height = N, I === "rounded" && (u.beginPath(), u.arc(
168
+ L / 2,
167
169
  N / 2,
168
- Math.min(x, N) / 2,
170
+ Math.min(L, N) / 2,
169
171
  0,
170
172
  Math.PI * 2
171
173
  ), u.closePath(), u.clip()), u.drawImage(
172
- $.current,
173
- k,
174
- p,
175
- x,
174
+ W.current,
175
+ D,
176
+ B,
177
+ L,
176
178
  N,
177
179
  0,
178
180
  0,
179
- x,
181
+ L,
180
182
  N
181
- ), d.toBlob(
182
- (I) => {
183
- I ? i(I) : h(new Error("Failed to create blob"));
183
+ ), s.toBlob(
184
+ (A) => {
185
+ A ? n(A) : i(new Error("Failed to create blob"));
184
186
  },
185
187
  "image/png",
186
188
  1
187
189
  );
188
- }), [t, m, o, Y]);
189
- q(() => {
190
- F && S().then(F).catch(() => {
190
+ }), [t, f, r, I]);
191
+ j(() => {
192
+ J && te().then(J).catch(() => {
191
193
  });
192
- }, [S, F]);
193
- const B = (i) => {
194
- const h = {
195
- nw: r.handleNW,
196
- ne: r.handleNE,
197
- sw: r.handleSW,
198
- se: r.handleSE
194
+ }, [te, J]);
195
+ const C = (n) => {
196
+ const i = {
197
+ nw: h.handleNW,
198
+ ne: h.handleNE,
199
+ sw: h.handleSW,
200
+ se: h.handleSE
199
201
  };
200
- return /* @__PURE__ */ X(
202
+ return /* @__PURE__ */ b(
201
203
  "div",
202
204
  {
203
- className: `${r.cornerHandle} ${h[i]}`,
204
- onMouseDown: A(i),
205
- onTouchStart: A(i),
205
+ className: `${h.cornerHandle} ${i[n]}`,
206
+ onMouseDown: q(n),
207
+ onTouchStart: q(n),
206
208
  children: [
207
- /* @__PURE__ */ g("div", { className: r.cornerHandleArm, "data-direction": "horizontal" }),
208
- /* @__PURE__ */ g("div", { className: r.cornerHandleArm, "data-direction": "vertical" })
209
+ /* @__PURE__ */ a("div", { className: h.cornerHandleArm, "data-direction": "horizontal" }),
210
+ /* @__PURE__ */ a("div", { className: h.cornerHandleArm, "data-direction": "vertical" })
209
211
  ]
210
212
  }
211
213
  );
212
- }, P = (i) => {
213
- const h = {
214
- n: r.handleN,
215
- s: r.handleS,
216
- e: r.handleE,
217
- w: r.handleW
214
+ }, F = (n) => {
215
+ const i = {
216
+ n: h.handleN,
217
+ s: h.handleS,
218
+ e: h.handleE,
219
+ w: h.handleW
218
220
  };
219
- return /* @__PURE__ */ g(
221
+ return /* @__PURE__ */ a(
220
222
  "div",
221
223
  {
222
- className: `${r.edgeHandle} ${h[i]}`,
223
- onMouseDown: A(i),
224
- onTouchStart: A(i),
225
- children: /* @__PURE__ */ g("div", { className: r.edgeHandleBar })
224
+ className: `${h.edgeHandle} ${i[n]}`,
225
+ onMouseDown: q(n),
226
+ onTouchStart: q(n),
227
+ children: /* @__PURE__ */ a("div", { className: h.edgeHandleBar })
226
228
  }
227
229
  );
228
230
  };
229
- return /* @__PURE__ */ X(se, { className: r.container, ref: ee, children: [
230
- /* @__PURE__ */ g("canvas", { ref: j, style: { display: "none" } }),
231
- /* @__PURE__ */ g(
231
+ return /* @__PURE__ */ b(oe, { className: h.container, ref: he, children: [
232
+ /* @__PURE__ */ a("canvas", { ref: Q, style: { display: "none" } }),
233
+ /* @__PURE__ */ a(
232
234
  "img",
233
235
  {
234
- ref: $,
235
- src: z,
236
+ ref: W,
237
+ src: ie,
236
238
  alt: "Crop preview",
237
- className: r.image,
238
- onLoad: ie,
239
+ className: h.image,
240
+ onLoad: re,
239
241
  draggable: !1
240
242
  }
241
243
  ),
242
- H && /* @__PURE__ */ X(T, { children: [
243
- Y === "square" ? /* @__PURE__ */ X(T, { children: [
244
- /* @__PURE__ */ g(
244
+ Y && /* @__PURE__ */ b(O, { children: [
245
+ I === "square" ? /* @__PURE__ */ b(O, { children: [
246
+ /* @__PURE__ */ a(
245
247
  "div",
246
248
  {
247
- className: r.overlay,
249
+ className: h.overlay,
248
250
  style: {
249
251
  top: 0,
250
252
  left: 0,
@@ -253,10 +255,10 @@ const ge = ({
253
255
  }
254
256
  }
255
257
  ),
256
- /* @__PURE__ */ g(
258
+ /* @__PURE__ */ a(
257
259
  "div",
258
260
  {
259
- className: r.overlay,
261
+ className: h.overlay,
260
262
  style: {
261
263
  top: t.y + t.height,
262
264
  left: 0,
@@ -265,10 +267,10 @@ const ge = ({
265
267
  }
266
268
  }
267
269
  ),
268
- /* @__PURE__ */ g(
270
+ /* @__PURE__ */ a(
269
271
  "div",
270
272
  {
271
- className: r.overlay,
273
+ className: h.overlay,
272
274
  style: {
273
275
  top: t.y,
274
276
  left: 0,
@@ -277,10 +279,10 @@ const ge = ({
277
279
  }
278
280
  }
279
281
  ),
280
- /* @__PURE__ */ g(
282
+ /* @__PURE__ */ a(
281
283
  "div",
282
284
  {
283
- className: r.overlay,
285
+ className: h.overlay,
284
286
  style: {
285
287
  top: t.y,
286
288
  left: t.x + t.width,
@@ -289,10 +291,10 @@ const ge = ({
289
291
  }
290
292
  }
291
293
  )
292
- ] }) : /* @__PURE__ */ g(
294
+ ] }) : /* @__PURE__ */ a(
293
295
  "div",
294
296
  {
295
- className: r.circularOverlay,
297
+ className: h.circularOverlay,
296
298
  style: {
297
299
  left: t.x + t.width / 2,
298
300
  top: t.y + t.height / 2,
@@ -301,49 +303,49 @@ const ge = ({
301
303
  }
302
304
  }
303
305
  ),
304
- /* @__PURE__ */ X(
306
+ /* @__PURE__ */ b(
305
307
  "div",
306
308
  {
307
- className: `${r.cropArea} ${Y === "rounded" ? r.cropAreaRounded : ""}`,
309
+ className: `${h.cropArea} ${I === "rounded" ? h.cropAreaRounded : ""}`,
308
310
  style: {
309
311
  left: t.x,
310
312
  top: t.y,
311
313
  width: t.width,
312
314
  height: t.height
313
315
  },
314
- onMouseDown: _,
315
- onTouchStart: _,
316
+ onMouseDown: ee,
317
+ onTouchStart: ee,
316
318
  children: [
317
- Y === "square" ? /* @__PURE__ */ g("div", { className: r.dashedBorder }) : /* @__PURE__ */ X(T, { children: [
318
- /* @__PURE__ */ g("div", { className: `${r.edgeLine} ${r.edgeLineTop}` }),
319
- /* @__PURE__ */ g(
319
+ I === "square" ? /* @__PURE__ */ a("div", { className: h.dashedBorder }) : /* @__PURE__ */ b(O, { children: [
320
+ /* @__PURE__ */ a("div", { className: `${h.edgeLine} ${h.edgeLineTop}` }),
321
+ /* @__PURE__ */ a(
320
322
  "div",
321
323
  {
322
- className: `${r.edgeLine} ${r.edgeLineBottom}`
324
+ className: `${h.edgeLine} ${h.edgeLineBottom}`
323
325
  }
324
326
  ),
325
- /* @__PURE__ */ g(
327
+ /* @__PURE__ */ a(
326
328
  "div",
327
329
  {
328
- className: `${r.edgeLine} ${r.edgeLineLeft}`
330
+ className: `${h.edgeLine} ${h.edgeLineLeft}`
329
331
  }
330
332
  ),
331
- /* @__PURE__ */ g(
333
+ /* @__PURE__ */ a(
332
334
  "div",
333
335
  {
334
- className: `${r.edgeLine} ${r.edgeLineRight}`
336
+ className: `${h.edgeLine} ${h.edgeLineRight}`
335
337
  }
336
338
  )
337
339
  ] }),
338
- B("nw"),
339
- B("ne"),
340
- B("sw"),
341
- B("se"),
342
- Y === "square" && /* @__PURE__ */ X(T, { children: [
343
- P("n"),
344
- P("s"),
345
- P("e"),
346
- P("w")
340
+ C("nw"),
341
+ C("ne"),
342
+ C("sw"),
343
+ C("se"),
344
+ I === "square" && /* @__PURE__ */ b(O, { children: [
345
+ F("n"),
346
+ F("s"),
347
+ F("e"),
348
+ F("w")
347
349
  ] })
348
350
  ]
349
351
  }
@@ -352,5 +354,5 @@ const ge = ({
352
354
  ] });
353
355
  };
354
356
  export {
355
- ge as ImageCropper
357
+ fe as ImageCropper
356
358
  };