@chayns-components/gallery 5.0.53 → 5.0.56

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 (184) hide show
  1. package/AGENTS.md +135 -72
  2. package/lib/cjs/components/Gallery.js +16 -329
  3. package/lib/cjs/components/Gallery.js.map +1 -1
  4. package/lib/cjs/components/Gallery.types.js +6 -0
  5. package/lib/cjs/components/Gallery.types.js.map +1 -0
  6. package/lib/cjs/components/gallery-editor/GalleryEditor.js +198 -0
  7. package/lib/cjs/components/gallery-editor/GalleryEditor.js.map +1 -0
  8. package/lib/cjs/components/gallery-editor/GalleryEditor.styles.js +20 -0
  9. package/lib/cjs/components/gallery-editor/GalleryEditor.styles.js.map +1 -0
  10. package/lib/cjs/components/gallery-editor/GalleryEditor.types.js +6 -0
  11. package/lib/cjs/components/gallery-editor/GalleryEditor.types.js.map +1 -0
  12. package/lib/cjs/components/gallery-editor/add-file/AddFile.js.map +1 -0
  13. package/lib/cjs/components/gallery-editor/add-file/AddFile.styles.js.map +1 -0
  14. package/lib/cjs/components/gallery-editor/add-file/AddFile.types.js +6 -0
  15. package/lib/cjs/components/gallery-editor/add-file/AddFile.types.js.map +1 -0
  16. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.js +41 -0
  17. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.js.map +1 -0
  18. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.js +37 -0
  19. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.js.map +1 -0
  20. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.js +6 -0
  21. package/lib/cjs/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.js.map +1 -0
  22. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.js +36 -0
  23. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.js.map +1 -0
  24. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.js +15 -0
  25. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.js.map +1 -0
  26. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.js +6 -0
  27. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.js.map +1 -0
  28. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.js +45 -0
  29. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.js.map +1 -0
  30. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.styles.js +44 -0
  31. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.styles.js.map +1 -0
  32. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.types.js +6 -0
  33. package/lib/cjs/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.types.js.map +1 -0
  34. package/lib/cjs/components/gallery-viewer/GalleryViewer.js +42 -0
  35. package/lib/cjs/components/gallery-viewer/GalleryViewer.js.map +1 -0
  36. package/lib/cjs/components/{Gallery.styles.js → gallery-viewer/GalleryViewer.styles.js} +13 -18
  37. package/lib/cjs/components/gallery-viewer/GalleryViewer.styles.js.map +1 -0
  38. package/lib/cjs/components/gallery-viewer/GalleryViewer.types.js +6 -0
  39. package/lib/cjs/components/gallery-viewer/GalleryViewer.types.js.map +1 -0
  40. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.js +25 -0
  41. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.js.map +1 -0
  42. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.styles.js +30 -0
  43. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.styles.js.map +1 -0
  44. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.types.js +6 -0
  45. package/lib/cjs/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.types.js.map +1 -0
  46. package/lib/cjs/components/media-content/MediaContent.js +36 -0
  47. package/lib/cjs/components/media-content/MediaContent.js.map +1 -0
  48. package/lib/cjs/components/media-content/MediaContent.styles.js +56 -0
  49. package/lib/cjs/components/media-content/MediaContent.styles.js.map +1 -0
  50. package/lib/cjs/components/media-content/MediaContent.types.js +6 -0
  51. package/lib/cjs/components/media-content/MediaContent.types.js.map +1 -0
  52. package/lib/cjs/index.js +14 -0
  53. package/lib/cjs/index.js.map +1 -1
  54. package/lib/cjs/types/gallery.js +9 -0
  55. package/lib/cjs/types/gallery.js.map +1 -1
  56. package/lib/cjs/utils/gallery.js +152 -0
  57. package/lib/cjs/utils/gallery.js.map +1 -0
  58. package/lib/esm/components/Gallery.js +16 -319
  59. package/lib/esm/components/Gallery.js.map +1 -1
  60. package/lib/esm/components/Gallery.types.js +2 -0
  61. package/lib/esm/components/Gallery.types.js.map +1 -0
  62. package/lib/esm/components/gallery-editor/GalleryEditor.js +189 -0
  63. package/lib/esm/components/gallery-editor/GalleryEditor.js.map +1 -0
  64. package/lib/esm/components/gallery-editor/GalleryEditor.styles.js +13 -0
  65. package/lib/esm/components/gallery-editor/GalleryEditor.styles.js.map +1 -0
  66. package/lib/esm/components/gallery-editor/GalleryEditor.types.js +2 -0
  67. package/lib/esm/components/gallery-editor/GalleryEditor.types.js.map +1 -0
  68. package/lib/esm/components/gallery-editor/add-file/AddFile.js.map +1 -0
  69. package/lib/esm/components/gallery-editor/add-file/AddFile.styles.js.map +1 -0
  70. package/lib/esm/components/gallery-editor/add-file/AddFile.types.js +2 -0
  71. package/lib/esm/components/gallery-editor/add-file/AddFile.types.js.map +1 -0
  72. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.js +34 -0
  73. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.js.map +1 -0
  74. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.js +30 -0
  75. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.js.map +1 -0
  76. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.js +2 -0
  77. package/lib/esm/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.js.map +1 -0
  78. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.js +29 -0
  79. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.js.map +1 -0
  80. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.js +8 -0
  81. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.js.map +1 -0
  82. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.js +2 -0
  83. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.js.map +1 -0
  84. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.js +38 -0
  85. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.js.map +1 -0
  86. package/lib/esm/components/{gallery-item/preview-item/PreviewItem.styles.js → gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.styles.js} +7 -6
  87. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.styles.js.map +1 -0
  88. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.types.js +2 -0
  89. package/lib/esm/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.types.js.map +1 -0
  90. package/lib/esm/components/gallery-viewer/GalleryViewer.js +34 -0
  91. package/lib/esm/components/gallery-viewer/GalleryViewer.js.map +1 -0
  92. package/lib/esm/components/{Gallery.styles.js → gallery-viewer/GalleryViewer.styles.js} +12 -17
  93. package/lib/esm/components/gallery-viewer/GalleryViewer.styles.js.map +1 -0
  94. package/lib/esm/components/gallery-viewer/GalleryViewer.types.js +2 -0
  95. package/lib/esm/components/gallery-viewer/GalleryViewer.types.js.map +1 -0
  96. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.js +18 -0
  97. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.js.map +1 -0
  98. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.styles.js +23 -0
  99. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.styles.js.map +1 -0
  100. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.types.js +2 -0
  101. package/lib/esm/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.types.js.map +1 -0
  102. package/lib/esm/components/media-content/MediaContent.js +29 -0
  103. package/lib/esm/components/media-content/MediaContent.js.map +1 -0
  104. package/lib/esm/components/media-content/MediaContent.styles.js +49 -0
  105. package/lib/esm/components/media-content/MediaContent.styles.js.map +1 -0
  106. package/lib/esm/components/media-content/MediaContent.types.js +2 -0
  107. package/lib/esm/components/media-content/MediaContent.types.js.map +1 -0
  108. package/lib/esm/index.js +2 -0
  109. package/lib/esm/index.js.map +1 -1
  110. package/lib/esm/types/gallery.js +9 -0
  111. package/lib/esm/types/gallery.js.map +1 -1
  112. package/lib/esm/utils/gallery.js +132 -0
  113. package/lib/esm/utils/gallery.js.map +1 -0
  114. package/lib/types/components/Gallery.d.ts +1 -44
  115. package/lib/types/components/Gallery.types.d.ts +107 -0
  116. package/lib/types/components/gallery-editor/GalleryEditor.d.ts +4 -0
  117. package/lib/types/components/gallery-editor/GalleryEditor.styles.d.ts +4 -0
  118. package/lib/types/components/gallery-editor/GalleryEditor.types.d.ts +81 -0
  119. package/lib/types/components/gallery-editor/add-file/AddFile.d.ts +4 -0
  120. package/lib/types/components/gallery-editor/add-file/AddFile.types.d.ts +13 -0
  121. package/lib/types/components/gallery-editor/gallery-editor-item/GalleryEditorItem.d.ts +4 -0
  122. package/lib/types/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.d.ts +4 -0
  123. package/lib/types/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.d.ts +40 -0
  124. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.d.ts +4 -0
  125. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.d.ts +3 -0
  126. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.d.ts +30 -0
  127. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.d.ts +4 -0
  128. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.styles.d.ts +10 -0
  129. package/lib/types/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.types.d.ts +22 -0
  130. package/lib/types/components/gallery-viewer/GalleryViewer.d.ts +4 -0
  131. package/lib/types/components/gallery-viewer/GalleryViewer.styles.d.ts +7 -0
  132. package/lib/types/components/gallery-viewer/GalleryViewer.types.d.ts +26 -0
  133. package/lib/types/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.d.ts +4 -0
  134. package/lib/types/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.styles.d.ts +2 -0
  135. package/lib/types/components/gallery-viewer/gallery-viewer-item/GalleryViewerItem.types.d.ts +41 -0
  136. package/lib/types/components/media-content/MediaContent.d.ts +4 -0
  137. package/lib/types/components/media-content/MediaContent.styles.d.ts +13 -0
  138. package/lib/types/components/media-content/MediaContent.types.d.ts +40 -0
  139. package/lib/types/index.d.ts +5 -0
  140. package/lib/types/types/gallery.d.ts +9 -0
  141. package/lib/types/utils/gallery.d.ts +12 -0
  142. package/package.json +3 -3
  143. package/lib/cjs/components/Gallery.styles.js.map +0 -1
  144. package/lib/cjs/components/add-file/AddFile.js.map +0 -1
  145. package/lib/cjs/components/add-file/AddFile.styles.js.map +0 -1
  146. package/lib/cjs/components/gallery-item/GalleryItem.js +0 -44
  147. package/lib/cjs/components/gallery-item/GalleryItem.js.map +0 -1
  148. package/lib/cjs/components/gallery-item/GalleryItem.styles.js +0 -51
  149. package/lib/cjs/components/gallery-item/GalleryItem.styles.js.map +0 -1
  150. package/lib/cjs/components/gallery-item/media-item/MediaItem.js +0 -52
  151. package/lib/cjs/components/gallery-item/media-item/MediaItem.js.map +0 -1
  152. package/lib/cjs/components/gallery-item/media-item/MediaItem.styles.js +0 -62
  153. package/lib/cjs/components/gallery-item/media-item/MediaItem.styles.js.map +0 -1
  154. package/lib/cjs/components/gallery-item/preview-item/PreviewItem.js +0 -45
  155. package/lib/cjs/components/gallery-item/preview-item/PreviewItem.js.map +0 -1
  156. package/lib/cjs/components/gallery-item/preview-item/PreviewItem.styles.js +0 -43
  157. package/lib/cjs/components/gallery-item/preview-item/PreviewItem.styles.js.map +0 -1
  158. package/lib/esm/components/Gallery.styles.js.map +0 -1
  159. package/lib/esm/components/add-file/AddFile.js.map +0 -1
  160. package/lib/esm/components/add-file/AddFile.styles.js.map +0 -1
  161. package/lib/esm/components/gallery-item/GalleryItem.js +0 -36
  162. package/lib/esm/components/gallery-item/GalleryItem.js.map +0 -1
  163. package/lib/esm/components/gallery-item/GalleryItem.styles.js +0 -44
  164. package/lib/esm/components/gallery-item/GalleryItem.styles.js.map +0 -1
  165. package/lib/esm/components/gallery-item/media-item/MediaItem.js +0 -42
  166. package/lib/esm/components/gallery-item/media-item/MediaItem.js.map +0 -1
  167. package/lib/esm/components/gallery-item/media-item/MediaItem.styles.js +0 -55
  168. package/lib/esm/components/gallery-item/media-item/MediaItem.styles.js.map +0 -1
  169. package/lib/esm/components/gallery-item/preview-item/PreviewItem.js +0 -38
  170. package/lib/esm/components/gallery-item/preview-item/PreviewItem.js.map +0 -1
  171. package/lib/esm/components/gallery-item/preview-item/PreviewItem.styles.js.map +0 -1
  172. package/lib/types/components/Gallery.styles.d.ts +0 -10
  173. package/lib/types/components/add-file/AddFile.d.ts +0 -9
  174. package/lib/types/components/gallery-item/GalleryItem.d.ts +0 -30
  175. package/lib/types/components/gallery-item/GalleryItem.styles.d.ts +0 -5
  176. package/lib/types/components/gallery-item/media-item/MediaItem.d.ts +0 -22
  177. package/lib/types/components/gallery-item/media-item/MediaItem.styles.d.ts +0 -16
  178. package/lib/types/components/gallery-item/preview-item/PreviewItem.d.ts +0 -14
  179. package/lib/types/components/gallery-item/preview-item/PreviewItem.styles.d.ts +0 -10
  180. /package/lib/cjs/components/{add-file → gallery-editor/add-file}/AddFile.js +0 -0
  181. /package/lib/cjs/components/{add-file → gallery-editor/add-file}/AddFile.styles.js +0 -0
  182. /package/lib/esm/components/{add-file → gallery-editor/add-file}/AddFile.js +0 -0
  183. /package/lib/esm/components/{add-file → gallery-editor/add-file}/AddFile.styles.js +0 -0
  184. /package/lib/types/components/{add-file → gallery-editor/add-file}/AddFile.styles.d.ts +0 -0
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=Gallery.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gallery.types.js","names":[],"sources":["../../../src/components/Gallery.types.ts"],"sourcesContent":["import type { FileItem } from '@chayns-components/core';\nimport type { GalleryViewMode } from '../types/gallery';\n\n/**\n * Props for the public Gallery wrapper component.\n */\nexport interface GalleryProps {\n /**\n * Enables drag and drop while the component is used in edit mode.\n * @description\n * This prop only affects the editor path. In read-only mode, drag and drop stays disabled regardless of this value.\n * @default false\n * @example\n * <Gallery allowDragAndDrop isEditMode files={files} />\n * @optional\n */\n allowDragAndDrop?: boolean;\n /**\n * Defines the dialog message that is shown when a duplicate upload is detected.\n * @description\n * The message is used by the editor when a locally added file resolves to an already known uploaded file.\n * @default 'Diese Datei ist bereits vorhanden'\n * @example\n * <Gallery doubleFileDialogMessage=\"This file already exists.\" isEditMode files={files} />\n * @optional\n */\n doubleFileDialogMessage?: string;\n /**\n * Defines the minimum width of one tile in edit mode.\n * @description\n * The editor uses this value to build its responsive grid. It has no effect in the read-only viewer.\n * @default 100\n * @example\n * <Gallery fileMinWidth={140} isEditMode files={files} />\n * @optional\n */\n fileMinWidth?: number;\n /**\n * Provides already known media items that should be rendered by the gallery.\n * @description\n * In read-only mode, these files are rendered directly from props. In edit mode, they are used as the external baseline\n * for already uploaded media while local uploads are managed internally.\n * @example\n * <Gallery files={files} />\n * @optional\n */\n files?: FileItem[];\n /**\n * Enables the editable upload mode instead of the read-only viewer mode.\n * @description\n * When set to `true`, the public wrapper renders `GalleryEditor`. Otherwise it renders `GalleryViewer`.\n * @default false\n * @example\n * <Gallery isEditMode files={files} />\n * @optional\n */\n isEditMode?: boolean;\n /**\n * Limits how many files can be managed in edit mode.\n * @description\n * Once the limit is reached, the editor hides the add-tile and does not accept more files.\n * This prop has no effect in read-only mode.\n * @example\n * <Gallery isEditMode maxFiles={6} files={files} />\n * @optional\n */\n maxFiles?: number;\n /**\n * Is called after a file has been uploaded successfully in edit mode.\n * @description\n * The callback receives the uploaded file representation that should be merged into the consuming state.\n * It is never called by the read-only viewer.\n * @example\n * <Gallery isEditMode onAdd={(file) => setFiles((prev) => [...prev, file])} />\n * @optional\n */\n onAdd?: (file: FileItem) => void;\n /**\n * Is called whenever the internal item count changes in edit mode.\n * @description\n * This includes already uploaded files and locally pending uploads that are currently managed by the editor.\n * It is useful when surrounding UI needs to know whether uploads are still in progress.\n * @example\n * <Gallery isEditMode onFileCountChange={(count) => console.log(count)} />\n * @optional\n */\n onFileCountChange?: (fileCount: number) => void;\n /**\n * Is called after an uploaded file has been removed in edit mode.\n * @description\n * The callback receives the removed uploaded file so the consuming state can remove it as well.\n * It is never called by the read-only viewer.\n * @example\n * <Gallery isEditMode onRemove={(file) => removeFile(file.id)} />\n * @optional\n */\n onRemove?: (file: FileItem) => void;\n /**\n * Defines how known media items are arranged in read-only mode.\n * @description\n * This prop only affects the viewer path. The editor always uses its dedicated editable grid layout.\n * @default GalleryViewMode.GRID\n * @example\n * <Gallery files={files} viewMode={GalleryViewMode.SQUARE} />\n * @optional\n */\n viewMode?: GalleryViewMode;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _core = require("@chayns-components/core");
8
+ var _chaynsApi = require("chayns-api");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _uuid = require("uuid");
11
+ var _file = require("../../utils/file");
12
+ var _gallery = require("../../utils/gallery");
13
+ var _AddFile = _interopRequireDefault(require("./add-file/AddFile"));
14
+ var _GalleryEditorItem = _interopRequireDefault(require("./gallery-editor-item/GalleryEditorItem"));
15
+ var _GalleryEditor = require("./GalleryEditor.styles");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
+ const GalleryEditor = ({
19
+ allowDragAndDrop = false,
20
+ doubleFileDialogMessage = 'Diese Datei ist bereits vorhanden',
21
+ fileMinWidth = 100,
22
+ files,
23
+ maxFiles,
24
+ onAdd,
25
+ onFileCountChange,
26
+ onRemove
27
+ }) => {
28
+ const [fileItems, setFileItems] = (0, _react.useState)(() => (0, _gallery.mapFilesToInternalItems)(files));
29
+ const handlePreviewUrlCallback = (0, _react.useCallback)((previewUrl, file) => {
30
+ setFileItems(prevState => prevState.map(prevFile => {
31
+ if (prevFile.id === file.id) {
32
+ return {
33
+ ...prevFile,
34
+ previewUrl
35
+ };
36
+ }
37
+ return prevFile;
38
+ }));
39
+ }, []);
40
+ const callDuplicateFileDialog = (0, _react.useCallback)(() => {
41
+ (0, _chaynsApi.createDialog)({
42
+ type: _chaynsApi.DialogType.ALERT,
43
+ text: doubleFileDialogMessage
44
+ });
45
+ }, [doubleFileDialogMessage]);
46
+ const handleUploadFileCallback = (0, _react.useCallback)((file, uploadedFile) => {
47
+ setFileItems(prevState => {
48
+ const updatedState = prevState.map(prevFile => {
49
+ var _prevFile$uploadedFil;
50
+ if (((_prevFile$uploadedFil = prevFile.uploadedFile) === null || _prevFile$uploadedFil === void 0 ? void 0 : _prevFile$uploadedFil.url) === uploadedFile.url) {
51
+ callDuplicateFileDialog();
52
+ return undefined;
53
+ }
54
+ if (prevFile.id === file.id) {
55
+ if (typeof onAdd === 'function') {
56
+ const prevElement = prevState.find(({
57
+ uploadedFile: nextUploadedFile
58
+ }) => (nextUploadedFile === null || nextUploadedFile === void 0 ? void 0 : nextUploadedFile.url) === (uploadedFile === null || uploadedFile === void 0 ? void 0 : uploadedFile.url));
59
+ if (!prevElement) {
60
+ onAdd({
61
+ file: uploadedFile,
62
+ id: file.id
63
+ });
64
+ }
65
+ }
66
+ return {
67
+ ...prevFile,
68
+ uploadedFile,
69
+ state: 'uploaded'
70
+ };
71
+ }
72
+ return prevFile;
73
+ });
74
+ return updatedState.filter(Boolean);
75
+ });
76
+ }, [callDuplicateFileDialog, onAdd]);
77
+ const handleAddFiles = (0, _react.useCallback)(filesToAdd => {
78
+ const newFileItems = [];
79
+ filesToAdd.forEach(file => {
80
+ if (file && !(0, _file.filterDuplicateFile)({
81
+ files: fileItems,
82
+ newFile: file
83
+ })) {
84
+ newFileItems.push({
85
+ id: (0, _uuid.v4)(),
86
+ file,
87
+ state: 'none'
88
+ });
89
+ }
90
+ });
91
+ let limitedFileItems = newFileItems;
92
+ if (maxFiles) {
93
+ limitedFileItems = newFileItems.slice(0, Math.max(maxFiles - fileItems.length, 0));
94
+ }
95
+ setFileItems(prevState => [...prevState, ...limitedFileItems]);
96
+ }, [fileItems, maxFiles]);
97
+ const handleDeleteFile = (0, _react.useCallback)(id => {
98
+ let fileToDelete;
99
+ const filteredFiles = fileItems.filter(file => {
100
+ if (file.id === id && file.uploadedFile) {
101
+ fileToDelete = {
102
+ file: file.uploadedFile,
103
+ id
104
+ };
105
+ }
106
+ return file.id !== id;
107
+ });
108
+ setFileItems(filteredFiles);
109
+ if (!fileToDelete || typeof onRemove !== 'function') {
110
+ return;
111
+ }
112
+ onRemove(fileToDelete);
113
+ }, [fileItems, onRemove]);
114
+ const handleDrop = (0, _react.useCallback)(event => {
115
+ if (!allowDragAndDrop) {
116
+ return;
117
+ }
118
+ event.preventDefault();
119
+ handleAddFiles(Array.from(event.dataTransfer.files));
120
+ }, [allowDragAndDrop, handleAddFiles]);
121
+ const handleOpenFiles = (0, _react.useCallback)(file => {
122
+ (0, _gallery.openFiles)(fileItems, file);
123
+ }, [fileItems]);
124
+ (0, _react.useEffect)(() => {
125
+ if (typeof onFileCountChange === 'function') {
126
+ onFileCountChange(fileItems.length);
127
+ }
128
+ }, [fileItems.length, onFileCountChange]);
129
+ (0, _react.useEffect)(() => {
130
+ const filesToGeneratePreview = fileItems.filter(file => file.file && !file.previewUrl && (file.state === 'none' || !file.state));
131
+ const filesToUpload = fileItems.filter(file => file.file && !file.uploadedFile && file.state !== 'uploading');
132
+ filesToGeneratePreview.forEach(file => {
133
+ if (!file.file) {
134
+ return;
135
+ }
136
+ if (file.file.type.includes('video/')) {
137
+ (0, _file.generateVideoThumbnail)({
138
+ file: file.file,
139
+ callback: previewUrl => handlePreviewUrlCallback(previewUrl, file)
140
+ });
141
+ return;
142
+ }
143
+ (0, _file.generatePreviewUrl)({
144
+ file: file.file,
145
+ callback: previewUrl => handlePreviewUrlCallback(previewUrl, file)
146
+ });
147
+ });
148
+ filesToUpload.forEach(file => {
149
+ setFileItems(prevState => prevState.map(prevFile => {
150
+ if (prevFile.id === file.id) {
151
+ return {
152
+ ...prevFile,
153
+ state: 'uploading'
154
+ };
155
+ }
156
+ return prevFile;
157
+ }));
158
+ void (0, _core.uploadFile)({
159
+ fileToUpload: file,
160
+ callback: uploadedFile => handleUploadFileCallback(file, uploadedFile)
161
+ });
162
+ });
163
+ }, [fileItems, handlePreviewUrlCallback, handleUploadFileCallback]);
164
+ (0, _react.useEffect)(() => {
165
+ const externalFileItems = (0, _gallery.mapFilesToInternalItems)(files);
166
+ setFileItems(prevState => {
167
+ // Keep local-only items such as pending uploads while refreshing known external media.
168
+ const updatedItems = prevState.map(prevItem => {
169
+ const matchingItem = externalFileItems.find(item => item.uploadedFile && item.uploadedFile.url === (prevItem.uploadedFile && prevItem.uploadedFile.url));
170
+ return matchingItem || prevItem;
171
+ });
172
+ return updatedItems.concat(externalFileItems.filter(newItem => !prevState.some(prevItem => prevItem.uploadedFile && newItem.uploadedFile && prevItem.uploadedFile.url === newItem.uploadedFile.url)));
173
+ });
174
+ }, [files]);
175
+ const galleryItems = (0, _react.useMemo)(() => {
176
+ const items = fileItems.map(file => /*#__PURE__*/_react.default.createElement(_GalleryEditorItem.default, {
177
+ key: file.id,
178
+ fileItem: file,
179
+ onClick: handleOpenFiles,
180
+ handleDeleteFile: handleDeleteFile
181
+ }));
182
+ if (maxFiles && maxFiles <= fileItems.length) {
183
+ return items;
184
+ }
185
+ return [...items, /*#__PURE__*/_react.default.createElement(_AddFile.default, {
186
+ key: "add_file",
187
+ onAdd: handleAddFiles
188
+ })];
189
+ }, [fileItems, handleAddFiles, handleDeleteFile, handleOpenFiles, maxFiles]);
190
+ return /*#__PURE__*/_react.default.createElement(_GalleryEditor.StyledGalleryEditor, null, /*#__PURE__*/_react.default.createElement(_GalleryEditor.StyledGalleryEditorGrid, {
191
+ $fileMinWidth: fileMinWidth,
192
+ onDragOver: event => event.preventDefault(),
193
+ onDrop: event => void handleDrop(event)
194
+ }, galleryItems));
195
+ };
196
+ GalleryEditor.displayName = 'GalleryEditor';
197
+ var _default = exports.default = GalleryEditor;
198
+ //# sourceMappingURL=GalleryEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditor.js","names":["_core","require","_chaynsApi","_react","_interopRequireWildcard","_uuid","_file","_gallery","_AddFile","_interopRequireDefault","_GalleryEditorItem","_GalleryEditor","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GalleryEditor","allowDragAndDrop","doubleFileDialogMessage","fileMinWidth","files","maxFiles","onAdd","onFileCountChange","onRemove","fileItems","setFileItems","useState","mapFilesToInternalItems","handlePreviewUrlCallback","useCallback","previewUrl","file","prevState","map","prevFile","id","callDuplicateFileDialog","createDialog","type","DialogType","ALERT","text","handleUploadFileCallback","uploadedFile","updatedState","_prevFile$uploadedFil","url","undefined","prevElement","find","nextUploadedFile","state","filter","Boolean","handleAddFiles","filesToAdd","newFileItems","forEach","filterDuplicateFile","newFile","push","uuidv4","limitedFileItems","slice","Math","max","length","handleDeleteFile","fileToDelete","filteredFiles","handleDrop","event","preventDefault","Array","from","dataTransfer","handleOpenFiles","openFiles","useEffect","filesToGeneratePreview","filesToUpload","includes","generateVideoThumbnail","callback","generatePreviewUrl","uploadFile","fileToUpload","externalFileItems","updatedItems","prevItem","matchingItem","item","concat","newItem","some","galleryItems","useMemo","items","createElement","key","fileItem","onClick","StyledGalleryEditor","StyledGalleryEditorGrid","$fileMinWidth","onDragOver","onDrop","displayName","_default","exports"],"sources":["../../../../src/components/gallery-editor/GalleryEditor.tsx"],"sourcesContent":["import {\n Image,\n uploadFile,\n Video,\n type FileItem,\n type InternalFileItem,\n} from '@chayns-components/core';\nimport { createDialog, DialogType } from 'chayns-api';\nimport React, { DragEvent, FC, useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { filterDuplicateFile, generatePreviewUrl, generateVideoThumbnail } from '../../utils/file';\nimport { openFiles, mapFilesToInternalItems } from '../../utils/gallery';\nimport AddFile from './add-file/AddFile';\nimport GalleryEditorItem from './gallery-editor-item/GalleryEditorItem';\nimport { StyledGalleryEditor, StyledGalleryEditorGrid } from './GalleryEditor.styles';\nimport type { GalleryEditorProps } from './GalleryEditor.types';\n\nconst GalleryEditor: FC<GalleryEditorProps> = ({\n allowDragAndDrop = false,\n doubleFileDialogMessage = 'Diese Datei ist bereits vorhanden',\n fileMinWidth = 100,\n files,\n maxFiles,\n onAdd,\n onFileCountChange,\n onRemove,\n}) => {\n const [fileItems, setFileItems] = useState<InternalFileItem[]>(() =>\n mapFilesToInternalItems(files),\n );\n\n const handlePreviewUrlCallback = useCallback((previewUrl: string, file: InternalFileItem) => {\n setFileItems((prevState) =>\n prevState.map((prevFile) => {\n if (prevFile.id === file.id) {\n return { ...prevFile, previewUrl };\n }\n\n return prevFile;\n }),\n );\n }, []);\n\n const callDuplicateFileDialog = useCallback(() => {\n createDialog({ type: DialogType.ALERT, text: doubleFileDialogMessage });\n }, [doubleFileDialogMessage]);\n\n const handleUploadFileCallback = useCallback(\n (file: InternalFileItem, uploadedFile: Video | Image) => {\n setFileItems((prevState) => {\n const updatedState = prevState.map((prevFile) => {\n if (prevFile.uploadedFile?.url === uploadedFile.url) {\n callDuplicateFileDialog();\n\n return undefined;\n }\n\n if (prevFile.id === file.id) {\n if (typeof onAdd === 'function') {\n const prevElement = prevState.find(\n ({ uploadedFile: nextUploadedFile }) =>\n nextUploadedFile?.url === uploadedFile?.url,\n );\n\n if (!prevElement) {\n onAdd({\n file: uploadedFile,\n id: file.id,\n });\n }\n }\n\n return {\n ...prevFile,\n uploadedFile,\n state: 'uploaded',\n };\n }\n\n return prevFile;\n });\n\n return updatedState.filter(Boolean) as InternalFileItem[];\n });\n },\n [callDuplicateFileDialog, onAdd],\n );\n\n const handleAddFiles = useCallback(\n (filesToAdd: File[]) => {\n const newFileItems: InternalFileItem[] = [];\n\n filesToAdd.forEach((file) => {\n if (file && !filterDuplicateFile({ files: fileItems, newFile: file })) {\n newFileItems.push({\n id: uuidv4(),\n file,\n state: 'none',\n });\n }\n });\n\n let limitedFileItems = newFileItems;\n\n if (maxFiles) {\n limitedFileItems = newFileItems.slice(0, Math.max(maxFiles - fileItems.length, 0));\n }\n\n setFileItems((prevState) => [...prevState, ...limitedFileItems]);\n },\n [fileItems, maxFiles],\n );\n\n const handleDeleteFile = useCallback(\n (id?: string) => {\n let fileToDelete: FileItem | undefined;\n\n const filteredFiles = fileItems.filter((file) => {\n if (file.id === id && file.uploadedFile) {\n fileToDelete = { file: file.uploadedFile, id };\n }\n\n return file.id !== id;\n });\n\n setFileItems(filteredFiles);\n\n if (!fileToDelete || typeof onRemove !== 'function') {\n return;\n }\n\n onRemove(fileToDelete);\n },\n [fileItems, onRemove],\n );\n\n const handleDrop = useCallback(\n (event: DragEvent<HTMLDivElement>) => {\n if (!allowDragAndDrop) {\n return;\n }\n\n event.preventDefault();\n\n handleAddFiles(Array.from(event.dataTransfer.files));\n },\n [allowDragAndDrop, handleAddFiles],\n );\n\n const handleOpenFiles = useCallback(\n (file: InternalFileItem) => {\n openFiles(fileItems, file);\n },\n [fileItems],\n );\n\n useEffect(() => {\n if (typeof onFileCountChange === 'function') {\n onFileCountChange(fileItems.length);\n }\n }, [fileItems.length, onFileCountChange]);\n\n useEffect(() => {\n const filesToGeneratePreview = fileItems.filter(\n (file) => file.file && !file.previewUrl && (file.state === 'none' || !file.state),\n );\n\n const filesToUpload = fileItems.filter(\n (file) => file.file && !file.uploadedFile && file.state !== 'uploading',\n );\n\n filesToGeneratePreview.forEach((file) => {\n if (!file.file) {\n return;\n }\n\n if (file.file.type.includes('video/')) {\n generateVideoThumbnail({\n file: file.file,\n callback: (previewUrl) => handlePreviewUrlCallback(previewUrl, file),\n });\n\n return;\n }\n\n generatePreviewUrl({\n file: file.file,\n callback: (previewUrl) => handlePreviewUrlCallback(previewUrl, file),\n });\n });\n\n filesToUpload.forEach((file) => {\n setFileItems((prevState) =>\n prevState.map((prevFile) => {\n if (prevFile.id === file.id) {\n return { ...prevFile, state: 'uploading' };\n }\n\n return prevFile;\n }),\n );\n\n void uploadFile({\n fileToUpload: file,\n callback: (uploadedFile) => handleUploadFileCallback(file, uploadedFile),\n });\n });\n }, [fileItems, handlePreviewUrlCallback, handleUploadFileCallback]);\n\n useEffect(() => {\n const externalFileItems = mapFilesToInternalItems(files);\n\n setFileItems((prevState) => {\n // Keep local-only items such as pending uploads while refreshing known external media.\n const updatedItems = prevState.map((prevItem) => {\n const matchingItem = externalFileItems.find(\n (item) =>\n item.uploadedFile &&\n item.uploadedFile.url ===\n (prevItem.uploadedFile && prevItem.uploadedFile.url),\n );\n\n return matchingItem || prevItem;\n });\n\n return updatedItems.concat(\n externalFileItems.filter(\n (newItem) =>\n !prevState.some(\n (prevItem) =>\n prevItem.uploadedFile &&\n newItem.uploadedFile &&\n prevItem.uploadedFile.url === newItem.uploadedFile.url,\n ),\n ),\n );\n });\n }, [files]);\n\n const galleryItems = useMemo(() => {\n const items = fileItems.map((file) => (\n <GalleryEditorItem\n key={file.id}\n fileItem={file}\n onClick={handleOpenFiles}\n handleDeleteFile={handleDeleteFile}\n />\n ));\n\n if (maxFiles && maxFiles <= fileItems.length) {\n return items;\n }\n\n return [...items, <AddFile key=\"add_file\" onAdd={handleAddFiles} />];\n }, [fileItems, handleAddFiles, handleDeleteFile, handleOpenFiles, maxFiles]);\n\n return (\n <StyledGalleryEditor>\n <StyledGalleryEditorGrid\n $fileMinWidth={fileMinWidth}\n onDragOver={(event) => event.preventDefault()}\n onDrop={(event) => void handleDrop(event)}\n >\n {galleryItems}\n </StyledGalleryEditorGrid>\n </StyledGalleryEditor>\n );\n};\n\nGalleryEditor.displayName = 'GalleryEditor';\n\nexport default GalleryEditor;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAOA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AAAsF,SAAAQ,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAQ,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gB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E5E,oBACIjC,MAAA,CAAAW,OAAA,CAAAoG,aAAA,CAACvG,cAAA,CAAA2G,mBAAmB,qBAChBnH,MAAA,CAAAW,OAAA,CAAAoG,aAAA,CAACvG,cAAA,CAAA4G,uBAAuB;IACpBC,aAAa,EAAEtF,YAAa;IAC5BuF,UAAU,EAAGlC,KAAK,IAAKA,KAAK,CAACC,cAAc,CAAC,CAAE;IAC9CkC,MAAM,EAAGnC,KAAK,IAAK,KAAKD,UAAU,CAACC,KAAK;EAAE,GAEzCwB,YACoB,CACR,CAAC;AAE9B,CAAC;AAEDhF,aAAa,CAAC4F,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/G,OAAA,GAE7BiB,aAAa","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledGalleryEditorGrid = exports.StyledGalleryEditor = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledGalleryEditor = exports.StyledGalleryEditor = _styledComponents.default.div`
10
+ width: 100%;
11
+ `;
12
+ const StyledGalleryEditorGrid = exports.StyledGalleryEditorGrid = _styledComponents.default.div`
13
+ display: grid;
14
+ grid-template-columns: ${({
15
+ $fileMinWidth
16
+ }) => `repeat(auto-fill, minmax(${$fileMinWidth}px, 1fr))`};
17
+ grid-auto-rows: 1fr;
18
+ gap: 6px;
19
+ `;
20
+ //# sourceMappingURL=GalleryEditor.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditor.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledGalleryEditor","exports","styled","div","StyledGalleryEditorGrid","$fileMinWidth"],"sources":["../../../../src/components/gallery-editor/GalleryEditor.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledGalleryEditor = styled.div`\n width: 100%;\n`;\n\nexport const StyledGalleryEditorGrid = styled.div<{\n $fileMinWidth: number;\n}>`\n display: grid;\n grid-template-columns: ${({ $fileMinWidth }) =>\n `repeat(auto-fill, minmax(${$fileMinWidth}px, 1fr))`};\n grid-auto-rows: 1fr;\n gap: 6px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,yBAAM,CAACC,GAAG;AAC7C;AACA,CAAC;AAEM,MAAMC,uBAAuB,GAAAH,OAAA,CAAAG,uBAAA,GAAGF,yBAAM,CAACC,GAE5C;AACF;AACA,6BAA6B,CAAC;EAAEE;AAAc,CAAC,KACvC,4BAA4BA,aAAa,WAAW;AAC5D;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=GalleryEditor.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditor.types.js","names":[],"sources":["../../../../src/components/gallery-editor/GalleryEditor.types.ts"],"sourcesContent":["import type { FileItem } from '@chayns-components/core';\n\n/**\n * Props for the editable gallery component.\n */\nexport interface GalleryEditorProps {\n /**\n * Enables drag and drop file selection inside the editor grid.\n * @description\n * When enabled, users can drop local image or video files onto the editor grid to start the upload flow.\n * @default false\n * @example\n * <GalleryEditor allowDragAndDrop files={files} />\n * @optional\n */\n allowDragAndDrop?: boolean;\n /**\n * Defines the dialog message that is shown when a duplicate upload is detected.\n * @description\n * The message is shown when a newly uploaded file resolves to a URL that already exists in the editor state.\n * @default 'Diese Datei ist bereits vorhanden'\n * @example\n * <GalleryEditor doubleFileDialogMessage=\"This file already exists.\" files={files} />\n * @optional\n */\n doubleFileDialogMessage?: string;\n /**\n * Defines the minimum width of one tile in the editor grid.\n * @description\n * The editor uses this value to size the responsive grid columns that hold uploaded items and the add-tile.\n * @default 100\n * @example\n * <GalleryEditor fileMinWidth={140} files={files} />\n * @optional\n */\n fileMinWidth?: number;\n /**\n * Provides already uploaded media items that should be merged into the editor state.\n * @description\n * These files represent the externally known uploaded baseline. The editor may additionally hold local pending uploads.\n * @example\n * <GalleryEditor files={files} />\n * @optional\n */\n files?: FileItem[];\n /**\n * Limits how many files can be managed by the editor.\n * @description\n * After the limit is reached, the add-tile is hidden and additional file selection is ignored.\n * @example\n * <GalleryEditor files={files} maxFiles={6} />\n * @optional\n */\n maxFiles?: number;\n /**\n * Is called after a file has been uploaded successfully.\n * @description\n * The callback receives the uploaded file representation so the consuming state can persist it externally.\n * @example\n * <GalleryEditor onAdd={(file) => setFiles((prev) => [...prev, file])} />\n * @optional\n */\n onAdd?: (file: FileItem) => void;\n /**\n * Is called whenever the internal item count changes, including local pending uploads.\n * @description\n * Use this callback when surrounding UI needs to react to the number of currently managed items.\n * @example\n * <GalleryEditor onFileCountChange={(count) => console.log(count)} />\n * @optional\n */\n onFileCountChange?: (fileCount: number) => void;\n /**\n * Is called after an uploaded file has been removed.\n * @description\n * The callback receives the removed uploaded file so the consuming state can remove it from its controlled `files` array.\n * @example\n * <GalleryEditor onRemove={(file) => removeFile(file.id)} />\n * @optional\n */\n onRemove?: (file: FileItem) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFile.js","names":["_core","require","_react","_interopRequireWildcard","_AddFile","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AddFile","onAdd","openSelectDialog","useCallback","files","selectFiles","multiple","type","createElement","StyledAddFile","key","StyledAddFIleIconWrapper","onClick","Icon","size","icons","displayName","_default","exports"],"sources":["../../../../../src/components/gallery-editor/add-file/AddFile.tsx"],"sourcesContent":["import { Icon, selectFiles } from '@chayns-components/core';\nimport React, { FC, useCallback } from 'react';\nimport { StyledAddFile, StyledAddFIleIconWrapper } from './AddFile.styles';\nimport type { AddFileProps } from './AddFile.types';\n\nconst AddFile: FC<AddFileProps> = ({ onAdd }) => {\n const openSelectDialog = useCallback(async () => {\n const files = await selectFiles({\n multiple: true,\n type: 'image/*, video/*',\n });\n\n onAdd(files);\n }, [onAdd]);\n\n return (\n <StyledAddFile key=\"addButton\">\n <StyledAddFIleIconWrapper onClick={() => void openSelectDialog()}>\n <Icon size={40} icons={['fa fa-plus']} />\n </StyledAddFIleIconWrapper>\n </StyledAddFile>\n );\n};\n\nAddFile.displayName = 'AddFile';\n\nexport default AddFile;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA2E,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAG3E,MAAMkB,OAAyB,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAC7C,MAAMC,gBAAgB,GAAG,IAAAC,kBAAW,EAAC,YAAY;IAC7C,MAAMC,KAAK,GAAG,MAAM,IAAAC,iBAAW,EAAC;MAC5BC,QAAQ,EAAE,IAAI;MACdC,IAAI,EAAE;IACV,CAAC,CAAC;IAEFN,KAAK,CAACG,KAAK,CAAC;EAChB,CAAC,EAAE,CAACH,KAAK,CAAC,CAAC;EAEX,oBACIvB,MAAA,CAAAa,OAAA,CAAAiB,aAAA,CAAC5B,QAAA,CAAA6B,aAAa;IAACC,GAAG,EAAC;EAAW,gBAC1BhC,MAAA,CAAAa,OAAA,CAAAiB,aAAA,CAAC5B,QAAA,CAAA+B,wBAAwB;IAACC,OAAO,EAAEA,CAAA,KAAM,KAAKV,gBAAgB,CAAC;EAAE,gBAC7DxB,MAAA,CAAAa,OAAA,CAAAiB,aAAA,CAAChC,KAAA,CAAAqC,IAAI;IAACC,IAAI,EAAE,EAAG;IAACC,KAAK,EAAE,CAAC,YAAY;EAAE,CAAE,CAClB,CACf,CAAC;AAExB,CAAC;AAEDf,OAAO,CAACgB,WAAW,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAEjBS,OAAO","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFile.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledAddFile","exports","styled","div","StyledAddFIleIconWrapper","button","theme"],"sources":["../../../../../src/components/gallery-editor/add-file/AddFile.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\n\nexport const StyledAddFile = styled.div`\n position: relative;\n`;\n\ntype StyledAddFIleIconWrapperProps = WithTheme<unknown>;\n\nexport const StyledAddFIleIconWrapper = styled.button<StyledAddFIleIconWrapperProps>`\n background-color: ${({ theme }: StyledAddFIleIconWrapperProps) => theme['101']};\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledAddFIleIconWrapperProps) => theme['009-rgb']}, 0.08) inset;\n width: 100%;\n aspect-ratio: 1 / 1;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAG;AACvC;AACA,CAAC;AAIM,MAAMC,wBAAwB,GAAAH,OAAA,CAAAG,wBAAA,GAAGF,yBAAM,CAACG,MAAqC;AACpF,wBAAwB,CAAC;EAAEC;AAAqC,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AAClF;AACA,eAAe,CAAC;EAAEA;AAAqC,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AAC7E;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AddFile.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddFile.types.js","names":[],"sources":["../../../../../src/components/gallery-editor/add-file/AddFile.types.ts"],"sourcesContent":["/**\n * Props for the add-file tile inside the gallery editor.\n */\nexport interface AddFileProps {\n /**\n * Is called with the selected local files.\n * @description\n * The editor add-tile uses this callback after the file picker resolves with the selected local image or video files.\n * @example\n * <AddFile onAdd={(files) => console.log(files)} />\n */\n onAdd: (files: File[]) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _core = require("@chayns-components/core");
8
+ var _react = require("motion/react");
9
+ var _react2 = _interopRequireDefault(require("react"));
10
+ var _GalleryEditorItem = require("./GalleryEditorItem.styles");
11
+ var _GalleryEditorMediaItem = _interopRequireDefault(require("./gallery-editor-media-item/GalleryEditorMediaItem"));
12
+ var _GalleryEditorPreviewItem = _interopRequireDefault(require("./gallery-editor-preview-item/GalleryEditorPreviewItem"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const GalleryEditorItem = ({
15
+ fileItem,
16
+ handleDeleteFile,
17
+ ratio = 1,
18
+ onClick
19
+ }) => {
20
+ const mediaContent = !fileItem.state || fileItem.state === 'none' || !fileItem.previewUrl && !fileItem.uploadedFile ? null : fileItem.state === 'uploading' ? /*#__PURE__*/_react2.default.createElement(_GalleryEditorPreviewItem.default, {
21
+ ratio: ratio,
22
+ key: `uploading_${fileItem.id ?? ''}`,
23
+ fileItem: fileItem
24
+ }) : /*#__PURE__*/_react2.default.createElement(_GalleryEditorMediaItem.default, {
25
+ key: `uploaded_${fileItem.id ?? ''}`,
26
+ fileItem: fileItem,
27
+ ratio: ratio,
28
+ openSelectedFile: onClick
29
+ });
30
+ return /*#__PURE__*/_react2.default.createElement(_GalleryEditorItem.StyledGalleryEditorItem, null, /*#__PURE__*/_react2.default.createElement(_GalleryEditorItem.StyledGalleryEditorItemDeleteButton, {
31
+ onClick: () => handleDeleteFile(fileItem.id)
32
+ }, /*#__PURE__*/_react2.default.createElement(_core.Icon, {
33
+ size: 20,
34
+ icons: ['ts-wrong']
35
+ })), /*#__PURE__*/_react2.default.createElement(_react.AnimatePresence, {
36
+ initial: false
37
+ }, mediaContent));
38
+ };
39
+ GalleryEditorItem.displayName = 'GalleryEditorItem';
40
+ var _default = exports.default = GalleryEditorItem;
41
+ //# sourceMappingURL=GalleryEditorItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorItem.js","names":["_core","require","_react","_react2","_interopRequireDefault","_GalleryEditorItem","_GalleryEditorMediaItem","_GalleryEditorPreviewItem","e","__esModule","default","GalleryEditorItem","fileItem","handleDeleteFile","ratio","onClick","mediaContent","state","previewUrl","uploadedFile","createElement","key","id","openSelectedFile","StyledGalleryEditorItem","StyledGalleryEditorItemDeleteButton","Icon","size","icons","AnimatePresence","initial","displayName","_default","exports"],"sources":["../../../../../src/components/gallery-editor/gallery-editor-item/GalleryEditorItem.tsx"],"sourcesContent":["import { Icon } from '@chayns-components/core';\nimport { AnimatePresence } from 'motion/react';\nimport React, { FC } from 'react';\nimport {\n StyledGalleryEditorItem,\n StyledGalleryEditorItemDeleteButton,\n} from './GalleryEditorItem.styles';\nimport GalleryEditorMediaItem from './gallery-editor-media-item/GalleryEditorMediaItem';\nimport GalleryEditorPreviewItem from './gallery-editor-preview-item/GalleryEditorPreviewItem';\nimport type { GalleryEditorItemProps } from './GalleryEditorItem.types';\n\nconst GalleryEditorItem: FC<GalleryEditorItemProps> = ({\n fileItem,\n handleDeleteFile,\n ratio = 1,\n onClick,\n}) => {\n const mediaContent =\n !fileItem.state ||\n fileItem.state === 'none' ||\n (!fileItem.previewUrl && !fileItem.uploadedFile) ? null : fileItem.state === 'uploading' ? (\n <GalleryEditorPreviewItem\n ratio={ratio}\n key={`uploading_${fileItem.id ?? ''}`}\n fileItem={fileItem}\n />\n ) : (\n <GalleryEditorMediaItem\n key={`uploaded_${fileItem.id ?? ''}`}\n fileItem={fileItem}\n ratio={ratio}\n openSelectedFile={onClick}\n />\n );\n\n return (\n <StyledGalleryEditorItem>\n <StyledGalleryEditorItemDeleteButton onClick={() => handleDeleteFile(fileItem.id)}>\n <Icon size={20} icons={['ts-wrong']} />\n </StyledGalleryEditorItemDeleteButton>\n <AnimatePresence initial={false}>{mediaContent}</AnimatePresence>\n </StyledGalleryEditorItem>\n );\n};\n\nGalleryEditorItem.displayName = 'GalleryEditorItem';\n\nexport default GalleryEditorItem;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAIA,IAAAK,uBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,yBAAA,GAAAH,sBAAA,CAAAH,OAAA;AAA8F,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG9F,MAAMG,iBAA6C,GAAGA,CAAC;EACnDC,QAAQ;EACRC,gBAAgB;EAChBC,KAAK,GAAG,CAAC;EACTC;AACJ,CAAC,KAAK;EACF,MAAMC,YAAY,GACd,CAACJ,QAAQ,CAACK,KAAK,IACfL,QAAQ,CAACK,KAAK,KAAK,MAAM,IACxB,CAACL,QAAQ,CAACM,UAAU,IAAI,CAACN,QAAQ,CAACO,YAAa,GAAG,IAAI,GAAGP,QAAQ,CAACK,KAAK,KAAK,WAAW,gBACpFd,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAACb,yBAAA,CAAAG,OAAwB;IACrBI,KAAK,EAAEA,KAAM;IACbO,GAAG,EAAE,aAAaT,QAAQ,CAACU,EAAE,IAAI,EAAE,EAAG;IACtCV,QAAQ,EAAEA;EAAS,CACtB,CAAC,gBAEFT,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAACd,uBAAA,CAAAI,OAAsB;IACnBW,GAAG,EAAE,YAAYT,QAAQ,CAACU,EAAE,IAAI,EAAE,EAAG;IACrCV,QAAQ,EAAEA,QAAS;IACnBE,KAAK,EAAEA,KAAM;IACbS,gBAAgB,EAAER;EAAQ,CAC7B,CACJ;EAEL,oBACIZ,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAACf,kBAAA,CAAAmB,uBAAuB,qBACpBrB,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAACf,kBAAA,CAAAoB,mCAAmC;IAACV,OAAO,EAAEA,CAAA,KAAMF,gBAAgB,CAACD,QAAQ,CAACU,EAAE;EAAE,gBAC9EnB,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAACpB,KAAA,CAAA0B,IAAI;IAACC,IAAI,EAAE,EAAG;IAACC,KAAK,EAAE,CAAC,UAAU;EAAE,CAAE,CACL,CAAC,eACtCzB,OAAA,CAAAO,OAAA,CAAAU,aAAA,CAAClB,MAAA,CAAA2B,eAAe;IAACC,OAAO,EAAE;EAAM,GAAEd,YAA8B,CAC3C,CAAC;AAElC,CAAC;AAEDL,iBAAiB,CAACoB,WAAW,GAAG,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAErCC,iBAAiB","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledGalleryEditorItemDeleteButton = exports.StyledGalleryEditorItem = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const StyledGalleryEditorItem = exports.StyledGalleryEditorItem = _styledComponents.default.div`
10
+ display: flex;
11
+ position: relative;
12
+ height: 100%;
13
+ width: 100%;
14
+ `;
15
+ const StyledGalleryEditorItemDeleteButton = exports.StyledGalleryEditorItemDeleteButton = _styledComponents.default.button`
16
+ background-color: rgba(
17
+ ${({
18
+ theme
19
+ }) => theme['000-rgb']},
20
+ 0.75
21
+ );
22
+ box-shadow: 0 0 0 1px
23
+ rgba(${({
24
+ theme
25
+ }) => theme['009-rgb']}, 0.08)
26
+ inset;
27
+ position: absolute;
28
+ top: 0;
29
+ right: 0;
30
+ z-index: 2;
31
+ height: 30px;
32
+ width: 30px;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ `;
37
+ //# sourceMappingURL=GalleryEditorItem.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorItem.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledGalleryEditorItem","exports","styled","div","StyledGalleryEditorItemDeleteButton","button","theme"],"sources":["../../../../../src/components/gallery-editor/gallery-editor-item/GalleryEditorItem.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\n\nexport const StyledGalleryEditorItem = styled.div`\n display: flex;\n position: relative;\n height: 100%;\n width: 100%;\n`;\n\ntype StyledGalleryEditorItemDeleteButtonProps = WithTheme<unknown>;\n\nexport const StyledGalleryEditorItemDeleteButton = styled.button<StyledGalleryEditorItemDeleteButtonProps>`\n background-color: rgba(\n ${({ theme }: StyledGalleryEditorItemDeleteButtonProps) => theme['000-rgb']},\n 0.75\n );\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledGalleryEditorItemDeleteButtonProps) => theme['009-rgb']}, 0.08)\n inset;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n height: 30px;\n width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGE,yBAAM,CAACC,GAAG;AACjD;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMC,mCAAmC,GAAAH,OAAA,CAAAG,mCAAA,GAAGF,yBAAM,CAACG,MAAgD;AAC1G;AACA,UAAU,CAAC;EAAEC;AAAgD,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AACnF;AACA;AACA;AACA,eAAe,CAAC;EAAEA;AAAgD,CAAC,KAAKA,KAAK,CAAC,SAAS,CAAC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=GalleryEditorItem.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorItem.types.js","names":[],"sources":["../../../../../src/components/gallery-editor/gallery-editor-item/GalleryEditorItem.types.ts"],"sourcesContent":["import type { InternalFileItem } from '@chayns-components/core';\n\n/**\n * Props for a single editable gallery tile.\n */\nexport interface GalleryEditorItemProps {\n /**\n * Provides the media item that should be rendered inside the tile.\n * @description\n * The item may represent a pending local upload or an already uploaded media file managed by the editor.\n * @example\n * <GalleryEditorItem fileItem={fileItem} handleDeleteFile={handleDeleteFile} onClick={handleOpen} />\n */\n fileItem: InternalFileItem;\n /**\n * Is called when the delete button is clicked in edit mode.\n * @description\n * The callback receives the internal item identifier so the editor can remove the item from its local state.\n * @example\n * <GalleryEditorItem handleDeleteFile={(id) => console.log(id)} fileItem={fileItem} onClick={handleOpen} />\n */\n handleDeleteFile: (id?: string) => void;\n /**\n * Defines the aspect ratio that should be reserved for the rendered media.\n * @description\n * Use this when the editor item should reserve a fixed tile ratio for uploaded previews.\n * @default 1\n * @example\n * <GalleryEditorItem fileItem={fileItem} handleDeleteFile={handleDeleteFile} onClick={handleOpen} ratio={1.5} />\n * @optional\n */\n ratio?: number;\n /**\n * Is called when the tile is clicked.\n * @description\n * The editor uses this callback to open the currently selected media within the slideshow flow.\n * @example\n * <GalleryEditorItem fileItem={fileItem} handleDeleteFile={handleDeleteFile} onClick={handleOpen} />\n */\n onClick: (file: InternalFileItem) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _MediaContent = _interopRequireDefault(require("../../../media-content/MediaContent"));
9
+ var _GalleryEditorMediaItem = require("./GalleryEditorMediaItem.styles");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const GalleryEditorMediaItem = ({
12
+ fileItem,
13
+ openSelectedFile,
14
+ ratio
15
+ }) => /*#__PURE__*/_react.default.createElement(_GalleryEditorMediaItem.StyledMotionGalleryEditorMediaItem, {
16
+ animate: {
17
+ opacity: 1
18
+ },
19
+ initial: {
20
+ opacity: 0
21
+ },
22
+ exit: {
23
+ opacity: 0
24
+ },
25
+ transition: {
26
+ duration: 3.2
27
+ }
28
+ }, fileItem.uploadedFile && /*#__PURE__*/_react.default.createElement(_MediaContent.default, {
29
+ file: fileItem.uploadedFile,
30
+ onClick: () => openSelectedFile(fileItem),
31
+ playIconSize: 30,
32
+ ratio: ratio
33
+ }));
34
+ GalleryEditorMediaItem.displayName = 'GalleryEditorMediaItem';
35
+ var _default = exports.default = GalleryEditorMediaItem;
36
+ //# sourceMappingURL=GalleryEditorMediaItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorMediaItem.js","names":["_react","_interopRequireDefault","require","_MediaContent","_GalleryEditorMediaItem","e","__esModule","default","GalleryEditorMediaItem","fileItem","openSelectedFile","ratio","createElement","StyledMotionGalleryEditorMediaItem","animate","opacity","initial","exit","transition","duration","uploadedFile","file","onClick","playIconSize","displayName","_default","exports"],"sources":["../../../../../../src/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport MediaContent from '../../../media-content/MediaContent';\nimport { StyledMotionGalleryEditorMediaItem } from './GalleryEditorMediaItem.styles';\nimport type { GalleryEditorMediaItemProps } from './GalleryEditorMediaItem.types';\n\nconst GalleryEditorMediaItem: FC<GalleryEditorMediaItemProps> = ({\n fileItem,\n openSelectedFile,\n ratio,\n}) => (\n <StyledMotionGalleryEditorMediaItem\n animate={{ opacity: 1 }}\n initial={{ opacity: 0 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 3.2 }}\n >\n {fileItem.uploadedFile && (\n <MediaContent\n file={fileItem.uploadedFile}\n onClick={() => openSelectedFile(fileItem)}\n playIconSize={30}\n ratio={ratio}\n />\n )}\n </StyledMotionGalleryEditorMediaItem>\n);\n\nGalleryEditorMediaItem.displayName = 'GalleryEditorMediaItem';\n\nexport default GalleryEditorMediaItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AAAqF,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGrF,MAAMG,sBAAuD,GAAGA,CAAC;EAC7DC,QAAQ;EACRC,gBAAgB;EAChBC;AACJ,CAAC,kBACGX,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACR,uBAAA,CAAAS,kCAAkC;EAC/BC,OAAO,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAE;EACxBC,OAAO,EAAE;IAAED,OAAO,EAAE;EAAE,CAAE;EACxBE,IAAI,EAAE;IAAEF,OAAO,EAAE;EAAE,CAAE;EACrBG,UAAU,EAAE;IAAEC,QAAQ,EAAE;EAAI;AAAE,GAE7BV,QAAQ,CAACW,YAAY,iBAClBpB,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,aAAA,CAAAI,OAAY;EACTc,IAAI,EAAEZ,QAAQ,CAACW,YAAa;EAC5BE,OAAO,EAAEA,CAAA,KAAMZ,gBAAgB,CAACD,QAAQ,CAAE;EAC1Cc,YAAY,EAAE,EAAG;EACjBZ,KAAK,EAAEA;AAAM,CAChB,CAE2B,CACvC;AAEDH,sBAAsB,CAACgB,WAAW,GAAG,wBAAwB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAE/CC,sBAAsB","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMotionGalleryEditorMediaItem = void 0;
7
+ var _react = require("motion/react");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const StyledMotionGalleryEditorMediaItem = exports.StyledMotionGalleryEditorMediaItem = (0, _styledComponents.default)(_react.motion.div)`
11
+ display: flex;
12
+ width: 100%;
13
+ height: 100%;
14
+ `;
15
+ //# sourceMappingURL=GalleryEditorMediaItem.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorMediaItem.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledMotionGalleryEditorMediaItem","exports","styled","motion","div"],"sources":["../../../../../../src/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\n\nexport const StyledMotionGalleryEditorMediaItem = styled(motion.div)`\n display: flex;\n width: 100%;\n height: 100%;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,kCAAkC,GAAAC,OAAA,CAAAD,kCAAA,GAAG,IAAAE,yBAAM,EAACC,aAAM,CAACC,GAAG,CAAC;AACpE;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=GalleryEditorMediaItem.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorMediaItem.types.js","names":[],"sources":["../../../../../../src/components/gallery-editor/gallery-editor-item/gallery-editor-media-item/GalleryEditorMediaItem.types.ts"],"sourcesContent":["import type { InternalFileItem } from '@chayns-components/core';\n\n/**\n * Props for a rendered uploaded media item.\n */\nexport interface GalleryEditorMediaItemProps {\n /**\n * Provides the uploaded media item that should be rendered.\n * @description\n * This item is expected to contain an `uploadedFile` because pending uploads are rendered by the preview component instead.\n * @example\n * <GalleryEditorMediaItem fileItem={fileItem} onClick={handleOpen} ratio={1} />\n */\n fileItem: InternalFileItem;\n /**\n * Is called when the media tile is selected.\n * @description\n * The editor uses this callback to open the uploaded media in the slideshow flow.\n * @example\n * <GalleryEditorMediaItem fileItem={fileItem} openSelectedFile={handleOpen} ratio={1} />\n */\n openSelectedFile: (file: InternalFileItem) => void;\n /**\n * Defines the aspect ratio that should be reserved for the media.\n * @description\n * The media tile keeps this ratio reserved so the editor grid remains visually stable.\n * @example\n * <GalleryEditorMediaItem fileItem={fileItem} openSelectedFile={handleOpen} ratio={1.5} />\n */\n ratio: number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _core = require("@chayns-components/core");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _GalleryEditorPreviewItem = require("./GalleryEditorPreviewItem.styles");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const GalleryEditorPreviewItem = ({
12
+ fileItem,
13
+ ratio
14
+ }) => /*#__PURE__*/_react.default.createElement(_GalleryEditorPreviewItem.StyledMotionGalleryEditorPreviewItem, {
15
+ animate: {
16
+ opacity: 1
17
+ },
18
+ initial: {
19
+ opacity: 0
20
+ },
21
+ exit: {
22
+ opacity: 0,
23
+ transition: {
24
+ duration: 3.2,
25
+ delay: 3.2
26
+ }
27
+ },
28
+ transition: {
29
+ duration: 3.2
30
+ },
31
+ style: {
32
+ position: 'absolute'
33
+ }
34
+ }, /*#__PURE__*/_react.default.createElement(_GalleryEditorPreviewItem.StyledGalleryEditorPreviewItemImageWrapper, {
35
+ $ratio: ratio
36
+ }, /*#__PURE__*/_react.default.createElement(_GalleryEditorPreviewItem.StyledGalleryEditorPreviewItemLoadingIcon, null, /*#__PURE__*/_react.default.createElement(_core.SmallWaitCursor, {
37
+ shouldHideWaitCursor: false,
38
+ shouldHideBackground: true
39
+ })), /*#__PURE__*/_react.default.createElement(_GalleryEditorPreviewItem.StyledGalleryEditorPreviewItemImage, {
40
+ draggable: false,
41
+ src: fileItem.previewUrl
42
+ })));
43
+ GalleryEditorPreviewItem.displayName = 'GalleryEditorPreviewItem';
44
+ var _default = exports.default = GalleryEditorPreviewItem;
45
+ //# sourceMappingURL=GalleryEditorPreviewItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryEditorPreviewItem.js","names":["_core","require","_react","_interopRequireDefault","_GalleryEditorPreviewItem","e","__esModule","default","GalleryEditorPreviewItem","fileItem","ratio","createElement","StyledMotionGalleryEditorPreviewItem","animate","opacity","initial","exit","transition","duration","delay","style","position","StyledGalleryEditorPreviewItemImageWrapper","$ratio","StyledGalleryEditorPreviewItemLoadingIcon","SmallWaitCursor","shouldHideWaitCursor","shouldHideBackground","StyledGalleryEditorPreviewItemImage","draggable","src","previewUrl","displayName","_default","exports"],"sources":["../../../../../../src/components/gallery-editor/gallery-editor-item/gallery-editor-preview-item/GalleryEditorPreviewItem.tsx"],"sourcesContent":["import { SmallWaitCursor } from '@chayns-components/core';\nimport React, { FC } from 'react';\nimport {\n StyledGalleryEditorPreviewItemImage,\n StyledGalleryEditorPreviewItemImageWrapper,\n StyledGalleryEditorPreviewItemLoadingIcon,\n StyledMotionGalleryEditorPreviewItem,\n} from './GalleryEditorPreviewItem.styles';\nimport type { GalleryEditorPreviewItemProps } from './GalleryEditorPreviewItem.types';\n\nconst GalleryEditorPreviewItem: FC<GalleryEditorPreviewItemProps> = ({ fileItem, ratio }) => (\n <StyledMotionGalleryEditorPreviewItem\n animate={{ opacity: 1 }}\n initial={{ opacity: 0 }}\n exit={{\n opacity: 0,\n transition: { duration: 3.2, delay: 3.2 },\n }}\n transition={{ duration: 3.2 }}\n style={{ position: 'absolute' }}\n >\n <StyledGalleryEditorPreviewItemImageWrapper $ratio={ratio}>\n <StyledGalleryEditorPreviewItemLoadingIcon>\n <SmallWaitCursor shouldHideWaitCursor={false} shouldHideBackground />\n </StyledGalleryEditorPreviewItemLoadingIcon>\n <StyledGalleryEditorPreviewItemImage draggable={false} src={fileItem.previewUrl} />\n </StyledGalleryEditorPreviewItemImageWrapper>\n </StyledMotionGalleryEditorPreviewItem>\n);\n\nGalleryEditorPreviewItem.displayName = 'GalleryEditorPreviewItem';\n\nexport default GalleryEditorPreviewItem;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AAK2C,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG3C,MAAMG,wBAA2D,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,kBACpFR,MAAA,CAAAK,OAAA,CAAAI,aAAA,CAACP,yBAAA,CAAAQ,oCAAoC;EACjCC,OAAO,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAE;EACxBC,OAAO,EAAE;IAAED,OAAO,EAAE;EAAE,CAAE;EACxBE,IAAI,EAAE;IACFF,OAAO,EAAE,CA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