@caprionlinesrl/puck-plugin-media 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -38,22 +38,190 @@ __export(index_exports, {
38
38
  });
39
39
  module.exports = __toCommonJS(index_exports);
40
40
 
41
- // src/createMediaPlugin.tsx
42
- var import_lucide_react16 = require("lucide-react");
41
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
42
+ var import_react2 = require("react");
43
+
44
+ // node_modules/lucide-react/dist/esm/shared/src/utils.js
45
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
46
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
47
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
48
+ }).join(" ").trim();
49
+
50
+ // node_modules/lucide-react/dist/esm/Icon.js
51
+ var import_react = require("react");
52
+
53
+ // node_modules/lucide-react/dist/esm/defaultAttributes.js
54
+ var defaultAttributes = {
55
+ xmlns: "http://www.w3.org/2000/svg",
56
+ width: 24,
57
+ height: 24,
58
+ viewBox: "0 0 24 24",
59
+ fill: "none",
60
+ stroke: "currentColor",
61
+ strokeWidth: 2,
62
+ strokeLinecap: "round",
63
+ strokeLinejoin: "round"
64
+ };
65
+
66
+ // node_modules/lucide-react/dist/esm/Icon.js
67
+ var Icon = (0, import_react.forwardRef)(
68
+ ({
69
+ color = "currentColor",
70
+ size = 24,
71
+ strokeWidth = 2,
72
+ absoluteStrokeWidth,
73
+ className = "",
74
+ children,
75
+ iconNode,
76
+ ...rest
77
+ }, ref) => {
78
+ return (0, import_react.createElement)(
79
+ "svg",
80
+ {
81
+ ref,
82
+ ...defaultAttributes,
83
+ width: size,
84
+ height: size,
85
+ stroke: color,
86
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
87
+ className: mergeClasses("lucide", className),
88
+ ...rest
89
+ },
90
+ [
91
+ ...iconNode.map(([tag, attrs]) => (0, import_react.createElement)(tag, attrs)),
92
+ ...Array.isArray(children) ? children : [children]
93
+ ]
94
+ );
95
+ }
96
+ );
97
+
98
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
99
+ var createLucideIcon = (iconName, iconNode) => {
100
+ const Component = (0, import_react2.forwardRef)(
101
+ ({ className, ...props }, ref) => (0, import_react2.createElement)(Icon, {
102
+ ref,
103
+ iconNode,
104
+ className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
105
+ ...props
106
+ })
107
+ );
108
+ Component.displayName = `${iconName}`;
109
+ return Component;
110
+ };
111
+
112
+ // node_modules/lucide-react/dist/esm/icons/arrow-left.js
113
+ var ArrowLeft = createLucideIcon("ArrowLeft", [
114
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
115
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
116
+ ]);
117
+
118
+ // node_modules/lucide-react/dist/esm/icons/check.js
119
+ var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
120
+
121
+ // node_modules/lucide-react/dist/esm/icons/circle-alert.js
122
+ var CircleAlert = createLucideIcon("CircleAlert", [
123
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
124
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
125
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
126
+ ]);
127
+
128
+ // node_modules/lucide-react/dist/esm/icons/circle-check-big.js
129
+ var CircleCheckBig = createLucideIcon("CircleCheckBig", [
130
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
131
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
132
+ ]);
133
+
134
+ // node_modules/lucide-react/dist/esm/icons/file-text.js
135
+ var FileText = createLucideIcon("FileText", [
136
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
137
+ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
138
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
139
+ ["path", { d: "M16 13H8", key: "t4e002" }],
140
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
141
+ ]);
142
+
143
+ // node_modules/lucide-react/dist/esm/icons/file.js
144
+ var File = createLucideIcon("File", [
145
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
146
+ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
147
+ ]);
148
+
149
+ // node_modules/lucide-react/dist/esm/icons/image-plus.js
150
+ var ImagePlus = createLucideIcon("ImagePlus", [
151
+ ["path", { d: "M16 5h6", key: "1vod17" }],
152
+ ["path", { d: "M19 2v6", key: "4bpg5p" }],
153
+ ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
154
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
155
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
156
+ ]);
157
+
158
+ // node_modules/lucide-react/dist/esm/icons/image.js
159
+ var Image = createLucideIcon("Image", [
160
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
161
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
162
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
163
+ ]);
164
+
165
+ // node_modules/lucide-react/dist/esm/icons/images.js
166
+ var Images = createLucideIcon("Images", [
167
+ ["path", { d: "M18 22H4a2 2 0 0 1-2-2V6", key: "pblm9e" }],
168
+ ["path", { d: "m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18", key: "nf6bnh" }],
169
+ ["circle", { cx: "12", cy: "8", r: "2", key: "1822b1" }],
170
+ ["rect", { width: "16", height: "16", x: "6", y: "2", rx: "2", key: "12espp" }]
171
+ ]);
172
+
173
+ // node_modules/lucide-react/dist/esm/icons/loader-circle.js
174
+ var LoaderCircle = createLucideIcon("LoaderCircle", [
175
+ ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
176
+ ]);
177
+
178
+ // node_modules/lucide-react/dist/esm/icons/pencil.js
179
+ var Pencil = createLucideIcon("Pencil", [
180
+ [
181
+ "path",
182
+ {
183
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
184
+ key: "1a8usu"
185
+ }
186
+ ],
187
+ ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
188
+ ]);
189
+
190
+ // node_modules/lucide-react/dist/esm/icons/plus.js
191
+ var Plus = createLucideIcon("Plus", [
192
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
193
+ ["path", { d: "M12 5v14", key: "s699le" }]
194
+ ]);
195
+
196
+ // node_modules/lucide-react/dist/esm/icons/search.js
197
+ var Search = createLucideIcon("Search", [
198
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
199
+ ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
200
+ ]);
201
+
202
+ // node_modules/lucide-react/dist/esm/icons/upload.js
203
+ var Upload = createLucideIcon("Upload", [
204
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
205
+ ["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
206
+ ["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
207
+ ]);
208
+
209
+ // node_modules/lucide-react/dist/esm/icons/x.js
210
+ var X = createLucideIcon("X", [
211
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
212
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
213
+ ]);
43
214
 
44
215
  // src/components/ImageField/ImageField.tsx
45
- var import_react7 = require("react");
216
+ var import_react9 = require("react");
46
217
  var import_react_dom = require("react-dom");
47
218
  var import_core = require("@puckeditor/core");
48
- var import_lucide_react10 = require("lucide-react");
49
219
 
50
220
  // src/components/ImagePickerModal/ImagePickerModal.tsx
51
- var import_react6 = require("react");
52
- var import_lucide_react9 = require("lucide-react");
221
+ var import_react8 = require("react");
53
222
 
54
223
  // src/components/Modal/Modal.tsx
55
- var import_react = require("react");
56
- var import_lucide_react = require("lucide-react");
224
+ var import_react3 = require("react");
57
225
 
58
226
  // src/components/Modal/Modal.module.css
59
227
  var Modal_default = {
@@ -91,7 +259,7 @@ function Modal({
91
259
  empty = false,
92
260
  emptyMessage = "No items found"
93
261
  }) {
94
- (0, import_react.useEffect)(() => {
262
+ (0, import_react3.useEffect)(() => {
95
263
  const handleEscape = (e) => {
96
264
  if (e.key === "Escape") {
97
265
  onClose();
@@ -100,7 +268,7 @@ function Modal({
100
268
  window.addEventListener("keydown", handleEscape);
101
269
  return () => window.removeEventListener("keydown", handleEscape);
102
270
  }, [onClose]);
103
- (0, import_react.useEffect)(() => {
271
+ (0, import_react3.useEffect)(() => {
104
272
  const originalOverflow = document.body.style.overflow;
105
273
  document.body.style.overflow = "hidden";
106
274
  return () => {
@@ -136,16 +304,19 @@ function Modal({
136
304
  },
137
305
  className: Modal_default.closeButton,
138
306
  "aria-label": "Close",
139
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { size: 20 })
307
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 20 })
140
308
  }
141
309
  )
142
310
  ] })
143
311
  ] }),
144
312
  toolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.toolbar, children: toolbar }),
145
313
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.content, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Modal_default.loading, children: [
146
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { size: 32, className: Modal_default.spinner }),
314
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoaderCircle, { size: 32, className: Modal_default.spinner }),
147
315
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Loading..." })
148
- ] }) : empty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.empty, children: emptyMessage }) : children }),
316
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
317
+ children,
318
+ empty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.empty, children: emptyMessage })
319
+ ] }) }),
149
320
  footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.footer, children: footer }),
