@orion-studios/payload-studio 0.5.0-beta.113 → 0.5.0-beta.115
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/admin/client.js +1880 -502
- package/dist/admin/client.mjs +1164 -329
- package/dist/admin/index.d.mts +2 -1
- package/dist/admin/index.d.ts +2 -1
- package/dist/admin/index.js +267 -59
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/client.d.mts +1 -0
- package/dist/admin-app/client.d.ts +1 -0
- package/dist/admin-app/client.js +266 -105
- package/dist/admin-app/client.mjs +105 -456
- package/dist/admin-app/index.d.mts +2 -1
- package/dist/admin-app/index.d.ts +2 -1
- package/dist/admin-app/styles.css +351 -0
- package/dist/admin.css +9 -0
- package/dist/chunk-6NE7GIVT.mjs +555 -0
- package/dist/{chunk-DAIZDGHL.mjs → chunk-T5PBXPES.mjs} +267 -59
- package/dist/{chunk-3T2P6SDM.mjs → chunk-XKUTZ7IU.mjs} +215 -6
- package/dist/index-3jBpt6ZT.d.ts +385 -0
- package/dist/index-C3FgxbEL.d.mts +385 -0
- package/dist/{index-DUi_XND6.d.ts → index-Crx_MtPw.d.ts} +33 -3
- package/dist/{index-gLl_358v.d.mts → index-Cv-6qnrw.d.mts} +33 -3
- package/dist/{index-BzKOThsI.d.mts → index-DWmudwDm.d.mts} +1 -1
- package/dist/{index-BzKOThsI.d.ts → index-DWmudwDm.d.ts} +1 -1
- package/dist/{index-7lxTrxSG.d.mts → index-c5-qTRbH.d.mts} +7 -1
- package/dist/{index-7lxTrxSG.d.ts → index-yfpxsgUu.d.ts} +7 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +473 -65
- package/dist/index.mjs +6 -6
- package/dist/nextjs/index.mjs +2 -2
- package/dist/sitePreviewTypes-BECnq9xI.d.mts +41 -0
- package/dist/sitePreviewTypes-BECnq9xI.d.ts +41 -0
- package/dist/studio/index.d.mts +1 -1
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio-pages/index.d.mts +3 -3
- package/dist/studio-pages/index.d.ts +3 -3
- package/dist/studio-pages/index.js +330 -7
- package/dist/studio-pages/index.mjs +10 -3
- package/package.json +1 -1
- package/dist/index-B7QvY3yF.d.mts +0 -245
- package/dist/index-BK03FiEM.d.ts +0 -245
- package/dist/{chunk-BET2YLAS.mjs → chunk-OTHERBGX.mjs} +3 -3
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
HeaderNavEditorWithPreview,
|
|
4
|
+
HeaderNavItemsEditor,
|
|
5
|
+
SiteFooterPreview,
|
|
6
|
+
SiteHeaderPreview
|
|
7
|
+
} from "../chunk-6NE7GIVT.mjs";
|
|
2
8
|
import {
|
|
3
9
|
MAX_DIRECT_UPLOAD_BYTES,
|
|
4
10
|
optimizeImageForUpload
|
|
@@ -162,368 +168,9 @@ function AdminShellClient({
|
|
|
162
168
|
] });
|
|
163
169
|
}
|
|
164
170
|
|
|
165
|
-
// src/admin-app/components/HeaderNavItemsEditor.tsx
|
|
166
|
-
import { useEffect as useEffect2, useMemo, useState as useState2 } from "react";
|
|
167
|
-
|
|
168
|
-
// src/admin-app/navigationLinks.ts
|
|
169
|
-
var normalizeAdminNavInputs = (rows, pageOptions) => {
|
|
170
|
-
const allowedLinks = new Map(pageOptions.map((option) => [option.href, option.title]));
|
|
171
|
-
const deduped = [];
|
|
172
|
-
const seen = /* @__PURE__ */ new Set();
|
|
173
|
-
for (const row of rows) {
|
|
174
|
-
const href = typeof row.href === "string" ? row.href.trim() : "";
|
|
175
|
-
const defaultLabel = allowedLinks.get(href);
|
|
176
|
-
const explicitLabel = typeof row.label === "string" ? row.label.trim() : "";
|
|
177
|
-
const parentHref = typeof row.parentHref === "string" ? row.parentHref.trim() : "";
|
|
178
|
-
if (!href || !defaultLabel || seen.has(href)) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
seen.add(href);
|
|
182
|
-
deduped.push({
|
|
183
|
-
href,
|
|
184
|
-
label: explicitLabel.length > 0 ? explicitLabel : defaultLabel,
|
|
185
|
-
...parentHref.length > 0 ? { parentHref } : {}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
const hrefs = new Set(deduped.map((item) => item.href));
|
|
189
|
-
const parentByHref = new Map(deduped.map((item) => [item.href, item.parentHref || ""]));
|
|
190
|
-
const createsCycle = (href, parentHref) => {
|
|
191
|
-
const visited = /* @__PURE__ */ new Set([href]);
|
|
192
|
-
let current = parentHref;
|
|
193
|
-
while (current) {
|
|
194
|
-
if (visited.has(current)) {
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
visited.add(current);
|
|
198
|
-
current = parentByHref.get(current) || "";
|
|
199
|
-
}
|
|
200
|
-
return false;
|
|
201
|
-
};
|
|
202
|
-
return deduped.map((item) => {
|
|
203
|
-
const parentHref = item.parentHref;
|
|
204
|
-
if (!parentHref || parentHref === item.href || !hrefs.has(parentHref) || createsCycle(item.href, parentHref)) {
|
|
205
|
-
return {
|
|
206
|
-
href: item.href,
|
|
207
|
-
label: item.label
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
return item;
|
|
211
|
-
});
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// src/admin-app/components/HeaderNavItemsEditor.tsx
|
|
215
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
216
|
-
var toRow = (item, index) => ({
|
|
217
|
-
id: `row-${index}-${item.href || "empty"}`,
|
|
218
|
-
href: item.href || "",
|
|
219
|
-
label: item.label || "",
|
|
220
|
-
parentHref: item.parentHref || ""
|
|
221
|
-
});
|
|
222
|
-
var moveRow = (rows, fromIndex, toIndex) => {
|
|
223
|
-
if (fromIndex === toIndex || fromIndex < 0 || toIndex < 0 || fromIndex >= rows.length || toIndex >= rows.length) {
|
|
224
|
-
return rows;
|
|
225
|
-
}
|
|
226
|
-
const next = [...rows];
|
|
227
|
-
const [moved] = next.splice(fromIndex, 1);
|
|
228
|
-
if (!moved) {
|
|
229
|
-
return rows;
|
|
230
|
-
}
|
|
231
|
-
next.splice(toIndex, 0, moved);
|
|
232
|
-
return next;
|
|
233
|
-
};
|
|
234
|
-
function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
|
|
235
|
-
const [rows, setRows] = useState2(() => initialItems.map(toRow));
|
|
236
|
-
const [nextRowID, setNextRowID] = useState2(initialItems.length);
|
|
237
|
-
const [draggingRowID, setDraggingRowID] = useState2(null);
|
|
238
|
-
const [dragOverRowID, setDragOverRowID] = useState2(null);
|
|
239
|
-
const pageOptionByHref = useMemo(() => new Map(pageOptions.map((option) => [option.href, option])), [pageOptions]);
|
|
240
|
-
const serializedState = useMemo(
|
|
241
|
-
() => JSON.stringify(
|
|
242
|
-
rows.map((row) => ({
|
|
243
|
-
href: row.href.trim(),
|
|
244
|
-
label: row.label.trim(),
|
|
245
|
-
parentHref: row.parentHref.trim() || void 0
|
|
246
|
-
}))
|
|
247
|
-
),
|
|
248
|
-
[rows]
|
|
249
|
-
);
|
|
250
|
-
const normalizedItems = useMemo(() => {
|
|
251
|
-
const inputs = rows.map((row) => ({
|
|
252
|
-
href: row.href,
|
|
253
|
-
label: row.label,
|
|
254
|
-
parentHref: row.parentHref
|
|
255
|
-
}));
|
|
256
|
-
return normalizeAdminNavInputs(inputs, pageOptions);
|
|
257
|
-
}, [rows, pageOptions]);
|
|
258
|
-
useEffect2(() => {
|
|
259
|
-
onItemsChange?.(normalizedItems);
|
|
260
|
-
}, [normalizedItems, onItemsChange]);
|
|
261
|
-
const setRowValue = (rowID, changes) => {
|
|
262
|
-
setRows(
|
|
263
|
-
(currentRows) => currentRows.map((row) => {
|
|
264
|
-
if (row.id !== rowID) {
|
|
265
|
-
return row;
|
|
266
|
-
}
|
|
267
|
-
const nextRow = { ...row, ...changes };
|
|
268
|
-
if (nextRow.parentHref === nextRow.href) {
|
|
269
|
-
nextRow.parentHref = "";
|
|
270
|
-
}
|
|
271
|
-
return nextRow;
|
|
272
|
-
})
|
|
273
|
-
);
|
|
274
|
-
};
|
|
275
|
-
const removeRow = (rowID) => {
|
|
276
|
-
setRows((currentRows) => {
|
|
277
|
-
const removedRow = currentRows.find((candidate) => candidate.id === rowID);
|
|
278
|
-
const removedHref = removedRow?.href || "";
|
|
279
|
-
return currentRows.filter((row) => row.id !== rowID).map((row) => removedHref && row.parentHref === removedHref ? { ...row, parentHref: "" } : row);
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
const addRow = () => {
|
|
283
|
-
setRows((currentRows) => [
|
|
284
|
-
...currentRows,
|
|
285
|
-
{
|
|
286
|
-
id: `row-new-${nextRowID}`,
|
|
287
|
-
href: "",
|
|
288
|
-
label: "",
|
|
289
|
-
parentHref: ""
|
|
290
|
-
}
|
|
291
|
-
]);
|
|
292
|
-
setNextRowID((current) => current + 1);
|
|
293
|
-
};
|
|
294
|
-
return /* @__PURE__ */ jsxs2("div", { className: "orion-admin-nav-editor", children: [
|
|
295
|
-
/* @__PURE__ */ jsx2("input", { name: "navItemsState", readOnly: true, type: "hidden", value: serializedState }),
|
|
296
|
-
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-nav-editor-head", children: [
|
|
297
|
-
/* @__PURE__ */ jsx2("div", { className: "orion-admin-nav-editor-title", children: "Navigation Items" }),
|
|
298
|
-
/* @__PURE__ */ jsx2("button", { className: "orion-admin-nav-editor-add", onClick: addRow, type: "button", children: "Add Item" })
|
|
299
|
-
] }),
|
|
300
|
-
/* @__PURE__ */ jsx2("div", { className: "orion-admin-nav-editor-help", children: "Add only links you want in the menu. Drag rows to reorder. Set a parent to create dropdown items." }),
|
|
301
|
-
rows.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "orion-admin-nav-editor-empty", children: 'No navigation items yet. Click "Add Item" to start.' }) : null,
|
|
302
|
-
/* @__PURE__ */ jsx2("div", { className: "orion-admin-nav-editor-list", children: rows.map((row, rowIndex) => {
|
|
303
|
-
const parentCandidates = rows.filter((candidate) => candidate.id !== row.id && candidate.href.trim().length > 0).map((candidate) => {
|
|
304
|
-
const resolved = pageOptionByHref.get(candidate.href);
|
|
305
|
-
return {
|
|
306
|
-
href: candidate.href,
|
|
307
|
-
label: candidate.label.trim() || resolved?.title || candidate.href
|
|
308
|
-
};
|
|
309
|
-
});
|
|
310
|
-
const selectedPage = pageOptionByHref.get(row.href);
|
|
311
|
-
const labelPlaceholder = selectedPage?.title || "Navigation Label";
|
|
312
|
-
return /* @__PURE__ */ jsxs2(
|
|
313
|
-
"div",
|
|
314
|
-
{
|
|
315
|
-
className: `orion-admin-nav-editor-row${draggingRowID === row.id ? " is-dragging" : ""}${dragOverRowID === row.id && draggingRowID !== row.id ? " is-drop-target" : ""}`,
|
|
316
|
-
draggable: true,
|
|
317
|
-
onDragEnd: () => {
|
|
318
|
-
setDraggingRowID(null);
|
|
319
|
-
setDragOverRowID(null);
|
|
320
|
-
},
|
|
321
|
-
onDragEnter: () => {
|
|
322
|
-
if (draggingRowID && draggingRowID !== row.id) {
|
|
323
|
-
setDragOverRowID(row.id);
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
onDragLeave: () => {
|
|
327
|
-
if (dragOverRowID === row.id) {
|
|
328
|
-
setDragOverRowID(null);
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
onDragOver: (event) => {
|
|
332
|
-
event.preventDefault();
|
|
333
|
-
if (draggingRowID && draggingRowID !== row.id && dragOverRowID !== row.id) {
|
|
334
|
-
setDragOverRowID(row.id);
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
onDragStart: (event) => {
|
|
338
|
-
setDraggingRowID(row.id);
|
|
339
|
-
event.dataTransfer.effectAllowed = "move";
|
|
340
|
-
},
|
|
341
|
-
onDrop: (event) => {
|
|
342
|
-
event.preventDefault();
|
|
343
|
-
if (!draggingRowID || draggingRowID === row.id) {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
setRows((currentRows) => {
|
|
347
|
-
const fromIndex = currentRows.findIndex((entry) => entry.id === draggingRowID);
|
|
348
|
-
const toIndex = currentRows.findIndex((entry) => entry.id === row.id);
|
|
349
|
-
return moveRow(currentRows, fromIndex, toIndex);
|
|
350
|
-
});
|
|
351
|
-
setDraggingRowID(null);
|
|
352
|
-
setDragOverRowID(null);
|
|
353
|
-
},
|
|
354
|
-
children: [
|
|
355
|
-
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-nav-editor-row-head", children: [
|
|
356
|
-
/* @__PURE__ */ jsx2("span", { className: "orion-admin-nav-editor-drag", children: "Drag" }),
|
|
357
|
-
/* @__PURE__ */ jsxs2("span", { className: "orion-admin-nav-editor-row-index", children: [
|
|
358
|
-
"#",
|
|
359
|
-
rowIndex + 1
|
|
360
|
-
] }),
|
|
361
|
-
/* @__PURE__ */ jsx2("button", { className: "orion-admin-nav-editor-remove", onClick: () => removeRow(row.id), type: "button", children: "Remove" })
|
|
362
|
-
] }),
|
|
363
|
-
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-nav-editor-row-grid", children: [
|
|
364
|
-
/* @__PURE__ */ jsxs2("label", { children: [
|
|
365
|
-
"Label",
|
|
366
|
-
/* @__PURE__ */ jsx2(
|
|
367
|
-
"input",
|
|
368
|
-
{
|
|
369
|
-
name: `navLabel_${rowIndex}`,
|
|
370
|
-
onChange: (event) => setRowValue(row.id, { label: event.target.value }),
|
|
371
|
-
placeholder: labelPlaceholder,
|
|
372
|
-
type: "text",
|
|
373
|
-
value: row.label
|
|
374
|
-
}
|
|
375
|
-
)
|
|
376
|
-
] }),
|
|
377
|
-
/* @__PURE__ */ jsxs2("label", { children: [
|
|
378
|
-
"Page",
|
|
379
|
-
/* @__PURE__ */ jsxs2(
|
|
380
|
-
"select",
|
|
381
|
-
{
|
|
382
|
-
name: `navPage_${rowIndex}`,
|
|
383
|
-
onChange: (event) => {
|
|
384
|
-
const nextHref = event.target.value;
|
|
385
|
-
const nextParent = row.parentHref && row.parentHref === nextHref ? "" : row.parentHref;
|
|
386
|
-
setRowValue(row.id, { href: nextHref, parentHref: nextParent });
|
|
387
|
-
},
|
|
388
|
-
value: row.href,
|
|
389
|
-
children: [
|
|
390
|
-
/* @__PURE__ */ jsx2("option", { value: "", children: "Select page..." }),
|
|
391
|
-
pageOptions.map((pageOption) => /* @__PURE__ */ jsx2("option", { value: pageOption.href, children: pageOption.label }, `${pageOption.href}-${pageOption.title}`))
|
|
392
|
-
]
|
|
393
|
-
}
|
|
394
|
-
)
|
|
395
|
-
] }),
|
|
396
|
-
/* @__PURE__ */ jsxs2("label", { children: [
|
|
397
|
-
"Parent (dropdown under)",
|
|
398
|
-
/* @__PURE__ */ jsxs2(
|
|
399
|
-
"select",
|
|
400
|
-
{
|
|
401
|
-
name: `navParentHref_${rowIndex}`,
|
|
402
|
-
onChange: (event) => setRowValue(row.id, { parentHref: event.target.value }),
|
|
403
|
-
value: row.parentHref,
|
|
404
|
-
children: [
|
|
405
|
-
/* @__PURE__ */ jsx2("option", { value: "", children: "Top-level item" }),
|
|
406
|
-
parentCandidates.map((candidate) => /* @__PURE__ */ jsx2("option", { value: candidate.href, children: candidate.label }, `${row.id}-parent-${candidate.href}`))
|
|
407
|
-
]
|
|
408
|
-
}
|
|
409
|
-
)
|
|
410
|
-
] })
|
|
411
|
-
] })
|
|
412
|
-
]
|
|
413
|
-
},
|
|
414
|
-
row.id
|
|
415
|
-
);
|
|
416
|
-
}) })
|
|
417
|
-
] });
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
// src/admin-app/components/HeaderNavEditorWithPreview.tsx
|
|
421
|
-
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
422
|
-
|
|
423
|
-
// src/admin-app/nestedNavigation.ts
|
|
424
|
-
var normalizeNestedNavItems = (items) => {
|
|
425
|
-
const deduped = [];
|
|
426
|
-
const seen = /* @__PURE__ */ new Set();
|
|
427
|
-
for (const item of items) {
|
|
428
|
-
const href = typeof item.href === "string" ? item.href.trim() : "";
|
|
429
|
-
const label = typeof item.label === "string" ? item.label.trim() : "";
|
|
430
|
-
const parentHref = typeof item.parentHref === "string" ? item.parentHref.trim() : "";
|
|
431
|
-
if (!href || !label || seen.has(href)) {
|
|
432
|
-
continue;
|
|
433
|
-
}
|
|
434
|
-
seen.add(href);
|
|
435
|
-
deduped.push({
|
|
436
|
-
href,
|
|
437
|
-
label,
|
|
438
|
-
...parentHref ? { parentHref } : {}
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
const hrefs = new Set(deduped.map((item) => item.href));
|
|
442
|
-
return deduped.map((item) => ({
|
|
443
|
-
href: item.href,
|
|
444
|
-
label: item.label,
|
|
445
|
-
...item.parentHref && item.parentHref !== item.href && hrefs.has(item.parentHref) ? { parentHref: item.parentHref } : {}
|
|
446
|
-
}));
|
|
447
|
-
};
|
|
448
|
-
var buildNestedNavTree = (items) => {
|
|
449
|
-
const childrenByParent = /* @__PURE__ */ new Map();
|
|
450
|
-
const topLevel = [];
|
|
451
|
-
for (const item of items) {
|
|
452
|
-
if (!item.parentHref) {
|
|
453
|
-
topLevel.push(item);
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
const children = childrenByParent.get(item.parentHref) || [];
|
|
457
|
-
children.push(item);
|
|
458
|
-
childrenByParent.set(item.parentHref, children);
|
|
459
|
-
}
|
|
460
|
-
if (topLevel.length === 0 && items.length > 0) {
|
|
461
|
-
return {
|
|
462
|
-
topLevel: items.map((item) => ({ href: item.href, label: item.label })),
|
|
463
|
-
childrenByParent: /* @__PURE__ */ new Map()
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
return { childrenByParent, topLevel };
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
// src/admin-app/components/HeaderNavEditorWithPreview.tsx
|
|
470
|
-
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
471
|
-
var fallbackNav = [{ href: "/", label: "Home" }];
|
|
472
|
-
function HeaderNavEditorWithPreview({
|
|
473
|
-
brandName,
|
|
474
|
-
initialItems,
|
|
475
|
-
logoUrl,
|
|
476
|
-
pageOptions,
|
|
477
|
-
tagline = ""
|
|
478
|
-
}) {
|
|
479
|
-
const [liveItems, setLiveItems] = useState3(initialItems);
|
|
480
|
-
const previewItems = useMemo2(() => {
|
|
481
|
-
const normalized = normalizeNestedNavItems(liveItems);
|
|
482
|
-
const tree = buildNestedNavTree(normalized);
|
|
483
|
-
return tree.topLevel.length > 0 ? tree : buildNestedNavTree(fallbackNav);
|
|
484
|
-
}, [liveItems]);
|
|
485
|
-
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
486
|
-
/* @__PURE__ */ jsx3(HeaderNavItemsEditor, { initialItems, onItemsChange: setLiveItems, pageOptions }),
|
|
487
|
-
/* @__PURE__ */ jsx3("div", { style: { color: "#5d6664", fontSize: "0.88rem", fontWeight: 700 }, children: "Header Preview" }),
|
|
488
|
-
/* @__PURE__ */ jsx3(
|
|
489
|
-
"div",
|
|
490
|
-
{
|
|
491
|
-
style: {
|
|
492
|
-
border: "1px solid #dce2e0",
|
|
493
|
-
borderRadius: 14,
|
|
494
|
-
overflow: "hidden"
|
|
495
|
-
},
|
|
496
|
-
children: /* @__PURE__ */ jsx3("header", { className: "site-header", style: { position: "relative", top: "auto" }, children: /* @__PURE__ */ jsxs3("div", { className: "container container-content header-wrap", children: [
|
|
497
|
-
/* @__PURE__ */ jsxs3("a", { className: "brand", href: "#", children: [
|
|
498
|
-
logoUrl ? /* @__PURE__ */ jsx3("img", { alt: `${brandName} logo`, src: logoUrl }) : null,
|
|
499
|
-
/* @__PURE__ */ jsxs3("div", { children: [
|
|
500
|
-
/* @__PURE__ */ jsx3("div", { className: "brand-title", children: brandName }),
|
|
501
|
-
tagline ? /* @__PURE__ */ jsx3("div", { className: "brand-subtitle", children: tagline }) : null
|
|
502
|
-
] })
|
|
503
|
-
] }),
|
|
504
|
-
/* @__PURE__ */ jsx3("nav", { className: "site-nav open", children: previewItems.topLevel.map((item, index) => {
|
|
505
|
-
const children = previewItems.childrenByParent.get(item.href) || [];
|
|
506
|
-
return /* @__PURE__ */ jsxs3(
|
|
507
|
-
"div",
|
|
508
|
-
{
|
|
509
|
-
className: children.length > 0 ? "site-nav-item has-children" : "site-nav-item",
|
|
510
|
-
children: [
|
|
511
|
-
/* @__PURE__ */ jsx3("a", { className: index === 0 ? "active" : "", href: item.href, children: item.label }),
|
|
512
|
-
children.length > 0 ? /* @__PURE__ */ jsx3("div", { className: "site-subnav", children: children.map((child) => /* @__PURE__ */ jsx3("a", { href: child.href, children: child.label }, `${item.href}-${child.href}`)) }) : null
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
`${item.href}-${index}`
|
|
516
|
-
);
|
|
517
|
-
}) })
|
|
518
|
-
] }) })
|
|
519
|
-
}
|
|
520
|
-
)
|
|
521
|
-
] });
|
|
522
|
-
}
|
|
523
|
-
|
|
524
171
|
// src/admin-app/components/MediaDetailPanel.tsx
|
|
525
|
-
import { useState as
|
|
526
|
-
import { jsx as
|
|
172
|
+
import { useState as useState2 } from "react";
|
|
173
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
527
174
|
function formatFileSize(bytes) {
|
|
528
175
|
if (bytes < 1024) return `${bytes} B`;
|
|
529
176
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -542,8 +189,8 @@ function MediaDetailPanel({
|
|
|
542
189
|
updateAction,
|
|
543
190
|
deleteAction
|
|
544
191
|
}) {
|
|
545
|
-
const [copied, setCopied] =
|
|
546
|
-
const [confirmDelete, setConfirmDelete] =
|
|
192
|
+
const [copied, setCopied] = useState2(false);
|
|
193
|
+
const [confirmDelete, setConfirmDelete] = useState2(false);
|
|
547
194
|
const copyUrl = async () => {
|
|
548
195
|
if (!url) return;
|
|
549
196
|
try {
|
|
@@ -573,10 +220,10 @@ function MediaDetailPanel({
|
|
|
573
220
|
metaRows.push({ label: "Uploaded", value: createdAt });
|
|
574
221
|
}
|
|
575
222
|
}
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
url ? /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ jsxs2("div", { className: "orion-admin-grid", style: { alignItems: "start" }, children: [
|
|
224
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
225
|
+
/* @__PURE__ */ jsx2("div", { className: "orion-admin-card", children: url ? /* @__PURE__ */ jsx2("img", { alt: alt || filename || "Media", src: url, style: { borderRadius: 12, width: "100%" } }) : /* @__PURE__ */ jsx2("span", { children: "No preview available." }) }),
|
|
226
|
+
url ? /* @__PURE__ */ jsx2(
|
|
580
227
|
"button",
|
|
581
228
|
{
|
|
582
229
|
className: "orion-admin-action-button",
|
|
@@ -587,28 +234,28 @@ function MediaDetailPanel({
|
|
|
587
234
|
}
|
|
588
235
|
) : null
|
|
589
236
|
] }),
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
metaRows.length > 0 ? /* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "grid", gap: "0.8rem" }, children: [
|
|
238
|
+
metaRows.length > 0 ? /* @__PURE__ */ jsx2("div", { className: "orion-admin-card orion-admin-meta-table", children: metaRows.map((row) => /* @__PURE__ */ jsxs2("div", { className: "orion-admin-meta-row", children: [
|
|
239
|
+
/* @__PURE__ */ jsx2("span", { className: "orion-admin-meta-label", children: row.label }),
|
|
240
|
+
/* @__PURE__ */ jsx2("span", { className: "orion-admin-meta-value", children: row.value })
|
|
594
241
|
] }, row.label)) }) : null,
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ jsxs2("form", { action: updateAction, className: "orion-admin-form", children: [
|
|
243
|
+
/* @__PURE__ */ jsx2("input", { name: "id", type: "hidden", value: id }),
|
|
244
|
+
/* @__PURE__ */ jsxs2("label", { children: [
|
|
598
245
|
"Alt text",
|
|
599
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ jsx2("input", { defaultValue: alt || "", name: "alt", required: true, type: "text" })
|
|
600
247
|
] }),
|
|
601
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ jsx2("button", { type: "submit", children: "Save" })
|
|
602
249
|
] }),
|
|
603
|
-
confirmDelete ? /* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
250
|
+
confirmDelete ? /* @__PURE__ */ jsxs2("div", { className: "orion-admin-form", style: { borderColor: "#b42318" }, children: [
|
|
251
|
+
/* @__PURE__ */ jsx2("p", { style: { fontWeight: 700, margin: 0 }, children: "Are you sure you want to delete this asset?" }),
|
|
252
|
+
/* @__PURE__ */ jsx2("p", { style: { color: "var(--orion-admin-muted)", fontSize: "0.9rem", margin: 0 }, children: "This action cannot be undone." }),
|
|
253
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", gap: "0.5rem" }, children: [
|
|
254
|
+
/* @__PURE__ */ jsxs2("form", { action: deleteAction, style: { flex: 1 }, children: [
|
|
255
|
+
/* @__PURE__ */ jsx2("input", { name: "id", type: "hidden", value: id }),
|
|
256
|
+
/* @__PURE__ */ jsx2("button", { style: { background: "#b42318", border: 0, borderRadius: 10, color: "#fff", cursor: "pointer", fontWeight: 800, padding: "0.55rem 0.8rem", width: "100%" }, type: "submit", children: "Yes, Delete" })
|
|
610
257
|
] }),
|
|
611
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ jsx2(
|
|
612
259
|
"button",
|
|
613
260
|
{
|
|
614
261
|
onClick: () => setConfirmDelete(false),
|
|
@@ -618,7 +265,7 @@ function MediaDetailPanel({
|
|
|
618
265
|
}
|
|
619
266
|
)
|
|
620
267
|
] })
|
|
621
|
-
] }) : /* @__PURE__ */
|
|
268
|
+
] }) : /* @__PURE__ */ jsx2(
|
|
622
269
|
"button",
|
|
623
270
|
{
|
|
624
271
|
className: "orion-admin-action-button",
|
|
@@ -633,7 +280,7 @@ function MediaDetailPanel({
|
|
|
633
280
|
}
|
|
634
281
|
|
|
635
282
|
// src/admin-app/components/MediaListItem.tsx
|
|
636
|
-
import { jsx as
|
|
283
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
637
284
|
function formatFileSize2(bytes) {
|
|
638
285
|
if (bytes < 1024) return `${bytes} B`;
|
|
639
286
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -656,23 +303,23 @@ function MediaListItem({
|
|
|
656
303
|
if (typeof filesize === "number") metaParts.push(formatFileSize2(filesize));
|
|
657
304
|
if (typeof width === "number" && typeof height === "number") metaParts.push(`${width}\xD7${height}`);
|
|
658
305
|
if (typeof mimeType === "string") metaParts.push(mimeType);
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
url ? /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
metaParts.length > 0 ? /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsxs3("a", { className: "orion-admin-list-item", href, children: [
|
|
307
|
+
/* @__PURE__ */ jsxs3("div", { style: { alignItems: "center", display: "flex", gap: "0.8rem" }, children: [
|
|
308
|
+
url ? /* @__PURE__ */ jsx3("img", { alt: altText || label, className: "orion-admin-media-preview", src: url }) : null,
|
|
309
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
310
|
+
/* @__PURE__ */ jsx3("strong", { children: label }),
|
|
311
|
+
/* @__PURE__ */ jsx3("div", { className: "orion-admin-list-meta", children: altText || "No alt text" }),
|
|
312
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx3("div", { className: "orion-admin-list-meta", style: { marginTop: "0.15rem" }, children: metaParts.join(" \xB7 ") }) : null
|
|
666
313
|
] })
|
|
667
314
|
] }),
|
|
668
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ jsx3("span", { className: "orion-admin-list-meta", children: "Edit" })
|
|
669
316
|
] });
|
|
670
317
|
}
|
|
671
318
|
|
|
672
319
|
// src/admin-app/components/MediaUploadForm.tsx
|
|
673
|
-
import { useState as
|
|
320
|
+
import { useState as useState3, useRef, useCallback } from "react";
|
|
674
321
|
import { useRouter } from "next/navigation";
|
|
675
|
-
import { jsx as
|
|
322
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
676
323
|
var MEDIA_LIBRARY_SYNC_EVENT = "orion-media-library-updated";
|
|
677
324
|
var notifyMediaLibraryUpdated = () => {
|
|
678
325
|
if (typeof window === "undefined") {
|
|
@@ -713,12 +360,12 @@ var parseUploadError = async (response) => {
|
|
|
713
360
|
function MediaUploadForm() {
|
|
714
361
|
const router = useRouter();
|
|
715
362
|
const fileInputRef = useRef(null);
|
|
716
|
-
const [alt, setAlt] =
|
|
717
|
-
const [file, setFile] =
|
|
718
|
-
const [preview, setPreview] =
|
|
719
|
-
const [dragging, setDragging] =
|
|
720
|
-
const [submitting, setSubmitting] =
|
|
721
|
-
const [error, setError] =
|
|
363
|
+
const [alt, setAlt] = useState3("");
|
|
364
|
+
const [file, setFile] = useState3(null);
|
|
365
|
+
const [preview, setPreview] = useState3(null);
|
|
366
|
+
const [dragging, setDragging] = useState3(false);
|
|
367
|
+
const [submitting, setSubmitting] = useState3(false);
|
|
368
|
+
const [error, setError] = useState3(null);
|
|
722
369
|
const handleFile = useCallback((selectedFile) => {
|
|
723
370
|
setFile(selectedFile);
|
|
724
371
|
if (preview) {
|
|
@@ -786,10 +433,10 @@ function MediaUploadForm() {
|
|
|
786
433
|
setSubmitting(false);
|
|
787
434
|
}
|
|
788
435
|
};
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ jsxs4("form", { className: "orion-admin-upload-form", onSubmit: upload, children: [
|
|
437
|
+
/* @__PURE__ */ jsxs4("label", { children: [
|
|
791
438
|
"Alt text",
|
|
792
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ jsx4(
|
|
793
440
|
"input",
|
|
794
441
|
{
|
|
795
442
|
onChange: (event) => setAlt(event.target.value),
|
|
@@ -799,7 +446,7 @@ function MediaUploadForm() {
|
|
|
799
446
|
}
|
|
800
447
|
)
|
|
801
448
|
] }),
|
|
802
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ jsxs4(
|
|
803
450
|
"div",
|
|
804
451
|
{
|
|
805
452
|
className: `orion-admin-dropzone${dragging ? " is-dragging" : ""}${file ? " has-file" : ""}`,
|
|
@@ -808,14 +455,14 @@ function MediaUploadForm() {
|
|
|
808
455
|
onDragOver,
|
|
809
456
|
onDrop,
|
|
810
457
|
children: [
|
|
811
|
-
preview ? /* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
] }) : /* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
458
|
+
preview ? /* @__PURE__ */ jsxs4("div", { className: "orion-admin-dropzone-preview", children: [
|
|
459
|
+
/* @__PURE__ */ jsx4("img", { alt: "Upload preview", src: preview }),
|
|
460
|
+
/* @__PURE__ */ jsx4("span", { children: file?.name })
|
|
461
|
+
] }) : /* @__PURE__ */ jsxs4("div", { className: "orion-admin-dropzone-label", children: [
|
|
462
|
+
/* @__PURE__ */ jsx4("strong", { children: "Drop an image here" }),
|
|
463
|
+
/* @__PURE__ */ jsx4("span", { children: "or click to browse" })
|
|
817
464
|
] }),
|
|
818
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ jsx4(
|
|
819
466
|
"input",
|
|
820
467
|
{
|
|
821
468
|
accept: "image/*",
|
|
@@ -828,14 +475,14 @@ function MediaUploadForm() {
|
|
|
828
475
|
]
|
|
829
476
|
}
|
|
830
477
|
),
|
|
831
|
-
error ? /* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
478
|
+
error ? /* @__PURE__ */ jsx4("div", { className: "orion-admin-upload-error", children: error }) : null,
|
|
479
|
+
/* @__PURE__ */ jsx4("button", { disabled: submitting, type: "submit", children: submitting ? "Uploading..." : "Upload" })
|
|
833
480
|
] });
|
|
834
481
|
}
|
|
835
482
|
|
|
836
483
|
// src/admin-app/components/PageEditorFrame.tsx
|
|
837
|
-
import { useEffect as
|
|
838
|
-
import { jsx as
|
|
484
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
485
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
839
486
|
var extractPageIDFromBuilderSrc = (value) => {
|
|
840
487
|
if (!value || typeof value !== "string") {
|
|
841
488
|
return null;
|
|
@@ -851,17 +498,17 @@ var extractPageIDFromBuilderSrc = (value) => {
|
|
|
851
498
|
function PageEditorFrame({ src }) {
|
|
852
499
|
const iframeRef = useRef2(null);
|
|
853
500
|
const dirtyCheckTimerRef = useRef2(null);
|
|
854
|
-
const [saving, setSaving] =
|
|
855
|
-
const [message, setMessage] =
|
|
856
|
-
const [error, setError] =
|
|
857
|
-
const [hasUnsavedChanges, setHasUnsavedChanges] =
|
|
858
|
-
const [awaitingDirtyCheck, setAwaitingDirtyCheck] =
|
|
859
|
-
const [pendingNavigationURL, setPendingNavigationURL] =
|
|
860
|
-
const [showUnsavedDialog, setShowUnsavedDialog] =
|
|
861
|
-
const [canUndo, setCanUndo] =
|
|
862
|
-
const [canRedo, setCanRedo] =
|
|
863
|
-
const [sessionExpired, setSessionExpired] =
|
|
864
|
-
const [hasUnpublishedChanges, setHasUnpublishedChanges] =
|
|
501
|
+
const [saving, setSaving] = useState4(null);
|
|
502
|
+
const [message, setMessage] = useState4("");
|
|
503
|
+
const [error, setError] = useState4("");
|
|
504
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = useState4(false);
|
|
505
|
+
const [awaitingDirtyCheck, setAwaitingDirtyCheck] = useState4(false);
|
|
506
|
+
const [pendingNavigationURL, setPendingNavigationURL] = useState4(null);
|
|
507
|
+
const [showUnsavedDialog, setShowUnsavedDialog] = useState4(false);
|
|
508
|
+
const [canUndo, setCanUndo] = useState4(false);
|
|
509
|
+
const [canRedo, setCanRedo] = useState4(false);
|
|
510
|
+
const [sessionExpired, setSessionExpired] = useState4(false);
|
|
511
|
+
const [hasUnpublishedChanges, setHasUnpublishedChanges] = useState4(false);
|
|
865
512
|
const pageID = extractPageIDFromBuilderSrc(src);
|
|
866
513
|
const refreshUnpublishedChanges = async () => {
|
|
867
514
|
if (!pageID) {
|
|
@@ -942,7 +589,7 @@ function PageEditorFrame({ src }) {
|
|
|
942
589
|
"*"
|
|
943
590
|
);
|
|
944
591
|
};
|
|
945
|
-
|
|
592
|
+
useEffect2(() => {
|
|
946
593
|
const onMessage = (event) => {
|
|
947
594
|
const data = event.data;
|
|
948
595
|
if (!data || data.source !== "payload-visual-builder-child") {
|
|
@@ -994,10 +641,10 @@ function PageEditorFrame({ src }) {
|
|
|
994
641
|
window.addEventListener("message", onMessage);
|
|
995
642
|
return () => window.removeEventListener("message", onMessage);
|
|
996
643
|
}, [awaitingDirtyCheck, pendingNavigationURL]);
|
|
997
|
-
|
|
644
|
+
useEffect2(() => {
|
|
998
645
|
void refreshUnpublishedChanges();
|
|
999
646
|
}, [pageID]);
|
|
1000
|
-
|
|
647
|
+
useEffect2(() => {
|
|
1001
648
|
const onDocumentClick = (event) => {
|
|
1002
649
|
if (!hasUnsavedChanges) {
|
|
1003
650
|
return;
|
|
@@ -1060,7 +707,7 @@ function PageEditorFrame({ src }) {
|
|
|
1060
707
|
document.addEventListener("click", onDocumentClick, true);
|
|
1061
708
|
return () => document.removeEventListener("click", onDocumentClick, true);
|
|
1062
709
|
}, [hasUnsavedChanges]);
|
|
1063
|
-
|
|
710
|
+
useEffect2(() => {
|
|
1064
711
|
if (!hasUnsavedChanges) {
|
|
1065
712
|
return;
|
|
1066
713
|
}
|
|
@@ -1071,14 +718,14 @@ function PageEditorFrame({ src }) {
|
|
|
1071
718
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
1072
719
|
return () => window.removeEventListener("beforeunload", onBeforeUnload);
|
|
1073
720
|
}, [hasUnsavedChanges]);
|
|
1074
|
-
|
|
721
|
+
useEffect2(
|
|
1075
722
|
() => () => {
|
|
1076
723
|
clearDirtyCheckTimer();
|
|
1077
724
|
},
|
|
1078
725
|
[]
|
|
1079
726
|
);
|
|
1080
|
-
return /* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsxs5("div", { style: { display: "grid", gap: "0.8rem" }, children: [
|
|
728
|
+
/* @__PURE__ */ jsxs5(
|
|
1082
729
|
"div",
|
|
1083
730
|
{
|
|
1084
731
|
style: {
|
|
@@ -1093,9 +740,9 @@ function PageEditorFrame({ src }) {
|
|
|
1093
740
|
padding: "0.7rem 0.8rem"
|
|
1094
741
|
},
|
|
1095
742
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsxs5("div", { style: { display: "grid", gap: "0.2rem" }, children: [
|
|
744
|
+
/* @__PURE__ */ jsx5("div", { style: { color: "var(--orion-admin-muted)", fontSize: "0.9rem" }, children: "Save changes to update the page layout and content." }),
|
|
745
|
+
/* @__PURE__ */ jsx5(
|
|
1099
746
|
"div",
|
|
1100
747
|
{
|
|
1101
748
|
style: {
|
|
@@ -1115,8 +762,8 @@ function PageEditorFrame({ src }) {
|
|
|
1115
762
|
}
|
|
1116
763
|
)
|
|
1117
764
|
] }),
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ jsxs5("div", { style: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
|
|
766
|
+
/* @__PURE__ */ jsx5(
|
|
1120
767
|
"button",
|
|
1121
768
|
{
|
|
1122
769
|
className: "orion-admin-action-button",
|
|
@@ -1127,7 +774,7 @@ function PageEditorFrame({ src }) {
|
|
|
1127
774
|
children: "Undo"
|
|
1128
775
|
}
|
|
1129
776
|
),
|
|
1130
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ jsx5(
|
|
1131
778
|
"button",
|
|
1132
779
|
{
|
|
1133
780
|
className: "orion-admin-action-button",
|
|
@@ -1138,7 +785,7 @@ function PageEditorFrame({ src }) {
|
|
|
1138
785
|
children: "Redo"
|
|
1139
786
|
}
|
|
1140
787
|
),
|
|
1141
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ jsx5(
|
|
1142
789
|
"button",
|
|
1143
790
|
{
|
|
1144
791
|
className: "orion-admin-action-button",
|
|
@@ -1148,7 +795,7 @@ function PageEditorFrame({ src }) {
|
|
|
1148
795
|
children: saving === "draft" ? "Saving..." : "Save Draft"
|
|
1149
796
|
}
|
|
1150
797
|
),
|
|
1151
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ jsx5(
|
|
1152
799
|
"button",
|
|
1153
800
|
{
|
|
1154
801
|
className: "orion-admin-action-button",
|
|
@@ -1163,9 +810,9 @@ function PageEditorFrame({ src }) {
|
|
|
1163
810
|
]
|
|
1164
811
|
}
|
|
1165
812
|
),
|
|
1166
|
-
message ? /* @__PURE__ */
|
|
1167
|
-
error ? /* @__PURE__ */
|
|
1168
|
-
sessionExpired ? /* @__PURE__ */
|
|
813
|
+
message ? /* @__PURE__ */ jsx5("div", { style: { color: "var(--orion-admin-accent)", fontSize: "0.9rem", fontWeight: 700 }, children: message }) : null,
|
|
814
|
+
error ? /* @__PURE__ */ jsx5("div", { className: "orion-admin-error", children: error }) : null,
|
|
815
|
+
sessionExpired ? /* @__PURE__ */ jsx5(
|
|
1169
816
|
"div",
|
|
1170
817
|
{
|
|
1171
818
|
style: {
|
|
@@ -1180,7 +827,7 @@ function PageEditorFrame({ src }) {
|
|
|
1180
827
|
children: "Session expired. Log in again in a new tab, then save your changes."
|
|
1181
828
|
}
|
|
1182
829
|
) : null,
|
|
1183
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ jsx5(
|
|
1184
831
|
"iframe",
|
|
1185
832
|
{
|
|
1186
833
|
ref: iframeRef,
|
|
@@ -1200,7 +847,7 @@ function PageEditorFrame({ src }) {
|
|
|
1200
847
|
}
|
|
1201
848
|
}
|
|
1202
849
|
),
|
|
1203
|
-
pendingNavigationURL && showUnsavedDialog ? /* @__PURE__ */
|
|
850
|
+
pendingNavigationURL && showUnsavedDialog ? /* @__PURE__ */ jsx5(
|
|
1204
851
|
"div",
|
|
1205
852
|
{
|
|
1206
853
|
"data-orion-unsaved-dialog": "true",
|
|
@@ -1214,7 +861,7 @@ function PageEditorFrame({ src }) {
|
|
|
1214
861
|
position: "fixed",
|
|
1215
862
|
zIndex: 2e3
|
|
1216
863
|
},
|
|
1217
|
-
children: /* @__PURE__ */
|
|
864
|
+
children: /* @__PURE__ */ jsxs5(
|
|
1218
865
|
"div",
|
|
1219
866
|
{
|
|
1220
867
|
style: {
|
|
@@ -1229,12 +876,12 @@ function PageEditorFrame({ src }) {
|
|
|
1229
876
|
width: "100%"
|
|
1230
877
|
},
|
|
1231
878
|
children: [
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
880
|
+
/* @__PURE__ */ jsx5("div", { style: { color: "var(--orion-admin-text)", fontSize: "1rem", fontWeight: 700 }, children: "Unsaved changes" }),
|
|
881
|
+
/* @__PURE__ */ jsx5("div", { style: { color: "var(--orion-admin-muted)", fontSize: "0.9rem", marginTop: "0.4rem" }, children: "You have unsaved edits in the page builder. Save before leaving this page?" })
|
|
1235
882
|
] }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ jsxs5("div", { style: { display: "flex", gap: "0.6rem", justifyContent: "flex-end" }, children: [
|
|
884
|
+
/* @__PURE__ */ jsx5(
|
|
1238
885
|
"button",
|
|
1239
886
|
{
|
|
1240
887
|
className: "orion-admin-action-button",
|
|
@@ -1246,7 +893,7 @@ function PageEditorFrame({ src }) {
|
|
|
1246
893
|
children: "Stay"
|
|
1247
894
|
}
|
|
1248
895
|
),
|
|
1249
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ jsx5(
|
|
1250
897
|
"button",
|
|
1251
898
|
{
|
|
1252
899
|
className: "orion-admin-action-button",
|
|
@@ -1276,5 +923,7 @@ export {
|
|
|
1276
923
|
MediaDetailPanel,
|
|
1277
924
|
MediaListItem,
|
|
1278
925
|
MediaUploadForm,
|
|
1279
|
-
PageEditorFrame
|
|
926
|
+
PageEditorFrame,
|
|
927
|
+
SiteFooterPreview,
|
|
928
|
+
SiteHeaderPreview
|
|
1280
929
|
};
|