@aduptive/strapi-blockscene 2.0.0-alpha.10 → 2.0.0-alpha.12
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 +89 -11
- package/dist/admin.cjs +1103 -584
- package/dist/admin.mjs +1100 -581
- package/dist/server.cjs +177 -27
- package/package.json +1 -1
package/dist/admin.cjs
CHANGED
|
@@ -48,6 +48,10 @@ var require_groups = __commonJS({
|
|
|
48
48
|
return Object.keys(out).length ? out : null;
|
|
49
49
|
}
|
|
50
50
|
var uidOf = (row) => typeof row?.__component === "string" ? row.__component : "";
|
|
51
|
+
var invalidComponents = (rows, allowed) => {
|
|
52
|
+
const uids = new Set(Array.isArray(allowed) ? allowed : []);
|
|
53
|
+
return (Array.isArray(rows) ? rows : []).flatMap((row, index) => uidOf(row) && !uids.has(uidOf(row)) ? [{ index, uid: uidOf(row) }] : []);
|
|
54
|
+
};
|
|
51
55
|
var isOpener2 = (row, g) => Boolean(g) && Object.prototype.hasOwnProperty.call(g, uidOf(row));
|
|
52
56
|
var isClose2 = (row, g) => Boolean(g) && Object.values(g).includes(uidOf(row));
|
|
53
57
|
var blockKey3 = (row) => row && row.id != null ? `${row.__component}#${row.id}` : row && row.__temp_key__ != null ? String(row.__temp_key__) : null;
|
|
@@ -154,6 +158,7 @@ var require_groups = __commonJS({
|
|
|
154
158
|
module2.exports = {
|
|
155
159
|
safeGroups: safeGroups2,
|
|
156
160
|
validateGroups: validateGroups3,
|
|
161
|
+
invalidComponents,
|
|
157
162
|
groupRange: groupRange3,
|
|
158
163
|
groupRows: groupRows2,
|
|
159
164
|
topLevelRanges: topLevelRanges2,
|
|
@@ -255,8 +260,8 @@ var require_diff = __commonJS({
|
|
|
255
260
|
}
|
|
256
261
|
function summarize(before, after, schema) {
|
|
257
262
|
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 };
|
|
263
|
+
const blocks = { total: zones.reduce((n, name) => n + (Array.isArray(after?.[name]) ? after[name].length : 0), 0), added: 0, removed: 0, changed: 0 };
|
|
264
|
+
if (!before) return { initial: true, fields: [], blocks: { ...blocks, added: blocks.total } };
|
|
260
265
|
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after || {})])];
|
|
261
266
|
const fields = names.filter((name) => !zones.includes(name) && !same2(before[name], after?.[name])).sort();
|
|
262
267
|
for (const name of zones) for (const { op } of diffRows2(before[name], after?.[name])) if (op !== "same") blocks[op]++;
|
|
@@ -272,9 +277,9 @@ __export(strapi5_exports, {
|
|
|
272
277
|
default: () => strapi5_default
|
|
273
278
|
});
|
|
274
279
|
module.exports = __toCommonJS(strapi5_exports);
|
|
275
|
-
var
|
|
276
|
-
var
|
|
277
|
-
var
|
|
280
|
+
var React18 = __toESM(require("react"));
|
|
281
|
+
var import_design_system13 = require("@strapi/design-system");
|
|
282
|
+
var import_admin5 = require("@strapi/strapi/admin");
|
|
278
283
|
var import_strapi_admin2 = require("@strapi/content-manager/strapi-admin");
|
|
279
284
|
|
|
280
285
|
// admin/Gallery.tsx
|
|
@@ -325,6 +330,26 @@ function variantRow(schema, components, values, keys = fractional) {
|
|
|
325
330
|
}
|
|
326
331
|
return row;
|
|
327
332
|
}
|
|
333
|
+
function starterKitRows(kit, zones, components, form) {
|
|
334
|
+
const out = {};
|
|
335
|
+
for (const [name, items2] of Object.entries(kit?.zones || {})) {
|
|
336
|
+
const zone = zones.find((entry) => entry.name === name);
|
|
337
|
+
const current = form.rows(name);
|
|
338
|
+
if (!zone || current.length || current.length + items2.length > (zone.max ?? Infinity) || items2.some((item) => !zone.components.includes(item.__component) || !components[item.__component])) return null;
|
|
339
|
+
const keys = form.keys(current, current.length, items2.length);
|
|
340
|
+
out[name] = items2.map((item, index) => ({ ...variantRow(components[item.__component], components, item.values), __component: item.__component, __temp_key__: keys[index] }));
|
|
341
|
+
}
|
|
342
|
+
return out;
|
|
343
|
+
}
|
|
344
|
+
function starterKitsForLocale(kits, locale) {
|
|
345
|
+
if (!Array.isArray(kits)) return [];
|
|
346
|
+
const current = String(locale || "").toLowerCase();
|
|
347
|
+
const language = current.split("-")[0];
|
|
348
|
+
return kits.filter((kit) => !Array.isArray(kit.locales) || kit.locales.some((entry) => {
|
|
349
|
+
const wanted = String(entry).toLowerCase();
|
|
350
|
+
return wanted === current || !wanted.includes("-") && wanted === language;
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
328
353
|
function editableZones(schema, values, canEdit, disabled = false) {
|
|
329
354
|
if (disabled) return [];
|
|
330
355
|
return Object.entries(schema?.attributes || {}).filter(
|
|
@@ -640,6 +665,7 @@ var hoverKey = (key, rows) => key === null ? null : typeof key === "string" && k
|
|
|
640
665
|
function isPreviewMessage(event, origin, source, channel, type) {
|
|
641
666
|
return event.origin === origin && event.source === source && event.data?.protocol === PROTOCOL && event.data?.channel === channel && event.data?.type === type;
|
|
642
667
|
}
|
|
668
|
+
var previewMessageAllowed = (event, origin, source, channel, readOnly) => isPreviewMessage(event, origin, source, channel, event.data?.type) && (!readOnly || event.data?.type === "ready");
|
|
643
669
|
function insertIndex(rows, after) {
|
|
644
670
|
if (after === null || after === void 0) return 0;
|
|
645
671
|
const index = (Array.isArray(rows) ? rows : []).findIndex((row) => blockKey(row) === String(after));
|
|
@@ -894,10 +920,10 @@ var en_default = {
|
|
|
894
920
|
rememberHelp: "Only the explicit open all / close all buttons update the memory, per user and browser. Opening one block does not.",
|
|
895
921
|
previewUrl: "Preview route base URL",
|
|
896
922
|
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).",
|
|
897
|
-
previewUrlEmpty: "No preview URL is set: editors get the Fields +
|
|
923
|
+
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.",
|
|
898
924
|
previewMode: "Initial preview mode",
|
|
899
|
-
"modes.form": "Fields",
|
|
900
|
-
"modes.split": "Fields +
|
|
925
|
+
"modes.form": "Fields only",
|
|
926
|
+
"modes.split": "Fields + preview",
|
|
901
927
|
"modes.preview": "Visual editor",
|
|
902
928
|
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.",
|
|
903
929
|
lazyEdit: "Click to edit",
|
|
@@ -905,8 +931,8 @@ var en_default = {
|
|
|
905
931
|
lazyFields: "Custom fields loaded on demand",
|
|
906
932
|
lazyEditorsHelp: "Listed custom fields show a read-only preview until clicked or focused, so opening large pages stays fast. Separate uids with commas.",
|
|
907
933
|
lazyFieldsInvalid: "Use up to {max} custom field uids such as plugin::ckeditor5.CKEditor or global::my-field.",
|
|
908
|
-
modeForm: "Fields",
|
|
909
|
-
modeSplit: "Fields +
|
|
934
|
+
modeForm: "Fields only",
|
|
935
|
+
modeSplit: "Fields + preview",
|
|
910
936
|
modePreview: "Visual editor",
|
|
911
937
|
previewPane: "Page preview",
|
|
912
938
|
resize: "Resize preview pane",
|
|
@@ -1001,6 +1027,9 @@ var en_default = {
|
|
|
1001
1027
|
unstar: "Remove star",
|
|
1002
1028
|
quickInsert: "Insert {label}",
|
|
1003
1029
|
insert: "Insert",
|
|
1030
|
+
starterKits: "Start with a kit",
|
|
1031
|
+
starterKitsHelp: "Choose a starting structure. Everything is inserted as an unsaved, editable draft.",
|
|
1032
|
+
startBlank: "Start blank",
|
|
1004
1033
|
closeDetail: "Close details",
|
|
1005
1034
|
typology: "Typology",
|
|
1006
1035
|
typologyAuto: "Automatic ({name})",
|
|
@@ -1044,7 +1073,7 @@ var en_default = {
|
|
|
1044
1073
|
blockPreview: "Live block preview",
|
|
1045
1074
|
livePreviewFailed: "Live preview unavailable, showing the image.",
|
|
1046
1075
|
blockPreviewUrl: "Block preview URL",
|
|
1047
|
-
blockPreviewUrlHelp: "Optional. A page of your frontend that renders one block on its own, shown large
|
|
1076
|
+
blockPreviewUrlHelp: "Optional. A page of your frontend that renders one block on its own, shown large from a gallery card's magnifying glass, e.g. http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Placeholders: '{uid}', '{name}' (after the dot), '{category}' (before the dot), '{variant}' (default), '{locale}'. Empty uses the page preview route when there is one, else the image.",
|
|
1048
1077
|
rowActions: "Actions for {label}",
|
|
1049
1078
|
selectBlock: "Select {label}",
|
|
1050
1079
|
hiddenBadge: "Hidden",
|
|
@@ -1257,7 +1286,23 @@ var en_default = {
|
|
|
1257
1286
|
layoutOff: "No grid",
|
|
1258
1287
|
layoutNoMobile: "None",
|
|
1259
1288
|
layoutHelp: "The group's blocks show as a grid in the form, with the column count this block holds.",
|
|
1260
|
-
layoutNoFields: "This block has no field that can hold a column count."
|
|
1289
|
+
layoutNoFields: "This block has no field that can hold a column count.",
|
|
1290
|
+
"toolbar.versions": "Version history",
|
|
1291
|
+
versionsDenied: "Ask an administrator to grant the Blockscene Read version history permission.",
|
|
1292
|
+
versionsDisabled: "History is not enabled for this content type. Ask an administrator to enable it in Settings > Blockscene (settings.history.enabled).",
|
|
1293
|
+
versionsNew: "Save this entry first to start its history.",
|
|
1294
|
+
versionsPerson: "Filter by person",
|
|
1295
|
+
versionsEveryone: "Everyone",
|
|
1296
|
+
versionsCounts: "{total} blocks",
|
|
1297
|
+
versionsCountsMissing: "Block counts unavailable (older or unrecorded event).",
|
|
1298
|
+
versionsPage: "Page {page} of {count}",
|
|
1299
|
+
versionsPrevious: "Previous",
|
|
1300
|
+
versionsNext: "Next",
|
|
1301
|
+
versionsViewing: "Viewing version of {date} by {person} (read-only).",
|
|
1302
|
+
versionsCurrent: "Back to current draft",
|
|
1303
|
+
versionsMissing: "Some blocks, fields, media or relations are no longer available in this preview.",
|
|
1304
|
+
versionsBridgeLegacy: "This preview bridge does not support read-only browsing. Interaction is disabled; update the bridge to support readOnly.",
|
|
1305
|
+
historyExpired: "Snapshot no longer available"
|
|
1261
1306
|
};
|
|
1262
1307
|
|
|
1263
1308
|
// admin/translations/pt-BR.json
|
|
@@ -1315,10 +1360,10 @@ var pt_BR_default = {
|
|
|
1315
1360
|
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.",
|
|
1316
1361
|
previewUrl: "URL base da rota de preview",
|
|
1317
1362
|
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).",
|
|
1318
|
-
previewUrlEmpty: "Nenhuma URL de preview definida: os editores s\xF3 t\xEAm os modos Campos +
|
|
1363
|
+
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.",
|
|
1319
1364
|
previewMode: "Modo inicial da preview",
|
|
1320
|
-
"modes.form": "
|
|
1321
|
-
"modes.split": "Campos +
|
|
1365
|
+
"modes.form": "Somente campos",
|
|
1366
|
+
"modes.split": "Campos + preview",
|
|
1322
1367
|
"modes.preview": "Editor visual",
|
|
1323
1368
|
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.",
|
|
1324
1369
|
lazyEdit: "Clique para editar",
|
|
@@ -1326,8 +1371,8 @@ var pt_BR_default = {
|
|
|
1326
1371
|
lazyFields: "Campos personalizados carregados sob demanda",
|
|
1327
1372
|
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.",
|
|
1328
1373
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1329
|
-
modeForm: "
|
|
1330
|
-
modeSplit: "Campos +
|
|
1374
|
+
modeForm: "Somente campos",
|
|
1375
|
+
modeSplit: "Campos + preview",
|
|
1331
1376
|
modePreview: "Editor visual",
|
|
1332
1377
|
previewPane: "Preview da p\xE1gina",
|
|
1333
1378
|
resize: "Redimensionar painel de preview",
|
|
@@ -1422,6 +1467,9 @@ var pt_BR_default = {
|
|
|
1422
1467
|
unstar: "Remover dos favoritos",
|
|
1423
1468
|
quickInsert: "Inserir {label}",
|
|
1424
1469
|
insert: "Inserir",
|
|
1470
|
+
starterKits: "Come\xE7ar com um kit",
|
|
1471
|
+
starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como rascunho edit\xE1vel e ainda n\xE3o salvo.",
|
|
1472
|
+
startBlank: "Come\xE7ar em branco",
|
|
1425
1473
|
closeDetail: "Fechar detalhes",
|
|
1426
1474
|
typology: "Tipologia",
|
|
1427
1475
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -1465,7 +1513,7 @@ var pt_BR_default = {
|
|
|
1465
1513
|
blockPreview: "Preview ao vivo do bloco",
|
|
1466
1514
|
livePreviewFailed: "Preview ao vivo indispon\xEDvel, mostrando a imagem.",
|
|
1467
1515
|
blockPreviewUrl: "URL de preview do bloco",
|
|
1468
|
-
blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco sozinho, mostrada em tamanho grande
|
|
1516
|
+
blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco sozinho, mostrada em tamanho grande pela lupa do card da galeria, por exemplo http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de preview de p\xE1gina quando existir, sen\xE3o a imagem.",
|
|
1469
1517
|
rowActions: "A\xE7\xF5es de {label}",
|
|
1470
1518
|
selectBlock: "Selecionar {label}",
|
|
1471
1519
|
hiddenBadge: "Oculto",
|
|
@@ -1678,7 +1726,23 @@ var pt_BR_default = {
|
|
|
1678
1726
|
layoutOff: "Sem grade",
|
|
1679
1727
|
layoutNoMobile: "Nenhum",
|
|
1680
1728
|
layoutHelp: "Os blocos do grupo aparecem em grade no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
1681
|
-
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
|
|
1729
|
+
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
|
|
1730
|
+
"toolbar.versions": "Hist\xF3rico de vers\xF5es",
|
|
1731
|
+
versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
|
|
1732
|
+
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).",
|
|
1733
|
+
versionsNew: "Salve este conte\xFAdo primeiro para iniciar seu hist\xF3rico.",
|
|
1734
|
+
versionsPerson: "Filtrar por pessoa",
|
|
1735
|
+
versionsEveryone: "Todas as pessoas",
|
|
1736
|
+
versionsCounts: "{total} blocos",
|
|
1737
|
+
versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registrado).",
|
|
1738
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
1739
|
+
versionsPrevious: "Anterior",
|
|
1740
|
+
versionsNext: "Pr\xF3xima",
|
|
1741
|
+
versionsViewing: "Vendo vers\xE3o de {date} por {person} (somente leitura).",
|
|
1742
|
+
versionsCurrent: "Voltar ao rascunho atual",
|
|
1743
|
+
versionsMissing: "Alguns blocos, campos, m\xEDdias ou rela\xE7\xF5es n\xE3o est\xE3o mais dispon\xEDveis nesta preview.",
|
|
1744
|
+
versionsBridgeLegacy: "Esta bridge n\xE3o suporta navega\xE7\xE3o somente leitura. A intera\xE7\xE3o est\xE1 desativada; atualize a bridge para suportar readOnly.",
|
|
1745
|
+
historyExpired: "Snapshot n\xE3o est\xE1 mais dispon\xEDvel"
|
|
1682
1746
|
};
|
|
1683
1747
|
|
|
1684
1748
|
// admin/translations/pt.json
|
|
@@ -1736,10 +1800,10 @@ var pt_default = {
|
|
|
1736
1800
|
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.",
|
|
1737
1801
|
previewUrl: "URL base da rota de pr\xE9-visualiza\xE7\xE3o",
|
|
1738
1802
|
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).",
|
|
1739
|
-
previewUrlEmpty: "Nenhum URL de pr\xE9-visualiza\xE7\xE3o definido: os editores s\xF3 t\xEAm os modos Campos +
|
|
1803
|
+
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.",
|
|
1740
1804
|
previewMode: "Modo inicial da pr\xE9-visualiza\xE7\xE3o",
|
|
1741
|
-
"modes.form": "
|
|
1742
|
-
"modes.split": "Campos +
|
|
1805
|
+
"modes.form": "Apenas campos",
|
|
1806
|
+
"modes.split": "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1743
1807
|
"modes.preview": "Editor visual",
|
|
1744
1808
|
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.",
|
|
1745
1809
|
lazyEdit: "Clique para editar",
|
|
@@ -1747,8 +1811,8 @@ var pt_default = {
|
|
|
1747
1811
|
lazyFields: "Campos personalizados carregados a pedido",
|
|
1748
1812
|
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.",
|
|
1749
1813
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1750
|
-
modeForm: "
|
|
1751
|
-
modeSplit: "Campos +
|
|
1814
|
+
modeForm: "Apenas campos",
|
|
1815
|
+
modeSplit: "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1752
1816
|
modePreview: "Editor visual",
|
|
1753
1817
|
previewPane: "Pr\xE9-visualiza\xE7\xE3o da p\xE1gina",
|
|
1754
1818
|
resize: "Redimensionar painel de pr\xE9-visualiza\xE7\xE3o",
|
|
@@ -1843,6 +1907,9 @@ var pt_default = {
|
|
|
1843
1907
|
unstar: "Remover dos favoritos",
|
|
1844
1908
|
quickInsert: "Inserir {label}",
|
|
1845
1909
|
insert: "Inserir",
|
|
1910
|
+
starterKits: "Come\xE7ar com um kit",
|
|
1911
|
+
starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como um rascunho edit\xE1vel e ainda n\xE3o guardado.",
|
|
1912
|
+
startBlank: "Come\xE7ar em branco",
|
|
1846
1913
|
closeDetail: "Fechar detalhes",
|
|
1847
1914
|
typology: "Tipologia",
|
|
1848
1915
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -1886,7 +1953,7 @@ var pt_default = {
|
|
|
1886
1953
|
blockPreview: "Pr\xE9-visualiza\xE7\xE3o ao vivo do bloco",
|
|
1887
1954
|
livePreviewFailed: "Pr\xE9-visualiza\xE7\xE3o ao vivo indispon\xEDvel, a mostrar a imagem.",
|
|
1888
1955
|
blockPreviewUrl: "URL de pr\xE9-visualiza\xE7\xE3o do bloco",
|
|
1889
|
-
blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco isolado, mostrada em grande
|
|
1956
|
+
blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco isolado, mostrada em grande pela lupa do cart\xE3o da galeria, por exemplo http://localhost:3026/pt-PT/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de pr\xE9-visualiza\xE7\xE3o de p\xE1gina quando existir, caso contr\xE1rio a imagem.",
|
|
1890
1957
|
rowActions: "A\xE7\xF5es de {label}",
|
|
1891
1958
|
selectBlock: "Selecionar {label}",
|
|
1892
1959
|
hiddenBadge: "Oculto",
|
|
@@ -2099,7 +2166,23 @@ var pt_default = {
|
|
|
2099
2166
|
layoutOff: "Sem grelha",
|
|
2100
2167
|
layoutNoMobile: "Nenhum",
|
|
2101
2168
|
layoutHelp: "Os blocos do grupo aparecem em grelha no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
2102
|
-
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
|
|
2169
|
+
layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
|
|
2170
|
+
"toolbar.versions": "Hist\xF3rico de vers\xF5es",
|
|
2171
|
+
versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
|
|
2172
|
+
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).",
|
|
2173
|
+
versionsNew: "Guarde este conte\xFAdo primeiro para iniciar o hist\xF3rico.",
|
|
2174
|
+
versionsPerson: "Filtrar por pessoa",
|
|
2175
|
+
versionsEveryone: "Todas as pessoas",
|
|
2176
|
+
versionsCounts: "{total} blocos",
|
|
2177
|
+
versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registado).",
|
|
2178
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
2179
|
+
versionsPrevious: "Anterior",
|
|
2180
|
+
versionsNext: "Seguinte",
|
|
2181
|
+
versionsViewing: "A ver a vers\xE3o de {date} por {person} (s\xF3 de leitura).",
|
|
2182
|
+
versionsCurrent: "Voltar ao rascunho atual",
|
|
2183
|
+
versionsMissing: "Alguns blocos, campos, ficheiros ou rela\xE7\xF5es j\xE1 n\xE3o est\xE3o dispon\xEDveis nesta pr\xE9via.",
|
|
2184
|
+
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.",
|
|
2185
|
+
historyExpired: "Snapshot j\xE1 n\xE3o est\xE1 dispon\xEDvel"
|
|
2103
2186
|
};
|
|
2104
2187
|
|
|
2105
2188
|
// admin/translations/fr.json
|
|
@@ -2157,10 +2240,10 @@ var fr_default = {
|
|
|
2157
2240
|
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.",
|
|
2158
2241
|
previewUrl: "URL de base de la route d'aper\xE7u",
|
|
2159
2242
|
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).",
|
|
2160
|
-
previewUrlEmpty: "Aucune URL d'aper\xE7u : les \xE9diteurs n'ont les modes Champs +
|
|
2243
|
+
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.",
|
|
2161
2244
|
previewMode: "Mode d'aper\xE7u initial",
|
|
2162
|
-
"modes.form": "Champs",
|
|
2163
|
-
"modes.split": "Champs +
|
|
2245
|
+
"modes.form": "Champs uniquement",
|
|
2246
|
+
"modes.split": "Champs + aper\xE7u",
|
|
2164
2247
|
"modes.preview": "\xC9diteur visuel",
|
|
2165
2248
|
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.",
|
|
2166
2249
|
lazyEdit: "Cliquer pour modifier",
|
|
@@ -2168,8 +2251,8 @@ var fr_default = {
|
|
|
2168
2251
|
lazyFields: "Champs personnalis\xE9s charg\xE9s \xE0 la demande",
|
|
2169
2252
|
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.",
|
|
2170
2253
|
lazyFieldsInvalid: "Utilisez jusqu'\xE0 {max} uids de champs personnalis\xE9s, comme plugin::ckeditor5.CKEditor ou global::mon-champ.",
|
|
2171
|
-
modeForm: "Champs",
|
|
2172
|
-
modeSplit: "Champs +
|
|
2254
|
+
modeForm: "Champs uniquement",
|
|
2255
|
+
modeSplit: "Champs + aper\xE7u",
|
|
2173
2256
|
modePreview: "\xC9diteur visuel",
|
|
2174
2257
|
previewPane: "Aper\xE7u de la page",
|
|
2175
2258
|
resize: "Redimensionner le panneau d'aper\xE7u",
|
|
@@ -2264,6 +2347,9 @@ var fr_default = {
|
|
|
2264
2347
|
unstar: "Retirer des favoris",
|
|
2265
2348
|
quickInsert: "Ins\xE9rer {label}",
|
|
2266
2349
|
insert: "Ins\xE9rer",
|
|
2350
|
+
starterKits: "D\xE9marrer avec un kit",
|
|
2351
|
+
starterKitsHelp: "Choisissez une structure de d\xE9part. Tout est ins\xE9r\xE9 comme brouillon modifiable et non enregistr\xE9.",
|
|
2352
|
+
startBlank: "Commencer vide",
|
|
2267
2353
|
closeDetail: "Fermer les d\xE9tails",
|
|
2268
2354
|
typology: "Typologie",
|
|
2269
2355
|
typologyAuto: "Automatique ({name})",
|
|
@@ -2307,7 +2393,7 @@ var fr_default = {
|
|
|
2307
2393
|
blockPreview: "Aper\xE7u en direct du bloc",
|
|
2308
2394
|
livePreviewFailed: "Aper\xE7u en direct indisponible, l'image est affich\xE9e.",
|
|
2309
2395
|
blockPreviewUrl: "URL d'aper\xE7u de bloc",
|
|
2310
|
-
blockPreviewUrlHelp: "Facultatif. Une page de votre frontend qui affiche un seul bloc, montr\xE9e en grand
|
|
2396
|
+
blockPreviewUrlHelp: "Facultatif. Une page de votre frontend qui affiche un seul bloc, montr\xE9e en grand depuis la loupe d'une carte de la galerie, par ex. http://localhost:3026/fr/block-preview/'{name}'/'{variant}'. Variables : '{uid}', '{name}' (apr\xE8s le point), '{category}' (avant le point), '{variant}' (default), '{locale}'. Vide : la route d'aper\xE7u de page si elle existe, sinon l'image.",
|
|
2311
2397
|
rowActions: "Actions pour {label}",
|
|
2312
2398
|
selectBlock: "S\xE9lectionner {label}",
|
|
2313
2399
|
hiddenBadge: "Masqu\xE9",
|
|
@@ -2520,7 +2606,23 @@ var fr_default = {
|
|
|
2520
2606
|
layoutOff: "Pas de grille",
|
|
2521
2607
|
layoutNoMobile: "Aucun",
|
|
2522
2608
|
layoutHelp: "Les blocs du groupe s'affichent en grille dans le formulaire, avec le nombre de colonnes de ce bloc.",
|
|
2523
|
-
layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes."
|
|
2609
|
+
layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes.",
|
|
2610
|
+
"toolbar.versions": "Historique des versions",
|
|
2611
|
+
versionsDenied: "Demandez \xE0 un administrateur la permission Lire l\u2019historique des versions de Blockscene.",
|
|
2612
|
+
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).",
|
|
2613
|
+
versionsNew: "Enregistrez d\u2019abord ce contenu pour commencer son historique.",
|
|
2614
|
+
versionsPerson: "Filtrer par personne",
|
|
2615
|
+
versionsEveryone: "Tout le monde",
|
|
2616
|
+
versionsCounts: "{total} blocs",
|
|
2617
|
+
versionsCountsMissing: "Nombre de blocs indisponible (\xE9v\xE9nement ancien ou non enregistr\xE9).",
|
|
2618
|
+
versionsPage: "Page {page} sur {count}",
|
|
2619
|
+
versionsPrevious: "Pr\xE9c\xE9dente",
|
|
2620
|
+
versionsNext: "Suivante",
|
|
2621
|
+
versionsViewing: "Version du {date} par {person} (lecture seule).",
|
|
2622
|
+
versionsCurrent: "Revenir au brouillon actuel",
|
|
2623
|
+
versionsMissing: "Certains blocs, champs, m\xE9dias ou relations ne sont plus disponibles dans cet aper\xE7u.",
|
|
2624
|
+
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.",
|
|
2625
|
+
historyExpired: "Snapshot indisponible"
|
|
2524
2626
|
};
|
|
2525
2627
|
|
|
2526
2628
|
// admin/translations/es.json
|
|
@@ -2578,10 +2680,10 @@ var es_default = {
|
|
|
2578
2680
|
rememberHelp: "Solo los botones expl\xEDcitos de abrir/cerrar todos actualizan la memoria, por usuario y navegador. Abrir un solo bloque no la cambia.",
|
|
2579
2681
|
previewUrl: "URL base de la ruta de vista previa",
|
|
2580
2682
|
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).",
|
|
2581
|
-
previewUrlEmpty: "No hay URL de vista previa: los editores solo tienen los modos Campos +
|
|
2683
|
+
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.",
|
|
2582
2684
|
previewMode: "Modo inicial de la vista previa",
|
|
2583
|
-
"modes.form": "
|
|
2584
|
-
"modes.split": "Campos +
|
|
2685
|
+
"modes.form": "Solo campos",
|
|
2686
|
+
"modes.split": "Campos + vista previa",
|
|
2585
2687
|
"modes.preview": "Editor visual",
|
|
2586
2688
|
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.",
|
|
2587
2689
|
lazyEdit: "Haz clic para editar",
|
|
@@ -2589,8 +2691,8 @@ var es_default = {
|
|
|
2589
2691
|
lazyFields: "Campos personalizados cargados bajo demanda",
|
|
2590
2692
|
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.",
|
|
2591
2693
|
lazyFieldsInvalid: "Usa hasta {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor o global::mi-campo.",
|
|
2592
|
-
modeForm: "
|
|
2593
|
-
modeSplit: "Campos +
|
|
2694
|
+
modeForm: "Solo campos",
|
|
2695
|
+
modeSplit: "Campos + vista previa",
|
|
2594
2696
|
modePreview: "Editor visual",
|
|
2595
2697
|
previewPane: "Vista previa de la p\xE1gina",
|
|
2596
2698
|
resize: "Redimensionar el panel de vista previa",
|
|
@@ -2685,6 +2787,9 @@ var es_default = {
|
|
|
2685
2787
|
unstar: "Quitar de favoritos",
|
|
2686
2788
|
quickInsert: "Insertar {label}",
|
|
2687
2789
|
insert: "Insertar",
|
|
2790
|
+
starterKits: "Comenzar con un kit",
|
|
2791
|
+
starterKitsHelp: "Elige una estructura inicial. Todo se inserta como un borrador editable y sin guardar.",
|
|
2792
|
+
startBlank: "Comenzar en blanco",
|
|
2688
2793
|
closeDetail: "Cerrar detalles",
|
|
2689
2794
|
typology: "Tipolog\xEDa",
|
|
2690
2795
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -2728,7 +2833,7 @@ var es_default = {
|
|
|
2728
2833
|
blockPreview: "Vista previa en vivo del bloque",
|
|
2729
2834
|
livePreviewFailed: "Vista previa en vivo no disponible, se muestra la imagen.",
|
|
2730
2835
|
blockPreviewUrl: "URL de vista previa del bloque",
|
|
2731
|
-
blockPreviewUrlHelp: "Opcional. Una p\xE1gina de su frontend que renderiza un solo bloque, mostrada en grande
|
|
2836
|
+
blockPreviewUrlHelp: "Opcional. Una p\xE1gina de su frontend que renderiza un solo bloque, mostrada en grande desde la lupa de una tarjeta de la galer\xEDa, p. ej. http://localhost:3026/es/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (tras el punto), '{category}' (antes del punto), '{variant}' (default), '{locale}'. Vac\xEDa usa la ruta de vista previa de p\xE1gina si existe; si no, la imagen.",
|
|
2732
2837
|
rowActions: "Acciones de {label}",
|
|
2733
2838
|
selectBlock: "Seleccionar {label}",
|
|
2734
2839
|
hiddenBadge: "Oculto",
|
|
@@ -2941,7 +3046,23 @@ var es_default = {
|
|
|
2941
3046
|
layoutOff: "Sin cuadr\xEDcula",
|
|
2942
3047
|
layoutNoMobile: "Ninguno",
|
|
2943
3048
|
layoutHelp: "Los bloques del grupo se muestran en cuadr\xEDcula en el formulario, con el n\xFAmero de columnas de este bloque.",
|
|
2944
|
-
layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas."
|
|
3049
|
+
layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas.",
|
|
3050
|
+
"toolbar.versions": "Historial de versiones",
|
|
3051
|
+
versionsDenied: "Pide a un administrador el permiso Leer historial de versiones de Blockscene.",
|
|
3052
|
+
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).",
|
|
3053
|
+
versionsNew: "Guarda primero este contenido para iniciar su historial.",
|
|
3054
|
+
versionsPerson: "Filtrar por persona",
|
|
3055
|
+
versionsEveryone: "Todas las personas",
|
|
3056
|
+
versionsCounts: "{total} bloques",
|
|
3057
|
+
versionsCountsMissing: "Recuento de bloques no disponible (evento antiguo o no registrado).",
|
|
3058
|
+
versionsPage: "P\xE1gina {page} de {count}",
|
|
3059
|
+
versionsPrevious: "Anterior",
|
|
3060
|
+
versionsNext: "Siguiente",
|
|
3061
|
+
versionsViewing: "Viendo la versi\xF3n del {date} por {person} (solo lectura).",
|
|
3062
|
+
versionsCurrent: "Volver al borrador actual",
|
|
3063
|
+
versionsMissing: "Algunos bloques, campos, archivos o relaciones ya no est\xE1n disponibles en esta vista previa.",
|
|
3064
|
+
versionsBridgeLegacy: "Esta bridge no admite navegaci\xF3n de solo lectura. La interacci\xF3n est\xE1 desactivada; actualiza la bridge para admitir readOnly.",
|
|
3065
|
+
historyExpired: "Snapshot ya no disponible"
|
|
2945
3066
|
};
|
|
2946
3067
|
|
|
2947
3068
|
// admin/translations/de.json
|
|
@@ -2999,10 +3120,10 @@ var de_default = {
|
|
|
2999
3120
|
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.",
|
|
3000
3121
|
previewUrl: "Basis-URL der Vorschauroute",
|
|
3001
3122
|
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).",
|
|
3002
|
-
previewUrlEmpty: "Keine Vorschau-URL gesetzt: Redakteure erhalten die Modi Felder +
|
|
3123
|
+
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.",
|
|
3003
3124
|
previewMode: "Anf\xE4nglicher Vorschaumodus",
|
|
3004
|
-
"modes.form": "Felder",
|
|
3005
|
-
"modes.split": "Felder +
|
|
3125
|
+
"modes.form": "Nur Felder",
|
|
3126
|
+
"modes.split": "Felder + Vorschau",
|
|
3006
3127
|
"modes.preview": "Visueller Editor",
|
|
3007
3128
|
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.",
|
|
3008
3129
|
lazyEdit: "Zum Bearbeiten klicken",
|
|
@@ -3010,8 +3131,8 @@ var de_default = {
|
|
|
3010
3131
|
lazyFields: "Bei Bedarf geladene benutzerdefinierte Felder",
|
|
3011
3132
|
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.",
|
|
3012
3133
|
lazyFieldsInvalid: "Bis zu {max} Uids benutzerdefinierter Felder verwenden, z. B. plugin::ckeditor5.CKEditor oder global::mein-feld.",
|
|
3013
|
-
modeForm: "Felder",
|
|
3014
|
-
modeSplit: "Felder +
|
|
3134
|
+
modeForm: "Nur Felder",
|
|
3135
|
+
modeSplit: "Felder + Vorschau",
|
|
3015
3136
|
modePreview: "Visueller Editor",
|
|
3016
3137
|
previewPane: "Seitenvorschau",
|
|
3017
3138
|
resize: "Vorschaubereich anpassen",
|
|
@@ -3106,6 +3227,9 @@ var de_default = {
|
|
|
3106
3227
|
unstar: "Aus Favoriten entfernen",
|
|
3107
3228
|
quickInsert: "{label} einf\xFCgen",
|
|
3108
3229
|
insert: "Einf\xFCgen",
|
|
3230
|
+
starterKits: "Mit einem Kit starten",
|
|
3231
|
+
starterKitsHelp: "W\xE4hlen Sie eine Ausgangsstruktur. Alles wird als ungespeicherter, bearbeitbarer Entwurf eingef\xFCgt.",
|
|
3232
|
+
startBlank: "Leer beginnen",
|
|
3109
3233
|
closeDetail: "Details schlie\xDFen",
|
|
3110
3234
|
typology: "Typologie",
|
|
3111
3235
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -3149,7 +3273,7 @@ var de_default = {
|
|
|
3149
3273
|
blockPreview: "Live-Vorschau des Blocks",
|
|
3150
3274
|
livePreviewFailed: "Live-Vorschau nicht verf\xFCgbar, das Bild wird angezeigt.",
|
|
3151
3275
|
blockPreviewUrl: "Block-Vorschau-URL",
|
|
3152
|
-
blockPreviewUrlHelp: "Optional. Eine Seite Ihres Frontends, die einen einzelnen Block rendert und
|
|
3276
|
+
blockPreviewUrlHelp: "Optional. Eine Seite Ihres Frontends, die einen einzelnen Block rendert und \xFCber die Lupe einer Galeriekarte gro\xDF angezeigt wird, z. B. http://localhost:3026/de/block-preview/'{name}'/'{variant}'. Platzhalter: '{uid}', '{name}' (nach dem Punkt), '{category}' (vor dem Punkt), '{variant}' (default), '{locale}'. Leer verwendet die Seitenvorschau-Route, falls vorhanden, sonst das Bild.",
|
|
3153
3277
|
rowActions: "Aktionen f\xFCr {label}",
|
|
3154
3278
|
selectBlock: "{label} ausw\xE4hlen",
|
|
3155
3279
|
hiddenBadge: "Ausgeblendet",
|
|
@@ -3362,7 +3486,23 @@ var de_default = {
|
|
|
3362
3486
|
layoutOff: "Kein Raster",
|
|
3363
3487
|
layoutNoMobile: "Keines",
|
|
3364
3488
|
layoutHelp: "Die Bl\xF6cke der Gruppe erscheinen im Formular als Raster, mit der Spaltenzahl dieses Blocks.",
|
|
3365
|
-
layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann."
|
|
3489
|
+
layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann.",
|
|
3490
|
+
"toolbar.versions": "Versionsverlauf",
|
|
3491
|
+
versionsDenied: "Bitte einen Administrator um die Blockscene-Berechtigung zum Lesen des Versionsverlaufs.",
|
|
3492
|
+
versionsDisabled: "Der Verlauf ist f\xFCr diesen Inhaltstyp nicht aktiviert. Bitte einen Administrator, ihn unter Settings > Blockscene zu aktivieren (settings.history.enabled).",
|
|
3493
|
+
versionsNew: "Speichere diesen Eintrag zuerst, um seinen Verlauf zu beginnen.",
|
|
3494
|
+
versionsPerson: "Nach Person filtern",
|
|
3495
|
+
versionsEveryone: "Alle Personen",
|
|
3496
|
+
versionsCounts: "{total} Bl\xF6cke",
|
|
3497
|
+
versionsCountsMissing: "Blockanzahl nicht verf\xFCgbar (\xE4lteres oder nicht aufgezeichnetes Ereignis).",
|
|
3498
|
+
versionsPage: "Seite {page} von {count}",
|
|
3499
|
+
versionsPrevious: "Zur\xFCck",
|
|
3500
|
+
versionsNext: "Weiter",
|
|
3501
|
+
versionsViewing: "Version vom {date} von {person} (schreibgesch\xFCtzt).",
|
|
3502
|
+
versionsCurrent: "Zur\xFCck zum aktuellen Entwurf",
|
|
3503
|
+
versionsMissing: "Einige Bl\xF6cke, Felder, Medien oder Beziehungen sind in dieser Vorschau nicht mehr verf\xFCgbar.",
|
|
3504
|
+
versionsBridgeLegacy: "Diese Bridge unterst\xFCtzt keine schreibgesch\xFCtzte Navigation. Interaktion ist deaktiviert; aktualisiere die Bridge f\xFCr readOnly.",
|
|
3505
|
+
historyExpired: "Snapshot nicht mehr verf\xFCgbar"
|
|
3366
3506
|
};
|
|
3367
3507
|
|
|
3368
3508
|
// admin/translations/it.json
|
|
@@ -3420,10 +3560,10 @@ var it_default = {
|
|
|
3420
3560
|
rememberHelp: "Solo i pulsanti espliciti apri tutti / chiudi tutti aggiornano la memoria, per utente e browser. Aprire un singolo blocco non la cambia.",
|
|
3421
3561
|
previewUrl: "URL di base della route di anteprima",
|
|
3422
3562
|
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).",
|
|
3423
|
-
previewUrlEmpty: "Nessun URL di anteprima impostato: gli editor hanno le modalit\xE0 Campi +
|
|
3563
|
+
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.",
|
|
3424
3564
|
previewMode: "Modalit\xE0 iniziale dell'anteprima",
|
|
3425
|
-
"modes.form": "
|
|
3426
|
-
"modes.split": "Campi +
|
|
3565
|
+
"modes.form": "Solo campi",
|
|
3566
|
+
"modes.split": "Campi + anteprima",
|
|
3427
3567
|
"modes.preview": "Editor visivo",
|
|
3428
3568
|
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.",
|
|
3429
3569
|
lazyEdit: "Fai clic per modificare",
|
|
@@ -3431,8 +3571,8 @@ var it_default = {
|
|
|
3431
3571
|
lazyFields: "Campi personalizzati caricati su richiesta",
|
|
3432
3572
|
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.",
|
|
3433
3573
|
lazyFieldsInvalid: "Usa fino a {max} uid di campi personalizzati, come plugin::ckeditor5.CKEditor o global::mio-campo.",
|
|
3434
|
-
modeForm: "
|
|
3435
|
-
modeSplit: "Campi +
|
|
3574
|
+
modeForm: "Solo campi",
|
|
3575
|
+
modeSplit: "Campi + anteprima",
|
|
3436
3576
|
modePreview: "Editor visivo",
|
|
3437
3577
|
previewPane: "Anteprima della pagina",
|
|
3438
3578
|
resize: "Ridimensiona il pannello di anteprima",
|
|
@@ -3527,6 +3667,9 @@ var it_default = {
|
|
|
3527
3667
|
unstar: "Rimuovi dai preferiti",
|
|
3528
3668
|
quickInsert: "Inserisci {label}",
|
|
3529
3669
|
insert: "Inserisci",
|
|
3670
|
+
starterKits: "Inizia con un kit",
|
|
3671
|
+
starterKitsHelp: "Scegli una struttura iniziale. Tutto viene inserito come bozza modificabile e non salvata.",
|
|
3672
|
+
startBlank: "Inizia da zero",
|
|
3530
3673
|
closeDetail: "Chiudi dettagli",
|
|
3531
3674
|
typology: "Tipologia",
|
|
3532
3675
|
typologyAuto: "Automatica ({name})",
|
|
@@ -3570,7 +3713,7 @@ var it_default = {
|
|
|
3570
3713
|
blockPreview: "Anteprima dal vivo del blocco",
|
|
3571
3714
|
livePreviewFailed: "Anteprima dal vivo non disponibile, viene mostrata l'immagine.",
|
|
3572
3715
|
blockPreviewUrl: "URL di anteprima del blocco",
|
|
3573
|
-
blockPreviewUrlHelp: "Facoltativo. Una pagina del tuo frontend che renderizza un singolo blocco, mostrata in grande
|
|
3716
|
+
blockPreviewUrlHelp: "Facoltativo. Una pagina del tuo frontend che renderizza un singolo blocco, mostrata in grande dalla lente di ingrandimento di una scheda della galleria, ad es. http://localhost:3026/it/block-preview/'{name}'/'{variant}'. Segnaposto: '{uid}', '{name}' (dopo il punto), '{category}' (prima del punto), '{variant}' (default), '{locale}'. Vuoto usa la route di anteprima pagina se esiste, altrimenti l'immagine.",
|
|
3574
3717
|
rowActions: "Azioni per {label}",
|
|
3575
3718
|
selectBlock: "Seleziona {label}",
|
|
3576
3719
|
hiddenBadge: "Nascosto",
|
|
@@ -3783,7 +3926,23 @@ var it_default = {
|
|
|
3783
3926
|
layoutOff: "Nessuna griglia",
|
|
3784
3927
|
layoutNoMobile: "Nessuno",
|
|
3785
3928
|
layoutHelp: "I blocchi del gruppo appaiono in griglia nel modulo, con il numero di colonne di questo blocco.",
|
|
3786
|
-
layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne."
|
|
3929
|
+
layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne.",
|
|
3930
|
+
"toolbar.versions": "Cronologia delle versioni",
|
|
3931
|
+
versionsDenied: "Chiedi a un amministratore il permesso Leggere la cronologia delle versioni di Blockscene.",
|
|
3932
|
+
versionsDisabled: "La cronologia non \xE8 attiva per questo tipo di contenuto. Chiedi a un amministratore di attivarla in Settings > Blockscene (settings.history.enabled).",
|
|
3933
|
+
versionsNew: "Salva prima questo contenuto per avviare la cronologia.",
|
|
3934
|
+
versionsPerson: "Filtra per persona",
|
|
3935
|
+
versionsEveryone: "Tutte le persone",
|
|
3936
|
+
versionsCounts: "{total} blocchi",
|
|
3937
|
+
versionsCountsMissing: "Conteggio dei blocchi non disponibile (evento vecchio o non registrato).",
|
|
3938
|
+
versionsPage: "Pagina {page} di {count}",
|
|
3939
|
+
versionsPrevious: "Precedente",
|
|
3940
|
+
versionsNext: "Successiva",
|
|
3941
|
+
versionsViewing: "Versione del {date} di {person} (sola lettura).",
|
|
3942
|
+
versionsCurrent: "Torna alla bozza attuale",
|
|
3943
|
+
versionsMissing: "Alcuni blocchi, campi, media o relazioni non sono pi\xF9 disponibili in questa anteprima.",
|
|
3944
|
+
versionsBridgeLegacy: "Questa bridge non supporta la navigazione in sola lettura. Interazione disattivata; aggiorna la bridge per supportare readOnly.",
|
|
3945
|
+
historyExpired: "Snapshot non pi\xF9 disponibile"
|
|
3787
3946
|
};
|
|
3788
3947
|
|
|
3789
3948
|
// admin/translations/nl.json
|
|
@@ -3841,10 +4000,10 @@ var nl_default = {
|
|
|
3841
4000
|
rememberHelp: "Alleen de expliciete knoppen alles openen / alles sluiten werken het geheugen bij, per gebruiker en browser. E\xE9n blok openen verandert niets.",
|
|
3842
4001
|
previewUrl: "Basis-URL van de voorbeeldroute",
|
|
3843
4002
|
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).",
|
|
3844
|
-
previewUrlEmpty: "Geen preview-URL ingesteld: redacteuren krijgen de modi Velden +
|
|
4003
|
+
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.",
|
|
3845
4004
|
previewMode: "Beginmodus van het voorbeeld",
|
|
3846
|
-
"modes.form": "
|
|
3847
|
-
"modes.split": "Velden +
|
|
4005
|
+
"modes.form": "Alleen velden",
|
|
4006
|
+
"modes.split": "Velden + voorbeeld",
|
|
3848
4007
|
"modes.preview": "Visuele editor",
|
|
3849
4008
|
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.",
|
|
3850
4009
|
lazyEdit: "Klik om te bewerken",
|
|
@@ -3852,8 +4011,8 @@ var nl_default = {
|
|
|
3852
4011
|
lazyFields: "Aangepaste velden die op aanvraag laden",
|
|
3853
4012
|
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.",
|
|
3854
4013
|
lazyFieldsInvalid: "Gebruik maximaal {max} uids van aangepaste velden, zoals plugin::ckeditor5.CKEditor of global::mijn-veld.",
|
|
3855
|
-
modeForm: "
|
|
3856
|
-
modeSplit: "Velden +
|
|
4014
|
+
modeForm: "Alleen velden",
|
|
4015
|
+
modeSplit: "Velden + voorbeeld",
|
|
3857
4016
|
modePreview: "Visuele editor",
|
|
3858
4017
|
previewPane: "Paginavoorbeeld",
|
|
3859
4018
|
resize: "Voorbeeldpaneel aanpassen",
|
|
@@ -3948,6 +4107,9 @@ var nl_default = {
|
|
|
3948
4107
|
unstar: "Uit favorieten verwijderen",
|
|
3949
4108
|
quickInsert: "{label} invoegen",
|
|
3950
4109
|
insert: "Invoegen",
|
|
4110
|
+
starterKits: "Start met een kit",
|
|
4111
|
+
starterKitsHelp: "Kies een beginstructuur. Alles wordt ingevoegd als een onopgeslagen, bewerkbaar concept.",
|
|
4112
|
+
startBlank: "Leeg beginnen",
|
|
3951
4113
|
closeDetail: "Details sluiten",
|
|
3952
4114
|
typology: "Typologie",
|
|
3953
4115
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -3991,7 +4153,7 @@ var nl_default = {
|
|
|
3991
4153
|
blockPreview: "Livevoorbeeld van het blok",
|
|
3992
4154
|
livePreviewFailed: "Livevoorbeeld niet beschikbaar, de afbeelding wordt getoond.",
|
|
3993
4155
|
blockPreviewUrl: "URL van blokvoorbeeld",
|
|
3994
|
-
blockPreviewUrlHelp: "Optioneel. Een pagina van uw frontend die \xE9\xE9n blok rendert, groot getoond
|
|
4156
|
+
blockPreviewUrlHelp: "Optioneel. Een pagina van uw frontend die \xE9\xE9n blok rendert, groot getoond via het vergrootglas van een galerijkaart, bijv. http://localhost:3026/nl/block-preview/'{name}'/'{variant}'. Plaatshouders: '{uid}', '{name}' (na de punt), '{category}' (voor de punt), '{variant}' (default), '{locale}'. Leeg gebruikt de paginavoorbeeldroute als die er is, anders de afbeelding.",
|
|
3995
4157
|
rowActions: "Acties voor {label}",
|
|
3996
4158
|
selectBlock: "{label} selecteren",
|
|
3997
4159
|
hiddenBadge: "Verborgen",
|
|
@@ -4204,7 +4366,23 @@ var nl_default = {
|
|
|
4204
4366
|
layoutOff: "Geen raster",
|
|
4205
4367
|
layoutNoMobile: "Geen",
|
|
4206
4368
|
layoutHelp: "De blokken van de groep verschijnen als raster in het formulier, met het aantal kolommen van dit blok.",
|
|
4207
|
-
layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten."
|
|
4369
|
+
layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten.",
|
|
4370
|
+
"toolbar.versions": "Versiegeschiedenis",
|
|
4371
|
+
versionsDenied: "Vraag een beheerder om de Blockscene-machtiging Versiegeschiedenis lezen.",
|
|
4372
|
+
versionsDisabled: "Geschiedenis is niet ingeschakeld voor dit inhoudstype. Vraag een beheerder dit in Settings > Blockscene in te schakelen (settings.history.enabled).",
|
|
4373
|
+
versionsNew: "Sla dit item eerst op om de geschiedenis te starten.",
|
|
4374
|
+
versionsPerson: "Filter op persoon",
|
|
4375
|
+
versionsEveryone: "Iedereen",
|
|
4376
|
+
versionsCounts: "{total} blokken",
|
|
4377
|
+
versionsCountsMissing: "Aantal blokken niet beschikbaar (oudere of niet vastgelegde gebeurtenis).",
|
|
4378
|
+
versionsPage: "Pagina {page} van {count}",
|
|
4379
|
+
versionsPrevious: "Vorige",
|
|
4380
|
+
versionsNext: "Volgende",
|
|
4381
|
+
versionsViewing: "Versie van {date} door {person} bekijken (alleen-lezen).",
|
|
4382
|
+
versionsCurrent: "Terug naar huidig concept",
|
|
4383
|
+
versionsMissing: "Sommige blokken, velden, media of relaties zijn niet meer beschikbaar in dit voorbeeld.",
|
|
4384
|
+
versionsBridgeLegacy: "Deze bridge ondersteunt geen alleen-lezen navigatie. Interactie is uitgeschakeld; werk de bridge bij voor readOnly.",
|
|
4385
|
+
historyExpired: "Snapshot niet meer beschikbaar"
|
|
4208
4386
|
};
|
|
4209
4387
|
|
|
4210
4388
|
// admin/messages.ts
|
|
@@ -5836,10 +6014,6 @@ var Badge = import_styled_components5.default.span`
|
|
|
5836
6014
|
`;
|
|
5837
6015
|
var CardBox = import_styled_components5.default.div`
|
|
5838
6016
|
position: relative;
|
|
5839
|
-
&:hover .bs-quick,
|
|
5840
|
-
&:focus-within .bs-quick {
|
|
5841
|
-
opacity: 1;
|
|
5842
|
-
}
|
|
5843
6017
|
`;
|
|
5844
6018
|
var CardBadges = import_styled_components5.default.div`
|
|
5845
6019
|
position: absolute;
|
|
@@ -5862,17 +6036,17 @@ var Round = import_styled_components5.default.button`
|
|
|
5862
6036
|
padding: 0;
|
|
5863
6037
|
border-radius: 50%;
|
|
5864
6038
|
cursor: pointer;
|
|
5865
|
-
border: 1px solid ${({ theme
|
|
5866
|
-
color: ${({ theme, $on
|
|
5867
|
-
background: ${({ theme
|
|
6039
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
6040
|
+
color: ${({ theme, $on }) => $on ? theme.colors.warning500 : theme.colors.neutral600};
|
|
6041
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
|
6042
|
+
transition: transform 120ms ease-out;
|
|
6043
|
+
&:active {
|
|
6044
|
+
transform: scale(0.97);
|
|
6045
|
+
}
|
|
5868
6046
|
&:focus-visible {
|
|
5869
6047
|
outline: 2px solid ${({ theme }) => theme.colors.primary600};
|
|
5870
6048
|
outline-offset: 1px;
|
|
5871
6049
|
}
|
|
5872
|
-
&.bs-quick {
|
|
5873
|
-
opacity: 0;
|
|
5874
|
-
transition: opacity 120ms;
|
|
5875
|
-
}
|
|
5876
6050
|
`;
|
|
5877
6051
|
var Mono = import_styled_components5.default.code`
|
|
5878
6052
|
font-size: 12px;
|
|
@@ -5947,25 +6121,13 @@ function Badges({ entry, t, tags }) {
|
|
|
5947
6121
|
}
|
|
5948
6122
|
function Card({ entry, palette, showFields, starred, active, onOpen, onInsert, onStar }) {
|
|
5949
6123
|
const t = useMessages();
|
|
5950
|
-
const timer = React6.useRef(null);
|
|
5951
|
-
React6.useEffect(() => () => clearTimeout(timer.current), []);
|
|
5952
6124
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(CardBox, { title: entry.uid, "data-testid": `blockscene-${entry.uid}`, children: [
|
|
5953
6125
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5954
6126
|
Tile,
|
|
5955
6127
|
{
|
|
5956
6128
|
type: "button",
|
|
5957
6129
|
$active: active,
|
|
5958
|
-
onClick:
|
|
5959
|
-
clearTimeout(timer.current);
|
|
5960
|
-
if (event.detail === 2) onInsert();
|
|
5961
|
-
else if (event.detail === 1) timer.current = setTimeout(onOpen, 220);
|
|
5962
|
-
else onOpen();
|
|
5963
|
-
},
|
|
5964
|
-
onKeyDown: (event) => {
|
|
5965
|
-
if (event.key !== "Enter") return;
|
|
5966
|
-
event.preventDefault();
|
|
5967
|
-
onInsert();
|
|
5968
|
-
},
|
|
6130
|
+
onClick: onInsert,
|
|
5969
6131
|
children: [
|
|
5970
6132
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
5971
6133
|
Thumb,
|
|
@@ -6010,14 +6172,12 @@ function Card({ entry, palette, showFields, starred, active, onOpen, onInsert, o
|
|
|
6010
6172
|
Round,
|
|
6011
6173
|
{
|
|
6012
6174
|
type: "button",
|
|
6013
|
-
className: "bs-quick",
|
|
6014
6175
|
style: { top: 46 },
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
"
|
|
6020
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "plus", size: 16 })
|
|
6176
|
+
"aria-label": t.f("rowPreview", { label: entry.label }),
|
|
6177
|
+
title: t.f("rowPreview", { label: entry.label }),
|
|
6178
|
+
onClick: onOpen,
|
|
6179
|
+
"data-testid": `gallery-preview-${entry.uid}`,
|
|
6180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "seo", size: 16 })
|
|
6021
6181
|
}
|
|
6022
6182
|
)
|
|
6023
6183
|
] });
|
|
@@ -6576,7 +6736,7 @@ function ZoneGallery({
|
|
|
6576
6736
|
gap: 4,
|
|
6577
6737
|
style: { overflowY: "auto", flex: 1, minHeight: 0, padding: "4px" },
|
|
6578
6738
|
children: (view === "recent" ? [{ typology: "recent", entries }] : groupEntries(entries)).map(
|
|
6579
|
-
({ typology, entries: items2 }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system2.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
6739
|
+
({ typology, entries: items2 }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system2.Flex, { direction: "column", alignItems: "stretch", gap: 2, flex: "0 0 auto", children: [
|
|
6580
6740
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system2.Typography, { variant: "sigma", textColor: "neutral600", "data-testid": `block-group-${typology}`, children: `${typology === "recent" ? t.nav.recent : t.typologies[typology] || typology} (${items2.length})` }),
|
|
6581
6741
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Columns, { $columns: columns, children: items2.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6582
6742
|
Card,
|
|
@@ -6862,7 +7022,7 @@ var import_styled_components6 = __toESM(require("styled-components"));
|
|
|
6862
7022
|
var import_design_system4 = require("@strapi/design-system");
|
|
6863
7023
|
|
|
6864
7024
|
// admin/pane.mjs
|
|
6865
|
-
var TOOLBAR = ["modes", "history", "devices", "status", "actions"];
|
|
7025
|
+
var TOOLBAR = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
6866
7026
|
var RIGHT = ["status", "actions"];
|
|
6867
7027
|
function toolbarLayout(list2) {
|
|
6868
7028
|
const ids = Array.isArray(list2) ? list2.filter((id, i) => TOOLBAR.includes(id) && list2.indexOf(id) === i) : TOOLBAR;
|
|
@@ -7313,7 +7473,8 @@ function PagePreview({
|
|
|
7313
7473
|
hiddenAttribute = null,
|
|
7314
7474
|
form = null,
|
|
7315
7475
|
Modal: Modal3,
|
|
7316
|
-
Toggle
|
|
7476
|
+
Toggle,
|
|
7477
|
+
versions
|
|
7317
7478
|
}) {
|
|
7318
7479
|
const t = useMessages();
|
|
7319
7480
|
const { values, zone, zoneLabel, canEdit, latest, insertRows: insertRows2 } = usePreviewZone(host);
|
|
@@ -7336,6 +7497,7 @@ function PagePreview({
|
|
|
7336
7497
|
const vw = main.width;
|
|
7337
7498
|
const [dragging, setDragging] = React8.useState(false);
|
|
7338
7499
|
const [ready, setReady] = React8.useState(false);
|
|
7500
|
+
const [readOnlyBridge, setReadOnlyBridge] = React8.useState(false);
|
|
7339
7501
|
const [failed, setFailed] = React8.useState(false);
|
|
7340
7502
|
const [attempt, retry] = React8.useReducer((n) => n + 1, 0);
|
|
7341
7503
|
const [picking, setPicking] = React8.useState(null);
|
|
@@ -7380,7 +7542,11 @@ function PagePreview({
|
|
|
7380
7542
|
const iframe = React8.useRef(null);
|
|
7381
7543
|
const loaded = React8.useRef(false);
|
|
7382
7544
|
const anchor = React8.useRef(null);
|
|
7383
|
-
const
|
|
7545
|
+
const version = versions?.view;
|
|
7546
|
+
const readOnly = Boolean(version);
|
|
7547
|
+
const viewRows = React8.useRef([]);
|
|
7548
|
+
viewRows.current = version ? version.values?.[zone] || [] : latest.current;
|
|
7549
|
+
const channel = React8.useMemo(() => crypto.randomUUID(), [host.model, host.documentId, host.locale, version?.scope, version?.event.id]);
|
|
7384
7550
|
const { base, source } = state.preview;
|
|
7385
7551
|
const url = base ? new URL(base) : null;
|
|
7386
7552
|
url?.searchParams.set("channel", channel);
|
|
@@ -7399,7 +7565,8 @@ function PagePreview({
|
|
|
7399
7565
|
setMode,
|
|
7400
7566
|
onChange,
|
|
7401
7567
|
clip,
|
|
7402
|
-
clipCount
|
|
7568
|
+
clipCount,
|
|
7569
|
+
readOnly
|
|
7403
7570
|
});
|
|
7404
7571
|
live.current = {
|
|
7405
7572
|
mode,
|
|
@@ -7409,7 +7576,8 @@ function PagePreview({
|
|
|
7409
7576
|
setMode,
|
|
7410
7577
|
onChange,
|
|
7411
7578
|
clip,
|
|
7412
|
-
clipCount
|
|
7579
|
+
clipCount,
|
|
7580
|
+
readOnly
|
|
7413
7581
|
};
|
|
7414
7582
|
const send = React8.useCallback(() => {
|
|
7415
7583
|
iframe.current?.contentWindow?.postMessage(
|
|
@@ -7418,19 +7586,29 @@ function PagePreview({
|
|
|
7418
7586
|
channel,
|
|
7419
7587
|
type: "update-page",
|
|
7420
7588
|
blocks: projectPage(
|
|
7421
|
-
|
|
7589
|
+
viewRows.current,
|
|
7422
7590
|
live.current.components,
|
|
7423
7591
|
window.location.origin,
|
|
7424
7592
|
hiddenAttribute
|
|
7425
|
-
),
|
|
7593
|
+
).map((block) => live.current.readOnly ? { ...block, fields: [], media: {} } : block),
|
|
7426
7594
|
groups,
|
|
7427
7595
|
locale: t.locale,
|
|
7428
7596
|
mode: live.current.mode,
|
|
7429
|
-
clipboard: live.current.clipCount
|
|
7597
|
+
clipboard: live.current.readOnly ? 0 : live.current.clipCount,
|
|
7598
|
+
readOnly: live.current.readOnly
|
|
7430
7599
|
},
|
|
7431
7600
|
origin
|
|
7432
7601
|
);
|
|
7433
|
-
}, [channel, origin, hiddenAttribute]);
|
|
7602
|
+
}, [channel, origin, hiddenAttribute, groups]);
|
|
7603
|
+
React8.useEffect(() => {
|
|
7604
|
+
if (readOnly) {
|
|
7605
|
+
setInserting(null);
|
|
7606
|
+
setBlockModal(null);
|
|
7607
|
+
setPicking(null);
|
|
7608
|
+
setFieldsPanel(null);
|
|
7609
|
+
setHovered(null);
|
|
7610
|
+
}
|
|
7611
|
+
}, [readOnly]);
|
|
7434
7612
|
const indexOf = (key) => latest.current.findIndex((row) => blockKey(row) === key);
|
|
7435
7613
|
const path = (key, field) => `${zone}.${indexOf(key)}.${field}`;
|
|
7436
7614
|
React8.useEffect(() => {
|
|
@@ -7587,9 +7765,11 @@ function PagePreview({
|
|
|
7587
7765
|
React8.useEffect(() => {
|
|
7588
7766
|
if (!active) return;
|
|
7589
7767
|
setReady(false);
|
|
7768
|
+
setReadOnlyBridge(false);
|
|
7590
7769
|
setFailed(false);
|
|
7591
7770
|
const timeout = setTimeout(() => setFailed(true), 15e3);
|
|
7592
7771
|
const receive = (event) => {
|
|
7772
|
+
if (!previewMessageAllowed(event, origin, iframe.current?.contentWindow, channel, live.current.readOnly)) return;
|
|
7593
7773
|
const is = (type) => isPreviewMessage(
|
|
7594
7774
|
event,
|
|
7595
7775
|
origin,
|
|
@@ -7602,6 +7782,7 @@ function PagePreview({
|
|
|
7602
7782
|
clearTimeout(timeout);
|
|
7603
7783
|
setReady(true);
|
|
7604
7784
|
setFailed(false);
|
|
7785
|
+
setReadOnlyBridge(Array.isArray(event.data.capabilities) && event.data.capabilities.includes("readOnly"));
|
|
7605
7786
|
send();
|
|
7606
7787
|
return;
|
|
7607
7788
|
}
|
|
@@ -7729,9 +7910,9 @@ function PagePreview({
|
|
|
7729
7910
|
if (!ready || !active) return;
|
|
7730
7911
|
const timer = setTimeout(send, 120);
|
|
7731
7912
|
return () => clearTimeout(timer);
|
|
7732
|
-
}, [values, host.components, ready, active, send, mode, clipCount]);
|
|
7913
|
+
}, [values, version, host.components, ready, active, send, mode, clipCount]);
|
|
7733
7914
|
React8.useEffect(() => {
|
|
7734
|
-
if (!active || !ready) return;
|
|
7915
|
+
if (!active || !ready || readOnly) return;
|
|
7735
7916
|
let last = null;
|
|
7736
7917
|
const post = (key) => {
|
|
7737
7918
|
if (key === last) return;
|
|
@@ -7754,7 +7935,7 @@ function PagePreview({
|
|
|
7754
7935
|
document.removeEventListener("pointerout", onOut);
|
|
7755
7936
|
post(null);
|
|
7756
7937
|
};
|
|
7757
|
-
}, [active, ready, channel, origin]);
|
|
7938
|
+
}, [active, ready, channel, origin, readOnly]);
|
|
7758
7939
|
React8.useEffect(() => {
|
|
7759
7940
|
const item = hovered && active ? findZoneList(live.current.zoneLabel)?.querySelectorAll(":scope > li")[indexOf(hovered)] : void 0;
|
|
7760
7941
|
hoverRow.current = item || null;
|
|
@@ -7808,7 +7989,7 @@ function PagePreview({
|
|
|
7808
7989
|
}
|
|
7809
7990
|
) });
|
|
7810
7991
|
const layout = toolbarLayout(editor?.previewToolbar);
|
|
7811
|
-
const tools = { modes: switcher, history: historyTools, devices };
|
|
7992
|
+
const tools = { modes: switcher, history: !readOnly && historyTools, versions: versions?.button, devices };
|
|
7812
7993
|
const toolbarShown = !ready || layout.before.length + layout.right.length + layout.after.length > 0;
|
|
7813
7994
|
const onKey = (event) => {
|
|
7814
7995
|
const map = {
|
|
@@ -7917,7 +8098,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7917
8098
|
children: [
|
|
7918
8099
|
!ready && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Typography, { variant: "pi", role: "status", textColor: "neutral600", children: failed ? t.previewFailed : t.previewLoading }),
|
|
7919
8100
|
failed && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Button, { size: "S", variant: "secondary", onClick: retry, children: t.retry }),
|
|
7920
|
-
layout.right.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Actions2, { parts: layout.right })
|
|
8101
|
+
!readOnly && layout.right.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Actions2, { parts: layout.right })
|
|
7921
8102
|
]
|
|
7922
8103
|
}
|
|
7923
8104
|
),
|
|
@@ -7925,62 +8106,68 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7925
8106
|
]
|
|
7926
8107
|
}
|
|
7927
8108
|
),
|
|
7928
|
-
|
|
7929
|
-
|
|
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
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7961
|
-
"div",
|
|
7962
|
-
{
|
|
7963
|
-
ref: setStage,
|
|
7964
|
-
"data-testid": "page-preview-stage",
|
|
7965
|
-
"data-device": device.id,
|
|
7966
|
-
style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
|
|
7967
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7968
|
-
Frame2,
|
|
7969
|
-
{
|
|
7970
|
-
ref: iframe,
|
|
7971
|
-
title: t.previewPane,
|
|
7972
|
-
src: url.href,
|
|
7973
|
-
sandbox: "allow-scripts allow-same-origin",
|
|
7974
|
-
referrerPolicy: "no-referrer",
|
|
7975
|
-
onLoad: () => {
|
|
7976
|
-
loaded.current = true;
|
|
8109
|
+
versions?.banner,
|
|
8110
|
+
readOnly && ready && !readOnlyBridge && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Box, { padding: 2, background: "neutral100", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Typography, { variant: "pi", role: "status", children: t.versionsBridgeLegacy }) }),
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: [
|
|
8112
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: sidebarPosition === "bottom" ? "column-reverse" : sidebarPosition === "right" ? "row-reverse" : "row" }, children: [
|
|
8113
|
+
!readOnly && mode === "preview" && sidebar.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: setRailEl, style: { display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
8114
|
+
import_design_system4.Flex,
|
|
8115
|
+
{
|
|
8116
|
+
"data-testid": "page-preview-sidebar",
|
|
8117
|
+
"data-position": sidebarPosition,
|
|
8118
|
+
role: "toolbar",
|
|
8119
|
+
"aria-label": t.sidebarLabel,
|
|
8120
|
+
direction: sidebarPosition === "bottom" ? "row" : "column",
|
|
8121
|
+
gap: 1,
|
|
8122
|
+
padding: 1,
|
|
8123
|
+
background: "neutral100",
|
|
8124
|
+
justifyContent: sidebarPosition === "bottom" ? "center" : "flex-start",
|
|
8125
|
+
style: { [sidebarPosition === "bottom" ? "borderTop" : sidebarPosition === "right" ? "borderLeft" : "borderRight"]: `1px solid ${theme?.colors?.neutral200 || "#dcdce4"}`, overflow: "auto" },
|
|
8126
|
+
children: sidebar.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
8127
|
+
RailButton,
|
|
8128
|
+
{
|
|
8129
|
+
type: "button",
|
|
8130
|
+
$active: fieldsPanel === item,
|
|
8131
|
+
"aria-pressed": fieldsPanel === item,
|
|
8132
|
+
title: item.label,
|
|
8133
|
+
"data-testid": item.custom ? `sidebar-panel-${item.id}` : `sidebar-item-${i}`,
|
|
8134
|
+
onClick: () => setFieldsPanel(fieldsPanel === item ? null : item),
|
|
8135
|
+
children: [
|
|
8136
|
+
typeof item.icon === "string" ? item.icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: item.icon }) : item.icon,
|
|
8137
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: item.label })
|
|
8138
|
+
]
|
|
7977
8139
|
},
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
8140
|
+
`${item.label}-${i}`
|
|
8141
|
+
))
|
|
8142
|
+
}
|
|
8143
|
+
) }),
|
|
8144
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
8145
|
+
"div",
|
|
8146
|
+
{
|
|
8147
|
+
ref: setStage,
|
|
8148
|
+
"data-testid": "page-preview-stage",
|
|
8149
|
+
"data-device": device.id,
|
|
8150
|
+
style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
|
|
8151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
8152
|
+
Frame2,
|
|
8153
|
+
{
|
|
8154
|
+
ref: iframe,
|
|
8155
|
+
title: t.previewPane,
|
|
8156
|
+
src: url.href,
|
|
8157
|
+
sandbox: "allow-scripts allow-same-origin",
|
|
8158
|
+
referrerPolicy: "no-referrer",
|
|
8159
|
+
...readOnly && !readOnlyBridge ? { inert: "", tabIndex: -1 } : {},
|
|
8160
|
+
onLoad: () => {
|
|
8161
|
+
loaded.current = true;
|
|
8162
|
+
},
|
|
8163
|
+
style: { ...frameStyle(device.width, stageSize), ...dragging || readOnly && !readOnlyBridge ? { pointerEvents: "none" } : {} }
|
|
8164
|
+
},
|
|
8165
|
+
attempt
|
|
8166
|
+
)
|
|
8167
|
+
}
|
|
8168
|
+
)
|
|
8169
|
+
] }),
|
|
8170
|
+
versions?.drawer
|
|
7984
8171
|
] })
|
|
7985
8172
|
]
|
|
7986
8173
|
}
|
|
@@ -8007,6 +8194,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
8007
8194
|
if (!open) setInserting(null);
|
|
8008
8195
|
},
|
|
8009
8196
|
onSelect: (uid, values2) => {
|
|
8197
|
+
if (live.current.readOnly) return;
|
|
8010
8198
|
const rows = inserting.zone === zone ? latest.current : Array.isArray(host.values?.[inserting.zone]) ? host.values[inserting.zone] : [];
|
|
8011
8199
|
const index = insertIndex(rows, inserting.after);
|
|
8012
8200
|
setInserting(null);
|
|
@@ -8131,6 +8319,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
8131
8319
|
multiple: picking.attr.multiple === true,
|
|
8132
8320
|
onClose: () => setPicking(null),
|
|
8133
8321
|
onSelectAssets: (assets) => {
|
|
8322
|
+
if (live.current.readOnly) return;
|
|
8134
8323
|
const index = indexOf(picking.key);
|
|
8135
8324
|
setPicking(null);
|
|
8136
8325
|
if (index < 0 || !assets?.length) return;
|
|
@@ -8455,6 +8644,8 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8455
8644
|
const initialValues = (0, import_admin2.useForm)("BlocksceneVersions", (state) => state.initialValues);
|
|
8456
8645
|
const setValues = (0, import_admin2.useForm)("BlocksceneVersions", (state) => state.setValues);
|
|
8457
8646
|
const [events, setEvents] = React10.useState(null);
|
|
8647
|
+
const [pagination, setPagination] = React10.useState(null);
|
|
8648
|
+
const [moreLoading, setMoreLoading] = React10.useState(false);
|
|
8458
8649
|
const [failed, setFailed] = React10.useState(false);
|
|
8459
8650
|
const [shown, setShown] = React10.useState(PAGE);
|
|
8460
8651
|
const [open, setOpen] = React10.useState(null);
|
|
@@ -8462,11 +8653,19 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8462
8653
|
const [loading, setLoading] = React10.useState(false);
|
|
8463
8654
|
const [refresh, reload] = React10.useReducer((n) => n + 1, 0);
|
|
8464
8655
|
const allowed = Boolean(allowedActions?.canRead);
|
|
8656
|
+
const scope = `${model}:${documentId}:${locale}:${allowed}`;
|
|
8657
|
+
const latestScope = React10.useRef(scope);
|
|
8658
|
+
latestScope.current = scope;
|
|
8465
8659
|
React10.useEffect(() => {
|
|
8466
8660
|
if (!allowed || !documentId) return;
|
|
8467
8661
|
let active = true;
|
|
8468
8662
|
setFailed(false);
|
|
8469
|
-
get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) =>
|
|
8663
|
+
get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) => {
|
|
8664
|
+
if (active) {
|
|
8665
|
+
setEvents(Array.isArray(data?.results) ? data.results : []);
|
|
8666
|
+
setPagination(data?.pagination);
|
|
8667
|
+
}
|
|
8668
|
+
}).catch(() => active && setFailed(true));
|
|
8470
8669
|
return () => {
|
|
8471
8670
|
active = false;
|
|
8472
8671
|
};
|
|
@@ -8475,7 +8674,26 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8475
8674
|
setOpen(null);
|
|
8476
8675
|
setReport(null);
|
|
8477
8676
|
setShown(PAGE);
|
|
8677
|
+
setEvents(null);
|
|
8678
|
+
setPagination(null);
|
|
8679
|
+
setMoreLoading(false);
|
|
8478
8680
|
}, [model, documentId, locale]);
|
|
8681
|
+
const more = async () => {
|
|
8682
|
+
if (shown < (events?.length || 0)) return setShown(shown + PAGE);
|
|
8683
|
+
setMoreLoading(true);
|
|
8684
|
+
try {
|
|
8685
|
+
const params = new URLSearchParams({ page: String((pagination?.page || 1) + 1), ...locale && { locale } });
|
|
8686
|
+
const { data } = await get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}?${params}`);
|
|
8687
|
+
if (latestScope.current !== scope) return;
|
|
8688
|
+
setEvents((previous) => [...previous || [], ...data?.results || []]);
|
|
8689
|
+
setPagination(data?.pagination);
|
|
8690
|
+
setShown(shown + PAGE);
|
|
8691
|
+
} catch {
|
|
8692
|
+
if (latestScope.current === scope) setFailed(true);
|
|
8693
|
+
} finally {
|
|
8694
|
+
if (latestScope.current === scope) setMoreLoading(false);
|
|
8695
|
+
}
|
|
8696
|
+
};
|
|
8479
8697
|
if (isLoading || !allowed || !documentId) return null;
|
|
8480
8698
|
const name = (uid) => components?.[uid]?.info?.displayName || uid;
|
|
8481
8699
|
const when2 = (at) => {
|
|
@@ -8571,30 +8789,270 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8571
8789
|
] }) })
|
|
8572
8790
|
] }, event.id);
|
|
8573
8791
|
}),
|
|
8574
|
-
events.length > shown && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system6.Flex, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system6.Button, { variant: "tertiary", size: "S", onClick:
|
|
8792
|
+
(events.length > shown || pagination?.page < pagination?.pageCount) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system6.Flex, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system6.Button, { variant: "tertiary", size: "S", onClick: more, loading: moreLoading, disabled: moreLoading, children: t.historyShowMore }) })
|
|
8575
8793
|
] })
|
|
8576
8794
|
] });
|
|
8577
8795
|
}
|
|
8578
8796
|
|
|
8579
|
-
// admin/
|
|
8797
|
+
// admin/Versions.tsx
|
|
8580
8798
|
var React11 = __toESM(require("react"));
|
|
8581
|
-
var import_design_system7 = require("@strapi/design-system");
|
|
8582
8799
|
var import_styled_components7 = __toESM(require("styled-components"));
|
|
8800
|
+
var import_design_system7 = require("@strapi/design-system");
|
|
8801
|
+
var import_admin3 = require("@strapi/strapi/admin");
|
|
8583
8802
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
8803
|
+
var Drawer = import_styled_components7.default.aside`
|
|
8804
|
+
width: min(36rem, 55%); flex: 0 0 auto; overflow: auto;
|
|
8805
|
+
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
8806
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
|
8807
|
+
`;
|
|
8808
|
+
var Entry = import_styled_components7.default.button`
|
|
8809
|
+
display: block; width: 100%; text-align: left; padding: 12px; margin: 4px 0;
|
|
8810
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px;
|
|
8811
|
+
background: ${({ theme }) => theme.colors.neutral0}; cursor: pointer;
|
|
8812
|
+
&[aria-pressed="true"] { background: ${({ theme }) => theme.colors.primary100}; border-color: ${({ theme }) => theme.colors.primary600}; }
|
|
8813
|
+
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
|
|
8814
|
+
&:disabled { cursor: default; opacity: .65; }
|
|
8815
|
+
overflow-wrap: anywhere;
|
|
8816
|
+
`;
|
|
8817
|
+
var PAGE_SIZE = 25;
|
|
8818
|
+
function useVersions(host, config2) {
|
|
8819
|
+
const t = useMessages();
|
|
8820
|
+
const [{ query: query2 }] = (0, import_admin3.useQueryParams)();
|
|
8821
|
+
const locale = typeof query2?.plugins?.i18n?.locale === "string" ? query2.plugins.i18n.locale : host.locale || "";
|
|
8822
|
+
const rbac = (0, import_admin3.useRBAC)(HISTORY_READ);
|
|
8823
|
+
const allowed = !rbac.isLoading && Boolean(rbac.allowedActions?.canRead);
|
|
8824
|
+
const enabled = Boolean(config2?.contentTypes?.includes(host.model));
|
|
8825
|
+
const scope = `${host.model}:${host.documentId || ""}:${locale}:${allowed}:${enabled}`;
|
|
8826
|
+
const currentScope = React11.useRef(scope);
|
|
8827
|
+
currentScope.current = scope;
|
|
8828
|
+
const requests = React11.useRef(0);
|
|
8829
|
+
const [open, setOpen] = React11.useState(false);
|
|
8830
|
+
const [actor, setActor] = React11.useState("");
|
|
8831
|
+
const [page, setPage] = React11.useState(1);
|
|
8832
|
+
const [list2, setList] = React11.useState(null);
|
|
8833
|
+
const [people, setPeople] = React11.useState(null);
|
|
8834
|
+
const [selection, setSelection] = React11.useState(null);
|
|
8835
|
+
const [failed, setFailed] = React11.useState(false);
|
|
8836
|
+
const [refresh, retry] = React11.useReducer((n) => n + 1, 0);
|
|
8837
|
+
const trigger = React11.useRef(null);
|
|
8838
|
+
const closeButton = React11.useRef(null);
|
|
8839
|
+
const titleId = React11.useId(), drawerId = React11.useId();
|
|
8840
|
+
const available = allowed && enabled && Boolean(host.documentId) && !host.creating;
|
|
8841
|
+
const reason = rbac.isLoading ? t.historyLoading : !allowed ? t.versionsDenied : !enabled ? t.versionsDisabled : !host.documentId || host.creating ? t.versionsNew : "";
|
|
8842
|
+
const view = selection?.scope === scope ? selection : null;
|
|
8843
|
+
const close = () => {
|
|
8844
|
+
setOpen(false);
|
|
8845
|
+
trigger.current?.focus();
|
|
8846
|
+
};
|
|
8847
|
+
const back = () => {
|
|
8848
|
+
requests.current++;
|
|
8849
|
+
setSelection(null);
|
|
8850
|
+
setFailed(false);
|
|
8851
|
+
trigger.current?.focus();
|
|
8852
|
+
};
|
|
8853
|
+
React11.useEffect(() => {
|
|
8854
|
+
requests.current++;
|
|
8855
|
+
setSelection(null);
|
|
8856
|
+
setList(null);
|
|
8857
|
+
setPeople(null);
|
|
8858
|
+
setActor("");
|
|
8859
|
+
setPage(1);
|
|
8860
|
+
setFailed(false);
|
|
8861
|
+
return () => {
|
|
8862
|
+
requests.current++;
|
|
8863
|
+
};
|
|
8864
|
+
}, [scope]);
|
|
8865
|
+
React11.useEffect(() => {
|
|
8866
|
+
if (open) closeButton.current?.focus();
|
|
8867
|
+
}, [open]);
|
|
8868
|
+
React11.useEffect(() => {
|
|
8869
|
+
if (!open || !available) return;
|
|
8870
|
+
let active = true;
|
|
8871
|
+
setList(null);
|
|
8872
|
+
setFailed(false);
|
|
8873
|
+
const params = new URLSearchParams({ page: String(page), pageSize: String(PAGE_SIZE), ...locale && { locale }, ...actor && { actor } });
|
|
8874
|
+
host.get(`/blockscene/history/${encodeURIComponent(host.model)}/${encodeURIComponent(String(host.documentId))}?${params}`).then(({ data }) => {
|
|
8875
|
+
if (active && currentScope.current === scope) {
|
|
8876
|
+
setList({ ...data, scope });
|
|
8877
|
+
setPeople({ scope, actors: data.actors || [] });
|
|
8878
|
+
}
|
|
8879
|
+
}).catch(() => {
|
|
8880
|
+
if (active && currentScope.current === scope) setFailed(true);
|
|
8881
|
+
});
|
|
8882
|
+
return () => {
|
|
8883
|
+
active = false;
|
|
8884
|
+
};
|
|
8885
|
+
}, [scope, open, page, actor, refresh, host.get, host.history?.epoch]);
|
|
8886
|
+
const select = async (event) => {
|
|
8887
|
+
if (!available || !event.stored) return;
|
|
8888
|
+
const request = ++requests.current;
|
|
8889
|
+
setSelection({ scope, event, pending: true, values: view?.values });
|
|
8890
|
+
setFailed(false);
|
|
8891
|
+
try {
|
|
8892
|
+
const { data } = await host.get(`/blockscene/history-events/${event.id}`);
|
|
8893
|
+
if (requests.current !== request || currentScope.current !== scope) return;
|
|
8894
|
+
const localized2 = host.contentType?.pluginOptions?.i18n?.localized;
|
|
8895
|
+
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");
|
|
8896
|
+
const loaded = loadVersion(data.snapshot, {
|
|
8897
|
+
schema: host.contentType,
|
|
8898
|
+
components: host.components,
|
|
8899
|
+
media: data.media,
|
|
8900
|
+
relations: data.relations,
|
|
8901
|
+
editable: host.readable
|
|
8902
|
+
});
|
|
8903
|
+
for (const [name, attr] of Object.entries(host.contentType?.attributes || {}))
|
|
8904
|
+
if (attr.type === "dynamiczone") loaded.values[name]?.forEach((row, i) => {
|
|
8905
|
+
row.__temp_key__ = `version:${event.id}:${i}`;
|
|
8906
|
+
});
|
|
8907
|
+
setSelection({ scope, event, values: loaded.values, report: loaded.report, pending: false });
|
|
8908
|
+
} catch {
|
|
8909
|
+
if (requests.current === request && currentScope.current === scope) {
|
|
8910
|
+
setFailed(true);
|
|
8911
|
+
setSelection(null);
|
|
8912
|
+
}
|
|
8913
|
+
}
|
|
8914
|
+
};
|
|
8915
|
+
const when2 = (at, day = false) => new Date(at).toLocaleString(t.locale, { dateStyle: "medium", ...!day && { timeStyle: "short" } });
|
|
8916
|
+
const events = list2?.scope === scope ? list2.results || [] : [];
|
|
8917
|
+
let previousDay = "";
|
|
8918
|
+
const drawer = open && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8919
|
+
Drawer,
|
|
8920
|
+
{
|
|
8921
|
+
id: drawerId,
|
|
8922
|
+
role: "region",
|
|
8923
|
+
"aria-labelledby": titleId,
|
|
8924
|
+
"data-testid": "versions-drawer",
|
|
8925
|
+
onKeyDown: (event) => {
|
|
8926
|
+
if (event.key === "Escape") {
|
|
8927
|
+
event.preventDefault();
|
|
8928
|
+
event.stopPropagation();
|
|
8929
|
+
close();
|
|
8930
|
+
}
|
|
8931
|
+
},
|
|
8932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Box, { padding: 4, children: [
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Flex, { gap: 2, justifyContent: "space-between", children: [
|
|
8934
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { id: titleId, tag: "h2", variant: "delta", children: t.historyTitle }),
|
|
8935
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Button, { ref: closeButton, size: "S", variant: "tertiary", "aria-label": t.close, onClick: close, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "close" }) })
|
|
8936
|
+
] }),
|
|
8937
|
+
reason ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "p", textColor: "neutral600", children: reason }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
8938
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Box, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.SingleSelect, { "aria-label": t.versionsPerson, value: actor, onChange: (value) => {
|
|
8939
|
+
setActor(value);
|
|
8940
|
+
setPage(1);
|
|
8941
|
+
}, children: [
|
|
8942
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.SingleSelectOption, { value: "", children: t.versionsEveryone }),
|
|
8943
|
+
(people?.scope === scope ? people.actors : []).map((person) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.SingleSelectOption, { value: person.actor, children: person.actorName || person.actor }, person.actor))
|
|
8944
|
+
] }) }),
|
|
8945
|
+
!list2 && !failed && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { role: "status", children: t.historyLoading }),
|
|
8946
|
+
list2 && !events.length && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { children: t.historyEmpty }),
|
|
8947
|
+
events.map((event) => {
|
|
8948
|
+
const day = when2(event.at, true), heading = day !== previousDay;
|
|
8949
|
+
previousDay = day;
|
|
8950
|
+
const blocks = event.summary?.blocks;
|
|
8951
|
+
const counted = ["total", "added", "removed", "changed"].every((key) => Number.isInteger(blocks?.[key]));
|
|
8952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(React11.Fragment, { children: [
|
|
8953
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "h3", variant: "omega", fontWeight: "bold", style: { marginTop: 12 }, children: day }),
|
|
8954
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
8955
|
+
Entry,
|
|
8956
|
+
{
|
|
8957
|
+
"aria-pressed": view?.event.id === event.id,
|
|
8958
|
+
disabled: !event.stored,
|
|
8959
|
+
title: !event.stored ? t.historyExpired : void 0,
|
|
8960
|
+
"data-testid": `version-${event.id}`,
|
|
8961
|
+
onClick: () => select(event),
|
|
8962
|
+
children: [
|
|
8963
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "span", fontWeight: "bold", children: event.actorName || event.actor }),
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Typography, { tag: "p", variant: "pi", children: [
|
|
8965
|
+
when2(event.at),
|
|
8966
|
+
" \xB7 ",
|
|
8967
|
+
t.historyActions[event.action] || event.action
|
|
8968
|
+
] }),
|
|
8969
|
+
counted ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
8970
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: t.f("versionsCounts", blocks) }),
|
|
8971
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Flex, { gap: 2, wrap: "wrap", children: [
|
|
8972
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Typography, { variant: "pi", textColor: "success700", children: [
|
|
8973
|
+
"+",
|
|
8974
|
+
blocks.added,
|
|
8975
|
+
" ",
|
|
8976
|
+
t.diffOps.added
|
|
8977
|
+
] }),
|
|
8978
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Typography, { variant: "pi", textColor: "danger700", children: [
|
|
8979
|
+
"\u2212",
|
|
8980
|
+
blocks.removed,
|
|
8981
|
+
" ",
|
|
8982
|
+
t.diffOps.removed
|
|
8983
|
+
] }),
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Typography, { variant: "pi", textColor: "warning700", children: [
|
|
8985
|
+
"~",
|
|
8986
|
+
blocks.changed,
|
|
8987
|
+
" ",
|
|
8988
|
+
t.diffOps.changed
|
|
8989
|
+
] })
|
|
8990
|
+
] })
|
|
8991
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: t.versionsCountsMissing }),
|
|
8992
|
+
!event.stored && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { tag: "p", variant: "pi", children: t.historyExpired })
|
|
8993
|
+
]
|
|
8994
|
+
}
|
|
8995
|
+
)
|
|
8996
|
+
] }, event.id);
|
|
8997
|
+
}),
|
|
8998
|
+
list2 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Flex, { gap: 2, paddingTop: 3, justifyContent: "space-between", children: [
|
|
8999
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Button, { size: "S", variant: "tertiary", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.versionsPrevious }),
|
|
9000
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { variant: "pi", children: t.f("versionsPage", { page, count: Math.max(1, list2.pagination?.pageCount || 0) }) }),
|
|
9001
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Button, { size: "S", variant: "tertiary", disabled: page >= (list2.pagination?.pageCount || 0), onClick: () => setPage(page + 1), children: t.versionsNext })
|
|
9002
|
+
] })
|
|
9003
|
+
] }),
|
|
9004
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Box, { paddingTop: 3, children: [
|
|
9005
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { role: "alert", textColor: "danger600", children: t.historyFailed }),
|
|
9006
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Button, { size: "S", variant: "tertiary", onClick: retry, children: t.retry })
|
|
9007
|
+
] })
|
|
9008
|
+
] })
|
|
9009
|
+
}
|
|
9010
|
+
);
|
|
9011
|
+
return {
|
|
9012
|
+
view,
|
|
9013
|
+
drawer,
|
|
9014
|
+
button: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
9015
|
+
import_design_system7.Button,
|
|
9016
|
+
{
|
|
9017
|
+
ref: trigger,
|
|
9018
|
+
size: "S",
|
|
9019
|
+
variant: "tertiary",
|
|
9020
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "clock" }),
|
|
9021
|
+
"data-testid": "versions-toggle",
|
|
9022
|
+
"aria-expanded": open,
|
|
9023
|
+
"aria-controls": open ? drawerId : void 0,
|
|
9024
|
+
title: reason || t.historyTitle,
|
|
9025
|
+
onClick: () => setOpen(!open),
|
|
9026
|
+
children: t.historyTitle
|
|
9027
|
+
}
|
|
9028
|
+
),
|
|
9029
|
+
banner: view && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_design_system7.Flex, { padding: 3, gap: 3, wrap: "wrap", background: "primary100", "data-testid": "versions-banner", children: [
|
|
9030
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { role: "status", children: view.pending ? t.historyLoading : t.f("versionsViewing", { date: when2(view.event.at), person: view.event.actorName || view.event.actor }) }),
|
|
9031
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Button, { size: "S", variant: "secondary", onClick: back, children: t.versionsCurrent }),
|
|
9032
|
+
!view.pending && (view.report?.blocks || view.report?.media || view.report?.relations || view.report?.removed.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system7.Typography, { variant: "pi", children: t.versionsMissing })
|
|
9033
|
+
] })
|
|
9034
|
+
};
|
|
9035
|
+
}
|
|
9036
|
+
|
|
9037
|
+
// admin/Settings.tsx
|
|
9038
|
+
var React12 = __toESM(require("react"));
|
|
9039
|
+
var import_design_system8 = require("@strapi/design-system");
|
|
9040
|
+
var import_styled_components8 = __toESM(require("styled-components"));
|
|
9041
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
8584
9042
|
var COLOR2 = /^#[0-9A-Fa-f]{6}$/;
|
|
8585
|
-
var Grid2 =
|
|
8586
|
-
var Card2 =
|
|
9043
|
+
var Grid2 = import_styled_components8.default.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; `;
|
|
9044
|
+
var Card2 = import_styled_components8.default.div`
|
|
8587
9045
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8588
9046
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral0};
|
|
8589
9047
|
`;
|
|
8590
|
-
var Bar =
|
|
9048
|
+
var Bar = import_styled_components8.default.div`
|
|
8591
9049
|
position: fixed; top: 0; z-index: 4; padding: 12px 32px;
|
|
8592
9050
|
background: ${({ theme }) => theme.colors.neutral100}; border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8593
9051
|
box-shadow: 0 1px 4px rgba(33, 33, 52, 0.1);
|
|
8594
9052
|
`;
|
|
8595
9053
|
function useMainRect2(anchor) {
|
|
8596
|
-
const [rect, setRect] =
|
|
8597
|
-
|
|
9054
|
+
const [rect, setRect] = React12.useState({ left: 0, width: 0 });
|
|
9055
|
+
React12.useEffect(() => {
|
|
8598
9056
|
const read3 = () => {
|
|
8599
9057
|
let host = document.getElementById("main-content");
|
|
8600
9058
|
for (let el = anchor.current?.parentElement; !host && el; el = el.parentElement) if (["auto", "scroll"].includes(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) host = el;
|
|
@@ -8607,15 +9065,15 @@ function useMainRect2(anchor) {
|
|
|
8607
9065
|
});
|
|
8608
9066
|
return rect;
|
|
8609
9067
|
}
|
|
8610
|
-
var Swatches =
|
|
8611
|
-
var Label =
|
|
9068
|
+
var Swatches = import_styled_components8.default.div` display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; `;
|
|
9069
|
+
var Label = import_styled_components8.default.label` display: flex; flex-direction: column; gap: 4px; font-size: 12px; `;
|
|
8612
9070
|
function ColorField({ name, label, value, onChange, disabled }) {
|
|
8613
9071
|
const valid = COLOR2.test(value);
|
|
8614
|
-
return /* @__PURE__ */ (0,
|
|
8615
|
-
/* @__PURE__ */ (0,
|
|
8616
|
-
/* @__PURE__ */ (0,
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8618
|
-
/* @__PURE__ */ (0,
|
|
9072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Label, { children: [
|
|
9073
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
|
|
9074
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 2, children: [
|
|
9075
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" } }),
|
|
9076
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8619
9077
|
"input",
|
|
8620
9078
|
{
|
|
8621
9079
|
name,
|
|
@@ -8631,14 +9089,14 @@ function ColorField({ name, label, value, onChange, disabled }) {
|
|
|
8631
9089
|
] });
|
|
8632
9090
|
}
|
|
8633
9091
|
function TagsField({ name, label, hint, value, onChange, disabled }) {
|
|
8634
|
-
const [text, setText] =
|
|
8635
|
-
return /* @__PURE__ */ (0,
|
|
8636
|
-
/* @__PURE__ */ (0,
|
|
8637
|
-
/* @__PURE__ */ (0,
|
|
9092
|
+
const [text, setText] = React12.useState(value.join(", "));
|
|
9093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Label, { children: [
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
|
|
9095
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name, value: text, disabled, onChange: (e) => {
|
|
8638
9096
|
setText(e.target.value);
|
|
8639
9097
|
onChange([...new Set(e.target.value.split(",").map((tag) => tag.replace(/[<>]/g, "").trim().slice(0, 24)).filter(Boolean))].slice(0, 10));
|
|
8640
9098
|
}, style: { padding: "6px 8px", border: "1px solid #dcdce4", borderRadius: 4, fontSize: 13 } }),
|
|
8641
|
-
/* @__PURE__ */ (0,
|
|
9099
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: hint })
|
|
8642
9100
|
] });
|
|
8643
9101
|
}
|
|
8644
9102
|
var FIELD_UID = /^(plugin|global)::[\w.-]+$/;
|
|
@@ -8646,11 +9104,11 @@ var LAZY_MAX = 20;
|
|
|
8646
9104
|
var parseUids = (text) => [...new Set(text.split(/[\s,]+/).filter(Boolean))];
|
|
8647
9105
|
var badUids = (uids = []) => uids.length > LAZY_MAX || uids.some((uid) => !FIELD_UID.test(uid));
|
|
8648
9106
|
function UidListField({ TextField: TextField2, value, onChange, ...props }) {
|
|
8649
|
-
const [text, setText] =
|
|
8650
|
-
|
|
9107
|
+
const [text, setText] = React12.useState(value.join(", "));
|
|
9108
|
+
React12.useEffect(() => {
|
|
8651
9109
|
if (parseUids(text).join() !== value.join()) setText(value.join(", "));
|
|
8652
9110
|
}, [value.join()]);
|
|
8653
|
-
return /* @__PURE__ */ (0,
|
|
9111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TextField2, { ...props, value: text, onChange: (v) => {
|
|
8654
9112
|
setText(v);
|
|
8655
9113
|
onChange(parseUids(v));
|
|
8656
9114
|
} });
|
|
@@ -8660,31 +9118,31 @@ var SIDEBAR_MAX = 12;
|
|
|
8660
9118
|
var ITEM_LABEL = /^[^<>]{1,40}$/;
|
|
8661
9119
|
var badItem = (item) => !ITEM_LABEL.test(String(item.label || "").trim()) || !item.fields?.length;
|
|
8662
9120
|
var SYSTEM_FIELDS2 = ["createdAt", "updatedAt", "publishedAt", "createdBy", "updatedBy", "locale", "localizations"];
|
|
8663
|
-
var Item =
|
|
9121
|
+
var Item = import_styled_components8.default.div`
|
|
8664
9122
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8665
9123
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral100};
|
|
8666
9124
|
`;
|
|
8667
|
-
var Checks =
|
|
9125
|
+
var Checks = import_styled_components8.default.fieldset`
|
|
8668
9126
|
display: flex; flex-wrap: wrap; gap: 4px 16px; border: 0; padding: 0; margin: 0; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800};
|
|
8669
9127
|
legend { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
|
|
8670
9128
|
label { display: inline-flex; align-items: center; gap: 6px; }
|
|
8671
9129
|
`;
|
|
8672
|
-
var TOOLBAR2 = ["modes", "history", "devices", "status", "actions"];
|
|
9130
|
+
var TOOLBAR2 = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
8673
9131
|
var DEVICE_NAMES = ["fit", "mobile", "tablet", "desktop"];
|
|
8674
9132
|
var DEVICE_LABEL = /^[^<>]{1,24}$/;
|
|
8675
9133
|
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;
|
|
8676
|
-
var Row =
|
|
8677
|
-
function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2 }) {
|
|
9134
|
+
var Row = import_styled_components8.default.div` display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800}; `;
|
|
9135
|
+
function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2, versions }) {
|
|
8678
9136
|
const move = (list2, index, by) => {
|
|
8679
9137
|
const next = [...list2];
|
|
8680
9138
|
[next[index], next[index + by]] = [next[index + by], next[index]];
|
|
8681
9139
|
return next;
|
|
8682
9140
|
};
|
|
8683
|
-
const arrows = (list2, index, key) => /* @__PURE__ */ (0,
|
|
8684
|
-
/* @__PURE__ */ (0,
|
|
8685
|
-
/* @__PURE__ */ (0,
|
|
9141
|
+
const arrows = (list2, index, key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9142
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index < 0 || index === 0, onClick: () => set2(key, move(list2, index, -1)) }),
|
|
9143
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index < 0 || index === list2.length - 1, onClick: () => set2(key, move(list2, index, 1)) })
|
|
8686
9144
|
] });
|
|
8687
|
-
const check = (list2, item, key) => /* @__PURE__ */ (0,
|
|
9145
|
+
const check = (list2, item, key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8688
9146
|
"input",
|
|
8689
9147
|
{
|
|
8690
9148
|
type: "checkbox",
|
|
@@ -8695,27 +9153,27 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8695
9153
|
}
|
|
8696
9154
|
);
|
|
8697
9155
|
const width = (index, patch) => set2("previewDevices", devices.map((item, i) => i === index ? { ...item, ...patch } : item));
|
|
8698
|
-
return /* @__PURE__ */ (0,
|
|
8699
|
-
/* @__PURE__ */ (0,
|
|
8700
|
-
/* @__PURE__ */ (0,
|
|
9156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 3, "data-testid": `pane-editor-${id}`, children: [
|
|
9157
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.paneHelp }),
|
|
9158
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { children: [...toolbar, ...TOOLBAR2.filter((item) => !toolbar.includes(item))].filter((item) => item !== "versions" || versions).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Row, { "data-testid": `${id}-toolbar-${item}`, children: [
|
|
8701
9159
|
arrows(toolbar, toolbar.indexOf(item), "previewToolbar"),
|
|
8702
|
-
/* @__PURE__ */ (0,
|
|
9160
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
8703
9161
|
check(toolbar, item, "previewToolbar"),
|
|
8704
9162
|
t.toolbar[item]
|
|
8705
9163
|
] })
|
|
8706
9164
|
] }, item)) }),
|
|
8707
|
-
/* @__PURE__ */ (0,
|
|
8708
|
-
/* @__PURE__ */ (0,
|
|
8709
|
-
/* @__PURE__ */ (0,
|
|
9165
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "delta", tag: "h3", children: t.paneDevices }),
|
|
9166
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.paneDevicesHelp }),
|
|
9167
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { children: [...devices, ...DEVICE_NAMES.filter((item) => !devices.includes(item))].map((item) => {
|
|
8710
9168
|
const index = devices.indexOf(item);
|
|
8711
|
-
return /* @__PURE__ */ (0,
|
|
9169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Row, { "data-testid": `${id}-device-${typeof item === "string" ? item : index}`, children: [
|
|
8712
9170
|
arrows(devices, index, "previewDevices"),
|
|
8713
|
-
typeof item === "string" ? /* @__PURE__ */ (0,
|
|
9171
|
+
typeof item === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
8714
9172
|
check(devices, item, "previewDevices"),
|
|
8715
9173
|
t.device[item]
|
|
8716
|
-
] }) : /* @__PURE__ */ (0,
|
|
8717
|
-
/* @__PURE__ */ (0,
|
|
8718
|
-
/* @__PURE__ */ (0,
|
|
9174
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9175
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { flex: "1 1 160px" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TextField2, { name: `${id}-device-label-${index}`, label: t.paneWidthLabel, value: item.label, disabled, onChange: (v) => width(index, { label: v }) }) }),
|
|
9176
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { width: 140 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8719
9177
|
TextField2,
|
|
8720
9178
|
{
|
|
8721
9179
|
name: `${id}-device-width-${index}`,
|
|
@@ -8725,12 +9183,12 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8725
9183
|
onChange: (v) => width(index, { width: /^\d{1,4}$/.test(v.trim()) ? Number(v.trim()) : NaN })
|
|
8726
9184
|
}
|
|
8727
9185
|
) }),
|
|
8728
|
-
/* @__PURE__ */ (0,
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "close", label: t.paneRemoveWidth, disabled, onClick: () => set2("previewDevices", devices.filter((_, i) => i !== index)) })
|
|
8729
9187
|
] })
|
|
8730
9188
|
] }, typeof item === "string" ? item : `px-${index}`);
|
|
8731
9189
|
}) }),
|
|
8732
|
-
/* @__PURE__ */ (0,
|
|
8733
|
-
|
|
9190
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Flex, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9191
|
+
import_design_system8.Button,
|
|
8734
9192
|
{
|
|
8735
9193
|
variant: "secondary",
|
|
8736
9194
|
size: "S",
|
|
@@ -8740,7 +9198,7 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8740
9198
|
children: t.paneAddWidth
|
|
8741
9199
|
}
|
|
8742
9200
|
) }),
|
|
8743
|
-
badDevices(devices) && /* @__PURE__ */ (0,
|
|
9201
|
+
badDevices(devices) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", variant: "pi", textColor: "danger600", children: t.paneInvalid })
|
|
8744
9202
|
] });
|
|
8745
9203
|
}
|
|
8746
9204
|
var DAYS = (n) => Number.isInteger(n) && n >= 1 && n <= 3650;
|
|
@@ -8748,7 +9206,7 @@ var badRetention = (h) => !h || !DAYS(h.retentionDays) || !DAYS(h.eventDays) ||
|
|
|
8748
9206
|
function HistorySettings({ types, history, set: set2, t, disabled, ToggleField: ToggleField2, TextField: TextField2 }) {
|
|
8749
9207
|
const all = history.contentTypes === "all";
|
|
8750
9208
|
const list2 = all ? [] : history.contentTypes;
|
|
8751
|
-
const number = (key) => /* @__PURE__ */ (0,
|
|
9209
|
+
const number = (key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 200 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8752
9210
|
TextField2,
|
|
8753
9211
|
{
|
|
8754
9212
|
name: `history-${key}`,
|
|
@@ -8758,15 +9216,15 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8758
9216
|
onChange: (v) => set2(key, /^\d{1,5}$/.test(v.trim()) ? Number(v.trim()) : NaN)
|
|
8759
9217
|
}
|
|
8760
9218
|
) });
|
|
8761
|
-
return /* @__PURE__ */ (0,
|
|
8762
|
-
/* @__PURE__ */ (0,
|
|
8763
|
-
/* @__PURE__ */ (0,
|
|
8764
|
-
/* @__PURE__ */ (0,
|
|
8765
|
-
/* @__PURE__ */ (0,
|
|
8766
|
-
!all && /* @__PURE__ */ (0,
|
|
8767
|
-
/* @__PURE__ */ (0,
|
|
8768
|
-
types.map((type) => /* @__PURE__ */ (0,
|
|
8769
|
-
/* @__PURE__ */ (0,
|
|
9219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "history-settings", children: [
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.historySettings }),
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.historySettingsHelp }),
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "history-enabled", label: t.historyEnabled, value: history.enabled, disabled, onChange: (v) => set2("enabled", v) }),
|
|
9223
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "history-all", label: t.historyAll, value: all, disabled: disabled || !history.enabled, onChange: (v) => set2("contentTypes", v ? "all" : types.map((type) => type.uid)) }),
|
|
9224
|
+
!all && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Checks, { disabled: disabled || !history.enabled, children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("legend", { children: t.historyTypes }),
|
|
9226
|
+
types.map((type) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
9227
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8770
9228
|
"input",
|
|
8771
9229
|
{
|
|
8772
9230
|
type: "checkbox",
|
|
@@ -8778,13 +9236,13 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8778
9236
|
type.displayName
|
|
8779
9237
|
] }, type.uid))
|
|
8780
9238
|
] }),
|
|
8781
|
-
/* @__PURE__ */ (0,
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
|
|
8782
9240
|
number("retentionDays"),
|
|
8783
9241
|
number("maxSnapshots"),
|
|
8784
9242
|
number("eventDays"),
|
|
8785
9243
|
number("trashDays")
|
|
8786
9244
|
] }),
|
|
8787
|
-
/* @__PURE__ */ (0,
|
|
9245
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: badRetention(history) ? "danger600" : "neutral600", role: badRetention(history) ? "alert" : void 0, children: badRetention(history) ? t.historyInvalid : `${t.historyRetentionHelp} ${t.trashDaysHelp}` })
|
|
8788
9246
|
] }) });
|
|
8789
9247
|
}
|
|
8790
9248
|
function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: SelectField2, TextField: TextField2 }) {
|
|
@@ -8798,10 +9256,10 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8798
9256
|
};
|
|
8799
9257
|
const fields = (type.attributes || []).filter((attr) => !SYSTEM_FIELDS2.includes(attr.name));
|
|
8800
9258
|
const id = (name, index) => `sidebar-${name}-${type.uid}${index === void 0 ? "" : `-${index}`}`;
|
|
8801
|
-
return /* @__PURE__ */ (0,
|
|
8802
|
-
/* @__PURE__ */ (0,
|
|
8803
|
-
/* @__PURE__ */ (0,
|
|
8804
|
-
/* @__PURE__ */ (0,
|
|
9259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, "data-testid": `sidebar-editor-${type.uid}`, children: [
|
|
9260
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "delta", tag: "h3", children: t.f("sidebarTitle", { name: type.displayName }) }),
|
|
9261
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.sidebarHelp }),
|
|
9262
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { maxWidth: 240 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8805
9263
|
SelectField2,
|
|
8806
9264
|
{
|
|
8807
9265
|
name: id("position"),
|
|
@@ -8812,21 +9270,21 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8812
9270
|
onChange: (v) => set2("sidebarPosition", v, "left")
|
|
8813
9271
|
}
|
|
8814
9272
|
) }),
|
|
8815
|
-
items2.map((item, index) => /* @__PURE__ */ (0,
|
|
8816
|
-
/* @__PURE__ */ (0,
|
|
8817
|
-
/* @__PURE__ */ (0,
|
|
8818
|
-
/* @__PURE__ */ (0,
|
|
9273
|
+
items2.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Item, { "data-testid": id("item", index), children: [
|
|
9274
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
|
|
9275
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { flex: "1 1 200px" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TextField2, { name: id("label", index), label: t.sidebarItemLabel, value: item.label, disabled, onChange: (v) => edit(index, { label: v }) }) }),
|
|
9276
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 180 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8819
9277
|
SelectField2,
|
|
8820
9278
|
{
|
|
8821
9279
|
name: id("icon", index),
|
|
8822
9280
|
label: t.sidebarIcon,
|
|
8823
9281
|
value: item.icon || "none",
|
|
8824
9282
|
disabled,
|
|
8825
|
-
options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */ (0,
|
|
9283
|
+
options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: value, size: 16 }) }))],
|
|
8826
9284
|
onChange: (v) => edit(index, { icon: v === "none" ? void 0 : v })
|
|
8827
9285
|
}
|
|
8828
9286
|
) }),
|
|
8829
|
-
/* @__PURE__ */ (0,
|
|
9287
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 160 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8830
9288
|
SelectField2,
|
|
8831
9289
|
{
|
|
8832
9290
|
name: id("open", index),
|
|
@@ -8837,16 +9295,16 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8837
9295
|
onChange: (v) => edit(index, { open: v })
|
|
8838
9296
|
}
|
|
8839
9297
|
) }),
|
|
8840
|
-
/* @__PURE__ */ (0,
|
|
8841
|
-
/* @__PURE__ */ (0,
|
|
8842
|
-
/* @__PURE__ */ (0,
|
|
8843
|
-
/* @__PURE__ */ (0,
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 1, paddingBottom: 1, children: [
|
|
9299
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index === 0, onClick: () => move(index, -1) }),
|
|
9300
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index === items2.length - 1, onClick: () => move(index, 1) }),
|
|
9301
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "close", label: t.sidebarRemove, disabled, onClick: () => save(items2.filter((_, i) => i !== index)) })
|
|
8844
9302
|
] })
|
|
8845
9303
|
] }),
|
|
8846
|
-
/* @__PURE__ */ (0,
|
|
8847
|
-
/* @__PURE__ */ (0,
|
|
8848
|
-
fields.map((attr) => /* @__PURE__ */ (0,
|
|
8849
|
-
/* @__PURE__ */ (0,
|
|
9304
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Checks, { disabled, children: [
|
|
9305
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("legend", { children: t.sidebarFields }),
|
|
9306
|
+
fields.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
9307
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8850
9308
|
"input",
|
|
8851
9309
|
{
|
|
8852
9310
|
type: "checkbox",
|
|
@@ -8858,11 +9316,11 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8858
9316
|
attr.name
|
|
8859
9317
|
] }, attr.name))
|
|
8860
9318
|
] }),
|
|
8861
|
-
badItem(item) && /* @__PURE__ */ (0,
|
|
9319
|
+
badItem(item) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", variant: "pi", textColor: "danger600", children: t.sidebarInvalid })
|
|
8862
9320
|
] }, index)),
|
|
8863
|
-
/* @__PURE__ */ (0,
|
|
8864
|
-
/* @__PURE__ */ (0,
|
|
8865
|
-
|
|
9321
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 2, alignItems: "center", children: [
|
|
9322
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9323
|
+
import_design_system8.Button,
|
|
8866
9324
|
{
|
|
8867
9325
|
variant: "secondary",
|
|
8868
9326
|
size: "S",
|
|
@@ -8872,7 +9330,7 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8872
9330
|
children: t.sidebarAdd
|
|
8873
9331
|
}
|
|
8874
9332
|
),
|
|
8875
|
-
items2.length >= SIDEBAR_MAX && /* @__PURE__ */ (0,
|
|
9333
|
+
items2.length >= SIDEBAR_MAX && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.f("sidebarLimit", { max: SIDEBAR_MAX }) })
|
|
8876
9334
|
] })
|
|
8877
9335
|
] });
|
|
8878
9336
|
}
|
|
@@ -8881,18 +9339,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8881
9339
|
const t = useMessages();
|
|
8882
9340
|
const { get, put, del } = useClient();
|
|
8883
9341
|
const { canRead, canUpdate, isLoading } = usePermissions2();
|
|
8884
|
-
const [data, setData] =
|
|
8885
|
-
const [catalog, setCatalog] =
|
|
8886
|
-
const [settings, setSettings] =
|
|
8887
|
-
const [media, setMedia] =
|
|
8888
|
-
const [sources, setSources] =
|
|
8889
|
-
const [dirty, setDirty] =
|
|
8890
|
-
const [saving, setSaving] =
|
|
8891
|
-
const [status, setStatus] =
|
|
8892
|
-
const [failed, setFailed] =
|
|
8893
|
-
const [filter, setFilter] =
|
|
8894
|
-
const [picking, setPicking] =
|
|
8895
|
-
|
|
9342
|
+
const [data, setData] = React12.useState(null);
|
|
9343
|
+
const [catalog, setCatalog] = React12.useState(null);
|
|
9344
|
+
const [settings, setSettings] = React12.useState(null);
|
|
9345
|
+
const [media, setMedia] = React12.useState({});
|
|
9346
|
+
const [sources, setSources] = React12.useState({});
|
|
9347
|
+
const [dirty, setDirty] = React12.useState(false);
|
|
9348
|
+
const [saving, setSaving] = React12.useState(false);
|
|
9349
|
+
const [status, setStatus] = React12.useState("");
|
|
9350
|
+
const [failed, setFailed] = React12.useState(false);
|
|
9351
|
+
const [filter, setFilter] = React12.useState("");
|
|
9352
|
+
const [picking, setPicking] = React12.useState(null);
|
|
9353
|
+
React12.useEffect(() => {
|
|
8896
9354
|
if (!canRead || isLoading) return;
|
|
8897
9355
|
let active = true;
|
|
8898
9356
|
Promise.all([get("/blockscene/settings"), get("/blockscene/catalog")]).then(([s, c]) => {
|
|
@@ -8970,36 +9428,36 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8970
9428
|
return index === 0 && manual ? t.manual : t.automatic;
|
|
8971
9429
|
};
|
|
8972
9430
|
const ready = !isLoading && canRead && !failed && settings && catalog;
|
|
8973
|
-
const header =
|
|
8974
|
-
const [floating, setFloating] =
|
|
9431
|
+
const header = React12.useRef(null);
|
|
9432
|
+
const [floating, setFloating] = React12.useState(false);
|
|
8975
9433
|
const main = useMainRect2(header);
|
|
8976
|
-
|
|
9434
|
+
React12.useEffect(() => {
|
|
8977
9435
|
const el = header.current;
|
|
8978
9436
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
8979
9437
|
const observer = new IntersectionObserver(([entry]) => setFloating(!entry.isIntersecting && entry.boundingClientRect.top < 0));
|
|
8980
9438
|
observer.observe(el);
|
|
8981
9439
|
return () => observer.disconnect();
|
|
8982
9440
|
}, [ready]);
|
|
8983
|
-
const controls = (suffix) => ready && /* @__PURE__ */ (0,
|
|
8984
|
-
/* @__PURE__ */ (0,
|
|
8985
|
-
!suffix && /* @__PURE__ */ (0,
|
|
8986
|
-
/* @__PURE__ */ (0,
|
|
9441
|
+
const controls = (suffix) => ready && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 3, alignItems: "center", wrap: "wrap", children: [
|
|
9442
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "status", "aria-live": "polite", textColor: dirty ? "warning700" : "neutral600", "data-testid": `${dirty ? "unsaved-indicator" : "save-status"}${suffix}`, children: dirty ? t.unsaved : status || t.noChanges }),
|
|
9443
|
+
!suffix && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Button, { variant: "tertiary", onClick: restore, disabled: !canUpdate || saving, "data-testid": "restore-blockscene-settings", children: data.projectDefaults ? t.restoreProject : t.resetAll }),
|
|
9444
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Button, { onClick: save, disabled: !canUpdate || invalid || !dirty, loading: saving, "data-testid": `save-blockscene-settings${suffix}`, children: t.save })
|
|
8987
9445
|
] });
|
|
8988
|
-
return /* @__PURE__ */ (0,
|
|
8989
|
-
/* @__PURE__ */ (0,
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
9446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 8, background: "neutral100", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 5, children: [
|
|
9447
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: header, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
|
|
9448
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "alpha", tag: "h1", children: t.settingsTitle }),
|
|
8991
9449
|
controls("")
|
|
8992
9450
|
] }) }),
|
|
8993
|
-
floating && main.width > 0 && /* @__PURE__ */ (0,
|
|
8994
|
-
/* @__PURE__ */ (0,
|
|
9451
|
+
floating && main.width > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Bar, { style: { left: main.left, width: main.width }, "data-testid": "settings-floating-bar", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
|
|
9452
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "p", children: t.settingsTitle }),
|
|
8995
9453
|
controls("-floating")
|
|
8996
9454
|
] }) }),
|
|
8997
|
-
/* @__PURE__ */ (0,
|
|
8998
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8999
|
-
data.disabled && /* @__PURE__ */ (0,
|
|
9000
|
-
/* @__PURE__ */ (0,
|
|
9001
|
-
/* @__PURE__ */ (0,
|
|
9002
|
-
/* @__PURE__ */ (0,
|
|
9455
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { textColor: "neutral600", children: t.settingsIntro }),
|
|
9456
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { children: "\u2026" }) : !canRead ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", children: t.denied }) : failed ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", children: t.loadFailed }) : !settings || !catalog ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { children: t.loading }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9457
|
+
data.disabled && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 4, background: "warning100", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", textColor: "warning700", children: t.disabledByServer }) }),
|
|
9458
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9459
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.palette }),
|
|
9460
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Swatches, { children: Object.keys(DEFAULT_PALETTE).map((key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9003
9461
|
ColorField,
|
|
9004
9462
|
{
|
|
9005
9463
|
name: `palette-${key}`,
|
|
@@ -9013,43 +9471,43 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9013
9471
|
},
|
|
9014
9472
|
key
|
|
9015
9473
|
)) }),
|
|
9016
|
-
badColor && /* @__PURE__ */ (0,
|
|
9017
|
-
/* @__PURE__ */ (0,
|
|
9018
|
-
/* @__PURE__ */ (0,
|
|
9019
|
-
/* @__PURE__ */ (0,
|
|
9020
|
-
/* @__PURE__ */ (0,
|
|
9474
|
+
badColor && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", textColor: "danger600", children: t.invalidColor }),
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.previewLabel }),
|
|
9476
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Swatches, { "data-testid": "palette-preview", children: TEMPLATES.map((template) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", gap: 1, children: [
|
|
9477
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { aspectRatio: "16 / 9", overflow: "hidden" }, hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Wireframe, { template, palette: settings.palette }) }),
|
|
9478
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.templates[template] })
|
|
9021
9479
|
] }, template)) }),
|
|
9022
|
-
/* @__PURE__ */ (0,
|
|
9480
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Flex, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Button, { variant: "tertiary", size: "S", disabled: !canUpdate, onClick: () => update((s) => {
|
|
9023
9481
|
s.palette = { ...DEFAULT_PALETTE };
|
|
9024
9482
|
return s;
|
|
9025
9483
|
}), children: t.resetPalette }) })
|
|
9026
9484
|
] }) }),
|
|
9027
|
-
/* @__PURE__ */ (0,
|
|
9028
|
-
/* @__PURE__ */ (0,
|
|
9029
|
-
/* @__PURE__ */ (0,
|
|
9485
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9486
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.editor }),
|
|
9487
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-enabled", label: t.enabled, value: editor.enabled, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9030
9488
|
s.editor.enabled = v;
|
|
9031
9489
|
return s;
|
|
9032
9490
|
}) }),
|
|
9033
|
-
/* @__PURE__ */ (0,
|
|
9034
|
-
/* @__PURE__ */ (0,
|
|
9491
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.enabledHelp }),
|
|
9492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-showOpenAll", label: t.showOpenAll, value: editor.showOpenAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9035
9493
|
s.editor.showOpenAll = v;
|
|
9036
9494
|
return s;
|
|
9037
9495
|
}) }),
|
|
9038
|
-
/* @__PURE__ */ (0,
|
|
9496
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-showCloseAll", label: t.showCloseAll, value: editor.showCloseAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9039
9497
|
s.editor.showCloseAll = v;
|
|
9040
9498
|
return s;
|
|
9041
9499
|
}) }),
|
|
9042
|
-
/* @__PURE__ */ (0,
|
|
9043
|
-
/* @__PURE__ */ (0,
|
|
9500
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.toggleHelp }),
|
|
9501
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-showRowThumbnails", label: t.showRowThumbnails, value: editor.showRowThumbnails !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9044
9502
|
s.editor.showRowThumbnails = v;
|
|
9045
9503
|
return s;
|
|
9046
9504
|
}) }),
|
|
9047
|
-
/* @__PURE__ */ (0,
|
|
9505
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-friendlyLabels", label: t.friendlyLabels, value: editor.friendlyLabels !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9048
9506
|
s.editor.friendlyLabels = v;
|
|
9049
9507
|
return s;
|
|
9050
9508
|
}) }),
|
|
9051
|
-
/* @__PURE__ */ (0,
|
|
9052
|
-
/* @__PURE__ */ (0,
|
|
9509
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.friendlyLabelsHelp }),
|
|
9510
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9053
9511
|
SelectField2,
|
|
9054
9512
|
{
|
|
9055
9513
|
name: "editor-initialState",
|
|
@@ -9063,8 +9521,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9063
9521
|
})
|
|
9064
9522
|
}
|
|
9065
9523
|
),
|
|
9066
|
-
/* @__PURE__ */ (0,
|
|
9067
|
-
/* @__PURE__ */ (0,
|
|
9524
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.rememberHelp }),
|
|
9525
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9068
9526
|
TextField2,
|
|
9069
9527
|
{
|
|
9070
9528
|
name: "editor-blockPreviewUrl",
|
|
@@ -9078,8 +9536,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9078
9536
|
})
|
|
9079
9537
|
}
|
|
9080
9538
|
),
|
|
9081
|
-
/* @__PURE__ */ (0,
|
|
9082
|
-
/* @__PURE__ */ (0,
|
|
9539
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.blockPreviewUrlHelp }),
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9083
9541
|
TextField2,
|
|
9084
9542
|
{
|
|
9085
9543
|
name: "editor-previewUrl",
|
|
@@ -9093,9 +9551,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9093
9551
|
})
|
|
9094
9552
|
}
|
|
9095
9553
|
),
|
|
9096
|
-
/* @__PURE__ */ (0,
|
|
9097
|
-
!editor.previewUrl && /* @__PURE__ */ (0,
|
|
9098
|
-
/* @__PURE__ */ (0,
|
|
9554
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.previewUrlHelp }),
|
|
9555
|
+
!editor.previewUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "warning700", "data-testid": "preview-url-empty", children: t.previewUrlEmpty }),
|
|
9556
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9099
9557
|
SelectField2,
|
|
9100
9558
|
{
|
|
9101
9559
|
name: "editor-previewMode",
|
|
@@ -9109,12 +9567,13 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9109
9567
|
})
|
|
9110
9568
|
}
|
|
9111
9569
|
),
|
|
9112
|
-
/* @__PURE__ */ (0,
|
|
9113
|
-
/* @__PURE__ */ (0,
|
|
9114
|
-
/* @__PURE__ */ (0,
|
|
9570
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.previewModeHelp }),
|
|
9571
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "delta", tag: "h3", children: t.paneTitle }),
|
|
9572
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9115
9573
|
PaneEditor,
|
|
9116
9574
|
{
|
|
9117
9575
|
id: "editor",
|
|
9576
|
+
versions: Boolean(data.historyTypes),
|
|
9118
9577
|
toolbar: editor.previewToolbar || TOOLBAR2,
|
|
9119
9578
|
devices: editor.previewDevices || DEVICE_NAMES,
|
|
9120
9579
|
t,
|
|
@@ -9126,12 +9585,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9126
9585
|
})
|
|
9127
9586
|
}
|
|
9128
9587
|
),
|
|
9129
|
-
lazyEditors && /* @__PURE__ */ (0,
|
|
9130
|
-
/* @__PURE__ */ (0,
|
|
9588
|
+
lazyEditors && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9589
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-lazyEditors", label: t.lazyEditors, value: editor.lazyEditors !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9131
9590
|
s.editor.lazyEditors = v;
|
|
9132
9591
|
return s;
|
|
9133
9592
|
}) }),
|
|
9134
|
-
/* @__PURE__ */ (0,
|
|
9593
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9135
9594
|
UidListField,
|
|
9136
9595
|
{
|
|
9137
9596
|
TextField: TextField2,
|
|
@@ -9146,31 +9605,31 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9146
9605
|
})
|
|
9147
9606
|
}
|
|
9148
9607
|
),
|
|
9149
|
-
/* @__PURE__ */ (0,
|
|
9150
|
-
data.blockPreviewAvailable && /* @__PURE__ */ (0,
|
|
9151
|
-
/* @__PURE__ */ (0,
|
|
9608
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: badLazy ? "danger600" : "neutral600", role: badLazy ? "alert" : void 0, children: badLazy ? t.f("lazyFieldsInvalid", { max: LAZY_MAX }) : t.lazyEditorsHelp }),
|
|
9609
|
+
data.blockPreviewAvailable && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9610
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-blockPreviewInForm", label: t.blockPreviewInForm, value: editor.blockPreviewInForm, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9152
9611
|
s.editor.blockPreviewInForm = v;
|
|
9153
9612
|
return s;
|
|
9154
9613
|
}) }),
|
|
9155
|
-
/* @__PURE__ */ (0,
|
|
9614
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
|
|
9156
9615
|
] })
|
|
9157
9616
|
] })
|
|
9158
9617
|
] }) }),
|
|
9159
|
-
/* @__PURE__ */ (0,
|
|
9160
|
-
/* @__PURE__ */ (0,
|
|
9161
|
-
/* @__PURE__ */ (0,
|
|
9618
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "row-actions-settings", children: [
|
|
9619
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.rowActionsTitle }),
|
|
9620
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-confirmDelete", label: t.confirmDeleteOption, value: editor.confirmDelete !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9162
9621
|
s.editor.confirmDelete = v;
|
|
9163
9622
|
return s;
|
|
9164
9623
|
}) }),
|
|
9165
|
-
/* @__PURE__ */ (0,
|
|
9624
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-duplicate", label: t.duplicateOption, value: editor.duplicate !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9166
9625
|
s.editor.duplicate = v;
|
|
9167
9626
|
return s;
|
|
9168
9627
|
}) }),
|
|
9169
|
-
/* @__PURE__ */ (0,
|
|
9628
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleField2, { name: "editor-clipboard", label: t.clipboardOption, value: editor.clipboard !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
|
|
9170
9629
|
s.editor.clipboard = v;
|
|
9171
9630
|
return s;
|
|
9172
9631
|
}) }),
|
|
9173
|
-
/* @__PURE__ */ (0,
|
|
9632
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9174
9633
|
SelectField2,
|
|
9175
9634
|
{
|
|
9176
9635
|
name: "editor-hiddenBlocks",
|
|
@@ -9184,9 +9643,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9184
9643
|
})
|
|
9185
9644
|
}
|
|
9186
9645
|
),
|
|
9187
|
-
/* @__PURE__ */ (0,
|
|
9646
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: data.hiddenAttribute ? t.hiddenBlocksHelp : t.hiddenAttributeOff })
|
|
9188
9647
|
] }) }),
|
|
9189
|
-
data.historyTypes && settings.history && /* @__PURE__ */ (0,
|
|
9648
|
+
data.historyTypes && settings.history && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9190
9649
|
HistorySettings,
|
|
9191
9650
|
{
|
|
9192
9651
|
types: data.historyTypes,
|
|
@@ -9201,9 +9660,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9201
9660
|
})
|
|
9202
9661
|
}
|
|
9203
9662
|
),
|
|
9204
|
-
(data.contentTypes || []).length > 0 && /* @__PURE__ */ (0,
|
|
9205
|
-
/* @__PURE__ */ (0,
|
|
9206
|
-
/* @__PURE__ */ (0,
|
|
9663
|
+
(data.contentTypes || []).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "content-types", children: [
|
|
9664
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.contentTypes }),
|
|
9665
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.contentTypesHelp }),
|
|
9207
9666
|
data.contentTypes.map((type) => {
|
|
9208
9667
|
const entry = settings.contentTypes?.[type.uid] || {};
|
|
9209
9668
|
const set2 = (key, value, fallback) => update((s) => {
|
|
@@ -9215,9 +9674,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9215
9674
|
else delete s.contentTypes[type.uid];
|
|
9216
9675
|
return s;
|
|
9217
9676
|
});
|
|
9218
|
-
return /* @__PURE__ */ (0,
|
|
9219
|
-
/* @__PURE__ */ (0,
|
|
9220
|
-
/* @__PURE__ */ (0,
|
|
9677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9678
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 6, alignItems: "flex-end", wrap: "wrap", "data-testid": `content-type-${type.uid}`, children: [
|
|
9679
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 220 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9221
9680
|
ToggleField2,
|
|
9222
9681
|
{
|
|
9223
9682
|
name: `type-enabled-${type.uid}`,
|
|
@@ -9227,7 +9686,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9227
9686
|
onChange: (v) => set2("enabled", v, true)
|
|
9228
9687
|
}
|
|
9229
9688
|
) }),
|
|
9230
|
-
/* @__PURE__ */ (0,
|
|
9689
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 240 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9231
9690
|
SelectField2,
|
|
9232
9691
|
{
|
|
9233
9692
|
name: `type-mode-${type.uid}`,
|
|
@@ -9239,9 +9698,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9239
9698
|
}
|
|
9240
9699
|
) })
|
|
9241
9700
|
] }),
|
|
9242
|
-
entry.enabled !== false && /* @__PURE__ */ (0,
|
|
9243
|
-
entry.enabled !== false && /* @__PURE__ */ (0,
|
|
9244
|
-
/* @__PURE__ */ (0,
|
|
9701
|
+
entry.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SidebarEditor, { type, entry, set: set2, t, disabled: !canUpdate || saving, SelectField: SelectField2, TextField: TextField2 }),
|
|
9702
|
+
entry.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, children: [
|
|
9703
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9245
9704
|
ToggleField2,
|
|
9246
9705
|
{
|
|
9247
9706
|
name: `type-pane-${type.uid}`,
|
|
@@ -9254,10 +9713,11 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9254
9713
|
}
|
|
9255
9714
|
}
|
|
9256
9715
|
),
|
|
9257
|
-
(entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ (0,
|
|
9716
|
+
(entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9258
9717
|
PaneEditor,
|
|
9259
9718
|
{
|
|
9260
9719
|
id: `type-${type.uid}`,
|
|
9720
|
+
versions: Boolean(data.historyTypes),
|
|
9261
9721
|
toolbar: entry.previewToolbar || editor.previewToolbar || TOOLBAR2,
|
|
9262
9722
|
devices: entry.previewDevices || editor.previewDevices || DEVICE_NAMES,
|
|
9263
9723
|
t,
|
|
@@ -9269,18 +9729,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9269
9729
|
] })
|
|
9270
9730
|
] }, type.uid);
|
|
9271
9731
|
}),
|
|
9272
|
-
badSidebar && /* @__PURE__ */ (0,
|
|
9732
|
+
badSidebar && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", textColor: "danger600", children: t.sidebarInvalidSave })
|
|
9273
9733
|
] }) }),
|
|
9274
|
-
/* @__PURE__ */ (0,
|
|
9275
|
-
/* @__PURE__ */ (0,
|
|
9276
|
-
/* @__PURE__ */ (0,
|
|
9277
|
-
/* @__PURE__ */ (0,
|
|
9278
|
-
/* @__PURE__ */ (0,
|
|
9734
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
9735
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "beta", tag: "h2", children: t.components }),
|
|
9736
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Searchbar, { name: "component-filter", value: filter, placeholder: t.filter, clearLabel: t.clear, onClear: () => setFilter(""), onChange: (e) => setFilter(e.target.value), children: t.filter }),
|
|
9737
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", "data-testid": "components-count", children: t.f("countAll", { count: components.length }) }),
|
|
9738
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Grid2, { "data-testid": "components-grid", children: components.map((component) => {
|
|
9279
9739
|
const entry = settings.components[component.uid] || {};
|
|
9280
9740
|
const meta = { ...catalog.components?.[component.uid] || {}, ...media[component.uid] || {} };
|
|
9281
9741
|
const candidates = candidatesFor(component.uid, meta, catalog);
|
|
9282
|
-
return /* @__PURE__ */ (0,
|
|
9283
|
-
/* @__PURE__ */ (0,
|
|
9742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Card2, { "data-testid": `settings-${component.uid}`, children: [
|
|
9743
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9284
9744
|
Thumb,
|
|
9285
9745
|
{
|
|
9286
9746
|
candidates,
|
|
@@ -9291,23 +9751,23 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9291
9751
|
onResolved: (index) => setSources((current) => current[component.uid] === index ? current : { ...current, [component.uid]: index })
|
|
9292
9752
|
}
|
|
9293
9753
|
),
|
|
9294
|
-
/* @__PURE__ */ (0,
|
|
9295
|
-
/* @__PURE__ */ (0,
|
|
9296
|
-
/* @__PURE__ */ (0,
|
|
9754
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
9755
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { fontWeight: "bold", textColor: "neutral800", children: component.displayName }),
|
|
9756
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
9297
9757
|
component.uid,
|
|
9298
9758
|
" \xB7 ",
|
|
9299
9759
|
component.category
|
|
9300
9760
|
] }),
|
|
9301
|
-
/* @__PURE__ */ (0,
|
|
9761
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Typography, { variant: "pi", "data-testid": `source-${component.uid}`, children: [
|
|
9302
9762
|
t.source,
|
|
9303
9763
|
": ",
|
|
9304
9764
|
sourceOf(component.uid, Boolean(meta.manualImage)),
|
|
9305
9765
|
meta.manualName ? ` (${meta.manualName})` : ""
|
|
9306
9766
|
] }),
|
|
9307
|
-
meta.manualMissing && /* @__PURE__ */ (0,
|
|
9308
|
-
/* @__PURE__ */ (0,
|
|
9309
|
-
/* @__PURE__ */ (0,
|
|
9310
|
-
entry.mediaId && /* @__PURE__ */ (0,
|
|
9767
|
+
meta.manualMissing && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", role: "alert", textColor: "danger600", children: t.brokenMedia }),
|
|
9768
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 2, wrap: "wrap", children: [
|
|
9769
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Button, { variant: "secondary", size: "S", disabled: !canUpdate || saving, onClick: () => setPicking(component.uid), children: entry.mediaId ? t.replace : t.choose }),
|
|
9770
|
+
entry.mediaId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Button, { variant: "tertiary", size: "S", disabled: !canUpdate || saving, onClick: () => {
|
|
9311
9771
|
update((s) => {
|
|
9312
9772
|
delete s.components[component.uid]?.mediaId;
|
|
9313
9773
|
if (!Object.keys(s.components[component.uid] || {}).length) delete s.components[component.uid];
|
|
@@ -9320,7 +9780,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9320
9780
|
});
|
|
9321
9781
|
}, children: t.useAutomatic })
|
|
9322
9782
|
] }),
|
|
9323
|
-
/* @__PURE__ */ (0,
|
|
9783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9324
9784
|
SelectField2,
|
|
9325
9785
|
{
|
|
9326
9786
|
name: `template-${component.uid}`,
|
|
@@ -9334,7 +9794,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9334
9794
|
})
|
|
9335
9795
|
}
|
|
9336
9796
|
),
|
|
9337
|
-
/* @__PURE__ */ (0,
|
|
9797
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9338
9798
|
SelectField2,
|
|
9339
9799
|
{
|
|
9340
9800
|
name: `typology-${component.uid}`,
|
|
@@ -9345,7 +9805,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9345
9805
|
onChange: (v) => setComponent(component.uid, "typology", v === "auto" ? void 0 : v)
|
|
9346
9806
|
}
|
|
9347
9807
|
),
|
|
9348
|
-
/* @__PURE__ */ (0,
|
|
9808
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9349
9809
|
TagsField,
|
|
9350
9810
|
{
|
|
9351
9811
|
name: `tags-${component.uid}`,
|
|
@@ -9356,12 +9816,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9356
9816
|
onChange: (tags) => setComponent(component.uid, "tags", tags.length ? tags : void 0)
|
|
9357
9817
|
}
|
|
9358
9818
|
),
|
|
9359
|
-
meta.variants?.length > 0 && /* @__PURE__ */ (0,
|
|
9819
|
+
meta.variants?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", "data-testid": `variants-${component.uid}`, children: [
|
|
9360
9820
|
t.variantsFromCode,
|
|
9361
9821
|
": ",
|
|
9362
9822
|
meta.variants.map((item) => localized(item.label, t.locale) || item.id).join(", ")
|
|
9363
9823
|
] }),
|
|
9364
|
-
catalog.groups?.[component.uid] && /* @__PURE__ */ (0,
|
|
9824
|
+
catalog.groups?.[component.uid] && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9365
9825
|
LayoutFields,
|
|
9366
9826
|
{
|
|
9367
9827
|
component,
|
|
@@ -9376,7 +9836,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9376
9836
|
] }, component.uid);
|
|
9377
9837
|
}) })
|
|
9378
9838
|
] }) }),
|
|
9379
|
-
picking && /* @__PURE__ */ (0,
|
|
9839
|
+
picking && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MediaPicker2, { onClose: () => setPicking(null), onSelect: (asset) => {
|
|
9380
9840
|
const uid = picking;
|
|
9381
9841
|
setPicking(null);
|
|
9382
9842
|
if (!asset?.id) return;
|
|
@@ -9392,8 +9852,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9392
9852
|
function LayoutFields({ component, layout, set: set2, t, disabled, SelectField: SelectField2 }) {
|
|
9393
9853
|
const fields = (component.layoutFields || []).map((name) => ({ value: name, label: name }));
|
|
9394
9854
|
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)));
|
|
9395
|
-
return /* @__PURE__ */ (0,
|
|
9396
|
-
/* @__PURE__ */ (0,
|
|
9855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": `layout-${component.uid}`, style: { width: "100%" }, children: [
|
|
9856
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9397
9857
|
SelectField2,
|
|
9398
9858
|
{
|
|
9399
9859
|
name: `layout-columns-${component.uid}`,
|
|
@@ -9404,8 +9864,8 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9404
9864
|
onChange: (v) => change("columnsField", v)
|
|
9405
9865
|
}
|
|
9406
9866
|
),
|
|
9407
|
-
layout?.columnsField && /* @__PURE__ */ (0,
|
|
9408
|
-
/* @__PURE__ */ (0,
|
|
9867
|
+
layout?.columnsField && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9868
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9409
9869
|
SelectField2,
|
|
9410
9870
|
{
|
|
9411
9871
|
name: `layout-mobile-${component.uid}`,
|
|
@@ -9416,7 +9876,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9416
9876
|
onChange: (v) => change("mobileColumnsField", v)
|
|
9417
9877
|
}
|
|
9418
9878
|
),
|
|
9419
|
-
/* @__PURE__ */ (0,
|
|
9879
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9420
9880
|
SelectField2,
|
|
9421
9881
|
{
|
|
9422
9882
|
name: `layout-max-${component.uid}`,
|
|
@@ -9428,7 +9888,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9428
9888
|
}
|
|
9429
9889
|
)
|
|
9430
9890
|
] }),
|
|
9431
|
-
/* @__PURE__ */ (0,
|
|
9891
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: fields.length ? t.layoutHelp : t.layoutNoFields })
|
|
9432
9892
|
] });
|
|
9433
9893
|
}
|
|
9434
9894
|
function register(app, Component2, to) {
|
|
@@ -9447,27 +9907,27 @@ function register(app, Component2, to) {
|
|
|
9447
9907
|
}
|
|
9448
9908
|
|
|
9449
9909
|
// admin/catalog.ts
|
|
9450
|
-
var
|
|
9910
|
+
var React14 = __toESM(require("react"));
|
|
9451
9911
|
|
|
9452
9912
|
// admin/FieldHelp.tsx
|
|
9453
|
-
var
|
|
9454
|
-
var
|
|
9455
|
-
var
|
|
9456
|
-
var
|
|
9457
|
-
var HelpButton =
|
|
9913
|
+
var React13 = __toESM(require("react"));
|
|
9914
|
+
var import_styled_components9 = __toESM(require("styled-components"));
|
|
9915
|
+
var import_design_system9 = require("@strapi/design-system");
|
|
9916
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
9917
|
+
var HelpButton = import_styled_components9.default.button`
|
|
9458
9918
|
display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: help; color: inherit;
|
|
9459
9919
|
&:hover, &:focus-visible { color: ${({ theme }) => theme.colors.primary600}; }
|
|
9460
9920
|
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
|
|
9461
9921
|
`;
|
|
9462
9922
|
function FieldHelp({ text, previous, title }) {
|
|
9463
9923
|
const m = useMessages();
|
|
9464
|
-
const kept2 =
|
|
9465
|
-
return /* @__PURE__ */ (0,
|
|
9924
|
+
const kept2 = React13.isValidElement(previous) && previous.props.title ? React13.cloneElement(previous, { title }) : previous;
|
|
9925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_design_system9.Flex, { gap: 1, alignItems: "center", children: [
|
|
9466
9926
|
kept2,
|
|
9467
|
-
/* @__PURE__ */ (0,
|
|
9927
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system9.Tooltip, { label: text, style: { maxWidth: 320 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HelpButton, { type: "button", "aria-label": m.fieldHelp, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "info", size: 14 }) }) })
|
|
9468
9928
|
] });
|
|
9469
9929
|
}
|
|
9470
|
-
var helpAction = (text, previous) => /* @__PURE__ */ (0,
|
|
9930
|
+
var helpAction = (text, previous) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldHelp, { text, previous, title: React13.isValidElement(previous) && previous.props.title || { id: "blockscene.fieldHelp" } });
|
|
9471
9931
|
|
|
9472
9932
|
// admin/catalog.ts
|
|
9473
9933
|
var cached = null;
|
|
@@ -9480,8 +9940,8 @@ var load = (get) => flight || (flight = get("/blockscene/catalog").then(({ data
|
|
|
9480
9940
|
flight = null;
|
|
9481
9941
|
}));
|
|
9482
9942
|
function useCatalog(get) {
|
|
9483
|
-
const [catalog, setCatalog] =
|
|
9484
|
-
|
|
9943
|
+
const [catalog, setCatalog] = React14.useState(null);
|
|
9944
|
+
React14.useEffect(() => {
|
|
9485
9945
|
let active = true;
|
|
9486
9946
|
load(get).then((data) => {
|
|
9487
9947
|
if (active) setCatalog(data);
|
|
@@ -9517,9 +9977,9 @@ var labelsHook = (get, relabel, drop) => (args) => {
|
|
|
9517
9977
|
};
|
|
9518
9978
|
|
|
9519
9979
|
// admin/LazyInput.tsx
|
|
9520
|
-
var
|
|
9521
|
-
var
|
|
9522
|
-
var
|
|
9980
|
+
var React15 = __toESM(require("react"));
|
|
9981
|
+
var import_design_system10 = require("@strapi/design-system");
|
|
9982
|
+
var import_styled_components10 = __toESM(require("styled-components"));
|
|
9523
9983
|
|
|
9524
9984
|
// admin/sanitize.mjs
|
|
9525
9985
|
var DROP = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "IFRAME", "FRAME", "OBJECT", "EMBED", "LINK", "META", "BASE", "FORM", "TEMPLATE", "NOSCRIPT"]);
|
|
@@ -9573,7 +10033,7 @@ function sanitizeHtml(html) {
|
|
|
9573
10033
|
}
|
|
9574
10034
|
|
|
9575
10035
|
// admin/LazyInput.tsx
|
|
9576
|
-
var
|
|
10036
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
9577
10037
|
var config = { on: false, fields: [] };
|
|
9578
10038
|
var listeners = /* @__PURE__ */ new Set();
|
|
9579
10039
|
function setLazyConfig(next) {
|
|
@@ -9589,7 +10049,7 @@ var subscribe = (run) => {
|
|
|
9589
10049
|
};
|
|
9590
10050
|
var read2 = () => config;
|
|
9591
10051
|
var lazyFor = (uid) => config.on && config.fields.includes(uid);
|
|
9592
|
-
var Preview =
|
|
10052
|
+
var Preview = import_styled_components10.default.div`
|
|
9593
10053
|
min-height: 240px; border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px; overflow: hidden;
|
|
9594
10054
|
background: ${({ theme, $disabled }) => $disabled ? theme.colors.neutral150 : theme.colors.neutral0};
|
|
9595
10055
|
color: ${({ theme }) => theme.colors.neutral800}; font-size: 1.4rem; line-height: 1.5;
|
|
@@ -9608,14 +10068,14 @@ var Preview = import_styled_components9.default.div`
|
|
|
9608
10068
|
`;
|
|
9609
10069
|
function Placeholder({ name, label, hint, error, required, labelAction, placeholder, value, disabled, onActivate }) {
|
|
9610
10070
|
const t = useMessages();
|
|
9611
|
-
const html =
|
|
10071
|
+
const html = React15.useMemo(() => typeof value === "string" ? sanitizeHtml(value) : value == null ? "" : null, [value]);
|
|
9612
10072
|
const activate = disabled ? void 0 : (event) => {
|
|
9613
10073
|
event.preventDefault();
|
|
9614
10074
|
onActivate();
|
|
9615
10075
|
};
|
|
9616
|
-
return /* @__PURE__ */ (0,
|
|
9617
|
-
/* @__PURE__ */ (0,
|
|
9618
|
-
/* @__PURE__ */ (0,
|
|
10076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Field.Root, { id: name, name, error, hint, required, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system10.Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
10077
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Field.Label, { action: labelAction, children: label }),
|
|
10078
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9619
10079
|
Preview,
|
|
9620
10080
|
{
|
|
9621
10081
|
id: name,
|
|
@@ -9631,22 +10091,22 @@ function Placeholder({ name, label, hint, error, required, labelAction, placehol
|
|
|
9631
10091
|
if (e.key === "Enter" || e.key === " ") activate?.(e);
|
|
9632
10092
|
},
|
|
9633
10093
|
children: [
|
|
9634
|
-
/* @__PURE__ */ (0,
|
|
9635
|
-
html === null ? /* @__PURE__ */ (0,
|
|
10094
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { "data-bar": true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Typography, { variant: "pi", textColor: "neutral500", children: disabled ? "" : t.lazyEdit }) }),
|
|
10095
|
+
html === null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { "data-body": true, children: JSON.stringify(value) }) : html ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { "data-body": true, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { "data-body": true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Typography, { textColor: "neutral500", children: placeholder || "" }) })
|
|
9636
10096
|
]
|
|
9637
10097
|
}
|
|
9638
10098
|
),
|
|
9639
|
-
/* @__PURE__ */ (0,
|
|
9640
|
-
/* @__PURE__ */ (0,
|
|
10099
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Field.Hint, {}),
|
|
10100
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system10.Field.Error, {})
|
|
9641
10101
|
] }) });
|
|
9642
10102
|
}
|
|
9643
10103
|
function lazyInput(uid, Real) {
|
|
9644
|
-
const Lazy =
|
|
9645
|
-
|
|
9646
|
-
const [active, setActive] =
|
|
9647
|
-
const box =
|
|
9648
|
-
const focus =
|
|
9649
|
-
|
|
10104
|
+
const Lazy = React15.forwardRef((props, ref) => {
|
|
10105
|
+
React15.useSyncExternalStore(subscribe, read2);
|
|
10106
|
+
const [active, setActive] = React15.useState(() => !lazyFor(uid));
|
|
10107
|
+
const box = React15.useRef(null);
|
|
10108
|
+
const focus = React15.useRef(false);
|
|
10109
|
+
React15.useEffect(() => {
|
|
9650
10110
|
if (!active || !focus.current) return;
|
|
9651
10111
|
focus.current = false;
|
|
9652
10112
|
let frame2 = 0;
|
|
@@ -9659,7 +10119,7 @@ function lazyInput(uid, Real) {
|
|
|
9659
10119
|
poll();
|
|
9660
10120
|
return () => cancelAnimationFrame(frame2);
|
|
9661
10121
|
}, [active]);
|
|
9662
|
-
return /* @__PURE__ */ (0,
|
|
10122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: box, style: { display: "contents" }, children: active || !lazyFor(uid) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Real, { ...props, ref }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Placeholder, { ...props, onActivate: () => {
|
|
9663
10123
|
focus.current = true;
|
|
9664
10124
|
setActive(true);
|
|
9665
10125
|
} }) });
|
|
@@ -9679,17 +10139,17 @@ function wrapCustomFields(app) {
|
|
|
9679
10139
|
}
|
|
9680
10140
|
|
|
9681
10141
|
// admin/Activity.tsx
|
|
9682
|
-
var
|
|
9683
|
-
var
|
|
9684
|
-
var
|
|
9685
|
-
var
|
|
10142
|
+
var React16 = __toESM(require("react"));
|
|
10143
|
+
var import_design_system11 = require("@strapi/design-system");
|
|
10144
|
+
var import_admin4 = require("@strapi/strapi/admin");
|
|
10145
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9686
10146
|
var ACTIVITY = [{ action: "plugin::blockscene.activity.read", subject: null }];
|
|
9687
10147
|
var TRASH = ["read", "restore", "purge"].map((name) => ({ action: `plugin::blockscene.trash.${name}`, subject: null }));
|
|
9688
10148
|
var ACTIONS = ["create", "update", "publish", "unpublish", "discard", "delete", "restore", "purge"];
|
|
9689
10149
|
var DAY = 24 * 60 * 60 * 1e3;
|
|
9690
10150
|
var contentMenuLink = (Component2) => ({
|
|
9691
10151
|
to: "plugins/blockscene",
|
|
9692
|
-
icon: () => /* @__PURE__ */ (0,
|
|
10152
|
+
icon: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "clock", size: 20 }),
|
|
9693
10153
|
intlLabel: { id: "blockscene.contentMenu", defaultMessage: "Activity and trash" },
|
|
9694
10154
|
permissions: [...ACTIVITY, TRASH[0]],
|
|
9695
10155
|
// Not an `async` function: Strapi 5 warns on AsyncFunction loaders.
|
|
@@ -9708,29 +10168,29 @@ var editUrl = (type, documentId, locale) => {
|
|
|
9708
10168
|
return `${base}/content-manager/${kind}/${type.uid}${kind === "single-types" ? "" : `/${encodeURIComponent(documentId)}`}${locale ? `?plugins[i18n][locale]=${encodeURIComponent(locale)}` : ""}`;
|
|
9709
10169
|
};
|
|
9710
10170
|
var query = (params) => new URLSearchParams(Object.entries(params).filter(([, v]) => v !== "" && v != null).map(([k, v]) => [k, String(v)])).toString();
|
|
9711
|
-
var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ (0,
|
|
9712
|
-
/* @__PURE__ */ (0,
|
|
9713
|
-
/* @__PURE__ */ (0,
|
|
10171
|
+
var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Box, { style: { minWidth: 180 }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Field.Root, { name, children: [
|
|
10172
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Field.Label, { children: label }),
|
|
10173
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.SingleSelect, { value, onChange: (v) => onChange(String(v)), children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.SingleSelectOption, { value: o.value, children: o.label }, o.value)) })
|
|
9714
10174
|
] }) });
|
|
9715
|
-
var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ (0,
|
|
9716
|
-
/* @__PURE__ */ (0,
|
|
9717
|
-
/* @__PURE__ */ (0,
|
|
10175
|
+
var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Box, { style: { minWidth: 160 }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Field.Root, { name, children: [
|
|
10176
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Field.Label, { children: label }),
|
|
10177
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.TextInput, { name, type, value, onChange: (e) => onChange(e.target.value) })
|
|
9718
10178
|
] }) });
|
|
9719
10179
|
function Pager({ t, pagination, setPage }) {
|
|
9720
10180
|
if (!pagination?.total) return null;
|
|
9721
10181
|
const { page, pageCount, total } = pagination;
|
|
9722
|
-
return /* @__PURE__ */ (0,
|
|
9723
|
-
/* @__PURE__ */ (0,
|
|
9724
|
-
/* @__PURE__ */ (0,
|
|
9725
|
-
/* @__PURE__ */ (0,
|
|
9726
|
-
/* @__PURE__ */ (0,
|
|
10182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { justifyContent: "space-between", alignItems: "center", paddingTop: 4, children: [
|
|
10183
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "neutral600", children: t.f("contentPage", { page, pages: Math.max(pageCount, 1), total }) }),
|
|
10184
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { gap: 2, children: [
|
|
10185
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", size: "S", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.contentPrevious }),
|
|
10186
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", size: "S", disabled: page >= pageCount, onClick: () => setPage(page + 1), children: t.contentNext })
|
|
9727
10187
|
] })
|
|
9728
10188
|
] });
|
|
9729
10189
|
}
|
|
9730
10190
|
function useList(get, path, params, refresh = 0) {
|
|
9731
|
-
const [state, setState] =
|
|
10191
|
+
const [state, setState] = React16.useState({ data: null, failed: false });
|
|
9732
10192
|
const key = `${path}?${query(params)}`;
|
|
9733
|
-
|
|
10193
|
+
React16.useEffect(() => {
|
|
9734
10194
|
let active = true;
|
|
9735
10195
|
setState((s) => ({ data: s.data, failed: false, loading: true }));
|
|
9736
10196
|
get(`/blockscene${key}`).then(({ data }) => active && setState({ data, failed: false })).catch(() => active && setState({ data: null, failed: true }));
|
|
@@ -9742,9 +10202,9 @@ function useList(get, path, params, refresh = 0) {
|
|
|
9742
10202
|
}
|
|
9743
10203
|
var Doc = ({ t, type, row, documentId, locale }) => {
|
|
9744
10204
|
const title = row.title || t.contentUntitled;
|
|
9745
|
-
return /* @__PURE__ */ (0,
|
|
9746
|
-
row.exists && type ? /* @__PURE__ */ (0,
|
|
9747
|
-
/* @__PURE__ */ (0,
|
|
10205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
|
10206
|
+
row.exists && type ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Link, { href: editUrl(type, documentId, locale), children: title }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { fontWeight: "bold", children: title }),
|
|
10207
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
9748
10208
|
type?.displayName || row.contentType,
|
|
9749
10209
|
locale ? ` \xB7 ${locale}` : "",
|
|
9750
10210
|
row.exists === false ? ` \xB7 ${t.contentGone}` : ""
|
|
@@ -9752,9 +10212,9 @@ var Doc = ({ t, type, row, documentId, locale }) => {
|
|
|
9752
10212
|
] });
|
|
9753
10213
|
};
|
|
9754
10214
|
function ActivityTab({ t, get }) {
|
|
9755
|
-
const [filters, setFilters] =
|
|
9756
|
-
const [search, setSearch] =
|
|
9757
|
-
const [page, setPage] =
|
|
10215
|
+
const [filters, setFilters] = React16.useState({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
|
|
10216
|
+
const [search, setSearch] = React16.useState("");
|
|
10217
|
+
const [page, setPage] = React16.useState(1);
|
|
9758
10218
|
const set2 = (key, value) => {
|
|
9759
10219
|
setFilters((f) => ({ ...f, [key]: value }));
|
|
9760
10220
|
setPage(1);
|
|
@@ -9766,13 +10226,13 @@ function ActivityTab({ t, get }) {
|
|
|
9766
10226
|
};
|
|
9767
10227
|
const { data, failed } = useList(get, "/activity", { ...filters, from: day(filters.from, false), to: day(filters.to, true), page, pageSize: 25 });
|
|
9768
10228
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9769
|
-
return /* @__PURE__ */ (0,
|
|
9770
|
-
data && !data.enabled && /* @__PURE__ */ (0,
|
|
9771
|
-
/* @__PURE__ */ (0,
|
|
10229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10230
|
+
data && !data.enabled && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Box, { padding: 3, background: "warning100", hasRadius: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "warning700", children: t.contentOff }) }),
|
|
10231
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { tag: "form", gap: 3, wrap: "wrap", alignItems: "flex-end", onSubmit: (e) => {
|
|
9772
10232
|
e.preventDefault();
|
|
9773
10233
|
set2("q", search.trim());
|
|
9774
10234
|
}, children: [
|
|
9775
|
-
/* @__PURE__ */ (0,
|
|
10235
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9776
10236
|
Select,
|
|
9777
10237
|
{
|
|
9778
10238
|
name: "actor",
|
|
@@ -9782,7 +10242,7 @@ function ActivityTab({ t, get }) {
|
|
|
9782
10242
|
options: [{ value: "", label: t.activityAnyone }, ...(data?.actors || []).map((a) => ({ value: a.actor, label: a.actorName || (a.actor === "system" ? t.historySystem : a.actor) }))]
|
|
9783
10243
|
}
|
|
9784
10244
|
),
|
|
9785
|
-
/* @__PURE__ */ (0,
|
|
10245
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9786
10246
|
Select,
|
|
9787
10247
|
{
|
|
9788
10248
|
name: "contentType",
|
|
@@ -9792,7 +10252,7 @@ function ActivityTab({ t, get }) {
|
|
|
9792
10252
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9793
10253
|
}
|
|
9794
10254
|
),
|
|
9795
|
-
/* @__PURE__ */ (0,
|
|
10255
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9796
10256
|
Select,
|
|
9797
10257
|
{
|
|
9798
10258
|
name: "action",
|
|
@@ -9802,35 +10262,35 @@ function ActivityTab({ t, get }) {
|
|
|
9802
10262
|
options: [{ value: "", label: t.activityAnyAction }, ...ACTIONS.map((a) => ({ value: a, label: t.historyActions[a] || a }))]
|
|
9803
10263
|
}
|
|
9804
10264
|
),
|
|
9805
|
-
/* @__PURE__ */ (0,
|
|
9806
|
-
/* @__PURE__ */ (0,
|
|
9807
|
-
/* @__PURE__ */ (0,
|
|
9808
|
-
/* @__PURE__ */ (0,
|
|
9809
|
-
/* @__PURE__ */ (0,
|
|
10265
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Input, { name: "from", type: "date", label: t.activityFrom, value: filters.from, onChange: (v) => set2("from", v) }),
|
|
10266
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Input, { name: "to", type: "date", label: t.activityTo, value: filters.to, onChange: (v) => set2("to", v) }),
|
|
10267
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Input, { name: "q", label: t.activitySearch, value: search, onChange: setSearch }),
|
|
10268
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { type: "submit", variant: "secondary", children: t.activitySearchButton }),
|
|
10269
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { type: "button", variant: "tertiary", onClick: () => {
|
|
9810
10270
|
setSearch("");
|
|
9811
10271
|
setFilters({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
|
|
9812
10272
|
setPage(1);
|
|
9813
10273
|
}, children: t.contentClear })
|
|
9814
10274
|
] }),
|
|
9815
|
-
failed ? /* @__PURE__ */ (0,
|
|
9816
|
-
/* @__PURE__ */ (0,
|
|
9817
|
-
/* @__PURE__ */ (0,
|
|
9818
|
-
/* @__PURE__ */ (0,
|
|
9819
|
-
/* @__PURE__ */ (0,
|
|
9820
|
-
/* @__PURE__ */ (0,
|
|
9821
|
-
/* @__PURE__ */ (0,
|
|
10275
|
+
failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { role: "alert", textColor: "danger600", children: t.activityFailed }) : !data ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { textColor: "neutral600", children: t.activityEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Box, { children: [
|
|
10276
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Table, { colCount: 4, rowCount: data.results.length + 1, "data-testid": "blockscene-activity", children: [
|
|
10277
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tr, { children: [
|
|
10278
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.activityWhen }) }),
|
|
10279
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.activityDocument }) }),
|
|
10280
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.activityWho }) }),
|
|
10281
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.activityWhat }) })
|
|
9822
10282
|
] }) }),
|
|
9823
|
-
/* @__PURE__ */ (0,
|
|
9824
|
-
/* @__PURE__ */ (0,
|
|
9825
|
-
/* @__PURE__ */ (0,
|
|
9826
|
-
/* @__PURE__ */ (0,
|
|
9827
|
-
/* @__PURE__ */ (0,
|
|
9828
|
-
/* @__PURE__ */ (0,
|
|
9829
|
-
/* @__PURE__ */ (0,
|
|
10283
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tbody, { children: data.results.map((event) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tr, { "data-testid": `activity-${event.id}`, children: [
|
|
10284
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: when(t, event.at) }) }),
|
|
10285
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Doc, { t, type: types.get(event.contentType), row: event, documentId: event.relatedDocumentId, locale: event.locale }) }),
|
|
10286
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: event.actorName || (event.actor === "system" ? t.historySystem : event.actor) }) }),
|
|
10287
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
|
10288
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "omega", fontWeight: "bold", children: t.historyActions[event.action] || event.action }),
|
|
10289
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { 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 ") })
|
|
9830
10290
|
] }) })
|
|
9831
10291
|
] }, event.id)) })
|
|
9832
10292
|
] }),
|
|
9833
|
-
/* @__PURE__ */ (0,
|
|
10293
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pager, { t, pagination: data.pagination, setPage })
|
|
9834
10294
|
] })
|
|
9835
10295
|
] });
|
|
9836
10296
|
}
|
|
@@ -9839,57 +10299,57 @@ function Report({ t, report }) {
|
|
|
9839
10299
|
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(", ") });
|
|
9840
10300
|
const incoming = report.incoming && (report.incoming.reconnect || report.incoming.gone || report.incoming.replaced || report.incoming.published) ? [{ code: "incoming", ...report.incoming }] : [];
|
|
9841
10301
|
const warnings = [...report.warnings || [], ...incoming];
|
|
9842
|
-
return /* @__PURE__ */ (0,
|
|
9843
|
-
report.blocking?.length > 0 && /* @__PURE__ */ (0,
|
|
9844
|
-
/* @__PURE__ */ (0,
|
|
9845
|
-
/* @__PURE__ */ (0,
|
|
10302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": "restore-report", children: [
|
|
10303
|
+
report.blocking?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Box, { padding: 3, background: "danger100", hasRadius: true, children: [
|
|
10304
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", fontWeight: "bold", textColor: "danger700", children: t.restoreBlocked }),
|
|
10305
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: report.blocking.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "danger700", children: line(item) }) }, i)) })
|
|
9846
10306
|
] }),
|
|
9847
|
-
warnings.length > 0 && /* @__PURE__ */ (0,
|
|
9848
|
-
/* @__PURE__ */ (0,
|
|
9849
|
-
/* @__PURE__ */ (0,
|
|
10307
|
+
warnings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Box, { padding: 3, background: "warning100", hasRadius: true, children: [
|
|
10308
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", fontWeight: "bold", textColor: "warning700", children: t.restoreWarnings }),
|
|
10309
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: warnings.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "warning700", children: line(item) }) }, i)) })
|
|
9850
10310
|
] })
|
|
9851
10311
|
] });
|
|
9852
10312
|
}
|
|
9853
10313
|
function Preview2({ t, id, get, onClose }) {
|
|
9854
|
-
const [row, setRow] =
|
|
9855
|
-
const [failed, setFailed] =
|
|
9856
|
-
|
|
10314
|
+
const [row, setRow] = React16.useState(null);
|
|
10315
|
+
const [failed, setFailed] = React16.useState(false);
|
|
10316
|
+
React16.useEffect(() => {
|
|
9857
10317
|
get(`/blockscene/trash/${id}`).then(({ data }) => setRow(data)).catch(() => setFailed(true));
|
|
9858
10318
|
}, [get, id]);
|
|
9859
|
-
return /* @__PURE__ */ (0,
|
|
9860
|
-
/* @__PURE__ */ (0,
|
|
9861
|
-
/* @__PURE__ */ (0,
|
|
9862
|
-
row.incoming > 0 && /* @__PURE__ */ (0,
|
|
9863
|
-
row.entries.map((entry, i) => /* @__PURE__ */ (0,
|
|
9864
|
-
/* @__PURE__ */ (0,
|
|
10319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Modal.Content, { style: { width: "min(900px, 92vw)" }, children: [
|
|
10320
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Title, { children: row?.title || t.trashPreview }) }),
|
|
10321
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Body, { children: failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !row ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { children: t.contentLoading }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 5, "data-testid": "trash-preview", children: [
|
|
10322
|
+
row.incoming > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "neutral600", children: t.f("trashIncoming", { count: row.incoming }) }),
|
|
10323
|
+
row.entries.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
10324
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Typography, { variant: "delta", tag: "h3", children: [
|
|
9865
10325
|
entry.locale || t.contentNone,
|
|
9866
10326
|
entry.status ? ` \xB7 ${entry.status === "published" ? t.trashPublished : t.trashDraft}` : ""
|
|
9867
10327
|
] }),
|
|
9868
|
-
/* @__PURE__ */ (0,
|
|
9869
|
-
/* @__PURE__ */ (0,
|
|
9870
|
-
/* @__PURE__ */ (0,
|
|
9871
|
-
/* @__PURE__ */ (0,
|
|
10328
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", textColor: "neutral600", children: t.trashFields }),
|
|
10329
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dl", { style: { display: "grid", gridTemplateColumns: "minmax(120px, max-content) 1fr", gap: "4px 16px", margin: 0 }, children: entry.fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(React16.Fragment, { children: [
|
|
10330
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dt", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", fontWeight: "bold", children: field.name }) }),
|
|
10331
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dd", { style: { margin: 0, wordBreak: "break-word" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: field.count !== void 0 ? t.f("trashItems", { count: field.count }) : field.value }) })
|
|
9872
10332
|
] }, field.name)) }),
|
|
9873
|
-
entry.blocks.length > 0 && /* @__PURE__ */ (0,
|
|
9874
|
-
/* @__PURE__ */ (0,
|
|
9875
|
-
/* @__PURE__ */ (0,
|
|
10333
|
+
entry.blocks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
10334
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", textColor: "neutral600", children: t.trashBlocks }),
|
|
10335
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ol", { style: { margin: 0, paddingLeft: 20 }, children: entry.blocks.map((block, j) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: block.name }) }, j)) })
|
|
9876
10336
|
] })
|
|
9877
10337
|
] }, i))
|
|
9878
10338
|
] }) }),
|
|
9879
|
-
/* @__PURE__ */ (0,
|
|
10339
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Modal.Close, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", children: t.trashClose }) }) })
|
|
9880
10340
|
] }) });
|
|
9881
10341
|
}
|
|
9882
10342
|
function TrashTab({ t, get, post, del, can }) {
|
|
9883
|
-
const { toggleNotification } = (0,
|
|
9884
|
-
const [contentType, setType] =
|
|
9885
|
-
const [restored, setRestored] =
|
|
9886
|
-
const [page, setPage] =
|
|
9887
|
-
const [refresh, reload] =
|
|
10343
|
+
const { toggleNotification } = (0, import_admin4.useNotification)();
|
|
10344
|
+
const [contentType, setType] = React16.useState("");
|
|
10345
|
+
const [restored, setRestored] = React16.useState(false);
|
|
10346
|
+
const [page, setPage] = React16.useState(1);
|
|
10347
|
+
const [refresh, reload] = React16.useReducer((n) => n + 1, 0);
|
|
9888
10348
|
const { data, failed } = useList(get, "/trash", { contentType, status: restored ? "restored" : "trashed", page, pageSize: 20 }, refresh);
|
|
9889
|
-
const [preview, setPreview] =
|
|
9890
|
-
const [restore, setRestore] =
|
|
9891
|
-
const [remove, setRemove] =
|
|
9892
|
-
const [busy, setBusy] =
|
|
10349
|
+
const [preview, setPreview] = React16.useState(null);
|
|
10350
|
+
const [restore, setRestore] = React16.useState(null);
|
|
10351
|
+
const [remove, setRemove] = React16.useState(null);
|
|
10352
|
+
const [busy, setBusy] = React16.useState(false);
|
|
9893
10353
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9894
10354
|
const title = (row) => row.title || t.contentUntitled;
|
|
9895
10355
|
const check = async (row) => {
|
|
@@ -9935,9 +10395,9 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9935
10395
|
const days = Math.floor((new Date(at).getTime() - Date.now()) / DAY);
|
|
9936
10396
|
return days < 1 ? t.trashExpiresToday : t.f("trashExpiresIn", { days });
|
|
9937
10397
|
};
|
|
9938
|
-
return /* @__PURE__ */ (0,
|
|
9939
|
-
/* @__PURE__ */ (0,
|
|
9940
|
-
/* @__PURE__ */ (0,
|
|
10398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10399
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9941
10401
|
Select,
|
|
9942
10402
|
{
|
|
9943
10403
|
name: "trash-type",
|
|
@@ -9950,108 +10410,163 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9950
10410
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9951
10411
|
}
|
|
9952
10412
|
),
|
|
9953
|
-
/* @__PURE__ */ (0,
|
|
9954
|
-
/* @__PURE__ */ (0,
|
|
10413
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { gap: 2, paddingBottom: 2, children: [
|
|
10414
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Switch, { "aria-label": t.trashShowRestored, checked: restored, onCheckedChange: (v) => {
|
|
9955
10415
|
setRestored(v);
|
|
9956
10416
|
setPage(1);
|
|
9957
10417
|
} }),
|
|
9958
|
-
/* @__PURE__ */ (0,
|
|
10418
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: t.trashShowRestored })
|
|
9959
10419
|
] })
|
|
9960
10420
|
] }),
|
|
9961
|
-
failed ? /* @__PURE__ */ (0,
|
|
9962
|
-
/* @__PURE__ */ (0,
|
|
9963
|
-
/* @__PURE__ */ (0,
|
|
9964
|
-
/* @__PURE__ */ (0,
|
|
9965
|
-
/* @__PURE__ */ (0,
|
|
9966
|
-
/* @__PURE__ */ (0,
|
|
9967
|
-
/* @__PURE__ */ (0,
|
|
9968
|
-
/* @__PURE__ */ (0,
|
|
10421
|
+
failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !data ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { textColor: "neutral600", children: t.trashEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Box, { children: [
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Table, { colCount: 5, rowCount: data.results.length + 1, "data-testid": "blockscene-trash", children: [
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tr, { children: [
|
|
10424
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.activityDocument }) }),
|
|
10425
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.trashLocales }) }),
|
|
10426
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: t.trashDeletedBy }) }),
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: restored ? t.trashRestoredAs : t.trashExpires }) }),
|
|
10428
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "sigma", children: " " }) })
|
|
9969
10429
|
] }) }),
|
|
9970
|
-
/* @__PURE__ */ (0,
|
|
9971
|
-
/* @__PURE__ */ (0,
|
|
9972
|
-
/* @__PURE__ */ (0,
|
|
9973
|
-
/* @__PURE__ */ (0,
|
|
9974
|
-
/* @__PURE__ */ (0,
|
|
9975
|
-
/* @__PURE__ */ (0,
|
|
10430
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tbody, { children: data.results.map((row) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tr, { "data-testid": `trash-${row.id}`, children: [
|
|
10431
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Doc, { t, type: types.get(row.contentType), row: { ...row, exists: void 0 }, documentId: row.relatedDocumentId, locale: null }) }),
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: (row.locales || []).map((l) => l ?? t.contentNone).join(", ") }) }),
|
|
10433
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "flex-start", children: [
|
|
10434
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: row.actorName || (row.actor === "system" ? t.historySystem : row.actor) }),
|
|
10435
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", textColor: "neutral600", children: when(t, row.deletedAt) })
|
|
9976
10436
|
] }) }),
|
|
9977
|
-
/* @__PURE__ */ (0,
|
|
9978
|
-
/* @__PURE__ */ (0,
|
|
9979
|
-
restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */ (0,
|
|
10437
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Td, { children: [
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: restored ? row.restoredAt ? when(t, row.restoredAt) : "" : expires(row.expiresAt) }),
|
|
10439
|
+
restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Link, { href: editUrl(types.get(row.contentType), row.restoredAs, null), children: t.contentOpen }) })
|
|
9980
10440
|
] }),
|
|
9981
|
-
/* @__PURE__ */ (0,
|
|
9982
|
-
/* @__PURE__ */ (0,
|
|
9983
|
-
!restored && can.canRestore && /* @__PURE__ */ (0,
|
|
9984
|
-
can.canPurge && /* @__PURE__ */ (0,
|
|
10441
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { gap: 2, justifyContent: "flex-end", children: [
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", size: "S", onClick: () => setPreview(row.id), children: t.trashPreview }),
|
|
10443
|
+
!restored && can.canRestore && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "secondary", size: "S", onClick: () => check(row), "data-testid": `trash-restore-${row.id}`, children: t.trashRestore }),
|
|
10444
|
+
can.canPurge && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "danger-light", size: "S", onClick: () => setRemove(row), "data-testid": `trash-delete-${row.id}`, children: t.trashDelete })
|
|
9985
10445
|
] }) })
|
|
9986
10446
|
] }, row.id)) })
|
|
9987
10447
|
] }),
|
|
9988
|
-
/* @__PURE__ */ (0,
|
|
10448
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pager, { t, pagination: data.pagination, setPage })
|
|
9989
10449
|
] }),
|
|
9990
|
-
preview !== null && /* @__PURE__ */ (0,
|
|
9991
|
-
restore && /* @__PURE__ */ (0,
|
|
9992
|
-
/* @__PURE__ */ (0,
|
|
9993
|
-
/* @__PURE__ */ (0,
|
|
9994
|
-
/* @__PURE__ */ (0,
|
|
9995
|
-
restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ (0,
|
|
9996
|
-
!restore.done.already && /* @__PURE__ */ (0,
|
|
9997
|
-
] }) : !restore.report ? /* @__PURE__ */ (0,
|
|
9998
|
-
/* @__PURE__ */ (0,
|
|
10450
|
+
preview !== null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Preview2, { t, id: preview, get, onClose: () => setPreview(null) }),
|
|
10451
|
+
restore && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRestore(null), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Dialog.Content, { children: [
|
|
10452
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Header, { children: t.f("restoreTitle", { title: title(restore.row) }) }),
|
|
10453
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Flex, { direction: "column", alignItems: "stretch", gap: 3, width: "100%", children: restore.done ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Flex, { direction: "column", alignItems: "flex-start", gap: 2, role: "status", "data-testid": "restore-done", children: [
|
|
10454
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { textColor: "success700", children: restore.done.already ? t.restoreAlready : t.restoreDone }),
|
|
10455
|
+
restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Link, { href: editUrl(types.get(restore.row.contentType), restore.done.documentId, restore.done.locales?.[0] ?? null), children: t.restoreOpen }),
|
|
10456
|
+
!restore.done.already && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Report, { t, report: { warnings: restore.done.warnings, incoming: restore.done.incoming && { ...restore.done.incoming, reconnect: restore.done.incoming.reconnected } } })
|
|
10457
|
+
] }) : !restore.report ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { children: t.restoreChecking }) : restore.failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { role: "alert", textColor: "danger600", children: t.restoreFailed }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
10458
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Typography, { variant: "pi", children: [
|
|
9999
10459
|
t.restoreIntro,
|
|
10000
10460
|
" ",
|
|
10001
10461
|
restore.report.documentId ? t.restoreInto : t.restoreNew
|
|
10002
10462
|
] }),
|
|
10003
|
-
restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ (0,
|
|
10004
|
-
/* @__PURE__ */ (0,
|
|
10463
|
+
restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: t.f("restoreLocales", { locales: restore.report.locales.join(", ") }) }),
|
|
10464
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Report, { t, report: restore.report })
|
|
10005
10465
|
] }) }) }),
|
|
10006
|
-
/* @__PURE__ */ (0,
|
|
10007
|
-
/* @__PURE__ */ (0,
|
|
10008
|
-
!restore.done && /* @__PURE__ */ (0,
|
|
10466
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Dialog.Footer, { children: [
|
|
10467
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Cancel, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", disabled: busy, children: restore.done ? t.trashClose : t.restoreCancel }) }),
|
|
10468
|
+
!restore.done && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { onClick: confirmRestore, loading: busy, disabled: busy || !restore.report || restore.failed || restore.report.blocking?.length > 0, "data-testid": "restore-confirm", children: t.restoreConfirm })
|
|
10009
10469
|
] })
|
|
10010
10470
|
] }) }),
|
|
10011
|
-
remove && /* @__PURE__ */ (0,
|
|
10012
|
-
/* @__PURE__ */ (0,
|
|
10013
|
-
/* @__PURE__ */ (0,
|
|
10014
|
-
/* @__PURE__ */ (0,
|
|
10015
|
-
/* @__PURE__ */ (0,
|
|
10016
|
-
/* @__PURE__ */ (0,
|
|
10471
|
+
remove && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRemove(null), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Dialog.Content, { children: [
|
|
10472
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Header, { children: t.trashDeleteTitle }),
|
|
10473
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { children: t.f("trashDeleteConfirm", { title: title(remove) }) }) }),
|
|
10474
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Dialog.Footer, { children: [
|
|
10475
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Dialog.Cancel, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "tertiary", disabled: busy, children: t.restoreCancel }) }),
|
|
10476
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Button, { variant: "danger", onClick: confirmRemove, loading: busy, disabled: busy, "data-testid": "delete-confirm", children: t.trashDelete })
|
|
10017
10477
|
] })
|
|
10018
10478
|
] }) })
|
|
10019
10479
|
] });
|
|
10020
10480
|
}
|
|
10021
10481
|
function ContentPage() {
|
|
10022
10482
|
const t = useMessages();
|
|
10023
|
-
const { get, post, del } = (0,
|
|
10024
|
-
const activity = (0,
|
|
10025
|
-
const trash = (0,
|
|
10026
|
-
const [tab, setTab] =
|
|
10027
|
-
if (activity.isLoading || trash.isLoading) return /* @__PURE__ */ (0,
|
|
10483
|
+
const { get, post, del } = (0, import_admin4.useFetchClient)();
|
|
10484
|
+
const activity = (0, import_admin4.useRBAC)(ACTIVITY);
|
|
10485
|
+
const trash = (0, import_admin4.useRBAC)(TRASH);
|
|
10486
|
+
const [tab, setTab] = React16.useState(null);
|
|
10487
|
+
if (activity.isLoading || trash.isLoading) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Page.Loading, {});
|
|
10028
10488
|
const canActivity = Boolean(activity.allowedActions?.canRead), canTrash = Boolean(trash.allowedActions?.canRead);
|
|
10029
|
-
if (!canActivity && !canTrash) return /* @__PURE__ */ (0,
|
|
10489
|
+
if (!canActivity && !canTrash) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Page.NoPermissions, {});
|
|
10030
10490
|
const current = tab || (canActivity ? "activity" : "trash");
|
|
10031
|
-
return /* @__PURE__ */ (0,
|
|
10032
|
-
/* @__PURE__ */ (0,
|
|
10033
|
-
/* @__PURE__ */ (0,
|
|
10034
|
-
/* @__PURE__ */ (0,
|
|
10035
|
-
/* @__PURE__ */ (0,
|
|
10036
|
-
canActivity && /* @__PURE__ */ (0,
|
|
10037
|
-
canTrash && /* @__PURE__ */ (0,
|
|
10491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_admin4.Page.Main, { children: [
|
|
10492
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Page.Title, { children: t.contentTitle }),
|
|
10493
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Layouts.Header, { title: t.contentTitle, subtitle: t.contentSubtitle }),
|
|
10494
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Layouts.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tabs.Root, { value: current, onValueChange: setTab, children: [
|
|
10495
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Tabs.List, { "aria-label": t.contentTitle, children: [
|
|
10496
|
+
canActivity && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tabs.Trigger, { value: "activity", children: t.activityTab }),
|
|
10497
|
+
canTrash && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tabs.Trigger, { value: "trash", children: t.trashTab })
|
|
10038
10498
|
] }),
|
|
10039
|
-
/* @__PURE__ */ (0,
|
|
10040
|
-
canActivity && /* @__PURE__ */ (0,
|
|
10041
|
-
canTrash && /* @__PURE__ */ (0,
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system11.Box, { paddingTop: 6, paddingBottom: 6, background: "neutral0", hasRadius: true, paddingLeft: 6, paddingRight: 6, marginTop: 4, children: [
|
|
10500
|
+
canActivity && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tabs.Content, { value: "activity", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ActivityTab, { t, get }) }),
|
|
10501
|
+
canTrash && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Tabs.Content, { value: "trash", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TrashTab, { t, get, post, del, can: trash.allowedActions }) })
|
|
10042
10502
|
] })
|
|
10043
10503
|
] }) })
|
|
10044
10504
|
] });
|
|
10045
10505
|
}
|
|
10046
10506
|
|
|
10507
|
+
// admin/StarterKits.tsx
|
|
10508
|
+
var React17 = __toESM(require("react"));
|
|
10509
|
+
var import_design_system12 = require("@strapi/design-system");
|
|
10510
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
10511
|
+
var marker = (docKey) => {
|
|
10512
|
+
try {
|
|
10513
|
+
const entry = window.history.state?.key ?? window.history.state?.idx ?? "route";
|
|
10514
|
+
return `blockscene:starter-kit:${entry}:${docKey}`;
|
|
10515
|
+
} catch {
|
|
10516
|
+
return `blockscene:starter-kit:${docKey}`;
|
|
10517
|
+
}
|
|
10518
|
+
};
|
|
10519
|
+
var wasHandled = (key) => {
|
|
10520
|
+
try {
|
|
10521
|
+
return window.sessionStorage.getItem(key) === "handled";
|
|
10522
|
+
} catch {
|
|
10523
|
+
return false;
|
|
10524
|
+
}
|
|
10525
|
+
};
|
|
10526
|
+
var remember2 = (key) => {
|
|
10527
|
+
try {
|
|
10528
|
+
window.sessionStorage.setItem(key, "handled");
|
|
10529
|
+
} catch {
|
|
10530
|
+
}
|
|
10531
|
+
};
|
|
10532
|
+
function StarterKits({ creating, kits, zones, components, form, Modal: Modal3, docKey }) {
|
|
10533
|
+
const t = useMessages();
|
|
10534
|
+
const key = marker(docKey);
|
|
10535
|
+
const handled = React17.useRef({ key, value: wasHandled(key) });
|
|
10536
|
+
if (handled.current.key !== key) handled.current = { key, value: wasHandled(key) };
|
|
10537
|
+
const usable = starterKitsForLocale(kits, form?.locale).filter((kit) => Object.keys(kit.zones || {}).every((name) => zones.some((zone) => zone.name === name)));
|
|
10538
|
+
const available = creating && form && !handled.current.value && usable.length > 0 && zones.length > 0 && zones.every((zone) => form.rows(zone.name).length === 0);
|
|
10539
|
+
const [open, setOpen] = React17.useState(available);
|
|
10540
|
+
React17.useEffect(() => {
|
|
10541
|
+
if (available) setOpen(true);
|
|
10542
|
+
}, [available, key]);
|
|
10543
|
+
if (!available) return null;
|
|
10544
|
+
const finish = () => {
|
|
10545
|
+
handled.current.value = true;
|
|
10546
|
+
remember2(key);
|
|
10547
|
+
setOpen(false);
|
|
10548
|
+
};
|
|
10549
|
+
const apply = (kit) => {
|
|
10550
|
+
const rows = starterKitRows(kit, zones, components, form);
|
|
10551
|
+
if (!rows) return;
|
|
10552
|
+
for (const [zone, value] of Object.entries(rows)) form.setRows(zone, value);
|
|
10553
|
+
finish();
|
|
10554
|
+
};
|
|
10555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Modal3, { open, onOpenChange: (next) => next ? setOpen(true) : finish(), title: t.starterKits, width: "560px", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system12.Flex, { direction: "column", alignItems: "stretch", gap: 3, children: [
|
|
10556
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.Typography, { textColor: "neutral600", children: t.starterKitsHelp }),
|
|
10557
|
+
usable.map((kit) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.Button, { variant: "secondary", fullWidth: true, onClick: () => apply(kit), "data-testid": `starter-kit-${kit.id}`, children: localized(kit.label, t.locale) }, kit.id)),
|
|
10558
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.Box, { paddingTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system12.Button, { variant: "tertiary", onClick: finish, children: t.startBlank }) })
|
|
10559
|
+
] }) });
|
|
10560
|
+
}
|
|
10561
|
+
|
|
10047
10562
|
// admin/strapi5.tsx
|
|
10048
|
-
var
|
|
10563
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
10049
10564
|
function Modal2({ open, onOpenChange, trigger, title, children, width = "80vw" }) {
|
|
10050
|
-
return /* @__PURE__ */ (0,
|
|
10051
|
-
trigger && /* @__PURE__ */ (0,
|
|
10052
|
-
/* @__PURE__ */ (0,
|
|
10053
|
-
/* @__PURE__ */ (0,
|
|
10054
|
-
/* @__PURE__ */ (0,
|
|
10565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Modal.Root, { open, onOpenChange, children: [
|
|
10566
|
+
trigger && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Modal.Trigger, { children: trigger }),
|
|
10567
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Modal.Content, { style: { width, maxWidth: "92vw" }, children: [
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Modal.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Modal.Title, { children: title }) }),
|
|
10569
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Modal.Body, { children })
|
|
10055
10570
|
] })
|
|
10056
10571
|
] });
|
|
10057
10572
|
}
|
|
@@ -10066,10 +10581,10 @@ async function relationsOf(get, { uid, id, field }, locale) {
|
|
|
10066
10581
|
return out.reverse();
|
|
10067
10582
|
}
|
|
10068
10583
|
function useRowForm(c, values, get) {
|
|
10069
|
-
const onChange = (0,
|
|
10070
|
-
const errors = (0,
|
|
10071
|
-
const { toggleNotification } = (0,
|
|
10072
|
-
const latest =
|
|
10584
|
+
const onChange = (0, import_admin5.useForm)("Blockscene", (state) => state.onChange);
|
|
10585
|
+
const errors = (0, import_admin5.useForm)("Blockscene", (state) => state.errors);
|
|
10586
|
+
const { toggleNotification } = (0, import_admin5.useNotification)();
|
|
10587
|
+
const latest = React18.useRef(values);
|
|
10073
10588
|
latest.current = values;
|
|
10074
10589
|
const locale = c.form?.initialValues?.locale || void 0;
|
|
10075
10590
|
if (typeof onChange !== "function") return null;
|
|
@@ -10093,8 +10608,8 @@ function useRowForm(c, values, get) {
|
|
|
10093
10608
|
function useScope() {
|
|
10094
10609
|
const c = (0, import_strapi_admin2.unstable_useContentManagerContext)();
|
|
10095
10610
|
const rbac = (0, import_strapi_admin2.useDocumentRBAC)("Blockscene", (state) => state);
|
|
10096
|
-
const { get, put } = (0,
|
|
10097
|
-
const formValues = (0,
|
|
10611
|
+
const { get, put } = (0, import_admin5.useFetchClient)();
|
|
10612
|
+
const formValues = (0, import_admin5.useForm)("Blockscene", (state) => state.values);
|
|
10098
10613
|
const catalog = useCatalog(get);
|
|
10099
10614
|
const creating = !c.id && !c.form?.initialValues?.id && !c.form?.initialValues?.documentId;
|
|
10100
10615
|
const allowed = (creating ? rbac.canCreateFields : rbac.canUpdateFields) || [];
|
|
@@ -10113,8 +10628,8 @@ function useScope() {
|
|
|
10113
10628
|
const history = !creating && Boolean(c.id) && Boolean(catalog?.history?.contentTypes?.includes(c.model));
|
|
10114
10629
|
return { c, rbac, get, put, formValues, catalog, creating, zones, typeSettings, gallery, history };
|
|
10115
10630
|
}
|
|
10116
|
-
var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ (0,
|
|
10117
|
-
/* @__PURE__ */ (0,
|
|
10631
|
+
var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Box, { "data-testid": testid, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SimpleMenu, { variant: "tertiary", size: "S", "aria-label": label, title: label, endIcon: null, label: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "more", size: 16 }), children: items2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.MenuItem, { onSelect: item.onSelect, "data-testid": item.testid, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Flex, { gap: 2, alignItems: "center", children: [
|
|
10632
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: item.icon, size: 16 }),
|
|
10118
10633
|
item.label
|
|
10119
10634
|
] }) }, item.testid)) }) });
|
|
10120
10635
|
function Editor() {
|
|
@@ -10122,17 +10637,17 @@ function Editor() {
|
|
|
10122
10637
|
const { catalog, typeSettings, gallery } = scope;
|
|
10123
10638
|
const lazy = Boolean(catalog?.editor?.enabled && catalog.editor.lazyEditors !== false && typeSettings.enabled !== false);
|
|
10124
10639
|
const lazyFields = (catalog?.editor?.lazyFields || []).join(",");
|
|
10125
|
-
|
|
10640
|
+
React18.useEffect(() => {
|
|
10126
10641
|
if (catalog) setLazyConfig({ on: lazy, fields: lazyFields ? lazyFields.split(",") : [] });
|
|
10127
10642
|
}, [catalog, lazy, lazyFields]);
|
|
10128
|
-
const kept2 =
|
|
10643
|
+
const kept2 = React18.useRef(false);
|
|
10129
10644
|
if (!scope.c.isLoading) kept2.current = gallery;
|
|
10130
10645
|
if (!kept2.current) return null;
|
|
10131
|
-
return /* @__PURE__ */ (0,
|
|
10646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { hidden: true, "data-blockscene-editor": "", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Workspace, { scope }) }) });
|
|
10132
10647
|
}
|
|
10133
10648
|
function Workspace({ scope }) {
|
|
10134
10649
|
const { c, get, put, formValues, catalog, creating, zones, typeSettings } = scope;
|
|
10135
|
-
const user = (0,
|
|
10650
|
+
const user = (0, import_admin5.useAuth)("Blockscene", (state2) => state2.user);
|
|
10136
10651
|
const form = useRowForm(c, formValues ?? c.form?.values, get);
|
|
10137
10652
|
const editor = {
|
|
10138
10653
|
...catalog.editor,
|
|
@@ -10144,6 +10659,8 @@ function Workspace({ scope }) {
|
|
|
10144
10659
|
};
|
|
10145
10660
|
const host = usePreviewHost5();
|
|
10146
10661
|
const state = useEditorState(editor, host);
|
|
10662
|
+
const versions = useVersions(host, catalog?.history);
|
|
10663
|
+
const docKey = `${c.model}:${creating ? "new" : c.id}:${c.form?.initialValues?.locale || ""}`;
|
|
10147
10664
|
const add = (zone, uid, preset) => {
|
|
10148
10665
|
const values = formValues ?? c.form.values;
|
|
10149
10666
|
const close = catalog?.groups?.[uid];
|
|
@@ -10161,8 +10678,9 @@ function Workspace({ scope }) {
|
|
|
10161
10678
|
if (close) c.form.addFieldRow(zone.name, { __component: close }, at + 1);
|
|
10162
10679
|
return true;
|
|
10163
10680
|
};
|
|
10164
|
-
return /* @__PURE__ */ (0,
|
|
10165
|
-
/* @__PURE__ */ (0,
|
|
10681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StarterKits, { creating, kits: catalog.kits?.[c.model], zones, components: c.components, form, Modal: Modal2, docKey }),
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10166
10684
|
Gallery,
|
|
10167
10685
|
{
|
|
10168
10686
|
zones,
|
|
@@ -10175,18 +10693,19 @@ function Workspace({ scope }) {
|
|
|
10175
10693
|
put,
|
|
10176
10694
|
editor: catalog.editor,
|
|
10177
10695
|
catalog,
|
|
10178
|
-
docKey
|
|
10696
|
+
docKey,
|
|
10179
10697
|
contentType: c.model,
|
|
10180
10698
|
userId: user?.id,
|
|
10181
10699
|
form,
|
|
10182
|
-
zoneTools: /* @__PURE__ */ (0,
|
|
10700
|
+
zoneTools: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ZoneBarTools, { state }),
|
|
10183
10701
|
openBlock: state.openBlock,
|
|
10184
10702
|
openInsert: state.openInsert
|
|
10185
10703
|
}
|
|
10186
10704
|
),
|
|
10187
|
-
/* @__PURE__ */ (0,
|
|
10705
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10188
10706
|
PagePreview,
|
|
10189
10707
|
{
|
|
10708
|
+
versions,
|
|
10190
10709
|
editor,
|
|
10191
10710
|
state,
|
|
10192
10711
|
host,
|
|
@@ -10201,7 +10720,7 @@ function Workspace({ scope }) {
|
|
|
10201
10720
|
}
|
|
10202
10721
|
function Panel2() {
|
|
10203
10722
|
const { c, rbac, get, catalog, gallery, history } = useScope();
|
|
10204
|
-
const canReadHistory = Boolean((0,
|
|
10723
|
+
const canReadHistory = Boolean((0, import_admin5.useRBAC)(HISTORY_READ).allowedActions?.canRead);
|
|
10205
10724
|
const preview = usePreviewZone(usePreviewHost5());
|
|
10206
10725
|
const groups = gallery ? catalog?.groups : null;
|
|
10207
10726
|
const problems = groups && preview.zone ? (0, import_groups.validateGroups)(preview.rows, groups) : [];
|
|
@@ -10209,9 +10728,9 @@ function Panel2() {
|
|
|
10209
10728
|
if (!versions && !problems.length) return null;
|
|
10210
10729
|
return {
|
|
10211
10730
|
title: "Blockscene",
|
|
10212
|
-
content: /* @__PURE__ */ (0,
|
|
10213
|
-
problems.length > 0 && /* @__PURE__ */ (0,
|
|
10214
|
-
versions && /* @__PURE__ */ (0,
|
|
10731
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
10732
|
+
problems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GroupDiagnostics, { scope: preview, groups, problems }),
|
|
10733
|
+
versions && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10215
10734
|
History,
|
|
10216
10735
|
{
|
|
10217
10736
|
model: c.model,
|
|
@@ -10227,9 +10746,9 @@ function Panel2() {
|
|
|
10227
10746
|
] }) })
|
|
10228
10747
|
};
|
|
10229
10748
|
}
|
|
10230
|
-
var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ (0,
|
|
10231
|
-
/* @__PURE__ */ (0,
|
|
10232
|
-
|
|
10749
|
+
var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Flex, { gap: 3, children: [
|
|
10750
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10751
|
+
import_design_system13.Switch,
|
|
10233
10752
|
{
|
|
10234
10753
|
name,
|
|
10235
10754
|
"aria-label": label,
|
|
@@ -10238,7 +10757,7 @@ var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ *
|
|
|
10238
10757
|
onCheckedChange: onChange
|
|
10239
10758
|
}
|
|
10240
10759
|
),
|
|
10241
|
-
/* @__PURE__ */ (0,
|
|
10760
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Typography, { children: label })
|
|
10242
10761
|
] });
|
|
10243
10762
|
var TextField = ({
|
|
10244
10763
|
name,
|
|
@@ -10247,10 +10766,10 @@ var TextField = ({
|
|
|
10247
10766
|
onChange,
|
|
10248
10767
|
disabled,
|
|
10249
10768
|
placeholder
|
|
10250
|
-
}) => /* @__PURE__ */ (0,
|
|
10251
|
-
/* @__PURE__ */ (0,
|
|
10252
|
-
/* @__PURE__ */ (0,
|
|
10253
|
-
|
|
10769
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Field.Root, { name, children: [
|
|
10770
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Field.Label, { children: label }),
|
|
10771
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10772
|
+
import_design_system13.TextInput,
|
|
10254
10773
|
{
|
|
10255
10774
|
name,
|
|
10256
10775
|
value,
|
|
@@ -10267,30 +10786,30 @@ var SelectField = ({
|
|
|
10267
10786
|
onChange,
|
|
10268
10787
|
disabled,
|
|
10269
10788
|
options
|
|
10270
|
-
}) => /* @__PURE__ */ (0,
|
|
10271
|
-
/* @__PURE__ */ (0,
|
|
10272
|
-
/* @__PURE__ */ (0,
|
|
10273
|
-
|
|
10789
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system13.Field.Root, { name, children: [
|
|
10790
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Field.Label, { children: label }),
|
|
10791
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10792
|
+
import_design_system13.SingleSelect,
|
|
10274
10793
|
{
|
|
10275
10794
|
value,
|
|
10276
10795
|
disabled,
|
|
10277
10796
|
startIcon: options.find((o) => o.value === value)?.icon,
|
|
10278
10797
|
onChange: (v) => onChange(String(v)),
|
|
10279
|
-
children: options.map((o) => /* @__PURE__ */ (0,
|
|
10798
|
+
children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.SingleSelectOption, { value: o.value, startIcon: o.icon, children: o.label }, o.value))
|
|
10280
10799
|
}
|
|
10281
10800
|
)
|
|
10282
10801
|
] });
|
|
10283
10802
|
function MediaPicker({ onClose, onSelect }) {
|
|
10284
|
-
const components = (0,
|
|
10803
|
+
const components = (0, import_admin5.useStrapiApp)(
|
|
10285
10804
|
"Blockscene",
|
|
10286
10805
|
(state) => state.components
|
|
10287
10806
|
);
|
|
10288
10807
|
const Dialog3 = components?.["media-library"];
|
|
10289
|
-
|
|
10808
|
+
React18.useEffect(() => {
|
|
10290
10809
|
if (!Dialog3) onClose();
|
|
10291
10810
|
}, [Dialog3, onClose]);
|
|
10292
10811
|
if (!Dialog3) return null;
|
|
10293
|
-
return /* @__PURE__ */ (0,
|
|
10812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10294
10813
|
Dialog3,
|
|
10295
10814
|
{
|
|
10296
10815
|
onClose,
|
|
@@ -10301,7 +10820,7 @@ function MediaPicker({ onClose, onSelect }) {
|
|
|
10301
10820
|
);
|
|
10302
10821
|
}
|
|
10303
10822
|
function usePermissions() {
|
|
10304
|
-
const { allowedActions, isLoading } = (0,
|
|
10823
|
+
const { allowedActions, isLoading } = (0, import_admin5.useRBAC)(
|
|
10305
10824
|
Object.values(permissions).flat()
|
|
10306
10825
|
);
|
|
10307
10826
|
return {
|
|
@@ -10310,10 +10829,10 @@ function usePermissions() {
|
|
|
10310
10829
|
isLoading
|
|
10311
10830
|
};
|
|
10312
10831
|
}
|
|
10313
|
-
var SettingsPage = () => /* @__PURE__ */ (0,
|
|
10832
|
+
var SettingsPage = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10314
10833
|
Settings,
|
|
10315
10834
|
{
|
|
10316
|
-
useClient:
|
|
10835
|
+
useClient: import_admin5.useFetchClient,
|
|
10317
10836
|
usePermissions,
|
|
10318
10837
|
MediaPicker,
|
|
10319
10838
|
ToggleField,
|
|
@@ -10328,13 +10847,13 @@ var strapi5_default = {
|
|
|
10328
10847
|
strapiApp = app;
|
|
10329
10848
|
register(app, SettingsPage, "blockscene");
|
|
10330
10849
|
app.registerPlugin({ id: "blockscene", name: "Blockscene", apis: { registerPanel: (panel) => registerPanel(panel, ICON_NAMES) } });
|
|
10331
|
-
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ (0,
|
|
10850
|
+
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContentPage, {}) })));
|
|
10332
10851
|
},
|
|
10333
10852
|
registerTrads,
|
|
10334
10853
|
bootstrap(app) {
|
|
10335
10854
|
app.getPlugin("content-manager").apis.addEditViewSidePanel([Panel2]);
|
|
10336
10855
|
app.getPlugin("content-manager").injectComponent("editView", "right-links", { name: "blockscene", Component: Editor });
|
|
10337
|
-
app.registerHook("Admin/CM/pages/EditView/mutate-edit-view-layout", labelsHook(() => (0,
|
|
10856
|
+
app.registerHook("Admin/CM/pages/EditView/mutate-edit-view-layout", labelsHook(() => (0, import_admin5.getFetchClient)().get, labelEditLayout, dropField));
|
|
10338
10857
|
wrapCustomFields(strapiApp);
|
|
10339
10858
|
}
|
|
10340
10859
|
};
|