150
321
  overlay
151
322
  ]
@@ -154,8 +325,7 @@ function Modal({
154
325
  }
155
326
 
156
327
  // src/components/SearchBar/SearchBar.tsx
157
- var import_react2 = require("react");
158
- var import_lucide_react2 = require("lucide-react");
328
+ var import_react4 = require("react");
159
329
 
160
330
  // src/components/SearchBar/SearchBar.module.css
161
331
  var SearchBar_default = {
@@ -173,8 +343,8 @@ function SearchBar({
173
343
  placeholder = "Search...",
174
344
  autoFocus = false
175
345
  }) {
176
- const inputRef = (0, import_react2.useRef)(null);
177
- (0, import_react2.useEffect)(() => {
346
+ const inputRef = (0, import_react4.useRef)(null);
347
+ (0, import_react4.useEffect)(() => {
178
348
  if (autoFocus && inputRef.current) {
179
349
  inputRef.current.focus();
180
350
  }
@@ -184,7 +354,7 @@ function SearchBar({
184
354
  inputRef.current?.focus();
185
355
  };
186
356
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: SearchBar_default.container, children: [
187
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Search, { size: 18, className: SearchBar_default.icon }),
357
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Search, { size: 18, className: SearchBar_default.icon }),
188
358
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
189
359
  "input",
190
360
  {
@@ -203,15 +373,12 @@ function SearchBar({
203
373
  onClick: handleClear,
204
374
  className: SearchBar_default.clearButton,
205
375
  "aria-label": "Clear search",
206
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.X, { size: 16 })
376
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(X, { size: 16 })
207
377
  }
208
378
  )
209
379
  ] });
210
380
  }
211
381
 
212
- // src/components/LoadMoreButton/LoadMoreButton.tsx
213
- var import_lucide_react3 = require("lucide-react");
214
-
215
382
  // src/components/LoadMoreButton/LoadMoreButton.module.css
216
383
  var LoadMoreButton_default = {
217
384
  container: "LoadMoreButton_container",
@@ -231,7 +398,7 @@ function LoadMoreButton({ onClick, loading = false }) {
231
398
  disabled: loading,
232
399
  className: LoadMoreButton_default.button,
233
400
  children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
234
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Loader2, { size: 16, className: LoadMoreButton_default.spinner }),
401
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LoaderCircle, { size: 16, className: LoadMoreButton_default.spinner }),
235
402
  "Loading..."
236
403
  ] }) : "Load more"
237
404
  }
@@ -239,8 +406,7 @@ function LoadMoreButton({ onClick, loading = false }) {
239
406
  }
240
407
 
241
408
  // src/components/ConfirmDialog/ConfirmDialog.tsx
242
- var import_react3 = require("react");
243
- var import_lucide_react4 = require("lucide-react");
409
+ var import_react5 = require("react");
244
410
 
245
411
  // src/components/ConfirmDialog/ConfirmDialog.module.css
246
412
  var ConfirmDialog_default = {
@@ -269,7 +435,7 @@ function ConfirmDialog({
269
435
  loading = false,
270
436
  variant = "danger"
271
437
  }) {
272
- (0, import_react3.useEffect)(() => {
438
+ (0, import_react5.useEffect)(() => {
273
439
  const handleEscape = (e) => {
274
440
  if (e.key === "Escape" && !loading) {
275
441
  e.stopPropagation();
@@ -301,7 +467,7 @@ function ConfirmDialog({
301
467
  className: `${ConfirmDialog_default.confirmButton} ${variant === "danger" ? ConfirmDialog_default.danger : ""}`,
302
468
  disabled: loading,
303
469
  children: loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
304
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Loader2, { size: 16, className: ConfirmDialog_default.spinner }),
470
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LoaderCircle, { size: 16, className: ConfirmDialog_default.spinner }),
305
471
  confirmLabel
306
472
  ] }) : confirmLabel
307
473
  }
@@ -310,9 +476,6 @@ function ConfirmDialog({
310
476
  ] }) });
311
477
  }
312
478
 
313
- // src/components/SelectionToolbar/SelectionToolbar.tsx
314
- var import_lucide_react5 = require("lucide-react");
315
-
316
479
  // src/components/SelectionToolbar/SelectionToolbar.module.css
317
480
  var SelectionToolbar_default = {
318
481
  toolbar: "SelectionToolbar_toolbar",
@@ -349,7 +512,7 @@ function SelectionToolbar({
349
512
  "aria-label": isAllSelected ? "Deselect all" : "Select all",
350
513
  children: [
351
514
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: SelectionToolbar_default.checkbox, children: [
352
- isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Check, { size: 14, strokeWidth: 3 }),
515
+ isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Check, { size: 14, strokeWidth: 3 }),
353
516
  isIndeterminate && !isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: SelectionToolbar_default.indeterminateLine })
354
517
  ] }),
355
518
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Select All" })
@@ -385,9 +548,6 @@ function SelectionToolbar({
385
548
  ] });
386
549
  }
387
550
 
388
- // src/components/ImageGrid/ImageGrid.tsx
389
- var import_lucide_react6 = require("lucide-react");
390
-
391
551
  // src/components/ImageGrid/ImageGrid.module.css
