@caprionlinesrl/puck-plugin-media 0.1.5 → 0.1.6
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 +344 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +230 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -6
package/dist/index.js
CHANGED
|
@@ -38,22 +38,190 @@ __export(index_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
var
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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,
|
|
271
|
+
(0, import_react3.useEffect)(() => {
|
|
104
272
|
const originalOverflow = document.body.style.overflow;
|
|
105
273
|
document.body.style.overflow = "hidden";
|
|
106
274
|
return () => {
|
|
@@ -136,14 +304,14 @@ function Modal({
|
|
|
136
304
|
},
|
|
137
305
|
className: Modal_default.closeButton,
|
|
138
306
|
"aria-label": "Close",
|
|
139
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
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)(
|
|
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
316
|
] }) : empty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.empty, children: emptyMessage }) : children }),
|
|
149
317
|
footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: Modal_default.footer, children: footer }),
|
|
@@ -154,8 +322,7 @@ function Modal({
|
|
|
154
322
|
}
|
|
155
323
|
|
|
156
324
|
// src/components/SearchBar/SearchBar.tsx
|
|
157
|
-
var
|
|
158
|
-
var import_lucide_react2 = require("lucide-react");
|
|
325
|
+
var import_react4 = require("react");
|
|
159
326
|
|
|
160
327
|
// src/components/SearchBar/SearchBar.module.css
|
|
161
328
|
var SearchBar_default = {
|
|
@@ -173,8 +340,8 @@ function SearchBar({
|
|
|
173
340
|
placeholder = "Search...",
|
|
174
341
|
autoFocus = false
|
|
175
342
|
}) {
|
|
176
|
-
const inputRef = (0,
|
|
177
|
-
(0,
|
|
343
|
+
const inputRef = (0, import_react4.useRef)(null);
|
|
344
|
+
(0, import_react4.useEffect)(() => {
|
|
178
345
|
if (autoFocus && inputRef.current) {
|
|
179
346
|
inputRef.current.focus();
|
|
180
347
|
}
|
|
@@ -184,7 +351,7 @@ function SearchBar({
|
|
|
184
351
|
inputRef.current?.focus();
|
|
185
352
|
};
|
|
186
353
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: SearchBar_default.container, children: [
|
|
187
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Search, { size: 18, className: SearchBar_default.icon }),
|
|
188
355
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
189
356
|
"input",
|
|
190
357
|
{
|
|
@@ -203,15 +370,12 @@ function SearchBar({
|
|
|
203
370
|
onClick: handleClear,
|
|
204
371
|
className: SearchBar_default.clearButton,
|
|
205
372
|
"aria-label": "Clear search",
|
|
206
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
373
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(X, { size: 16 })
|
|
207
374
|
}
|
|
208
375
|
)
|
|
209
376
|
] });
|
|
210
377
|
}
|
|
211
378
|
|
|
212
|
-
// src/components/LoadMoreButton/LoadMoreButton.tsx
|
|
213
|
-
var import_lucide_react3 = require("lucide-react");
|
|
214
|
-
|
|
215
379
|
// src/components/LoadMoreButton/LoadMoreButton.module.css
|
|
216
380
|
var LoadMoreButton_default = {
|
|
217
381
|
container: "LoadMoreButton_container",
|
|
@@ -231,7 +395,7 @@ function LoadMoreButton({ onClick, loading = false }) {
|
|
|
231
395
|
disabled: loading,
|
|
232
396
|
className: LoadMoreButton_default.button,
|
|
233
397
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
234
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
398
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LoaderCircle, { size: 16, className: LoadMoreButton_default.spinner }),
|
|
235
399
|
"Loading..."
|
|
236
400
|
] }) : "Load more"
|
|
237
401
|
}
|
|
@@ -239,8 +403,7 @@ function LoadMoreButton({ onClick, loading = false }) {
|
|
|
239
403
|
}
|
|
240
404
|
|
|
241
405
|
// src/components/ConfirmDialog/ConfirmDialog.tsx
|
|
242
|
-
var
|
|
243
|
-
var import_lucide_react4 = require("lucide-react");
|
|
406
|
+
var import_react5 = require("react");
|
|
244
407
|
|
|
245
408
|
// src/components/ConfirmDialog/ConfirmDialog.module.css
|
|
246
409
|
var ConfirmDialog_default = {
|
|
@@ -269,7 +432,7 @@ function ConfirmDialog({
|
|
|
269
432
|
loading = false,
|
|
270
433
|
variant = "danger"
|
|
271
434
|
}) {
|
|
272
|
-
(0,
|
|
435
|
+
(0, import_react5.useEffect)(() => {
|
|
273
436
|
const handleEscape = (e) => {
|
|
274
437
|
if (e.key === "Escape" && !loading) {
|
|
275
438
|
e.stopPropagation();
|
|
@@ -301,7 +464,7 @@ function ConfirmDialog({
|
|
|
301
464
|
className: `${ConfirmDialog_default.confirmButton} ${variant === "danger" ? ConfirmDialog_default.danger : ""}`,
|
|
302
465
|
disabled: loading,
|
|
303
466
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
304
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
467
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LoaderCircle, { size: 16, className: ConfirmDialog_default.spinner }),
|
|
305
468
|
confirmLabel
|
|
306
469
|
] }) : confirmLabel
|
|
307
470
|
}
|
|
@@ -310,9 +473,6 @@ function ConfirmDialog({
|
|
|
310
473
|
] }) });
|
|
311
474
|
}
|
|
312
475
|
|
|
313
|
-
// src/components/SelectionToolbar/SelectionToolbar.tsx
|
|
314
|
-
var import_lucide_react5 = require("lucide-react");
|
|
315
|
-
|
|
316
476
|
// src/components/SelectionToolbar/SelectionToolbar.module.css
|
|
317
477
|
var SelectionToolbar_default = {
|
|
318
478
|
toolbar: "SelectionToolbar_toolbar",
|
|
@@ -349,7 +509,7 @@ function SelectionToolbar({
|
|
|
349
509
|
"aria-label": isAllSelected ? "Deselect all" : "Select all",
|
|
350
510
|
children: [
|
|
351
511
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: SelectionToolbar_default.checkbox, children: [
|
|
352
|
-
isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
512
|
+
isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Check, { size: 14, strokeWidth: 3 }),
|
|
353
513
|
isIndeterminate && !isAllSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: SelectionToolbar_default.indeterminateLine })
|
|
354
514
|
] }),
|
|
355
515
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Select All" })
|
|
@@ -385,9 +545,6 @@ function SelectionToolbar({
|
|
|
385
545
|
] });
|
|
386
546
|
}
|
|
387
547
|
|
|
388
|
-
// src/components/ImageGrid/ImageGrid.tsx
|
|
389
|
-
var import_lucide_react6 = require("lucide-react");
|
|
390
|
-
|
|
391
548
|
// src/components/ImageGrid/ImageGrid.module.css
|
|
392
549
|
var ImageGrid_default = {
|
|
393
550
|
grid: "ImageGrid_grid",
|
|
@@ -462,7 +619,7 @@ function ImageGrid({
|
|
|
462
619
|
loading: "lazy"
|
|
463
620
|
}
|
|
464
621
|
),
|
|
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)(
|
|
622
|
+
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
623
|
isSelectedForInsert && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: ImageGrid_default.checkmark, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
467
624
|
"svg",
|
|
468
625
|
{
|
|
@@ -505,7 +662,7 @@ function ImageGrid({
|
|
|
505
662
|
onClick: (e) => handleEditClick(e, item),
|
|
506
663
|
className: ImageGrid_default.editButton,
|
|
507
664
|
"aria-label": "Edit alt",
|
|
508
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pencil, { size: 14 })
|
|
509
666
|
}
|
|
510
667
|
)
|
|
511
668
|
] }) })
|
|
@@ -514,11 +671,10 @@ function ImageGrid({
|
|
|
514
671
|
}
|
|
515
672
|
|
|
516
673
|
// src/components/UploadDropzone/UploadDropzone.tsx
|
|
517
|
-
var
|
|
518
|
-
var import_lucide_react7 = require("lucide-react");
|
|
674
|
+
var import_react7 = require("react");
|
|
519
675
|
|
|
520
676
|
// src/hooks/useUpload.ts
|
|
521
|
-
var
|
|
677
|
+
var import_react6 = require("react");
|
|
522
678
|
var DEFAULT_CONFIG = {
|
|
523
679
|
accept: "image/*",
|
|
524
680
|
maxSize: 10 * 1024 * 1024,
|
|
@@ -570,10 +726,10 @@ function useUpload({
|
|
|
570
726
|
config,
|
|
571
727
|
onUploadComplete
|
|
572
728
|
}) {
|
|
573
|
-
const [uploading, setUploading] = (0,
|
|
574
|
-
const activeUploadsRef = (0,
|
|
729
|
+
const [uploading, setUploading] = (0, import_react6.useState)([]);
|
|
730
|
+
const activeUploadsRef = (0, import_react6.useRef)(/* @__PURE__ */ new Set());
|
|
575
731
|
const uploadConfig = { ...DEFAULT_CONFIG, ...config };
|
|
576
|
-
const startUpload = (0,
|
|
732
|
+
const startUpload = (0, import_react6.useCallback)(
|
|
577
733
|
async (id, file) => {
|
|
578
734
|
try {
|
|
579
735
|
const result = await upload(file, {
|
|
@@ -604,7 +760,7 @@ function useUpload({
|
|
|
604
760
|
},
|
|
605
761
|
[upload, onUploadComplete]
|
|
606
762
|
);
|
|
607
|
-
const processQueue = (0,
|
|
763
|
+
const processQueue = (0, import_react6.useCallback)(() => {
|
|
608
764
|
setUploading((current) => {
|
|
609
765
|
const pending = current.filter(
|
|
610
766
|
(f) => f.status === "pending" && !activeUploadsRef.current.has(f.id)
|
|
@@ -624,7 +780,7 @@ function useUpload({
|
|
|
624
780
|
);
|
|
625
781
|
});
|
|
626
782
|
}, [startUpload]);
|
|
627
|
-
const addFiles = (0,
|
|
783
|
+
const addFiles = (0, import_react6.useCallback)(
|
|
628
784
|
(files) => {
|
|
629
785
|
const fileArray = Array.from(files);
|
|
630
786
|
const filesToAdd = uploadConfig.multiple ? fileArray : fileArray.slice(0, 1);
|
|
@@ -645,7 +801,7 @@ function useUpload({
|
|
|
645
801
|
},
|
|
646
802
|
[uploadConfig, processQueue]
|
|
647
803
|
);
|
|
648
|
-
const cancelUpload = (0,
|
|
804
|
+
const cancelUpload = (0, import_react6.useCallback)((id) => {
|
|
649
805
|
setUploading((current) => {
|
|
650
806
|
const file = current.find((f) => f.id === id);
|
|
651
807
|
if (file?.previewUrl) {
|
|
@@ -655,7 +811,7 @@ function useUpload({
|
|
|
655
811
|
});
|
|
656
812
|
activeUploadsRef.current.delete(id);
|
|
657
813
|
}, []);
|
|
658
|
-
const clearCompleted = (0,
|
|
814
|
+
const clearCompleted = (0, import_react6.useCallback)(() => {
|
|
659
815
|
setUploading((current) => {
|
|
660
816
|
current.filter((f) => f.status === "completed" || f.status === "error").forEach((f) => {
|
|
661
817
|
if (f.previewUrl) {
|
|
@@ -696,10 +852,10 @@ function UploadDropzone({
|
|
|
696
852
|
config,
|
|
697
853
|
disabled = false
|
|
698
854
|
}) {
|
|
699
|
-
const [isDragging, setIsDragging] = (0,
|
|
700
|
-
const inputRef = (0,
|
|
701
|
-
const dragCounterRef = (0,
|
|
702
|
-
const handleDragEnter = (0,
|
|
855
|
+
const [isDragging, setIsDragging] = (0, import_react7.useState)(false);
|
|
856
|
+
const inputRef = (0, import_react7.useRef)(null);
|
|
857
|
+
const dragCounterRef = (0, import_react7.useRef)(0);
|
|
858
|
+
const handleDragEnter = (0, import_react7.useCallback)((e) => {
|
|
703
859
|
e.preventDefault();
|
|
704
860
|
e.stopPropagation();
|
|
705
861
|
dragCounterRef.current++;
|
|
@@ -707,7 +863,7 @@ function UploadDropzone({
|
|
|
707
863
|
setIsDragging(true);
|
|
708
864
|
}
|
|
709
865
|
}, []);
|
|
710
|
-
const handleDragLeave = (0,
|
|
866
|
+
const handleDragLeave = (0, import_react7.useCallback)((e) => {
|
|
711
867
|
e.preventDefault();
|
|
712
868
|
e.stopPropagation();
|
|
713
869
|
dragCounterRef.current--;
|
|
@@ -715,11 +871,11 @@ function UploadDropzone({
|
|
|
715
871
|
setIsDragging(false);
|
|
716
872
|
}
|
|
717
873
|
}, []);
|
|
718
|
-
const handleDragOver = (0,
|
|
874
|
+
const handleDragOver = (0, import_react7.useCallback)((e) => {
|
|
719
875
|
e.preventDefault();
|
|
720
876
|
e.stopPropagation();
|
|
721
877
|
}, []);
|
|
722
|
-
const handleDrop = (0,
|
|
878
|
+
const handleDrop = (0, import_react7.useCallback)(
|
|
723
879
|
(e) => {
|
|
724
880
|
e.preventDefault();
|
|
725
881
|
e.stopPropagation();
|
|
@@ -733,12 +889,12 @@ function UploadDropzone({
|
|
|
733
889
|
},
|
|
734
890
|
[disabled, onFilesSelected]
|
|
735
891
|
);
|
|
736
|
-
const handleClick = (0,
|
|
892
|
+
const handleClick = (0, import_react7.useCallback)(() => {
|
|
737
893
|
if (!disabled && inputRef.current) {
|
|
738
894
|
inputRef.current.click();
|
|
739
895
|
}
|
|
740
896
|
}, [disabled]);
|
|
741
|
-
const handleInputChange = (0,
|
|
897
|
+
const handleInputChange = (0, import_react7.useCallback)(
|
|
742
898
|
(e) => {
|
|
743
899
|
const { files } = e.target;
|
|
744
900
|
if (files && files.length > 0) {
|
|
@@ -791,7 +947,7 @@ function UploadDropzone({
|
|
|
791
947
|
disabled
|
|
792
948
|
}
|
|
793
949
|
),
|
|
794
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Upload, { size: 24, className: UploadDropzone_default.icon }),
|
|
795
951
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: UploadDropzone_default.text, children: isDragging ? "Drop files here" : "Drop files here or click to upload" }),
|
|
796
952
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: UploadDropzone_default.hint, children: [
|
|
797
953
|
formatAcceptedTypes(config.accept),
|
|
@@ -804,9 +960,6 @@ function UploadDropzone({
|
|
|
804
960
|
);
|
|
805
961
|
}
|
|
806
962
|
|
|
807
|
-
// src/components/UploadQueue/UploadQueue.tsx
|
|
808
|
-
var import_lucide_react8 = require("lucide-react");
|
|
809
|
-
|
|
810
963
|
// src/components/UploadQueue/UploadQueue.module.css
|
|
811
964
|
var UploadQueue_default = {
|
|
812
965
|
container: "UploadQueue_container",
|
|
@@ -890,12 +1043,12 @@ function UploadItem({ file, onCancel }) {
|
|
|
890
1043
|
onClick: onCancel,
|
|
891
1044
|
className: UploadQueue_default.cancelButton,
|
|
892
1045
|
"aria-label": "Cancel upload",
|
|
893
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(X, { size: 16 })
|
|
894
1047
|
}
|
|
895
1048
|
),
|
|
896
|
-
file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
897
|
-
file.status === "completed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
898
|
-
file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1049
|
+
file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LoaderCircle, { size: 18, className: UploadQueue_default.spinner }),
|
|
1050
|
+
file.status === "completed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CircleCheckBig, { size: 18, className: UploadQueue_default.successIcon }),
|
|
1051
|
+
file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CircleAlert, { size: 18, className: UploadQueue_default.errorIcon })
|
|
899
1052
|
] })
|
|
900
1053
|
] });
|
|
901
1054
|
}
|
|
@@ -950,21 +1103,21 @@ function ImagePickerModal({
|
|
|
950
1103
|
selectable = true
|
|
951
1104
|
}) {
|
|
952
1105
|
const { fetchList, upload, update, delete: deleteImage, uploadConfig } = imageOptions;
|
|
953
|
-
const [view, setView] = (0,
|
|
954
|
-
const [editingItem, setEditingItem] = (0,
|
|
955
|
-
const [selectMode, setSelectMode] = (0,
|
|
956
|
-
const [selectedForDelete, setSelectedForDelete] = (0,
|
|
957
|
-
const [items, setItems] = (0,
|
|
958
|
-
const [search, setSearch] = (0,
|
|
959
|
-
const [loading, setLoading] = (0,
|
|
960
|
-
const [page, setPage] = (0,
|
|
961
|
-
const [hasMore, setHasMore] = (0,
|
|
962
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
963
|
-
const [altValues, setAltValues] = (0,
|
|
964
|
-
const [activeLang, setActiveLang] = (0,
|
|
965
|
-
const [isSaving, setIsSaving] = (0,
|
|
966
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = (0,
|
|
967
|
-
const [isDeleting, setIsDeleting] = (0,
|
|
1106
|
+
const [view, setView] = (0, import_react8.useState)("picker");
|
|
1107
|
+
const [editingItem, setEditingItem] = (0, import_react8.useState)(null);
|
|
1108
|
+
const [selectMode, setSelectMode] = (0, import_react8.useState)(false);
|
|
1109
|
+
const [selectedForDelete, setSelectedForDelete] = (0, import_react8.useState)(/* @__PURE__ */ new Set());
|
|
1110
|
+
const [items, setItems] = (0, import_react8.useState)([]);
|
|
1111
|
+
const [search, setSearch] = (0, import_react8.useState)("");
|
|
1112
|
+
const [loading, setLoading] = (0, import_react8.useState)(true);
|
|
1113
|
+
const [page, setPage] = (0, import_react8.useState)(1);
|
|
1114
|
+
const [hasMore, setHasMore] = (0, import_react8.useState)(false);
|
|
1115
|
+
const [selectedItem, setSelectedItem] = (0, import_react8.useState)(null);
|
|
1116
|
+
const [altValues, setAltValues] = (0, import_react8.useState)({});
|
|
1117
|
+
const [activeLang, setActiveLang] = (0, import_react8.useState)(languages[0]?.code || "it");
|
|
1118
|
+
const [isSaving, setIsSaving] = (0, import_react8.useState)(false);
|
|
1119
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react8.useState)(false);
|
|
1120
|
+
const [isDeleting, setIsDeleting] = (0, import_react8.useState)(false);
|
|
968
1121
|
const canUpload = !!upload;
|
|
969
1122
|
const {
|
|
970
1123
|
uploading,
|
|
@@ -982,7 +1135,7 @@ function ImagePickerModal({
|
|
|
982
1135
|
setItems((prev) => [newItem, ...prev]);
|
|
983
1136
|
}
|
|
984
1137
|
});
|
|
985
|
-
const loadItems = (0,
|
|
1138
|
+
const loadItems = (0, import_react8.useCallback)(
|
|
986
1139
|
async (searchQuery, pageNum, append = false) => {
|
|
987
1140
|
setLoading(true);
|
|
988
1141
|
try {
|
|
@@ -1005,14 +1158,14 @@ function ImagePickerModal({
|
|
|
1005
1158
|
},
|
|
1006
1159
|
[fetchList]
|
|
1007
1160
|
);
|
|
1008
|
-
(0,
|
|
1161
|
+
(0, import_react8.useEffect)(() => {
|
|
1009
1162
|
const timer = setTimeout(() => {
|
|
1010
1163
|
setPage(1);
|
|
1011
1164
|
loadItems(search, 1);
|
|
1012
1165
|
}, 300);
|
|
1013
1166
|
return () => clearTimeout(timer);
|
|
1014
1167
|
}, [search, loadItems]);
|
|
1015
|
-
(0,
|
|
1168
|
+
(0, import_react8.useEffect)(() => {
|
|
1016
1169
|
if (selectedImage) {
|
|
1017
1170
|
const existingItem = items.find((item) => item.id === selectedImage.id);
|
|
1018
1171
|
if (existingItem) {
|
|
@@ -1020,7 +1173,7 @@ function ImagePickerModal({
|
|
|
1020
1173
|
}
|
|
1021
1174
|
}
|
|
1022
1175
|
}, [selectedImage, items]);
|
|
1023
|
-
const handleClose = (0,
|
|
1176
|
+
const handleClose = (0, import_react8.useCallback)(() => {
|
|
1024
1177
|
onClose();
|
|
1025
1178
|
}, [onClose]);
|
|
1026
1179
|
const handleLoadMore = () => {
|
|
@@ -1135,7 +1288,7 @@ function ImagePickerModal({
|
|
|
1135
1288
|
},
|
|
1136
1289
|
className: ImagePickerModal_default.backButton,
|
|
1137
1290
|
"aria-label": "Back to grid",
|
|
1138
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowLeft, { size: 20 })
|
|
1139
1292
|
}
|
|
1140
1293
|
),
|
|
1141
1294
|
footer: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: ImagePickerModal_default.editFooter, children: [
|
|
@@ -1148,7 +1301,7 @@ function ImagePickerModal({
|
|
|
1148
1301
|
className: ImagePickerModal_default.saveButton,
|
|
1149
1302
|
disabled: isSaving || !update,
|
|
1150
1303
|
children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1151
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoaderCircle, { size: 16, className: ImagePickerModal_default.spinner }),
|
|
1152
1305
|
"Saving..."
|
|
1153
1306
|
] }) : "Save"
|
|
1154
1307
|
}
|
|
@@ -1355,7 +1508,7 @@ function ImageField({
|
|
|
1355
1508
|
languages,
|
|
1356
1509
|
imageOptions
|
|
1357
1510
|
}) {
|
|
1358
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
1511
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react9.useState)(false);
|
|
1359
1512
|
const handleSelect = (item) => {
|
|
1360
1513
|
onChange(item);
|
|
1361
1514
|
setIsModalOpen(false);
|
|
@@ -1403,7 +1556,7 @@ function ImageField({
|
|
|
1403
1556
|
onClick: handleRemove,
|
|
1404
1557
|
className: ImageField_default.removeButton,
|
|
1405
1558
|
"aria-label": "Remove image",
|
|
1406
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(X, { size: 16 })
|
|
1407
1560
|
}
|
|
1408
1561
|
)
|
|
1409
1562
|
] })
|
|
@@ -1414,7 +1567,7 @@ function ImageField({
|
|
|
1414
1567
|
onClick: handleOpenModal,
|
|
1415
1568
|
className: ImageField_default.selectButton,
|
|
1416
1569
|
children: [
|
|
1417
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ImagePlus, { size: 24 }),
|
|
1418
1571
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Select image" })
|
|
1419
1572
|
]
|
|
1420
1573
|
}
|
|
@@ -1437,14 +1590,12 @@ function ImageField({
|
|
|
1437
1590
|
}
|
|
1438
1591
|
|
|
1439
1592
|
// src/components/GalleryField/GalleryField.tsx
|
|
1440
|
-
var
|
|
1593
|
+
var import_react11 = require("react");
|
|
1441
1594
|
var import_react_dom2 = require("react-dom");
|
|
1442
1595
|
var import_core2 = require("@puckeditor/core");
|
|
1443
|
-
var import_lucide_react12 = require("lucide-react");
|
|
1444
1596
|
|
|
1445
1597
|
// src/components/GalleryPickerModal/GalleryPickerModal.tsx
|
|
1446
|
-
var
|
|
1447
|
-
var import_lucide_react11 = require("lucide-react");
|
|
1598
|
+
var import_react10 = require("react");
|
|
1448
1599
|
|
|
1449
1600
|
// src/components/GalleryPickerModal/GalleryPickerModal.module.css
|
|
1450
1601
|
var GalleryPickerModal_default = {
|
|
@@ -1511,28 +1662,28 @@ function GalleryPickerModal({
|
|
|
1511
1662
|
}) {
|
|
1512
1663
|
void _initialSelectedGallery;
|
|
1513
1664
|
const { fetchList, fetch, create, delete: deleteGallery, upload, removeImage, updateImage } = galleryOptions;
|
|
1514
|
-
const [viewMode, setViewMode] = (0,
|
|
1515
|
-
const [editingImage, setEditingImage] = (0,
|
|
1516
|
-
const [galleries, setGalleries] = (0,
|
|
1517
|
-
const [selectedGalleryItem, setSelectedGalleryItem] = (0,
|
|
1518
|
-
const [search, setSearch] = (0,
|
|
1519
|
-
const [loading, setLoading] = (0,
|
|
1520
|
-
const [page, setPage] = (0,
|
|
1521
|
-
const [hasMore, setHasMore] = (0,
|
|
1522
|
-
const [gallerySelectMode, setGallerySelectMode] = (0,
|
|
1523
|
-
const [selectedGalleryIds, setSelectedGalleryIds] = (0,
|
|
1524
|
-
const [imageSelectMode, setImageSelectMode] = (0,
|
|
1525
|
-
const [selectedImageIds, setSelectedImageIds] = (0,
|
|
1526
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = (0,
|
|
1527
|
-
const [deleteTarget, setDeleteTarget] = (0,
|
|
1528
|
-
const [isDeleting, setIsDeleting] = (0,
|
|
1529
|
-
const [isCreating, setIsCreating] = (0,
|
|
1530
|
-
const [newGalleryName, setNewGalleryName] = (0,
|
|
1531
|
-
const [createLoading, setCreateLoading] = (0,
|
|
1532
|
-
const [altValues, setAltValues] = (0,
|
|
1533
|
-
const [activeLang, setActiveLang] = (0,
|
|
1534
|
-
const [isSaving, setIsSaving] = (0,
|
|
1535
|
-
const newGalleryInputRef = (0,
|
|
1665
|
+
const [viewMode, setViewMode] = (0, import_react10.useState)("list");
|
|
1666
|
+
const [editingImage, setEditingImage] = (0, import_react10.useState)(null);
|
|
1667
|
+
const [galleries, setGalleries] = (0, import_react10.useState)([]);
|
|
1668
|
+
const [selectedGalleryItem, setSelectedGalleryItem] = (0, import_react10.useState)(null);
|
|
1669
|
+
const [search, setSearch] = (0, import_react10.useState)("");
|
|
1670
|
+
const [loading, setLoading] = (0, import_react10.useState)(true);
|
|
1671
|
+
const [page, setPage] = (0, import_react10.useState)(1);
|
|
1672
|
+
const [hasMore, setHasMore] = (0, import_react10.useState)(false);
|
|
1673
|
+
const [gallerySelectMode, setGallerySelectMode] = (0, import_react10.useState)(false);
|
|
1674
|
+
const [selectedGalleryIds, setSelectedGalleryIds] = (0, import_react10.useState)(/* @__PURE__ */ new Set());
|
|
1675
|
+
const [imageSelectMode, setImageSelectMode] = (0, import_react10.useState)(false);
|
|
1676
|
+
const [selectedImageIds, setSelectedImageIds] = (0, import_react10.useState)(/* @__PURE__ */ new Set());
|
|
1677
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react10.useState)(false);
|
|
1678
|
+
const [deleteTarget, setDeleteTarget] = (0, import_react10.useState)("gallery");
|
|
1679
|
+
const [isDeleting, setIsDeleting] = (0, import_react10.useState)(false);
|
|
1680
|
+
const [isCreating, setIsCreating] = (0, import_react10.useState)(false);
|
|
1681
|
+
const [newGalleryName, setNewGalleryName] = (0, import_react10.useState)("");
|
|
1682
|
+
const [createLoading, setCreateLoading] = (0, import_react10.useState)(false);
|
|
1683
|
+
const [altValues, setAltValues] = (0, import_react10.useState)({});
|
|
1684
|
+
const [activeLang, setActiveLang] = (0, import_react10.useState)(languages[0]?.code || "it");
|
|
1685
|
+
const [isSaving, setIsSaving] = (0, import_react10.useState)(false);
|
|
1686
|
+
const newGalleryInputRef = (0, import_react10.useRef)(null);
|
|
1536
1687
|
const {
|
|
1537
1688
|
uploading,
|
|
1538
1689
|
isUploading,
|
|
@@ -1560,7 +1711,7 @@ function GalleryPickerModal({
|
|
|
1560
1711
|
}
|
|
1561
1712
|
}
|
|
1562
1713
|
});
|
|
1563
|
-
const loadGalleries = (0,
|
|
1714
|
+
const loadGalleries = (0, import_react10.useCallback)(
|
|
1564
1715
|
async (searchQuery, pageNum, append = false) => {
|
|
1565
1716
|
setLoading(true);
|
|
1566
1717
|
try {
|
|
@@ -1583,7 +1734,7 @@ function GalleryPickerModal({
|
|
|
1583
1734
|
},
|
|
1584
1735
|
[fetchList]
|
|
1585
1736
|
);
|
|
1586
|
-
const loadGalleryDetail = (0,
|
|
1737
|
+
const loadGalleryDetail = (0, import_react10.useCallback)(
|
|
1587
1738
|
async (id) => {
|
|
1588
1739
|
setLoading(true);
|
|
1589
1740
|
try {
|
|
@@ -1597,7 +1748,7 @@ function GalleryPickerModal({
|
|
|
1597
1748
|
},
|
|
1598
1749
|
[fetch]
|
|
1599
1750
|
);
|
|
1600
|
-
(0,
|
|
1751
|
+
(0, import_react10.useEffect)(() => {
|
|
1601
1752
|
if (viewMode === "list") {
|
|
1602
1753
|
const timer = setTimeout(() => {
|
|
1603
1754
|
setPage(1);
|
|
@@ -1606,12 +1757,12 @@ function GalleryPickerModal({
|
|
|
1606
1757
|
return () => clearTimeout(timer);
|
|
1607
1758
|
}
|
|
1608
1759
|
}, [search, loadGalleries, viewMode]);
|
|
1609
|
-
(0,
|
|
1760
|
+
(0, import_react10.useEffect)(() => {
|
|
1610
1761
|
if (isCreating && newGalleryInputRef.current) {
|
|
1611
1762
|
newGalleryInputRef.current.focus();
|
|
1612
1763
|
}
|
|
1613
1764
|
}, [isCreating]);
|
|
1614
|
-
const handleClose = (0,
|
|
1765
|
+
const handleClose = (0, import_react10.useCallback)(() => {
|
|
1615
1766
|
onClose();
|
|
1616
1767
|
}, [onClose]);
|
|
1617
1768
|
const handleLoadMore = () => {
|
|
@@ -1775,7 +1926,7 @@ function GalleryPickerModal({
|
|
|
1775
1926
|
},
|
|
1776
1927
|
className: GalleryPickerModal_default.backButton,
|
|
1777
1928
|
"aria-label": "Back to gallery",
|
|
1778
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ArrowLeft, { size: 20 })
|
|
1779
1930
|
}
|
|
1780
1931
|
),
|
|
1781
1932
|
footer: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: GalleryPickerModal_default.editFooter, children: [
|
|
@@ -1788,7 +1939,7 @@ function GalleryPickerModal({
|
|
|
1788
1939
|
className: GalleryPickerModal_default.saveButton,
|
|
1789
1940
|
disabled: isSaving || !updateImage,
|
|
1790
1941
|
children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1791
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1942
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoaderCircle, { size: 16, className: GalleryPickerModal_default.spinner }),
|
|
1792
1943
|
"Saving..."
|
|
1793
1944
|
] }) : "Save"
|
|
1794
1945
|
}
|
|
@@ -1908,7 +2059,7 @@ function GalleryPickerModal({
|
|
|
1908
2059
|
},
|
|
1909
2060
|
className: GalleryPickerModal_default.backButton,
|
|
1910
2061
|
"aria-label": "Back to galleries",
|
|
1911
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ArrowLeft, { size: 20 })
|
|
1912
2063
|
}
|
|
1913
2064
|
),
|
|
1914
2065
|
headerActions: !imageSelectMode && typeof removeImage === "function" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -2023,7 +2174,7 @@ function GalleryPickerModal({
|
|
|
2023
2174
|
onClick: () => setIsCreating(true),
|
|
2024
2175
|
className: GalleryPickerModal_default.createButton,
|
|
2025
2176
|
children: [
|
|
2026
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2177
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Plus, { size: 18 }),
|
|
2027
2178
|
"New Gallery"
|
|
2028
2179
|
]
|
|
2029
2180
|
}
|
|
@@ -2072,7 +2223,7 @@ function GalleryPickerModal({
|
|
|
2072
2223
|
onClick: handleCreateGallery,
|
|
2073
2224
|
disabled: !newGalleryName.trim() || createLoading,
|
|
2074
2225
|
className: GalleryPickerModal_default.createSubmitButton,
|
|
2075
|
-
children: createLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2226
|
+
children: createLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoaderCircle, { size: 16, className: GalleryPickerModal_default.spinner }) : "Create"
|
|
2076
2227
|
}
|
|
2077
2228
|
),
|
|
2078
2229
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -2097,7 +2248,7 @@ function GalleryPickerModal({
|
|
|
2097
2248
|
onClick: () => handleGalleryClick(gallery),
|
|
2098
2249
|
className: `${GalleryPickerModal_default.galleryCardButton} ${gallerySelectMode && isSelected ? GalleryPickerModal_default.selected : ""}`,
|
|
2099
2250
|
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)(
|
|
2251
|
+
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
2252
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: GalleryPickerModal_default.galleryCover, children: gallery.coverImage ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2102
2253
|
"img",
|
|
2103
2254
|
{
|
|
@@ -2148,7 +2299,7 @@ function GalleryField({
|
|
|
2148
2299
|
languages,
|
|
2149
2300
|
galleryOptions
|
|
2150
2301
|
}) {
|
|
2151
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
2302
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react11.useState)(false);
|
|
2152
2303
|
const handleSelect = (gallery) => {
|
|
2153
2304
|
onChange(gallery);
|
|
2154
2305
|
setIsModalOpen(false);
|
|
@@ -2196,7 +2347,7 @@ function GalleryField({
|
|
|
2196
2347
|
onClick: handleRemove,
|
|
2197
2348
|
className: GalleryField_default.removeButton,
|
|
2198
2349
|
"aria-label": "Remove gallery",
|
|
2199
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(X, { size: 16 })
|
|
2200
2351
|
}
|
|
2201
2352
|
)
|
|
2202
2353
|
] })
|
|
@@ -2207,7 +2358,7 @@ function GalleryField({
|
|
|
2207
2358
|
onClick: handleOpenModal,
|
|
2208
2359
|
className: GalleryField_default.selectButton,
|
|
2209
2360
|
children: [
|
|
2210
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Images, { size: 24 }),
|
|
2211
2362
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Select gallery" })
|
|
2212
2363
|
]
|
|
2213
2364
|
}
|
|
@@ -2229,14 +2380,12 @@ function GalleryField({
|
|
|
2229
2380
|
}
|
|
2230
2381
|
|
|
2231
2382
|
// src/components/DocumentField/DocumentField.tsx
|
|
2232
|
-
var
|
|
2383
|
+
var import_react13 = require("react");
|
|
2233
2384
|
var import_react_dom3 = require("react-dom");
|
|
2234
2385
|
var import_core3 = require("@puckeditor/core");
|
|
2235
|
-
var import_lucide_react14 = require("lucide-react");
|
|
2236
2386
|
|
|
2237
2387
|
// src/components/DocumentPickerModal/DocumentPickerModal.tsx
|
|
2238
|
-
var
|
|
2239
|
-
var import_lucide_react13 = require("lucide-react");
|
|
2388
|
+
var import_react12 = require("react");
|
|
2240
2389
|
|
|
2241
2390
|
// src/components/DocumentPickerModal/DocumentPickerModal.module.css
|
|
2242
2391
|
var DocumentPickerModal_default = {
|
|
@@ -2302,21 +2451,21 @@ function DocumentPickerModal({
|
|
|
2302
2451
|
selectable = true
|
|
2303
2452
|
}) {
|
|
2304
2453
|
const { fetchList, upload, update, delete: deleteDocument, uploadConfig } = documentOptions;
|
|
2305
|
-
const [view, setView] = (0,
|
|
2306
|
-
const [editingItem, setEditingItem] = (0,
|
|
2307
|
-
const [selectMode, setSelectMode] = (0,
|
|
2308
|
-
const [selectedForDelete, setSelectedForDelete] = (0,
|
|
2309
|
-
const [items, setItems] = (0,
|
|
2310
|
-
const [search, setSearch] = (0,
|
|
2311
|
-
const [loading, setLoading] = (0,
|
|
2312
|
-
const [page, setPage] = (0,
|
|
2313
|
-
const [hasMore, setHasMore] = (0,
|
|
2314
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
2315
|
-
const [titleValues, setTitleValues] = (0,
|
|
2316
|
-
const [activeLang, setActiveLang] = (0,
|
|
2317
|
-
const [isSaving, setIsSaving] = (0,
|
|
2318
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = (0,
|
|
2319
|
-
const [isDeleting, setIsDeleting] = (0,
|
|
2454
|
+
const [view, setView] = (0, import_react12.useState)("picker");
|
|
2455
|
+
const [editingItem, setEditingItem] = (0, import_react12.useState)(null);
|
|
2456
|
+
const [selectMode, setSelectMode] = (0, import_react12.useState)(false);
|
|
2457
|
+
const [selectedForDelete, setSelectedForDelete] = (0, import_react12.useState)(/* @__PURE__ */ new Set());
|
|
2458
|
+
const [items, setItems] = (0, import_react12.useState)([]);
|
|
2459
|
+
const [search, setSearch] = (0, import_react12.useState)("");
|
|
2460
|
+
const [loading, setLoading] = (0, import_react12.useState)(true);
|
|
2461
|
+
const [page, setPage] = (0, import_react12.useState)(1);
|
|
2462
|
+
const [hasMore, setHasMore] = (0, import_react12.useState)(false);
|
|
2463
|
+
const [selectedItem, setSelectedItem] = (0, import_react12.useState)(null);
|
|
2464
|
+
const [titleValues, setTitleValues] = (0, import_react12.useState)({});
|
|
2465
|
+
const [activeLang, setActiveLang] = (0, import_react12.useState)(languages[0]?.code || "it");
|
|
2466
|
+
const [isSaving, setIsSaving] = (0, import_react12.useState)(false);
|
|
2467
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = (0, import_react12.useState)(false);
|
|
2468
|
+
const [isDeleting, setIsDeleting] = (0, import_react12.useState)(false);
|
|
2320
2469
|
const canUpload = !!upload;
|
|
2321
2470
|
const {
|
|
2322
2471
|
uploading,
|
|
@@ -2334,7 +2483,7 @@ function DocumentPickerModal({
|
|
|
2334
2483
|
setItems((prev) => [newItem, ...prev]);
|
|
2335
2484
|
}
|
|
2336
2485
|
});
|
|
2337
|
-
const loadItems = (0,
|
|
2486
|
+
const loadItems = (0, import_react12.useCallback)(
|
|
2338
2487
|
async (searchQuery, pageNum, append = false) => {
|
|
2339
2488
|
setLoading(true);
|
|
2340
2489
|
try {
|
|
@@ -2357,14 +2506,14 @@ function DocumentPickerModal({
|
|
|
2357
2506
|
},
|
|
2358
2507
|
[fetchList]
|
|
2359
2508
|
);
|
|
2360
|
-
(0,
|
|
2509
|
+
(0, import_react12.useEffect)(() => {
|
|
2361
2510
|
const timer = setTimeout(() => {
|
|
2362
2511
|
setPage(1);
|
|
2363
2512
|
loadItems(search, 1);
|
|
2364
2513
|
}, 300);
|
|
2365
2514
|
return () => clearTimeout(timer);
|
|
2366
2515
|
}, [search, loadItems]);
|
|
2367
|
-
(0,
|
|
2516
|
+
(0, import_react12.useEffect)(() => {
|
|
2368
2517
|
if (selectedDocument) {
|
|
2369
2518
|
const existingItem = items.find((item) => item.id === selectedDocument.id);
|
|
2370
2519
|
if (existingItem) {
|
|
@@ -2372,7 +2521,7 @@ function DocumentPickerModal({
|
|
|
2372
2521
|
}
|
|
2373
2522
|
}
|
|
2374
2523
|
}, [selectedDocument, items]);
|
|
2375
|
-
const handleClose = (0,
|
|
2524
|
+
const handleClose = (0, import_react12.useCallback)(() => {
|
|
2376
2525
|
onClose();
|
|
2377
2526
|
}, [onClose]);
|
|
2378
2527
|
const handleLoadMore = () => {
|
|
@@ -2465,9 +2614,9 @@ function DocumentPickerModal({
|
|
|
2465
2614
|
};
|
|
2466
2615
|
const getIcon = (mimeType) => {
|
|
2467
2616
|
if (mimeType === "application/pdf") {
|
|
2468
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FileText, { size: 20, className: DocumentPickerModal_default.pdfIcon });
|
|
2469
2618
|
}
|
|
2470
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(File, { size: 20, className: DocumentPickerModal_default.fileIcon });
|
|
2471
2620
|
};
|
|
2472
2621
|
const isAllSelected = items.length > 0 && selectedForDelete.size === items.length;
|
|
2473
2622
|
const isSomeSelected = selectedForDelete.size > 0 && selectedForDelete.size < items.length;
|
|
@@ -2489,7 +2638,7 @@ function DocumentPickerModal({
|
|
|
2489
2638
|
},
|
|
2490
2639
|
className: DocumentPickerModal_default.backButton,
|
|
2491
2640
|
"aria-label": "Back to list",
|
|
2492
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ArrowLeft, { size: 20 })
|
|
2493
2642
|
}
|
|
2494
2643
|
),
|
|
2495
2644
|
footer: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: DocumentPickerModal_default.editFooter, children: [
|
|
@@ -2502,7 +2651,7 @@ function DocumentPickerModal({
|
|
|
2502
2651
|
className: DocumentPickerModal_default.saveButton,
|
|
2503
2652
|
disabled: isSaving || !update,
|
|
2504
2653
|
children: isSaving ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
2505
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoaderCircle, { size: 16, className: DocumentPickerModal_default.spinner }),
|
|
2506
2655
|
"Saving..."
|
|
2507
2656
|
] }) : "Save"
|
|
2508
2657
|
}
|
|
@@ -2664,7 +2813,7 @@ function DocumentPickerModal({
|
|
|
2664
2813
|
onClick: () => handleDocumentClick(item),
|
|
2665
2814
|
className: `${DocumentPickerModal_default.documentItem} ${isSelected ? DocumentPickerModal_default.selected : ""}`,
|
|
2666
2815
|
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)(
|
|
2816
|
+
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
2817
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: DocumentPickerModal_default.documentIcon, children: getIcon(item.mimeType) }),
|
|
2669
2818
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: DocumentPickerModal_default.documentInfo, children: [
|
|
2670
2819
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: DocumentPickerModal_default.documentName, children: item.title?.[languages[0]?.code] || item.filename }),
|
|
@@ -2707,7 +2856,7 @@ function DocumentPickerModal({
|
|
|
2707
2856
|
},
|
|
2708
2857
|
className: DocumentPickerModal_default.editButton,
|
|
2709
2858
|
"aria-label": "Edit title",
|
|
2710
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Pencil, { size: 14 })
|
|
2711
2860
|
}
|
|
2712
2861
|
)
|
|
2713
2862
|
] }, item.id);
|
|
@@ -2743,7 +2892,7 @@ function DocumentField({
|
|
|
2743
2892
|
languages,
|
|
2744
2893
|
documentOptions
|
|
2745
2894
|
}) {
|
|
2746
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
2895
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react13.useState)(false);
|
|
2747
2896
|
const handleSelect = (item) => {
|
|
2748
2897
|
onChange(item);
|
|
2749
2898
|
setIsModalOpen(false);
|
|
@@ -2767,9 +2916,9 @@ function DocumentField({
|
|
|
2767
2916
|
};
|
|
2768
2917
|
const getIcon = () => {
|
|
2769
2918
|
if (value?.mimeType === "application/pdf") {
|
|
2770
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileText, { size: 24, className: DocumentField_default.pdfIcon });
|
|
2771
2920
|
}
|
|
2772
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(File, { size: 24, className: DocumentField_default.fileIcon });
|
|
2773
2922
|
};
|
|
2774
2923
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core3.FieldLabel, { label: field.label || "Document", children: [
|
|
2775
2924
|
/* @__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 +2948,7 @@ function DocumentField({
|
|
|
2799
2948
|
onClick: handleRemove,
|
|
2800
2949
|
className: DocumentField_default.removeButton,
|
|
2801
2950
|
"aria-label": "Remove document",
|
|
2802
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(X, { size: 16 })
|
|
2803
2952
|
}
|
|
2804
2953
|
)
|
|
2805
2954
|
] })
|
|
@@ -2810,7 +2959,7 @@ function DocumentField({
|
|
|
2810
2959
|
onClick: handleOpenModal,
|
|
2811
2960
|
className: DocumentField_default.selectButton,
|
|
2812
2961
|
children: [
|
|
2813
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileText, { size: 24 }),
|
|
2814
2963
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Select document" })
|
|
2815
2964
|
]
|
|
2816
2965
|
}
|
|
@@ -2832,9 +2981,8 @@ function DocumentField({
|
|
|
2832
2981
|
}
|
|
2833
2982
|
|
|
2834
2983
|
// src/components/MediaPanel/MediaPanel.tsx
|
|
2835
|
-
var
|
|
2984
|
+
var import_react14 = require("react");
|
|
2836
2985
|
var import_react_dom4 = require("react-dom");
|
|
2837
|
-
var import_lucide_react15 = require("lucide-react");
|
|
2838
2986
|
|
|
2839
2987
|
// src/components/MediaPanel/MediaPanel.module.css
|
|
2840
2988
|
var MediaPanel_default = {
|
|
@@ -2850,7 +2998,7 @@ function MediaPanel({
|
|
|
2850
2998
|
galleryOptions,
|
|
2851
2999
|
documentOptions
|
|
2852
3000
|
}) {
|
|
2853
|
-
const [openModal, setOpenModal] = (0,
|
|
3001
|
+
const [openModal, setOpenModal] = (0, import_react14.useState)(null);
|
|
2854
3002
|
const handleCloseModal = () => {
|
|
2855
3003
|
setOpenModal(null);
|
|
2856
3004
|
};
|
|
@@ -2862,7 +3010,7 @@ function MediaPanel({
|
|
|
2862
3010
|
className: MediaPanel_default.item,
|
|
2863
3011
|
onClick: () => setOpenModal("image"),
|
|
2864
3012
|
children: [
|
|
2865
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Image, { size: 20 }),
|
|
2866
3014
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Images" })
|
|
2867
3015
|
]
|
|
2868
3016
|
}
|
|
@@ -2874,7 +3022,7 @@ function MediaPanel({
|
|
|
2874
3022
|
className: MediaPanel_default.item,
|
|
2875
3023
|
onClick: () => setOpenModal("gallery"),
|
|
2876
3024
|
children: [
|
|
2877
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Images, { size: 20 }),
|
|
2878
3026
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Gallery" })
|
|
2879
3027
|
]
|
|
2880
3028
|
}
|
|
@@ -2886,7 +3034,7 @@ function MediaPanel({
|
|
|
2886
3034
|
className: MediaPanel_default.item,
|
|
2887
3035
|
onClick: () => setOpenModal("document"),
|
|
2888
3036
|
children: [
|
|
2889
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileText, { size: 20 }),
|
|
2890
3038
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Documents" })
|
|
2891
3039
|
]
|
|
2892
3040
|
}
|
|
@@ -2988,7 +3136,7 @@ function createMediaPlugin(options) {
|
|
|
2988
3136
|
return {
|
|
2989
3137
|
name: "puck-media",
|
|
2990
3138
|
label: "Media",
|
|
2991
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3139
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Image, { size: 20 }),
|
|
2992
3140
|
render: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2993
3141
|
MediaPanel,
|
|
2994
3142
|
{
|
|
@@ -3026,4 +3174,33 @@ var DEFAULT_LANGUAGES = [
|
|
|
3026
3174
|
formatFileSize,
|
|
3027
3175
|
useUpload
|
|
3028
3176
|
});
|
|
3177
|
+
/*! Bundled license information:
|
|
3178
|
+
|
|
3179
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
3180
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
3181
|
+
lucide-react/dist/esm/Icon.js:
|
|
3182
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
3183
|
+
lucide-react/dist/esm/icons/arrow-left.js:
|
|
3184
|
+
lucide-react/dist/esm/icons/check.js:
|
|
3185
|
+
lucide-react/dist/esm/icons/circle-alert.js:
|
|
3186
|
+
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
3187
|
+
lucide-react/dist/esm/icons/file-text.js:
|
|
3188
|
+
lucide-react/dist/esm/icons/file.js:
|
|
3189
|
+
lucide-react/dist/esm/icons/image-plus.js:
|
|
3190
|
+
lucide-react/dist/esm/icons/image.js:
|
|
3191
|
+
lucide-react/dist/esm/icons/images.js:
|
|
3192
|
+
lucide-react/dist/esm/icons/loader-circle.js:
|
|
3193
|
+
lucide-react/dist/esm/icons/pencil.js:
|
|
3194
|
+
lucide-react/dist/esm/icons/plus.js:
|
|
3195
|
+
lucide-react/dist/esm/icons/search.js:
|
|
3196
|
+
lucide-react/dist/esm/icons/upload.js:
|
|
3197
|
+
lucide-react/dist/esm/icons/x.js:
|
|
3198
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
3199
|
+
(**
|
|
3200
|
+
* @license lucide-react v0.468.0 - ISC
|
|
3201
|
+
*
|
|
3202
|
+
* This source code is licensed under the ISC license.
|
|
3203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
3204
|
+
*)
|
|
3205
|
+
*/
|
|
3029
3206
|
//# sourceMappingURL=index.js.map
|