@aduptive/strapi-blockscene 2.0.0-alpha.11 → 2.0.0-alpha.13
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/README.md +111 -18
- package/dist/admin.cjs +1701 -654
- package/dist/admin.mjs +1698 -651
- package/dist/server.cjs +165 -17
- package/package.json +1 -1
package/dist/admin.mjs
CHANGED
|
@@ -125,13 +125,22 @@ var require_groups = __commonJS({
|
|
|
125
125
|
const [a, b] = direction === "up" ? [ranges[to], ranges[at]] : [ranges[at], ranges[to]];
|
|
126
126
|
return [...rows.slice(0, a[0]), ...rows.slice(b[0], b[1] + 1), ...rows.slice(a[0], a[1] + 1), ...rows.slice(b[1] + 1)];
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function removeGroup3(rows, key, g) {
|
|
129
129
|
if (!g) return null;
|
|
130
130
|
const start = rows.findIndex((row) => blockKey3(row) === String(key));
|
|
131
131
|
if (start < 0 || !isOpener2(rows[start], g)) return null;
|
|
132
132
|
const [, end] = groupRange3(rows, start, g);
|
|
133
|
+
if (end <= start || uidOf(rows[end]) !== g[uidOf(rows[start])]) return null;
|
|
133
134
|
return [...rows.slice(0, start), ...rows.slice(end + 1)];
|
|
134
135
|
}
|
|
136
|
+
function unwrapGroup3(rows, key, g) {
|
|
137
|
+
if (!g) return null;
|
|
138
|
+
const start = rows.findIndex((row) => blockKey3(row) === String(key));
|
|
139
|
+
if (start < 0 || !isOpener2(rows[start], g)) return null;
|
|
140
|
+
const [, end] = groupRange3(rows, start, g);
|
|
141
|
+
if (end <= start || uidOf(rows[end]) !== g[uidOf(rows[start])]) return null;
|
|
142
|
+
return [...rows.slice(0, start), ...rows.slice(start + 1, end), ...rows.slice(end + 1)];
|
|
143
|
+
}
|
|
135
144
|
var MAX_COLUMNS = 12;
|
|
136
145
|
var parseColumns = (value) => {
|
|
137
146
|
const n = typeof value === "number" ? value : typeof value === "string" && /^\s*\d{1,3}\s*$/.test(value) ? Number(value) : NaN;
|
|
@@ -158,7 +167,8 @@ var require_groups = __commonJS({
|
|
|
158
167
|
groupRows: groupRows2,
|
|
159
168
|
topLevelRanges: topLevelRanges2,
|
|
160
169
|
moveGroup: moveGroup2,
|
|
161
|
-
removeGroup:
|
|
170
|
+
removeGroup: removeGroup3,
|
|
171
|
+
unwrapGroup: unwrapGroup3,
|
|
162
172
|
blockKey: blockKey3,
|
|
163
173
|
isOpener: isOpener2,
|
|
164
174
|
isClose: isClose2,
|
|
@@ -255,8 +265,8 @@ var require_diff = __commonJS({
|
|
|
255
265
|
}
|
|
256
266
|
function summarize(before, after, schema) {
|
|
257
267
|
const zones = Object.entries(schema?.attributes || {}).filter(([, attr]) => attr?.type === "dynamiczone").map(([name]) => name);
|
|
258
|
-
const blocks = { added: 0, removed: 0, changed: 0 };
|
|
259
|
-
if (!before) return { initial: true, fields: [], blocks };
|
|
268
|
+
const blocks = { total: zones.reduce((n, name) => n + (Array.isArray(after?.[name]) ? after[name].length : 0), 0), added: 0, removed: 0, changed: 0 };
|
|
269
|
+
if (!before) return { initial: true, fields: [], blocks: { ...blocks, added: blocks.total } };
|
|
260
270
|
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after || {})])];
|
|
261
271
|
const fields = names.filter((name) => !zones.includes(name) && !same2(before[name], after?.[name])).sort();
|
|
262
272
|
for (const name of zones) for (const { op } of diffRows2(before[name], after?.[name])) if (op !== "same") blocks[op]++;
|
|
@@ -267,23 +277,23 @@ var require_diff = __commonJS({
|
|
|
267
277
|
});
|
|
268
278
|
|
|
269
279
|
// admin/strapi5.tsx
|
|
270
|
-
import * as
|
|
280
|
+
import * as React18 from "react";
|
|
271
281
|
import {
|
|
272
|
-
Box as
|
|
282
|
+
Box as Box10,
|
|
273
283
|
Modal as Dialog2,
|
|
274
284
|
MenuItem as MenuItem2,
|
|
275
285
|
SimpleMenu as SimpleMenu2,
|
|
276
286
|
Switch as Switch2,
|
|
277
|
-
Flex as
|
|
278
|
-
Typography as
|
|
287
|
+
Flex as Flex12,
|
|
288
|
+
Typography as Typography12,
|
|
279
289
|
Field as Field3,
|
|
280
|
-
SingleSelect as
|
|
281
|
-
SingleSelectOption as
|
|
290
|
+
SingleSelect as SingleSelect3,
|
|
291
|
+
SingleSelectOption as SingleSelectOption3,
|
|
282
292
|
TextInput as TextInput2
|
|
283
293
|
} from "@strapi/design-system";
|
|
284
294
|
import {
|
|
285
295
|
useFetchClient as useFetchClient3,
|
|
286
|
-
useRBAC as
|
|
296
|
+
useRBAC as useRBAC4,
|
|
287
297
|
useStrapiApp as useStrapiApp2,
|
|
288
298
|
useAuth,
|
|
289
299
|
useForm as useForm3,
|
|
@@ -349,6 +359,26 @@ function variantRow(schema, components, values, keys = fractional) {
|
|
|
349
359
|
}
|
|
350
360
|
return row;
|
|
351
361
|
}
|
|
362
|
+
function starterKitRows(kit, zones, components, form) {
|
|
363
|
+
const out = {};
|
|
364
|
+
for (const [name, items2] of Object.entries(kit?.zones || {})) {
|
|
365
|
+
const zone = zones.find((entry) => entry.name === name);
|
|
366
|
+
const current = form.rows(name);
|
|
367
|
+
if (!zone || current.length || current.length + items2.length > (zone.max ?? Infinity) || items2.some((item) => !zone.components.includes(item.__component) || !components[item.__component])) return null;
|
|
368
|
+
const keys = form.keys(current, current.length, items2.length);
|
|
369
|
+
out[name] = items2.map((item, index) => ({ ...variantRow(components[item.__component], components, item.values), __component: item.__component, __temp_key__: keys[index] }));
|
|
370
|
+
}
|
|
371
|
+
return out;
|
|
372
|
+
}
|
|
373
|
+
function starterKitsForLocale(kits, locale) {
|
|
374
|
+
if (!Array.isArray(kits)) return [];
|
|
375
|
+
const current = String(locale || "").toLowerCase();
|
|
376
|
+
const language = current.split("-")[0];
|
|
377
|
+
return kits.filter((kit) => !Array.isArray(kit.locales) || kit.locales.some((entry) => {
|
|
378
|
+
const wanted = String(entry).toLowerCase();
|
|
379
|
+
return wanted === current || !wanted.includes("-") && wanted === language;
|
|
380
|
+
}));
|
|
381
|
+
}
|
|
352
382
|
function editableZones(schema, values, canEdit, disabled = false) {
|
|
353
383
|
if (disabled) return [];
|
|
354
384
|
return Object.entries(schema?.attributes || {}).filter(
|
|
@@ -413,6 +443,12 @@ var pickable = (zone, config2) => {
|
|
|
413
443
|
const closers = Object.values(config2.groups || {});
|
|
414
444
|
return zone.components.filter((uid) => !closers.includes(uid));
|
|
415
445
|
};
|
|
446
|
+
function showRowThumbnail(uid, config2 = {}) {
|
|
447
|
+
const configured = config2.components?.[uid]?.showRowThumbnail;
|
|
448
|
+
if (typeof configured === "boolean") return configured;
|
|
449
|
+
const groups = config2.groups || {};
|
|
450
|
+
return !Object.prototype.hasOwnProperty.call(groups, uid) && !Object.values(groups).includes(uid);
|
|
451
|
+
}
|
|
416
452
|
function entryOf(uid, schema, config2) {
|
|
417
453
|
const meta = config2.components?.[uid] || {};
|
|
418
454
|
return {
|
|
@@ -559,13 +595,74 @@ var TEXT_TYPES = ["string", "text"];
|
|
|
559
595
|
var RICH_TYPES = ["richtext", "blocks", "customField"];
|
|
560
596
|
var EDITABLE_TYPES = [...TEXT_TYPES, ...RICH_TYPES];
|
|
561
597
|
var SCALAR = ["string", "text", "richtext", "email", "enumeration", "integer", "biginteger", "float", "decimal", "boolean", "date", "datetime", "time", "json", "blocks", "uid", "customField"];
|
|
598
|
+
var ENTRY_SYSTEM = ["id", "documentId", "locale", "createdAt", "updatedAt", "publishedAt"];
|
|
599
|
+
var privateAttribute = (attr) => attr?.private === true || attr?.pluginOptions?.blockscene?.private === true;
|
|
600
|
+
var fieldReadable = (path, allowed, all = false) => {
|
|
601
|
+
if (all) return true;
|
|
602
|
+
const fields = Array.isArray(allowed) ? allowed : [];
|
|
603
|
+
const parts = String(path).split(".");
|
|
604
|
+
return parts.some((_, index) => fields.includes(parts.slice(0, index + 1).join("."))) || fields.some((field) => field.startsWith(`${path}.`));
|
|
605
|
+
};
|
|
562
606
|
var blockKey = (row) => row && row.id != null ? `${row.__component}#${row.id}` : row && row.__temp_key__ != null ? String(row.__temp_key__) : null;
|
|
607
|
+
function plainValue(value, depth = 0) {
|
|
608
|
+
if (value == null || typeof value === "number" || typeof value === "boolean") return value;
|
|
609
|
+
if (typeof value === "string") return value.slice(0, 2e5);
|
|
610
|
+
if (typeof value !== "object" || depth > 8) return void 0;
|
|
611
|
+
if (Array.isArray(value)) return value.slice(0, 500).map((item) => plainValue(item, depth + 1)).filter((item) => item !== void 0);
|
|
612
|
+
const out = {};
|
|
613
|
+
for (const [name, child] of Object.entries(value).slice(0, 500)) {
|
|
614
|
+
const projected = plainValue(child, depth + 1);
|
|
615
|
+
if (projected !== void 0) out[name] = projected;
|
|
616
|
+
}
|
|
617
|
+
return out;
|
|
618
|
+
}
|
|
619
|
+
function projectEntryValue(value, attr, components, cmsOrigin, depth = 0, readable = () => true, path = "") {
|
|
620
|
+
if (privateAttribute(attr) || attr?.type === "password" || depth > 8) return void 0;
|
|
621
|
+
if (attr?.type === "media") {
|
|
622
|
+
const files = (attr.multiple ? Array.isArray(value) ? value : [] : value ? [value] : []).map((file) => projectMedia(file, cmsOrigin)).filter(Boolean);
|
|
623
|
+
return attr.multiple ? files : files[0] || null;
|
|
624
|
+
}
|
|
625
|
+
if (attr?.type === "component") {
|
|
626
|
+
const schema = components?.[attr.component];
|
|
627
|
+
const one = (item) => {
|
|
628
|
+
if (!item || !schema) return null;
|
|
629
|
+
const projected = projectEntryObject(item, schema, components, cmsOrigin, depth + 1, readable, path);
|
|
630
|
+
return item.id != null ? { id: item.id, ...projected } : projected;
|
|
631
|
+
};
|
|
632
|
+
return attr.repeatable ? (Array.isArray(value) ? value : []).slice(0, 500).map(one).filter(Boolean) : one(value);
|
|
633
|
+
}
|
|
634
|
+
if (attr?.type === "dynamiczone") {
|
|
635
|
+
return (Array.isArray(value) ? value : []).slice(0, 500).flatMap((item) => {
|
|
636
|
+
const uid = item?.__component;
|
|
637
|
+
const schema = components?.[uid];
|
|
638
|
+
if (!uid || !schema) return [];
|
|
639
|
+
const projected = projectEntryObject(item, schema, components, cmsOrigin, depth + 1, readable, path);
|
|
640
|
+
return [{ ...item.id != null && { id: item.id }, __component: uid, ...projected }];
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
return plainValue(value, depth);
|
|
644
|
+
}
|
|
645
|
+
function projectEntryObject(values, schema, components, cmsOrigin, depth = 0, readable = () => true, prefix2 = "") {
|
|
646
|
+
const out = {};
|
|
647
|
+
for (const [name, attr] of Object.entries(schema?.attributes || {})) {
|
|
648
|
+
const path = prefix2 ? `${prefix2}.${name}` : name;
|
|
649
|
+
if (!readable(path) || privateAttribute(attr) || attr.type === "password" || values?.[name] === void 0) continue;
|
|
650
|
+
const projected = projectEntryValue(values[name], attr, components, cmsOrigin, depth, readable, path);
|
|
651
|
+
if (projected !== void 0) out[name] = projected;
|
|
652
|
+
}
|
|
653
|
+
return out;
|
|
654
|
+
}
|
|
655
|
+
function projectEntry(values, schema, components, cmsOrigin, readable = () => true) {
|
|
656
|
+
const out = projectEntryObject(values, schema, components, cmsOrigin, 0, readable);
|
|
657
|
+
for (const name of ENTRY_SYSTEM) if (values?.[name] !== void 0) out[name] = plainValue(values[name]);
|
|
658
|
+
return out;
|
|
659
|
+
}
|
|
563
660
|
function projectRow(row, schema, components, cmsOrigin, depth = 0) {
|
|
564
661
|
if (!row || !schema || depth > 3) return null;
|
|
565
662
|
const out = {};
|
|
566
663
|
for (const [name, attr] of Object.entries(schema.attributes || {})) {
|
|
567
664
|
const value = row[name];
|
|
568
|
-
if (attr.type === "password" || attr.type === "relation" || attr
|
|
665
|
+
if (attr.type === "password" || attr.type === "relation" || privateAttribute(attr)) continue;
|
|
569
666
|
if (SCALAR.includes(attr.type)) {
|
|
570
667
|
if (value !== void 0) out[name] = typeof value === "string" ? value.slice(0, 2e5) : value;
|
|
571
668
|
} else if (attr.type === "media") {
|
|
@@ -594,7 +691,7 @@ function resolveField(uid, field, components) {
|
|
|
594
691
|
const parts = field.split(".");
|
|
595
692
|
for (let i = 0; i < parts.length; i++) {
|
|
596
693
|
const attr = schema?.attributes?.[parts[i]];
|
|
597
|
-
if (!attr || attr
|
|
694
|
+
if (!attr || privateAttribute(attr)) return null;
|
|
598
695
|
if (i === parts.length - 1) return attr;
|
|
599
696
|
if (attr.type !== "component") return null;
|
|
600
697
|
if (attr.repeatable) {
|
|
@@ -610,7 +707,7 @@ function editableFields(uid, row, components) {
|
|
|
610
707
|
const out = [];
|
|
611
708
|
const SYSTEM = ["id", "documentId", "locale", "createdAt", "updatedAt", "publishedAt", "createdBy", "updatedBy", "localizations", "__component", "__temp_key__"];
|
|
612
709
|
const push = (name, attr, label) => {
|
|
613
|
-
if (!SYSTEM.includes(name.split(".").pop()) && attr
|
|
710
|
+
if (!SYSTEM.includes(name.split(".").pop()) && !privateAttribute(attr) && EDITABLE_TYPES.includes(attr?.type)) out.push({ name, type: attr.type, label });
|
|
614
711
|
};
|
|
615
712
|
for (const [name, attr] of Object.entries(schema?.attributes || {})) {
|
|
616
713
|
if (attr.type === "component" && attr.repeatable) {
|
|
@@ -624,7 +721,7 @@ function editableFields(uid, row, components) {
|
|
|
624
721
|
function mediaFields(uid, row, components) {
|
|
625
722
|
const media = {};
|
|
626
723
|
for (const [name, attr] of Object.entries(components?.[uid]?.attributes || {})) {
|
|
627
|
-
if (attr.type === "media" && attr
|
|
724
|
+
if (attr.type === "media" && !privateAttribute(attr)) media[name] = { required: attr.required === true, multiple: attr.multiple === true, present: attr.multiple ? Array.isArray(row?.[name]) && row[name].length > 0 : Boolean(row?.[name]) };
|
|
628
725
|
}
|
|
629
726
|
return media;
|
|
630
727
|
}
|
|
@@ -664,6 +761,7 @@ var hoverKey = (key, rows) => key === null ? null : typeof key === "string" && k
|
|
|
664
761
|
function isPreviewMessage(event, origin, source, channel, type) {
|
|
665
762
|
return event.origin === origin && event.source === source && event.data?.protocol === PROTOCOL && event.data?.channel === channel && event.data?.type === type;
|
|
666
763
|
}
|
|
764
|
+
var previewMessageAllowed = (event, origin, source, channel, readOnly) => isPreviewMessage(event, origin, source, channel, event.data?.type) && (!readOnly || event.data?.type === "ready");
|
|
667
765
|
function insertIndex(rows, after) {
|
|
668
766
|
if (after === null || after === void 0) return 0;
|
|
669
767
|
const index = (Array.isArray(rows) ? rows : []).findIndex((row) => blockKey(row) === String(after));
|
|
@@ -866,7 +964,7 @@ import { useIntl } from "react-intl";
|
|
|
866
964
|
// admin/translations/en.json
|
|
867
965
|
var en_default = {
|
|
868
966
|
title: "Blockscene",
|
|
869
|
-
settings: "
|
|
967
|
+
settings: "General",
|
|
870
968
|
gallery: "Block gallery",
|
|
871
969
|
search: "Search blocks",
|
|
872
970
|
clear: "Clear search",
|
|
@@ -882,6 +980,17 @@ var en_default = {
|
|
|
882
980
|
moreActions: "More actions",
|
|
883
981
|
settingsTitle: "Blockscene",
|
|
884
982
|
settingsIntro: "Gallery thumbnails, wireframe palette and editor preferences. Changes apply the next time the gallery opens; no rebuild is needed.",
|
|
983
|
+
settingsGeneral: "General",
|
|
984
|
+
settingsGeneralIntro: "Choose how Blockscene behaves in the editor and which row actions are available.",
|
|
985
|
+
settingsPreview: "Page preview",
|
|
986
|
+
settingsPreviewIntro: "Connect the frontend preview and configure its modes, toolbar and responsive widths.",
|
|
987
|
+
settingsContentTypes: "Content types",
|
|
988
|
+
settingsContentTypesIntro: "Choose where Blockscene is enabled and tailor the visual editor for each content type.",
|
|
989
|
+
settingsGallery: "Block gallery",
|
|
990
|
+
settingsGalleryIntro: "Configure gallery thumbnails, wireframe colors, block types and filters.",
|
|
991
|
+
settingsHistory: "History & trash",
|
|
992
|
+
settingsHistoryIntro: "Control version snapshots, activity retention and recoverable deletions.",
|
|
993
|
+
historyUnavailable: "History and trash settings require Strapi 5.",
|
|
885
994
|
palette: "Wireframe palette",
|
|
886
995
|
background: "Background",
|
|
887
996
|
surface: "Surfaces",
|
|
@@ -911,6 +1020,7 @@ var en_default = {
|
|
|
911
1020
|
showCloseAll: 'Show "Collapse all"',
|
|
912
1021
|
toggleHelp: "The zone bar shows one button: with both on it expands while any block is collapsed and collapses them all otherwise; with only one on, it offers that action alone.",
|
|
913
1022
|
showRowThumbnails: "Show block thumbnails in the rows",
|
|
1023
|
+
componentRowThumbnail: "Show thumbnail in the editor row",
|
|
914
1024
|
initialState: "Initial accordion state",
|
|
915
1025
|
"states.closed": "All closed",
|
|
916
1026
|
"states.open": "All open",
|
|
@@ -918,10 +1028,10 @@ var en_default = {
|
|
|
918
1028
|
rememberHelp: "Only the explicit open all / close all buttons update the memory, per user and browser. Opening one block does not.",
|
|
919
1029
|
previewUrl: "Preview route base URL",
|
|
920
1030
|
previewUrlHelp: "Full URL of your frontend page-preview route, e.g. https://site.test/block-preview/page. Leave empty to reuse the origin of Strapi's native Preview (when configured for the content type) with /block-preview/page. The route must implement the bridge (see README).",
|
|
921
|
-
previewUrlEmpty: "No preview URL is set: editors get the Fields +
|
|
1031
|
+
previewUrlEmpty: "No preview URL is set: editors get the Fields + preview and Visual editor modes only on content types where Strapi's native Preview is configured. Elsewhere the mode menu is not shown.",
|
|
922
1032
|
previewMode: "Initial preview mode",
|
|
923
|
-
"modes.form": "Fields",
|
|
924
|
-
"modes.split": "Fields +
|
|
1033
|
+
"modes.form": "Fields only",
|
|
1034
|
+
"modes.split": "Fields + preview",
|
|
925
1035
|
"modes.preview": "Visual editor",
|
|
926
1036
|
previewModeHelp: "Every edit view opens in this mode, unless its content type sets its own below. Editors can switch while they edit; the switch is not remembered.",
|
|
927
1037
|
lazyEdit: "Click to edit",
|
|
@@ -929,8 +1039,8 @@ var en_default = {
|
|
|
929
1039
|
lazyFields: "Custom fields loaded on demand",
|
|
930
1040
|
lazyEditorsHelp: "Listed custom fields show a read-only preview until clicked or focused, so opening large pages stays fast. Separate uids with commas.",
|
|
931
1041
|
lazyFieldsInvalid: "Use up to {max} custom field uids such as plugin::ckeditor5.CKEditor or global::my-field.",
|
|
932
|
-
modeForm: "Fields",
|
|
933
|
-
modeSplit: "Fields +
|
|
1042
|
+
modeForm: "Fields only",
|
|
1043
|
+
modeSplit: "Fields + preview",
|
|
934
1044
|
modePreview: "Visual editor",
|
|
935
1045
|
previewPane: "Page preview",
|
|
936
1046
|
resize: "Resize preview pane",
|
|
@@ -957,6 +1067,7 @@ var en_default = {
|
|
|
957
1067
|
denied: "Access denied.",
|
|
958
1068
|
loadFailed: "Could not load settings. Reload to try again.",
|
|
959
1069
|
invalidColor: "Colors must use #RRGGBB.",
|
|
1070
|
+
invalidUrl: "Preview URLs must be complete HTTP or HTTPS URLs.",
|
|
960
1071
|
previewLabel: "Palette preview",
|
|
961
1072
|
removeGroup: "Remove group",
|
|
962
1073
|
diagTitle: "Block groups need attention; publishing is refused until they are fixed:",
|
|
@@ -991,6 +1102,7 @@ var en_default = {
|
|
|
991
1102
|
contentTypes: "Content types",
|
|
992
1103
|
contentTypesHelp: 'The gallery, accordions and page preview work on these content types (the ones with a Dynamic Zone). Turn one off to leave its edit view native. "Opens in" is how every edit view of that type starts; editors can still switch while they edit.',
|
|
993
1104
|
typeMode: "Opens in",
|
|
1105
|
+
typeAdvanced: "Visual editor options",
|
|
994
1106
|
modeDefault: "Default ({mode})",
|
|
995
1107
|
blockModalDone: "Done",
|
|
996
1108
|
crashed: "Blockscene stopped here after an error. The native editor is unaffected. If it happens again, turn Blockscene off in Settings, Blockscene.",
|
|
@@ -1025,6 +1137,9 @@ var en_default = {
|
|
|
1025
1137
|
unstar: "Remove star",
|
|
1026
1138
|
quickInsert: "Insert {label}",
|
|
1027
1139
|
insert: "Insert",
|
|
1140
|
+
starterKits: "Start with a kit",
|
|
1141
|
+
starterKitsHelp: "Choose a starting structure. Everything is inserted as an unsaved, editable draft.",
|
|
1142
|
+
startBlank: "Start blank",
|
|
1028
1143
|
closeDetail: "Close details",
|
|
1029
1144
|
typology: "Typology",
|
|
1030
1145
|
typologyAuto: "Automatic ({name})",
|
|
@@ -1079,6 +1194,11 @@ var en_default = {
|
|
|
1079
1194
|
confirmDeleteTitle: "Delete block",
|
|
1080
1195
|
confirmDelete: "Delete block {name}?",
|
|
1081
1196
|
confirmDeleteMarker: "This is a group marker: only the marker is removed, not the blocks inside the group, and the group stays unbalanced until it is fixed.",
|
|
1197
|
+
confirmDeleteGroupTitle: "Delete group",
|
|
1198
|
+
confirmDeleteGroup: "Delete group {name}?",
|
|
1199
|
+
confirmDeleteGroupHint: "This group contains {count, plural, one {# block} other {# blocks}}. Choose whether to delete them or keep them on the page without the group.",
|
|
1200
|
+
keepGroupBlocks: "Remove group, keep blocks",
|
|
1201
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Delete group} one {Delete group and # block} other {Delete group and # blocks}}",
|
|
1082
1202
|
delete: "Delete",
|
|
1083
1203
|
selectBlocks: "Select blocks",
|
|
1084
1204
|
selectAll: "Select all",
|
|
@@ -1273,6 +1393,7 @@ var en_default = {
|
|
|
1273
1393
|
gridCellMenu: "More actions for {label}",
|
|
1274
1394
|
removeFromGroup: "Remove from group",
|
|
1275
1395
|
gridAdd: "Add a block",
|
|
1396
|
+
groupAdd: "Add block inside {label}",
|
|
1276
1397
|
gridShowList: "Show group {label} as a list",
|
|
1277
1398
|
gridShowGrid: "Show group {label} as a grid",
|
|
1278
1399
|
layoutColumnsField: "Layout grid: columns field",
|
|
@@ -1281,13 +1402,29 @@ var en_default = {
|
|
|
1281
1402
|
layoutOff: "No grid",
|
|
1282
1403
|
layoutNoMobile: "None",
|
|
1283
1404
|
layoutHelp: "The group's blocks show as a grid in the form, with the column count this block holds.",
|
|
1284
|
-
layoutNoFields: "This block has no field that can hold a column count."
|
|
1405
|
+
layoutNoFields: "This block has no field that can hold a column count.",
|
|
1406
|
+
"toolbar.versions": "Version history",
|
|
1407
|
+
versionsDenied: "Ask an administrator to grant the Blockscene Read version history permission.",
|
|
1408
|
+
versionsDisabled: "History is not enabled for this content type. Ask an administrator to enable it in Settings > Blockscene (settings.history.enabled).",
|
|
1409
|
+
versionsNew: "Save this entry first to start its history.",
|
|
1410
|
+
versionsPerson: "Filter by person",
|
|
1411
|
+
versionsEveryone: "Everyone",
|
|
1412
|
+
versionsCounts: "{total} blocks",
|
|
1413
|
+
versionsCountsMissing: "Block counts unavailable (older or unrecorded event).",
|
|
1414
|
+
versionsPage: "Page {page} of {count}",
|
|
1415
|
+
versionsPrevious: "Previous",
|
|
1416
|
+
versionsNext: "Next",
|
|
1417
|
+
versionsViewing: "Viewing version of {date} by {person} (read-only).",
|
|
1418
|
+
versionsCurrent: "Back to current draft",
|
|
1419
|
+
versionsMissing: "Some blocks, fields, media or relations are no longer available in this preview.",
|
|
1420
|
+
versionsBridgeLegacy: "This preview bridge does not support read-only browsing. Interaction is disabled; update the bridge to support readOnly.",
|
|
1421
|
+
historyExpired: "Snapshot no longer available"
|
|
1285
1422
|
};
|
|
1286
1423
|
|
|
1287
1424
|
// admin/translations/pt-BR.json
|
|
1288
1425
|
var pt_BR_default = {
|
|
1289
1426
|
title: "Blockscene",
|
|
1290
|
-
settings: "
|
|
1427
|
+
settings: "Geral",
|
|
1291
1428
|
gallery: "Galeria de blocos",
|
|
1292
1429
|
search: "Buscar blocos",
|
|
1293
1430
|
clear: "Limpar busca",
|
|
@@ -1303,6 +1440,17 @@ var pt_BR_default = {
|
|
|
1303
1440
|
moreActions: "Mais a\xE7\xF5es",
|
|
1304
1441
|
settingsTitle: "Blockscene",
|
|
1305
1442
|
settingsIntro: "Miniaturas da galeria, paleta dos wireframes e prefer\xEAncias do editor. As mudan\xE7as valem na pr\xF3xima abertura da galeria; n\xE3o \xE9 preciso rebuild.",
|
|
1443
|
+
settingsGeneral: "Geral",
|
|
1444
|
+
settingsGeneralIntro: "Defina como o Blockscene funciona no editor e quais a\xE7\xF5es ficam dispon\xEDveis nas linhas.",
|
|
1445
|
+
settingsPreview: "Preview da p\xE1gina",
|
|
1446
|
+
settingsPreviewIntro: "Conecte a preview do frontend e configure modos, barra de ferramentas e larguras responsivas.",
|
|
1447
|
+
settingsContentTypes: "Tipos de conte\xFAdo",
|
|
1448
|
+
settingsContentTypesIntro: "Escolha onde o Blockscene fica ativo e personalize o editor visual de cada tipo de conte\xFAdo.",
|
|
1449
|
+
settingsGallery: "Galeria de blocos",
|
|
1450
|
+
settingsGalleryIntro: "Configure miniaturas, cores dos wireframes, tipos e filtros da galeria.",
|
|
1451
|
+
settingsHistory: "Hist\xF3rico e lixeira",
|
|
1452
|
+
settingsHistoryIntro: "Controle vers\xF5es, reten\xE7\xE3o de atividades e exclus\xF5es recuper\xE1veis.",
|
|
1453
|
+
historyUnavailable: "As configura\xE7\xF5es de hist\xF3rico e lixeira exigem o Strapi 5.",
|
|
1306
1454
|
palette: "Paleta dos wireframes",
|
|
1307
1455
|
background: "Fundo",
|
|
1308
1456
|
surface: "Superf\xEDcies",
|
|
@@ -1332,6 +1480,7 @@ var pt_BR_default = {
|
|
|
1332
1480
|
showCloseAll: 'Mostrar "Recolher tudo"',
|
|
1333
1481
|
toggleHelp: "A barra da zona mostra um \xFAnico bot\xE3o: com as duas op\xE7\xF5es ligadas, ele expande enquanto houver algum bloco recolhido e, sen\xE3o, recolhe todos; com s\xF3 uma ligada, oferece apenas essa a\xE7\xE3o.",
|
|
1334
1482
|
showRowThumbnails: "Mostrar miniaturas dos blocos nas linhas",
|
|
1483
|
+
componentRowThumbnail: "Mostrar miniatura na linha do editor",
|
|
1335
1484
|
initialState: "Estado inicial dos accordions",
|
|
1336
1485
|
"states.closed": "Todos fechados",
|
|
1337
1486
|
"states.open": "Todos abertos",
|
|
@@ -1339,10 +1488,10 @@ var pt_BR_default = {
|
|
|
1339
1488
|
rememberHelp: "Somente os bot\xF5es de abrir/fechar todos atualizam a mem\xF3ria, por usu\xE1rio e navegador. Abrir um bloco isolado n\xE3o muda.",
|
|
1340
1489
|
previewUrl: "URL base da rota de preview",
|
|
1341
1490
|
previewUrlHelp: "URL completa da rota de preview de p\xE1gina do seu frontend, por exemplo https://site.test/block-preview/page. Vazio reutiliza a origem da Preview nativa do Strapi (quando configurada para o tipo de conte\xFAdo) com /block-preview/page. A rota precisa implementar a bridge (ver README).",
|
|
1342
|
-
previewUrlEmpty: "Nenhuma URL de preview definida: os editores s\xF3 t\xEAm os modos Campos +
|
|
1491
|
+
previewUrlEmpty: "Nenhuma URL de preview definida: os editores s\xF3 t\xEAm os modos Campos + preview e Editor visual nos tipos de conte\xFAdo com o Preview nativo do Strapi configurado. Nos demais, o menu de modos n\xE3o aparece.",
|
|
1343
1492
|
previewMode: "Modo inicial da preview",
|
|
1344
|
-
"modes.form": "
|
|
1345
|
-
"modes.split": "Campos +
|
|
1493
|
+
"modes.form": "Somente campos",
|
|
1494
|
+
"modes.split": "Campos + preview",
|
|
1346
1495
|
"modes.preview": "Editor visual",
|
|
1347
1496
|
previewModeHelp: "Toda tela de edi\xE7\xE3o abre neste modo, a menos que o tipo de conte\xFAdo defina o seu abaixo. Quem edita pode trocar durante a edi\xE7\xE3o; a troca n\xE3o fica gravada.",
|
|
1348
1497
|
lazyEdit: "Clique para editar",
|
|
@@ -1350,8 +1499,8 @@ var pt_BR_default = {
|
|
|
1350
1499
|
lazyFields: "Campos personalizados carregados sob demanda",
|
|
1351
1500
|
lazyEditorsHelp: "Os campos personalizados listados mostram uma pr\xE9via somente leitura at\xE9 receberem clique ou foco, para que p\xE1ginas grandes abram r\xE1pido. Separe os uids com v\xEDrgulas.",
|
|
1352
1501
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1353
|
-
modeForm: "
|
|
1354
|
-
modeSplit: "Campos +
|
|
1502
|
+
modeForm: "Somente campos",
|
|
1503
|
+
modeSplit: "Campos + preview",
|
|
1355
1504
|
modePreview: "Editor visual",
|
|
1356
1505
|
previewPane: "Preview da p\xE1gina",
|
|
1357
1506
|
resize: "Redimensionar painel de preview",
|
|
@@ -1378,6 +1527,7 @@ var pt_BR_default = {
|
|
|
1378
1527
|
denied: "Acesso negado.",
|
|
1379
1528
|
loadFailed: "N\xE3o foi poss\xEDvel carregar. Recarregue para tentar novamente.",
|
|
1380
1529
|
invalidColor: "As cores devem usar #RRGGBB.",
|
|
1530
|
+
invalidUrl: "As URLs de preview devem ser URLs HTTP ou HTTPS completas.",
|
|
1381
1531
|
previewLabel: "Pr\xE9via da paleta",
|
|
1382
1532
|
removeGroup: "Remover grupo",
|
|
1383
1533
|
diagTitle: "Os grupos de blocos precisam de aten\xE7\xE3o; a publica\xE7\xE3o \xE9 recusada at\xE9 a corre\xE7\xE3o:",
|
|
@@ -1412,6 +1562,7 @@ var pt_BR_default = {
|
|
|
1412
1562
|
contentTypes: "Tipos de conte\xFAdo",
|
|
1413
1563
|
contentTypesHelp: 'A galeria, os accordions e o preview da p\xE1gina funcionam nestes tipos de conte\xFAdo (os que t\xEAm uma zona din\xE2mica). Desligue um para deixar a edi\xE7\xE3o dele nativa. "Abre em" \xE9 como toda tela de edi\xE7\xE3o desse tipo come\xE7a; quem edita ainda pode trocar durante a edi\xE7\xE3o.',
|
|
1414
1564
|
typeMode: "Abre em",
|
|
1565
|
+
typeAdvanced: "Op\xE7\xF5es do editor visual",
|
|
1415
1566
|
modeDefault: "Padr\xE3o ({mode})",
|
|
1416
1567
|
blockModalDone: "Concluir",
|
|
1417
1568
|
crashed: "O Blockscene parou aqui por causa de um erro. O editor nativo n\xE3o foi afetado. Se acontecer de novo, desligue o Blockscene em Settings, Blockscene.",
|
|
@@ -1446,6 +1597,9 @@ var pt_BR_default = {
|
|
|
1446
1597
|
unstar: "Remover dos favoritos",
|
|
1447
1598
|
quickInsert: "Inserir {label}",
|
|
1448
1599
|
insert: "Inserir",
|
|
1600
|
+
starterKits: "Come\xE7ar com um kit",
|
|
1601
|
+
starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como rascunho edit\xE1vel e ainda n\xE3o salvo.",
|
|
1602
|
+
startBlank: "Come\xE7ar em branco",
|
|
1449
1603
|
closeDetail: "Fechar detalhes",
|
|
1450
1604
|
typology: "Tipologia",
|
|
1451
1605
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -1500,6 +1654,11 @@ var pt_BR_default = {
|
|
|
1500
1654
|
confirmDeleteTitle: "Excluir bloco",
|
|
1501
1655
|
confirmDelete: "Excluir o bloco {name}?",
|
|
1502
1656
|
confirmDeleteMarker: "Este \xE9 um marcador de grupo: s\xF3 o marcador \xE9 removido, n\xE3o os blocos dentro do grupo, e o grupo fica desbalanceado at\xE9 ser corrigido.",
|
|
1657
|
+
confirmDeleteGroupTitle: "Excluir grupo",
|
|
1658
|
+
confirmDeleteGroup: "Excluir o grupo {name}?",
|
|
1659
|
+
confirmDeleteGroupHint: "Este grupo cont\xE9m {count, plural, one {# bloco} other {# blocos}}. Escolha entre exclu\xED-los ou mant\xEA-los na p\xE1gina sem o grupo.",
|
|
1660
|
+
keepGroupBlocks: "Remover grupo e manter blocos",
|
|
1661
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Excluir grupo} one {Excluir grupo e # bloco} other {Excluir grupo e # blocos}}",
|
|
1503
1662
|
delete: "Excluir",
|
|
1504
1663
|
selectBlocks: "Selecionar blocos",
|
|
1505
1664
|
selectAll: "Selecionar todos",
|
|
@@ -1694,6 +1853,7 @@ var pt_BR_default = {
|
|
|
1694
1853
|
gridCellMenu: "Mais a\xE7\xF5es para {label}",
|
|
1695
1854
|
removeFromGroup: "Remover do grupo",
|
|
1696
1855
|
gridAdd: "Adicionar bloco",
|
|
1856
|
+
groupAdd: "Adicionar bloco dentro de {label}",
|
|
1697
1857
|
gridShowList: "Mostrar o grupo {label} como lista",
|
|
1698
1858
|
gridShowGrid: "Mostrar o grupo {label} como grade",
|
|
1699
1859
|
layoutColumnsField: "Grade do layout: campo das colunas",
|
|
@@ -1702,13 +1862,29 @@ var pt_BR_default = {
|
|
|
1702
1862
|
layoutOff: "Sem grade",
|
|
1703
1863
|
layoutNoMobile: "Nenhum",
|
|
1704
1864
|
layoutHelp: "Os blocos do grupo aparecem em grade no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
1705
|
-
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
|
|
1865
|
+
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
|
|
1866
|
+
"toolbar.versions": "Hist\xF3rico de vers\xF5es",
|
|
1867
|
+
versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
|
|
1868
|
+
versionsDisabled: "O hist\xF3rico n\xE3o est\xE1 ativo para este tipo de conte\xFAdo. Pe\xE7a a um administrador para ativ\xE1-lo em Settings > Blockscene (settings.history.enabled).",
|
|
1869
|
+
versionsNew: "Salve este conte\xFAdo primeiro para iniciar seu hist\xF3rico.",
|
|
1870
|
+
versionsPerson: "Filtrar por pessoa",
|
|
1871
|
+
versionsEveryone: "Todas as pessoas",
|
|
1872
|
+
versionsCounts: "{total} blocos",
|
|
1873
|
+
versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registrado).",
|
|
1874
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
1875
|
+
versionsPrevious: "Anterior",
|
|
1876
|
+
versionsNext: "Pr\xF3xima",
|
|
1877
|
+
versionsViewing: "Vendo vers\xE3o de {date} por {person} (somente leitura).",
|
|
1878
|
+
versionsCurrent: "Voltar ao rascunho atual",
|
|
1879
|
+
versionsMissing: "Alguns blocos, campos, m\xEDdias ou rela\xE7\xF5es n\xE3o est\xE3o mais dispon\xEDveis nesta preview.",
|
|
1880
|
+
versionsBridgeLegacy: "Esta bridge n\xE3o suporta navega\xE7\xE3o somente leitura. A intera\xE7\xE3o est\xE1 desativada; atualize a bridge para suportar readOnly.",
|
|
1881
|
+
historyExpired: "Snapshot n\xE3o est\xE1 mais dispon\xEDvel"
|
|
1706
1882
|
};
|
|
1707
1883
|
|
|
1708
1884
|
// admin/translations/pt.json
|
|
1709
1885
|
var pt_default = {
|
|
1710
1886
|
title: "Blockscene",
|
|
1711
|
-
settings: "
|
|
1887
|
+
settings: "Geral",
|
|
1712
1888
|
gallery: "Galeria de blocos",
|
|
1713
1889
|
search: "Pesquisar blocos",
|
|
1714
1890
|
clear: "Limpar pesquisa",
|
|
@@ -1724,6 +1900,17 @@ var pt_default = {
|
|
|
1724
1900
|
moreActions: "Mais a\xE7\xF5es",
|
|
1725
1901
|
settingsTitle: "Blockscene",
|
|
1726
1902
|
settingsIntro: "Miniaturas da galeria, paleta dos wireframes e prefer\xEAncias do editor. As mudan\xE7as valem na pr\xF3xima abertura da galeria; n\xE3o \xE9 preciso rebuild.",
|
|
1903
|
+
settingsGeneral: "Geral",
|
|
1904
|
+
settingsGeneralIntro: "Defina como o Blockscene funciona no editor e quais a\xE7\xF5es ficam dispon\xEDveis nas linhas.",
|
|
1905
|
+
settingsPreview: "Pr\xE9-visualiza\xE7\xE3o da p\xE1gina",
|
|
1906
|
+
settingsPreviewIntro: "Ligue a pr\xE9-visualiza\xE7\xE3o do frontend e configure modos, barra de ferramentas e larguras responsivas.",
|
|
1907
|
+
settingsContentTypes: "Tipos de conte\xFAdo",
|
|
1908
|
+
settingsContentTypesIntro: "Escolha onde o Blockscene fica ativo e personalize o editor visual de cada tipo de conte\xFAdo.",
|
|
1909
|
+
settingsGallery: "Galeria de blocos",
|
|
1910
|
+
settingsGalleryIntro: "Configure miniaturas, cores dos wireframes, tipos e filtros da galeria.",
|
|
1911
|
+
settingsHistory: "Hist\xF3rico e lixo",
|
|
1912
|
+
settingsHistoryIntro: "Controle vers\xF5es, reten\xE7\xE3o de atividades e elimina\xE7\xF5es recuper\xE1veis.",
|
|
1913
|
+
historyUnavailable: "As configura\xE7\xF5es de hist\xF3rico e lixo exigem o Strapi 5.",
|
|
1727
1914
|
palette: "Paleta dos wireframes",
|
|
1728
1915
|
background: "Fundo",
|
|
1729
1916
|
surface: "Superf\xEDcies",
|
|
@@ -1753,6 +1940,7 @@ var pt_default = {
|
|
|
1753
1940
|
showCloseAll: 'Mostrar "Recolher tudo"',
|
|
1754
1941
|
toggleHelp: "A barra da zona mostra um \xFAnico bot\xE3o: com as duas op\xE7\xF5es ativas, expande enquanto houver algum bloco recolhido e, caso contr\xE1rio, recolhe todos; com apenas uma ativa, oferece s\xF3 essa a\xE7\xE3o.",
|
|
1755
1942
|
showRowThumbnails: "Mostrar miniaturas dos blocos nas linhas",
|
|
1943
|
+
componentRowThumbnail: "Mostrar miniatura na linha do editor",
|
|
1756
1944
|
initialState: "Estado inicial dos accordions",
|
|
1757
1945
|
"states.closed": "Todos fechados",
|
|
1758
1946
|
"states.open": "Todos abertos",
|
|
@@ -1760,10 +1948,10 @@ var pt_default = {
|
|
|
1760
1948
|
rememberHelp: "Somente os bot\xF5es de abrir/fechar todos atualizam a mem\xF3ria, por usu\xE1rio e navegador. Abrir um bloco isolado n\xE3o muda.",
|
|
1761
1949
|
previewUrl: "URL base da rota de pr\xE9-visualiza\xE7\xE3o",
|
|
1762
1950
|
previewUrlHelp: "URL completa da rota de preview de p\xE1gina do seu frontend, por exemplo https://site.test/block-preview/page. Vazio reutiliza a origem da Preview nativa do Strapi (quando configurada para o tipo de conte\xFAdo) com /block-preview/page. A rota precisa implementar a bridge (ver README).",
|
|
1763
|
-
previewUrlEmpty: "Nenhum URL de pr\xE9-visualiza\xE7\xE3o definido: os editores s\xF3 t\xEAm os modos Campos +
|
|
1951
|
+
previewUrlEmpty: "Nenhum URL de pr\xE9-visualiza\xE7\xE3o definido: os editores s\xF3 t\xEAm os modos Campos + pr\xE9-visualiza\xE7\xE3o e Editor visual nos tipos de conte\xFAdo com a Preview nativa do Strapi configurada. Nos restantes, o menu de modos n\xE3o aparece.",
|
|
1764
1952
|
previewMode: "Modo inicial da pr\xE9-visualiza\xE7\xE3o",
|
|
1765
|
-
"modes.form": "
|
|
1766
|
-
"modes.split": "Campos +
|
|
1953
|
+
"modes.form": "Apenas campos",
|
|
1954
|
+
"modes.split": "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1767
1955
|
"modes.preview": "Editor visual",
|
|
1768
1956
|
previewModeHelp: "Cada ecr\xE3 de edi\xE7\xE3o abre neste modo, salvo se o tipo de conte\xFAdo definir o seu abaixo. Quem edita pode mudar durante a edi\xE7\xE3o; a mudan\xE7a n\xE3o fica guardada.",
|
|
1769
1957
|
lazyEdit: "Clique para editar",
|
|
@@ -1771,8 +1959,8 @@ var pt_default = {
|
|
|
1771
1959
|
lazyFields: "Campos personalizados carregados a pedido",
|
|
1772
1960
|
lazyEditorsHelp: "Os campos personalizados indicados mostram uma pr\xE9-visualiza\xE7\xE3o s\xF3 de leitura at\xE9 receberem clique ou foco, para que p\xE1ginas grandes abram depressa. Separe os uids com v\xEDrgulas.",
|
|
1773
1961
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1774
|
-
modeForm: "
|
|
1775
|
-
modeSplit: "Campos +
|
|
1962
|
+
modeForm: "Apenas campos",
|
|
1963
|
+
modeSplit: "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1776
1964
|
modePreview: "Editor visual",
|
|
1777
1965
|
previewPane: "Pr\xE9-visualiza\xE7\xE3o da p\xE1gina",
|
|
1778
1966
|
resize: "Redimensionar painel de pr\xE9-visualiza\xE7\xE3o",
|
|
@@ -1799,6 +1987,7 @@ var pt_default = {
|
|
|
1799
1987
|
denied: "Acesso negado.",
|
|
1800
1988
|
loadFailed: "N\xE3o foi poss\xEDvel carregar. Recarregue para tentar novamente.",
|
|
1801
1989
|
invalidColor: "As cores devem usar #RRGGBB.",
|
|
1990
|
+
invalidUrl: "Os URL de pr\xE9-visualiza\xE7\xE3o devem ser endere\xE7os HTTP ou HTTPS completos.",
|
|
1802
1991
|
previewLabel: "Pr\xE9-visualiza\xE7\xE3o da paleta",
|
|
1803
1992
|
removeGroup: "Remover grupo",
|
|
1804
1993
|
diagTitle: "Os grupos de blocos precisam de aten\xE7\xE3o; a publica\xE7\xE3o \xE9 recusada at\xE9 \xE0 corre\xE7\xE3o:",
|
|
@@ -1833,6 +2022,7 @@ var pt_default = {
|
|
|
1833
2022
|
contentTypes: "Tipos de conte\xFAdo",
|
|
1834
2023
|
contentTypesHelp: 'A galeria, os acorde\xF5es e a pr\xE9-visualiza\xE7\xE3o da p\xE1gina funcionam nestes tipos de conte\xFAdo (os que t\xEAm uma zona din\xE2mica). Desligue um para manter a edi\xE7\xE3o nativa. "Abre em" \xE9 como come\xE7a cada ecr\xE3 de edi\xE7\xE3o desse tipo; quem edita pode sempre mudar durante a edi\xE7\xE3o.',
|
|
1835
2024
|
typeMode: "Abre em",
|
|
2025
|
+
typeAdvanced: "Op\xE7\xF5es do editor visual",
|
|
1836
2026
|
modeDefault: "Predefini\xE7\xE3o ({mode})",
|
|
1837
2027
|
blockModalDone: "Concluir",
|
|
1838
2028
|
crashed: "O Blockscene parou aqui devido a um erro. O editor nativo n\xE3o foi afetado. Se voltar a acontecer, desligue o Blockscene em Settings, Blockscene.",
|
|
@@ -1867,6 +2057,9 @@ var pt_default = {
|
|
|
1867
2057
|
unstar: "Remover dos favoritos",
|
|
1868
2058
|
quickInsert: "Inserir {label}",
|
|
1869
2059
|
insert: "Inserir",
|
|
2060
|
+
starterKits: "Come\xE7ar com um kit",
|
|
2061
|
+
starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como um rascunho edit\xE1vel e ainda n\xE3o guardado.",
|
|
2062
|
+
startBlank: "Come\xE7ar em branco",
|
|
1870
2063
|
closeDetail: "Fechar detalhes",
|
|
1871
2064
|
typology: "Tipologia",
|
|
1872
2065
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -1921,6 +2114,11 @@ var pt_default = {
|
|
|
1921
2114
|
confirmDeleteTitle: "Eliminar bloco",
|
|
1922
2115
|
confirmDelete: "Eliminar o bloco {name}?",
|
|
1923
2116
|
confirmDeleteMarker: "Este \xE9 um marcador de grupo: s\xF3 o marcador \xE9 removido, n\xE3o os blocos dentro do grupo, e o grupo fica desequilibrado at\xE9 ser corrigido.",
|
|
2117
|
+
confirmDeleteGroupTitle: "Eliminar grupo",
|
|
2118
|
+
confirmDeleteGroup: "Eliminar o grupo {name}?",
|
|
2119
|
+
confirmDeleteGroupHint: "Este grupo cont\xE9m {count, plural, one {# bloco} other {# blocos}}. Escolha entre elimin\xE1-los ou mant\xEA-los na p\xE1gina sem o grupo.",
|
|
2120
|
+
keepGroupBlocks: "Eliminar grupo e manter blocos",
|
|
2121
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Eliminar grupo} one {Eliminar grupo e # bloco} other {Eliminar grupo e # blocos}}",
|
|
1924
2122
|
delete: "Eliminar",
|
|
1925
2123
|
selectBlocks: "Selecionar blocos",
|
|
1926
2124
|
selectAll: "Selecionar todos",
|
|
@@ -2115,6 +2313,7 @@ var pt_default = {
|
|
|
2115
2313
|
gridCellMenu: "Mais a\xE7\xF5es para {label}",
|
|
2116
2314
|
removeFromGroup: "Remover do grupo",
|
|
2117
2315
|
gridAdd: "Adicionar bloco",
|
|
2316
|
+
groupAdd: "Adicionar bloco dentro de {label}",
|
|
2118
2317
|
gridShowList: "Mostrar o grupo {label} como lista",
|
|
2119
2318
|
gridShowGrid: "Mostrar o grupo {label} como grelha",
|
|
2120
2319
|
layoutColumnsField: "Grelha do layout: campo das colunas",
|
|
@@ -2123,13 +2322,29 @@ var pt_default = {
|
|
|
2123
2322
|
layoutOff: "Sem grelha",
|
|
2124
2323
|
layoutNoMobile: "Nenhum",
|
|
2125
2324
|
layoutHelp: "Os blocos do grupo aparecem em grelha no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
2126
|
-
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
|
|
2325
|
+
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
|
|
2326
|
+
"toolbar.versions": "Hist\xF3rico de vers\xF5es",
|
|
2327
|
+
versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
|
|
2328
|
+
versionsDisabled: "O hist\xF3rico n\xE3o est\xE1 ativo para este tipo de conte\xFAdo. Pe\xE7a a um administrador para o ativar em Settings > Blockscene (settings.history.enabled).",
|
|
2329
|
+
versionsNew: "Guarde este conte\xFAdo primeiro para iniciar o hist\xF3rico.",
|
|
2330
|
+
versionsPerson: "Filtrar por pessoa",
|
|
2331
|
+
versionsEveryone: "Todas as pessoas",
|
|
2332
|
+
versionsCounts: "{total} blocos",
|
|
2333
|
+
versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registado).",
|
|
2334
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
2335
|
+
versionsPrevious: "Anterior",
|
|
2336
|
+
versionsNext: "Seguinte",
|
|
2337
|
+
versionsViewing: "A ver a vers\xE3o de {date} por {person} (s\xF3 de leitura).",
|
|
2338
|
+
versionsCurrent: "Voltar ao rascunho atual",
|
|
2339
|
+
versionsMissing: "Alguns blocos, campos, ficheiros ou rela\xE7\xF5es j\xE1 n\xE3o est\xE3o dispon\xEDveis nesta pr\xE9via.",
|
|
2340
|
+
versionsBridgeLegacy: "Esta bridge n\xE3o suporta navega\xE7\xE3o s\xF3 de leitura. A intera\xE7\xE3o est\xE1 desativada; atualize a bridge para suportar readOnly.",
|
|
2341
|
+
historyExpired: "Snapshot j\xE1 n\xE3o est\xE1 dispon\xEDvel"
|
|
2127
2342
|
};
|
|
2128
2343
|
|
|
2129
2344
|
// admin/translations/fr.json
|
|
2130
2345
|
var fr_default = {
|
|
2131
2346
|
title: "Blockscene",
|
|
2132
|
-
settings: "
|
|
2347
|
+
settings: "G\xE9n\xE9ral",
|
|
2133
2348
|
gallery: "Galerie de blocs",
|
|
2134
2349
|
search: "Rechercher des blocs",
|
|
2135
2350
|
clear: "Effacer la recherche",
|
|
@@ -2145,6 +2360,17 @@ var fr_default = {
|
|
|
2145
2360
|
moreActions: "Plus d'actions",
|
|
2146
2361
|
settingsTitle: "Blockscene",
|
|
2147
2362
|
settingsIntro: "Vignettes de la galerie, palette des wireframes et pr\xE9f\xE9rences de l'\xE9diteur. Les changements s'appliquent \xE0 la prochaine ouverture de la galerie ; aucun rebuild n'est n\xE9cessaire.",
|
|
2363
|
+
settingsGeneral: "G\xE9n\xE9ral",
|
|
2364
|
+
settingsGeneralIntro: "D\xE9finissez le comportement de Blockscene dans l'\xE9diteur et les actions disponibles sur les lignes.",
|
|
2365
|
+
settingsPreview: "Aper\xE7u de page",
|
|
2366
|
+
settingsPreviewIntro: "Connectez l'aper\xE7u du frontend et configurez ses modes, sa barre d'outils et ses largeurs responsives.",
|
|
2367
|
+
settingsContentTypes: "Types de contenu",
|
|
2368
|
+
settingsContentTypesIntro: "Choisissez o\xF9 Blockscene est actif et personnalisez l'\xE9diteur visuel pour chaque type de contenu.",
|
|
2369
|
+
settingsGallery: "Galerie de blocs",
|
|
2370
|
+
settingsGalleryIntro: "Configurez les vignettes, les couleurs des wireframes, les types et les filtres de la galerie.",
|
|
2371
|
+
settingsHistory: "Historique et corbeille",
|
|
2372
|
+
settingsHistoryIntro: "G\xE9rez les versions, la conservation des activit\xE9s et les suppressions r\xE9cup\xE9rables.",
|
|
2373
|
+
historyUnavailable: "Les r\xE9glages d'historique et de corbeille n\xE9cessitent Strapi 5.",
|
|
2148
2374
|
palette: "Palette des wireframes",
|
|
2149
2375
|
background: "Fond",
|
|
2150
2376
|
surface: "Surfaces",
|
|
@@ -2174,6 +2400,7 @@ var fr_default = {
|
|
|
2174
2400
|
showCloseAll: "Afficher \xAB Tout replier \xBB",
|
|
2175
2401
|
toggleHelp: "La barre de la zone affiche un seul bouton : avec les deux options activ\xE9es, il d\xE9plie tant qu'un bloc est repli\xE9 et sinon les replie tous ; avec une seule, il ne propose que cette action.",
|
|
2176
2402
|
showRowThumbnails: "Afficher les miniatures des blocs dans les lignes",
|
|
2403
|
+
componentRowThumbnail: "Afficher la miniature dans la ligne de l'\xE9diteur",
|
|
2177
2404
|
initialState: "\xC9tat initial des accord\xE9ons",
|
|
2178
2405
|
"states.closed": "Tous ferm\xE9s",
|
|
2179
2406
|
"states.open": "Tous ouverts",
|
|
@@ -2181,10 +2408,10 @@ var fr_default = {
|
|
|
2181
2408
|
rememberHelp: "Seuls les boutons explicites tout ouvrir / tout fermer mettent la m\xE9moire \xE0 jour, par utilisateur et navigateur. Ouvrir un seul bloc ne change rien.",
|
|
2182
2409
|
previewUrl: "URL de base de la route d'aper\xE7u",
|
|
2183
2410
|
previewUrlHelp: "URL compl\xE8te de la route d'aper\xE7u de page de votre frontend, par ex. https://site.test/block-preview/page. Laissez vide pour r\xE9utiliser l'origine de l'aper\xE7u natif de Strapi (s'il est configur\xE9 pour le type de contenu) avec /block-preview/page. La route doit impl\xE9menter le pont (voir README).",
|
|
2184
|
-
previewUrlEmpty: "Aucune URL d'aper\xE7u : les \xE9diteurs n'ont les modes Champs +
|
|
2411
|
+
previewUrlEmpty: "Aucune URL d'aper\xE7u : les \xE9diteurs n'ont les modes Champs + aper\xE7u et \xC9diteur visuel que sur les types de contenu o\xF9 l'aper\xE7u natif de Strapi est configur\xE9. Ailleurs, le menu des modes n'appara\xEEt pas.",
|
|
2185
2412
|
previewMode: "Mode d'aper\xE7u initial",
|
|
2186
|
-
"modes.form": "Champs",
|
|
2187
|
-
"modes.split": "Champs +
|
|
2413
|
+
"modes.form": "Champs uniquement",
|
|
2414
|
+
"modes.split": "Champs + aper\xE7u",
|
|
2188
2415
|
"modes.preview": "\xC9diteur visuel",
|
|
2189
2416
|
previewModeHelp: "Chaque vue d'\xE9dition s'ouvre dans ce mode, sauf si son type de contenu d\xE9finit le sien ci-dessous. L'\xE9diteur peut changer pendant l'\xE9dition ; ce choix n'est pas m\xE9moris\xE9.",
|
|
2190
2417
|
lazyEdit: "Cliquer pour modifier",
|
|
@@ -2192,8 +2419,8 @@ var fr_default = {
|
|
|
2192
2419
|
lazyFields: "Champs personnalis\xE9s charg\xE9s \xE0 la demande",
|
|
2193
2420
|
lazyEditorsHelp: "Les champs personnalis\xE9s list\xE9s affichent un aper\xE7u en lecture seule jusqu'au clic ou au focus, pour que les grandes pages s'ouvrent vite. S\xE9parez les uids par des virgules.",
|
|
2194
2421
|
lazyFieldsInvalid: "Utilisez jusqu'\xE0 {max} uids de champs personnalis\xE9s, comme plugin::ckeditor5.CKEditor ou global::mon-champ.",
|
|
2195
|
-
modeForm: "Champs",
|
|
2196
|
-
modeSplit: "Champs +
|
|
2422
|
+
modeForm: "Champs uniquement",
|
|
2423
|
+
modeSplit: "Champs + aper\xE7u",
|
|
2197
2424
|
modePreview: "\xC9diteur visuel",
|
|
2198
2425
|
previewPane: "Aper\xE7u de la page",
|
|
2199
2426
|
resize: "Redimensionner le panneau d'aper\xE7u",
|
|
@@ -2220,6 +2447,7 @@ var fr_default = {
|
|
|
2220
2447
|
denied: "Acc\xE8s refus\xE9.",
|
|
2221
2448
|
loadFailed: "Impossible de charger les param\xE8tres. Rechargez pour r\xE9essayer.",
|
|
2222
2449
|
invalidColor: "Les couleurs doivent utiliser #RRGGBB.",
|
|
2450
|
+
invalidUrl: "Les URL d'aper\xE7u doivent \xEAtre des adresses HTTP ou HTTPS compl\xE8tes.",
|
|
2223
2451
|
previewLabel: "Aper\xE7u de la palette",
|
|
2224
2452
|
removeGroup: "Supprimer le groupe",
|
|
2225
2453
|
diagTitle: "Les groupes de blocs demandent une correction ; la publication est refus\xE9e tant qu'ils ne sont pas corrig\xE9s :",
|
|
@@ -2254,6 +2482,7 @@ var fr_default = {
|
|
|
2254
2482
|
contentTypes: "Types de contenu",
|
|
2255
2483
|
contentTypesHelp: "La galerie, les accord\xE9ons et l'aper\xE7u de page fonctionnent sur ces types de contenu (ceux qui ont une Dynamic Zone). D\xE9sactivez-en un pour garder son \xE9dition native. \xAB S'ouvre en \xBB d\xE9finit le mode de d\xE9part de chaque vue d'\xE9dition de ce type ; l'\xE9diteur peut toujours changer pendant l'\xE9dition.",
|
|
2256
2484
|
typeMode: "S'ouvre en",
|
|
2485
|
+
typeAdvanced: "Options de l'\xE9diteur visuel",
|
|
2257
2486
|
modeDefault: "Par d\xE9faut ({mode})",
|
|
2258
2487
|
blockModalDone: "Termin\xE9",
|
|
2259
2488
|
crashed: "Blockscene s'est arr\xEAt\xE9 ici \xE0 cause d'une erreur. L'\xE9diteur natif n'est pas touch\xE9. Si cela se reproduit, d\xE9sactivez Blockscene dans Settings, Blockscene.",
|
|
@@ -2288,6 +2517,9 @@ var fr_default = {
|
|
|
2288
2517
|
unstar: "Retirer des favoris",
|
|
2289
2518
|
quickInsert: "Ins\xE9rer {label}",
|
|
2290
2519
|
insert: "Ins\xE9rer",
|
|
2520
|
+
starterKits: "D\xE9marrer avec un kit",
|
|
2521
|
+
starterKitsHelp: "Choisissez une structure de d\xE9part. Tout est ins\xE9r\xE9 comme brouillon modifiable et non enregistr\xE9.",
|
|
2522
|
+
startBlank: "Commencer vide",
|
|
2291
2523
|
closeDetail: "Fermer les d\xE9tails",
|
|
2292
2524
|
typology: "Typologie",
|
|
2293
2525
|
typologyAuto: "Automatique ({name})",
|
|
@@ -2342,6 +2574,11 @@ var fr_default = {
|
|
|
2342
2574
|
confirmDeleteTitle: "Supprimer le bloc",
|
|
2343
2575
|
confirmDelete: "Supprimer le bloc {name} ?",
|
|
2344
2576
|
confirmDeleteMarker: "C'est un marqueur de groupe : seul le marqueur est supprim\xE9, pas les blocs du groupe, et le groupe reste d\xE9s\xE9quilibr\xE9 jusqu'\xE0 sa correction.",
|
|
2577
|
+
confirmDeleteGroupTitle: "Supprimer le groupe",
|
|
2578
|
+
confirmDeleteGroup: "Supprimer le groupe {name} ?",
|
|
2579
|
+
confirmDeleteGroupHint: "Ce groupe contient {count, plural, one {# bloc} other {# blocs}}. Choisissez de les supprimer ou de les conserver dans la page sans le groupe.",
|
|
2580
|
+
keepGroupBlocks: "Supprimer le groupe, conserver les blocs",
|
|
2581
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Supprimer le groupe} one {Supprimer le groupe et # bloc} other {Supprimer le groupe et # blocs}}",
|
|
2345
2582
|
delete: "Supprimer",
|
|
2346
2583
|
selectBlocks: "S\xE9lectionner des blocs",
|
|
2347
2584
|
selectAll: "Tout s\xE9lectionner",
|
|
@@ -2536,6 +2773,7 @@ var fr_default = {
|
|
|
2536
2773
|
gridCellMenu: "Plus d'actions pour {label}",
|
|
2537
2774
|
removeFromGroup: "Retirer du groupe",
|
|
2538
2775
|
gridAdd: "Ajouter un bloc",
|
|
2776
|
+
groupAdd: "Ajouter un bloc dans {label}",
|
|
2539
2777
|
gridShowList: "Afficher le groupe {label} en liste",
|
|
2540
2778
|
gridShowGrid: "Afficher le groupe {label} en grille",
|
|
2541
2779
|
layoutColumnsField: "Grille de mise en page : champ des colonnes",
|
|
@@ -2544,13 +2782,29 @@ var fr_default = {
|
|
|
2544
2782
|
layoutOff: "Pas de grille",
|
|
2545
2783
|
layoutNoMobile: "Aucun",
|
|
2546
2784
|
layoutHelp: "Les blocs du groupe s'affichent en grille dans le formulaire, avec le nombre de colonnes de ce bloc.",
|
|
2547
|
-
layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes."
|
|
2785
|
+
layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes.",
|
|
2786
|
+
"toolbar.versions": "Historique des versions",
|
|
2787
|
+
versionsDenied: "Demandez \xE0 un administrateur la permission Lire l\u2019historique des versions de Blockscene.",
|
|
2788
|
+
versionsDisabled: "L\u2019historique n\u2019est pas activ\xE9 pour ce type de contenu. Demandez \xE0 un administrateur de l\u2019activer dans Settings > Blockscene (settings.history.enabled).",
|
|
2789
|
+
versionsNew: "Enregistrez d\u2019abord ce contenu pour commencer son historique.",
|
|
2790
|
+
versionsPerson: "Filtrer par personne",
|
|
2791
|
+
versionsEveryone: "Tout le monde",
|
|
2792
|
+
versionsCounts: "{total} blocs",
|
|
2793
|
+
versionsCountsMissing: "Nombre de blocs indisponible (\xE9v\xE9nement ancien ou non enregistr\xE9).",
|
|
2794
|
+
versionsPage: "Page {page} sur {count}",
|
|
2795
|
+
versionsPrevious: "Pr\xE9c\xE9dente",
|
|
2796
|
+
versionsNext: "Suivante",
|
|
2797
|
+
versionsViewing: "Version du {date} par {person} (lecture seule).",
|
|
2798
|
+
versionsCurrent: "Revenir au brouillon actuel",
|
|
2799
|
+
versionsMissing: "Certains blocs, champs, m\xE9dias ou relations ne sont plus disponibles dans cet aper\xE7u.",
|
|
2800
|
+
versionsBridgeLegacy: "Cette bridge ne prend pas en charge la navigation en lecture seule. L\u2019interaction est d\xE9sactiv\xE9e ; mettez la bridge \xE0 jour pour prendre en charge readOnly.",
|
|
2801
|
+
historyExpired: "Snapshot indisponible"
|
|
2548
2802
|
};
|
|
2549
2803
|
|
|
2550
2804
|
// admin/translations/es.json
|
|
2551
2805
|
var es_default = {
|
|
2552
2806
|
title: "Blockscene",
|
|
2553
|
-
settings: "
|
|
2807
|
+
settings: "General",
|
|
2554
2808
|
gallery: "Galer\xEDa de bloques",
|
|
2555
2809
|
search: "Buscar bloques",
|
|
2556
2810
|
clear: "Borrar b\xFAsqueda",
|
|
@@ -2566,6 +2820,17 @@ var es_default = {
|
|
|
2566
2820
|
moreActions: "M\xE1s acciones",
|
|
2567
2821
|
settingsTitle: "Blockscene",
|
|
2568
2822
|
settingsIntro: "Miniaturas de la galer\xEDa, paleta de los wireframes y preferencias del editor. Los cambios se aplican la pr\xF3xima vez que se abra la galer\xEDa; no hace falta rebuild.",
|
|
2823
|
+
settingsGeneral: "General",
|
|
2824
|
+
settingsGeneralIntro: "Define c\xF3mo funciona Blockscene en el editor y qu\xE9 acciones est\xE1n disponibles en las filas.",
|
|
2825
|
+
settingsPreview: "Vista previa de p\xE1gina",
|
|
2826
|
+
settingsPreviewIntro: "Conecta la vista previa del frontend y configura sus modos, barra de herramientas y anchos adaptables.",
|
|
2827
|
+
settingsContentTypes: "Tipos de contenido",
|
|
2828
|
+
settingsContentTypesIntro: "Elige d\xF3nde se activa Blockscene y personaliza el editor visual de cada tipo de contenido.",
|
|
2829
|
+
settingsGallery: "Galer\xEDa de bloques",
|
|
2830
|
+
settingsGalleryIntro: "Configura miniaturas, colores de wireframes, tipos y filtros de la galer\xEDa.",
|
|
2831
|
+
settingsHistory: "Historial y papelera",
|
|
2832
|
+
settingsHistoryIntro: "Controla versiones, retenci\xF3n de actividad y eliminaciones recuperables.",
|
|
2833
|
+
historyUnavailable: "La configuraci\xF3n de historial y papelera requiere Strapi 5.",
|
|
2569
2834
|
palette: "Paleta de wireframes",
|
|
2570
2835
|
background: "Fondo",
|
|
2571
2836
|
surface: "Superficies",
|
|
@@ -2595,6 +2860,7 @@ var es_default = {
|
|
|
2595
2860
|
showCloseAll: "Mostrar \xABContraer todo\xBB",
|
|
2596
2861
|
toggleHelp: "La barra de la zona muestra un solo bot\xF3n: con ambas opciones activadas expande mientras haya alg\xFAn bloque contra\xEDdo y, si no, los contrae todos; con solo una, ofrece \xFAnicamente esa acci\xF3n.",
|
|
2597
2862
|
showRowThumbnails: "Mostrar miniaturas de los bloques en las filas",
|
|
2863
|
+
componentRowThumbnail: "Mostrar miniatura en la fila del editor",
|
|
2598
2864
|
initialState: "Estado inicial de los acordeones",
|
|
2599
2865
|
"states.closed": "Todos cerrados",
|
|
2600
2866
|
"states.open": "Todos abiertos",
|
|
@@ -2602,10 +2868,10 @@ var es_default = {
|
|
|
2602
2868
|
rememberHelp: "Solo los botones expl\xEDcitos de abrir/cerrar todos actualizan la memoria, por usuario y navegador. Abrir un solo bloque no la cambia.",
|
|
2603
2869
|
previewUrl: "URL base de la ruta de vista previa",
|
|
2604
2870
|
previewUrlHelp: "URL completa de la ruta de vista previa de p\xE1gina de su frontend, p. ej. https://site.test/block-preview/page. D\xE9jela vac\xEDa para reutilizar el origen de la Vista previa nativa de Strapi (si est\xE1 configurada para el tipo de contenido) con /block-preview/page. La ruta debe implementar el puente (ver README).",
|
|
2605
|
-
previewUrlEmpty: "No hay URL de vista previa: los editores solo tienen los modos Campos +
|
|
2871
|
+
previewUrlEmpty: "No hay URL de vista previa: los editores solo tienen los modos Campos + vista previa y Editor visual en los tipos de contenido con la vista previa nativa de Strapi configurada. En los dem\xE1s no aparece el men\xFA de modos.",
|
|
2606
2872
|
previewMode: "Modo inicial de la vista previa",
|
|
2607
|
-
"modes.form": "
|
|
2608
|
-
"modes.split": "Campos +
|
|
2873
|
+
"modes.form": "Solo campos",
|
|
2874
|
+
"modes.split": "Campos + vista previa",
|
|
2609
2875
|
"modes.preview": "Editor visual",
|
|
2610
2876
|
previewModeHelp: "Cada vista de edici\xF3n se abre en este modo, salvo que su tipo de contenido defina el suyo abajo. Quien edita puede cambiarlo mientras edita; el cambio no se recuerda.",
|
|
2611
2877
|
lazyEdit: "Haz clic para editar",
|
|
@@ -2613,8 +2879,8 @@ var es_default = {
|
|
|
2613
2879
|
lazyFields: "Campos personalizados cargados bajo demanda",
|
|
2614
2880
|
lazyEditorsHelp: "Los campos personalizados de la lista muestran una vista previa de solo lectura hasta recibir un clic o el foco, para que las p\xE1ginas grandes abran r\xE1pido. Separa los uids con comas.",
|
|
2615
2881
|
lazyFieldsInvalid: "Usa hasta {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor o global::mi-campo.",
|
|
2616
|
-
modeForm: "
|
|
2617
|
-
modeSplit: "Campos +
|
|
2882
|
+
modeForm: "Solo campos",
|
|
2883
|
+
modeSplit: "Campos + vista previa",
|
|
2618
2884
|
modePreview: "Editor visual",
|
|
2619
2885
|
previewPane: "Vista previa de la p\xE1gina",
|
|
2620
2886
|
resize: "Redimensionar el panel de vista previa",
|
|
@@ -2641,6 +2907,7 @@ var es_default = {
|
|
|
2641
2907
|
denied: "Acceso denegado.",
|
|
2642
2908
|
loadFailed: "No se pudieron cargar los ajustes. Recargue para reintentar.",
|
|
2643
2909
|
invalidColor: "Los colores deben usar #RRGGBB.",
|
|
2910
|
+
invalidUrl: "Las URL de vista previa deben ser direcciones HTTP o HTTPS completas.",
|
|
2644
2911
|
previewLabel: "Vista previa de la paleta",
|
|
2645
2912
|
removeGroup: "Eliminar grupo",
|
|
2646
2913
|
diagTitle: "Los grupos de bloques necesitan atenci\xF3n; la publicaci\xF3n se rechaza hasta corregirlos:",
|
|
@@ -2675,6 +2942,7 @@ var es_default = {
|
|
|
2675
2942
|
contentTypes: "Tipos de contenido",
|
|
2676
2943
|
contentTypesHelp: 'La galer\xEDa, los acordeones y la vista previa de p\xE1gina funcionan en estos tipos de contenido (los que tienen una Dynamic Zone). Desactiva uno para dejar su edici\xF3n nativa. "Se abre en" define c\xF3mo empieza cada vista de edici\xF3n de ese tipo; quien edita puede cambiarlo mientras edita.',
|
|
2677
2944
|
typeMode: "Se abre en",
|
|
2945
|
+
typeAdvanced: "Opciones del editor visual",
|
|
2678
2946
|
modeDefault: "Predeterminado ({mode})",
|
|
2679
2947
|
blockModalDone: "Listo",
|
|
2680
2948
|
crashed: "Blockscene se detuvo aqu\xED por un error. El editor nativo no se ve afectado. Si vuelve a pasar, desactiva Blockscene en Settings, Blockscene.",
|
|
@@ -2709,6 +2977,9 @@ var es_default = {
|
|
|
2709
2977
|
unstar: "Quitar de favoritos",
|
|
2710
2978
|
quickInsert: "Insertar {label}",
|
|
2711
2979
|
insert: "Insertar",
|
|
2980
|
+
starterKits: "Comenzar con un kit",
|
|
2981
|
+
starterKitsHelp: "Elige una estructura inicial. Todo se inserta como un borrador editable y sin guardar.",
|
|
2982
|
+
startBlank: "Comenzar en blanco",
|
|
2712
2983
|
closeDetail: "Cerrar detalles",
|
|
2713
2984
|
typology: "Tipolog\xEDa",
|
|
2714
2985
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -2763,6 +3034,11 @@ var es_default = {
|
|
|
2763
3034
|
confirmDeleteTitle: "Eliminar bloque",
|
|
2764
3035
|
confirmDelete: "\xBFEliminar el bloque {name}?",
|
|
2765
3036
|
confirmDeleteMarker: "Es un marcador de grupo: solo se elimina el marcador, no los bloques del grupo, y el grupo queda desequilibrado hasta corregirlo.",
|
|
3037
|
+
confirmDeleteGroupTitle: "Eliminar grupo",
|
|
3038
|
+
confirmDeleteGroup: "\xBFEliminar el grupo {name}?",
|
|
3039
|
+
confirmDeleteGroupHint: "Este grupo contiene {count, plural, one {# bloque} other {# bloques}}. Elige si eliminarlos o conservarlos en la p\xE1gina sin el grupo.",
|
|
3040
|
+
keepGroupBlocks: "Eliminar grupo y conservar bloques",
|
|
3041
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Eliminar grupo} one {Eliminar grupo y # bloque} other {Eliminar grupo y # bloques}}",
|
|
2766
3042
|
delete: "Eliminar",
|
|
2767
3043
|
selectBlocks: "Seleccionar bloques",
|
|
2768
3044
|
selectAll: "Seleccionar todos",
|
|
@@ -2957,6 +3233,7 @@ var es_default = {
|
|
|
2957
3233
|
gridCellMenu: "M\xE1s acciones para {label}",
|
|
2958
3234
|
removeFromGroup: "Quitar del grupo",
|
|
2959
3235
|
gridAdd: "A\xF1adir un bloque",
|
|
3236
|
+
groupAdd: "A\xF1adir un bloque dentro de {label}",
|
|
2960
3237
|
gridShowList: "Mostrar el grupo {label} como lista",
|
|
2961
3238
|
gridShowGrid: "Mostrar el grupo {label} como cuadr\xEDcula",
|
|
2962
3239
|
layoutColumnsField: "Cuadr\xEDcula de dise\xF1o: campo de columnas",
|
|
@@ -2965,13 +3242,29 @@ var es_default = {
|
|
|
2965
3242
|
layoutOff: "Sin cuadr\xEDcula",
|
|
2966
3243
|
layoutNoMobile: "Ninguno",
|
|
2967
3244
|
layoutHelp: "Los bloques del grupo se muestran en cuadr\xEDcula en el formulario, con el n\xFAmero de columnas de este bloque.",
|
|
2968
|
-
layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas."
|
|
3245
|
+
layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas.",
|
|
3246
|
+
"toolbar.versions": "Historial de versiones",
|
|
3247
|
+
versionsDenied: "Pide a un administrador el permiso Leer historial de versiones de Blockscene.",
|
|
3248
|
+
versionsDisabled: "El historial no est\xE1 activo para este tipo de contenido. Pide a un administrador que lo active en Settings > Blockscene (settings.history.enabled).",
|
|
3249
|
+
versionsNew: "Guarda primero este contenido para iniciar su historial.",
|
|
3250
|
+
versionsPerson: "Filtrar por persona",
|
|
3251
|
+
versionsEveryone: "Todas las personas",
|
|
3252
|
+
versionsCounts: "{total} bloques",
|
|
3253
|
+
versionsCountsMissing: "Recuento de bloques no disponible (evento antiguo o no registrado).",
|
|
3254
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
3255
|
+
versionsPrevious: "Anterior",
|
|
3256
|
+
versionsNext: "Siguiente",
|
|
3257
|
+
versionsViewing: "Viendo la versi\xF3n del {date} por {person} (solo lectura).",
|
|
3258
|
+
versionsCurrent: "Volver al borrador actual",
|
|
3259
|
+
versionsMissing: "Algunos bloques, campos, archivos o relaciones ya no est\xE1n disponibles en esta vista previa.",
|
|
3260
|
+
versionsBridgeLegacy: "Esta bridge no admite navegaci\xF3n de solo lectura. La interacci\xF3n est\xE1 desactivada; actualiza la bridge para admitir readOnly.",
|
|
3261
|
+
historyExpired: "Snapshot ya no disponible"
|
|
2969
3262
|
};
|
|
2970
3263
|
|
|
2971
3264
|
// admin/translations/de.json
|
|
2972
3265
|
var de_default = {
|
|
2973
3266
|
title: "Blockscene",
|
|
2974
|
-
settings: "
|
|
3267
|
+
settings: "Allgemein",
|
|
2975
3268
|
gallery: "Blockgalerie",
|
|
2976
3269
|
search: "Bl\xF6cke suchen",
|
|
2977
3270
|
clear: "Suche l\xF6schen",
|
|
@@ -2987,6 +3280,17 @@ var de_default = {
|
|
|
2987
3280
|
moreActions: "Weitere Aktionen",
|
|
2988
3281
|
settingsTitle: "Blockscene",
|
|
2989
3282
|
settingsIntro: "Galerie-Vorschaubilder, Wireframe-Palette und Editor-Einstellungen. \xC4nderungen gelten beim n\xE4chsten \xD6ffnen der Galerie; kein Rebuild n\xF6tig.",
|
|
3283
|
+
settingsGeneral: "Allgemein",
|
|
3284
|
+
settingsGeneralIntro: "Lege fest, wie Blockscene im Editor arbeitet und welche Zeilenaktionen verf\xFCgbar sind.",
|
|
3285
|
+
settingsPreview: "Seitenvorschau",
|
|
3286
|
+
settingsPreviewIntro: "Verbinde die Frontend-Vorschau und konfiguriere Modi, Werkzeugleiste und responsive Breiten.",
|
|
3287
|
+
settingsContentTypes: "Inhaltstypen",
|
|
3288
|
+
settingsContentTypesIntro: "W\xE4hle, wo Blockscene aktiv ist, und passe den visuellen Editor je Inhaltstyp an.",
|
|
3289
|
+
settingsGallery: "Blockgalerie",
|
|
3290
|
+
settingsGalleryIntro: "Konfiguriere Vorschaubilder, Wireframe-Farben, Blocktypen und Filter.",
|
|
3291
|
+
settingsHistory: "Verlauf und Papierkorb",
|
|
3292
|
+
settingsHistoryIntro: "Steuere Versionen, Aufbewahrung von Aktivit\xE4ten und wiederherstellbare L\xF6schungen.",
|
|
3293
|
+
historyUnavailable: "Verlauf und Papierkorb erfordern Strapi 5.",
|
|
2990
3294
|
palette: "Wireframe-Palette",
|
|
2991
3295
|
background: "Hintergrund",
|
|
2992
3296
|
surface: "Fl\xE4chen",
|
|
@@ -3016,6 +3320,7 @@ var de_default = {
|
|
|
3016
3320
|
showCloseAll: "\u201EAlle zuklappen\u201C anzeigen",
|
|
3017
3321
|
toggleHelp: "Die Zonenleiste zeigt einen einzigen Button: Sind beide Optionen an, klappt er auf, solange ein Block zugeklappt ist, sonst klappt er alle zu; ist nur eine an, bietet er nur diese Aktion.",
|
|
3018
3322
|
showRowThumbnails: "Blockvorschaubilder in den Zeilen anzeigen",
|
|
3323
|
+
componentRowThumbnail: "Vorschaubild in der Editorzeile anzeigen",
|
|
3019
3324
|
initialState: "Anfangszustand der Akkordeons",
|
|
3020
3325
|
"states.closed": "Alle geschlossen",
|
|
3021
3326
|
"states.open": "Alle ge\xF6ffnet",
|
|
@@ -3023,10 +3328,10 @@ var de_default = {
|
|
|
3023
3328
|
rememberHelp: "Nur die expliziten Schaltfl\xE4chen \u201Ealle \xF6ffnen/schlie\xDFen\u201C aktualisieren die Erinnerung, pro Benutzer und Browser. Das \xD6ffnen eines einzelnen Blocks \xE4ndert nichts.",
|
|
3024
3329
|
previewUrl: "Basis-URL der Vorschauroute",
|
|
3025
3330
|
previewUrlHelp: "Vollst\xE4ndige URL der Seitenvorschau-Route Ihres Frontends, z. B. https://site.test/block-preview/page. Leer lassen, um den Ursprung der nativen Strapi-Vorschau (wenn f\xFCr den Inhaltstyp konfiguriert) mit /block-preview/page zu verwenden. Die Route muss die Bridge implementieren (siehe README).",
|
|
3026
|
-
previewUrlEmpty: "Keine Vorschau-URL gesetzt: Redakteure erhalten die Modi Felder +
|
|
3331
|
+
previewUrlEmpty: "Keine Vorschau-URL gesetzt: Redakteure erhalten die Modi Felder + Vorschau und Visueller Editor nur bei Inhaltstypen, f\xFCr die Strapis native Vorschau konfiguriert ist. Sonst wird das Modusmen\xFC nicht angezeigt.",
|
|
3027
3332
|
previewMode: "Anf\xE4nglicher Vorschaumodus",
|
|
3028
|
-
"modes.form": "Felder",
|
|
3029
|
-
"modes.split": "Felder +
|
|
3333
|
+
"modes.form": "Nur Felder",
|
|
3334
|
+
"modes.split": "Felder + Vorschau",
|
|
3030
3335
|
"modes.preview": "Visueller Editor",
|
|
3031
3336
|
previewModeHelp: "Jede Bearbeitungsansicht \xF6ffnet in diesem Modus, au\xDFer ihr Inhaltstyp legt unten einen eigenen fest. Beim Bearbeiten l\xE4sst sich wechseln; der Wechsel wird nicht gespeichert.",
|
|
3032
3337
|
lazyEdit: "Zum Bearbeiten klicken",
|
|
@@ -3034,8 +3339,8 @@ var de_default = {
|
|
|
3034
3339
|
lazyFields: "Bei Bedarf geladene benutzerdefinierte Felder",
|
|
3035
3340
|
lazyEditorsHelp: "Die aufgef\xFChrten benutzerdefinierten Felder zeigen eine schreibgesch\xFCtzte Vorschau, bis sie angeklickt oder fokussiert werden, damit gro\xDFe Seiten schnell \xF6ffnen. Uids durch Kommas trennen.",
|
|
3036
3341
|
lazyFieldsInvalid: "Bis zu {max} Uids benutzerdefinierter Felder verwenden, z. B. plugin::ckeditor5.CKEditor oder global::mein-feld.",
|
|
3037
|
-
modeForm: "Felder",
|
|
3038
|
-
modeSplit: "Felder +
|
|
3342
|
+
modeForm: "Nur Felder",
|
|
3343
|
+
modeSplit: "Felder + Vorschau",
|
|
3039
3344
|
modePreview: "Visueller Editor",
|
|
3040
3345
|
previewPane: "Seitenvorschau",
|
|
3041
3346
|
resize: "Vorschaubereich anpassen",
|
|
@@ -3062,6 +3367,7 @@ var de_default = {
|
|
|
3062
3367
|
denied: "Zugriff verweigert.",
|
|
3063
3368
|
loadFailed: "Einstellungen konnten nicht geladen werden. Neu laden, um es erneut zu versuchen.",
|
|
3064
3369
|
invalidColor: "Farben m\xFCssen #RRGGBB verwenden.",
|
|
3370
|
+
invalidUrl: "Vorschau-URLs m\xFCssen vollst\xE4ndige HTTP- oder HTTPS-Adressen sein.",
|
|
3065
3371
|
previewLabel: "Palettenvorschau",
|
|
3066
3372
|
removeGroup: "Gruppe entfernen",
|
|
3067
3373
|
diagTitle: "Blockgruppen m\xFCssen korrigiert werden; das Ver\xF6ffentlichen wird bis dahin abgelehnt:",
|
|
@@ -3096,6 +3402,7 @@ var de_default = {
|
|
|
3096
3402
|
contentTypes: "Inhaltstypen",
|
|
3097
3403
|
contentTypesHelp: "Galerie, Akkordeons und Seitenvorschau arbeiten auf diesen Inhaltstypen (denen mit einer Dynamic Zone). Schalte einen aus, um seine Bearbeitung nativ zu lassen. \u201E\xD6ffnet in\u201C bestimmt, wie jede Bearbeitungsansicht dieses Typs startet; beim Bearbeiten l\xE4sst sich weiter wechseln.",
|
|
3098
3404
|
typeMode: "\xD6ffnet in",
|
|
3405
|
+
typeAdvanced: "Optionen des visuellen Editors",
|
|
3099
3406
|
modeDefault: "Standard ({mode})",
|
|
3100
3407
|
blockModalDone: "Fertig",
|
|
3101
3408
|
crashed: "Blockscene wurde hier wegen eines Fehlers beendet. Der native Editor ist nicht betroffen. Passiert es erneut, schalte Blockscene unter Settings, Blockscene aus.",
|
|
@@ -3130,6 +3437,9 @@ var de_default = {
|
|
|
3130
3437
|
unstar: "Aus Favoriten entfernen",
|
|
3131
3438
|
quickInsert: "{label} einf\xFCgen",
|
|
3132
3439
|
insert: "Einf\xFCgen",
|
|
3440
|
+
starterKits: "Mit einem Kit starten",
|
|
3441
|
+
starterKitsHelp: "W\xE4hlen Sie eine Ausgangsstruktur. Alles wird als ungespeicherter, bearbeitbarer Entwurf eingef\xFCgt.",
|
|
3442
|
+
startBlank: "Leer beginnen",
|
|
3133
3443
|
closeDetail: "Details schlie\xDFen",
|
|
3134
3444
|
typology: "Typologie",
|
|
3135
3445
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -3184,6 +3494,11 @@ var de_default = {
|
|
|
3184
3494
|
confirmDeleteTitle: "Block l\xF6schen",
|
|
3185
3495
|
confirmDelete: "Block {name} l\xF6schen?",
|
|
3186
3496
|
confirmDeleteMarker: "Dies ist eine Gruppenmarkierung: Nur die Markierung wird entfernt, nicht die Bl\xF6cke der Gruppe, und die Gruppe bleibt unausgeglichen, bis sie korrigiert ist.",
|
|
3497
|
+
confirmDeleteGroupTitle: "Gruppe l\xF6schen",
|
|
3498
|
+
confirmDeleteGroup: "Gruppe {name} l\xF6schen?",
|
|
3499
|
+
confirmDeleteGroupHint: "Diese Gruppe enth\xE4lt {count, plural, one {# Block} other {# Bl\xF6cke}}. L\xF6schen Sie sie oder behalten Sie sie ohne die Gruppe auf der Seite.",
|
|
3500
|
+
keepGroupBlocks: "Gruppe entfernen, Bl\xF6cke behalten",
|
|
3501
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Gruppe l\xF6schen} one {Gruppe und # Block l\xF6schen} other {Gruppe und # Bl\xF6cke l\xF6schen}}",
|
|
3187
3502
|
delete: "L\xF6schen",
|
|
3188
3503
|
selectBlocks: "Bl\xF6cke ausw\xE4hlen",
|
|
3189
3504
|
selectAll: "Alle ausw\xE4hlen",
|
|
@@ -3378,6 +3693,7 @@ var de_default = {
|
|
|
3378
3693
|
gridCellMenu: "Weitere Aktionen f\xFCr {label}",
|
|
3379
3694
|
removeFromGroup: "Aus der Gruppe entfernen",
|
|
3380
3695
|
gridAdd: "Block hinzuf\xFCgen",
|
|
3696
|
+
groupAdd: "Block in {label} hinzuf\xFCgen",
|
|
3381
3697
|
gridShowList: "Gruppe {label} als Liste anzeigen",
|
|
3382
3698
|
gridShowGrid: "Gruppe {label} als Raster anzeigen",
|
|
3383
3699
|
layoutColumnsField: "Layout-Raster: Feld der Spalten",
|
|
@@ -3386,13 +3702,29 @@ var de_default = {
|
|
|
3386
3702
|
layoutOff: "Kein Raster",
|
|
3387
3703
|
layoutNoMobile: "Keines",
|
|
3388
3704
|
layoutHelp: "Die Bl\xF6cke der Gruppe erscheinen im Formular als Raster, mit der Spaltenzahl dieses Blocks.",
|
|
3389
|
-
layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann."
|
|
3705
|
+
layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann.",
|
|
3706
|
+
"toolbar.versions": "Versionsverlauf",
|
|
3707
|
+
versionsDenied: "Bitte einen Administrator um die Blockscene-Berechtigung zum Lesen des Versionsverlaufs.",
|
|
3708
|
+
versionsDisabled: "Der Verlauf ist f\xFCr diesen Inhaltstyp nicht aktiviert. Bitte einen Administrator, ihn unter Settings > Blockscene zu aktivieren (settings.history.enabled).",
|
|
3709
|
+
versionsNew: "Speichere diesen Eintrag zuerst, um seinen Verlauf zu beginnen.",
|
|
3710
|
+
versionsPerson: "Nach Person filtern",
|
|
3711
|
+
versionsEveryone: "Alle Personen",
|
|
3712
|
+
versionsCounts: "{total} Bl\xF6cke",
|
|
3713
|
+
versionsCountsMissing: "Blockanzahl nicht verf\xFCgbar (\xE4lteres oder nicht aufgezeichnetes Ereignis).",
|
|
3714
|
+
versionsPage: "Seite {page} von {count}",
|
|
3715
|
+
versionsPrevious: "Zur\xFCck",
|
|
3716
|
+
versionsNext: "Weiter",
|
|
3717
|
+
versionsViewing: "Version vom {date} von {person} (schreibgesch\xFCtzt).",
|
|
3718
|
+
versionsCurrent: "Zur\xFCck zum aktuellen Entwurf",
|
|
3719
|
+
versionsMissing: "Einige Bl\xF6cke, Felder, Medien oder Beziehungen sind in dieser Vorschau nicht mehr verf\xFCgbar.",
|
|
3720
|
+
versionsBridgeLegacy: "Diese Bridge unterst\xFCtzt keine schreibgesch\xFCtzte Navigation. Interaktion ist deaktiviert; aktualisiere die Bridge f\xFCr readOnly.",
|
|
3721
|
+
historyExpired: "Snapshot nicht mehr verf\xFCgbar"
|
|
3390
3722
|
};
|
|
3391
3723
|
|
|
3392
3724
|
// admin/translations/it.json
|
|
3393
3725
|
var it_default = {
|
|
3394
3726
|
title: "Blockscene",
|
|
3395
|
-
settings: "
|
|
3727
|
+
settings: "Generali",
|
|
3396
3728
|
gallery: "Galleria dei blocchi",
|
|
3397
3729
|
search: "Cerca blocchi",
|
|
3398
3730
|
clear: "Cancella ricerca",
|
|
@@ -3408,6 +3740,17 @@ var it_default = {
|
|
|
3408
3740
|
moreActions: "Altre azioni",
|
|
3409
3741
|
settingsTitle: "Blockscene",
|
|
3410
3742
|
settingsIntro: "Miniature della galleria, palette dei wireframe e preferenze dell'editor. Le modifiche valgono alla prossima apertura della galleria; non serve alcun rebuild.",
|
|
3743
|
+
settingsGeneral: "Generali",
|
|
3744
|
+
settingsGeneralIntro: "Configura il comportamento di Blockscene nell'editor e le azioni disponibili sulle righe.",
|
|
3745
|
+
settingsPreview: "Anteprima pagina",
|
|
3746
|
+
settingsPreviewIntro: "Collega l'anteprima del frontend e configura modalit\xE0, barra degli strumenti e larghezze responsive.",
|
|
3747
|
+
settingsContentTypes: "Tipi di contenuto",
|
|
3748
|
+
settingsContentTypesIntro: "Scegli dove attivare Blockscene e personalizza l'editor visivo per ogni tipo di contenuto.",
|
|
3749
|
+
settingsGallery: "Galleria dei blocchi",
|
|
3750
|
+
settingsGalleryIntro: "Configura miniature, colori dei wireframe, tipi e filtri della galleria.",
|
|
3751
|
+
settingsHistory: "Cronologia e cestino",
|
|
3752
|
+
settingsHistoryIntro: "Gestisci versioni, conservazione delle attivit\xE0 ed eliminazioni recuperabili.",
|
|
3753
|
+
historyUnavailable: "Le impostazioni di cronologia e cestino richiedono Strapi 5.",
|
|
3411
3754
|
palette: "Palette dei wireframe",
|
|
3412
3755
|
background: "Sfondo",
|
|
3413
3756
|
surface: "Superfici",
|
|
@@ -3437,6 +3780,7 @@ var it_default = {
|
|
|
3437
3780
|
showCloseAll: 'Mostra "Comprimi tutto"',
|
|
3438
3781
|
toggleHelp: "La barra della zona mostra un solo pulsante: con entrambe le opzioni attive espande finch\xE9 c'\xE8 un blocco compresso, altrimenti li comprime tutti; con una sola, offre solo quell'azione.",
|
|
3439
3782
|
showRowThumbnails: "Mostra le miniature dei blocchi nelle righe",
|
|
3783
|
+
componentRowThumbnail: "Mostra la miniatura nella riga dell'editor",
|
|
3440
3784
|
initialState: "Stato iniziale delle fisarmoniche",
|
|
3441
3785
|
"states.closed": "Tutte chiuse",
|
|
3442
3786
|
"states.open": "Tutte aperte",
|
|
@@ -3444,10 +3788,10 @@ var it_default = {
|
|
|
3444
3788
|
rememberHelp: "Solo i pulsanti espliciti apri tutti / chiudi tutti aggiornano la memoria, per utente e browser. Aprire un singolo blocco non la cambia.",
|
|
3445
3789
|
previewUrl: "URL di base della route di anteprima",
|
|
3446
3790
|
previewUrlHelp: "URL completo della route di anteprima pagina del tuo frontend, ad es. https://site.test/block-preview/page. Lascia vuoto per riutilizzare l'origine dell'Anteprima nativa di Strapi (se configurata per il tipo di contenuto) con /block-preview/page. La route deve implementare il bridge (vedi README).",
|
|
3447
|
-
previewUrlEmpty: "Nessun URL di anteprima impostato: gli editor hanno le modalit\xE0 Campi +
|
|
3791
|
+
previewUrlEmpty: "Nessun URL di anteprima impostato: gli editor hanno le modalit\xE0 Campi + anteprima ed Editor visivo solo sui tipi di contenuto con l'anteprima nativa di Strapi configurata. Altrove il menu delle modalit\xE0 non compare.",
|
|
3448
3792
|
previewMode: "Modalit\xE0 iniziale dell'anteprima",
|
|
3449
|
-
"modes.form": "
|
|
3450
|
-
"modes.split": "Campi +
|
|
3793
|
+
"modes.form": "Solo campi",
|
|
3794
|
+
"modes.split": "Campi + anteprima",
|
|
3451
3795
|
"modes.preview": "Editor visivo",
|
|
3452
3796
|
previewModeHelp: "Ogni vista di modifica si apre in questo modo, a meno che il suo tipo di contenuto ne imposti uno proprio qui sotto. Durante la modifica si pu\xF2 cambiare; la scelta non viene ricordata.",
|
|
3453
3797
|
lazyEdit: "Fai clic per modificare",
|
|
@@ -3455,8 +3799,8 @@ var it_default = {
|
|
|
3455
3799
|
lazyFields: "Campi personalizzati caricati su richiesta",
|
|
3456
3800
|
lazyEditorsHelp: "I campi personalizzati elencati mostrano un'anteprima di sola lettura finch\xE9 non ricevono un clic o il focus, cos\xEC le pagine grandi si aprono in fretta. Separa gli uid con virgole.",
|
|
3457
3801
|
lazyFieldsInvalid: "Usa fino a {max} uid di campi personalizzati, come plugin::ckeditor5.CKEditor o global::mio-campo.",
|
|
3458
|
-
modeForm: "
|
|
3459
|
-
modeSplit: "Campi +
|
|
3802
|
+
modeForm: "Solo campi",
|
|
3803
|
+
modeSplit: "Campi + anteprima",
|
|
3460
3804
|
modePreview: "Editor visivo",
|
|
3461
3805
|
previewPane: "Anteprima della pagina",
|
|
3462
3806
|
resize: "Ridimensiona il pannello di anteprima",
|
|
@@ -3483,6 +3827,7 @@ var it_default = {
|
|
|
3483
3827
|
denied: "Accesso negato.",
|
|
3484
3828
|
loadFailed: "Impossibile caricare le impostazioni. Ricarica per riprovare.",
|
|
3485
3829
|
invalidColor: "I colori devono usare #RRGGBB.",
|
|
3830
|
+
invalidUrl: "Gli URL di anteprima devono essere indirizzi HTTP o HTTPS completi.",
|
|
3486
3831
|
previewLabel: "Anteprima della palette",
|
|
3487
3832
|
removeGroup: "Rimuovi gruppo",
|
|
3488
3833
|
diagTitle: "I gruppi di blocchi richiedono attenzione; la pubblicazione \xE8 rifiutata finch\xE9 non vengono corretti:",
|
|
@@ -3517,6 +3862,7 @@ var it_default = {
|
|
|
3517
3862
|
contentTypes: "Tipi di contenuto",
|
|
3518
3863
|
contentTypesHelp: "La galleria, le fisarmoniche e l'anteprima di pagina funzionano su questi tipi di contenuto (quelli con una Dynamic Zone). Disattivane uno per lasciarne la modifica nativa. \xABSi apre in\xBB \xE8 il modo in cui parte ogni vista di modifica di quel tipo; durante la modifica si pu\xF2 sempre cambiare.",
|
|
3519
3864
|
typeMode: "Si apre in",
|
|
3865
|
+
typeAdvanced: "Opzioni dell'editor visivo",
|
|
3520
3866
|
modeDefault: "Predefinito ({mode})",
|
|
3521
3867
|
blockModalDone: "Fatto",
|
|
3522
3868
|
crashed: "Blockscene si \xE8 fermato qui a causa di un errore. L'editor nativo non \xE8 toccato. Se succede di nuovo, disattiva Blockscene in Settings, Blockscene.",
|
|
@@ -3551,6 +3897,9 @@ var it_default = {
|
|
|
3551
3897
|
unstar: "Rimuovi dai preferiti",
|
|
3552
3898
|
quickInsert: "Inserisci {label}",
|
|
3553
3899
|
insert: "Inserisci",
|
|
3900
|
+
starterKits: "Inizia con un kit",
|
|
3901
|
+
starterKitsHelp: "Scegli una struttura iniziale. Tutto viene inserito come bozza modificabile e non salvata.",
|
|
3902
|
+
startBlank: "Inizia da zero",
|
|
3554
3903
|
closeDetail: "Chiudi dettagli",
|
|
3555
3904
|
typology: "Tipologia",
|
|
3556
3905
|
typologyAuto: "Automatica ({name})",
|
|
@@ -3605,6 +3954,11 @@ var it_default = {
|
|
|
3605
3954
|
confirmDeleteTitle: "Elimina blocco",
|
|
3606
3955
|
confirmDelete: "Eliminare il blocco {name}?",
|
|
3607
3956
|
confirmDeleteMarker: "\xC8 un marcatore di gruppo: viene rimosso solo il marcatore, non i blocchi del gruppo, e il gruppo resta sbilanciato finch\xE9 non viene corretto.",
|
|
3957
|
+
confirmDeleteGroupTitle: "Elimina gruppo",
|
|
3958
|
+
confirmDeleteGroup: "Eliminare il gruppo {name}?",
|
|
3959
|
+
confirmDeleteGroupHint: "Questo gruppo contiene {count, plural, one {# blocco} other {# blocchi}}. Scegli se eliminarli o mantenerli nella pagina senza il gruppo.",
|
|
3960
|
+
keepGroupBlocks: "Rimuovi il gruppo, mantieni i blocchi",
|
|
3961
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Elimina gruppo} one {Elimina gruppo e # blocco} other {Elimina gruppo e # blocchi}}",
|
|
3608
3962
|
delete: "Elimina",
|
|
3609
3963
|
selectBlocks: "Seleziona blocchi",
|
|
3610
3964
|
selectAll: "Seleziona tutti",
|
|
@@ -3799,6 +4153,7 @@ var it_default = {
|
|
|
3799
4153
|
gridCellMenu: "Altre azioni per {label}",
|
|
3800
4154
|
removeFromGroup: "Rimuovi dal gruppo",
|
|
3801
4155
|
gridAdd: "Aggiungi un blocco",
|
|
4156
|
+
groupAdd: "Aggiungi un blocco dentro {label}",
|
|
3802
4157
|
gridShowList: "Mostra il gruppo {label} come elenco",
|
|
3803
4158
|
gridShowGrid: "Mostra il gruppo {label} come griglia",
|
|
3804
4159
|
layoutColumnsField: "Griglia di layout: campo delle colonne",
|
|
@@ -3807,13 +4162,29 @@ var it_default = {
|
|
|
3807
4162
|
layoutOff: "Nessuna griglia",
|
|
3808
4163
|
layoutNoMobile: "Nessuno",
|
|
3809
4164
|
layoutHelp: "I blocchi del gruppo appaiono in griglia nel modulo, con il numero di colonne di questo blocco.",
|
|
3810
|
-
layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne."
|
|
4165
|
+
layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne.",
|
|
4166
|
+
"toolbar.versions": "Cronologia delle versioni",
|
|
4167
|
+
versionsDenied: "Chiedi a un amministratore il permesso Leggere la cronologia delle versioni di Blockscene.",
|
|
4168
|
+
versionsDisabled: "La cronologia non \xE8 attiva per questo tipo di contenuto. Chiedi a un amministratore di attivarla in Settings > Blockscene (settings.history.enabled).",
|
|
4169
|
+
versionsNew: "Salva prima questo contenuto per avviare la cronologia.",
|
|
4170
|
+
versionsPerson: "Filtra per persona",
|
|
4171
|
+
versionsEveryone: "Tutte le persone",
|
|
4172
|
+
versionsCounts: "{total} blocchi",
|
|
4173
|
+
versionsCountsMissing: "Conteggio dei blocchi non disponibile (evento vecchio o non registrato).",
|
|
4174
|
+
versionsPage: "Pagina {page} di {count}",
|
|
4175
|
+
versionsPrevious: "Precedente",
|
|
4176
|
+
versionsNext: "Successiva",
|
|
4177
|
+
versionsViewing: "Versione del {date} di {person} (sola lettura).",
|
|
4178
|
+
versionsCurrent: "Torna alla bozza attuale",
|
|
4179
|
+
versionsMissing: "Alcuni blocchi, campi, media o relazioni non sono pi\xF9 disponibili in questa anteprima.",
|
|
4180
|
+
versionsBridgeLegacy: "Questa bridge non supporta la navigazione in sola lettura. Interazione disattivata; aggiorna la bridge per supportare readOnly.",
|
|
4181
|
+
historyExpired: "Snapshot non pi\xF9 disponibile"
|
|
3811
4182
|
};
|
|
3812
4183
|
|
|
3813
4184
|
// admin/translations/nl.json
|
|
3814
4185
|
var nl_default = {
|
|
3815
4186
|
title: "Blockscene",
|
|
3816
|
-
settings: "
|
|
4187
|
+
settings: "Algemeen",
|
|
3817
4188
|
gallery: "Blokkengalerij",
|
|
3818
4189
|
search: "Blokken zoeken",
|
|
3819
4190
|
clear: "Zoekopdracht wissen",
|
|
@@ -3829,6 +4200,17 @@ var nl_default = {
|
|
|
3829
4200
|
moreActions: "Meer acties",
|
|
3830
4201
|
settingsTitle: "Blockscene",
|
|
3831
4202
|
settingsIntro: "Galerijminiaturen, wireframe-palet en editorvoorkeuren. Wijzigingen gelden bij de volgende opening van de galerij; geen rebuild nodig.",
|
|
4203
|
+
settingsGeneral: "Algemeen",
|
|
4204
|
+
settingsGeneralIntro: "Bepaal hoe Blockscene in de editor werkt en welke rijacties beschikbaar zijn.",
|
|
4205
|
+
settingsPreview: "Paginavoorbeeld",
|
|
4206
|
+
settingsPreviewIntro: "Koppel het frontendvoorbeeld en configureer modi, werkbalk en responsieve breedtes.",
|
|
4207
|
+
settingsContentTypes: "Contenttypes",
|
|
4208
|
+
settingsContentTypesIntro: "Kies waar Blockscene actief is en pas de visuele editor per contenttype aan.",
|
|
4209
|
+
settingsGallery: "Blokkengalerij",
|
|
4210
|
+
settingsGalleryIntro: "Configureer miniaturen, wireframekleuren, bloktypen en filters.",
|
|
4211
|
+
settingsHistory: "Geschiedenis en prullenbak",
|
|
4212
|
+
settingsHistoryIntro: "Beheer versies, activiteitsbewaring en herstelbare verwijderingen.",
|
|
4213
|
+
historyUnavailable: "Instellingen voor geschiedenis en prullenbak vereisen Strapi 5.",
|
|
3832
4214
|
palette: "Wireframe-palet",
|
|
3833
4215
|
background: "Achtergrond",
|
|
3834
4216
|
surface: "Vlakken",
|
|
@@ -3858,6 +4240,7 @@ var nl_default = {
|
|
|
3858
4240
|
showCloseAll: '"Alles inklappen" tonen',
|
|
3859
4241
|
toggleHelp: "De zonebalk toont \xE9\xE9n knop: staan beide opties aan, dan klapt hij uit zolang er een blok ingeklapt is en klapt hij anders alles in; staat er maar \xE9\xE9n aan, dan biedt hij alleen die actie.",
|
|
3860
4242
|
showRowThumbnails: "Blokminiaturen in de rijen tonen",
|
|
4243
|
+
componentRowThumbnail: "Miniatuur in de editorrij tonen",
|
|
3861
4244
|
initialState: "Beginstand van de accordeons",
|
|
3862
4245
|
"states.closed": "Alle gesloten",
|
|
3863
4246
|
"states.open": "Alle open",
|
|
@@ -3865,10 +4248,10 @@ var nl_default = {
|
|
|
3865
4248
|
rememberHelp: "Alleen de expliciete knoppen alles openen / alles sluiten werken het geheugen bij, per gebruiker en browser. E\xE9n blok openen verandert niets.",
|
|
3866
4249
|
previewUrl: "Basis-URL van de voorbeeldroute",
|
|
3867
4250
|
previewUrlHelp: "Volledige URL van de paginavoorbeeldroute van uw frontend, bijv. https://site.test/block-preview/page. Laat leeg om de oorsprong van Strapi's native Preview (indien geconfigureerd voor het contenttype) met /block-preview/page te hergebruiken. De route moet de bridge implementeren (zie README).",
|
|
3868
|
-
previewUrlEmpty: "Geen preview-URL ingesteld: redacteuren krijgen de modi Velden +
|
|
4251
|
+
previewUrlEmpty: "Geen preview-URL ingesteld: redacteuren krijgen de modi Velden + voorbeeld en Visuele editor alleen bij inhoudstypes waarvoor de native Preview van Strapi is ingesteld. Elders verschijnt het modusmenu niet.",
|
|
3869
4252
|
previewMode: "Beginmodus van het voorbeeld",
|
|
3870
|
-
"modes.form": "
|
|
3871
|
-
"modes.split": "Velden +
|
|
4253
|
+
"modes.form": "Alleen velden",
|
|
4254
|
+
"modes.split": "Velden + voorbeeld",
|
|
3872
4255
|
"modes.preview": "Visuele editor",
|
|
3873
4256
|
previewModeHelp: "Elke bewerkweergave opent in deze modus, tenzij het contenttype hieronder een eigen modus instelt. Tijdens het bewerken kan je wisselen; die keuze wordt niet onthouden.",
|
|
3874
4257
|
lazyEdit: "Klik om te bewerken",
|
|
@@ -3876,8 +4259,8 @@ var nl_default = {
|
|
|
3876
4259
|
lazyFields: "Aangepaste velden die op aanvraag laden",
|
|
3877
4260
|
lazyEditorsHelp: "De vermelde aangepaste velden tonen een alleen-lezen voorbeeld tot ze worden aangeklikt of focus krijgen, zodat grote pagina's snel openen. Scheid uids met komma's.",
|
|
3878
4261
|
lazyFieldsInvalid: "Gebruik maximaal {max} uids van aangepaste velden, zoals plugin::ckeditor5.CKEditor of global::mijn-veld.",
|
|
3879
|
-
modeForm: "
|
|
3880
|
-
modeSplit: "Velden +
|
|
4262
|
+
modeForm: "Alleen velden",
|
|
4263
|
+
modeSplit: "Velden + voorbeeld",
|
|
3881
4264
|
modePreview: "Visuele editor",
|
|
3882
4265
|
previewPane: "Paginavoorbeeld",
|
|
3883
4266
|
resize: "Voorbeeldpaneel aanpassen",
|
|
@@ -3904,6 +4287,7 @@ var nl_default = {
|
|
|
3904
4287
|
denied: "Toegang geweigerd.",
|
|
3905
4288
|
loadFailed: "Instellingen konden niet worden geladen. Herlaad om opnieuw te proberen.",
|
|
3906
4289
|
invalidColor: "Kleuren moeten #RRGGBB gebruiken.",
|
|
4290
|
+
invalidUrl: "Voorbeeld-URL's moeten volledige HTTP- of HTTPS-adressen zijn.",
|
|
3907
4291
|
previewLabel: "Paletvoorbeeld",
|
|
3908
4292
|
removeGroup: "Groep verwijderen",
|
|
3909
4293
|
diagTitle: "Blokgroepen vragen aandacht; publiceren wordt geweigerd tot ze hersteld zijn:",
|
|
@@ -3938,6 +4322,7 @@ var nl_default = {
|
|
|
3938
4322
|
contentTypes: "Contenttypes",
|
|
3939
4323
|
contentTypesHelp: 'De galerij, accordeons en paginavoorbeeld werken op deze contenttypes (die met een Dynamic Zone). Zet er een uit om de bewerking native te laten. "Opent in" bepaalt hoe elke bewerkweergave van dat type start; tijdens het bewerken kan je nog wisselen.',
|
|
3940
4324
|
typeMode: "Opent in",
|
|
4325
|
+
typeAdvanced: "Opties voor de visuele editor",
|
|
3941
4326
|
modeDefault: "Standaard ({mode})",
|
|
3942
4327
|
blockModalDone: "Klaar",
|
|
3943
4328
|
crashed: "Blockscene is hier gestopt door een fout. De native editor blijft werken. Gebeurt het opnieuw, zet Blockscene uit in Settings, Blockscene.",
|
|
@@ -3972,6 +4357,9 @@ var nl_default = {
|
|
|
3972
4357
|
unstar: "Uit favorieten verwijderen",
|
|
3973
4358
|
quickInsert: "{label} invoegen",
|
|
3974
4359
|
insert: "Invoegen",
|
|
4360
|
+
starterKits: "Start met een kit",
|
|
4361
|
+
starterKitsHelp: "Kies een beginstructuur. Alles wordt ingevoegd als een onopgeslagen, bewerkbaar concept.",
|
|
4362
|
+
startBlank: "Leeg beginnen",
|
|
3975
4363
|
closeDetail: "Details sluiten",
|
|
3976
4364
|
typology: "Typologie",
|
|
3977
4365
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -4026,6 +4414,11 @@ var nl_default = {
|
|
|
4026
4414
|
confirmDeleteTitle: "Blok verwijderen",
|
|
4027
4415
|
confirmDelete: "Blok {name} verwijderen?",
|
|
4028
4416
|
confirmDeleteMarker: "Dit is een groepsmarkering: alleen de markering wordt verwijderd, niet de blokken in de groep, en de groep blijft onevenwichtig tot hij hersteld is.",
|
|
4417
|
+
confirmDeleteGroupTitle: "Groep verwijderen",
|
|
4418
|
+
confirmDeleteGroup: "Groep {name} verwijderen?",
|
|
4419
|
+
confirmDeleteGroupHint: "Deze groep bevat {count, plural, one {# blok} other {# blokken}}. Verwijder ze of behoud ze op de pagina zonder de groep.",
|
|
4420
|
+
keepGroupBlocks: "Groep verwijderen, blokken behouden",
|
|
4421
|
+
deleteGroupAndBlocks: "{count, plural, =0 {Groep verwijderen} one {Groep en # blok verwijderen} other {Groep en # blokken verwijderen}}",
|
|
4029
4422
|
delete: "Verwijderen",
|
|
4030
4423
|
selectBlocks: "Blokken selecteren",
|
|
4031
4424
|
selectAll: "Alles selecteren",
|
|
@@ -4220,6 +4613,7 @@ var nl_default = {
|
|
|
4220
4613
|
gridCellMenu: "Meer acties voor {label}",
|
|
4221
4614
|
removeFromGroup: "Uit de groep halen",
|
|
4222
4615
|
gridAdd: "Blok toevoegen",
|
|
4616
|
+
groupAdd: "Blok toevoegen binnen {label}",
|
|
4223
4617
|
gridShowList: "Groep {label} als lijst tonen",
|
|
4224
4618
|
gridShowGrid: "Groep {label} als raster tonen",
|
|
4225
4619
|
layoutColumnsField: "Layoutraster: veld met kolommen",
|
|
@@ -4228,7 +4622,23 @@ var nl_default = {
|
|
|
4228
4622
|
layoutOff: "Geen raster",
|
|
4229
4623
|
layoutNoMobile: "Geen",
|
|
4230
4624
|
layoutHelp: "De blokken van de groep verschijnen als raster in het formulier, met het aantal kolommen van dit blok.",
|
|
4231
|
-
layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten."
|
|
4625
|
+
layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten.",
|
|
4626
|
+
"toolbar.versions": "Versiegeschiedenis",
|
|
4627
|
+
versionsDenied: "Vraag een beheerder om de Blockscene-machtiging Versiegeschiedenis lezen.",
|
|
4628
|
+
versionsDisabled: "Geschiedenis is niet ingeschakeld voor dit inhoudstype. Vraag een beheerder dit in Settings > Blockscene in te schakelen (settings.history.enabled).",
|
|
4629
|
+
versionsNew: "Sla dit item eerst op om de geschiedenis te starten.",
|
|
4630
|
+
versionsPerson: "Filter op persoon",
|
|
4631
|
+
versionsEveryone: "Iedereen",
|
|
4632
|
+
versionsCounts: "{total} blokken",
|
|
4633
|
+
versionsCountsMissing: "Aantal blokken niet beschikbaar (oudere of niet vastgelegde gebeurtenis).",
|
|
4634
|
+
versionsPage: "Pagina {page} van {count}",
|
|
4635
|
+
versionsPrevious: "Vorige",
|
|
4636
|
+
versionsNext: "Volgende",
|
|
4637
|
+
versionsViewing: "Versie van {date} door {person} bekijken (alleen-lezen).",
|
|
4638
|
+
versionsCurrent: "Terug naar huidig concept",
|
|
4639
|
+
versionsMissing: "Sommige blokken, velden, media of relaties zijn niet meer beschikbaar in dit voorbeeld.",
|
|
4640
|
+
versionsBridgeLegacy: "Deze bridge ondersteunt geen alleen-lezen navigatie. Interactie is uitgeschakeld; werk de bridge bij voor readOnly.",
|
|
4641
|
+
historyExpired: "Snapshot niet meer beschikbaar"
|
|
4232
4642
|
};
|
|
4233
4643
|
|
|
4234
4644
|
// admin/messages.ts
|
|
@@ -4332,8 +4742,15 @@ function RowPreviews({ zones, components, catalog, Modal: Modal3 }) {
|
|
|
4332
4742
|
const candidates = (uid) => candidatesFor(uid, catalog?.components?.[uid] || {}, catalog || {});
|
|
4333
4743
|
const label = (uid) => catalog?.components?.[uid]?.label || components?.[uid]?.info?.displayName || uid;
|
|
4334
4744
|
const srcOf = (uid) => candidates(uid)[resolved[uid] ?? -1] || "";
|
|
4745
|
+
const visible = anchors.filter(({ uid }) => showRowThumbnail(uid, catalog));
|
|
4335
4746
|
React2.useEffect(() => {
|
|
4336
4747
|
for (const { el, uid } of anchors) {
|
|
4748
|
+
if (!showRowThumbnail(uid, catalog)) {
|
|
4749
|
+
el.style.removeProperty("cursor");
|
|
4750
|
+
for (const name of ["role", "tabindex", "aria-label"])
|
|
4751
|
+
el.removeAttribute(name);
|
|
4752
|
+
continue;
|
|
4753
|
+
}
|
|
4337
4754
|
if (srcOf(uid)) {
|
|
4338
4755
|
el.setAttribute("role", "button");
|
|
4339
4756
|
el.setAttribute("tabindex", "0");
|
|
@@ -4345,7 +4762,7 @@ function RowPreviews({ zones, components, catalog, Modal: Modal3 }) {
|
|
|
4345
4762
|
}
|
|
4346
4763
|
});
|
|
4347
4764
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4348
|
-
|
|
4765
|
+
visible.map(
|
|
4349
4766
|
(a) => createPortal(
|
|
4350
4767
|
/* @__PURE__ */ jsx2(
|
|
4351
4768
|
"span",
|
|
@@ -4568,7 +4985,15 @@ function movedRow(prev, next, actor) {
|
|
|
4568
4985
|
}
|
|
4569
4986
|
function keepGroupsTogether(prev, next, groups, actor) {
|
|
4570
4987
|
if (!groups) return null;
|
|
4571
|
-
|
|
4988
|
+
let move = movedRow(prev, next, actor);
|
|
4989
|
+
if (!move && actor == null) {
|
|
4990
|
+
const candidates = prev.flatMap((row) => {
|
|
4991
|
+
if (!(0, import_groups2.isOpener)(row, groups)) return [];
|
|
4992
|
+
const candidate = movedRow(prev, next, (0, import_groups2.blockKey)(row));
|
|
4993
|
+
return candidate && (0, import_groups2.isOpener)(prev[candidate.from], groups) ? [candidate] : [];
|
|
4994
|
+
});
|
|
4995
|
+
if (candidates.length === 1) move = candidates[0];
|
|
4996
|
+
}
|
|
4572
4997
|
if (!move || !(0, import_groups2.isOpener)(prev[move.from], groups)) return null;
|
|
4573
4998
|
const start = move.from, end = groupOutline(prev, groups)[start].end;
|
|
4574
4999
|
if (end == null) return null;
|
|
@@ -4921,6 +5346,7 @@ var DEPTH = "data-blockscene-depth";
|
|
|
4921
5346
|
var KIND = "data-blockscene-group";
|
|
4922
5347
|
var FOLD = "data-blockscene-fold";
|
|
4923
5348
|
var COUNT = "data-blockscene-fold-count";
|
|
5349
|
+
var INSERT = "data-blockscene-group-insert";
|
|
4924
5350
|
var GRID_BOX = "data-blockscene-grid";
|
|
4925
5351
|
var STEP = "2.4rem";
|
|
4926
5352
|
var folded = /* @__PURE__ */ new Set();
|
|
@@ -4942,6 +5368,14 @@ var Count = styled3.span`
|
|
|
4942
5368
|
margin-right: 4px; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap;
|
|
4943
5369
|
color: ${({ theme }) => theme.colors.primary700}; background: ${({ theme }) => theme.colors.primary100};
|
|
4944
5370
|
`;
|
|
5371
|
+
var GroupInsert = styled3.button`
|
|
5372
|
+
display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 42px; padding: 8px 12px;
|
|
5373
|
+
border: 1px dashed ${({ theme }) => theme.colors.primary600}; border-radius: 4px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
|
|
5374
|
+
color: ${({ theme }) => theme.colors.primary600}; background: ${({ theme }) => theme.colors.neutral0};
|
|
5375
|
+
&:hover:not(:disabled) { background: ${({ theme }) => theme.colors.primary100}; }
|
|
5376
|
+
&:disabled { opacity: 0.5; cursor: default; }
|
|
5377
|
+
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 1px; }
|
|
5378
|
+
`;
|
|
4945
5379
|
function GroupRows({ zones, form, groups, docKey, labelOf, layouts = null, components, catalog, openBlock, openInsert }) {
|
|
4946
5380
|
const t = useMessages();
|
|
4947
5381
|
const theme = useTheme();
|
|
@@ -5037,18 +5471,34 @@ function GroupRows({ zones, form, groups, docKey, labelOf, layouts = null, compo
|
|
|
5037
5471
|
for (const index of unfold) for (const p of outline[index]?.parents || []) folded.delete(idOf(p));
|
|
5038
5472
|
const isFolded = (i) => outline[i].end != null && folded.has(idOf(i));
|
|
5039
5473
|
const grid = [];
|
|
5474
|
+
const anchorByOpen = /* @__PURE__ */ new Map();
|
|
5040
5475
|
lis.forEach((li, i) => {
|
|
5041
5476
|
const o = outline[i];
|
|
5042
5477
|
seen.add(li);
|
|
5043
5478
|
set(li, DEPTH, o.depth ? String(o.depth) : null);
|
|
5044
5479
|
if (o.depth) li.style.setProperty("--bs-depth", String(o.depth));
|
|
5045
5480
|
set(li, KIND, o.kind === "block" ? null : o.kind);
|
|
5046
|
-
const inGrid =
|
|
5481
|
+
const inGrid = o.parents.some((p) => grid[p]);
|
|
5047
5482
|
const hidden = o.parents.some(isFolded) || inGrid;
|
|
5048
5483
|
set(li, FOLDED, hidden ? "" : null);
|
|
5049
5484
|
const layout = o.kind === "open" && o.end != null ? layouts2?.[rows[i].__component] || null : null;
|
|
5050
5485
|
const toggle = li.querySelector("button[aria-expanded]");
|
|
5051
5486
|
grid[i] = Boolean(layout && toggle?.parentElement) && !hidden && !isFolded(i) && !listed.has(idOf(i));
|
|
5487
|
+
if (o.kind === "close") {
|
|
5488
|
+
const open = o.parents[o.parents.length - 1];
|
|
5489
|
+
const anchor2 = anchorByOpen.get(open);
|
|
5490
|
+
if (anchor2 && !grid[open] && !hidden) {
|
|
5491
|
+
let insertEl = li.querySelector(`:scope > [${INSERT}]`);
|
|
5492
|
+
if (!insertEl) {
|
|
5493
|
+
insertEl = document.createElement("div");
|
|
5494
|
+
insertEl.setAttribute(INSERT, "");
|
|
5495
|
+
li.appendChild(insertEl);
|
|
5496
|
+
}
|
|
5497
|
+
anchor2.insertEl = insertEl;
|
|
5498
|
+
anchor2.after = blockKey(rows[Math.max(open, i - 1)]);
|
|
5499
|
+
}
|
|
5500
|
+
return;
|
|
5501
|
+
}
|
|
5052
5502
|
if (o.kind !== "open" || o.end == null || !toggle?.parentElement) return;
|
|
5053
5503
|
let gridEl = li.querySelector(`:scope > [${GRID_BOX}]`);
|
|
5054
5504
|
if (grid[i] && !gridEl) {
|
|
@@ -5071,15 +5521,32 @@ function GroupRows({ zones, form, groups, docKey, labelOf, layouts = null, compo
|
|
|
5071
5521
|
countEl.style.cssText = "display:inline-flex;align-items:center";
|
|
5072
5522
|
actions.insertBefore(countEl, actions.firstChild);
|
|
5073
5523
|
}
|
|
5074
|
-
|
|
5524
|
+
const anchor = {
|
|
5525
|
+
el,
|
|
5526
|
+
countEl,
|
|
5527
|
+
insertEl: null,
|
|
5528
|
+
after: null,
|
|
5529
|
+
full: Boolean(zone.full),
|
|
5530
|
+
zone: zone.name,
|
|
5531
|
+
index: i,
|
|
5532
|
+
id: idOf(i),
|
|
5533
|
+
count: o.count || 0,
|
|
5534
|
+
open: !isFolded(i),
|
|
5535
|
+
label: labelOf2(rows[i]),
|
|
5536
|
+
layout,
|
|
5537
|
+
gridEl
|
|
5538
|
+
};
|
|
5539
|
+
next.push(anchor);
|
|
5540
|
+
anchorByOpen.set(i, anchor);
|
|
5075
5541
|
});
|
|
5076
5542
|
}
|
|
5077
5543
|
landed.current = null;
|
|
5078
5544
|
for (const li of document.querySelectorAll(`li[${DEPTH}], li[${KIND}], li[${FOLDED}]`))
|
|
5079
5545
|
if (!seen.has(li)) for (const name of [DEPTH, KIND, FOLDED]) li.removeAttribute(name);
|
|
5080
|
-
for (const el of document.querySelectorAll(`[${FOLD}], [${COUNT}], [${GRID_BOX}]`))
|
|
5546
|
+
for (const el of document.querySelectorAll(`[${FOLD}], [${COUNT}], [${GRID_BOX}], [${INSERT}]`))
|
|
5547
|
+
if (!next.some((a) => a.el === el || a.countEl === el || a.gridEl === el || a.insertEl === el)) el.remove();
|
|
5081
5548
|
setAnchors(
|
|
5082
|
-
(prev) => prev.length === next.length && prev.every((a, i) => ["el", "countEl", "id", "index", "count", "open", "label", "layout", "gridEl"].every((k) => a[k] === next[i][k])) ? prev : next
|
|
5549
|
+
(prev) => prev.length === next.length && prev.every((a, i) => ["el", "countEl", "insertEl", "after", "full", "id", "index", "count", "open", "label", "layout", "gridEl"].every((k) => a[k] === next[i][k])) ? prev : next
|
|
5083
5550
|
);
|
|
5084
5551
|
};
|
|
5085
5552
|
React4.useEffect(() => {
|
|
@@ -5097,7 +5564,7 @@ function GroupRows({ zones, form, groups, docKey, labelOf, layouts = null, compo
|
|
|
5097
5564
|
return () => {
|
|
5098
5565
|
observer.disconnect();
|
|
5099
5566
|
cancelAnimationFrame(frame2);
|
|
5100
|
-
for (const el of document.querySelectorAll(`[${FOLD}], [${COUNT}], [${GRID_BOX}]`)) el.remove();
|
|
5567
|
+
for (const el of document.querySelectorAll(`[${FOLD}], [${COUNT}], [${GRID_BOX}], [${INSERT}]`)) el.remove();
|
|
5101
5568
|
for (const li of document.querySelectorAll(`li[${DEPTH}], li[${KIND}], li[${FOLDED}]`)) for (const name of [DEPTH, KIND, FOLDED]) li.removeAttribute(name);
|
|
5102
5569
|
};
|
|
5103
5570
|
}, []);
|
|
@@ -5114,10 +5581,8 @@ function GroupRows({ zones, form, groups, docKey, labelOf, layouts = null, compo
|
|
|
5114
5581
|
${list2}[${DEPTH}] { padding-left: calc(var(--bs-depth) * ${STEP}); background: repeating-linear-gradient(to right, ${line} 0 2px, transparent 2px ${STEP}) 1.1rem 0 / calc(var(--bs-depth) * ${STEP}) 100% no-repeat; }
|
|
5115
5582
|
${list2}[${FOLDED}]:not([data-bp-block-modal]) { display: none !important; }
|
|
5116
5583
|
${list2}[data-bp-block-modal] { padding-left: 0 !important; background-image: none !important; }
|
|
5117
|
-
${list2}[${KIND}="close"] [
|
|
5118
|
-
${list2}[${KIND}="close"]
|
|
5119
|
-
${list2}[${KIND}="close"] button[aria-expanded]:first-of-type + * { padding-top: 0 !important; padding-bottom: 0 !important; }
|
|
5120
|
-
${list2}[${KIND}="close"] button[aria-expanded] [data-blockscene-row-thumb] { display: none; }` }),
|
|
5584
|
+
${list2}[${KIND}="close"] > *:not([${INSERT}]) { display: none !important; }
|
|
5585
|
+
${list2}[${KIND}="close"] [${INSERT}] { display: block; padding: 8px 12px; }` }),
|
|
5121
5586
|
anchors.map(
|
|
5122
5587
|
(a) => createPortal2(
|
|
5123
5588
|
/* @__PURE__ */ jsx5(
|
|
@@ -5171,7 +5636,27 @@ ${list2}[${KIND}="close"] button[aria-expanded] [data-blockscene-row-thumb] { di
|
|
|
5171
5636
|
a.gridEl,
|
|
5172
5637
|
`grid:${a.zone}:${a.index}`
|
|
5173
5638
|
) : null;
|
|
5174
|
-
})
|
|
5639
|
+
}),
|
|
5640
|
+
anchors.map(
|
|
5641
|
+
(a) => a.insertEl ? createPortal2(
|
|
5642
|
+
/* @__PURE__ */ jsxs3(
|
|
5643
|
+
GroupInsert,
|
|
5644
|
+
{
|
|
5645
|
+
type: "button",
|
|
5646
|
+
disabled: a.full,
|
|
5647
|
+
title: a.full ? t.zoneFull : void 0,
|
|
5648
|
+
"data-testid": `group-add-${a.zone}-${a.index}`,
|
|
5649
|
+
onClick: () => openInsert?.(a.zone, a.after),
|
|
5650
|
+
children: [
|
|
5651
|
+
/* @__PURE__ */ jsx5(Icon, { name: "plus", size: 14 }),
|
|
5652
|
+
t.f("groupAdd", { label: a.label })
|
|
5653
|
+
]
|
|
5654
|
+
}
|
|
5655
|
+
),
|
|
5656
|
+
a.insertEl,
|
|
5657
|
+
`insert:${a.zone}:${a.index}`
|
|
5658
|
+
) : null
|
|
5659
|
+
)
|
|
5175
5660
|
] });
|
|
5176
5661
|
}
|
|
5177
5662
|
function ViewToggle({ grid, testid, label, onFlip }) {
|
|
@@ -5374,9 +5859,33 @@ function useRowActions({ zones, components, catalog, form }) {
|
|
|
5374
5859
|
if (hiddenName) form.setRows(zoneName, setHidden(rows, index, groups, hiddenName, rows[index]?.[hiddenName] !== true));
|
|
5375
5860
|
};
|
|
5376
5861
|
const paste = (zoneName, at) => pasteInto(form, zoneOf(zoneName), clip, components, groups, t, at);
|
|
5862
|
+
const changeGroup = (zoneName, key, keepBlocks) => {
|
|
5863
|
+
const rows = form.rows(zoneName);
|
|
5864
|
+
const next = keepBlocks ? (0, import_groups2.unwrapGroup)(rows, key, groups) : (0, import_groups2.removeGroup)(rows, key, groups);
|
|
5865
|
+
if (next) form.setRows(zoneName, next);
|
|
5866
|
+
};
|
|
5377
5867
|
const pastable = (zoneName) => !["empty", "notAllowed"].includes(pasteProblem(clip, zoneOf(zoneName), form.rows(zoneName), components, groups)?.code);
|
|
5378
5868
|
const selectable = (zoneName) => form.rows(zoneName).filter((row) => canAct(row, groups)).map((row) => blockKey(row)).filter(Boolean);
|
|
5379
|
-
return {
|
|
5869
|
+
return {
|
|
5870
|
+
t,
|
|
5871
|
+
editor,
|
|
5872
|
+
groups,
|
|
5873
|
+
hiddenName,
|
|
5874
|
+
clip,
|
|
5875
|
+
selection,
|
|
5876
|
+
setSelection,
|
|
5877
|
+
busy,
|
|
5878
|
+
form,
|
|
5879
|
+
labelOf,
|
|
5880
|
+
duplicate,
|
|
5881
|
+
copy: copy2,
|
|
5882
|
+
toggleHidden,
|
|
5883
|
+
paste,
|
|
5884
|
+
pastable,
|
|
5885
|
+
selectable,
|
|
5886
|
+
changeGroup,
|
|
5887
|
+
isMarker: (row) => isGroupMarker(row, groups)
|
|
5888
|
+
};
|
|
5380
5889
|
}
|
|
5381
5890
|
var RowButton = styled4.button`
|
|
5382
5891
|
display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
|
|
@@ -5400,7 +5909,7 @@ function RowActions({ zones, actions, Modal: Modal3 }) {
|
|
|
5400
5909
|
const latest = React5.useRef({ zones, a });
|
|
5401
5910
|
latest.current = { zones, a };
|
|
5402
5911
|
React5.useEffect(() => {
|
|
5403
|
-
if (!a
|
|
5912
|
+
if (!a) return;
|
|
5404
5913
|
const onClick = (event) => {
|
|
5405
5914
|
const button = event.target?.closest?.("button");
|
|
5406
5915
|
if (!button || bypass.current) return;
|
|
@@ -5410,10 +5919,23 @@ function RowActions({ zones, actions, Modal: Modal3 }) {
|
|
|
5410
5919
|
const headers = toggles(list2);
|
|
5411
5920
|
const index = headers.findIndex((toggle) => trashOf(toggle) === button);
|
|
5412
5921
|
if (index < 0) return;
|
|
5922
|
+
const row = latest.current.a?.form.rows(zone.name)[index];
|
|
5923
|
+
const marker2 = Boolean(latest.current.a?.isMarker(row));
|
|
5924
|
+
if (!marker2 && e.confirmDelete === false) return;
|
|
5413
5925
|
event.preventDefault();
|
|
5414
5926
|
event.stopPropagation();
|
|
5415
|
-
|
|
5416
|
-
|
|
5927
|
+
if (marker2 && !canAct(row, latest.current.a?.groups)) return;
|
|
5928
|
+
const key = blockKey(row) || "";
|
|
5929
|
+
const rows = latest.current.a.form.rows(zone.name);
|
|
5930
|
+
const range = marker2 ? actionRange(rows, index, latest.current.a.groups) : [index, index];
|
|
5931
|
+
setConfirm({
|
|
5932
|
+
button,
|
|
5933
|
+
label: latest.current.a?.labelOf(row) || headers[index].textContent?.trim(),
|
|
5934
|
+
kind: marker2 ? "group" : "block",
|
|
5935
|
+
zone: zone.name,
|
|
5936
|
+
key,
|
|
5937
|
+
count: marker2 ? rows.slice(range[0] + 1, range[1]).filter((item) => canAct(item, latest.current.a.groups)).length : 0
|
|
5938
|
+
});
|
|
5417
5939
|
return;
|
|
5418
5940
|
}
|
|
5419
5941
|
};
|
|
@@ -5441,6 +5963,11 @@ function RowActions({ zones, actions, Modal: Modal3 }) {
|
|
|
5441
5963
|
bypass.current = false;
|
|
5442
5964
|
}
|
|
5443
5965
|
};
|
|
5966
|
+
const confirmGroup = (keepBlocks) => {
|
|
5967
|
+
const target = confirm;
|
|
5968
|
+
setConfirm(null);
|
|
5969
|
+
if (target?.kind === "group") a.changeGroup(target.zone, target.key, keepBlocks);
|
|
5970
|
+
};
|
|
5444
5971
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
5445
5972
|
/* @__PURE__ */ jsx6("style", { children: `li[${HIDDEN_ATTR}] button[aria-expanded] { opacity: 0.5; }
|
|
5446
5973
|
ol[aria-describedby] > li button[data-strapi-accordion-toggle] { overflow: hidden; }
|
|
@@ -5520,14 +6047,25 @@ ol[aria-describedby] > li button[data-strapi-accordion-toggle] > span:last-child
|
|
|
5520
6047
|
`${zone}:${index}`
|
|
5521
6048
|
);
|
|
5522
6049
|
}),
|
|
5523
|
-
confirm && /* @__PURE__ */ jsx6(
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
6050
|
+
confirm && /* @__PURE__ */ jsx6(
|
|
6051
|
+
Modal3,
|
|
6052
|
+
{
|
|
6053
|
+
open: true,
|
|
6054
|
+
width: "48rem",
|
|
6055
|
+
onOpenChange: (open) => !open && setConfirm(null),
|
|
6056
|
+
trigger: null,
|
|
6057
|
+
title: confirm.kind === "group" ? t.confirmDeleteGroupTitle : t.confirmDeleteTitle,
|
|
6058
|
+
children: /* @__PURE__ */ jsxs4(Flex, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "row-confirm-delete", children: [
|
|
6059
|
+
/* @__PURE__ */ jsx6(Typography, { children: t.f(confirm.kind === "group" ? "confirmDeleteGroup" : "confirmDelete", { name: confirm.label, count: confirm.count }) }),
|
|
6060
|
+
confirm.kind === "group" && confirm.count > 0 && /* @__PURE__ */ jsx6(Typography, { variant: "pi", textColor: "neutral600", children: t.f("confirmDeleteGroupHint", { count: confirm.count }) }),
|
|
6061
|
+
/* @__PURE__ */ jsxs4(Flex, { gap: 2, justifyContent: "flex-end", children: [
|
|
6062
|
+
/* @__PURE__ */ jsx6(Button, { variant: "tertiary", onClick: () => setConfirm(null), "data-testid": "row-confirm-cancel", children: t.cancel }),
|
|
6063
|
+
confirm.kind === "group" && confirm.count > 0 && /* @__PURE__ */ jsx6(Button, { variant: "secondary", onClick: () => confirmGroup(true), "data-testid": "row-confirm-unwrap", children: t.keepGroupBlocks }),
|
|
6064
|
+
/* @__PURE__ */ jsx6(Button, { variant: "danger", onClick: confirm.kind === "group" ? () => confirmGroup(false) : confirmDelete, "data-testid": "row-confirm-ok", children: confirm.kind === "group" ? t.f("deleteGroupAndBlocks", { count: confirm.count }) : t.delete })
|
|
6065
|
+
] })
|
|
6066
|
+
] })
|
|
6067
|
+
}
|
|
6068
|
+
)
|
|
5531
6069
|
] });
|
|
5532
6070
|
}
|
|
5533
6071
|
function zoneMenuItems(zone, a) {
|
|
@@ -5885,6 +6423,10 @@ var Round = styled5.button`
|
|
|
5885
6423
|
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
5886
6424
|
color: ${({ theme, $on }) => $on ? theme.colors.warning500 : theme.colors.neutral600};
|
|
5887
6425
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
6426
|
+
transition: transform 120ms ease-out;
|
|
6427
|
+
&:active {
|
|
6428
|
+
transform: scale(0.97);
|
|
6429
|
+
}
|
|
5888
6430
|
&:focus-visible {
|
|
5889
6431
|
outline: 2px solid ${({ theme }) => theme.colors.primary600};
|
|
5890
6432
|
outline-offset: 1px;
|
|
@@ -6578,7 +7120,7 @@ function ZoneGallery({
|
|
|
6578
7120
|
gap: 4,
|
|
6579
7121
|
style: { overflowY: "auto", flex: 1, minHeight: 0, padding: "4px" },
|
|
6580
7122
|
children: (view === "recent" ? [{ typology: "recent", entries }] : groupEntries(entries)).map(
|
|
6581
|
-
({ typology, entries: items2 }) => /* @__PURE__ */ jsxs5(Flex2, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
7123
|
+
({ typology, entries: items2 }) => /* @__PURE__ */ jsxs5(Flex2, { direction: "column", alignItems: "stretch", gap: 2, flex: "0 0 auto", children: [
|
|
6582
7124
|
/* @__PURE__ */ jsx7(Typography2, { variant: "sigma", textColor: "neutral600", "data-testid": `block-group-${typology}`, children: `${typology === "recent" ? t.nav.recent : t.typologies[typology] || typology} (${items2.length})` }),
|
|
6583
7125
|
/* @__PURE__ */ jsx7(Columns, { $columns: columns, children: items2.map((entry) => /* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7(
|
|
6584
7126
|
Card,
|
|
@@ -6864,8 +7406,14 @@ import styled6, { useTheme as useTheme2 } from "styled-components";
|
|
|
6864
7406
|
import { Box as Box4, Button as Button3, Flex as Flex3, MenuItem, SimpleMenu, Typography as Typography4 } from "@strapi/design-system";
|
|
6865
7407
|
|
|
6866
7408
|
// admin/pane.mjs
|
|
6867
|
-
var TOOLBAR = ["modes", "history", "devices", "status", "actions"];
|
|
7409
|
+
var TOOLBAR = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
6868
7410
|
var RIGHT = ["status", "actions"];
|
|
7411
|
+
function topNavigationInset(navs, viewportWidth) {
|
|
7412
|
+
return Math.round(Math.max(0, ...(Array.isArray(navs) ? navs : []).flatMap((nav) => {
|
|
7413
|
+
const rect = nav?.rect || {};
|
|
7414
|
+
return ["fixed", "sticky"].includes(nav?.position) && Math.abs(Number(rect.top) || 0) <= 1 && (Number(rect.left) || 0) <= 1 && Number(rect.right) >= viewportWidth - 1 && Number(rect.height) > 0 && Number(rect.height) <= 128 ? [Number(rect.bottom) || Number(rect.height)] : [];
|
|
7415
|
+
})));
|
|
7416
|
+
}
|
|
6869
7417
|
function toolbarLayout(list2) {
|
|
6870
7418
|
const ids = Array.isArray(list2) ? list2.filter((id, i) => TOOLBAR.includes(id) && list2.indexOf(id) === i) : TOOLBAR;
|
|
6871
7419
|
const at = ids.findIndex((id) => RIGHT.includes(id));
|
|
@@ -7000,6 +7548,25 @@ function useMainRect() {
|
|
|
7000
7548
|
}, []);
|
|
7001
7549
|
return rect;
|
|
7002
7550
|
}
|
|
7551
|
+
function useAdminTopInset() {
|
|
7552
|
+
const [inset, setInset] = React8.useState(0);
|
|
7553
|
+
React8.useLayoutEffect(() => {
|
|
7554
|
+
const navs = () => [...document.querySelectorAll("nav")];
|
|
7555
|
+
const measure = () => setInset(topNavigationInset(navs().map((nav) => ({
|
|
7556
|
+
position: getComputedStyle(nav).position,
|
|
7557
|
+
rect: nav.getBoundingClientRect()
|
|
7558
|
+
})), window.innerWidth));
|
|
7559
|
+
measure();
|
|
7560
|
+
const observer = "ResizeObserver" in window ? new ResizeObserver(measure) : null;
|
|
7561
|
+
navs().forEach((nav) => observer?.observe(nav));
|
|
7562
|
+
window.addEventListener("resize", measure);
|
|
7563
|
+
return () => {
|
|
7564
|
+
observer?.disconnect();
|
|
7565
|
+
window.removeEventListener("resize", measure);
|
|
7566
|
+
};
|
|
7567
|
+
}, []);
|
|
7568
|
+
return inset;
|
|
7569
|
+
}
|
|
7003
7570
|
var Handle = styled6.div`
|
|
7004
7571
|
position: absolute;
|
|
7005
7572
|
top: 0;
|
|
@@ -7088,6 +7655,7 @@ body.bp-block-modal [data-bp-block-modal] { position: fixed !important; top: ${B
|
|
|
7088
7655
|
background: ${background}; border-radius: 0 0 8px 8px; box-shadow: 0 8px 32px rgba(33, 33, 52, 0.3); }
|
|
7089
7656
|
body.bp-block-modal [data-bp-block-modal]::before, body.bp-block-modal [data-bp-block-modal]::after { display: none !important; }
|
|
7090
7657
|
body.bp-block-modal [data-bp-block-modal] > div { margin: 0 !important; padding-top: 0 !important; }
|
|
7658
|
+
body.bp-block-modal > div:has(> [role="listbox"]) { z-index: 1002 !important; }
|
|
7091
7659
|
body.bp-block-modal [data-bp-modal-hide] { display: none !important; }`;
|
|
7092
7660
|
var DRAWER_WIDTH = 640;
|
|
7093
7661
|
var fieldsStyle = (background, drawer) => `
|
|
@@ -7096,6 +7664,7 @@ body.bp-fields [data-bp-show] { grid-column: 1 / -1 !important; }
|
|
|
7096
7664
|
body.bp-fields [data-bp-flat] { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; }
|
|
7097
7665
|
body.bp-fields [data-bp-fields] { position: fixed !important; z-index: 1001; overflow: auto; margin: 0 !important;
|
|
7098
7666
|
padding: 1.6rem 2.4rem; background: ${background}; box-shadow: 0 8px 32px rgba(33, 33, 52, 0.3); }
|
|
7667
|
+
body.bp-fields > div:has(> [role="listbox"]) { z-index: 1002 !important; }
|
|
7099
7668
|
body.bp-fields [data-bp-fields="modal"] { top: ${BLOCK_TOP}; left: 50%; transform: translateX(-50%); width: min(96rem, 92vw);
|
|
7100
7669
|
max-height: calc(88vh - 5.6rem); border-radius: 0 0 8px 8px; }
|
|
7101
7670
|
${drawer ? `body.bp-fields [data-bp-fields="drawer"] { top: ${drawer.top + 56}px; left: ${drawer.left}px; width: ${drawer.width}px; height: ${drawer.height - 56}px; }` : ""}`;
|
|
@@ -7315,7 +7884,8 @@ function PagePreview({
|
|
|
7315
7884
|
hiddenAttribute = null,
|
|
7316
7885
|
form = null,
|
|
7317
7886
|
Modal: Modal3,
|
|
7318
|
-
Toggle
|
|
7887
|
+
Toggle,
|
|
7888
|
+
versions
|
|
7319
7889
|
}) {
|
|
7320
7890
|
const t = useMessages();
|
|
7321
7891
|
const { values, zone, zoneLabel, canEdit, latest, insertRows: insertRows2 } = usePreviewZone(host);
|
|
@@ -7335,12 +7905,15 @@ function PagePreview({
|
|
|
7335
7905
|
return v > 0 && v < 1 ? v : 0.5;
|
|
7336
7906
|
});
|
|
7337
7907
|
const main = useMainRect();
|
|
7908
|
+
const topInset = useAdminTopInset();
|
|
7338
7909
|
const vw = main.width;
|
|
7339
7910
|
const [dragging, setDragging] = React8.useState(false);
|
|
7340
7911
|
const [ready, setReady] = React8.useState(false);
|
|
7912
|
+
const [readOnlyBridge, setReadOnlyBridge] = React8.useState(false);
|
|
7341
7913
|
const [failed, setFailed] = React8.useState(false);
|
|
7342
7914
|
const [attempt, retry] = React8.useReducer((n) => n + 1, 0);
|
|
7343
7915
|
const [picking, setPicking] = React8.useState(null);
|
|
7916
|
+
const [deletingGroup, setDeletingGroup] = React8.useState(null);
|
|
7344
7917
|
const [hovered, setHovered] = React8.useState(null);
|
|
7345
7918
|
const [edge, setEdge] = React8.useState(null);
|
|
7346
7919
|
const hoverRow = React8.useRef(null);
|
|
@@ -7382,7 +7955,13 @@ function PagePreview({
|
|
|
7382
7955
|
const iframe = React8.useRef(null);
|
|
7383
7956
|
const loaded = React8.useRef(false);
|
|
7384
7957
|
const anchor = React8.useRef(null);
|
|
7385
|
-
const
|
|
7958
|
+
const version = versions?.view;
|
|
7959
|
+
const readOnly = Boolean(version);
|
|
7960
|
+
const viewRows = React8.useRef([]);
|
|
7961
|
+
viewRows.current = version ? version.values?.[zone] || [] : latest.current;
|
|
7962
|
+
const viewValues = React8.useRef({});
|
|
7963
|
+
viewValues.current = version ? version.values : values;
|
|
7964
|
+
const channel = React8.useMemo(() => crypto.randomUUID(), [host.model, host.documentId, host.locale, version?.scope, version?.event.id]);
|
|
7386
7965
|
const { base, source } = state.preview;
|
|
7387
7966
|
const url = base ? new URL(base) : null;
|
|
7388
7967
|
url?.searchParams.set("channel", channel);
|
|
@@ -7401,7 +7980,8 @@ function PagePreview({
|
|
|
7401
7980
|
setMode,
|
|
7402
7981
|
onChange,
|
|
7403
7982
|
clip,
|
|
7404
|
-
clipCount
|
|
7983
|
+
clipCount,
|
|
7984
|
+
readOnly
|
|
7405
7985
|
});
|
|
7406
7986
|
live.current = {
|
|
7407
7987
|
mode,
|
|
@@ -7411,7 +7991,8 @@ function PagePreview({
|
|
|
7411
7991
|
setMode,
|
|
7412
7992
|
onChange,
|
|
7413
7993
|
clip,
|
|
7414
|
-
clipCount
|
|
7994
|
+
clipCount,
|
|
7995
|
+
readOnly
|
|
7415
7996
|
};
|
|
7416
7997
|
const send = React8.useCallback(() => {
|
|
7417
7998
|
iframe.current?.contentWindow?.postMessage(
|
|
@@ -7419,20 +8000,45 @@ function PagePreview({
|
|
|
7419
8000
|
protocol: PROTOCOL,
|
|
7420
8001
|
channel,
|
|
7421
8002
|
type: "update-page",
|
|
8003
|
+
entry: projectEntry(
|
|
8004
|
+
viewValues.current,
|
|
8005
|
+
host.contentType,
|
|
8006
|
+
live.current.components,
|
|
8007
|
+
window.location.origin,
|
|
8008
|
+
host.readable
|
|
8009
|
+
),
|
|
8010
|
+
contentType: {
|
|
8011
|
+
uid: host.model,
|
|
8012
|
+
kind: host.contentType?.kind,
|
|
8013
|
+
singularName: host.contentType?.info?.singularName,
|
|
8014
|
+
pluralName: host.contentType?.info?.pluralName,
|
|
8015
|
+
displayName: host.contentType?.info?.displayName
|
|
8016
|
+
},
|
|
8017
|
+
zone,
|
|
7422
8018
|
blocks: projectPage(
|
|
7423
|
-
|
|
8019
|
+
viewRows.current,
|
|
7424
8020
|
live.current.components,
|
|
7425
8021
|
window.location.origin,
|
|
7426
8022
|
hiddenAttribute
|
|
7427
|
-
),
|
|
8023
|
+
).map((block) => live.current.readOnly ? { ...block, fields: [], media: {} } : block),
|
|
7428
8024
|
groups,
|
|
7429
8025
|
locale: t.locale,
|
|
7430
8026
|
mode: live.current.mode,
|
|
7431
|
-
clipboard: live.current.clipCount
|
|
8027
|
+
clipboard: live.current.readOnly ? 0 : live.current.clipCount,
|
|
8028
|
+
readOnly: live.current.readOnly
|
|
7432
8029
|
},
|
|
7433
8030
|
origin
|
|
7434
8031
|
);
|
|
7435
|
-
}, [channel, origin, hiddenAttribute]);
|
|
8032
|
+
}, [channel, origin, hiddenAttribute, groups, host.contentType, host.model, host.readable, zone]);
|
|
8033
|
+
React8.useEffect(() => {
|
|
8034
|
+
if (readOnly) {
|
|
8035
|
+
setInserting(null);
|
|
8036
|
+
setBlockModal(null);
|
|
8037
|
+
setPicking(null);
|
|
8038
|
+
setFieldsPanel(null);
|
|
8039
|
+
setHovered(null);
|
|
8040
|
+
}
|
|
8041
|
+
}, [readOnly]);
|
|
7436
8042
|
const indexOf = (key) => latest.current.findIndex((row) => blockKey(row) === key);
|
|
7437
8043
|
const path = (key, field) => `${zone}.${indexOf(key)}.${field}`;
|
|
7438
8044
|
React8.useEffect(() => {
|
|
@@ -7589,9 +8195,11 @@ function PagePreview({
|
|
|
7589
8195
|
React8.useEffect(() => {
|
|
7590
8196
|
if (!active) return;
|
|
7591
8197
|
setReady(false);
|
|
8198
|
+
setReadOnlyBridge(false);
|
|
7592
8199
|
setFailed(false);
|
|
7593
8200
|
const timeout = setTimeout(() => setFailed(true), 15e3);
|
|
7594
8201
|
const receive = (event) => {
|
|
8202
|
+
if (!previewMessageAllowed(event, origin, iframe.current?.contentWindow, channel, live.current.readOnly)) return;
|
|
7595
8203
|
const is = (type) => isPreviewMessage(
|
|
7596
8204
|
event,
|
|
7597
8205
|
origin,
|
|
@@ -7604,6 +8212,7 @@ function PagePreview({
|
|
|
7604
8212
|
clearTimeout(timeout);
|
|
7605
8213
|
setReady(true);
|
|
7606
8214
|
setFailed(false);
|
|
8215
|
+
setReadOnlyBridge(Array.isArray(event.data.capabilities) && event.data.capabilities.includes("readOnly"));
|
|
7607
8216
|
send();
|
|
7608
8217
|
return;
|
|
7609
8218
|
}
|
|
@@ -7635,12 +8244,17 @@ function PagePreview({
|
|
|
7635
8244
|
return;
|
|
7636
8245
|
}
|
|
7637
8246
|
if (is("delete-group") && canEdit2 && groups) {
|
|
7638
|
-
const
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
);
|
|
7643
|
-
|
|
8247
|
+
const key2 = String(event.data.key);
|
|
8248
|
+
const start = latest.current.findIndex((row) => blockKey(row) === key2);
|
|
8249
|
+
if (start < 0) return;
|
|
8250
|
+
const [, end] = (0, import_groups.groupRange)(latest.current, start, groups);
|
|
8251
|
+
if (end <= start || latest.current[end]?.__component !== groups[latest.current[start]?.__component]) return;
|
|
8252
|
+
const closes = new Set(Object.values(groups));
|
|
8253
|
+
setDeletingGroup({
|
|
8254
|
+
key: key2,
|
|
8255
|
+
label: components?.[latest.current[start]?.__component]?.info?.displayName || latest.current[start]?.__component || "",
|
|
8256
|
+
count: latest.current.slice(start + 1, end).filter((row) => !closes.has(row?.__component)).length
|
|
8257
|
+
});
|
|
7644
8258
|
return;
|
|
7645
8259
|
}
|
|
7646
8260
|
if (is("insert-group") && canEdit2 && groups) {
|
|
@@ -7731,9 +8345,9 @@ function PagePreview({
|
|
|
7731
8345
|
if (!ready || !active) return;
|
|
7732
8346
|
const timer = setTimeout(send, 120);
|
|
7733
8347
|
return () => clearTimeout(timer);
|
|
7734
|
-
}, [values, host.components, ready, active, send, mode, clipCount]);
|
|
8348
|
+
}, [values, version, host.components, ready, active, send, mode, clipCount]);
|
|
7735
8349
|
React8.useEffect(() => {
|
|
7736
|
-
if (!active || !ready) return;
|
|
8350
|
+
if (!active || !ready || readOnly) return;
|
|
7737
8351
|
let last = null;
|
|
7738
8352
|
const post = (key) => {
|
|
7739
8353
|
if (key === last) return;
|
|
@@ -7756,7 +8370,7 @@ function PagePreview({
|
|
|
7756
8370
|
document.removeEventListener("pointerout", onOut);
|
|
7757
8371
|
post(null);
|
|
7758
8372
|
};
|
|
7759
|
-
}, [active, ready, channel, origin]);
|
|
8373
|
+
}, [active, ready, channel, origin, readOnly]);
|
|
7760
8374
|
React8.useEffect(() => {
|
|
7761
8375
|
const item = hovered && active ? findZoneList(live.current.zoneLabel)?.querySelectorAll(":scope > li")[indexOf(hovered)] : void 0;
|
|
7762
8376
|
hoverRow.current = item || null;
|
|
@@ -7810,7 +8424,7 @@ function PagePreview({
|
|
|
7810
8424
|
}
|
|
7811
8425
|
) });
|
|
7812
8426
|
const layout = toolbarLayout(editor?.previewToolbar);
|
|
7813
|
-
const tools = { modes: switcher, history: historyTools, devices };
|
|
8427
|
+
const tools = { modes: switcher, history: !readOnly && historyTools, versions: versions?.button, devices };
|
|
7814
8428
|
const toolbarShown = !ready || layout.before.length + layout.right.length + layout.after.length > 0;
|
|
7815
8429
|
const onKey = (event) => {
|
|
7816
8430
|
const map = {
|
|
@@ -7824,6 +8438,12 @@ function PagePreview({
|
|
|
7824
8438
|
applyWidth(map[event.key], true);
|
|
7825
8439
|
}
|
|
7826
8440
|
};
|
|
8441
|
+
const confirmGroupDelete = (keepBlocks) => {
|
|
8442
|
+
if (!deletingGroup || !zone) return;
|
|
8443
|
+
const next = keepBlocks ? (0, import_groups.unwrapGroup)(latest.current, deletingGroup.key, groups) : (0, import_groups.removeGroup)(latest.current, deletingGroup.key, groups);
|
|
8444
|
+
setDeletingGroup(null);
|
|
8445
|
+
if (next) onChange(zone, next);
|
|
8446
|
+
};
|
|
7827
8447
|
return (
|
|
7828
8448
|
// Hidden anchor in the side panels column: split mode and the sidebar items find the edit view's grid from here.
|
|
7829
8449
|
/* @__PURE__ */ jsxs6("div", { ref: anchor, children: [
|
|
@@ -7834,6 +8454,7 @@ function PagePreview({
|
|
|
7834
8454
|
"data-testid": "page-preview-pane",
|
|
7835
8455
|
"aria-label": t.previewPane,
|
|
7836
8456
|
style: {
|
|
8457
|
+
top: topInset,
|
|
7837
8458
|
left: mode === "preview" || narrow ? main.left : main.left + main.width - paneWidth,
|
|
7838
8459
|
width: mode === "preview" || narrow ? main.width : paneWidth,
|
|
7839
8460
|
userSelect: dragging ? "none" : void 0
|
|
@@ -7919,7 +8540,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7919
8540
|
children: [
|
|
7920
8541
|
!ready && /* @__PURE__ */ jsx9(Typography4, { variant: "pi", role: "status", textColor: "neutral600", children: failed ? t.previewFailed : t.previewLoading }),
|
|
7921
8542
|
failed && /* @__PURE__ */ jsx9(Button3, { size: "S", variant: "secondary", onClick: retry, children: t.retry }),
|
|
7922
|
-
layout.right.length > 0 && /* @__PURE__ */ jsx9(Actions2, { parts: layout.right })
|
|
8543
|
+
!readOnly && layout.right.length > 0 && /* @__PURE__ */ jsx9(Actions2, { parts: layout.right })
|
|
7923
8544
|
]
|
|
7924
8545
|
}
|
|
7925
8546
|
),
|
|
@@ -7927,68 +8548,83 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7927
8548
|
]
|
|
7928
8549
|
}
|
|
7929
8550
|
),
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
{
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
}
|
|
7961
|
-
) }),
|
|
7962
|
-
/* @__PURE__ */ jsx9(
|
|
7963
|
-
"div",
|
|
7964
|
-
{
|
|
7965
|
-
ref: setStage,
|
|
7966
|
-
"data-testid": "page-preview-stage",
|
|
7967
|
-
"data-device": device.id,
|
|
7968
|
-
style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
|
|
7969
|
-
children: /* @__PURE__ */ jsx9(
|
|
7970
|
-
Frame2,
|
|
7971
|
-
{
|
|
7972
|
-
ref: iframe,
|
|
7973
|
-
title: t.previewPane,
|
|
7974
|
-
src: url.href,
|
|
7975
|
-
sandbox: "allow-scripts allow-same-origin",
|
|
7976
|
-
referrerPolicy: "no-referrer",
|
|
7977
|
-
onLoad: () => {
|
|
7978
|
-
loaded.current = true;
|
|
8551
|
+
versions?.banner,
|
|
8552
|
+
readOnly && ready && !readOnlyBridge && /* @__PURE__ */ jsx9(Box4, { padding: 2, background: "neutral100", children: /* @__PURE__ */ jsx9(Typography4, { variant: "pi", role: "status", children: t.versionsBridgeLegacy }) }),
|
|
8553
|
+
/* @__PURE__ */ jsxs6("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: [
|
|
8554
|
+
/* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: sidebarPosition === "bottom" ? "column-reverse" : sidebarPosition === "right" ? "row-reverse" : "row" }, children: [
|
|
8555
|
+
!readOnly && mode === "preview" && sidebar.length > 0 && /* @__PURE__ */ jsx9("div", { ref: setRailEl, style: { display: "flex" }, children: /* @__PURE__ */ jsx9(
|
|
8556
|
+
Flex3,
|
|
8557
|
+
{
|
|
8558
|
+
"data-testid": "page-preview-sidebar",
|
|
8559
|
+
"data-position": sidebarPosition,
|
|
8560
|
+
role: "toolbar",
|
|
8561
|
+
"aria-label": t.sidebarLabel,
|
|
8562
|
+
direction: sidebarPosition === "bottom" ? "row" : "column",
|
|
8563
|
+
gap: 1,
|
|
8564
|
+
padding: 1,
|
|
8565
|
+
background: "neutral100",
|
|
8566
|
+
justifyContent: sidebarPosition === "bottom" ? "center" : "flex-start",
|
|
8567
|
+
style: { [sidebarPosition === "bottom" ? "borderTop" : sidebarPosition === "right" ? "borderLeft" : "borderRight"]: `1px solid ${theme?.colors?.neutral200 || "#dcdce4"}`, overflow: "auto" },
|
|
8568
|
+
children: sidebar.map((item, i) => /* @__PURE__ */ jsxs6(
|
|
8569
|
+
RailButton,
|
|
8570
|
+
{
|
|
8571
|
+
type: "button",
|
|
8572
|
+
$active: fieldsPanel === item,
|
|
8573
|
+
"aria-pressed": fieldsPanel === item,
|
|
8574
|
+
title: item.label,
|
|
8575
|
+
"data-testid": item.custom ? `sidebar-panel-${item.id}` : `sidebar-item-${i}`,
|
|
8576
|
+
onClick: () => setFieldsPanel(fieldsPanel === item ? null : item),
|
|
8577
|
+
children: [
|
|
8578
|
+
typeof item.icon === "string" ? item.icon && /* @__PURE__ */ jsx9(Icon, { name: item.icon }) : item.icon,
|
|
8579
|
+
/* @__PURE__ */ jsx9("span", { children: item.label })
|
|
8580
|
+
]
|
|
7979
8581
|
},
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
8582
|
+
`${item.label}-${i}`
|
|
8583
|
+
))
|
|
8584
|
+
}
|
|
8585
|
+
) }),
|
|
8586
|
+
/* @__PURE__ */ jsx9(
|
|
8587
|
+
"div",
|
|
8588
|
+
{
|
|
8589
|
+
ref: setStage,
|
|
8590
|
+
"data-testid": "page-preview-stage",
|
|
8591
|
+
"data-device": device.id,
|
|
8592
|
+
style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
|
|
8593
|
+
children: /* @__PURE__ */ jsx9(
|
|
8594
|
+
Frame2,
|
|
8595
|
+
{
|
|
8596
|
+
ref: iframe,
|
|
8597
|
+
title: t.previewPane,
|
|
8598
|
+
src: url.href,
|
|
8599
|
+
sandbox: "allow-scripts allow-same-origin",
|
|
8600
|
+
referrerPolicy: "no-referrer",
|
|
8601
|
+
...readOnly && !readOnlyBridge ? { inert: "", tabIndex: -1 } : {},
|
|
8602
|
+
onLoad: () => {
|
|
8603
|
+
loaded.current = true;
|
|
8604
|
+
},
|
|
8605
|
+
style: { ...frameStyle(device.width, stageSize), ...dragging || readOnly && !readOnlyBridge ? { pointerEvents: "none" } : {} }
|
|
8606
|
+
},
|
|
8607
|
+
attempt
|
|
8608
|
+
)
|
|
8609
|
+
}
|
|
8610
|
+
)
|
|
8611
|
+
] }),
|
|
8612
|
+
versions?.drawer
|
|
7986
8613
|
] })
|
|
7987
8614
|
]
|
|
7988
8615
|
}
|
|
7989
8616
|
),
|
|
7990
8617
|
document.body
|
|
7991
8618
|
),
|
|
8619
|
+
deletingGroup && /* @__PURE__ */ jsx9(Modal3, { open: true, width: "48rem", onOpenChange: (open) => !open && setDeletingGroup(null), trigger: null, title: t.confirmDeleteGroupTitle, children: /* @__PURE__ */ jsxs6(Flex3, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "preview-confirm-delete-group", children: [
|
|
8620
|
+
/* @__PURE__ */ jsx9(Typography4, { children: t.f("confirmDeleteGroup", { name: deletingGroup.label, count: deletingGroup.count }) }),
|
|
8621
|
+
deletingGroup.count > 0 && /* @__PURE__ */ jsx9(Typography4, { variant: "pi", textColor: "neutral600", children: t.f("confirmDeleteGroupHint", { count: deletingGroup.count }) }),
|
|
8622
|
+
/* @__PURE__ */ jsxs6(Flex3, { gap: 2, justifyContent: "flex-end", children: [
|
|
8623
|
+
/* @__PURE__ */ jsx9(Button3, { variant: "tertiary", onClick: () => setDeletingGroup(null), children: t.cancel }),
|
|
8624
|
+
deletingGroup.count > 0 && /* @__PURE__ */ jsx9(Button3, { variant: "secondary", onClick: () => confirmGroupDelete(true), children: t.keepGroupBlocks }),
|
|
8625
|
+
/* @__PURE__ */ jsx9(Button3, { variant: "danger", onClick: () => confirmGroupDelete(false), children: t.f("deleteGroupAndBlocks", { count: deletingGroup.count }) })
|
|
8626
|
+
] })
|
|
8627
|
+
] }) }),
|
|
7992
8628
|
inserting && insertAttr && /* @__PURE__ */ jsx9(
|
|
7993
8629
|
PickerModal,
|
|
7994
8630
|
{
|
|
@@ -8009,6 +8645,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
8009
8645
|
if (!open) setInserting(null);
|
|
8010
8646
|
},
|
|
8011
8647
|
onSelect: (uid, values2) => {
|
|
8648
|
+
if (live.current.readOnly) return;
|
|
8012
8649
|
const rows = inserting.zone === zone ? latest.current : Array.isArray(host.values?.[inserting.zone]) ? host.values[inserting.zone] : [];
|
|
8013
8650
|
const index = insertIndex(rows, inserting.after);
|
|
8014
8651
|
setInserting(null);
|
|
@@ -8133,6 +8770,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
8133
8770
|
multiple: picking.attr.multiple === true,
|
|
8134
8771
|
onClose: () => setPicking(null),
|
|
8135
8772
|
onSelectAssets: (assets) => {
|
|
8773
|
+
if (live.current.readOnly) return;
|
|
8136
8774
|
const index = indexOf(picking.key);
|
|
8137
8775
|
setPicking(null);
|
|
8138
8776
|
if (index < 0 || !assets?.length) return;
|
|
@@ -8190,11 +8828,15 @@ function usePreviewHost5() {
|
|
|
8190
8828
|
const { toggleNotification } = useNotification();
|
|
8191
8829
|
const components = useStrapiApp("BlockscenePagePreview", (state) => state.components);
|
|
8192
8830
|
const fields = c.layout?.edit?.layout?.flat(3) || [];
|
|
8831
|
+
const layoutFields = React9.useMemo(
|
|
8832
|
+
() => new Set(fields.map((field) => field?.name).filter(Boolean)),
|
|
8833
|
+
[c.layout?.edit?.layout]
|
|
8834
|
+
);
|
|
8193
8835
|
const latest = React9.useRef(values);
|
|
8194
8836
|
latest.current = values;
|
|
8195
8837
|
const readable = React9.useCallback(
|
|
8196
|
-
(name) => c.isCreatingEntry || (
|
|
8197
|
-
[c.isCreatingEntry, rbac.canReadFields]
|
|
8838
|
+
(name) => fieldReadable(name, rbac.canReadFields, c.isCreatingEntry) || layoutFields.has(name.split(".")[0]),
|
|
8839
|
+
[c.isCreatingEntry, layoutFields, rbac.canReadFields]
|
|
8198
8840
|
);
|
|
8199
8841
|
return {
|
|
8200
8842
|
ds: 2,
|
|
@@ -8468,6 +9110,8 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8468
9110
|
const initialValues = useForm2("BlocksceneVersions", (state) => state.initialValues);
|
|
8469
9111
|
const setValues = useForm2("BlocksceneVersions", (state) => state.setValues);
|
|
8470
9112
|
const [events, setEvents] = React10.useState(null);
|
|
9113
|
+
const [pagination, setPagination] = React10.useState(null);
|
|
9114
|
+
const [moreLoading, setMoreLoading] = React10.useState(false);
|
|
8471
9115
|
const [failed, setFailed] = React10.useState(false);
|
|
8472
9116
|
const [shown, setShown] = React10.useState(PAGE);
|
|
8473
9117
|
const [open, setOpen] = React10.useState(null);
|
|
@@ -8475,11 +9119,19 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8475
9119
|
const [loading, setLoading] = React10.useState(false);
|
|
8476
9120
|
const [refresh, reload] = React10.useReducer((n) => n + 1, 0);
|
|
8477
9121
|
const allowed = Boolean(allowedActions?.canRead);
|
|
9122
|
+
const scope = `${model}:${documentId}:${locale}:${allowed}`;
|
|
9123
|
+
const latestScope = React10.useRef(scope);
|
|
9124
|
+
latestScope.current = scope;
|
|
8478
9125
|
React10.useEffect(() => {
|
|
8479
9126
|
if (!allowed || !documentId) return;
|
|
8480
9127
|
let active = true;
|
|
8481
9128
|
setFailed(false);
|
|
8482
|
-
get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) =>
|
|
9129
|
+
get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) => {
|
|
9130
|
+
if (active) {
|
|
9131
|
+
setEvents(Array.isArray(data?.results) ? data.results : []);
|
|
9132
|
+
setPagination(data?.pagination);
|
|
9133
|
+
}
|
|
9134
|
+
}).catch(() => active && setFailed(true));
|
|
8483
9135
|
return () => {
|
|
8484
9136
|
active = false;
|
|
8485
9137
|
};
|
|
@@ -8488,7 +9140,26 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8488
9140
|
setOpen(null);
|
|
8489
9141
|
setReport(null);
|
|
8490
9142
|
setShown(PAGE);
|
|
9143
|
+
setEvents(null);
|
|
9144
|
+
setPagination(null);
|
|
9145
|
+
setMoreLoading(false);
|
|
8491
9146
|
}, [model, documentId, locale]);
|
|
9147
|
+
const more = async () => {
|
|
9148
|
+
if (shown < (events?.length || 0)) return setShown(shown + PAGE);
|
|
9149
|
+
setMoreLoading(true);
|
|
9150
|
+
try {
|
|
9151
|
+
const params = new URLSearchParams({ page: String((pagination?.page || 1) + 1), ...locale && { locale } });
|
|
9152
|
+
const { data } = await get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}?${params}`);
|
|
9153
|
+
if (latestScope.current !== scope) return;
|
|
9154
|
+
setEvents((previous) => [...previous || [], ...data?.results || []]);
|
|
9155
|
+
setPagination(data?.pagination);
|
|
9156
|
+
setShown(shown + PAGE);
|
|
9157
|
+
} catch {
|
|
9158
|
+
if (latestScope.current === scope) setFailed(true);
|
|
9159
|
+
} finally {
|
|
9160
|
+
if (latestScope.current === scope) setMoreLoading(false);
|
|
9161
|
+
}
|
|
9162
|
+
};
|
|
8492
9163
|
if (isLoading || !allowed || !documentId) return null;
|
|
8493
9164
|
const name = (uid) => components?.[uid]?.info?.displayName || uid;
|
|
8494
9165
|
const when2 = (at) => {
|
|
@@ -8584,30 +9255,291 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8584
9255
|
] }) })
|
|
8585
9256
|
] }, event.id);
|
|
8586
9257
|
}),
|
|
8587
|
-
events.length > shown && /* @__PURE__ */ jsx11(Flex5, { children: /* @__PURE__ */ jsx11(Button5, { variant: "tertiary", size: "S", onClick:
|
|
9258
|
+
(events.length > shown || pagination?.page < pagination?.pageCount) && /* @__PURE__ */ jsx11(Flex5, { children: /* @__PURE__ */ jsx11(Button5, { variant: "tertiary", size: "S", onClick: more, loading: moreLoading, disabled: moreLoading, children: t.historyShowMore }) })
|
|
8588
9259
|
] })
|
|
8589
9260
|
] });
|
|
8590
9261
|
}
|
|
8591
9262
|
|
|
8592
|
-
// admin/
|
|
9263
|
+
// admin/Versions.tsx
|
|
8593
9264
|
import * as React11 from "react";
|
|
8594
|
-
import { Box as Box6, Button as Button6, Flex as Flex6, Searchbar as Searchbar2, Typography as Typography7 } from "@strapi/design-system";
|
|
8595
9265
|
import styled7 from "styled-components";
|
|
8596
|
-
import {
|
|
9266
|
+
import { Box as Box6, Button as Button6, Flex as Flex6, SingleSelect, SingleSelectOption, Typography as Typography7 } from "@strapi/design-system";
|
|
9267
|
+
import { useQueryParams as useQueryParams3, useRBAC as useRBAC2 } from "@strapi/strapi/admin";
|
|
9268
|
+
import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
9269
|
+
var Drawer = styled7.aside`
|
|
9270
|
+
width: min(36rem, 55%); flex: 0 0 auto; overflow: auto;
|
|
9271
|
+
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
9272
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
|
9273
|
+
`;
|
|
9274
|
+
var Entry = styled7.button`
|
|
9275
|
+
display: block; width: 100%; text-align: left; padding: 12px; margin: 4px 0;
|
|
9276
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px;
|
|
9277
|
+
background: ${({ theme }) => theme.colors.neutral0}; cursor: pointer;
|
|
9278
|
+
&[aria-pressed="true"] { background: ${({ theme }) => theme.colors.primary100}; border-color: ${({ theme }) => theme.colors.primary600}; }
|
|
9279
|
+
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
|
|
9280
|
+
&:disabled { cursor: default; opacity: .65; }
|
|
9281
|
+
overflow-wrap: anywhere;
|
|
9282
|
+
`;
|
|
9283
|
+
var PAGE_SIZE = 25;
|
|
9284
|
+
function useVersions(host, config2) {
|
|
9285
|
+
const t = useMessages();
|
|
9286
|
+
const [{ query: query2 }] = useQueryParams3();
|
|
9287
|
+
const locale = typeof query2?.plugins?.i18n?.locale === "string" ? query2.plugins.i18n.locale : host.locale || "";
|
|
9288
|
+
const rbac = useRBAC2(HISTORY_READ);
|
|
9289
|
+
const allowed = !rbac.isLoading && Boolean(rbac.allowedActions?.canRead);
|
|
9290
|
+
const enabled = Boolean(config2?.contentTypes?.includes(host.model));
|
|
9291
|
+
const scope = `${host.model}:${host.documentId || ""}:${locale}:${allowed}:${enabled}`;
|
|
9292
|
+
const currentScope = React11.useRef(scope);
|
|
9293
|
+
currentScope.current = scope;
|
|
9294
|
+
const requests = React11.useRef(0);
|
|
9295
|
+
const [open, setOpen] = React11.useState(false);
|
|
9296
|
+
const [actor, setActor] = React11.useState("");
|
|
9297
|
+
const [page, setPage] = React11.useState(1);
|
|
9298
|
+
const [list2, setList] = React11.useState(null);
|
|
9299
|
+
const [people, setPeople] = React11.useState(null);
|
|
9300
|
+
const [selection, setSelection] = React11.useState(null);
|
|
9301
|
+
const [failed, setFailed] = React11.useState(false);
|
|
9302
|
+
const [refresh, retry] = React11.useReducer((n) => n + 1, 0);
|
|
9303
|
+
const trigger = React11.useRef(null);
|
|
9304
|
+
const closeButton = React11.useRef(null);
|
|
9305
|
+
const titleId = React11.useId(), drawerId = React11.useId();
|
|
9306
|
+
const available = allowed && enabled && Boolean(host.documentId) && !host.creating;
|
|
9307
|
+
const reason = rbac.isLoading ? t.historyLoading : !allowed ? t.versionsDenied : !enabled ? t.versionsDisabled : !host.documentId || host.creating ? t.versionsNew : "";
|
|
9308
|
+
const view = selection?.scope === scope ? selection : null;
|
|
9309
|
+
const close = () => {
|
|
9310
|
+
setOpen(false);
|
|
9311
|
+
trigger.current?.focus();
|
|
9312
|
+
};
|
|
9313
|
+
const back = () => {
|
|
9314
|
+
requests.current++;
|
|
9315
|
+
setSelection(null);
|
|
9316
|
+
setFailed(false);
|
|
9317
|
+
trigger.current?.focus();
|
|
9318
|
+
};
|
|
9319
|
+
React11.useEffect(() => {
|
|
9320
|
+
requests.current++;
|
|
9321
|
+
setSelection(null);
|
|
9322
|
+
setList(null);
|
|
9323
|
+
setPeople(null);
|
|
9324
|
+
setActor("");
|
|
9325
|
+
setPage(1);
|
|
9326
|
+
setFailed(false);
|
|
9327
|
+
return () => {
|
|
9328
|
+
requests.current++;
|
|
9329
|
+
};
|
|
9330
|
+
}, [scope]);
|
|
9331
|
+
React11.useEffect(() => {
|
|
9332
|
+
if (open) closeButton.current?.focus();
|
|
9333
|
+
}, [open]);
|
|
9334
|
+
React11.useEffect(() => {
|
|
9335
|
+
if (!open || !available) return;
|
|
9336
|
+
let active = true;
|
|
9337
|
+
setList(null);
|
|
9338
|
+
setFailed(false);
|
|
9339
|
+
const params = new URLSearchParams({ page: String(page), pageSize: String(PAGE_SIZE), ...locale && { locale }, ...actor && { actor } });
|
|
9340
|
+
host.get(`/blockscene/history/${encodeURIComponent(host.model)}/${encodeURIComponent(String(host.documentId))}?${params}`).then(({ data }) => {
|
|
9341
|
+
if (active && currentScope.current === scope) {
|
|
9342
|
+
setList({ ...data, scope });
|
|
9343
|
+
setPeople({ scope, actors: data.actors || [] });
|
|
9344
|
+
}
|
|
9345
|
+
}).catch(() => {
|
|
9346
|
+
if (active && currentScope.current === scope) setFailed(true);
|
|
9347
|
+
});
|
|
9348
|
+
return () => {
|
|
9349
|
+
active = false;
|
|
9350
|
+
};
|
|
9351
|
+
}, [scope, open, page, actor, refresh, host.get, host.history?.epoch]);
|
|
9352
|
+
const select = async (event) => {
|
|
9353
|
+
if (!available || !event.stored) return;
|
|
9354
|
+
const request = ++requests.current;
|
|
9355
|
+
setSelection({ scope, event, pending: true, values: view?.values });
|
|
9356
|
+
setFailed(false);
|
|
9357
|
+
try {
|
|
9358
|
+
const { data } = await host.get(`/blockscene/history-events/${event.id}`);
|
|
9359
|
+
if (requests.current !== request || currentScope.current !== scope) return;
|
|
9360
|
+
const localized2 = host.contentType?.pluginOptions?.i18n?.localized;
|
|
9361
|
+
if (!data?.snapshot || data.event?.contentType !== host.model || data.event?.relatedDocumentId !== String(host.documentId) || localized2 && (data.event?.locale || "") !== (locale || list2?.locale || "")) throw new Error("Unavailable version");
|
|
9362
|
+
const loaded = loadVersion(data.snapshot, {
|
|
9363
|
+
schema: host.contentType,
|
|
9364
|
+
components: host.components,
|
|
9365
|
+
media: data.media,
|
|
9366
|
+
relations: data.relations,
|
|
9367
|
+
editable: host.readable
|
|
9368
|
+
});
|
|
9369
|
+
for (const [name, attr] of Object.entries(host.contentType?.attributes || {}))
|
|
9370
|
+
if (attr.type === "dynamiczone") loaded.values[name]?.forEach((row, i) => {
|
|
9371
|
+
row.__temp_key__ = `version:${event.id}:${i}`;
|
|
9372
|
+
});
|
|
9373
|
+
setSelection({ scope, event, values: loaded.values, report: loaded.report, pending: false });
|
|
9374
|
+
} catch {
|
|
9375
|
+
if (requests.current === request && currentScope.current === scope) {
|
|
9376
|
+
setFailed(true);
|
|
9377
|
+
setSelection(null);
|
|
9378
|
+
}
|
|
9379
|
+
}
|
|
9380
|
+
};
|
|
9381
|
+
const when2 = (at, day = false) => new Date(at).toLocaleString(t.locale, { dateStyle: "medium", ...!day && { timeStyle: "short" } });
|
|
9382
|
+
const events = list2?.scope === scope ? list2.results || [] : [];
|
|
9383
|
+
let previousDay = "";
|
|
9384
|
+
const drawer = open && /* @__PURE__ */ jsx12(
|
|
9385
|
+
Drawer,
|
|
9386
|
+
{
|
|
9387
|
+
id: drawerId,
|
|
9388
|
+
role: "region",
|
|
9389
|
+
"aria-labelledby": titleId,
|
|
9390
|
+
"data-testid": "versions-drawer",
|
|
9391
|
+
onKeyDown: (event) => {
|
|
9392
|
+
if (event.key === "Escape") {
|
|
9393
|
+
event.preventDefault();
|
|
9394
|
+
event.stopPropagation();
|
|
9395
|
+
close();
|
|
9396
|
+
}
|
|
9397
|
+
},
|
|
9398
|
+
children: /* @__PURE__ */ jsxs9(Box6, { padding: 4, children: [
|
|
9399
|
+
/* @__PURE__ */ jsxs9(Flex6, { gap: 2, justifyContent: "space-between", children: [
|
|
9400
|
+
/* @__PURE__ */ jsx12(Typography7, { id: titleId, tag: "h2", variant: "delta", children: t.historyTitle }),
|
|
9401
|
+
/* @__PURE__ */ jsx12(Button6, { ref: closeButton, size: "S", variant: "tertiary", "aria-label": t.close, onClick: close, children: /* @__PURE__ */ jsx12(Icon, { name: "close" }) })
|
|
9402
|
+
] }),
|
|
9403
|
+
reason ? /* @__PURE__ */ jsx12(Typography7, { tag: "p", textColor: "neutral600", children: reason }) : /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
9404
|
+
/* @__PURE__ */ jsx12(Box6, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ jsxs9(SingleSelect, { "aria-label": t.versionsPerson, value: actor, onChange: (value) => {
|
|
9405
|
+
setActor(value);
|
|
9406
|
+
setPage(1);
|
|
9407
|
+
}, children: [
|
|
9408
|
+
/* @__PURE__ */ jsx12(SingleSelectOption, { value: "", children: t.versionsEveryone }),
|
|
9409
|
+
(people?.scope === scope ? people.actors : []).map((person) => /* @__PURE__ */ jsx12(SingleSelectOption, { value: person.actor, children: person.actorName || person.actor }, person.actor))
|
|
9410
|
+
] }) }),
|
|
9411
|
+
!list2 && !failed && /* @__PURE__ */ jsx12(Typography7, { role: "status", children: t.historyLoading }),
|
|
9412
|
+
list2 && !events.length && /* @__PURE__ */ jsx12(Typography7, { children: t.historyEmpty }),
|
|
9413
|
+
events.map((event) => {
|
|
9414
|
+
const day = when2(event.at, true), heading = day !== previousDay;
|
|
9415
|
+
previousDay = day;
|
|
9416
|
+
const blocks = event.summary?.blocks;
|
|
9417
|
+
const counted = ["total", "added", "removed", "changed"].every((key) => Number.isInteger(blocks?.[key]));
|
|
9418
|
+
return /* @__PURE__ */ jsxs9(React11.Fragment, { children: [
|
|
9419
|
+
heading && /* @__PURE__ */ jsx12(Typography7, { tag: "h3", variant: "omega", fontWeight: "bold", style: { marginTop: 12 }, children: day }),
|
|
9420
|
+
/* @__PURE__ */ jsxs9(
|
|
9421
|
+
Entry,
|
|
9422
|
+
{
|
|
9423
|
+
"aria-pressed": view?.event.id === event.id,
|
|
9424
|
+
disabled: !event.stored,
|
|
9425
|
+
title: !event.stored ? t.historyExpired : void 0,
|
|
9426
|
+
"data-testid": `version-${event.id}`,
|
|
9427
|
+
onClick: () => select(event),
|
|
9428
|
+
children: [
|
|
9429
|
+
/* @__PURE__ */ jsx12(Typography7, { tag: "span", fontWeight: "bold", children: event.actorName || event.actor }),
|
|
9430
|
+
/* @__PURE__ */ jsxs9(Typography7, { tag: "p", variant: "pi", children: [
|
|
9431
|
+
when2(event.at),
|
|
9432
|
+
" \xB7 ",
|
|
9433
|
+
t.historyActions[event.action] || event.action
|
|
9434
|
+
] }),
|
|
9435
|
+
counted ? /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
9436
|
+
/* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", textColor: "neutral600", children: t.f("versionsCounts", blocks) }),
|
|
9437
|
+
/* @__PURE__ */ jsxs9(Flex6, { gap: 2, wrap: "wrap", children: [
|
|
9438
|
+
/* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "success700", children: [
|
|
9439
|
+
"+",
|
|
9440
|
+
blocks.added,
|
|
9441
|
+
" ",
|
|
9442
|
+
t.diffOps.added
|
|
9443
|
+
] }),
|
|
9444
|
+
/* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "danger700", children: [
|
|
9445
|
+
"\u2212",
|
|
9446
|
+
blocks.removed,
|
|
9447
|
+
" ",
|
|
9448
|
+
t.diffOps.removed
|
|
9449
|
+
] }),
|
|
9450
|
+
/* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "warning700", children: [
|
|
9451
|
+
"~",
|
|
9452
|
+
blocks.changed,
|
|
9453
|
+
" ",
|
|
9454
|
+
t.diffOps.changed
|
|
9455
|
+
] })
|
|
9456
|
+
] })
|
|
9457
|
+
] }) : /* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", textColor: "neutral600", children: t.versionsCountsMissing }),
|
|
9458
|
+
!event.stored && /* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", children: t.historyExpired })
|
|
9459
|
+
]
|
|
9460
|
+
}
|
|
9461
|
+
)
|
|
9462
|
+
] }, event.id);
|
|
9463
|
+
}),
|
|
9464
|
+
list2 && /* @__PURE__ */ jsxs9(Flex6, { gap: 2, paddingTop: 3, justifyContent: "space-between", children: [
|
|
9465
|
+
/* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.versionsPrevious }),
|
|
9466
|
+
/* @__PURE__ */ jsx12(Typography7, { variant: "pi", children: t.f("versionsPage", { page, count: Math.max(1, list2.pagination?.pageCount || 0) }) }),
|
|
9467
|
+
/* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", disabled: page >= (list2.pagination?.pageCount || 0), onClick: () => setPage(page + 1), children: t.versionsNext })
|
|
9468
|
+
] })
|
|
9469
|
+
] }),
|
|
9470
|
+
failed && /* @__PURE__ */ jsxs9(Box6, { paddingTop: 3, children: [
|
|
9471
|
+
/* @__PURE__ */ jsx12(Typography7, { role: "alert", textColor: "danger600", children: t.historyFailed }),
|
|
9472
|
+
/* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", onClick: retry, children: t.retry })
|
|
9473
|
+
] })
|
|
9474
|
+
] })
|
|
9475
|
+
}
|
|
9476
|
+
);
|
|
9477
|
+
return {
|
|
9478
|
+
view,
|
|
9479
|
+
drawer,
|
|
9480
|
+
button: /* @__PURE__ */ jsx12(
|
|
9481
|
+
Button6,
|
|
9482
|
+
{
|
|
9483
|
+
ref: trigger,
|
|
9484
|
+
size: "S",
|
|
9485
|
+
variant: "tertiary",
|
|
9486
|
+
startIcon: /* @__PURE__ */ jsx12(Icon, { name: "clock" }),
|
|
9487
|
+
"data-testid": "versions-toggle",
|
|
9488
|
+
"aria-expanded": open,
|
|
9489
|
+
"aria-controls": open ? drawerId : void 0,
|
|
9490
|
+
title: reason || t.historyTitle,
|
|
9491
|
+
onClick: () => setOpen(!open),
|
|
9492
|
+
children: t.historyTitle
|
|
9493
|
+
}
|
|
9494
|
+
),
|
|
9495
|
+
banner: view && /* @__PURE__ */ jsxs9(Flex6, { padding: 3, gap: 3, wrap: "wrap", background: "primary100", "data-testid": "versions-banner", children: [
|
|
9496
|
+
/* @__PURE__ */ jsx12(Typography7, { role: "status", children: view.pending ? t.historyLoading : t.f("versionsViewing", { date: when2(view.event.at), person: view.event.actorName || view.event.actor }) }),
|
|
9497
|
+
/* @__PURE__ */ jsx12(Button6, { size: "S", variant: "secondary", onClick: back, children: t.versionsCurrent }),
|
|
9498
|
+
!view.pending && (view.report?.blocks || view.report?.media || view.report?.relations || view.report?.removed.length) > 0 && /* @__PURE__ */ jsx12(Typography7, { variant: "pi", children: t.versionsMissing })
|
|
9499
|
+
] })
|
|
9500
|
+
};
|
|
9501
|
+
}
|
|
9502
|
+
|
|
9503
|
+
// admin/Settings.tsx
|
|
9504
|
+
import * as React12 from "react";
|
|
9505
|
+
import { Box as Box7, Button as Button7, Flex as Flex7, Searchbar as Searchbar2, Typography as Typography8 } from "@strapi/design-system";
|
|
9506
|
+
import styled8 from "styled-components";
|
|
9507
|
+
import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
8597
9508
|
var COLOR2 = /^#[0-9A-Fa-f]{6}$/;
|
|
8598
|
-
var Grid2 =
|
|
8599
|
-
var Card2 =
|
|
9509
|
+
var Grid2 = styled8.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; `;
|
|
9510
|
+
var Card2 = styled8.div`
|
|
8600
9511
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8601
9512
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral0};
|
|
8602
9513
|
`;
|
|
8603
|
-
var
|
|
9514
|
+
var ContentTypeGrid = styled8.div`
|
|
9515
|
+
display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start;
|
|
9516
|
+
`;
|
|
9517
|
+
var ContentTypeCard = styled8.div`
|
|
9518
|
+
display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 4px;
|
|
9519
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral0};
|
|
9520
|
+
`;
|
|
9521
|
+
var ContentTypeTop = styled8.div`
|
|
9522
|
+
display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); gap: 16px; align-items: end;
|
|
9523
|
+
@media (max-width: 520px) { grid-template-columns: 1fr; }
|
|
9524
|
+
`;
|
|
9525
|
+
var Advanced = styled8.details`
|
|
9526
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral200}; padding-top: 12px;
|
|
9527
|
+
summary { cursor: pointer; color: ${({ theme }) => theme.colors.neutral800}; font-size: 13px; font-weight: 600; }
|
|
9528
|
+
summary::marker { color: ${({ theme }) => theme.colors.neutral500}; }
|
|
9529
|
+
&[open] summary { margin-bottom: 16px; }
|
|
9530
|
+
`;
|
|
9531
|
+
var ToolbarSection = styled8.div`
|
|
9532
|
+
display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding-top: 16px;
|
|
9533
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
9534
|
+
`;
|
|
9535
|
+
var Bar = styled8.div`
|
|
8604
9536
|
position: fixed; top: 0; z-index: 4; padding: 12px 32px;
|
|
8605
9537
|
background: ${({ theme }) => theme.colors.neutral100}; border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8606
9538
|
box-shadow: 0 1px 4px rgba(33, 33, 52, 0.1);
|
|
8607
9539
|
`;
|
|
8608
9540
|
function useMainRect2(anchor) {
|
|
8609
|
-
const [rect, setRect] =
|
|
8610
|
-
|
|
9541
|
+
const [rect, setRect] = React12.useState({ left: 0, width: 0 });
|
|
9542
|
+
React12.useEffect(() => {
|
|
8611
9543
|
const read3 = () => {
|
|
8612
9544
|
let host = document.getElementById("main-content");
|
|
8613
9545
|
for (let el = anchor.current?.parentElement; !host && el; el = el.parentElement) if (["auto", "scroll"].includes(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) host = el;
|
|
@@ -8620,15 +9552,15 @@ function useMainRect2(anchor) {
|
|
|
8620
9552
|
});
|
|
8621
9553
|
return rect;
|
|
8622
9554
|
}
|
|
8623
|
-
var Swatches =
|
|
8624
|
-
var Label =
|
|
9555
|
+
var Swatches = styled8.div` display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; `;
|
|
9556
|
+
var Label = styled8.label` display: flex; flex-direction: column; gap: 4px; font-size: 12px; `;
|
|
8625
9557
|
function ColorField({ name, label, value, onChange, disabled }) {
|
|
8626
9558
|
const valid = COLOR2.test(value);
|
|
8627
|
-
return /* @__PURE__ */
|
|
8628
|
-
/* @__PURE__ */
|
|
8629
|
-
/* @__PURE__ */
|
|
8630
|
-
/* @__PURE__ */
|
|
8631
|
-
/* @__PURE__ */
|
|
9559
|
+
return /* @__PURE__ */ jsxs10(Label, { children: [
|
|
9560
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
|
|
9561
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 2, children: [
|
|
9562
|
+
/* @__PURE__ */ jsx13("input", { type: "color", "aria-label": label, value: valid ? value : "#000000", disabled, onChange: (e) => onChange(e.target.value.toUpperCase()), style: { width: 40, height: 32, padding: 0, border: 0, background: "none" } }),
|
|
9563
|
+
/* @__PURE__ */ jsx13(
|
|
8632
9564
|
"input",
|
|
8633
9565
|
{
|
|
8634
9566
|
name,
|
|
@@ -8644,14 +9576,34 @@ function ColorField({ name, label, value, onChange, disabled }) {
|
|
|
8644
9576
|
] });
|
|
8645
9577
|
}
|
|
8646
9578
|
function TagsField({ name, label, hint, value, onChange, disabled }) {
|
|
8647
|
-
const
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
9579
|
+
const external = value.join(", ");
|
|
9580
|
+
const input = React12.useRef(null);
|
|
9581
|
+
const focused = React12.useRef(false);
|
|
9582
|
+
const parse = (next) => [...new Set(next.split(",").map((tag) => tag.replace(/[<>]/g, "").trim().slice(0, 24)).filter(Boolean))].slice(0, 10);
|
|
9583
|
+
React12.useEffect(() => {
|
|
9584
|
+
if (!focused.current && input.current && input.current.value !== external) input.current.value = external;
|
|
9585
|
+
}, [external]);
|
|
9586
|
+
return /* @__PURE__ */ jsxs10(Label, { children: [
|
|
9587
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
|
|
9588
|
+
/* @__PURE__ */ jsx13(
|
|
9589
|
+
"input",
|
|
9590
|
+
{
|
|
9591
|
+
ref: input,
|
|
9592
|
+
name,
|
|
9593
|
+
defaultValue: external,
|
|
9594
|
+
disabled,
|
|
9595
|
+
spellCheck: false,
|
|
9596
|
+
onFocus: () => {
|
|
9597
|
+
focused.current = true;
|
|
9598
|
+
},
|
|
9599
|
+
onBlur: (e) => {
|
|
9600
|
+
focused.current = false;
|
|
9601
|
+
onChange(parse(e.currentTarget.value));
|
|
9602
|
+
},
|
|
9603
|
+
style: { padding: "6px 8px", border: "1px solid #dcdce4", borderRadius: 4, fontSize: 13 }
|
|
9604
|
+
}
|
|
9605
|
+
),
|
|
9606
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: hint })
|
|
8655
9607
|
] });
|
|
8656
9608
|
}
|
|
8657
9609
|
var FIELD_UID = /^(plugin|global)::[\w.-]+$/;
|
|
@@ -8659,11 +9611,11 @@ var LAZY_MAX = 20;
|
|
|
8659
9611
|
var parseUids = (text) => [...new Set(text.split(/[\s,]+/).filter(Boolean))];
|
|
8660
9612
|
var badUids = (uids = []) => uids.length > LAZY_MAX || uids.some((uid) => !FIELD_UID.test(uid));
|
|
8661
9613
|
function UidListField({ TextField: TextField2, value, onChange, ...props }) {
|
|
8662
|
-
const [text, setText] =
|
|
8663
|
-
|
|
9614
|
+
const [text, setText] = React12.useState(value.join(", "));
|
|
9615
|
+
React12.useEffect(() => {
|
|
8664
9616
|
if (parseUids(text).join() !== value.join()) setText(value.join(", "));
|
|
8665
9617
|
}, [value.join()]);
|
|
8666
|
-
return /* @__PURE__ */
|
|
9618
|
+
return /* @__PURE__ */ jsx13(TextField2, { ...props, value: text, onChange: (v) => {
|
|
8667
9619
|
setText(v);
|
|
8668
9620
|
onChange(parseUids(v));
|
|
8669
9621
|
} });
|
|
@@ -8673,31 +9625,31 @@ var SIDEBAR_MAX = 12;
|
|
|
8673
9625
|
var ITEM_LABEL = /^[^<>]{1,40}$/;
|
|
8674
9626
|
var badItem = (item) => !ITEM_LABEL.test(String(item.label || "").trim()) || !item.fields?.length;
|
|
8675
9627
|
var SYSTEM_FIELDS2 = ["createdAt", "updatedAt", "publishedAt", "createdBy", "updatedBy", "locale", "localizations"];
|
|
8676
|
-
var Item =
|
|
9628
|
+
var Item = styled8.div`
|
|
8677
9629
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8678
9630
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral100};
|
|
8679
9631
|
`;
|
|
8680
|
-
var Checks =
|
|
9632
|
+
var Checks = styled8.fieldset`
|
|
8681
9633
|
display: flex; flex-wrap: wrap; gap: 4px 16px; border: 0; padding: 0; margin: 0; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800};
|
|
8682
9634
|
legend { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
|
|
8683
9635
|
label { display: inline-flex; align-items: center; gap: 6px; }
|
|
8684
9636
|
`;
|
|
8685
|
-
var TOOLBAR2 = ["modes", "history", "devices", "status", "actions"];
|
|
9637
|
+
var TOOLBAR2 = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
8686
9638
|
var DEVICE_NAMES = ["fit", "mobile", "tablet", "desktop"];
|
|
8687
9639
|
var DEVICE_LABEL = /^[^<>]{1,24}$/;
|
|
8688
9640
|
var badDevices = (list2 = []) => list2.length < 1 || list2.length > 8 || list2.some((item) => typeof item !== "string" && (!DEVICE_LABEL.test(String(item.label || "").trim()) || !(Number.isInteger(item.width) && item.width >= 240 && item.width <= 3840))) || new Set(list2.map((item) => typeof item === "string" ? item : item.width)).size !== list2.length;
|
|
8689
|
-
var Row =
|
|
8690
|
-
function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2 }) {
|
|
9641
|
+
var Row = styled8.div` display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800}; `;
|
|
9642
|
+
function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2, versions }) {
|
|
8691
9643
|
const move = (list2, index, by) => {
|
|
8692
9644
|
const next = [...list2];
|
|
8693
9645
|
[next[index], next[index + by]] = [next[index + by], next[index]];
|
|
8694
9646
|
return next;
|
|
8695
9647
|
};
|
|
8696
|
-
const arrows = (list2, index, key) => /* @__PURE__ */
|
|
8697
|
-
/* @__PURE__ */
|
|
8698
|
-
/* @__PURE__ */
|
|
9648
|
+
const arrows = (list2, index, key) => /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
9649
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index < 0 || index === 0, onClick: () => set2(key, move(list2, index, -1)) }),
|
|
9650
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index < 0 || index === list2.length - 1, onClick: () => set2(key, move(list2, index, 1)) })
|
|
8699
9651
|
] });
|
|
8700
|
-
const check = (list2, item, key) => /* @__PURE__ */
|
|
9652
|
+
const check = (list2, item, key) => /* @__PURE__ */ jsx13(
|
|
8701
9653
|
"input",
|
|
8702
9654
|
{
|
|
8703
9655
|
type: "checkbox",
|
|
@@ -8708,27 +9660,27 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8708
9660
|
}
|
|
8709
9661
|
);
|
|
8710
9662
|
const width = (index, patch) => set2("previewDevices", devices.map((item, i) => i === index ? { ...item, ...patch } : item));
|
|
8711
|
-
return /* @__PURE__ */
|
|
8712
|
-
/* @__PURE__ */
|
|
8713
|
-
/* @__PURE__ */
|
|
9663
|
+
return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 3, "data-testid": `pane-editor-${id}`, children: [
|
|
9664
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.paneHelp }),
|
|
9665
|
+
/* @__PURE__ */ jsx13(Box7, { children: [...toolbar, ...TOOLBAR2.filter((item) => !toolbar.includes(item))].filter((item) => item !== "versions" || versions).map((item) => /* @__PURE__ */ jsxs10(Row, { "data-testid": `${id}-toolbar-${item}`, children: [
|
|
8714
9666
|
arrows(toolbar, toolbar.indexOf(item), "previewToolbar"),
|
|
8715
|
-
/* @__PURE__ */
|
|
9667
|
+
/* @__PURE__ */ jsxs10("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
8716
9668
|
check(toolbar, item, "previewToolbar"),
|
|
8717
9669
|
t.toolbar[item]
|
|
8718
9670
|
] })
|
|
8719
9671
|
] }, item)) }),
|
|
8720
|
-
/* @__PURE__ */
|
|
8721
|
-
/* @__PURE__ */
|
|
8722
|
-
/* @__PURE__ */
|
|
9672
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "delta", tag: "h3", children: t.paneDevices }),
|
|
9673
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.paneDevicesHelp }),
|
|
9674
|
+
/* @__PURE__ */ jsx13(Box7, { children: [...devices, ...DEVICE_NAMES.filter((item) => !devices.includes(item))].map((item) => {
|
|
8723
9675
|
const index = devices.indexOf(item);
|
|
8724
|
-
return /* @__PURE__ */
|
|
9676
|
+
return /* @__PURE__ */ jsxs10(Row, { "data-testid": `${id}-device-${typeof item === "string" ? item : index}`, children: [
|
|
8725
9677
|
arrows(devices, index, "previewDevices"),
|
|
8726
|
-
typeof item === "string" ? /* @__PURE__ */
|
|
9678
|
+
typeof item === "string" ? /* @__PURE__ */ jsxs10("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
8727
9679
|
check(devices, item, "previewDevices"),
|
|
8728
9680
|
t.device[item]
|
|
8729
|
-
] }) : /* @__PURE__ */
|
|
8730
|
-
/* @__PURE__ */
|
|
8731
|
-
/* @__PURE__ */
|
|
9681
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
9682
|
+
/* @__PURE__ */ jsx13(Box7, { style: { flex: "1 1 160px" }, children: /* @__PURE__ */ jsx13(TextField2, { name: `${id}-device-label-${index}`, label: t.paneWidthLabel, value: item.label, disabled, onChange: (v) => width(index, { label: v }) }) }),
|
|
9683
|
+
/* @__PURE__ */ jsx13(Box7, { style: { width: 140 }, children: /* @__PURE__ */ jsx13(
|
|
8732
9684
|
TextField2,
|
|
8733
9685
|
{
|
|
8734
9686
|
name: `${id}-device-width-${index}`,
|
|
@@ -8738,12 +9690,12 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8738
9690
|
onChange: (v) => width(index, { width: /^\d{1,4}$/.test(v.trim()) ? Number(v.trim()) : NaN })
|
|
8739
9691
|
}
|
|
8740
9692
|
) }),
|
|
8741
|
-
/* @__PURE__ */
|
|
9693
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "close", label: t.paneRemoveWidth, disabled, onClick: () => set2("previewDevices", devices.filter((_, i) => i !== index)) })
|
|
8742
9694
|
] })
|
|
8743
9695
|
] }, typeof item === "string" ? item : `px-${index}`);
|
|
8744
9696
|
}) }),
|
|
8745
|
-
/* @__PURE__ */
|
|
8746
|
-
|
|
9697
|
+
/* @__PURE__ */ jsx13(Flex7, { children: /* @__PURE__ */ jsx13(
|
|
9698
|
+
Button7,
|
|
8747
9699
|
{
|
|
8748
9700
|
variant: "secondary",
|
|
8749
9701
|
size: "S",
|
|
@@ -8753,7 +9705,7 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8753
9705
|
children: t.paneAddWidth
|
|
8754
9706
|
}
|
|
8755
9707
|
) }),
|
|
8756
|
-
badDevices(devices) && /* @__PURE__ */
|
|
9708
|
+
badDevices(devices) && /* @__PURE__ */ jsx13(Typography8, { role: "alert", variant: "pi", textColor: "danger600", children: t.paneInvalid })
|
|
8757
9709
|
] });
|
|
8758
9710
|
}
|
|
8759
9711
|
var DAYS = (n) => Number.isInteger(n) && n >= 1 && n <= 3650;
|
|
@@ -8761,7 +9713,7 @@ var badRetention = (h) => !h || !DAYS(h.retentionDays) || !DAYS(h.eventDays) ||
|
|
|
8761
9713
|
function HistorySettings({ types, history, set: set2, t, disabled, ToggleField: ToggleField2, TextField: TextField2 }) {
|
|
8762
9714
|
const all = history.contentTypes === "all";
|
|
8763
9715
|
const list2 = all ? [] : history.contentTypes;
|
|
8764
|
-
const number = (key) => /* @__PURE__ */
|
|
9716
|
+
const number = (key) => /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 200 }, children: /* @__PURE__ */ jsx13(
|
|
8765
9717
|
TextField2,
|
|
8766
9718
|
{
|
|
8767
9719
|
name: `history-${key}`,
|
|
@@ -8771,15 +9723,15 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8771
9723
|
onChange: (v) => set2(key, /^\d{1,5}$/.test(v.trim()) ? Number(v.trim()) : NaN)
|
|
8772
9724
|
}
|
|
8773
9725
|
) });
|
|
8774
|
-
return /* @__PURE__ */
|
|
8775
|
-
/* @__PURE__ */
|
|
8776
|
-
/* @__PURE__ */
|
|
8777
|
-
/* @__PURE__ */
|
|
8778
|
-
/* @__PURE__ */
|
|
8779
|
-
!all && /* @__PURE__ */
|
|
8780
|
-
/* @__PURE__ */
|
|
8781
|
-
types.map((type) => /* @__PURE__ */
|
|
8782
|
-
/* @__PURE__ */
|
|
9726
|
+
return /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "history-settings", children: [
|
|
9727
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.historySettings }),
|
|
9728
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.historySettingsHelp }),
|
|
9729
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "history-enabled", label: t.historyEnabled, value: history.enabled, disabled, onChange: (v) => set2("enabled", v) }),
|
|
9730
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "history-all", label: t.historyAll, value: all, disabled: disabled || !history.enabled, onChange: (v) => set2("contentTypes", v ? "all" : types.map((type) => type.uid)) }),
|
|
9731
|
+
!all && /* @__PURE__ */ jsxs10(Checks, { disabled: disabled || !history.enabled, children: [
|
|
9732
|
+
/* @__PURE__ */ jsx13("legend", { children: t.historyTypes }),
|
|
9733
|
+
types.map((type) => /* @__PURE__ */ jsxs10("label", { children: [
|
|
9734
|
+
/* @__PURE__ */ jsx13(
|
|
8783
9735
|
"input",
|
|
8784
9736
|
{
|
|
8785
9737
|
type: "checkbox",
|
|
@@ -8791,13 +9743,13 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8791
9743
|
type.displayName
|
|
8792
9744
|
] }, type.uid))
|
|
8793
9745
|
] }),
|
|
8794
|
-
/* @__PURE__ */
|
|
9746
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
|
|
8795
9747
|
number("retentionDays"),
|
|
8796
9748
|
number("maxSnapshots"),
|
|
8797
9749
|
number("eventDays"),
|
|
8798
9750
|
number("trashDays")
|
|
8799
9751
|
] }),
|
|
8800
|
-
/* @__PURE__ */
|
|
9752
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: badRetention(history) ? "danger600" : "neutral600", role: badRetention(history) ? "alert" : void 0, children: badRetention(history) ? t.historyInvalid : `${t.historyRetentionHelp} ${t.trashDaysHelp}` })
|
|
8801
9753
|
] }) });
|
|
8802
9754
|
}
|
|
8803
9755
|
function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: SelectField2, TextField: TextField2 }) {
|
|
@@ -8811,10 +9763,9 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8811
9763
|
};
|
|
8812
9764
|
const fields = (type.attributes || []).filter((attr) => !SYSTEM_FIELDS2.includes(attr.name));
|
|
8813
9765
|
const id = (name, index) => `sidebar-${name}-${type.uid}${index === void 0 ? "" : `-${index}`}`;
|
|
8814
|
-
return /* @__PURE__ */
|
|
8815
|
-
/* @__PURE__ */
|
|
8816
|
-
/* @__PURE__ */
|
|
8817
|
-
/* @__PURE__ */ jsx12(Box6, { style: { maxWidth: 240 }, children: /* @__PURE__ */ jsx12(
|
|
9766
|
+
return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 3, "data-testid": `sidebar-editor-${type.uid}`, children: [
|
|
9767
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.sidebarHelp }),
|
|
9768
|
+
/* @__PURE__ */ jsx13(Box7, { children: /* @__PURE__ */ jsx13(
|
|
8818
9769
|
SelectField2,
|
|
8819
9770
|
{
|
|
8820
9771
|
name: id("position"),
|
|
@@ -8825,21 +9776,21 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8825
9776
|
onChange: (v) => set2("sidebarPosition", v, "left")
|
|
8826
9777
|
}
|
|
8827
9778
|
) }),
|
|
8828
|
-
items2.map((item, index) => /* @__PURE__ */
|
|
8829
|
-
/* @__PURE__ */
|
|
8830
|
-
/* @__PURE__ */
|
|
8831
|
-
/* @__PURE__ */
|
|
9779
|
+
items2.map((item, index) => /* @__PURE__ */ jsxs10(Item, { "data-testid": id("item", index), children: [
|
|
9780
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
|
|
9781
|
+
/* @__PURE__ */ jsx13(Box7, { style: { flex: "1 1 200px" }, children: /* @__PURE__ */ jsx13(TextField2, { name: id("label", index), label: t.sidebarItemLabel, value: item.label, disabled, onChange: (v) => edit(index, { label: v }) }) }),
|
|
9782
|
+
/* @__PURE__ */ jsx13(Box7, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsx13(
|
|
8832
9783
|
SelectField2,
|
|
8833
9784
|
{
|
|
8834
9785
|
name: id("icon", index),
|
|
8835
9786
|
label: t.sidebarIcon,
|
|
8836
9787
|
value: item.icon || "none",
|
|
8837
9788
|
disabled,
|
|
8838
|
-
options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */
|
|
9789
|
+
options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */ jsx13(Icon, { name: value, size: 16 }) }))],
|
|
8839
9790
|
onChange: (v) => edit(index, { icon: v === "none" ? void 0 : v })
|
|
8840
9791
|
}
|
|
8841
9792
|
) }),
|
|
8842
|
-
/* @__PURE__ */
|
|
9793
|
+
/* @__PURE__ */ jsx13(Box7, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsx13(
|
|
8843
9794
|
SelectField2,
|
|
8844
9795
|
{
|
|
8845
9796
|
name: id("open", index),
|
|
@@ -8850,16 +9801,16 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8850
9801
|
onChange: (v) => edit(index, { open: v })
|
|
8851
9802
|
}
|
|
8852
9803
|
) }),
|
|
8853
|
-
/* @__PURE__ */
|
|
8854
|
-
/* @__PURE__ */
|
|
8855
|
-
/* @__PURE__ */
|
|
8856
|
-
/* @__PURE__ */
|
|
9804
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 1, paddingBottom: 1, children: [
|
|
9805
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index === 0, onClick: () => move(index, -1) }),
|
|
9806
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index === items2.length - 1, onClick: () => move(index, 1) }),
|
|
9807
|
+
/* @__PURE__ */ jsx13(Tool, { icon: "close", label: t.sidebarRemove, disabled, onClick: () => save(items2.filter((_, i) => i !== index)) })
|
|
8857
9808
|
] })
|
|
8858
9809
|
] }),
|
|
8859
|
-
/* @__PURE__ */
|
|
8860
|
-
/* @__PURE__ */
|
|
8861
|
-
fields.map((attr) => /* @__PURE__ */
|
|
8862
|
-
/* @__PURE__ */
|
|
9810
|
+
/* @__PURE__ */ jsxs10(Checks, { disabled, children: [
|
|
9811
|
+
/* @__PURE__ */ jsx13("legend", { children: t.sidebarFields }),
|
|
9812
|
+
fields.map((attr) => /* @__PURE__ */ jsxs10("label", { children: [
|
|
9813
|
+
/* @__PURE__ */ jsx13(
|
|
8863
9814
|
"input",
|
|
8864
9815
|
{
|
|
8865
9816
|
type: "checkbox",
|
|
@@ -8871,11 +9822,11 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8871
9822
|
attr.name
|
|
8872
9823
|
] }, attr.name))
|
|
8873
9824
|
] }),
|
|
8874
|
-
badItem(item) && /* @__PURE__ */
|
|
9825
|
+
badItem(item) && /* @__PURE__ */ jsx13(Typography8, { role: "alert", variant: "pi", textColor: "danger600", children: t.sidebarInvalid })
|
|
8875
9826
|
] }, index)),
|
|
8876
|
-
/* @__PURE__ */
|
|
8877
|
-
/* @__PURE__ */
|
|
8878
|
-
|
|
9827
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 2, alignItems: "center", children: [
|
|
9828
|
+
/* @__PURE__ */ jsx13(
|
|
9829
|
+
Button7,
|
|
8879
9830
|
{
|
|
8880
9831
|
variant: "secondary",
|
|
8881
9832
|
size: "S",
|
|
@@ -8885,30 +9836,30 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8885
9836
|
children: t.sidebarAdd
|
|
8886
9837
|
}
|
|
8887
9838
|
),
|
|
8888
|
-
items2.length >= SIDEBAR_MAX && /* @__PURE__ */
|
|
9839
|
+
items2.length >= SIDEBAR_MAX && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.f("sidebarLimit", { max: SIDEBAR_MAX }) })
|
|
8889
9840
|
] })
|
|
8890
9841
|
] });
|
|
8891
9842
|
}
|
|
8892
9843
|
var permissions = { read: [{ action: "plugin::blockscene.settings.read", subject: null }], update: [{ action: "plugin::blockscene.settings.update", subject: null }] };
|
|
8893
|
-
function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: MediaPicker2, ToggleField: ToggleField2, SelectField: SelectField2, TextField: TextField2, lazyEditors = false }) {
|
|
9844
|
+
function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: MediaPicker2, ToggleField: ToggleField2, SelectField: SelectField2, TextField: TextField2, lazyEditors = false, section = "general" }) {
|
|
8894
9845
|
const t = useMessages();
|
|
8895
9846
|
const { get, put, del } = useClient();
|
|
8896
9847
|
const { canRead, canUpdate, isLoading } = usePermissions2();
|
|
8897
|
-
const [data, setData] =
|
|
8898
|
-
const [catalog, setCatalog] =
|
|
8899
|
-
const [settings, setSettings] =
|
|
8900
|
-
const [media, setMedia] =
|
|
8901
|
-
const [sources, setSources] =
|
|
8902
|
-
const [dirty, setDirty] =
|
|
8903
|
-
const [saving, setSaving] =
|
|
8904
|
-
const [status, setStatus] =
|
|
8905
|
-
const [failed, setFailed] =
|
|
8906
|
-
const [filter, setFilter] =
|
|
8907
|
-
const [picking, setPicking] =
|
|
8908
|
-
|
|
9848
|
+
const [data, setData] = React12.useState(null);
|
|
9849
|
+
const [catalog, setCatalog] = React12.useState(null);
|
|
9850
|
+
const [settings, setSettings] = React12.useState(null);
|
|
9851
|
+
const [media, setMedia] = React12.useState({});
|
|
9852
|
+
const [sources, setSources] = React12.useState({});
|
|
9853
|
+
const [dirty, setDirty] = React12.useState(false);
|
|
9854
|
+
const [saving, setSaving] = React12.useState(false);
|
|
9855
|
+
const [status, setStatus] = React12.useState("");
|
|
9856
|
+
const [failed, setFailed] = React12.useState(false);
|
|
9857
|
+
const [filter, setFilter] = React12.useState("");
|
|
9858
|
+
const [picking, setPicking] = React12.useState(null);
|
|
9859
|
+
React12.useEffect(() => {
|
|
8909
9860
|
if (!canRead || isLoading) return;
|
|
8910
9861
|
let active = true;
|
|
8911
|
-
Promise.all([get("/blockscene/settings"), get("/blockscene/catalog")]).then(([s, c]) => {
|
|
9862
|
+
Promise.all([get("/blockscene/settings"), section === "gallery" ? get("/blockscene/catalog") : Promise.resolve({ data: {} })]).then(([s, c]) => {
|
|
8912
9863
|
if (!active) return;
|
|
8913
9864
|
setData(s.data);
|
|
8914
9865
|
setSettings(s.data.settings);
|
|
@@ -8920,18 +9871,20 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8920
9871
|
return () => {
|
|
8921
9872
|
active = false;
|
|
8922
9873
|
};
|
|
8923
|
-
}, [get, canRead, isLoading]);
|
|
9874
|
+
}, [get, canRead, isLoading, section]);
|
|
8924
9875
|
const update = (patch) => {
|
|
8925
9876
|
setSettings((current) => patch(structuredClone(current)));
|
|
8926
9877
|
setDirty(true);
|
|
8927
9878
|
setStatus("");
|
|
8928
9879
|
};
|
|
8929
|
-
const
|
|
9880
|
+
const badPalette = settings && Object.values(settings.palette).some((value) => !COLOR2.test(value));
|
|
9881
|
+
const badPreviewUrl = settings && [settings.editor.previewUrl, settings.editor.blockPreviewUrl].some((url) => url && !/^https?:\/\/\S+$/.test(url));
|
|
8930
9882
|
const badSidebar = settings && Object.values(settings.contentTypes || {}).some((entry) => (entry.sidebar || []).some(badItem));
|
|
8931
9883
|
const badLazy = settings && badUids(settings.editor.lazyFields);
|
|
8932
9884
|
const badHistory = settings && data?.historyTypes && badRetention(settings.history);
|
|
8933
|
-
const
|
|
8934
|
-
const
|
|
9885
|
+
const badEditorPane = settings && settings.editor.previewDevices && badDevices(settings.editor.previewDevices);
|
|
9886
|
+
const badTypePane = settings && Object.values(settings.contentTypes || {}).some((entry) => entry.previewDevices && badDevices(entry.previewDevices));
|
|
9887
|
+
const invalid = section === "general" ? badLazy : section === "preview" ? badPreviewUrl || badEditorPane : section === "content-types" ? badSidebar || badTypePane : section === "gallery" ? badPalette : badHistory;
|
|
8935
9888
|
const save = async () => {
|
|
8936
9889
|
if (!settings || invalid || !canUpdate) return;
|
|
8937
9890
|
setSaving(true);
|
|
@@ -8983,36 +9936,38 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8983
9936
|
return index === 0 && manual ? t.manual : t.automatic;
|
|
8984
9937
|
};
|
|
8985
9938
|
const ready = !isLoading && canRead && !failed && settings && catalog;
|
|
8986
|
-
const
|
|
8987
|
-
const [
|
|
9939
|
+
const sectionTitle = t[`settings${section === "content-types" ? "ContentTypes" : section[0].toUpperCase() + section.slice(1)}`];
|
|
9940
|
+
const sectionIntro = t[`settings${section === "content-types" ? "ContentTypes" : section[0].toUpperCase() + section.slice(1)}Intro`];
|
|
9941
|
+
const header = React12.useRef(null);
|
|
9942
|
+
const [floating, setFloating] = React12.useState(false);
|
|
8988
9943
|
const main = useMainRect2(header);
|
|
8989
|
-
|
|
9944
|
+
React12.useEffect(() => {
|
|
8990
9945
|
const el = header.current;
|
|
8991
9946
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
8992
9947
|
const observer = new IntersectionObserver(([entry]) => setFloating(!entry.isIntersecting && entry.boundingClientRect.top < 0));
|
|
8993
9948
|
observer.observe(el);
|
|
8994
9949
|
return () => observer.disconnect();
|
|
8995
9950
|
}, [ready]);
|
|
8996
|
-
const controls = (suffix) => ready && /* @__PURE__ */
|
|
8997
|
-
/* @__PURE__ */
|
|
8998
|
-
!suffix && /* @__PURE__ */
|
|
8999
|
-
/* @__PURE__ */
|
|
9951
|
+
const controls = (suffix) => ready && /* @__PURE__ */ jsxs10(Flex7, { gap: 3, alignItems: "center", wrap: "wrap", children: [
|
|
9952
|
+
/* @__PURE__ */ jsx13(Typography8, { role: "status", "aria-live": "polite", textColor: dirty ? "warning700" : "neutral600", "data-testid": `${dirty ? "unsaved-indicator" : "save-status"}${suffix}`, children: dirty ? t.unsaved : status || t.noChanges }),
|
|
9953
|
+
!suffix && section === "general" && /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", onClick: restore, disabled: !canUpdate || saving, "data-testid": "restore-blockscene-settings", children: data.projectDefaults ? t.restoreProject : t.resetAll }),
|
|
9954
|
+
/* @__PURE__ */ jsx13(Button7, { onClick: save, disabled: !canUpdate || invalid || !dirty, loading: saving, "data-testid": `save-blockscene-settings${suffix}`, children: t.save })
|
|
9000
9955
|
] });
|
|
9001
|
-
return /* @__PURE__ */
|
|
9002
|
-
/* @__PURE__ */
|
|
9003
|
-
/* @__PURE__ */
|
|
9956
|
+
return /* @__PURE__ */ jsx13(Box7, { padding: 8, background: "neutral100", children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 5, children: [
|
|
9957
|
+
/* @__PURE__ */ jsx13("div", { ref: header, children: /* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
|
|
9958
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "alpha", tag: "h1", children: sectionTitle }),
|
|
9004
9959
|
controls("")
|
|
9005
9960
|
] }) }),
|
|
9006
|
-
floating && main.width > 0 && /* @__PURE__ */
|
|
9007
|
-
/* @__PURE__ */
|
|
9961
|
+
floating && main.width > 0 && /* @__PURE__ */ jsx13(Bar, { style: { left: main.left, width: main.width }, "data-testid": "settings-floating-bar", children: /* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
|
|
9962
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "p", children: sectionTitle }),
|
|
9008
9963
|
controls("-floating")
|
|
9009
9964
|
] }) }),
|
|
9010
|
-
/* @__PURE__ */
|
|
9011
|
-
isLoading ? /* @__PURE__ */
|
|
9012
|
-
data.disabled && /* @__PURE__ */
|
|
9013
|
-
/* @__PURE__ */
|
|
9014
|
-
/* @__PURE__ */
|
|
9015
|
-
/* @__PURE__ */
|
|
9965
|
+
/* @__PURE__ */ jsx13(Typography8, { textColor: "neutral600", children: sectionIntro }),
|
|
9966
|
+
isLoading ? /* @__PURE__ */ jsx13(Typography8, { children: "\u2026" }) : !canRead ? /* @__PURE__ */ jsx13(Typography8, { role: "alert", children: t.denied }) : failed ? /* @__PURE__ */ jsx13(Typography8, { role: "alert", children: t.loadFailed }) : !settings || !catalog ? /* @__PURE__ */ jsx13(Typography8, { children: t.loading }) : /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
9967
|
+
data.disabled && /* @__PURE__ */ jsx13(Box7, { padding: 4, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "warning700", children: t.disabledByServer }) }),
|
|
9968
|
+
section === "gallery" && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9969
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.palette }),
|
|
9970
|
+
/* @__PURE__ */ jsx13(Swatches, { children: Object.keys(DEFAULT_PALETTE).map((key) => /* @__PURE__ */ jsx13(
|
|
9016
9971
|
ColorField,
|
|
9017
9972
|
{
|
|
9018
9973
|
name: `palette-${key}`,
|
|
@@ -9026,43 +9981,43 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9026
9981
|
},
|
|
9027
9982
|
key
|
|
9028
9983
|
)) }),
|
|
9029
|
-
|
|
9030
|
-
/* @__PURE__ */
|
|
9031
|
-
/* @__PURE__ */
|
|
9032
|
-
/* @__PURE__ */
|
|
9033
|
-
/* @__PURE__ */
|
|
9984
|
+
badPalette && /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "danger600", children: t.invalidColor }),
|
|
9985
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewLabel }),
|
|
9986
|
+
/* @__PURE__ */ jsx13(Swatches, { "data-testid": "palette-preview", children: TEMPLATES.map((template) => /* @__PURE__ */ jsxs10(Flex7, { direction: "column", gap: 1, children: [
|
|
9987
|
+
/* @__PURE__ */ jsx13(Box7, { style: { aspectRatio: "16 / 9", overflow: "hidden" }, hasRadius: true, children: /* @__PURE__ */ jsx13(Wireframe, { template, palette: settings.palette }) }),
|
|
9988
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.templates[template] })
|
|
9034
9989
|
] }, template)) }),
|
|
9035
|
-
/* @__PURE__ */
|
|
9990
|
+
/* @__PURE__ */ jsx13(Flex7, { children: /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", size: "S", disabled: !canUpdate, onClick: () => update((s) => {
|
|
9036
9991
|
s.palette = { ...DEFAULT_PALETTE };
|
|
9037
9992
|
return s;
|
|
9038
9993
|
}), children: t.resetPalette }) })
|
|
9039
9994
|
] }) }),
|
|
9040
|
-
/* @__PURE__ */
|
|
9041
|
-
/* @__PURE__ */
|
|
9042
|
-
/* @__PURE__ */
|
|
9995
|
+
section === "general" && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9996
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.editor }),
|
|
9997
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-enabled", label: t.enabled, value: editor.enabled, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9043
9998
|
s.editor.enabled = v;
|
|
9044
9999
|
return s;
|
|
9045
10000
|
}) }),
|
|
9046
|
-
/* @__PURE__ */
|
|
9047
|
-
/* @__PURE__ */
|
|
10001
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.enabledHelp }),
|
|
10002
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showOpenAll", label: t.showOpenAll, value: editor.showOpenAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9048
10003
|
s.editor.showOpenAll = v;
|
|
9049
10004
|
return s;
|
|
9050
10005
|
}) }),
|
|
9051
|
-
/* @__PURE__ */
|
|
10006
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showCloseAll", label: t.showCloseAll, value: editor.showCloseAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9052
10007
|
s.editor.showCloseAll = v;
|
|
9053
10008
|
return s;
|
|
9054
10009
|
}) }),
|
|
9055
|
-
/* @__PURE__ */
|
|
9056
|
-
/* @__PURE__ */
|
|
10010
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.toggleHelp }),
|
|
10011
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showRowThumbnails", label: t.showRowThumbnails, value: editor.showRowThumbnails !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9057
10012
|
s.editor.showRowThumbnails = v;
|
|
9058
10013
|
return s;
|
|
9059
10014
|
}) }),
|
|
9060
|
-
/* @__PURE__ */
|
|
10015
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-friendlyLabels", label: t.friendlyLabels, value: editor.friendlyLabels !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9061
10016
|
s.editor.friendlyLabels = v;
|
|
9062
10017
|
return s;
|
|
9063
10018
|
}) }),
|
|
9064
|
-
/* @__PURE__ */
|
|
9065
|
-
/* @__PURE__ */
|
|
10019
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.friendlyLabelsHelp }),
|
|
10020
|
+
/* @__PURE__ */ jsx13(
|
|
9066
10021
|
SelectField2,
|
|
9067
10022
|
{
|
|
9068
10023
|
name: "editor-initialState",
|
|
@@ -9076,8 +10031,32 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9076
10031
|
})
|
|
9077
10032
|
}
|
|
9078
10033
|
),
|
|
9079
|
-
/* @__PURE__ */
|
|
9080
|
-
/* @__PURE__ */
|
|
10034
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.rememberHelp }),
|
|
10035
|
+
lazyEditors && /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
10036
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-lazyEditors", label: t.lazyEditors, value: editor.lazyEditors !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
10037
|
+
s.editor.lazyEditors = v;
|
|
10038
|
+
return s;
|
|
10039
|
+
}) }),
|
|
10040
|
+
/* @__PURE__ */ jsx13(
|
|
10041
|
+
UidListField,
|
|
10042
|
+
{
|
|
10043
|
+
TextField: TextField2,
|
|
10044
|
+
name: "editor-lazyFields",
|
|
10045
|
+
label: t.lazyFields,
|
|
10046
|
+
value: editor.lazyFields || [],
|
|
10047
|
+
disabled: !canUpdate || saving || editor.lazyEditors === false,
|
|
10048
|
+
placeholder: "plugin::ckeditor5.CKEditor",
|
|
10049
|
+
onChange: (uids) => update((s) => {
|
|
10050
|
+
s.editor.lazyFields = uids;
|
|
10051
|
+
return s;
|
|
10052
|
+
})
|
|
10053
|
+
}
|
|
10054
|
+
),
|
|
10055
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: badLazy ? "danger600" : "neutral600", role: badLazy ? "alert" : void 0, children: badLazy ? t.f("lazyFieldsInvalid", { max: LAZY_MAX }) : t.lazyEditorsHelp })
|
|
10056
|
+
] })
|
|
10057
|
+
] }) }),
|
|
10058
|
+
section === "preview" && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10059
|
+
/* @__PURE__ */ jsx13(
|
|
9081
10060
|
TextField2,
|
|
9082
10061
|
{
|
|
9083
10062
|
name: "editor-blockPreviewUrl",
|
|
@@ -9091,8 +10070,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9091
10070
|
})
|
|
9092
10071
|
}
|
|
9093
10072
|
),
|
|
9094
|
-
/* @__PURE__ */
|
|
9095
|
-
/* @__PURE__ */
|
|
10073
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.blockPreviewUrlHelp }),
|
|
10074
|
+
/* @__PURE__ */ jsx13(
|
|
9096
10075
|
TextField2,
|
|
9097
10076
|
{
|
|
9098
10077
|
name: "editor-previewUrl",
|
|
@@ -9106,9 +10085,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9106
10085
|
})
|
|
9107
10086
|
}
|
|
9108
10087
|
),
|
|
9109
|
-
/* @__PURE__ */
|
|
9110
|
-
!editor.previewUrl && /* @__PURE__ */
|
|
9111
|
-
/* @__PURE__ */
|
|
10088
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewUrlHelp }),
|
|
10089
|
+
!editor.previewUrl && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "warning700", "data-testid": "preview-url-empty", children: t.previewUrlEmpty }),
|
|
10090
|
+
/* @__PURE__ */ jsx13(
|
|
9112
10091
|
SelectField2,
|
|
9113
10092
|
{
|
|
9114
10093
|
name: "editor-previewMode",
|
|
@@ -9122,12 +10101,13 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9122
10101
|
})
|
|
9123
10102
|
}
|
|
9124
10103
|
),
|
|
9125
|
-
/* @__PURE__ */
|
|
9126
|
-
/* @__PURE__ */
|
|
9127
|
-
/* @__PURE__ */
|
|
10104
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewModeHelp }),
|
|
10105
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "delta", tag: "h3", children: t.paneTitle }),
|
|
10106
|
+
/* @__PURE__ */ jsx13(
|
|
9128
10107
|
PaneEditor,
|
|
9129
10108
|
{
|
|
9130
10109
|
id: "editor",
|
|
10110
|
+
versions: Boolean(data.historyTypes),
|
|
9131
10111
|
toolbar: editor.previewToolbar || TOOLBAR2,
|
|
9132
10112
|
devices: editor.previewDevices || DEVICE_NAMES,
|
|
9133
10113
|
t,
|
|
@@ -9139,51 +10119,30 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9139
10119
|
})
|
|
9140
10120
|
}
|
|
9141
10121
|
),
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
10122
|
+
badPreviewUrl && /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "danger600", children: t.invalidUrl }),
|
|
10123
|
+
lazyEditors && data.blockPreviewAvailable && /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
10124
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-blockPreviewInForm", label: t.blockPreviewInForm, value: editor.blockPreviewInForm, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
10125
|
+
s.editor.blockPreviewInForm = v;
|
|
9145
10126
|
return s;
|
|
9146
10127
|
}) }),
|
|
9147
|
-
/* @__PURE__ */
|
|
9148
|
-
UidListField,
|
|
9149
|
-
{
|
|
9150
|
-
TextField: TextField2,
|
|
9151
|
-
name: "editor-lazyFields",
|
|
9152
|
-
label: t.lazyFields,
|
|
9153
|
-
value: editor.lazyFields || [],
|
|
9154
|
-
disabled: !canUpdate || saving || editor.lazyEditors === false,
|
|
9155
|
-
placeholder: "plugin::ckeditor5.CKEditor",
|
|
9156
|
-
onChange: (uids) => update((s) => {
|
|
9157
|
-
s.editor.lazyFields = uids;
|
|
9158
|
-
return s;
|
|
9159
|
-
})
|
|
9160
|
-
}
|
|
9161
|
-
),
|
|
9162
|
-
/* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: badLazy ? "danger600" : "neutral600", role: badLazy ? "alert" : void 0, children: badLazy ? t.f("lazyFieldsInvalid", { max: LAZY_MAX }) : t.lazyEditorsHelp }),
|
|
9163
|
-
data.blockPreviewAvailable && /* @__PURE__ */ jsxs9(Fragment9, { children: [
|
|
9164
|
-
/* @__PURE__ */ jsx12(ToggleField2, { name: "editor-blockPreviewInForm", label: t.blockPreviewInForm, value: editor.blockPreviewInForm, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9165
|
-
s.editor.blockPreviewInForm = v;
|
|
9166
|
-
return s;
|
|
9167
|
-
}) }),
|
|
9168
|
-
/* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
|
|
9169
|
-
] })
|
|
10128
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
|
|
9170
10129
|
] })
|
|
9171
10130
|
] }) }),
|
|
9172
|
-
/* @__PURE__ */
|
|
9173
|
-
/* @__PURE__ */
|
|
9174
|
-
/* @__PURE__ */
|
|
10131
|
+
section === "general" && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "row-actions-settings", children: [
|
|
10132
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.rowActionsTitle }),
|
|
10133
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-confirmDelete", label: t.confirmDeleteOption, value: editor.confirmDelete !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9175
10134
|
s.editor.confirmDelete = v;
|
|
9176
10135
|
return s;
|
|
9177
10136
|
}) }),
|
|
9178
|
-
/* @__PURE__ */
|
|
10137
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-duplicate", label: t.duplicateOption, value: editor.duplicate !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9179
10138
|
s.editor.duplicate = v;
|
|
9180
10139
|
return s;
|
|
9181
10140
|
}) }),
|
|
9182
|
-
/* @__PURE__ */
|
|
10141
|
+
/* @__PURE__ */ jsx13(ToggleField2, { name: "editor-clipboard", label: t.clipboardOption, value: editor.clipboard !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9183
10142
|
s.editor.clipboard = v;
|
|
9184
10143
|
return s;
|
|
9185
10144
|
}) }),
|
|
9186
|
-
/* @__PURE__ */
|
|
10145
|
+
/* @__PURE__ */ jsx13(
|
|
9187
10146
|
SelectField2,
|
|
9188
10147
|
{
|
|
9189
10148
|
name: "editor-hiddenBlocks",
|
|
@@ -9197,9 +10156,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9197
10156
|
})
|
|
9198
10157
|
}
|
|
9199
10158
|
),
|
|
9200
|
-
/* @__PURE__ */
|
|
10159
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: data.hiddenAttribute ? t.hiddenBlocksHelp : t.hiddenAttributeOff })
|
|
9201
10160
|
] }) }),
|
|
9202
|
-
data.historyTypes && settings.history && /* @__PURE__ */
|
|
10161
|
+
section === "history" && data.historyTypes && settings.history && /* @__PURE__ */ jsx13(
|
|
9203
10162
|
HistorySettings,
|
|
9204
10163
|
{
|
|
9205
10164
|
types: data.historyTypes,
|
|
@@ -9214,10 +10173,10 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9214
10173
|
})
|
|
9215
10174
|
}
|
|
9216
10175
|
),
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
/* @__PURE__ */
|
|
9220
|
-
data.contentTypes.map((type) => {
|
|
10176
|
+
section === "history" && !data.historyTypes && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsx13(Typography8, { textColor: "neutral600", children: t.historyUnavailable }) }),
|
|
10177
|
+
section === "content-types" && (data.contentTypes || []).length > 0 && /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "content-types", children: [
|
|
10178
|
+
/* @__PURE__ */ jsx13(Box7, { padding: 4, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.contentTypesHelp }) }),
|
|
10179
|
+
/* @__PURE__ */ jsx13(ContentTypeGrid, { children: data.contentTypes.map((type) => {
|
|
9221
10180
|
const entry = settings.contentTypes?.[type.uid] || {};
|
|
9222
10181
|
const set2 = (key, value, fallback) => update((s) => {
|
|
9223
10182
|
const next = { ...s.contentTypes?.[type.uid] || {} };
|
|
@@ -9228,9 +10187,10 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9228
10187
|
else delete s.contentTypes[type.uid];
|
|
9229
10188
|
return s;
|
|
9230
10189
|
});
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
10190
|
+
const customized = Boolean(entry.sidebar?.length || entry.sidebarPosition || entry.previewToolbar || entry.previewDevices);
|
|
10191
|
+
return /* @__PURE__ */ jsxs10(ContentTypeCard, { "data-testid": `content-type-${type.uid}`, children: [
|
|
10192
|
+
/* @__PURE__ */ jsxs10(ContentTypeTop, { children: [
|
|
10193
|
+
/* @__PURE__ */ jsx13(Box7, { children: /* @__PURE__ */ jsx13(
|
|
9234
10194
|
ToggleField2,
|
|
9235
10195
|
{
|
|
9236
10196
|
name: `type-enabled-${type.uid}`,
|
|
@@ -9240,7 +10200,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9240
10200
|
onChange: (v) => set2("enabled", v, true)
|
|
9241
10201
|
}
|
|
9242
10202
|
) }),
|
|
9243
|
-
/* @__PURE__ */
|
|
10203
|
+
/* @__PURE__ */ jsx13(Box7, { children: /* @__PURE__ */ jsx13(
|
|
9244
10204
|
SelectField2,
|
|
9245
10205
|
{
|
|
9246
10206
|
name: `type-mode-${type.uid}`,
|
|
@@ -9252,48 +10212,54 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9252
10212
|
}
|
|
9253
10213
|
) })
|
|
9254
10214
|
] }),
|
|
9255
|
-
entry.enabled !== false && /* @__PURE__ */
|
|
9256
|
-
|
|
9257
|
-
/* @__PURE__ */
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
10215
|
+
entry.enabled !== false && /* @__PURE__ */ jsxs10(Advanced, { defaultOpen: customized, children: [
|
|
10216
|
+
/* @__PURE__ */ jsx13("summary", { children: t.typeAdvanced }),
|
|
10217
|
+
/* @__PURE__ */ jsx13(SidebarEditor, { type, entry, set: set2, t, disabled: !canUpdate || saving, SelectField: SelectField2, TextField: TextField2 }),
|
|
10218
|
+
/* @__PURE__ */ jsxs10(ToolbarSection, { children: [
|
|
10219
|
+
/* @__PURE__ */ jsx13(
|
|
10220
|
+
ToggleField2,
|
|
10221
|
+
{
|
|
10222
|
+
name: `type-pane-${type.uid}`,
|
|
10223
|
+
label: t.f("paneTypeOverride", { name: type.displayName }),
|
|
10224
|
+
value: Boolean(entry.previewToolbar || entry.previewDevices),
|
|
10225
|
+
disabled: !canUpdate || saving,
|
|
10226
|
+
onChange: (v) => {
|
|
10227
|
+
set2("previewToolbar", v ? [...editor.previewToolbar || TOOLBAR2] : void 0, void 0);
|
|
10228
|
+
set2("previewDevices", v ? structuredClone(editor.previewDevices || DEVICE_NAMES) : void 0, void 0);
|
|
10229
|
+
}
|
|
9267
10230
|
}
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
10231
|
+
),
|
|
10232
|
+
(entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ jsx13(
|
|
10233
|
+
PaneEditor,
|
|
10234
|
+
{
|
|
10235
|
+
id: `type-${type.uid}`,
|
|
10236
|
+
versions: Boolean(data.historyTypes),
|
|
10237
|
+
toolbar: entry.previewToolbar || editor.previewToolbar || TOOLBAR2,
|
|
10238
|
+
devices: entry.previewDevices || editor.previewDevices || DEVICE_NAMES,
|
|
10239
|
+
t,
|
|
10240
|
+
disabled: !canUpdate || saving,
|
|
10241
|
+
TextField: TextField2,
|
|
10242
|
+
set: (key, value) => set2(key, value, void 0)
|
|
10243
|
+
}
|
|
10244
|
+
)
|
|
10245
|
+
] })
|
|
9282
10246
|
] })
|
|
9283
10247
|
] }, type.uid);
|
|
9284
|
-
}),
|
|
9285
|
-
badSidebar && /* @__PURE__ */
|
|
9286
|
-
] })
|
|
9287
|
-
/* @__PURE__ */
|
|
9288
|
-
/* @__PURE__ */
|
|
9289
|
-
/* @__PURE__ */
|
|
9290
|
-
/* @__PURE__ */
|
|
9291
|
-
/* @__PURE__ */
|
|
10248
|
+
}) }),
|
|
10249
|
+
badSidebar && /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "danger600", children: t.sidebarInvalidSave })
|
|
10250
|
+
] }),
|
|
10251
|
+
section === "gallery" && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10252
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.components }),
|
|
10253
|
+
/* @__PURE__ */ jsx13(Searchbar2, { name: "component-filter", value: filter, placeholder: t.filter, clearLabel: t.clear, onClear: () => setFilter(""), onChange: (e) => setFilter(e.target.value), children: t.filter }),
|
|
10254
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", "data-testid": "components-count", children: t.f("countAll", { count: components.length }) }),
|
|
10255
|
+
/* @__PURE__ */ jsx13(Grid2, { "data-testid": "components-grid", children: components.map((component) => {
|
|
9292
10256
|
const entry = settings.components[component.uid] || {};
|
|
9293
10257
|
const meta = { ...catalog.components?.[component.uid] || {}, ...media[component.uid] || {} };
|
|
10258
|
+
const groupMarker = Boolean(catalog.groups?.[component.uid] || Object.values(catalog.groups || {}).includes(component.uid));
|
|
10259
|
+
const rowThumbnail = entry.showRowThumbnail ?? !groupMarker;
|
|
9294
10260
|
const candidates = candidatesFor(component.uid, meta, catalog);
|
|
9295
|
-
return /* @__PURE__ */
|
|
9296
|
-
/* @__PURE__ */
|
|
10261
|
+
return /* @__PURE__ */ jsxs10(Card2, { "data-testid": `settings-${component.uid}`, children: [
|
|
10262
|
+
/* @__PURE__ */ jsx13(
|
|
9297
10263
|
Thumb,
|
|
9298
10264
|
{
|
|
9299
10265
|
candidates,
|
|
@@ -9304,23 +10270,23 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9304
10270
|
onResolved: (index) => setSources((current) => current[component.uid] === index ? current : { ...current, [component.uid]: index })
|
|
9305
10271
|
}
|
|
9306
10272
|
),
|
|
9307
|
-
/* @__PURE__ */
|
|
9308
|
-
/* @__PURE__ */
|
|
9309
|
-
/* @__PURE__ */
|
|
10273
|
+
/* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
10274
|
+
/* @__PURE__ */ jsx13(Typography8, { fontWeight: "bold", textColor: "neutral800", children: component.displayName }),
|
|
10275
|
+
/* @__PURE__ */ jsxs10(Typography8, { variant: "pi", textColor: "neutral600", children: [
|
|
9310
10276
|
component.uid,
|
|
9311
10277
|
" \xB7 ",
|
|
9312
10278
|
component.category
|
|
9313
10279
|
] }),
|
|
9314
|
-
/* @__PURE__ */
|
|
10280
|
+
/* @__PURE__ */ jsxs10(Typography8, { variant: "pi", "data-testid": `source-${component.uid}`, children: [
|
|
9315
10281
|
t.source,
|
|
9316
10282
|
": ",
|
|
9317
10283
|
sourceOf(component.uid, Boolean(meta.manualImage)),
|
|
9318
10284
|
meta.manualName ? ` (${meta.manualName})` : ""
|
|
9319
10285
|
] }),
|
|
9320
|
-
meta.manualMissing && /* @__PURE__ */
|
|
9321
|
-
/* @__PURE__ */
|
|
9322
|
-
/* @__PURE__ */
|
|
9323
|
-
entry.mediaId && /* @__PURE__ */
|
|
10286
|
+
meta.manualMissing && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", role: "alert", textColor: "danger600", children: t.brokenMedia }),
|
|
10287
|
+
/* @__PURE__ */ jsxs10(Flex7, { gap: 2, wrap: "wrap", children: [
|
|
10288
|
+
/* @__PURE__ */ jsx13(Button7, { variant: "secondary", size: "S", disabled: !canUpdate || saving, onClick: () => setPicking(component.uid), children: entry.mediaId ? t.replace : t.choose }),
|
|
10289
|
+
entry.mediaId && /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", size: "S", disabled: !canUpdate || saving, onClick: () => {
|
|
9324
10290
|
update((s) => {
|
|
9325
10291
|
delete s.components[component.uid]?.mediaId;
|
|
9326
10292
|
if (!Object.keys(s.components[component.uid] || {}).length) delete s.components[component.uid];
|
|
@@ -9333,7 +10299,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9333
10299
|
});
|
|
9334
10300
|
}, children: t.useAutomatic })
|
|
9335
10301
|
] }),
|
|
9336
|
-
/* @__PURE__ */
|
|
10302
|
+
/* @__PURE__ */ jsx13(
|
|
9337
10303
|
SelectField2,
|
|
9338
10304
|
{
|
|
9339
10305
|
name: `template-${component.uid}`,
|
|
@@ -9347,7 +10313,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9347
10313
|
})
|
|
9348
10314
|
}
|
|
9349
10315
|
),
|
|
9350
|
-
/* @__PURE__ */
|
|
10316
|
+
/* @__PURE__ */ jsx13(
|
|
9351
10317
|
SelectField2,
|
|
9352
10318
|
{
|
|
9353
10319
|
name: `typology-${component.uid}`,
|
|
@@ -9358,7 +10324,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9358
10324
|
onChange: (v) => setComponent(component.uid, "typology", v === "auto" ? void 0 : v)
|
|
9359
10325
|
}
|
|
9360
10326
|
),
|
|
9361
|
-
/* @__PURE__ */
|
|
10327
|
+
/* @__PURE__ */ jsx13(
|
|
9362
10328
|
TagsField,
|
|
9363
10329
|
{
|
|
9364
10330
|
name: `tags-${component.uid}`,
|
|
@@ -9369,12 +10335,22 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9369
10335
|
onChange: (tags) => setComponent(component.uid, "tags", tags.length ? tags : void 0)
|
|
9370
10336
|
}
|
|
9371
10337
|
),
|
|
9372
|
-
|
|
10338
|
+
/* @__PURE__ */ jsx13(
|
|
10339
|
+
ToggleField2,
|
|
10340
|
+
{
|
|
10341
|
+
name: `row-thumbnail-${component.uid}`,
|
|
10342
|
+
label: t.componentRowThumbnail,
|
|
10343
|
+
value: rowThumbnail,
|
|
10344
|
+
disabled: !canUpdate || saving,
|
|
10345
|
+
onChange: (v) => setComponent(component.uid, "showRowThumbnail", v)
|
|
10346
|
+
}
|
|
10347
|
+
),
|
|
10348
|
+
meta.variants?.length > 0 && /* @__PURE__ */ jsxs10(Typography8, { variant: "pi", textColor: "neutral600", "data-testid": `variants-${component.uid}`, children: [
|
|
9373
10349
|
t.variantsFromCode,
|
|
9374
10350
|
": ",
|
|
9375
10351
|
meta.variants.map((item) => localized(item.label, t.locale) || item.id).join(", ")
|
|
9376
10352
|
] }),
|
|
9377
|
-
catalog.groups?.[component.uid] && /* @__PURE__ */
|
|
10353
|
+
catalog.groups?.[component.uid] && /* @__PURE__ */ jsx13(
|
|
9378
10354
|
LayoutFields,
|
|
9379
10355
|
{
|
|
9380
10356
|
component,
|
|
@@ -9389,7 +10365,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9389
10365
|
] }, component.uid);
|
|
9390
10366
|
}) })
|
|
9391
10367
|
] }) }),
|
|
9392
|
-
picking && /* @__PURE__ */
|
|
10368
|
+
picking && /* @__PURE__ */ jsx13(MediaPicker2, { onClose: () => setPicking(null), onSelect: (asset) => {
|
|
9393
10369
|
const uid = picking;
|
|
9394
10370
|
setPicking(null);
|
|
9395
10371
|
if (!asset?.id) return;
|
|
@@ -9405,8 +10381,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9405
10381
|
function LayoutFields({ component, layout, set: set2, t, disabled, SelectField: SelectField2 }) {
|
|
9406
10382
|
const fields = (component.layoutFields || []).map((name) => ({ value: name, label: name }));
|
|
9407
10383
|
const change = (key, value) => set2(key === "columnsField" && value === "none" ? void 0 : Object.fromEntries(Object.entries({ ...layout, [key]: value }).filter(([, v]) => v !== "none" && v !== void 0)));
|
|
9408
|
-
return /* @__PURE__ */
|
|
9409
|
-
/* @__PURE__ */
|
|
10384
|
+
return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": `layout-${component.uid}`, style: { width: "100%" }, children: [
|
|
10385
|
+
/* @__PURE__ */ jsx13(
|
|
9410
10386
|
SelectField2,
|
|
9411
10387
|
{
|
|
9412
10388
|
name: `layout-columns-${component.uid}`,
|
|
@@ -9417,8 +10393,8 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9417
10393
|
onChange: (v) => change("columnsField", v)
|
|
9418
10394
|
}
|
|
9419
10395
|
),
|
|
9420
|
-
layout?.columnsField && /* @__PURE__ */
|
|
9421
|
-
/* @__PURE__ */
|
|
10396
|
+
layout?.columnsField && /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
10397
|
+
/* @__PURE__ */ jsx13(
|
|
9422
10398
|
SelectField2,
|
|
9423
10399
|
{
|
|
9424
10400
|
name: `layout-mobile-${component.uid}`,
|
|
@@ -9429,7 +10405,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9429
10405
|
onChange: (v) => change("mobileColumnsField", v)
|
|
9430
10406
|
}
|
|
9431
10407
|
),
|
|
9432
|
-
/* @__PURE__ */
|
|
10408
|
+
/* @__PURE__ */ jsx13(
|
|
9433
10409
|
SelectField2,
|
|
9434
10410
|
{
|
|
9435
10411
|
name: `layout-max-${component.uid}`,
|
|
@@ -9441,46 +10417,57 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9441
10417
|
}
|
|
9442
10418
|
)
|
|
9443
10419
|
] }),
|
|
9444
|
-
/* @__PURE__ */
|
|
10420
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: fields.length ? t.layoutHelp : t.layoutNoFields })
|
|
9445
10421
|
] });
|
|
9446
10422
|
}
|
|
10423
|
+
var SETTINGS_SECTIONS = [
|
|
10424
|
+
{ id: "general", label: "General" },
|
|
10425
|
+
{ id: "preview", label: "Page preview" },
|
|
10426
|
+
{ id: "content-types", label: "Content types" },
|
|
10427
|
+
{ id: "gallery", label: "Block gallery" },
|
|
10428
|
+
{ id: "history", label: "History & trash" }
|
|
10429
|
+
];
|
|
9447
10430
|
function register(app, Component2, to) {
|
|
9448
10431
|
app.createSettingSection(
|
|
9449
10432
|
{ id: "blockscene", intlLabel: { id: "blockscene.title", defaultMessage: "Blockscene" } },
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
to
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
10433
|
+
SETTINGS_SECTIONS.map(({ id, label }) => {
|
|
10434
|
+
const Page2 = () => React12.createElement(Component2, { section: id });
|
|
10435
|
+
const sectionPath = id === "general" ? to : to.startsWith("/") ? `${to}-${id}` : `${to}/${id}`;
|
|
10436
|
+
return {
|
|
10437
|
+
id: `blockscene-${id}`,
|
|
10438
|
+
to: sectionPath,
|
|
10439
|
+
intlLabel: { id: `blockscene.settings${id === "content-types" ? "ContentTypes" : id[0].toUpperCase() + id.slice(1)}`, defaultMessage: label },
|
|
10440
|
+
// Module shape: older Strapi 4 (e.g. 4.11) only reads `.default` from the loader result.
|
|
10441
|
+
// Not an `async` function: Strapi 5 warns on AsyncFunction loaders.
|
|
10442
|
+
Component: () => Promise.resolve({ default: Page2 }),
|
|
10443
|
+
permissions: permissions.read
|
|
10444
|
+
};
|
|
10445
|
+
})
|
|
9459
10446
|
);
|
|
9460
10447
|
}
|
|
9461
10448
|
|
|
9462
10449
|
// admin/catalog.ts
|
|
9463
|
-
import * as
|
|
10450
|
+
import * as React14 from "react";
|
|
9464
10451
|
|
|
9465
10452
|
// admin/FieldHelp.tsx
|
|
9466
|
-
import * as
|
|
9467
|
-
import
|
|
9468
|
-
import { Flex as
|
|
9469
|
-
import { jsx as
|
|
9470
|
-
var HelpButton =
|
|
10453
|
+
import * as React13 from "react";
|
|
10454
|
+
import styled9 from "styled-components";
|
|
10455
|
+
import { Flex as Flex8, Tooltip } from "@strapi/design-system";
|
|
10456
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
10457
|
+
var HelpButton = styled9.button`
|
|
9471
10458
|
display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: help; color: inherit;
|
|
9472
10459
|
&:hover, &:focus-visible { color: ${({ theme }) => theme.colors.primary600}; }
|
|
9473
10460
|
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
|
|
9474
10461
|
`;
|
|
9475
10462
|
function FieldHelp({ text, previous, title }) {
|
|
9476
10463
|
const m = useMessages();
|
|
9477
|
-
const kept2 =
|
|
9478
|
-
return /* @__PURE__ */
|
|
10464
|
+
const kept2 = React13.isValidElement(previous) && previous.props.title ? React13.cloneElement(previous, { title }) : previous;
|
|
10465
|
+
return /* @__PURE__ */ jsxs11(Flex8, { gap: 1, alignItems: "center", children: [
|
|
9479
10466
|
kept2,
|
|
9480
|
-
/* @__PURE__ */
|
|
10467
|
+
/* @__PURE__ */ jsx14(Tooltip, { label: text, style: { maxWidth: 320 }, children: /* @__PURE__ */ jsx14(HelpButton, { type: "button", "aria-label": m.fieldHelp, children: /* @__PURE__ */ jsx14(Icon, { name: "info", size: 14 }) }) })
|
|
9481
10468
|
] });
|
|
9482
10469
|
}
|
|
9483
|
-
var helpAction = (text, previous) => /* @__PURE__ */
|
|
10470
|
+
var helpAction = (text, previous) => /* @__PURE__ */ jsx14(FieldHelp, { text, previous, title: React13.isValidElement(previous) && previous.props.title || { id: "blockscene.fieldHelp" } });
|
|
9484
10471
|
|
|
9485
10472
|
// admin/catalog.ts
|
|
9486
10473
|
var cached = null;
|
|
@@ -9493,8 +10480,8 @@ var load = (get) => flight || (flight = get("/blockscene/catalog").then(({ data
|
|
|
9493
10480
|
flight = null;
|
|
9494
10481
|
}));
|
|
9495
10482
|
function useCatalog(get) {
|
|
9496
|
-
const [catalog, setCatalog] =
|
|
9497
|
-
|
|
10483
|
+
const [catalog, setCatalog] = React14.useState(null);
|
|
10484
|
+
React14.useEffect(() => {
|
|
9498
10485
|
let active = true;
|
|
9499
10486
|
load(get).then((data) => {
|
|
9500
10487
|
if (active) setCatalog(data);
|
|
@@ -9530,9 +10517,9 @@ var labelsHook = (get, relabel, drop) => (args) => {
|
|
|
9530
10517
|
};
|
|
9531
10518
|
|
|
9532
10519
|
// admin/LazyInput.tsx
|
|
9533
|
-
import * as
|
|
9534
|
-
import { Field, Flex as
|
|
9535
|
-
import
|
|
10520
|
+
import * as React15 from "react";
|
|
10521
|
+
import { Field, Flex as Flex9, Typography as Typography9 } from "@strapi/design-system";
|
|
10522
|
+
import styled10 from "styled-components";
|
|
9536
10523
|
|
|
9537
10524
|
// admin/sanitize.mjs
|
|
9538
10525
|
var DROP = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "IFRAME", "FRAME", "OBJECT", "EMBED", "LINK", "META", "BASE", "FORM", "TEMPLATE", "NOSCRIPT"]);
|
|
@@ -9586,7 +10573,7 @@ function sanitizeHtml(html) {
|
|
|
9586
10573
|
}
|
|
9587
10574
|
|
|
9588
10575
|
// admin/LazyInput.tsx
|
|
9589
|
-
import { jsx as
|
|
10576
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9590
10577
|
var config = { on: false, fields: [] };
|
|
9591
10578
|
var listeners = /* @__PURE__ */ new Set();
|
|
9592
10579
|
function setLazyConfig(next) {
|
|
@@ -9602,7 +10589,7 @@ var subscribe = (run) => {
|
|
|
9602
10589
|
};
|
|
9603
10590
|
var read2 = () => config;
|
|
9604
10591
|
var lazyFor = (uid) => config.on && config.fields.includes(uid);
|
|
9605
|
-
var Preview =
|
|
10592
|
+
var Preview = styled10.div`
|
|
9606
10593
|
min-height: 240px; border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px; overflow: hidden;
|
|
9607
10594
|
background: ${({ theme, $disabled }) => $disabled ? theme.colors.neutral150 : theme.colors.neutral0};
|
|
9608
10595
|
color: ${({ theme }) => theme.colors.neutral800}; font-size: 1.4rem; line-height: 1.5;
|
|
@@ -9621,14 +10608,14 @@ var Preview = styled9.div`
|
|
|
9621
10608
|
`;
|
|
9622
10609
|
function Placeholder({ name, label, hint, error, required, labelAction, placeholder, value, disabled, onActivate }) {
|
|
9623
10610
|
const t = useMessages();
|
|
9624
|
-
const html =
|
|
10611
|
+
const html = React15.useMemo(() => typeof value === "string" ? sanitizeHtml(value) : value == null ? "" : null, [value]);
|
|
9625
10612
|
const activate = disabled ? void 0 : (event) => {
|
|
9626
10613
|
event.preventDefault();
|
|
9627
10614
|
onActivate();
|
|
9628
10615
|
};
|
|
9629
|
-
return /* @__PURE__ */
|
|
9630
|
-
/* @__PURE__ */
|
|
9631
|
-
/* @__PURE__ */
|
|
10616
|
+
return /* @__PURE__ */ jsx15(Field.Root, { id: name, name, error, hint, required, children: /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
10617
|
+
/* @__PURE__ */ jsx15(Field.Label, { action: labelAction, children: label }),
|
|
10618
|
+
/* @__PURE__ */ jsxs12(
|
|
9632
10619
|
Preview,
|
|
9633
10620
|
{
|
|
9634
10621
|
id: name,
|
|
@@ -9644,22 +10631,22 @@ function Placeholder({ name, label, hint, error, required, labelAction, placehol
|
|
|
9644
10631
|
if (e.key === "Enter" || e.key === " ") activate?.(e);
|
|
9645
10632
|
},
|
|
9646
10633
|
children: [
|
|
9647
|
-
/* @__PURE__ */
|
|
9648
|
-
html === null ? /* @__PURE__ */
|
|
10634
|
+
/* @__PURE__ */ jsx15("div", { "data-bar": true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "neutral500", children: disabled ? "" : t.lazyEdit }) }),
|
|
10635
|
+
html === null ? /* @__PURE__ */ jsx15("div", { "data-body": true, children: JSON.stringify(value) }) : html ? /* @__PURE__ */ jsx15("div", { "data-body": true, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx15("div", { "data-body": true, children: /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral500", children: placeholder || "" }) })
|
|
9649
10636
|
]
|
|
9650
10637
|
}
|
|
9651
10638
|
),
|
|
9652
|
-
/* @__PURE__ */
|
|
9653
|
-
/* @__PURE__ */
|
|
10639
|
+
/* @__PURE__ */ jsx15(Field.Hint, {}),
|
|
10640
|
+
/* @__PURE__ */ jsx15(Field.Error, {})
|
|
9654
10641
|
] }) });
|
|
9655
10642
|
}
|
|
9656
10643
|
function lazyInput(uid, Real) {
|
|
9657
|
-
const Lazy =
|
|
9658
|
-
|
|
9659
|
-
const [active, setActive] =
|
|
9660
|
-
const box =
|
|
9661
|
-
const focus =
|
|
9662
|
-
|
|
10644
|
+
const Lazy = React15.forwardRef((props, ref) => {
|
|
10645
|
+
React15.useSyncExternalStore(subscribe, read2);
|
|
10646
|
+
const [active, setActive] = React15.useState(() => !lazyFor(uid));
|
|
10647
|
+
const box = React15.useRef(null);
|
|
10648
|
+
const focus = React15.useRef(false);
|
|
10649
|
+
React15.useEffect(() => {
|
|
9663
10650
|
if (!active || !focus.current) return;
|
|
9664
10651
|
focus.current = false;
|
|
9665
10652
|
let frame2 = 0;
|
|
@@ -9672,7 +10659,7 @@ function lazyInput(uid, Real) {
|
|
|
9672
10659
|
poll();
|
|
9673
10660
|
return () => cancelAnimationFrame(frame2);
|
|
9674
10661
|
}, [active]);
|
|
9675
|
-
return /* @__PURE__ */
|
|
10662
|
+
return /* @__PURE__ */ jsx15("div", { ref: box, style: { display: "contents" }, children: active || !lazyFor(uid) ? /* @__PURE__ */ jsx15(Real, { ...props, ref }) : /* @__PURE__ */ jsx15(Placeholder, { ...props, onActivate: () => {
|
|
9676
10663
|
focus.current = true;
|
|
9677
10664
|
setActive(true);
|
|
9678
10665
|
} }) });
|
|
@@ -9692,17 +10679,17 @@ function wrapCustomFields(app) {
|
|
|
9692
10679
|
}
|
|
9693
10680
|
|
|
9694
10681
|
// admin/Activity.tsx
|
|
9695
|
-
import * as
|
|
10682
|
+
import * as React16 from "react";
|
|
9696
10683
|
import {
|
|
9697
|
-
Box as
|
|
9698
|
-
Button as
|
|
10684
|
+
Box as Box8,
|
|
10685
|
+
Button as Button8,
|
|
9699
10686
|
Dialog,
|
|
9700
10687
|
Field as Field2,
|
|
9701
|
-
Flex as
|
|
10688
|
+
Flex as Flex10,
|
|
9702
10689
|
Link,
|
|
9703
10690
|
Modal,
|
|
9704
|
-
SingleSelect,
|
|
9705
|
-
SingleSelectOption,
|
|
10691
|
+
SingleSelect as SingleSelect2,
|
|
10692
|
+
SingleSelectOption as SingleSelectOption2,
|
|
9706
10693
|
Switch,
|
|
9707
10694
|
Table,
|
|
9708
10695
|
Tabs,
|
|
@@ -9712,17 +10699,17 @@ import {
|
|
|
9712
10699
|
Th,
|
|
9713
10700
|
Thead,
|
|
9714
10701
|
Tr,
|
|
9715
|
-
Typography as
|
|
10702
|
+
Typography as Typography10
|
|
9716
10703
|
} from "@strapi/design-system";
|
|
9717
|
-
import { Layouts, Page, useFetchClient as useFetchClient2, useNotification as useNotification2, useRBAC as
|
|
9718
|
-
import { Fragment as
|
|
10704
|
+
import { Layouts, Page, useFetchClient as useFetchClient2, useNotification as useNotification2, useRBAC as useRBAC3 } from "@strapi/strapi/admin";
|
|
10705
|
+
import { Fragment as Fragment13, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
9719
10706
|
var ACTIVITY = [{ action: "plugin::blockscene.activity.read", subject: null }];
|
|
9720
10707
|
var TRASH = ["read", "restore", "purge"].map((name) => ({ action: `plugin::blockscene.trash.${name}`, subject: null }));
|
|
9721
10708
|
var ACTIONS = ["create", "update", "publish", "unpublish", "discard", "delete", "restore", "purge"];
|
|
9722
10709
|
var DAY = 24 * 60 * 60 * 1e3;
|
|
9723
10710
|
var contentMenuLink = (Component2) => ({
|
|
9724
10711
|
to: "plugins/blockscene",
|
|
9725
|
-
icon: () => /* @__PURE__ */
|
|
10712
|
+
icon: () => /* @__PURE__ */ jsx16(Icon, { name: "clock", size: 20 }),
|
|
9726
10713
|
intlLabel: { id: "blockscene.contentMenu", defaultMessage: "Activity and trash" },
|
|
9727
10714
|
permissions: [...ACTIVITY, TRASH[0]],
|
|
9728
10715
|
// Not an `async` function: Strapi 5 warns on AsyncFunction loaders.
|
|
@@ -9741,29 +10728,29 @@ var editUrl = (type, documentId, locale) => {
|
|
|
9741
10728
|
return `${base}/content-manager/${kind}/${type.uid}${kind === "single-types" ? "" : `/${encodeURIComponent(documentId)}`}${locale ? `?plugins[i18n][locale]=${encodeURIComponent(locale)}` : ""}`;
|
|
9742
10729
|
};
|
|
9743
10730
|
var query = (params) => new URLSearchParams(Object.entries(params).filter(([, v]) => v !== "" && v != null).map(([k, v]) => [k, String(v)])).toString();
|
|
9744
|
-
var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */
|
|
9745
|
-
/* @__PURE__ */
|
|
9746
|
-
/* @__PURE__ */
|
|
10731
|
+
var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ jsx16(Box8, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsxs13(Field2.Root, { name, children: [
|
|
10732
|
+
/* @__PURE__ */ jsx16(Field2.Label, { children: label }),
|
|
10733
|
+
/* @__PURE__ */ jsx16(SingleSelect2, { value, onChange: (v) => onChange(String(v)), children: options.map((o) => /* @__PURE__ */ jsx16(SingleSelectOption2, { value: o.value, children: o.label }, o.value)) })
|
|
9747
10734
|
] }) });
|
|
9748
|
-
var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */
|
|
9749
|
-
/* @__PURE__ */
|
|
9750
|
-
/* @__PURE__ */
|
|
10735
|
+
var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ jsx16(Box8, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsxs13(Field2.Root, { name, children: [
|
|
10736
|
+
/* @__PURE__ */ jsx16(Field2.Label, { children: label }),
|
|
10737
|
+
/* @__PURE__ */ jsx16(TextInput, { name, type, value, onChange: (e) => onChange(e.target.value) })
|
|
9751
10738
|
] }) });
|
|
9752
10739
|
function Pager({ t, pagination, setPage }) {
|
|
9753
10740
|
if (!pagination?.total) return null;
|
|
9754
10741
|
const { page, pageCount, total } = pagination;
|
|
9755
|
-
return /* @__PURE__ */
|
|
9756
|
-
/* @__PURE__ */
|
|
9757
|
-
/* @__PURE__ */
|
|
9758
|
-
/* @__PURE__ */
|
|
9759
|
-
/* @__PURE__ */
|
|
10742
|
+
return /* @__PURE__ */ jsxs13(Flex10, { justifyContent: "space-between", alignItems: "center", paddingTop: 4, children: [
|
|
10743
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: t.f("contentPage", { page, pages: Math.max(pageCount, 1), total }) }),
|
|
10744
|
+
/* @__PURE__ */ jsxs13(Flex10, { gap: 2, children: [
|
|
10745
|
+
/* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.contentPrevious }),
|
|
10746
|
+
/* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", disabled: page >= pageCount, onClick: () => setPage(page + 1), children: t.contentNext })
|
|
9760
10747
|
] })
|
|
9761
10748
|
] });
|
|
9762
10749
|
}
|
|
9763
10750
|
function useList(get, path, params, refresh = 0) {
|
|
9764
|
-
const [state, setState] =
|
|
10751
|
+
const [state, setState] = React16.useState({ data: null, failed: false });
|
|
9765
10752
|
const key = `${path}?${query(params)}`;
|
|
9766
|
-
|
|
10753
|
+
React16.useEffect(() => {
|
|
9767
10754
|
let active = true;
|
|
9768
10755
|
setState((s) => ({ data: s.data, failed: false, loading: true }));
|
|
9769
10756
|
get(`/blockscene${key}`).then(({ data }) => active && setState({ data, failed: false })).catch(() => active && setState({ data: null, failed: true }));
|
|
@@ -9775,9 +10762,9 @@ function useList(get, path, params, refresh = 0) {
|
|
|
9775
10762
|
}
|
|
9776
10763
|
var Doc = ({ t, type, row, documentId, locale }) => {
|
|
9777
10764
|
const title = row.title || t.contentUntitled;
|
|
9778
|
-
return /* @__PURE__ */
|
|
9779
|
-
row.exists && type ? /* @__PURE__ */
|
|
9780
|
-
/* @__PURE__ */
|
|
10765
|
+
return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
|
10766
|
+
row.exists && type ? /* @__PURE__ */ jsx16(Link, { href: editUrl(type, documentId, locale), children: title }) : /* @__PURE__ */ jsx16(Typography10, { fontWeight: "bold", children: title }),
|
|
10767
|
+
/* @__PURE__ */ jsxs13(Typography10, { variant: "pi", textColor: "neutral600", children: [
|
|
9781
10768
|
type?.displayName || row.contentType,
|
|
9782
10769
|
locale ? ` \xB7 ${locale}` : "",
|
|
9783
10770
|
row.exists === false ? ` \xB7 ${t.contentGone}` : ""
|
|
@@ -9785,9 +10772,9 @@ var Doc = ({ t, type, row, documentId, locale }) => {
|
|
|
9785
10772
|
] });
|
|
9786
10773
|
};
|
|
9787
10774
|
function ActivityTab({ t, get }) {
|
|
9788
|
-
const [filters, setFilters] =
|
|
9789
|
-
const [search, setSearch] =
|
|
9790
|
-
const [page, setPage] =
|
|
10775
|
+
const [filters, setFilters] = React16.useState({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
|
|
10776
|
+
const [search, setSearch] = React16.useState("");
|
|
10777
|
+
const [page, setPage] = React16.useState(1);
|
|
9791
10778
|
const set2 = (key, value) => {
|
|
9792
10779
|
setFilters((f) => ({ ...f, [key]: value }));
|
|
9793
10780
|
setPage(1);
|
|
@@ -9799,13 +10786,13 @@ function ActivityTab({ t, get }) {
|
|
|
9799
10786
|
};
|
|
9800
10787
|
const { data, failed } = useList(get, "/activity", { ...filters, from: day(filters.from, false), to: day(filters.to, true), page, pageSize: 25 });
|
|
9801
10788
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9802
|
-
return /* @__PURE__ */
|
|
9803
|
-
data && !data.enabled && /* @__PURE__ */
|
|
9804
|
-
/* @__PURE__ */
|
|
10789
|
+
return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10790
|
+
data && !data.enabled && /* @__PURE__ */ jsx16(Box8, { padding: 3, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "warning700", children: t.contentOff }) }),
|
|
10791
|
+
/* @__PURE__ */ jsxs13(Flex10, { tag: "form", gap: 3, wrap: "wrap", alignItems: "flex-end", onSubmit: (e) => {
|
|
9805
10792
|
e.preventDefault();
|
|
9806
10793
|
set2("q", search.trim());
|
|
9807
10794
|
}, children: [
|
|
9808
|
-
/* @__PURE__ */
|
|
10795
|
+
/* @__PURE__ */ jsx16(
|
|
9809
10796
|
Select,
|
|
9810
10797
|
{
|
|
9811
10798
|
name: "actor",
|
|
@@ -9815,7 +10802,7 @@ function ActivityTab({ t, get }) {
|
|
|
9815
10802
|
options: [{ value: "", label: t.activityAnyone }, ...(data?.actors || []).map((a) => ({ value: a.actor, label: a.actorName || (a.actor === "system" ? t.historySystem : a.actor) }))]
|
|
9816
10803
|
}
|
|
9817
10804
|
),
|
|
9818
|
-
/* @__PURE__ */
|
|
10805
|
+
/* @__PURE__ */ jsx16(
|
|
9819
10806
|
Select,
|
|
9820
10807
|
{
|
|
9821
10808
|
name: "contentType",
|
|
@@ -9825,7 +10812,7 @@ function ActivityTab({ t, get }) {
|
|
|
9825
10812
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9826
10813
|
}
|
|
9827
10814
|
),
|
|
9828
|
-
/* @__PURE__ */
|
|
10815
|
+
/* @__PURE__ */ jsx16(
|
|
9829
10816
|
Select,
|
|
9830
10817
|
{
|
|
9831
10818
|
name: "action",
|
|
@@ -9835,35 +10822,35 @@ function ActivityTab({ t, get }) {
|
|
|
9835
10822
|
options: [{ value: "", label: t.activityAnyAction }, ...ACTIONS.map((a) => ({ value: a, label: t.historyActions[a] || a }))]
|
|
9836
10823
|
}
|
|
9837
10824
|
),
|
|
9838
|
-
/* @__PURE__ */
|
|
9839
|
-
/* @__PURE__ */
|
|
9840
|
-
/* @__PURE__ */
|
|
9841
|
-
/* @__PURE__ */
|
|
9842
|
-
/* @__PURE__ */
|
|
10825
|
+
/* @__PURE__ */ jsx16(Input, { name: "from", type: "date", label: t.activityFrom, value: filters.from, onChange: (v) => set2("from", v) }),
|
|
10826
|
+
/* @__PURE__ */ jsx16(Input, { name: "to", type: "date", label: t.activityTo, value: filters.to, onChange: (v) => set2("to", v) }),
|
|
10827
|
+
/* @__PURE__ */ jsx16(Input, { name: "q", label: t.activitySearch, value: search, onChange: setSearch }),
|
|
10828
|
+
/* @__PURE__ */ jsx16(Button8, { type: "submit", variant: "secondary", children: t.activitySearchButton }),
|
|
10829
|
+
/* @__PURE__ */ jsx16(Button8, { type: "button", variant: "tertiary", onClick: () => {
|
|
9843
10830
|
setSearch("");
|
|
9844
10831
|
setFilters({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
|
|
9845
10832
|
setPage(1);
|
|
9846
10833
|
}, children: t.contentClear })
|
|
9847
10834
|
] }),
|
|
9848
|
-
failed ? /* @__PURE__ */
|
|
9849
|
-
/* @__PURE__ */
|
|
9850
|
-
/* @__PURE__ */
|
|
9851
|
-
/* @__PURE__ */
|
|
9852
|
-
/* @__PURE__ */
|
|
9853
|
-
/* @__PURE__ */
|
|
9854
|
-
/* @__PURE__ */
|
|
10835
|
+
failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.activityFailed }) : !data ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.activityEmpty }) : /* @__PURE__ */ jsxs13(Box8, { children: [
|
|
10836
|
+
/* @__PURE__ */ jsxs13(Table, { colCount: 4, rowCount: data.results.length + 1, "data-testid": "blockscene-activity", children: [
|
|
10837
|
+
/* @__PURE__ */ jsx16(Thead, { children: /* @__PURE__ */ jsxs13(Tr, { children: [
|
|
10838
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWhen }) }),
|
|
10839
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityDocument }) }),
|
|
10840
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWho }) }),
|
|
10841
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWhat }) })
|
|
9855
10842
|
] }) }),
|
|
9856
|
-
/* @__PURE__ */
|
|
9857
|
-
/* @__PURE__ */
|
|
9858
|
-
/* @__PURE__ */
|
|
9859
|
-
/* @__PURE__ */
|
|
9860
|
-
/* @__PURE__ */
|
|
9861
|
-
/* @__PURE__ */
|
|
9862
|
-
/* @__PURE__ */
|
|
10843
|
+
/* @__PURE__ */ jsx16(Tbody, { children: data.results.map((event) => /* @__PURE__ */ jsxs13(Tr, { "data-testid": `activity-${event.id}`, children: [
|
|
10844
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: when(t, event.at) }) }),
|
|
10845
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Doc, { t, type: types.get(event.contentType), row: event, documentId: event.relatedDocumentId, locale: event.locale }) }),
|
|
10846
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: event.actorName || (event.actor === "system" ? t.historySystem : event.actor) }) }),
|
|
10847
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
|
10848
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "omega", fontWeight: "bold", children: t.historyActions[event.action] || event.action }),
|
|
10849
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: event.summary?.missing ? "warning700" : "neutral700", children: ["delete", "purge"].includes(event.action) ? "" : [event.summary?.restoredFrom ? t.activityRestoredFrom : "", summaryText(t, event.summary)].filter(Boolean).join(" \xB7 ") })
|
|
9863
10850
|
] }) })
|
|
9864
10851
|
] }, event.id)) })
|
|
9865
10852
|
] }),
|
|
9866
|
-
/* @__PURE__ */
|
|
10853
|
+
/* @__PURE__ */ jsx16(Pager, { t, pagination: data.pagination, setPage })
|
|
9867
10854
|
] })
|
|
9868
10855
|
] });
|
|
9869
10856
|
}
|
|
@@ -9872,57 +10859,57 @@ function Report({ t, report }) {
|
|
|
9872
10859
|
const line = (item) => item.code === "incoming" ? t.f("report.incoming", item) : t.f(`report.${item.code}`, { ...item, locale: locale(item.locale), locales: (item.locales || []).map(locale).join(", "), fields: (item.fields || []).join(", ") });
|
|
9873
10860
|
const incoming = report.incoming && (report.incoming.reconnect || report.incoming.gone || report.incoming.replaced || report.incoming.published) ? [{ code: "incoming", ...report.incoming }] : [];
|
|
9874
10861
|
const warnings = [...report.warnings || [], ...incoming];
|
|
9875
|
-
return /* @__PURE__ */
|
|
9876
|
-
report.blocking?.length > 0 && /* @__PURE__ */
|
|
9877
|
-
/* @__PURE__ */
|
|
9878
|
-
/* @__PURE__ */
|
|
10862
|
+
return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": "restore-report", children: [
|
|
10863
|
+
report.blocking?.length > 0 && /* @__PURE__ */ jsxs13(Box8, { padding: 3, background: "danger100", hasRadius: true, children: [
|
|
10864
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", textColor: "danger700", children: t.restoreBlocked }),
|
|
10865
|
+
/* @__PURE__ */ jsx16("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: report.blocking.map((item, i) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "danger700", children: line(item) }) }, i)) })
|
|
9879
10866
|
] }),
|
|
9880
|
-
warnings.length > 0 && /* @__PURE__ */
|
|
9881
|
-
/* @__PURE__ */
|
|
9882
|
-
/* @__PURE__ */
|
|
10867
|
+
warnings.length > 0 && /* @__PURE__ */ jsxs13(Box8, { padding: 3, background: "warning100", hasRadius: true, children: [
|
|
10868
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", textColor: "warning700", children: t.restoreWarnings }),
|
|
10869
|
+
/* @__PURE__ */ jsx16("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: warnings.map((item, i) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "warning700", children: line(item) }) }, i)) })
|
|
9883
10870
|
] })
|
|
9884
10871
|
] });
|
|
9885
10872
|
}
|
|
9886
10873
|
function Preview2({ t, id, get, onClose }) {
|
|
9887
|
-
const [row, setRow] =
|
|
9888
|
-
const [failed, setFailed] =
|
|
9889
|
-
|
|
10874
|
+
const [row, setRow] = React16.useState(null);
|
|
10875
|
+
const [failed, setFailed] = React16.useState(false);
|
|
10876
|
+
React16.useEffect(() => {
|
|
9890
10877
|
get(`/blockscene/trash/${id}`).then(({ data }) => setRow(data)).catch(() => setFailed(true));
|
|
9891
10878
|
}, [get, id]);
|
|
9892
|
-
return /* @__PURE__ */
|
|
9893
|
-
/* @__PURE__ */
|
|
9894
|
-
/* @__PURE__ */
|
|
9895
|
-
row.incoming > 0 && /* @__PURE__ */
|
|
9896
|
-
row.entries.map((entry, i) => /* @__PURE__ */
|
|
9897
|
-
/* @__PURE__ */
|
|
10879
|
+
return /* @__PURE__ */ jsx16(Modal.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(Modal.Content, { style: { width: "min(900px, 92vw)" }, children: [
|
|
10880
|
+
/* @__PURE__ */ jsx16(Modal.Header, { children: /* @__PURE__ */ jsx16(Modal.Title, { children: row?.title || t.trashPreview }) }),
|
|
10881
|
+
/* @__PURE__ */ jsx16(Modal.Body, { children: failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !row ? /* @__PURE__ */ jsx16(Typography10, { children: t.contentLoading }) : /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 5, "data-testid": "trash-preview", children: [
|
|
10882
|
+
row.incoming > 0 && /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: t.f("trashIncoming", { count: row.incoming }) }),
|
|
10883
|
+
row.entries.map((entry, i) => /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
10884
|
+
/* @__PURE__ */ jsxs13(Typography10, { variant: "delta", tag: "h3", children: [
|
|
9898
10885
|
entry.locale || t.contentNone,
|
|
9899
10886
|
entry.status ? ` \xB7 ${entry.status === "published" ? t.trashPublished : t.trashDraft}` : ""
|
|
9900
10887
|
] }),
|
|
9901
|
-
/* @__PURE__ */
|
|
9902
|
-
/* @__PURE__ */
|
|
9903
|
-
/* @__PURE__ */
|
|
9904
|
-
/* @__PURE__ */
|
|
10888
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "sigma", textColor: "neutral600", children: t.trashFields }),
|
|
10889
|
+
/* @__PURE__ */ jsx16("dl", { style: { display: "grid", gridTemplateColumns: "minmax(120px, max-content) 1fr", gap: "4px 16px", margin: 0 }, children: entry.fields.map((field) => /* @__PURE__ */ jsxs13(React16.Fragment, { children: [
|
|
10890
|
+
/* @__PURE__ */ jsx16("dt", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", children: field.name }) }),
|
|
10891
|
+
/* @__PURE__ */ jsx16("dd", { style: { margin: 0, wordBreak: "break-word" }, children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: field.count !== void 0 ? t.f("trashItems", { count: field.count }) : field.value }) })
|
|
9905
10892
|
] }, field.name)) }),
|
|
9906
|
-
entry.blocks.length > 0 && /* @__PURE__ */
|
|
9907
|
-
/* @__PURE__ */
|
|
9908
|
-
/* @__PURE__ */
|
|
10893
|
+
entry.blocks.length > 0 && /* @__PURE__ */ jsxs13(Fragment13, { children: [
|
|
10894
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "sigma", textColor: "neutral600", children: t.trashBlocks }),
|
|
10895
|
+
/* @__PURE__ */ jsx16("ol", { style: { margin: 0, paddingLeft: 20 }, children: entry.blocks.map((block, j) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: block.name }) }, j)) })
|
|
9909
10896
|
] })
|
|
9910
10897
|
] }, i))
|
|
9911
10898
|
] }) }),
|
|
9912
|
-
/* @__PURE__ */
|
|
10899
|
+
/* @__PURE__ */ jsx16(Modal.Footer, { children: /* @__PURE__ */ jsx16(Modal.Close, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", children: t.trashClose }) }) })
|
|
9913
10900
|
] }) });
|
|
9914
10901
|
}
|
|
9915
10902
|
function TrashTab({ t, get, post, del, can }) {
|
|
9916
10903
|
const { toggleNotification } = useNotification2();
|
|
9917
|
-
const [contentType, setType] =
|
|
9918
|
-
const [restored, setRestored] =
|
|
9919
|
-
const [page, setPage] =
|
|
9920
|
-
const [refresh, reload] =
|
|
10904
|
+
const [contentType, setType] = React16.useState("");
|
|
10905
|
+
const [restored, setRestored] = React16.useState(false);
|
|
10906
|
+
const [page, setPage] = React16.useState(1);
|
|
10907
|
+
const [refresh, reload] = React16.useReducer((n) => n + 1, 0);
|
|
9921
10908
|
const { data, failed } = useList(get, "/trash", { contentType, status: restored ? "restored" : "trashed", page, pageSize: 20 }, refresh);
|
|
9922
|
-
const [preview, setPreview] =
|
|
9923
|
-
const [restore, setRestore] =
|
|
9924
|
-
const [remove, setRemove] =
|
|
9925
|
-
const [busy, setBusy] =
|
|
10909
|
+
const [preview, setPreview] = React16.useState(null);
|
|
10910
|
+
const [restore, setRestore] = React16.useState(null);
|
|
10911
|
+
const [remove, setRemove] = React16.useState(null);
|
|
10912
|
+
const [busy, setBusy] = React16.useState(false);
|
|
9926
10913
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9927
10914
|
const title = (row) => row.title || t.contentUntitled;
|
|
9928
10915
|
const check = async (row) => {
|
|
@@ -9968,9 +10955,9 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9968
10955
|
const days = Math.floor((new Date(at).getTime() - Date.now()) / DAY);
|
|
9969
10956
|
return days < 1 ? t.trashExpiresToday : t.f("trashExpiresIn", { days });
|
|
9970
10957
|
};
|
|
9971
|
-
return /* @__PURE__ */
|
|
9972
|
-
/* @__PURE__ */
|
|
9973
|
-
/* @__PURE__ */
|
|
10958
|
+
return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10959
|
+
/* @__PURE__ */ jsxs13(Flex10, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
|
|
10960
|
+
/* @__PURE__ */ jsx16(
|
|
9974
10961
|
Select,
|
|
9975
10962
|
{
|
|
9976
10963
|
name: "trash-type",
|
|
@@ -9983,70 +10970,70 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9983
10970
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9984
10971
|
}
|
|
9985
10972
|
),
|
|
9986
|
-
/* @__PURE__ */
|
|
9987
|
-
/* @__PURE__ */
|
|
10973
|
+
/* @__PURE__ */ jsxs13(Flex10, { gap: 2, paddingBottom: 2, children: [
|
|
10974
|
+
/* @__PURE__ */ jsx16(Switch, { "aria-label": t.trashShowRestored, checked: restored, onCheckedChange: (v) => {
|
|
9988
10975
|
setRestored(v);
|
|
9989
10976
|
setPage(1);
|
|
9990
10977
|
} }),
|
|
9991
|
-
/* @__PURE__ */
|
|
10978
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: t.trashShowRestored })
|
|
9992
10979
|
] })
|
|
9993
10980
|
] }),
|
|
9994
|
-
failed ? /* @__PURE__ */
|
|
9995
|
-
/* @__PURE__ */
|
|
9996
|
-
/* @__PURE__ */
|
|
9997
|
-
/* @__PURE__ */
|
|
9998
|
-
/* @__PURE__ */
|
|
9999
|
-
/* @__PURE__ */
|
|
10000
|
-
/* @__PURE__ */
|
|
10001
|
-
/* @__PURE__ */
|
|
10981
|
+
failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !data ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.trashEmpty }) : /* @__PURE__ */ jsxs13(Box8, { children: [
|
|
10982
|
+
/* @__PURE__ */ jsxs13(Table, { colCount: 5, rowCount: data.results.length + 1, "data-testid": "blockscene-trash", children: [
|
|
10983
|
+
/* @__PURE__ */ jsx16(Thead, { children: /* @__PURE__ */ jsxs13(Tr, { children: [
|
|
10984
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityDocument }) }),
|
|
10985
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.trashLocales }) }),
|
|
10986
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.trashDeletedBy }) }),
|
|
10987
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: restored ? t.trashRestoredAs : t.trashExpires }) }),
|
|
10988
|
+
/* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: " " }) })
|
|
10002
10989
|
] }) }),
|
|
10003
|
-
/* @__PURE__ */
|
|
10004
|
-
/* @__PURE__ */
|
|
10005
|
-
/* @__PURE__ */
|
|
10006
|
-
/* @__PURE__ */
|
|
10007
|
-
/* @__PURE__ */
|
|
10008
|
-
/* @__PURE__ */
|
|
10990
|
+
/* @__PURE__ */ jsx16(Tbody, { children: data.results.map((row) => /* @__PURE__ */ jsxs13(Tr, { "data-testid": `trash-${row.id}`, children: [
|
|
10991
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Doc, { t, type: types.get(row.contentType), row: { ...row, exists: void 0 }, documentId: row.relatedDocumentId, locale: null }) }),
|
|
10992
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: (row.locales || []).map((l) => l ?? t.contentNone).join(", ") }) }),
|
|
10993
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", children: [
|
|
10994
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: row.actorName || (row.actor === "system" ? t.historySystem : row.actor) }),
|
|
10995
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: when(t, row.deletedAt) })
|
|
10009
10996
|
] }) }),
|
|
10010
|
-
/* @__PURE__ */
|
|
10011
|
-
/* @__PURE__ */
|
|
10012
|
-
restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */
|
|
10997
|
+
/* @__PURE__ */ jsxs13(Td, { children: [
|
|
10998
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: restored ? row.restoredAt ? when(t, row.restoredAt) : "" : expires(row.expiresAt) }),
|
|
10999
|
+
restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */ jsx16(Box8, { children: /* @__PURE__ */ jsx16(Link, { href: editUrl(types.get(row.contentType), row.restoredAs, null), children: t.contentOpen }) })
|
|
10013
11000
|
] }),
|
|
10014
|
-
/* @__PURE__ */
|
|
10015
|
-
/* @__PURE__ */
|
|
10016
|
-
!restored && can.canRestore && /* @__PURE__ */
|
|
10017
|
-
can.canPurge && /* @__PURE__ */
|
|
11001
|
+
/* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { gap: 2, justifyContent: "flex-end", children: [
|
|
11002
|
+
/* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", onClick: () => setPreview(row.id), children: t.trashPreview }),
|
|
11003
|
+
!restored && can.canRestore && /* @__PURE__ */ jsx16(Button8, { variant: "secondary", size: "S", onClick: () => check(row), "data-testid": `trash-restore-${row.id}`, children: t.trashRestore }),
|
|
11004
|
+
can.canPurge && /* @__PURE__ */ jsx16(Button8, { variant: "danger-light", size: "S", onClick: () => setRemove(row), "data-testid": `trash-delete-${row.id}`, children: t.trashDelete })
|
|
10018
11005
|
] }) })
|
|
10019
11006
|
] }, row.id)) })
|
|
10020
11007
|
] }),
|
|
10021
|
-
/* @__PURE__ */
|
|
11008
|
+
/* @__PURE__ */ jsx16(Pager, { t, pagination: data.pagination, setPage })
|
|
10022
11009
|
] }),
|
|
10023
|
-
preview !== null && /* @__PURE__ */
|
|
10024
|
-
restore && /* @__PURE__ */
|
|
10025
|
-
/* @__PURE__ */
|
|
10026
|
-
/* @__PURE__ */
|
|
10027
|
-
/* @__PURE__ */
|
|
10028
|
-
restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */
|
|
10029
|
-
!restore.done.already && /* @__PURE__ */
|
|
10030
|
-
] }) : !restore.report ? /* @__PURE__ */
|
|
10031
|
-
/* @__PURE__ */
|
|
11010
|
+
preview !== null && /* @__PURE__ */ jsx16(Preview2, { t, id: preview, get, onClose: () => setPreview(null) }),
|
|
11011
|
+
restore && /* @__PURE__ */ jsx16(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRestore(null), children: /* @__PURE__ */ jsxs13(Dialog.Content, { children: [
|
|
11012
|
+
/* @__PURE__ */ jsx16(Dialog.Header, { children: t.f("restoreTitle", { title: title(restore.row) }) }),
|
|
11013
|
+
/* @__PURE__ */ jsx16(Dialog.Body, { children: /* @__PURE__ */ jsx16(Flex10, { direction: "column", alignItems: "stretch", gap: 3, width: "100%", children: restore.done ? /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 2, role: "status", "data-testid": "restore-done", children: [
|
|
11014
|
+
/* @__PURE__ */ jsx16(Typography10, { textColor: "success700", children: restore.done.already ? t.restoreAlready : t.restoreDone }),
|
|
11015
|
+
restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ jsx16(Link, { href: editUrl(types.get(restore.row.contentType), restore.done.documentId, restore.done.locales?.[0] ?? null), children: t.restoreOpen }),
|
|
11016
|
+
!restore.done.already && /* @__PURE__ */ jsx16(Report, { t, report: { warnings: restore.done.warnings, incoming: restore.done.incoming && { ...restore.done.incoming, reconnect: restore.done.incoming.reconnected } } })
|
|
11017
|
+
] }) : !restore.report ? /* @__PURE__ */ jsx16(Typography10, { children: t.restoreChecking }) : restore.failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.restoreFailed }) : /* @__PURE__ */ jsxs13(Fragment13, { children: [
|
|
11018
|
+
/* @__PURE__ */ jsxs13(Typography10, { variant: "pi", children: [
|
|
10032
11019
|
t.restoreIntro,
|
|
10033
11020
|
" ",
|
|
10034
11021
|
restore.report.documentId ? t.restoreInto : t.restoreNew
|
|
10035
11022
|
] }),
|
|
10036
|
-
restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */
|
|
10037
|
-
/* @__PURE__ */
|
|
11023
|
+
restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: t.f("restoreLocales", { locales: restore.report.locales.join(", ") }) }),
|
|
11024
|
+
/* @__PURE__ */ jsx16(Report, { t, report: restore.report })
|
|
10038
11025
|
] }) }) }),
|
|
10039
|
-
/* @__PURE__ */
|
|
10040
|
-
/* @__PURE__ */
|
|
10041
|
-
!restore.done && /* @__PURE__ */
|
|
11026
|
+
/* @__PURE__ */ jsxs13(Dialog.Footer, { children: [
|
|
11027
|
+
/* @__PURE__ */ jsx16(Dialog.Cancel, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", disabled: busy, children: restore.done ? t.trashClose : t.restoreCancel }) }),
|
|
11028
|
+
!restore.done && /* @__PURE__ */ jsx16(Button8, { onClick: confirmRestore, loading: busy, disabled: busy || !restore.report || restore.failed || restore.report.blocking?.length > 0, "data-testid": "restore-confirm", children: t.restoreConfirm })
|
|
10042
11029
|
] })
|
|
10043
11030
|
] }) }),
|
|
10044
|
-
remove && /* @__PURE__ */
|
|
10045
|
-
/* @__PURE__ */
|
|
10046
|
-
/* @__PURE__ */
|
|
10047
|
-
/* @__PURE__ */
|
|
10048
|
-
/* @__PURE__ */
|
|
10049
|
-
/* @__PURE__ */
|
|
11031
|
+
remove && /* @__PURE__ */ jsx16(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRemove(null), children: /* @__PURE__ */ jsxs13(Dialog.Content, { children: [
|
|
11032
|
+
/* @__PURE__ */ jsx16(Dialog.Header, { children: t.trashDeleteTitle }),
|
|
11033
|
+
/* @__PURE__ */ jsx16(Dialog.Body, { children: /* @__PURE__ */ jsx16(Typography10, { children: t.f("trashDeleteConfirm", { title: title(remove) }) }) }),
|
|
11034
|
+
/* @__PURE__ */ jsxs13(Dialog.Footer, { children: [
|
|
11035
|
+
/* @__PURE__ */ jsx16(Dialog.Cancel, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", disabled: busy, children: t.restoreCancel }) }),
|
|
11036
|
+
/* @__PURE__ */ jsx16(Button8, { variant: "danger", onClick: confirmRemove, loading: busy, disabled: busy, "data-testid": "delete-confirm", children: t.trashDelete })
|
|
10050
11037
|
] })
|
|
10051
11038
|
] }) })
|
|
10052
11039
|
] });
|
|
@@ -10054,37 +11041,92 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
10054
11041
|
function ContentPage() {
|
|
10055
11042
|
const t = useMessages();
|
|
10056
11043
|
const { get, post, del } = useFetchClient2();
|
|
10057
|
-
const activity =
|
|
10058
|
-
const trash =
|
|
10059
|
-
const [tab, setTab] =
|
|
10060
|
-
if (activity.isLoading || trash.isLoading) return /* @__PURE__ */
|
|
11044
|
+
const activity = useRBAC3(ACTIVITY);
|
|
11045
|
+
const trash = useRBAC3(TRASH);
|
|
11046
|
+
const [tab, setTab] = React16.useState(null);
|
|
11047
|
+
if (activity.isLoading || trash.isLoading) return /* @__PURE__ */ jsx16(Page.Loading, {});
|
|
10061
11048
|
const canActivity = Boolean(activity.allowedActions?.canRead), canTrash = Boolean(trash.allowedActions?.canRead);
|
|
10062
|
-
if (!canActivity && !canTrash) return /* @__PURE__ */
|
|
11049
|
+
if (!canActivity && !canTrash) return /* @__PURE__ */ jsx16(Page.NoPermissions, {});
|
|
10063
11050
|
const current = tab || (canActivity ? "activity" : "trash");
|
|
10064
|
-
return /* @__PURE__ */
|
|
10065
|
-
/* @__PURE__ */
|
|
10066
|
-
/* @__PURE__ */
|
|
10067
|
-
/* @__PURE__ */
|
|
10068
|
-
/* @__PURE__ */
|
|
10069
|
-
canActivity && /* @__PURE__ */
|
|
10070
|
-
canTrash && /* @__PURE__ */
|
|
11051
|
+
return /* @__PURE__ */ jsxs13(Page.Main, { children: [
|
|
11052
|
+
/* @__PURE__ */ jsx16(Page.Title, { children: t.contentTitle }),
|
|
11053
|
+
/* @__PURE__ */ jsx16(Layouts.Header, { title: t.contentTitle, subtitle: t.contentSubtitle }),
|
|
11054
|
+
/* @__PURE__ */ jsx16(Layouts.Content, { children: /* @__PURE__ */ jsxs13(Tabs.Root, { value: current, onValueChange: setTab, children: [
|
|
11055
|
+
/* @__PURE__ */ jsxs13(Tabs.List, { "aria-label": t.contentTitle, children: [
|
|
11056
|
+
canActivity && /* @__PURE__ */ jsx16(Tabs.Trigger, { value: "activity", children: t.activityTab }),
|
|
11057
|
+
canTrash && /* @__PURE__ */ jsx16(Tabs.Trigger, { value: "trash", children: t.trashTab })
|
|
10071
11058
|
] }),
|
|
10072
|
-
/* @__PURE__ */
|
|
10073
|
-
canActivity && /* @__PURE__ */
|
|
10074
|
-
canTrash && /* @__PURE__ */
|
|
11059
|
+
/* @__PURE__ */ jsxs13(Box8, { paddingTop: 6, paddingBottom: 6, background: "neutral0", hasRadius: true, paddingLeft: 6, paddingRight: 6, marginTop: 4, children: [
|
|
11060
|
+
canActivity && /* @__PURE__ */ jsx16(Tabs.Content, { value: "activity", children: /* @__PURE__ */ jsx16(ActivityTab, { t, get }) }),
|
|
11061
|
+
canTrash && /* @__PURE__ */ jsx16(Tabs.Content, { value: "trash", children: /* @__PURE__ */ jsx16(TrashTab, { t, get, post, del, can: trash.allowedActions }) })
|
|
10075
11062
|
] })
|
|
10076
11063
|
] }) })
|
|
10077
11064
|
] });
|
|
10078
11065
|
}
|
|
10079
11066
|
|
|
11067
|
+
// admin/StarterKits.tsx
|
|
11068
|
+
import * as React17 from "react";
|
|
11069
|
+
import { Box as Box9, Button as Button9, Flex as Flex11, Typography as Typography11 } from "@strapi/design-system";
|
|
11070
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
11071
|
+
var marker = (docKey) => {
|
|
11072
|
+
try {
|
|
11073
|
+
const entry = window.history.state?.key ?? window.history.state?.idx ?? "route";
|
|
11074
|
+
return `blockscene:starter-kit:${entry}:${docKey}`;
|
|
11075
|
+
} catch {
|
|
11076
|
+
return `blockscene:starter-kit:${docKey}`;
|
|
11077
|
+
}
|
|
11078
|
+
};
|
|
11079
|
+
var wasHandled = (key) => {
|
|
11080
|
+
try {
|
|
11081
|
+
return window.sessionStorage.getItem(key) === "handled";
|
|
11082
|
+
} catch {
|
|
11083
|
+
return false;
|
|
11084
|
+
}
|
|
11085
|
+
};
|
|
11086
|
+
var remember2 = (key) => {
|
|
11087
|
+
try {
|
|
11088
|
+
window.sessionStorage.setItem(key, "handled");
|
|
11089
|
+
} catch {
|
|
11090
|
+
}
|
|
11091
|
+
};
|
|
11092
|
+
function StarterKits({ creating, kits, zones, components, form, Modal: Modal3, docKey }) {
|
|
11093
|
+
const t = useMessages();
|
|
11094
|
+
const key = marker(docKey);
|
|
11095
|
+
const handled = React17.useRef({ key, value: wasHandled(key) });
|
|
11096
|
+
if (handled.current.key !== key) handled.current = { key, value: wasHandled(key) };
|
|
11097
|
+
const usable = starterKitsForLocale(kits, form?.locale).filter((kit) => Object.keys(kit.zones || {}).every((name) => zones.some((zone) => zone.name === name)));
|
|
11098
|
+
const available = creating && form && !handled.current.value && usable.length > 0 && zones.length > 0 && zones.every((zone) => form.rows(zone.name).length === 0);
|
|
11099
|
+
const [open, setOpen] = React17.useState(available);
|
|
11100
|
+
React17.useEffect(() => {
|
|
11101
|
+
if (available) setOpen(true);
|
|
11102
|
+
}, [available, key]);
|
|
11103
|
+
if (!available) return null;
|
|
11104
|
+
const finish = () => {
|
|
11105
|
+
handled.current.value = true;
|
|
11106
|
+
remember2(key);
|
|
11107
|
+
setOpen(false);
|
|
11108
|
+
};
|
|
11109
|
+
const apply = (kit) => {
|
|
11110
|
+
const rows = starterKitRows(kit, zones, components, form);
|
|
11111
|
+
if (!rows) return;
|
|
11112
|
+
for (const [zone, value] of Object.entries(rows)) form.setRows(zone, value);
|
|
11113
|
+
finish();
|
|
11114
|
+
};
|
|
11115
|
+
return /* @__PURE__ */ jsx17(Modal3, { open, onOpenChange: (next) => next ? setOpen(true) : finish(), title: t.starterKits, width: "560px", children: /* @__PURE__ */ jsxs14(Flex11, { direction: "column", alignItems: "stretch", gap: 3, children: [
|
|
11116
|
+
/* @__PURE__ */ jsx17(Typography11, { textColor: "neutral600", children: t.starterKitsHelp }),
|
|
11117
|
+
usable.map((kit) => /* @__PURE__ */ jsx17(Button9, { variant: "secondary", fullWidth: true, onClick: () => apply(kit), "data-testid": `starter-kit-${kit.id}`, children: localized(kit.label, t.locale) }, kit.id)),
|
|
11118
|
+
/* @__PURE__ */ jsx17(Box9, { paddingTop: 1, children: /* @__PURE__ */ jsx17(Button9, { variant: "tertiary", onClick: finish, children: t.startBlank }) })
|
|
11119
|
+
] }) });
|
|
11120
|
+
}
|
|
11121
|
+
|
|
10080
11122
|
// admin/strapi5.tsx
|
|
10081
|
-
import { Fragment as
|
|
11123
|
+
import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
10082
11124
|
function Modal2({ open, onOpenChange, trigger, title, children, width = "80vw" }) {
|
|
10083
|
-
return /* @__PURE__ */
|
|
10084
|
-
trigger && /* @__PURE__ */
|
|
10085
|
-
/* @__PURE__ */
|
|
10086
|
-
/* @__PURE__ */
|
|
10087
|
-
/* @__PURE__ */
|
|
11125
|
+
return /* @__PURE__ */ jsxs15(Dialog2.Root, { open, onOpenChange, children: [
|
|
11126
|
+
trigger && /* @__PURE__ */ jsx18(Dialog2.Trigger, { children: trigger }),
|
|
11127
|
+
/* @__PURE__ */ jsxs15(Dialog2.Content, { style: { width, maxWidth: "92vw" }, children: [
|
|
11128
|
+
/* @__PURE__ */ jsx18(Dialog2.Header, { children: /* @__PURE__ */ jsx18(Dialog2.Title, { children: title }) }),
|
|
11129
|
+
/* @__PURE__ */ jsx18(Dialog2.Body, { children })
|
|
10088
11130
|
] })
|
|
10089
11131
|
] });
|
|
10090
11132
|
}
|
|
@@ -10102,7 +11144,7 @@ function useRowForm(c, values, get) {
|
|
|
10102
11144
|
const onChange = useForm3("Blockscene", (state) => state.onChange);
|
|
10103
11145
|
const errors = useForm3("Blockscene", (state) => state.errors);
|
|
10104
11146
|
const { toggleNotification } = useNotification3();
|
|
10105
|
-
const latest =
|
|
11147
|
+
const latest = React18.useRef(values);
|
|
10106
11148
|
latest.current = values;
|
|
10107
11149
|
const locale = c.form?.initialValues?.locale || void 0;
|
|
10108
11150
|
if (typeof onChange !== "function") return null;
|
|
@@ -10146,8 +11188,8 @@ function useScope() {
|
|
|
10146
11188
|
const history = !creating && Boolean(c.id) && Boolean(catalog?.history?.contentTypes?.includes(c.model));
|
|
10147
11189
|
return { c, rbac, get, put, formValues, catalog, creating, zones, typeSettings, gallery, history };
|
|
10148
11190
|
}
|
|
10149
|
-
var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */
|
|
10150
|
-
/* @__PURE__ */
|
|
11191
|
+
var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ jsx18(Box10, { "data-testid": testid, children: /* @__PURE__ */ jsx18(SimpleMenu2, { variant: "tertiary", size: "S", "aria-label": label, title: label, endIcon: null, label: /* @__PURE__ */ jsx18(Icon, { name: "more", size: 16 }), children: items2.map((item) => /* @__PURE__ */ jsx18(MenuItem2, { onSelect: item.onSelect, "data-testid": item.testid, children: /* @__PURE__ */ jsxs15(Flex12, { gap: 2, alignItems: "center", children: [
|
|
11192
|
+
/* @__PURE__ */ jsx18(Icon, { name: item.icon, size: 16 }),
|
|
10151
11193
|
item.label
|
|
10152
11194
|
] }) }, item.testid)) }) });
|
|
10153
11195
|
function Editor() {
|
|
@@ -10155,13 +11197,13 @@ function Editor() {
|
|
|
10155
11197
|
const { catalog, typeSettings, gallery } = scope;
|
|
10156
11198
|
const lazy = Boolean(catalog?.editor?.enabled && catalog.editor.lazyEditors !== false && typeSettings.enabled !== false);
|
|
10157
11199
|
const lazyFields = (catalog?.editor?.lazyFields || []).join(",");
|
|
10158
|
-
|
|
11200
|
+
React18.useEffect(() => {
|
|
10159
11201
|
if (catalog) setLazyConfig({ on: lazy, fields: lazyFields ? lazyFields.split(",") : [] });
|
|
10160
11202
|
}, [catalog, lazy, lazyFields]);
|
|
10161
|
-
const kept2 =
|
|
11203
|
+
const kept2 = React18.useRef(false);
|
|
10162
11204
|
if (!scope.c.isLoading) kept2.current = gallery;
|
|
10163
11205
|
if (!kept2.current) return null;
|
|
10164
|
-
return /* @__PURE__ */
|
|
11206
|
+
return /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18("div", { hidden: true, "data-blockscene-editor": "", children: /* @__PURE__ */ jsx18(Workspace, { scope }) }) });
|
|
10165
11207
|
}
|
|
10166
11208
|
function Workspace({ scope }) {
|
|
10167
11209
|
const { c, get, put, formValues, catalog, creating, zones, typeSettings } = scope;
|
|
@@ -10177,6 +11219,8 @@ function Workspace({ scope }) {
|
|
|
10177
11219
|
};
|
|
10178
11220
|
const host = usePreviewHost5();
|
|
10179
11221
|
const state = useEditorState(editor, host);
|
|
11222
|
+
const versions = useVersions(host, catalog?.history);
|
|
11223
|
+
const docKey = `${c.model}:${creating ? "new" : c.id}:${c.form?.initialValues?.locale || ""}`;
|
|
10180
11224
|
const add = (zone, uid, preset) => {
|
|
10181
11225
|
const values = formValues ?? c.form.values;
|
|
10182
11226
|
const close = catalog?.groups?.[uid];
|
|
@@ -10194,8 +11238,9 @@ function Workspace({ scope }) {
|
|
|
10194
11238
|
if (close) c.form.addFieldRow(zone.name, { __component: close }, at + 1);
|
|
10195
11239
|
return true;
|
|
10196
11240
|
};
|
|
10197
|
-
return /* @__PURE__ */
|
|
10198
|
-
/* @__PURE__ */
|
|
11241
|
+
return /* @__PURE__ */ jsxs15(Fragment14, { children: [
|
|
11242
|
+
/* @__PURE__ */ jsx18(StarterKits, { creating, kits: catalog.kits?.[c.model], zones, components: c.components, form, Modal: Modal2, docKey }),
|
|
11243
|
+
/* @__PURE__ */ jsx18(
|
|
10199
11244
|
Gallery,
|
|
10200
11245
|
{
|
|
10201
11246
|
zones,
|
|
@@ -10208,18 +11253,19 @@ function Workspace({ scope }) {
|
|
|
10208
11253
|
put,
|
|
10209
11254
|
editor: catalog.editor,
|
|
10210
11255
|
catalog,
|
|
10211
|
-
docKey
|
|
11256
|
+
docKey,
|
|
10212
11257
|
contentType: c.model,
|
|
10213
11258
|
userId: user?.id,
|
|
10214
11259
|
form,
|
|
10215
|
-
zoneTools: /* @__PURE__ */
|
|
11260
|
+
zoneTools: /* @__PURE__ */ jsx18(ZoneBarTools, { state }),
|
|
10216
11261
|
openBlock: state.openBlock,
|
|
10217
11262
|
openInsert: state.openInsert
|
|
10218
11263
|
}
|
|
10219
11264
|
),
|
|
10220
|
-
/* @__PURE__ */
|
|
11265
|
+
/* @__PURE__ */ jsx18(
|
|
10221
11266
|
PagePreview,
|
|
10222
11267
|
{
|
|
11268
|
+
versions,
|
|
10223
11269
|
editor,
|
|
10224
11270
|
state,
|
|
10225
11271
|
host,
|
|
@@ -10234,7 +11280,7 @@ function Workspace({ scope }) {
|
|
|
10234
11280
|
}
|
|
10235
11281
|
function Panel2() {
|
|
10236
11282
|
const { c, rbac, get, catalog, gallery, history } = useScope();
|
|
10237
|
-
const canReadHistory = Boolean(
|
|
11283
|
+
const canReadHistory = Boolean(useRBAC4(HISTORY_READ).allowedActions?.canRead);
|
|
10238
11284
|
const preview = usePreviewZone(usePreviewHost5());
|
|
10239
11285
|
const groups = gallery ? catalog?.groups : null;
|
|
10240
11286
|
const problems = groups && preview.zone ? (0, import_groups.validateGroups)(preview.rows, groups) : [];
|
|
@@ -10242,9 +11288,9 @@ function Panel2() {
|
|
|
10242
11288
|
if (!versions && !problems.length) return null;
|
|
10243
11289
|
return {
|
|
10244
11290
|
title: "Blockscene",
|
|
10245
|
-
content: /* @__PURE__ */
|
|
10246
|
-
problems.length > 0 && /* @__PURE__ */
|
|
10247
|
-
versions && /* @__PURE__ */
|
|
11291
|
+
content: /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsxs15(Flex12, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
11292
|
+
problems.length > 0 && /* @__PURE__ */ jsx18(GroupDiagnostics, { scope: preview, groups, problems }),
|
|
11293
|
+
versions && /* @__PURE__ */ jsx18(
|
|
10248
11294
|
History,
|
|
10249
11295
|
{
|
|
10250
11296
|
model: c.model,
|
|
@@ -10260,8 +11306,8 @@ function Panel2() {
|
|
|
10260
11306
|
] }) })
|
|
10261
11307
|
};
|
|
10262
11308
|
}
|
|
10263
|
-
var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */
|
|
10264
|
-
/* @__PURE__ */
|
|
11309
|
+
var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ jsxs15(Flex12, { gap: 3, children: [
|
|
11310
|
+
/* @__PURE__ */ jsx18(
|
|
10265
11311
|
Switch2,
|
|
10266
11312
|
{
|
|
10267
11313
|
name,
|
|
@@ -10271,7 +11317,7 @@ var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ *
|
|
|
10271
11317
|
onCheckedChange: onChange
|
|
10272
11318
|
}
|
|
10273
11319
|
),
|
|
10274
|
-
/* @__PURE__ */
|
|
11320
|
+
/* @__PURE__ */ jsx18(Typography12, { children: label })
|
|
10275
11321
|
] });
|
|
10276
11322
|
var TextField = ({
|
|
10277
11323
|
name,
|
|
@@ -10280,9 +11326,9 @@ var TextField = ({
|
|
|
10280
11326
|
onChange,
|
|
10281
11327
|
disabled,
|
|
10282
11328
|
placeholder
|
|
10283
|
-
}) => /* @__PURE__ */
|
|
10284
|
-
/* @__PURE__ */
|
|
10285
|
-
/* @__PURE__ */
|
|
11329
|
+
}) => /* @__PURE__ */ jsxs15(Field3.Root, { name, children: [
|
|
11330
|
+
/* @__PURE__ */ jsx18(Field3.Label, { children: label }),
|
|
11331
|
+
/* @__PURE__ */ jsx18(
|
|
10286
11332
|
TextInput2,
|
|
10287
11333
|
{
|
|
10288
11334
|
name,
|
|
@@ -10300,16 +11346,16 @@ var SelectField = ({
|
|
|
10300
11346
|
onChange,
|
|
10301
11347
|
disabled,
|
|
10302
11348
|
options
|
|
10303
|
-
}) => /* @__PURE__ */
|
|
10304
|
-
/* @__PURE__ */
|
|
10305
|
-
/* @__PURE__ */
|
|
10306
|
-
|
|
11349
|
+
}) => /* @__PURE__ */ jsxs15(Field3.Root, { name, children: [
|
|
11350
|
+
/* @__PURE__ */ jsx18(Field3.Label, { children: label }),
|
|
11351
|
+
/* @__PURE__ */ jsx18(
|
|
11352
|
+
SingleSelect3,
|
|
10307
11353
|
{
|
|
10308
11354
|
value,
|
|
10309
11355
|
disabled,
|
|
10310
11356
|
startIcon: options.find((o) => o.value === value)?.icon,
|
|
10311
11357
|
onChange: (v) => onChange(String(v)),
|
|
10312
|
-
children: options.map((o) => /* @__PURE__ */
|
|
11358
|
+
children: options.map((o) => /* @__PURE__ */ jsx18(SingleSelectOption3, { value: o.value, startIcon: o.icon, children: o.label }, o.value))
|
|
10313
11359
|
}
|
|
10314
11360
|
)
|
|
10315
11361
|
] });
|
|
@@ -10319,11 +11365,11 @@ function MediaPicker({ onClose, onSelect }) {
|
|
|
10319
11365
|
(state) => state.components
|
|
10320
11366
|
);
|
|
10321
11367
|
const Dialog3 = components?.["media-library"];
|
|
10322
|
-
|
|
11368
|
+
React18.useEffect(() => {
|
|
10323
11369
|
if (!Dialog3) onClose();
|
|
10324
11370
|
}, [Dialog3, onClose]);
|
|
10325
11371
|
if (!Dialog3) return null;
|
|
10326
|
-
return /* @__PURE__ */
|
|
11372
|
+
return /* @__PURE__ */ jsx18(
|
|
10327
11373
|
Dialog3,
|
|
10328
11374
|
{
|
|
10329
11375
|
onClose,
|
|
@@ -10334,7 +11380,7 @@ function MediaPicker({ onClose, onSelect }) {
|
|
|
10334
11380
|
);
|
|
10335
11381
|
}
|
|
10336
11382
|
function usePermissions() {
|
|
10337
|
-
const { allowedActions, isLoading } =
|
|
11383
|
+
const { allowedActions, isLoading } = useRBAC4(
|
|
10338
11384
|
Object.values(permissions).flat()
|
|
10339
11385
|
);
|
|
10340
11386
|
return {
|
|
@@ -10343,7 +11389,7 @@ function usePermissions() {
|
|
|
10343
11389
|
isLoading
|
|
10344
11390
|
};
|
|
10345
11391
|
}
|
|
10346
|
-
var SettingsPage = () => /* @__PURE__ */
|
|
11392
|
+
var SettingsPage = ({ section }) => /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18(
|
|
10347
11393
|
Settings,
|
|
10348
11394
|
{
|
|
10349
11395
|
useClient: useFetchClient3,
|
|
@@ -10352,7 +11398,8 @@ var SettingsPage = () => /* @__PURE__ */ jsx16(Guard, { children: /* @__PURE__ *
|
|
|
10352
11398
|
ToggleField,
|
|
10353
11399
|
SelectField,
|
|
10354
11400
|
TextField,
|
|
10355
|
-
lazyEditors: true
|
|
11401
|
+
lazyEditors: true,
|
|
11402
|
+
section
|
|
10356
11403
|
}
|
|
10357
11404
|
) });
|
|
10358
11405
|
var strapiApp = null;
|
|
@@ -10361,7 +11408,7 @@ var strapi5_default = {
|
|
|
10361
11408
|
strapiApp = app;
|
|
10362
11409
|
register(app, SettingsPage, "blockscene");
|
|
10363
11410
|
app.registerPlugin({ id: "blockscene", name: "Blockscene", apis: { registerPanel: (panel) => registerPanel(panel, ICON_NAMES) } });
|
|
10364
|
-
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */
|
|
11411
|
+
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18(ContentPage, {}) })));
|
|
10365
11412
|
},
|
|
10366
11413
|
registerTrads,
|
|
10367
11414
|
bootstrap(app) {
|