@haklex/rich-ext-gallery 0.58.0 → 0.59.1
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/GalleryDialogSubHeader.d.ts.map +1 -1
- package/dist/GalleryEditRenderer.d.ts.map +1 -1
- package/dist/GalleryEditorDialog.d.ts +22 -0
- package/dist/GalleryEditorDialog.d.ts.map +1 -0
- package/dist/GalleryImageCard.d.ts +16 -0
- package/dist/GalleryImageCard.d.ts.map +1 -0
- package/dist/GalleryImageList.d.ts +10 -0
- package/dist/GalleryImageList.d.ts.map +1 -0
- package/dist/{GalleryRenderer-CHoZMZOz.js → GalleryRenderer-BQwH6RKf.js} +13 -22
- package/dist/{edit-CM5oZUvY.js → edit-PI4a20en.js} +380 -330
- package/dist/edit.mjs +1 -1
- package/dist/gallery-files.d.ts +11 -0
- package/dist/gallery-files.d.ts.map +1 -0
- package/dist/index.mjs +2 -2
- package/dist/renderer.mjs +1 -1
- package/dist/rich-ext-gallery.css +1 -1
- package/dist/static.mjs +1 -1
- package/dist/styles.css.d.ts +6 -16
- package/dist/styles.css.d.ts.map +1 -1
- package/dist/useGalleryUpload.d.ts +22 -0
- package/dist/useGalleryUpload.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as galleryMaxHeightInput, S as galleryImageThumbPlaceholder, _ as galleryImageCard, a as galleryDialogEmpty, b as galleryImageList, c as galleryDialogSubHeaderGroup, d as galleryDragOverlayText, f as galleryDropZone, g as galleryEmptyState, h as galleryEditOverlay, i as galleryDialogBody, l as galleryDialogSubHeaderLabel, m as galleryEditLabel, o as galleryDialogPopup, p as galleryEditContainer, r as galleryAddActions, s as galleryDialogSubHeader, t as GalleryRenderer, u as galleryDragOverlay, v as galleryImageDragHandle, x as galleryImageThumb, y as galleryImageFields } from "./GalleryRenderer-BQwH6RKf.js";
|
|
2
2
|
import { i as _defineProperty, r as GalleryNode } from "./GalleryNode-CGOSFC43.js";
|
|
3
3
|
import { $getNodeByKey, $insertNodes } from "lexical";
|
|
4
|
-
import { GripVertical, ImageIcon, Images, Pencil, Plus, Trash2
|
|
5
|
-
import { createElement, useCallback, useRef, useState } from "react";
|
|
6
|
-
import { DndContext, DragOverlay, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
7
|
-
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
8
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
4
|
+
import { GripVertical, ImageIcon, Images, Link, Pencil, Plus, Trash2 } from "lucide-react";
|
|
5
|
+
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
6
|
import { resolvePreprocessTargets, useImagePreprocess, useImageUpload } from "@haklex/rich-editor/plugins";
|
|
10
7
|
import { useColorScheme } from "@haklex/rich-editor/static";
|
|
11
|
-
import { SegmentedControl, presentDialog } from "@haklex/rich-editor-ui";
|
|
8
|
+
import { ActionButton, ModalShell, ModalShellBody, ModalShellFooter, ModalShellHeader, SegmentedControl, TextInput, confirmDiscardChanges, presentDialog, toast } from "@haklex/rich-editor-ui";
|
|
12
9
|
import { usePortalTheme, vars } from "@haklex/rich-style-token";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { DndContext, DragOverlay, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
12
|
+
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
13
13
|
import { createPortal } from "react-dom";
|
|
14
|
-
import {
|
|
14
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
15
|
+
//#region src/gallery-files.ts
|
|
16
|
+
function readAsDataUrl(file) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
const reader = new FileReader();
|
|
19
|
+
reader.onload = () => resolve(String(reader.result));
|
|
20
|
+
reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("File read failed"));
|
|
21
|
+
reader.readAsDataURL(file);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function fileToGalleryImage(file, uploader) {
|
|
25
|
+
if (uploader) {
|
|
26
|
+
const result = await uploader(file);
|
|
27
|
+
return {
|
|
28
|
+
src: result.src,
|
|
29
|
+
alt: result.altText ?? file.name
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
src: await readAsDataUrl(file),
|
|
34
|
+
alt: file.name
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function extractImageFiles(list) {
|
|
38
|
+
if (!list) return [];
|
|
39
|
+
return Array.from(list).filter((file) => file?.type.startsWith("image/"));
|
|
40
|
+
}
|
|
41
|
+
function imageCountLabel(count) {
|
|
42
|
+
return `${count} ${count === 1 ? "image" : "images"}`;
|
|
43
|
+
}
|
|
44
|
+
var nextId = 0;
|
|
45
|
+
function genId() {
|
|
46
|
+
return `img-${++nextId}`;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
15
49
|
//#region src/GalleryDialogSubHeader.tsx
|
|
16
50
|
var aspectItems = [
|
|
17
51
|
{
|
|
@@ -43,26 +77,29 @@ var fitBaseItems = [{
|
|
|
43
77
|
label: "Contain"
|
|
44
78
|
}];
|
|
45
79
|
var GalleryDialogSubHeader = ({ aspect, fit, layout, maxItemHeightInput, onAspectChange, onFitChange, onMaxItemHeightInputChange }) => {
|
|
46
|
-
if (layout === "masonry") return /* @__PURE__ */
|
|
80
|
+
if (layout === "masonry") return /* @__PURE__ */ jsx("div", {
|
|
47
81
|
className: galleryDialogSubHeader,
|
|
48
|
-
children:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
83
|
+
className: galleryDialogSubHeaderGroup,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: galleryDialogSubHeaderLabel,
|
|
87
|
+
children: "Max height"
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
90
|
+
className: galleryMaxHeightInput,
|
|
91
|
+
min: 1,
|
|
92
|
+
placeholder: "Auto",
|
|
93
|
+
type: "number",
|
|
94
|
+
value: maxItemHeightInput,
|
|
95
|
+
onChange: (e) => onMaxItemHeightInputChange(e.target.value)
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: galleryDialogSubHeaderLabel,
|
|
99
|
+
children: "px"
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
66
103
|
});
|
|
67
104
|
return /* @__PURE__ */ jsxs("div", {
|
|
68
105
|
className: galleryDialogSubHeader,
|
|
@@ -93,64 +130,18 @@ var GalleryDialogSubHeader = ({ aspect, fit, layout, maxItemHeightInput, onAspec
|
|
|
93
130
|
});
|
|
94
131
|
};
|
|
95
132
|
//#endregion
|
|
96
|
-
//#region src/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
value: "grid",
|
|
109
|
-
label: "Grid"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
value: "masonry",
|
|
113
|
-
label: "Masonry"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
value: "carousel",
|
|
117
|
-
label: "Carousel"
|
|
118
|
-
}
|
|
119
|
-
];
|
|
120
|
-
var nextId = 0;
|
|
121
|
-
function genId() {
|
|
122
|
-
return `img-${++nextId}`;
|
|
123
|
-
}
|
|
124
|
-
function readAsDataUrl(file) {
|
|
125
|
-
return new Promise((resolve, reject) => {
|
|
126
|
-
const reader = new FileReader();
|
|
127
|
-
reader.onload = () => resolve(String(reader.result));
|
|
128
|
-
reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("File read failed"));
|
|
129
|
-
reader.readAsDataURL(file);
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
async function fileToGalleryImage(file, uploader) {
|
|
133
|
-
if (uploader) {
|
|
134
|
-
const result = await uploader(file);
|
|
135
|
-
return {
|
|
136
|
-
src: result.src,
|
|
137
|
-
alt: result.altText ?? file.name
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
src: await readAsDataUrl(file),
|
|
142
|
-
alt: file.name
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function extractImageFiles(list) {
|
|
146
|
-
if (!list) return [];
|
|
147
|
-
const files = [];
|
|
148
|
-
for (let i = 0; i < list.length; i++) {
|
|
149
|
-
const f = list[i];
|
|
150
|
-
if (f && f.type.startsWith("image/")) files.push(f);
|
|
151
|
-
}
|
|
152
|
-
return files;
|
|
153
|
-
}
|
|
133
|
+
//#region src/GalleryImageCard.tsx
|
|
134
|
+
var Thumb = ({ image }) => /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: galleryImageThumb,
|
|
136
|
+
title: "Drop an image here to replace",
|
|
137
|
+
children: image.src ? /* @__PURE__ */ jsx("img", {
|
|
138
|
+
alt: image.alt || "",
|
|
139
|
+
src: image.src
|
|
140
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
141
|
+
className: galleryImageThumbPlaceholder,
|
|
142
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { size: 20 })
|
|
143
|
+
})
|
|
144
|
+
});
|
|
154
145
|
var SortableImageCard = ({ id, image, index, isLast, lastInputRef, onUpdate, onRemove, onDropFile }) => {
|
|
155
146
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id });
|
|
156
147
|
const [dropActive, setDropActive] = useState(false);
|
|
@@ -188,130 +179,164 @@ var SortableImageCard = ({ id, image, index, isLast, lastInputRef, onUpdate, onR
|
|
|
188
179
|
onDrop: handleDrop,
|
|
189
180
|
children: [
|
|
190
181
|
/* @__PURE__ */ jsx("div", {
|
|
182
|
+
"aria-label": "Reorder image",
|
|
191
183
|
className: galleryImageDragHandle,
|
|
192
184
|
...attributes,
|
|
193
185
|
...listeners,
|
|
194
186
|
children: /* @__PURE__ */ jsx(GripVertical, { size: 14 })
|
|
195
187
|
}),
|
|
196
|
-
/* @__PURE__ */ jsx(
|
|
197
|
-
className: galleryImageThumb,
|
|
198
|
-
title: "Drop an image here to replace",
|
|
199
|
-
children: image.src ? /* @__PURE__ */ jsx("img", {
|
|
200
|
-
alt: image.alt || "",
|
|
201
|
-
src: image.src
|
|
202
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
203
|
-
className: galleryImageThumbPlaceholder,
|
|
204
|
-
children: /* @__PURE__ */ jsx(ImageIcon, { size: 20 })
|
|
205
|
-
})
|
|
206
|
-
}),
|
|
188
|
+
/* @__PURE__ */ jsx(Thumb, { image }),
|
|
207
189
|
/* @__PURE__ */ jsxs("div", {
|
|
208
190
|
className: galleryImageFields,
|
|
209
|
-
children: [/* @__PURE__ */ jsx(
|
|
210
|
-
|
|
191
|
+
children: [/* @__PURE__ */ jsx(TextInput, {
|
|
192
|
+
"aria-label": "Image URL",
|
|
211
193
|
placeholder: "Image URL",
|
|
212
194
|
ref: isLast ? lastInputRef : void 0,
|
|
213
|
-
type: "text",
|
|
214
195
|
value: image.src,
|
|
215
196
|
onChange: (e) => onUpdate(index, "src", e.target.value)
|
|
216
|
-
}), /* @__PURE__ */ jsx(
|
|
217
|
-
|
|
197
|
+
}), /* @__PURE__ */ jsx(TextInput, {
|
|
198
|
+
"aria-label": "Alt text",
|
|
218
199
|
placeholder: "Alt text (optional)",
|
|
219
|
-
type: "text",
|
|
220
200
|
value: image.alt || "",
|
|
221
201
|
onChange: (e) => onUpdate(index, "alt", e.target.value)
|
|
222
202
|
})]
|
|
223
203
|
}),
|
|
224
|
-
/* @__PURE__ */ jsx(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
})
|
|
204
|
+
/* @__PURE__ */ jsx(ActionButton, {
|
|
205
|
+
danger: true,
|
|
206
|
+
icon: true,
|
|
207
|
+
"aria-label": "Remove image",
|
|
208
|
+
size: "md",
|
|
209
|
+
title: "Remove image",
|
|
210
|
+
onClick: () => onRemove(index),
|
|
211
|
+
children: /* @__PURE__ */ jsx(Trash2, {})
|
|
233
212
|
})
|
|
234
213
|
]
|
|
235
214
|
});
|
|
236
215
|
};
|
|
237
216
|
var DragOverlayCard = ({ image }) => /* @__PURE__ */ jsxs("div", {
|
|
238
|
-
className: galleryImageCard
|
|
239
|
-
style: { opacity: .9 },
|
|
217
|
+
className: `${galleryImageCard} ${galleryDragOverlay}`,
|
|
240
218
|
children: [
|
|
241
219
|
/* @__PURE__ */ jsx("div", {
|
|
242
220
|
className: galleryImageDragHandle,
|
|
243
221
|
children: /* @__PURE__ */ jsx(GripVertical, { size: 14 })
|
|
244
222
|
}),
|
|
245
|
-
/* @__PURE__ */ jsx(
|
|
246
|
-
className: galleryImageThumb,
|
|
247
|
-
children: image.src ? /* @__PURE__ */ jsx("img", {
|
|
248
|
-
alt: image.alt || "",
|
|
249
|
-
src: image.src
|
|
250
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
251
|
-
className: galleryImageThumbPlaceholder,
|
|
252
|
-
children: /* @__PURE__ */ jsx(ImageIcon, { size: 20 })
|
|
253
|
-
})
|
|
254
|
-
}),
|
|
223
|
+
/* @__PURE__ */ jsx(Thumb, { image }),
|
|
255
224
|
/* @__PURE__ */ jsx("div", {
|
|
256
225
|
className: galleryImageFields,
|
|
257
226
|
children: /* @__PURE__ */ jsx("span", {
|
|
258
|
-
|
|
259
|
-
fontSize: vars.typography.fontSizeSm,
|
|
260
|
-
overflow: "hidden",
|
|
261
|
-
textOverflow: "ellipsis",
|
|
262
|
-
whiteSpace: "nowrap"
|
|
263
|
-
},
|
|
227
|
+
className: galleryDragOverlayText,
|
|
264
228
|
children: image.src || "No URL"
|
|
265
229
|
})
|
|
266
230
|
})
|
|
267
231
|
]
|
|
268
232
|
});
|
|
269
|
-
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/GalleryImageList.tsx
|
|
235
|
+
var GalleryImageList = ({ children, entries, lastInputRef, setEntries, onDropFile }) => {
|
|
270
236
|
const { className: portalClassName } = usePortalTheme();
|
|
271
|
-
const [entries, setEntries] = useState(() => initialImages.map((img) => ({
|
|
272
|
-
id: genId(),
|
|
273
|
-
image: { ...img }
|
|
274
|
-
})));
|
|
275
|
-
const [layout, setLayout] = useState(initialLayout);
|
|
276
|
-
const [aspect, setAspect] = useState(initialAspect);
|
|
277
|
-
const [fit, setFit] = useState(initialFit);
|
|
278
|
-
const [maxItemHeightInput, setMaxItemHeightInput] = useState(initialMaxItemHeight === void 0 ? "" : String(initialMaxItemHeight));
|
|
279
|
-
const newInputRef = useRef(null);
|
|
280
237
|
const [dragActiveId, setDragActiveId] = useState(null);
|
|
281
|
-
const [bodyDropActive, setBodyDropActive] = useState(false);
|
|
282
|
-
const dragDepthRef = useRef(0);
|
|
283
|
-
const itemIds = entries.map((e) => e.id);
|
|
284
238
|
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
|
|
285
|
-
const
|
|
286
|
-
setEntries((prev) =>
|
|
287
|
-
|
|
239
|
+
const handleRemove = useCallback((index) => {
|
|
240
|
+
setEntries((prev) => prev.filter((_, i) => i !== index));
|
|
241
|
+
}, [setEntries]);
|
|
242
|
+
const handleUpdate = useCallback((index, field, value) => {
|
|
243
|
+
setEntries((prev) => prev.map((entry, i) => i === index ? {
|
|
244
|
+
...entry,
|
|
288
245
|
image: {
|
|
289
|
-
|
|
290
|
-
|
|
246
|
+
...entry.image,
|
|
247
|
+
[field]: value
|
|
291
248
|
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
249
|
+
} : entry));
|
|
250
|
+
}, [setEntries]);
|
|
251
|
+
const handleDragEnd = useCallback((event) => {
|
|
252
|
+
const { active, over } = event;
|
|
253
|
+
setDragActiveId(null);
|
|
254
|
+
if (!over || active.id === over.id) return;
|
|
255
|
+
setEntries((prev) => {
|
|
256
|
+
const oldIndex = prev.findIndex((e) => e.id === String(active.id));
|
|
257
|
+
const newIndex = prev.findIndex((e) => e.id === String(over.id));
|
|
258
|
+
if (oldIndex === -1 || newIndex === -1) return prev;
|
|
259
|
+
return arrayMove(prev, oldIndex, newIndex);
|
|
295
260
|
});
|
|
296
|
-
}, []);
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
261
|
+
}, [setEntries]);
|
|
262
|
+
const dragActiveEntry = dragActiveId ? entries.find((e) => e.id === dragActiveId) : null;
|
|
263
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
264
|
+
className: galleryImageList,
|
|
265
|
+
children: [/* @__PURE__ */ jsxs(DndContext, {
|
|
266
|
+
collisionDetection: closestCenter,
|
|
267
|
+
sensors,
|
|
268
|
+
onDragCancel: () => setDragActiveId(null),
|
|
269
|
+
onDragEnd: handleDragEnd,
|
|
270
|
+
onDragStart: (event) => {
|
|
271
|
+
setDragActiveId(String(event.active.id));
|
|
272
|
+
},
|
|
273
|
+
children: [/* @__PURE__ */ jsx(SortableContext, {
|
|
274
|
+
items: entries.map((e) => e.id),
|
|
275
|
+
strategy: verticalListSortingStrategy,
|
|
276
|
+
children: entries.map((entry, index) => /* @__PURE__ */ jsx(SortableImageCard, {
|
|
277
|
+
id: entry.id,
|
|
278
|
+
image: entry.image,
|
|
279
|
+
index,
|
|
280
|
+
isLast: index === entries.length - 1,
|
|
281
|
+
lastInputRef,
|
|
282
|
+
onDropFile,
|
|
283
|
+
onRemove: handleRemove,
|
|
284
|
+
onUpdate: handleUpdate
|
|
285
|
+
}, entry.id))
|
|
286
|
+
}), typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
287
|
+
className: portalClassName,
|
|
288
|
+
children: /* @__PURE__ */ jsx(DragOverlay, {
|
|
289
|
+
dropAnimation: null,
|
|
290
|
+
children: dragActiveEntry ? /* @__PURE__ */ jsx(DragOverlayCard, { image: dragActiveEntry.image }) : null
|
|
291
|
+
})
|
|
292
|
+
}), document.body) : null]
|
|
293
|
+
}), children]
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/maxItemHeight.ts
|
|
298
|
+
function parseMaxItemHeightInput(value) {
|
|
299
|
+
const trimmed = value.trim();
|
|
300
|
+
if (!trimmed) return void 0;
|
|
301
|
+
const parsed = Number(trimmed);
|
|
302
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return void 0;
|
|
303
|
+
return parsed;
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/useGalleryUpload.ts
|
|
307
|
+
function uploadFailedTitle(count) {
|
|
308
|
+
return count === 1 ? "Couldn’t upload image" : `Couldn’t upload ${count} images`;
|
|
309
|
+
}
|
|
310
|
+
var hasFiles = (e) => !!e.dataTransfer?.types.includes("Files");
|
|
311
|
+
function useGalleryUpload({ preprocess, uploader, setEntries, onAddUrl }) {
|
|
312
|
+
const fileInputRef = useRef(null);
|
|
313
|
+
const [dropActive, setDropActive] = useState(false);
|
|
314
|
+
const dragDepthRef = useRef(0);
|
|
300
315
|
const appendFiles = useCallback(async (picked) => {
|
|
301
316
|
const files = await resolvePreprocessTargets(picked, "gallery", preprocess?.ref.current ?? null);
|
|
302
317
|
if (!files.length) return;
|
|
303
|
-
const
|
|
318
|
+
const results = await Promise.all(files.map(async (file) => {
|
|
304
319
|
try {
|
|
305
320
|
return await fileToGalleryImage(file, uploader);
|
|
306
321
|
} catch {
|
|
307
322
|
return null;
|
|
308
323
|
}
|
|
309
|
-
}))
|
|
324
|
+
}));
|
|
325
|
+
const failed = results.filter((r) => !r?.src).length;
|
|
326
|
+
if (failed) toast({
|
|
327
|
+
title: uploadFailedTitle(failed),
|
|
328
|
+
tone: "error"
|
|
329
|
+
});
|
|
330
|
+
const fresh = results.filter((r) => !!r && !!r.src).map((image) => ({
|
|
310
331
|
id: genId(),
|
|
311
332
|
image
|
|
312
333
|
}));
|
|
313
334
|
if (fresh.length) setEntries((prev) => [...prev, ...fresh]);
|
|
314
|
-
}, [
|
|
335
|
+
}, [
|
|
336
|
+
preprocess,
|
|
337
|
+
uploader,
|
|
338
|
+
setEntries
|
|
339
|
+
]);
|
|
315
340
|
const replaceEntryFile = useCallback(async (index, picked) => {
|
|
316
341
|
const [file] = await resolvePreprocessTargets([picked], "gallery", preprocess?.ref.current ?? null);
|
|
317
342
|
if (!file) return;
|
|
@@ -324,28 +349,120 @@ var GalleryEditorDialogContent = ({ dismiss, initialAspect, initialFit, initialI
|
|
|
324
349
|
alt: next.alt || entry.image.alt || ""
|
|
325
350
|
}
|
|
326
351
|
} : entry));
|
|
327
|
-
} catch {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
352
|
+
} catch {
|
|
353
|
+
toast({
|
|
354
|
+
title: uploadFailedTitle(1),
|
|
355
|
+
tone: "error"
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}, [
|
|
359
|
+
preprocess,
|
|
360
|
+
uploader,
|
|
361
|
+
setEntries
|
|
362
|
+
]);
|
|
363
|
+
const handleAddImages = useCallback(() => {
|
|
364
|
+
if (uploader) fileInputRef.current?.click();
|
|
365
|
+
else onAddUrl();
|
|
366
|
+
}, [uploader, onAddUrl]);
|
|
367
|
+
const handleFileInputChange = (e) => {
|
|
368
|
+
const files = extractImageFiles(e.target.files);
|
|
369
|
+
e.target.value = "";
|
|
370
|
+
if (files.length) appendFiles(files);
|
|
371
|
+
};
|
|
372
|
+
return {
|
|
373
|
+
dropActive,
|
|
374
|
+
dropHandlers: {
|
|
375
|
+
onDragEnter: (e) => {
|
|
376
|
+
if (!hasFiles(e)) return;
|
|
377
|
+
dragDepthRef.current += 1;
|
|
378
|
+
setDropActive(true);
|
|
379
|
+
},
|
|
380
|
+
onDragOver: (e) => {
|
|
381
|
+
if (!hasFiles(e)) return;
|
|
382
|
+
e.preventDefault();
|
|
383
|
+
e.dataTransfer.dropEffect = "copy";
|
|
384
|
+
},
|
|
385
|
+
onDragLeave: (e) => {
|
|
386
|
+
if (!hasFiles(e)) return;
|
|
387
|
+
dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);
|
|
388
|
+
if (dragDepthRef.current === 0) setDropActive(false);
|
|
389
|
+
},
|
|
390
|
+
onDrop: (e) => {
|
|
391
|
+
const files = extractImageFiles(e.dataTransfer?.files);
|
|
392
|
+
dragDepthRef.current = 0;
|
|
393
|
+
setDropActive(false);
|
|
394
|
+
if (!files.length) return;
|
|
395
|
+
e.preventDefault();
|
|
396
|
+
appendFiles(files);
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
fileInputRef,
|
|
400
|
+
handleAddImages,
|
|
401
|
+
handleFileInputChange,
|
|
402
|
+
replaceEntryFile
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/GalleryEditorDialog.tsx
|
|
407
|
+
var layoutItems = [
|
|
408
|
+
{
|
|
409
|
+
value: "grid",
|
|
410
|
+
label: "Grid"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
value: "masonry",
|
|
414
|
+
label: "Masonry"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
value: "carousel",
|
|
418
|
+
label: "Carousel"
|
|
419
|
+
}
|
|
420
|
+
];
|
|
421
|
+
var GalleryEditorDialog = ({ dismiss, requestDismiss, initialAspect, initialFit, initialImages, initialLayout, initialMaxItemHeight, preprocess, uploader, onAspectChange, onDirtyChange, onFitChange, onImagesChange, onLayoutChange, onMaxItemHeightChange }) => {
|
|
422
|
+
const [entries, setEntries] = useState(() => initialImages.map((img) => ({
|
|
423
|
+
id: genId(),
|
|
424
|
+
image: { ...img }
|
|
425
|
+
})));
|
|
426
|
+
const [layout, setLayout] = useState(initialLayout);
|
|
427
|
+
const [aspect, setAspect] = useState(initialAspect);
|
|
428
|
+
const [fit, setFit] = useState(initialFit);
|
|
429
|
+
const initialMaxItemHeightInput = initialMaxItemHeight === void 0 ? "" : String(initialMaxItemHeight);
|
|
430
|
+
const [maxItemHeightInput, setMaxItemHeightInput] = useState(initialMaxItemHeightInput);
|
|
431
|
+
const newInputRef = useRef(null);
|
|
432
|
+
const dirty = useMemo(() => layout !== initialLayout || aspect !== initialAspect || fit !== initialFit || maxItemHeightInput !== initialMaxItemHeightInput || JSON.stringify(entries.map((e) => e.image)) !== JSON.stringify(initialImages), [
|
|
433
|
+
entries,
|
|
434
|
+
layout,
|
|
435
|
+
aspect,
|
|
436
|
+
fit,
|
|
437
|
+
maxItemHeightInput,
|
|
438
|
+
initialImages,
|
|
439
|
+
initialLayout,
|
|
440
|
+
initialAspect,
|
|
441
|
+
initialFit,
|
|
442
|
+
initialMaxItemHeightInput
|
|
443
|
+
]);
|
|
444
|
+
useEffect(() => {
|
|
445
|
+
onDirtyChange?.(dirty);
|
|
446
|
+
}, [dirty, onDirtyChange]);
|
|
447
|
+
const imageCount = entries.filter((e) => e.image.src.trim()).length;
|
|
448
|
+
const handleAddUrl = useCallback(() => {
|
|
449
|
+
setEntries((prev) => [...prev, {
|
|
450
|
+
id: genId(),
|
|
332
451
|
image: {
|
|
333
|
-
|
|
334
|
-
|
|
452
|
+
src: "",
|
|
453
|
+
alt: ""
|
|
335
454
|
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const { active, over } = event;
|
|
340
|
-
setDragActiveId(null);
|
|
341
|
-
if (!over || active.id === over.id) return;
|
|
342
|
-
setEntries((prev) => {
|
|
343
|
-
const oldIndex = prev.findIndex((e) => e.id === String(active.id));
|
|
344
|
-
const newIndex = prev.findIndex((e) => e.id === String(over.id));
|
|
345
|
-
if (oldIndex === -1 || newIndex === -1) return prev;
|
|
346
|
-
return arrayMove(prev, oldIndex, newIndex);
|
|
455
|
+
}]);
|
|
456
|
+
requestAnimationFrame(() => {
|
|
457
|
+
newInputRef.current?.focus();
|
|
347
458
|
});
|
|
348
459
|
}, []);
|
|
460
|
+
const { dropActive, dropHandlers, fileInputRef, handleAddImages, handleFileInputChange, replaceEntryFile } = useGalleryUpload({
|
|
461
|
+
preprocess,
|
|
462
|
+
uploader,
|
|
463
|
+
setEntries,
|
|
464
|
+
onAddUrl: handleAddUrl
|
|
465
|
+
});
|
|
349
466
|
const handleSave = useCallback(() => {
|
|
350
467
|
onImagesChange(entries.map((e) => e.image).filter((img) => img.src.trim()));
|
|
351
468
|
onLayoutChange(layout);
|
|
@@ -366,147 +483,83 @@ var GalleryEditorDialogContent = ({ dismiss, initialAspect, initialFit, initialI
|
|
|
366
483
|
onMaxItemHeightChange,
|
|
367
484
|
dismiss
|
|
368
485
|
]);
|
|
369
|
-
const
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
appendFiles(files);
|
|
392
|
-
};
|
|
393
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
394
|
-
/* @__PURE__ */ jsxs("div", {
|
|
395
|
-
className: galleryDialogHeader,
|
|
396
|
-
children: [
|
|
397
|
-
/* @__PURE__ */ jsxs("div", {
|
|
398
|
-
className: galleryDialogTitle,
|
|
399
|
-
children: [/* @__PURE__ */ jsx(Images, { size: 18 }), /* @__PURE__ */ jsx("span", { children: "Gallery Editor" })]
|
|
400
|
-
}),
|
|
401
|
-
/* @__PURE__ */ jsx("div", {
|
|
402
|
-
className: galleryHeaderActions,
|
|
403
|
-
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
404
|
-
items: layoutItems,
|
|
405
|
-
value: layout,
|
|
406
|
-
onChange: setLayout
|
|
407
|
-
})
|
|
486
|
+
const handleCancel = requestDismiss ?? dismiss;
|
|
487
|
+
const addActions = /* @__PURE__ */ jsxs("div", {
|
|
488
|
+
className: galleryAddActions,
|
|
489
|
+
children: [/* @__PURE__ */ jsxs(ActionButton, {
|
|
490
|
+
size: "md",
|
|
491
|
+
variant: "outline",
|
|
492
|
+
onClick: handleAddImages,
|
|
493
|
+
children: [/* @__PURE__ */ jsx(Plus, {}), "Add images"]
|
|
494
|
+
}), uploader && /* @__PURE__ */ jsxs(ActionButton, {
|
|
495
|
+
size: "md",
|
|
496
|
+
onClick: handleAddUrl,
|
|
497
|
+
children: [/* @__PURE__ */ jsx(Link, {}), "Add URL"]
|
|
498
|
+
})]
|
|
499
|
+
});
|
|
500
|
+
return /* @__PURE__ */ jsxs(ModalShell, {
|
|
501
|
+
onSave: handleSave,
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ jsx(ModalShellHeader, {
|
|
504
|
+
center: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
505
|
+
items: layoutItems,
|
|
506
|
+
value: layout,
|
|
507
|
+
onChange: setLayout
|
|
408
508
|
}),
|
|
409
|
-
/* @__PURE__ */ jsx(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
509
|
+
icon: /* @__PURE__ */ jsx(Images, {}),
|
|
510
|
+
title: "Gallery",
|
|
511
|
+
onClose: handleCancel
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ jsx(GalleryDialogSubHeader, {
|
|
514
|
+
aspect,
|
|
515
|
+
fit,
|
|
516
|
+
layout,
|
|
517
|
+
maxItemHeightInput,
|
|
518
|
+
onAspectChange: setAspect,
|
|
519
|
+
onFitChange: setFit,
|
|
520
|
+
onMaxItemHeightInputChange: setMaxItemHeightInput
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ jsx(ModalShellBody, {
|
|
523
|
+
className: galleryDialogBody,
|
|
524
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
525
|
+
className: galleryDropZone,
|
|
526
|
+
"data-drop-active": dropActive || void 0,
|
|
527
|
+
...dropHandlers,
|
|
528
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
529
|
+
hidden: true,
|
|
530
|
+
multiple: true,
|
|
531
|
+
accept: "image/*",
|
|
532
|
+
ref: fileInputRef,
|
|
533
|
+
tabIndex: -1,
|
|
534
|
+
type: "file",
|
|
535
|
+
onChange: handleFileInputChange
|
|
536
|
+
}), entries.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
537
|
+
className: galleryDialogEmpty,
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ jsx(ImageIcon, { size: 32 }),
|
|
540
|
+
/* @__PURE__ */ jsx("span", { children: "Add images or drop files here" }),
|
|
541
|
+
addActions
|
|
542
|
+
]
|
|
543
|
+
}) : /* @__PURE__ */ jsx(GalleryImageList, {
|
|
544
|
+
entries,
|
|
545
|
+
lastInputRef: newInputRef,
|
|
546
|
+
setEntries,
|
|
547
|
+
onDropFile: replaceEntryFile,
|
|
548
|
+
children: addActions
|
|
549
|
+
})]
|
|
414
550
|
})
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
maxItemHeightInput,
|
|
422
|
-
onAspectChange: setAspect,
|
|
423
|
-
onFitChange: setFit,
|
|
424
|
-
onMaxItemHeightInputChange: setMaxItemHeightInput
|
|
425
|
-
}),
|
|
426
|
-
/* @__PURE__ */ jsx("div", {
|
|
427
|
-
className: galleryDialogBody,
|
|
428
|
-
style: bodyDropActive ? {
|
|
429
|
-
outline: `2px dashed ${vars.color.accent}`,
|
|
430
|
-
outlineOffset: -8,
|
|
431
|
-
borderRadius: 8
|
|
432
|
-
} : void 0,
|
|
433
|
-
onDragEnter: handleBodyDragEnter,
|
|
434
|
-
onDragLeave: handleBodyDragLeave,
|
|
435
|
-
onDragOver: handleBodyDragOver,
|
|
436
|
-
onDrop: handleBodyDrop,
|
|
437
|
-
children: entries.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
438
|
-
className: galleryDialogEmpty,
|
|
439
|
-
children: [
|
|
440
|
-
/* @__PURE__ */ jsx(ImageIcon, { size: 32 }),
|
|
441
|
-
/* @__PURE__ */ jsx("span", { children: "Add your first image or drop files here" }),
|
|
442
|
-
/* @__PURE__ */ jsxs("button", {
|
|
443
|
-
className: galleryAddBtn,
|
|
444
|
-
style: { maxWidth: 200 },
|
|
445
|
-
type: "button",
|
|
446
|
-
onClick: handleAddImage,
|
|
447
|
-
children: [/* @__PURE__ */ jsx(Plus, { size: 14 }), "Add Image"]
|
|
448
|
-
})
|
|
449
|
-
]
|
|
450
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
451
|
-
className: galleryImageList,
|
|
452
|
-
children: [/* @__PURE__ */ jsxs(DndContext, {
|
|
453
|
-
collisionDetection: closestCenter,
|
|
454
|
-
sensors,
|
|
455
|
-
onDragCancel: () => setDragActiveId(null),
|
|
456
|
-
onDragEnd: handleDragEnd,
|
|
457
|
-
onDragStart: (event) => {
|
|
458
|
-
setDragActiveId(String(event.active.id));
|
|
459
|
-
},
|
|
460
|
-
children: [/* @__PURE__ */ jsx(SortableContext, {
|
|
461
|
-
items: itemIds,
|
|
462
|
-
strategy: verticalListSortingStrategy,
|
|
463
|
-
children: entries.map((entry, index) => /* @__PURE__ */ jsx(SortableImageCard, {
|
|
464
|
-
id: entry.id,
|
|
465
|
-
image: entry.image,
|
|
466
|
-
index,
|
|
467
|
-
isLast: index === entries.length - 1,
|
|
468
|
-
lastInputRef: newInputRef,
|
|
469
|
-
onDropFile: replaceEntryFile,
|
|
470
|
-
onRemove: handleRemoveImage,
|
|
471
|
-
onUpdate: handleUpdateImage
|
|
472
|
-
}, entry.id))
|
|
473
|
-
}), typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
474
|
-
className: portalClassName,
|
|
475
|
-
children: /* @__PURE__ */ jsx(DragOverlay, {
|
|
476
|
-
dropAnimation: null,
|
|
477
|
-
children: dragActiveEntry ? /* @__PURE__ */ jsx(DragOverlayCard, { image: dragActiveEntry.image }) : null
|
|
478
|
-
})
|
|
479
|
-
}), document.body) : null]
|
|
480
|
-
}), /* @__PURE__ */ jsxs("button", {
|
|
481
|
-
className: galleryAddBtn,
|
|
482
|
-
type: "button",
|
|
483
|
-
onClick: handleAddImage,
|
|
484
|
-
children: [/* @__PURE__ */ jsx(Plus, { size: 14 }), "Add Image"]
|
|
485
|
-
})]
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ jsx(ModalShellFooter, {
|
|
553
|
+
dirty,
|
|
554
|
+
status: imageCountLabel(imageCount),
|
|
555
|
+
onCancel: handleCancel,
|
|
556
|
+
onSave: handleSave
|
|
486
557
|
})
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
className: galleryDialogFooter,
|
|
490
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
491
|
-
className: galleryFooterInfo,
|
|
492
|
-
children: `${entries.filter((e) => e.image.src.trim()).length} ${entries.filter((e) => e.image.src.trim()).length !== 1 ? "images" : "image"}`
|
|
493
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
494
|
-
className: galleryFooterActions,
|
|
495
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
496
|
-
className: galleryFooterBtnCancel,
|
|
497
|
-
type: "button",
|
|
498
|
-
onClick: dismiss,
|
|
499
|
-
children: "Cancel"
|
|
500
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
501
|
-
className: galleryFooterBtnSave,
|
|
502
|
-
type: "button",
|
|
503
|
-
onClick: handleSave,
|
|
504
|
-
children: "Save"
|
|
505
|
-
})]
|
|
506
|
-
})]
|
|
507
|
-
})
|
|
508
|
-
] });
|
|
558
|
+
]
|
|
559
|
+
});
|
|
509
560
|
};
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/GalleryEditRenderer.tsx
|
|
510
563
|
var GalleryEditRenderer = ({ aspect, fit, images, layout, maxItemHeight, onAspectChange, onFitChange, onImagesChange, onLayoutChange, onMaxItemHeightChange }) => {
|
|
511
564
|
const { className: portalClassName } = usePortalTheme();
|
|
512
565
|
const theme = useColorScheme();
|
|
@@ -514,8 +567,12 @@ var GalleryEditRenderer = ({ aspect, fit, images, layout, maxItemHeight, onAspec
|
|
|
514
567
|
const preprocess = useImagePreprocess();
|
|
515
568
|
const handleOpenEditor = useCallback(() => {
|
|
516
569
|
if (!onImagesChange || !onLayoutChange) return;
|
|
570
|
+
let dirty = false;
|
|
571
|
+
const setDirty = (next) => {
|
|
572
|
+
dirty = next;
|
|
573
|
+
};
|
|
517
574
|
presentDialog({
|
|
518
|
-
content: ({ dismiss }) => /* @__PURE__ */ jsx(
|
|
575
|
+
content: ({ dismiss, requestDismiss }) => /* @__PURE__ */ jsx(GalleryEditorDialog, {
|
|
519
576
|
dismiss,
|
|
520
577
|
initialAspect: aspect ?? "auto",
|
|
521
578
|
initialFit: fit ?? "cover",
|
|
@@ -523,8 +580,10 @@ var GalleryEditRenderer = ({ aspect, fit, images, layout, maxItemHeight, onAspec
|
|
|
523
580
|
initialLayout: layout,
|
|
524
581
|
initialMaxItemHeight: maxItemHeight,
|
|
525
582
|
preprocess,
|
|
583
|
+
requestDismiss,
|
|
526
584
|
uploader,
|
|
527
585
|
onAspectChange,
|
|
586
|
+
onDirtyChange: setDirty,
|
|
528
587
|
onFitChange,
|
|
529
588
|
onImagesChange,
|
|
530
589
|
onLayoutChange,
|
|
@@ -533,8 +592,10 @@ var GalleryEditRenderer = ({ aspect, fit, images, layout, maxItemHeight, onAspec
|
|
|
533
592
|
className: galleryDialogPopup,
|
|
534
593
|
portalClassName,
|
|
535
594
|
theme,
|
|
595
|
+
width: 896,
|
|
596
|
+
sheet: "auto",
|
|
536
597
|
showCloseButton: false,
|
|
537
|
-
|
|
598
|
+
confirmDismiss: () => !dirty || confirmDiscardChanges()
|
|
538
599
|
});
|
|
539
600
|
}, [
|
|
540
601
|
aspect,
|
|
@@ -559,36 +620,25 @@ var GalleryEditRenderer = ({ aspect, fit, images, layout, maxItemHeight, onAspec
|
|
|
559
620
|
layout,
|
|
560
621
|
maxItemHeight
|
|
561
622
|
});
|
|
562
|
-
|
|
623
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
563
624
|
className: galleryEditContainer,
|
|
564
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
625
|
+
children: [images.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
565
626
|
className: galleryEmptyState,
|
|
566
627
|
children: [/* @__PURE__ */ jsx(ImageIcon, { size: 32 }), /* @__PURE__ */ jsx("span", { children: "Empty gallery" })]
|
|
567
|
-
})
|
|
568
|
-
className: galleryEditOverlay,
|
|
569
|
-
type: "button",
|
|
570
|
-
onClick: handleOpenEditor,
|
|
571
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
572
|
-
className: galleryEditLabel,
|
|
573
|
-
children: [/* @__PURE__ */ jsx(Pencil, { size: 16 }), "Edit Gallery"]
|
|
574
|
-
})
|
|
575
|
-
})]
|
|
576
|
-
});
|
|
577
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
578
|
-
className: galleryEditContainer,
|
|
579
|
-
children: [/* @__PURE__ */ jsx(GalleryRenderer, {
|
|
628
|
+
}) : /* @__PURE__ */ jsx(GalleryRenderer, {
|
|
580
629
|
aspect,
|
|
581
630
|
fit,
|
|
582
631
|
images,
|
|
583
632
|
layout,
|
|
584
633
|
maxItemHeight
|
|
585
634
|
}), /* @__PURE__ */ jsx("button", {
|
|
635
|
+
"aria-label": "Edit gallery",
|
|
586
636
|
className: galleryEditOverlay,
|
|
587
637
|
type: "button",
|
|
588
638
|
onClick: handleOpenEditor,
|
|
589
639
|
children: /* @__PURE__ */ jsxs("span", {
|
|
590
640
|
className: galleryEditLabel,
|
|
591
|
-
children: [/* @__PURE__ */ jsx(Pencil, { size: 16 }), "Edit
|
|
641
|
+
children: [/* @__PURE__ */ jsx(Pencil, { size: 16 }), "Edit gallery"]
|
|
592
642
|
})
|
|
593
643
|
})]
|
|
594
644
|
});
|