392
552
  var ImageGrid_default = {
393
553
  grid: "ImageGrid_grid",
@@ -462,7 +622,7 @@ function ImageGrid({
462
622
  loading: "lazy"
463
623
  }
464
624
  ),
465
- manageMode && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${ImageGrid_default.checkbox} ${selected ? ImageGrid_default.checkboxChecked : ""}`, children: selected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react6.Check, { size: 14, strokeWidth: 3 }) }),
625
+ manageMode && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${ImageGrid_default.checkbox} ${selected ? ImageGrid_default.checkboxChecked : ""}`, children: selected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Check, { size: 14, strokeWidth: 3 }) }),
466
626
  isSelectedForInsert && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: ImageGrid_default.checkmark, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
467
627
  "svg",
468
628
  {
@@ -505,7 +665,7 @@ function ImageGrid({
505
665
  onClick: (e) => handleEditClick(e, item),
506
666
  className: ImageGrid_default.editButton,
507
667
  "aria-label": "Edit alt",
508
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react6.Pencil, { size: 14 })
668
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pencil, { size: 14 })
509
669
  }
510
670
  )
511
671
  ] }) })
@@ -514,11 +674,10 @@ function ImageGrid({
514
674
  }
515
675
 
516
676
  // src/components/UploadDropzone/UploadDropzone.tsx
517
- var import_react5 = require("react");
518
- var import_lucide_react7 = require("lucide-react");
677
+ var import_react7 = require("react");
519
678
 
520
679
  // src/hooks/useUpload.ts
521
- var import_react4 = require("react");
680
+ var import_react6 = require("react");
522
681
  var DEFAULT_CONFIG = {
523
682
  accept: "image/*",
524
683
  maxSize: 10 * 1024 * 1024,
@@ -570,10 +729,10 @@ function useUpload({
570
729
  config,
571
730
  onUploadComplete
572
731
  }) {
573
- const [uploading, setUploading] = (0, import_react4.useState)([]);
574
- const activeUploadsRef = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
732
+ const [uploading, setUploading] = (0, import_react6.useState)([]);
733
+ const activeUploadsRef = (0, import_react6.useRef)(/* @__PURE__ */ new Set());
575
734
  const uploadConfig = { ...DEFAULT_CONFIG, ...config };
576
- const startUpload = (0, import_react4.useCallback)(
735
+ const startUpload = (0, import_react6.useCallback)(
577
736
  async (id, file) => {
578
737
  try {
579
738
  const result = await upload(file, {
@@ -604,7 +763,7 @@ function useUpload({
604
763
  },
605
764
  [upload, onUploadComplete]
606
765
  );
607
- const processQueue = (0, import_react4.useCallback)(() => {
766
+ const processQueue = (0, import_react6.useCallback)(() => {
608
767
  setUploading((current) => {
609
768
  const pending = current.filter(
610
769
  (f) => f.status === "pending" && !activeUploadsRef.current.has(f.id)
@@ -624,7 +783,7 @@ function useUpload({
624
783
  );
625
784
  });
626
785
  }, [startUpload]);
627
- const addFiles = (0, import_react4.useCallback)(
786
+ const addFiles = (0, import_react6.useCallback)(
628
787
  (files) => {
629
788
  const fileArray = Array.from(files);
630
789
  const filesToAdd = uploadConfig.multiple ? fileArray : fileArray.slice(0, 1);
@@ -645,7 +804,7 @@ function useUpload({
645
804
  },
646
805
  [uploadConfig, processQueue]
647
806
  );
648
- const cancelUpload = (0, import_react4.useCallback)((id) => {
807
+ const cancelUpload = (0, import_react6.useCallback)((id) => {
649
808
  setUploading((current) => {
650
809
  const file = current.find((f) => f.id === id);
651
810
  if (file?.previewUrl) {
@@ -655,7 +814,7 @@ function useUpload({
655
814
  });
656
815
  activeUploadsRef.current.delete(id);
657
816
  }, []);
658
- const clearCompleted = (0, import_react4.useCallback)(() => {
817
+ const clearCompleted = (0, import_react6.useCallback)(() => {
659
818
  setUploading((current) => {
660
819
  current.filter((f) => f.status === "completed" || f.status === "error").forEach((f) => {
661
820
  if (f.previewUrl) {
@@ -696,10 +855,10 @@ function UploadDropzone({
696
855
  config,
697
856
  disabled = false
698
857
  }) {
699
- const [isDragging, setIsDragging] = (0, import_react5.useState)(false);
700
- const inputRef = (0, import_react5.useRef)(null);
701
- const dragCounterRef = (0, import_react5.useRef)(0);
702
- const handleDragEnter = (0, import_react5.useCallback)((e) => {
858
+ const [isDragging, setIsDragging] = (0, import_react7.useState)(false);
859
+ const inputRef = (0, import_react7.useRef)(null);
860
+ const dragCounterRef = (0, import_react7.useRef)(0);
861
+ const handleDragEnter = (0, import_react7.useCallback)((e) => {
703
862
  e.preventDefault();
704
863
  e.stopPropagation();
705
864
  dragCounterRef.current++;
@@ -707,7 +866,7 @@ function UploadDropzone({
707
866
  setIsDragging(true);
708
867
  }
709
868
  }, []);
710
- const handleDragLeave = (0, import_react5.useCallback)((e) => {
869
+ const handleDragLeave = (0, import_react7.useCallback)((e) => {
711
870
  e.preventDefault();
712
871
  e.stopPropagation();
713
872
  dragCounterRef.current--;
@@ -715,11 +874,11 @@ function UploadDropzone({
715
874
  setIsDragging(false);
716
875
  }
717
876
  }, []);
718
- const handleDragOver = (0, import_react5.useCallback)((e) => {
877
+ const handleDragOver = (0, import_react7.useCallback)((e) => {
719
878
  e.preventDefault();
720
879
  e.stopPropagation();
721
880
  }, []);
722
- const handleDrop = (0, import_react5.useCallback)(
881
+ const handleDrop = (0, import_react7.useCallback)(
723
882
  (e) => {
724
883
  e.preventDefault();
725
884
  e.stopPropagation();
@@ -733,12 +892,12 @@ function UploadDropzone({
733
892
  },
734
893
  [disabled, onFilesSelected]
735
894
  );
736
- const handleClick = (0, import_react5.useCallback)(() => {
895
+ const handleClick = (0, import_react7.useCallback)(() => {
737
896
  if (!disabled && inputRef.current) {
738
897
  inputRef.current.click();
739
898
  }
740
899
  }, [disabled]);
741
- const handleInputChange = (0, import_react5.useCallback)(
900
+ const handleInputChange = (0, import_react7.useCallback)(
742
901
  (e) => {
743
902
  const { files } = e.target;
744
903
  if (files && files.length > 0) {
@@ -791,7 +950,7 @@ function UploadDropzone({
791
950
  disabled
792
951
  }
793
952
  ),
794
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react7.Upload, { size: 24, className: UploadDropzone_default.icon }),
953
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Upload, { size: 24, className: UploadDropzone_default.icon }),
795
954
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: UploadDropzone_default.text, children: isDragging ? "Drop files here" : "Drop files here or click to upload" }),
796
955
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: UploadDropzone_default.hint, children: [
797
956
  formatAcceptedTypes(config.accept),
@@ -804,9 +963,6 @@ function UploadDropzone({
804
963
  );
805
964
  }
806
965
 
807
- // src/components/UploadQueue/UploadQueue.tsx
808
- var import_lucide_react8 = require("lucide-react");
809
-
810
966
  // src/components/UploadQueue/UploadQueue.module.css
811
967
  var UploadQueue_default = {
812
968
  container: "UploadQueue_container",
@@ -890,12 +1046,12 @@ function UploadItem({ file, onCancel }) {
890
1046
  onClick: onCancel,
891
1047
  className: UploadQueue_default.cancelButton,
892
1048
  "aria-label": "Cancel upload",
893
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.X, { size: 16 })
1049
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(X, { size: 16 })
894
1050
  }
895
1051
  ),
896
- file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.Loader2, { size: 18, className: UploadQueue_default.spinner }),
897
- file.status === "completed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.CheckCircle, { size: 18, className: UploadQueue_default.successIcon }),
898
- file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react8.AlertCircle, { size: 18, className: UploadQueue_default.errorIcon })
1052
+ file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LoaderCircle, { size: 18, className: UploadQueue_default.spinner }),
1053
+ file.status === "completed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CircleCheckBig, { size: 18, className: UploadQueue_default.successIcon }),
1054
+ file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CircleAlert, { size: 18, className: UploadQueue_default.errorIcon })
899
1055
  ] })
900
1056
  ] });
901
1057
  }
@@ -950,21 +1106,21 @@ function ImagePickerModal({
950
1106
  selectable = true
951
1107
  }) {
952
1108
  const { fetchList, upload, update, delete: deleteImage, uploadConfig } = imageOptions;
953
- const [view, setView] = (0, import_react6.useState)("picker");
954
- const [editingItem, setEditingItem] = (0, import_react6.useState)(null);
955
- const [selectMode, setSelectMode] = (0, import_react6.useState)(false);
956
- const [selectedForDelete, setSelectedForDelete] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
957
- const [items, setItems] = (0, import_react6.useState)([]);
958
- const [search, setSearch] = (0, import_react6.useState)("");
959
- const [loading, setLoading] = (0, import_react6.useState)(true);
960
- const [page, setPage] = (0, import_react6.useState)(1);
961
- const [hasMore, setHasMore] = (0, import_react6.useState)(false);
962
- const [selectedItem, setSelectedItem] = (0, import_react6.useState)(null);
963
- const [altValues, setAltValues] = (0, import_react6.useState)({});
964
- const [activeLang, setActiveLang] = (0, import_react6.useState)(languages[0]?.code || "it");
965
- const [isSaving, setIsSaving] = (0, import_react6.useState)(false);
966
- const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react6.useState)(false);
967
- const [isDeleting, setIsDeleting] = (0, import_react6.useState)(false);
1109
+ const [view, setView] = (0, import_react8.useState)("picker");
1110
+ const [editingItem, setEditingItem] = (0, import_react8.useState)(null);
1111
+ const [selectMode, setSelectMode] = (0, import_react8.useState)(false);
1112
+ const [selectedForDelete, setSelectedForDelete] = (0, import_react8.useState)(/* @__PURE__ */ new Set());
1113
+ const [items, setItems] = (0, import_react8.useState)([]);
1114
+ const [search, setSearch] = (0, import_react8.useState)("");
1115
+ const [loading, setLoading] = (0, import_react8.useState)(true);
1116
+ const [page, setPage] = (0, import_react8.useState)(1);
1117
+ const [hasMore, setHasMore] = (0, import_react8.useState)(false);
1118
+ const [selectedItem, setSelectedItem] = (0, import_react8.useState)(null);
1119
+ const [altValues, setAltValues] = (0, import_react8.useState)({});
1120
+ const [activeLang, setActiveLang] = (0, import_react8.useState)(languages[0]?.code || "it");
1121
+ const [isSaving, setIsSaving] = (0, import_react8.useState)(false);
1122
+ const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react8.useState)(false);
1123
+ const [isDeleting, setIsDeleting] = (0, import_react8.useState)(false);
968
1124
  const canUpload = !!upload;
969
1125
  const {
970
1126
  uploading,
@@ -982,7 +1138,7 @@ function ImagePickerModal({
982
1138
  setItems((prev) => [newItem, ...prev]);
983
1139
  }
984
1140
  });
985
- const loadItems = (0, import_react6.useCallback)(
1141
+ const loadItems = (0, import_react8.useCallback)(
986
1142
  async (searchQuery, pageNum, append = false) => {
987
1143
  setLoading(true);
988
1144
  try {
@@ -1005,14 +1161,14 @@ function ImagePickerModal({
1005
1161
  },
1006
1162
  [fetchList]
1007
1163
  );
1008
- (0, import_react6.useEffect)(() => {
1164
+ (0, import_react8.useEffect)(() => {
1009
1165
  const timer = setTimeout(() => {
1010
1166
  setPage(1);
1011
1167
  loadItems(search, 1);
1012
1168
  }, 300);
1013
1169
  return () => clearTimeout(timer);
1014
1170
  }, [search, loadItems]);
1015
- (0, import_react6.useEffect)(() => {
1171
+ (0, import_react8.useEffect)(() => {
1016
1172
  if (selectedImage) {
1017
1173
  const existingItem = items.find((item) => item.id === selectedImage.id);
1018
1174
  if (existingItem) {
@@ -1020,7 +1176,7 @@ function ImagePickerModal({
1020
1176
  }
1021
1177
  }
1022
1178
  }, [selectedImage, items]);
1023
- const handleClose = (0, import_react6.useCallback)(() => {
1179
+ const handleClose = (0, import_react8.useCallback)(() => {
1024
1180
  onClose();
1025
1181
  }, [onClose]);
1026
1182
  const handleLoadMore = () => {
@@ -1135,7 +1291,7 @@ function ImagePickerModal({
1135
1291
  },
1136
1292
  className: ImagePickerModal_default.backButton,
1137
1293
  "aria-label": "Back to grid",
1138
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react9.ArrowLeft, { size: 20 })
1294
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowLeft, { size: 20 })
1139
1295
  }
1140
1296
  ),
1141
1297
  footer: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: ImagePickerModal_default.editFooter, children: [
@@ -1148,7 +1304,7 @@ function ImagePickerModal({
1148
1304
  className: ImagePickerModal_default.saveButton,
1149
1305
  disabled: isSaving || !update,
1150
1306
  children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1151
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react9.Loader2, { size: 16, className: ImagePickerModal_default.spinner }),
1307
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoaderCircle, { size: 16, className: ImagePickerModal_default.spinner }),
1152
1308
  "Saving..."
1153
1309
  ] }) : "Save"
1154
1310
  }
@@ -1355,7 +1511,7 @@ function ImageField({
1355
1511
  languages,
1356
1512
  imageOptions
1357
1513
  }) {
1358
- const [isModalOpen, setIsModalOpen] = (0, import_react7.useState)(false);
1514
+ const [isModalOpen, setIsModalOpen] = (0, import_react9.useState)(false);
1359
1515
  const handleSelect = (item) => {
1360
1516
  onChange(item);
1361
1517
  setIsModalOpen(false);
@@ -1403,7 +1559,7 @@ function ImageField({
1403
1559
  onClick: handleRemove,
1404
1560
  className: ImageField_default.removeButton,
1405
1561
  "aria-label": "Remove image",
1406
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react10.X, { size: 16 })
1562
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(X, { size: 16 })
1407
1563
  }
1408
1564
  )
1409
1565
  ] })
@@ -1414,7 +1570,7 @@ function ImageField({
1414
1570
  onClick: handleOpenModal,
1415
1571
  className: ImageField_default.selectButton,
1416
1572
  children: [
1417
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react10.ImagePlus, { size: 24 }),
1573
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ImagePlus, { size: 24 }),
1418
1574
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Select image" })
1419
1575
  ]
1420
1576
  }
@@ -1437,14 +1593,12 @@ function ImageField({
1437
1593
  }
1438
1594
 
1439
1595
  // src/components/GalleryField/GalleryField.tsx
1440
- var import_react9 = require("react");
1596
+ var import_react11 = require("react");
1441
1597
  var import_react_dom2 = require("react-dom");
1442
1598
  var import_core2 = require("@puckeditor/core");
1443
- var import_lucide_react12 = require("lucide-react");
1444
1599
 
1445
1600
  // src/components/GalleryPickerModal/GalleryPickerModal.tsx
1446
- var import_react8 = require("react");
1447
- var import_lucide_react11 = require("lucide-react");
1601
+ var import_react10 = require("react");
1448
1602
 
1449
1603
  // src/components/GalleryPickerModal/GalleryPickerModal.module.css
1450
1604
  var GalleryPickerModal_default = {
@@ -1511,28 +1665,28 @@ function GalleryPickerModal({
1511
1665
  }) {
1512
1666
  void _initialSelectedGallery;
1513
1667
  const { fetchList, fetch, create, delete: deleteGallery, upload, removeImage, updateImage } = galleryOptions;
1514
- const [viewMode, setViewMode] = (0, import_react8.useState)("list");
1515
- const [editingImage, setEditingImage] = (0, import_react8.useState)(null);
1516
- const [galleries, setGalleries] = (0, import_react8.useState)([]);
1517
- const [selectedGalleryItem, setSelectedGalleryItem] = (0, import_react8.useState)(null);
1518
- const [search, setSearch] = (0, import_react8.useState)("");
1519
- const [loading, setLoading] = (0, import_react8.useState)(true);
1520
- const [page, setPage] = (0, import_react8.useState)(1);
1521
- const [hasMore, setHasMore] = (0, import_react8.useState)(false);
1522
- const [gallerySelectMode, setGallerySelectMode] = (0, import_react8.useState)(false);
1523
- const [selectedGalleryIds, setSelectedGalleryIds] = (0, import_react8.useState)(/* @__PURE__ */ new Set());
1524
- const [imageSelectMode, setImageSelectMode] = (0, import_react8.useState)(false);
1525
- const [selectedImageIds, setSelectedImageIds] = (0, import_react8.useState)(/* @__PURE__ */ new Set());
1526
- const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react8.useState)(false);
1527
- const [deleteTarget, setDeleteTarget] = (0, import_react8.useState)("gallery");
1528
- const [isDeleting, setIsDeleting] = (0, import_react8.useState)(false);
1529
- const [isCreating, setIsCreating] = (0, import_react8.useState)(false);
1530
- const [newGalleryName, setNewGalleryName] = (0, import_react8.useState)("");
1531
- const [createLoading, setCreateLoading] = (0, import_react8.useState)(false);
1532
- const [altValues, setAltValues] = (0, import_react8.useState)({});
1533
- const [activeLang, setActiveLang] = (0, import_react8.useState)(languages[0]?.code || "it");
1534
- const [isSaving, setIsSaving] = (0, import_react8.useState)(false);
1535
- const newGalleryInputRef = (0, import_react8.useRef)(null);
1668
+ const [viewMode, setViewMode] = (0, import_react10.useState)("list");
1669
+ const [editingImage, setEditingImage] = (0, import_react10.useState)(null);
1670
+ const [galleries, setGalleries] = (0, import_react10.useState)([]);
1671
+ const [selectedGalleryItem, setSelectedGalleryItem] = (0, import_react10.useState)(null);
1672
+ const [search, setSearch] = (0, import_react10.useState)("");
1673
+ const [loading, setLoading] = (0, import_react10.useState)(true);
1674
+ const [page, setPage] = (0, import_react10.useState)(1);
1675
+ const [hasMore, setHasMore] = (0, import_react10.useState)(false);
1676
+ const [gallerySelectMode, setGallerySelectMode] = (0, import_react10.useState)(false);
1677
+ const [selectedGalleryIds, setSelectedGalleryIds] = (0, import_react10.useState)(/* @__PURE__ */ new Set());
1678
+ const [imageSelectMode, setImageSelectMode] = (0, import_react10.useState)(false);
1679
+ const [selectedImageIds, setSelectedImageIds] = (0, import_react10.useState)(/* @__PURE__ */ new Set());
1680
+ const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react10.useState)(false);
1681
+ const [deleteTarget, setDeleteTarget] = (0, import_react10.useState)("gallery");
1682
+ const [isDeleting, setIsDeleting] = (0, import_react10.useState)(false);
1683
+ const [isCreating, setIsCreating] = (0, import_react10.useState)(false);
1684
+ const [newGalleryName, setNewGalleryName] = (0, import_react10.useState)("");
1685
+ const [createLoading, setCreateLoading] = (0, import_react10.useState)(false);
1686
+ const [altValues, setAltValues] = (0, import_react10.useState)({});
1687
+ const [activeLang, setActiveLang] = (0, import_react10.useState)(languages[0]?.code || "it");
1688
+ const [isSaving, setIsSaving] = (0, import_react10.useState)(false);
1689
+ const newGalleryInputRef = (0, import_react10.useRef)(null);
1536
1690
  const {
1537
1691
  uploading,
1538
1692
  isUploading,
@@ -1560,7 +1714,7 @@ function GalleryPickerModal({
1560
1714
  }
1561
1715
  }
1562
1716
  });
1563
- const loadGalleries = (0, import_react8.useCallback)(
1717
+ const loadGalleries = (0, import_react10.useCallback)(
1564
1718
  async (searchQuery, pageNum, append = false) => {
1565
1719
  setLoading(true);
1566
1720
  try {
@@ -1583,7 +1737,7 @@ function GalleryPickerModal({
1583
1737
  },
1584
1738
  [fetchList]
1585
1739
  );
1586
- const loadGalleryDetail = (0, import_react8.useCallback)(
1740
+ const loadGalleryDetail = (0, import_react10.useCallback)(
1587
1741
  async (id) => {
1588
1742
  setLoading(true);
1589
1743
  try {
@@ -1597,7 +1751,7 @@ function GalleryPickerModal({
1597
1751
  },
1598
1752
  [fetch]
1599
1753
  );
1600
- (0, import_react8.useEffect)(() => {
1754
+ (0, import_react10.useEffect)(() => {
1601
1755
  if (viewMode === "list") {
1602
1756
  const timer = setTimeout(() => {
1603
1757
  setPage(1);
@@ -1606,12 +1760,12 @@ function GalleryPickerModal({
1606
1760
  return () => clearTimeout(timer);
1607
1761
  }
1608
1762
  }, [search, loadGalleries, viewMode]);
1609
- (0, import_react8.useEffect)(() => {
1763
+ (0, import_react10.useEffect)(() => {
1610
1764
  if (isCreating && newGalleryInputRef.current) {
1611
1765
  newGalleryInputRef.current.focus();
1612
1766
  }
1613
1767
  }, [isCreating]);
1614
- const handleClose = (0, import_react8.useCallback)(() => {
1768
+ const handleClose = (0, import_react10.useCallback)(() => {
1615
1769
  onClose();
1616
1770
  }, [onClose]);
1617
1771
  const handleLoadMore = () => {
@@ -1775,7 +1929,7 @@ function GalleryPickerModal({
1775
1929
  },
1776
1930
  className: GalleryPickerModal_default.backButton,
1777
1931
  "aria-label": "Back to gallery",
1778
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.ArrowLeft, { size: 20 })
1932
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ArrowLeft, { size: 20 })
1779
1933
  }
1780
1934
  ),
1781
1935
  footer: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: GalleryPickerModal_default.editFooter, children: [
@@ -1788,7 +1942,7 @@ function GalleryPickerModal({
1788
1942
  className: GalleryPickerModal_default.saveButton,
1789
1943
  disabled: isSaving || !updateImage,
1790
1944
  children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1791
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.Loader2, { size: 16, className: GalleryPickerModal_default.spinner }),
1945
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoaderCircle, { size: 16, className: GalleryPickerModal_default.spinner }),
1792
1946
  "Saving..."
1793
1947
  ] }) : "Save"
1794
1948
  }
@@ -1908,7 +2062,7 @@ function GalleryPickerModal({
1908
2062
  },
1909
2063
  className: GalleryPickerModal_default.backButton,
1910
2064
  "aria-label": "Back to galleries",
1911
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.ArrowLeft, { size: 20 })
2065
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ArrowLeft, { size: 20 })
1912
2066
  }
1913
2067
  ),
1914
2068
  headerActions: !imageSelectMode && typeof removeImage === "function" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -2023,7 +2177,7 @@ function GalleryPickerModal({
2023
2177
  onClick: () => setIsCreating(true),
2024
2178
  className: GalleryPickerModal_default.createButton,
2025
2179
  children: [
2026
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.Plus, { size: 18 }),
2180
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Plus, { size: 18 }),
2027
2181
  "New Gallery"
2028
2182
  ]
2029
2183
  }
@@ -2072,7 +2226,7 @@ function GalleryPickerModal({
2072
2226
  onClick: handleCreateGallery,
2073
2227
  disabled: !newGalleryName.trim() || createLoading,
2074
2228
  className: GalleryPickerModal_default.createSubmitButton,
2075
- children: createLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.Loader2, { size: 16, className: GalleryPickerModal_default.spinner }) : "Create"
2229
+ children: createLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoaderCircle, { size: 16, className: GalleryPickerModal_default.spinner }) : "Create"
2076
2230
  }
2077
2231
  ),
2078
2232
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -2097,7 +2251,7 @@ function GalleryPickerModal({
2097
2251
  onClick: () => handleGalleryClick(gallery),
2098
2252
  className: `${GalleryPickerModal_default.galleryCardButton} ${gallerySelectMode && isSelected ? GalleryPickerModal_default.selected : ""}`,
2099
2253
  children: [
2100
- gallerySelectMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `${GalleryPickerModal_default.checkbox} ${isSelected ? GalleryPickerModal_default.checkboxChecked : ""}`, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react11.Check, { size: 14, strokeWidth: 3 }) }),
2254
+ gallerySelectMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `${GalleryPickerModal_default.checkbox} ${isSelected ? GalleryPickerModal_default.checkboxChecked : ""}`, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Check, { size: 14, strokeWidth: 3 }) }),
2101
2255
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: GalleryPickerModal_default.galleryCover, children: gallery.coverImage ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2102
2256
  "img",
2103
2257
  {
@@ -2148,7 +2302,7 @@ function GalleryField({
2148
2302
  languages,
2149
2303
  galleryOptions
2150
2304
  }) {
2151
- const [isModalOpen, setIsModalOpen] = (0, import_react9.useState)(false);
2305
+ const [isModalOpen, setIsModalOpen] = (0, import_react11.useState)(false);
2152
2306
  const handleSelect = (gallery) => {
2153
2307
  onChange(gallery);
2154
2308
  setIsModalOpen(false);
@@ -2196,7 +2350,7 @@ function GalleryField({
2196
2350
  onClick: handleRemove,
2197
2351
  className: GalleryField_default.removeButton,
2198
2352
  "aria-label": "Remove gallery",
2199
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.X, { size: 16 })
2353
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(X, { size: 16 })
2200
2354
  }
2201
2355
  )
2202
2356
  ] })
@@ -2207,7 +2361,7 @@ function GalleryField({
2207
2361
  onClick: handleOpenModal,
2208
2362
  className: GalleryField_default.selectButton,
2209
2363
  children: [
2210
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react12.Images, { size: 24 }),
2364
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Images, { size: 24 }),
2211
2365
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Select gallery" })
2212
2366
  ]
2213
2367
  }
@@ -2229,14 +2383,12 @@ function GalleryField({
2229
2383
  }
2230
2384
 
2231
2385
  // src/components/DocumentField/DocumentField.tsx
2232
- var import_react11 = require("react");
2386
+ var import_react13 = require("react");
2233
2387
  var import_react_dom3 = require("react-dom");
2234
2388
  var import_core3 = require("@puckeditor/core");
2235
- var import_lucide_react14 = require("lucide-react");
2236
2389
 
2237
2390
  // src/components/DocumentPickerModal/DocumentPickerModal.tsx
2238
- var import_react10 = require("react");
2239
- var import_lucide_react13 = require("lucide-react");
2391
+ var import_react12 = require("react");
2240
2392
 
2241
2393
  // src/components/DocumentPickerModal/DocumentPickerModal.module.css
2242
2394
  var DocumentPickerModal_default = {
@@ -2302,21 +2454,21 @@ function DocumentPickerModal({
2302
2454
  selectable = true
2303
2455
  }) {
2304
2456
  const { fetchList, upload, update, delete: deleteDocument, uploadConfig } = documentOptions;
2305
- const [view, setView] = (0, import_react10.useState)("picker");
2306
- const [editingItem, setEditingItem] = (0, import_react10.useState)(null);
2307
- const [selectMode, setSelectMode] = (0, import_react10.useState)(false);
2308
- const [selectedForDelete, setSelectedForDelete] = (0, import_react10.useState)(/* @__PURE__ */ new Set());
2309
- const [items, setItems] = (0, import_react10.useState)([]);
2310
- const [search, setSearch] = (0, import_react10.useState)("");
2311
- const [loading, setLoading] = (0, import_react10.useState)(true);
2312
- const [page, setPage] = (0, import_react10.useState)(1);
2313
- const [hasMore, setHasMore] = (0, import_react10.useState)(false);
2314
- const [selectedItem, setSelectedItem] = (0, import_react10.useState)(null);
2315
- const [titleValues, setTitleValues] = (0, import_react10.useState)({});
2316
- const [activeLang, setActiveLang] = (0, import_react10.useState)(languages[0]?.code || "it");
2317
- const [isSaving, setIsSaving] = (0, import_react10.useState)(false);
2318
- const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react10.useState)(false);
2319
- const [isDeleting, setIsDeleting] = (0, import_react10.useState)(false);
2457
+ const [view, setView] = (0, import_react12.useState)("picker");
2458
+ const [editingItem, setEditingItem] = (0, import_react12.useState)(null);
2459
+ const [selectMode, setSelectMode] = (0, import_react12.useState)(false);
2460
+ const [selectedForDelete, setSelectedForDelete] = (0, import_react12.useState)(/* @__PURE__ */ new Set());
2461
+ const [items, setItems] = (0, import_react12.useState)([]);
2462
+ const [search, setSearch] = (0, import_react12.useState)("");
2463
+ const [loading, setLoading] = (0, import_react12.useState)(true);
2464
+ const [page, setPage] = (0, import_react12.useState)(1);
2465
+ const [hasMore, setHasMore] = (0, import_react12.useState)(false);
2466
+ const [selectedItem, setSelectedItem] = (0, import_react12.useState)(null);
2467
+ const [titleValues, setTitleValues] = (0, import_react12.useState)({});
2468
+ const [activeLang, setActiveLang] = (0, import_react12.useState)(languages[0]?.code || "it");
2469
+ const [isSaving, setIsSaving] = (0, import_react12.useState)(false);
2470
+ const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react12.useState)(false);
2471
+ const [isDeleting, setIsDeleting] = (0, import_react12.useState)(false);
2320
2472
  const canUpload = !!upload;
2321
2473
  const {
2322
2474
  uploading,
@@ -2334,7 +2486,7 @@ function DocumentPickerModal({
2334
2486
  setItems((prev) => [newItem, ...prev]);
2335
2487
  }
2336
2488
  });
2337
- const loadItems = (0, import_react10.useCallback)(
2489
+ const loadItems = (0, import_react12.useCallback)(
2338
2490
  async (searchQuery, pageNum, append = false) => {
2339
2491
  setLoading(true);
2340
2492
  try {
@@ -2357,14 +2509,14 @@ function DocumentPickerModal({
2357
2509
  },
2358
2510
  [fetchList]
2359
2511
  );
2360
- (0, import_react10.useEffect)(() => {
2512
+ (0, import_react12.useEffect)(() => {
2361
2513
  const timer = setTimeout(() => {
2362
2514
  setPage(1);
2363
2515
  loadItems(search, 1);
2364
2516
  }, 300);
2365
2517
  return () => clearTimeout(timer);
2366
2518
  }, [search, loadItems]);
2367
- (0, import_react10.useEffect)(() => {
2519
+ (0, import_react12.useEffect)(() => {
2368
2520
  if (selectedDocument) {
2369
2521
  const existingItem = items.find((item) => item.id === selectedDocument.id);
2370
2522
  if (existingItem) {
@@ -2372,7 +2524,7 @@ function DocumentPickerModal({
2372
2524
  }
2373
2525
  }
2374
2526
  }, [selectedDocument, items]);
2375
- const handleClose = (0, import_react10.useCallback)(() => {
2527
+ const handleClose = (0, import_react12.useCallback)(() => {
2376
2528
  onClose();
2377
2529
  }, [onClose]);
2378
2530
  const handleLoadMore = () => {
@@ -2465,9 +2617,9 @@ function DocumentPickerModal({
2465
2617
  };
2466
2618
  const getIcon = (mimeType) => {
2467
2619
  if (mimeType === "application/pdf") {
2468
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.FileText, { size: 20, className: DocumentPickerModal_default.pdfIcon });
2620
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FileText, { size: 20, className: DocumentPickerModal_default.pdfIcon });
2469
2621
  }
2470
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.File, { size: 20, className: DocumentPickerModal_default.fileIcon });
2622
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(File, { size: 20, className: DocumentPickerModal_default.fileIcon });
2471
2623
  };
2472
2624
  const isAllSelected = items.length > 0 && selectedForDelete.size === items.length;
2473
2625
  const isSomeSelected = selectedForDelete.size > 0 && selectedForDelete.size < items.length;
@@ -2489,7 +2641,7 @@ function DocumentPickerModal({
2489
2641
  },
2490
2642
  className: DocumentPickerModal_default.backButton,
2491
2643
  "aria-label": "Back to list",
2492
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.ArrowLeft, { size: 20 })
2644
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ArrowLeft, { size: 20 })
2493
2645
  }
2494
2646
  ),
2495
2647
  footer: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: DocumentPickerModal_default.editFooter, children: [
@@ -2502,7 +2654,7 @@ function DocumentPickerModal({
2502
2654
  className: DocumentPickerModal_default.saveButton,
2503
2655
  disabled: isSaving || !update,
2504
2656
  children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2505
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.Loader2, { size: 16, className: DocumentPickerModal_default.spinner }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoaderCircle, { size: 16, className: DocumentPickerModal_default.spinner }),
2506
2658
  "Saving..."
2507
2659
  ] }) : "Save"
2508
2660
  }
@@ -2664,7 +2816,7 @@ function DocumentPickerModal({
2664
2816
  onClick: () => handleDocumentClick(item),
2665
2817
  className: `${DocumentPickerModal_default.documentItem} ${isSelected ? DocumentPickerModal_default.selected : ""}`,
2666
2818
  children: [
2667
- selectMode && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${DocumentPickerModal_default.checkbox} ${isSelected ? DocumentPickerModal_default.checkboxChecked : ""}`, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.Check, { size: 14, strokeWidth: 3 }) }),
2819
+ selectMode && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${DocumentPickerModal_default.checkbox} ${isSelected ? DocumentPickerModal_default.checkboxChecked : ""}`, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Check, { size: 14, strokeWidth: 3 }) }),
2668
2820
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: DocumentPickerModal_default.documentIcon, children: getIcon(item.mimeType) }),
2669
2821
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: DocumentPickerModal_default.documentInfo, children: [
2670
2822
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: DocumentPickerModal_default.documentName, children: item.title?.[languages[0]?.code] || item.filename }),
@@ -2707,7 +2859,7 @@ function DocumentPickerModal({
2707
2859
  },
2708
2860
  className: DocumentPickerModal_default.editButton,
2709
2861
  "aria-label": "Edit title",
2710
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react13.Pencil, { size: 14 })
2862
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pencil, { size: 14 })
2711
2863
  }
2712
2864
  )
2713
2865
  ] }, item.id);
@@ -2743,7 +2895,7 @@ function DocumentField({
2743
2895
  languages,
2744
2896
  documentOptions
2745
2897
  }) {
2746
- const [isModalOpen, setIsModalOpen] = (0, import_react11.useState)(false);
2898
+ const [isModalOpen, setIsModalOpen] = (0, import_react13.useState)(false);
2747
2899
  const handleSelect = (item) => {
2748
2900
  onChange(item);
2749
2901
  setIsModalOpen(false);
@@ -2767,9 +2919,9 @@ function DocumentField({
2767
2919
  };
2768
2920
  const getIcon = () => {
2769
2921
  if (value?.mimeType === "application/pdf") {
2770
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.FileText, { size: 24, className: DocumentField_default.pdfIcon });
2922
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileText, { size: 24, className: DocumentField_default.pdfIcon });
2771
2923
  }
2772
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.File, { size: 24, className: DocumentField_default.fileIcon });
2924
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(File, { size: 24, className: DocumentField_default.fileIcon });
2773
2925
  };
2774
2926
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core3.FieldLabel, { label: field.label || "Document", children: [
2775
2927
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: DocumentField_default.container, children: value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: DocumentField_default.preview, children: [
@@ -2799,7 +2951,7 @@ function DocumentField({
2799
2951
  onClick: handleRemove,
2800
2952
  className: DocumentField_default.removeButton,
2801
2953
  "aria-label": "Remove document",
2802
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.X, { size: 16 })
2954
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(X, { size: 16 })
2803
2955
  }
2804
2956
  )
2805
2957
  ] })
@@ -2810,7 +2962,7 @@ function DocumentField({
2810
2962
  onClick: handleOpenModal,
2811
2963
  className: DocumentField_default.selectButton,
2812
2964
  children: [
2813
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react14.FileText, { size: 24 }),
2965
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileText, { size: 24 }),
2814
2966
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Select document" })
2815
2967
  ]
2816
2968
  }
@@ -2832,9 +2984,8 @@ function DocumentField({
2832
2984
  }
2833
2985
 
2834
2986
  // src/components/MediaPanel/MediaPanel.tsx
2835
- var import_react12 = require("react");
2987
+ var import_react14 = require("react");
2836
2988
  var import_react_dom4 = require("react-dom");
2837
- var import_lucide_react15 = require("lucide-react");
2838
2989
 
2839
2990
  // src/components/MediaPanel/MediaPanel.module.css
2840
2991
  var MediaPanel_default = {
@@ -2850,7 +3001,7 @@ function MediaPanel({
2850
3001
  galleryOptions,
2851
3002
  documentOptions
2852
3003
  }) {
2853
- const [openModal, setOpenModal] = (0, import_react12.useState)(null);
3004
+ const [openModal, setOpenModal] = (0, import_react14.useState)(null);
2854
3005
  const handleCloseModal = () => {
2855
3006
  setOpenModal(null);
2856
3007
  };
@@ -2862,7 +3013,7 @@ function MediaPanel({
2862
3013
  className: MediaPanel_default.item,
2863
3014
  onClick: () => setOpenModal("image"),
2864
3015
  children: [
2865
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.Image, { size: 20 }),
3016
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Image, { size: 20 }),
2866
3017
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Images" })
2867
3018
  ]
2868
3019
  }
@@ -2874,7 +3025,7 @@ function MediaPanel({
2874
3025
  className: MediaPanel_default.item,
2875
3026
  onClick: () => setOpenModal("gallery"),
2876
3027
  children: [
2877
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.Images, { size: 20 }),
3028
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Images, { size: 20 }),
2878
3029
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Gallery" })
2879
3030
  ]
2880
3031
  }
@@ -2886,7 +3037,7 @@ function MediaPanel({
2886
3037
  className: MediaPanel_default.item,
2887
3038
  onClick: () => setOpenModal("document"),
2888
3039
  children: [
2889
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react15.FileText, { size: 20 }),
3040
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileText, { size: 20 }),
2890
3041
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Documents" })
2891
3042
  ]
2892
3043
  }
@@ -2988,7 +3139,7 @@ function createMediaPlugin(options) {
2988
3139
  return {
2989
3140
  name: "puck-media",
2990
3141
  label: "Media",
2991
- icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react16.Image, { size: 20 }),
3142
+ icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Image, { size: 20 }),
2992
3143
  render: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2993
3144
  MediaPanel,
2994
3145
  {
@@ -3026,4 +3177,33 @@ var DEFAULT_LANGUAGES = [
3026
3177
  formatFileSize,
3027
3178
  useUpload
3028
3179
  });
3180
+ /*! Bundled license information:
3181
+
3182
+ lucide-react/dist/esm/shared/src/utils.js:
3183
+ lucide-react/dist/esm/defaultAttributes.js:
3184
+ lucide-react/dist/esm/Icon.js:
3185
+ lucide-react/dist/esm/createLucideIcon.js:
3186
+ lucide-react/dist/esm/icons/arrow-left.js:
3187
+ lucide-react/dist/esm/icons/check.js:
3188
+ lucide-react/dist/esm/icons/circle-alert.js:
3189
+ lucide-react/dist/esm/icons/circle-check-big.js:
3190
+ lucide-react/dist/esm/icons/file-text.js:
3191
+ lucide-react/dist/esm/icons/file.js:
3192
+ lucide-react/dist/esm/icons/image-plus.js:
3193
+ lucide-react/dist/esm/icons/image.js:
3194
+ lucide-react/dist/esm/icons/images.js:
3195
+ lucide-react/dist/esm/icons/loader-circle.js:
3196
+ lucide-react/dist/esm/icons/pencil.js:
3197
+ lucide-react/dist/esm/icons/plus.js:
3198
+ lucide-react/dist/esm/icons/search.js:
3199
+ lucide-react/dist/esm/icons/upload.js:
3200
+ lucide-react/dist/esm/icons/x.js:
3201
+ lucide-react/dist/esm/lucide-react.js:
3202
+ (**
3203
+ * @license lucide-react v0.468.0 - ISC
3204
+ *
3205
+ * This source code is licensed under the ISC license.
3206
+ * See the LICENSE file in the root directory of this source tree.
3207
+ *)
3208
+ */
3029
3209
  //# sourceMappingURL=index.js.map