@aduptive/strapi-blockscene 2.0.0-alpha.11 → 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 +87 -10
- package/dist/admin.cjs +1081 -545
- package/dist/admin.mjs +1078 -542
- package/dist/server.cjs +135 -15
- package/package.json +1 -1
package/dist/admin.cjs
CHANGED
|
@@ -260,8 +260,8 @@ var require_diff = __commonJS({
|
|
|
260
260
|
}
|
|
261
261
|
function summarize(before, after, schema) {
|
|
262
262
|
const zones = Object.entries(schema?.attributes || {}).filter(([, attr]) => attr?.type === "dynamiczone").map(([name]) => name);
|
|
263
|
-
const blocks = { added: 0, removed: 0, changed: 0 };
|
|
264
|
-
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 } };
|
|
265
265
|
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after || {})])];
|
|
266
266
|
const fields = names.filter((name) => !zones.includes(name) && !same2(before[name], after?.[name])).sort();
|
|
267
267
|
for (const name of zones) for (const { op } of diffRows2(before[name], after?.[name])) if (op !== "same") blocks[op]++;
|
|
@@ -277,9 +277,9 @@ __export(strapi5_exports, {
|
|
|
277
277
|
default: () => strapi5_default
|
|
278
278
|
});
|
|
279
279
|
module.exports = __toCommonJS(strapi5_exports);
|
|
280
|
-
var
|
|
281
|
-
var
|
|
282
|
-
var
|
|
280
|
+
var React18 = __toESM(require("react"));
|
|
281
|
+
var import_design_system13 = require("@strapi/design-system");
|
|
282
|
+
var import_admin5 = require("@strapi/strapi/admin");
|
|
283
283
|
var import_strapi_admin2 = require("@strapi/content-manager/strapi-admin");
|
|
284
284
|
|
|
285
285
|
// admin/Gallery.tsx
|
|
@@ -330,6 +330,26 @@ function variantRow(schema, components, values, keys = fractional) {
|
|
|
330
330
|
}
|
|
331
331
|
return row;
|
|
332
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
|
+
}
|
|
333
353
|
function editableZones(schema, values, canEdit, disabled = false) {
|
|
334
354
|
if (disabled) return [];
|
|
335
355
|
return Object.entries(schema?.attributes || {}).filter(
|
|
@@ -645,6 +665,7 @@ var hoverKey = (key, rows) => key === null ? null : typeof key === "string" && k
|
|
|
645
665
|
function isPreviewMessage(event, origin, source, channel, type) {
|
|
646
666
|
return event.origin === origin && event.source === source && event.data?.protocol === PROTOCOL && event.data?.channel === channel && event.data?.type === type;
|
|
647
667
|
}
|
|
668
|
+
var previewMessageAllowed = (event, origin, source, channel, readOnly) => isPreviewMessage(event, origin, source, channel, event.data?.type) && (!readOnly || event.data?.type === "ready");
|
|
648
669
|
function insertIndex(rows, after) {
|
|
649
670
|
if (after === null || after === void 0) return 0;
|
|
650
671
|
const index = (Array.isArray(rows) ? rows : []).findIndex((row) => blockKey(row) === String(after));
|
|
@@ -899,10 +920,10 @@ var en_default = {
|
|
|
899
920
|
rememberHelp: "Only the explicit open all / close all buttons update the memory, per user and browser. Opening one block does not.",
|
|
900
921
|
previewUrl: "Preview route base URL",
|
|
901
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).",
|
|
902
|
-
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.",
|
|
903
924
|
previewMode: "Initial preview mode",
|
|
904
|
-
"modes.form": "Fields",
|
|
905
|
-
"modes.split": "Fields +
|
|
925
|
+
"modes.form": "Fields only",
|
|
926
|
+
"modes.split": "Fields + preview",
|
|
906
927
|
"modes.preview": "Visual editor",
|
|
907
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.",
|
|
908
929
|
lazyEdit: "Click to edit",
|
|
@@ -910,8 +931,8 @@ var en_default = {
|
|
|
910
931
|
lazyFields: "Custom fields loaded on demand",
|
|
911
932
|
lazyEditorsHelp: "Listed custom fields show a read-only preview until clicked or focused, so opening large pages stays fast. Separate uids with commas.",
|
|
912
933
|
lazyFieldsInvalid: "Use up to {max} custom field uids such as plugin::ckeditor5.CKEditor or global::my-field.",
|
|
913
|
-
modeForm: "Fields",
|
|
914
|
-
modeSplit: "Fields +
|
|
934
|
+
modeForm: "Fields only",
|
|
935
|
+
modeSplit: "Fields + preview",
|
|
915
936
|
modePreview: "Visual editor",
|
|
916
937
|
previewPane: "Page preview",
|
|
917
938
|
resize: "Resize preview pane",
|
|
@@ -1006,6 +1027,9 @@ var en_default = {
|
|
|
1006
1027
|
unstar: "Remove star",
|
|
1007
1028
|
quickInsert: "Insert {label}",
|
|
1008
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",
|
|
1009
1033
|
closeDetail: "Close details",
|
|
1010
1034
|
typology: "Typology",
|
|
1011
1035
|
typologyAuto: "Automatic ({name})",
|
|
@@ -1262,7 +1286,23 @@ var en_default = {
|
|
|
1262
1286
|
layoutOff: "No grid",
|
|
1263
1287
|
layoutNoMobile: "None",
|
|
1264
1288
|
layoutHelp: "The group's blocks show as a grid in the form, with the column count this block holds.",
|
|
1265
|
-
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"
|
|
1266
1306
|
};
|
|
1267
1307
|
|
|
1268
1308
|
// admin/translations/pt-BR.json
|
|
@@ -1320,10 +1360,10 @@ var pt_BR_default = {
|
|
|
1320
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.",
|
|
1321
1361
|
previewUrl: "URL base da rota de preview",
|
|
1322
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).",
|
|
1323
|
-
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.",
|
|
1324
1364
|
previewMode: "Modo inicial da preview",
|
|
1325
|
-
"modes.form": "
|
|
1326
|
-
"modes.split": "Campos +
|
|
1365
|
+
"modes.form": "Somente campos",
|
|
1366
|
+
"modes.split": "Campos + preview",
|
|
1327
1367
|
"modes.preview": "Editor visual",
|
|
1328
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.",
|
|
1329
1369
|
lazyEdit: "Clique para editar",
|
|
@@ -1331,8 +1371,8 @@ var pt_BR_default = {
|
|
|
1331
1371
|
lazyFields: "Campos personalizados carregados sob demanda",
|
|
1332
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.",
|
|
1333
1373
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1334
|
-
modeForm: "
|
|
1335
|
-
modeSplit: "Campos +
|
|
1374
|
+
modeForm: "Somente campos",
|
|
1375
|
+
modeSplit: "Campos + preview",
|
|
1336
1376
|
modePreview: "Editor visual",
|
|
1337
1377
|
previewPane: "Preview da p\xE1gina",
|
|
1338
1378
|
resize: "Redimensionar painel de preview",
|
|
@@ -1427,6 +1467,9 @@ var pt_BR_default = {
|
|
|
1427
1467
|
unstar: "Remover dos favoritos",
|
|
1428
1468
|
quickInsert: "Inserir {label}",
|
|
1429
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",
|
|
1430
1473
|
closeDetail: "Fechar detalhes",
|
|
1431
1474
|
typology: "Tipologia",
|
|
1432
1475
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -1683,7 +1726,23 @@ var pt_BR_default = {
|
|
|
1683
1726
|
layoutOff: "Sem grade",
|
|
1684
1727
|
layoutNoMobile: "Nenhum",
|
|
1685
1728
|
layoutHelp: "Os blocos do grupo aparecem em grade no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
1686
|
-
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"
|
|
1687
1746
|
};
|
|
1688
1747
|
|
|
1689
1748
|
// admin/translations/pt.json
|
|
@@ -1741,10 +1800,10 @@ var pt_default = {
|
|
|
1741
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.",
|
|
1742
1801
|
previewUrl: "URL base da rota de pr\xE9-visualiza\xE7\xE3o",
|
|
1743
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).",
|
|
1744
|
-
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.",
|
|
1745
1804
|
previewMode: "Modo inicial da pr\xE9-visualiza\xE7\xE3o",
|
|
1746
|
-
"modes.form": "
|
|
1747
|
-
"modes.split": "Campos +
|
|
1805
|
+
"modes.form": "Apenas campos",
|
|
1806
|
+
"modes.split": "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1748
1807
|
"modes.preview": "Editor visual",
|
|
1749
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.",
|
|
1750
1809
|
lazyEdit: "Clique para editar",
|
|
@@ -1752,8 +1811,8 @@ var pt_default = {
|
|
|
1752
1811
|
lazyFields: "Campos personalizados carregados a pedido",
|
|
1753
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.",
|
|
1754
1813
|
lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
|
|
1755
|
-
modeForm: "
|
|
1756
|
-
modeSplit: "Campos +
|
|
1814
|
+
modeForm: "Apenas campos",
|
|
1815
|
+
modeSplit: "Campos + pr\xE9-visualiza\xE7\xE3o",
|
|
1757
1816
|
modePreview: "Editor visual",
|
|
1758
1817
|
previewPane: "Pr\xE9-visualiza\xE7\xE3o da p\xE1gina",
|
|
1759
1818
|
resize: "Redimensionar painel de pr\xE9-visualiza\xE7\xE3o",
|
|
@@ -1848,6 +1907,9 @@ var pt_default = {
|
|
|
1848
1907
|
unstar: "Remover dos favoritos",
|
|
1849
1908
|
quickInsert: "Inserir {label}",
|
|
1850
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",
|
|
1851
1913
|
closeDetail: "Fechar detalhes",
|
|
1852
1914
|
typology: "Tipologia",
|
|
1853
1915
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -2104,7 +2166,23 @@ var pt_default = {
|
|
|
2104
2166
|
layoutOff: "Sem grelha",
|
|
2105
2167
|
layoutNoMobile: "Nenhum",
|
|
2106
2168
|
layoutHelp: "Os blocos do grupo aparecem em grelha no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
|
|
2107
|
-
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"
|
|
2108
2186
|
};
|
|
2109
2187
|
|
|
2110
2188
|
// admin/translations/fr.json
|
|
@@ -2162,10 +2240,10 @@ var fr_default = {
|
|
|
2162
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.",
|
|
2163
2241
|
previewUrl: "URL de base de la route d'aper\xE7u",
|
|
2164
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).",
|
|
2165
|
-
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.",
|
|
2166
2244
|
previewMode: "Mode d'aper\xE7u initial",
|
|
2167
|
-
"modes.form": "Champs",
|
|
2168
|
-
"modes.split": "Champs +
|
|
2245
|
+
"modes.form": "Champs uniquement",
|
|
2246
|
+
"modes.split": "Champs + aper\xE7u",
|
|
2169
2247
|
"modes.preview": "\xC9diteur visuel",
|
|
2170
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.",
|
|
2171
2249
|
lazyEdit: "Cliquer pour modifier",
|
|
@@ -2173,8 +2251,8 @@ var fr_default = {
|
|
|
2173
2251
|
lazyFields: "Champs personnalis\xE9s charg\xE9s \xE0 la demande",
|
|
2174
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.",
|
|
2175
2253
|
lazyFieldsInvalid: "Utilisez jusqu'\xE0 {max} uids de champs personnalis\xE9s, comme plugin::ckeditor5.CKEditor ou global::mon-champ.",
|
|
2176
|
-
modeForm: "Champs",
|
|
2177
|
-
modeSplit: "Champs +
|
|
2254
|
+
modeForm: "Champs uniquement",
|
|
2255
|
+
modeSplit: "Champs + aper\xE7u",
|
|
2178
2256
|
modePreview: "\xC9diteur visuel",
|
|
2179
2257
|
previewPane: "Aper\xE7u de la page",
|
|
2180
2258
|
resize: "Redimensionner le panneau d'aper\xE7u",
|
|
@@ -2269,6 +2347,9 @@ var fr_default = {
|
|
|
2269
2347
|
unstar: "Retirer des favoris",
|
|
2270
2348
|
quickInsert: "Ins\xE9rer {label}",
|
|
2271
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",
|
|
2272
2353
|
closeDetail: "Fermer les d\xE9tails",
|
|
2273
2354
|
typology: "Typologie",
|
|
2274
2355
|
typologyAuto: "Automatique ({name})",
|
|
@@ -2525,7 +2606,23 @@ var fr_default = {
|
|
|
2525
2606
|
layoutOff: "Pas de grille",
|
|
2526
2607
|
layoutNoMobile: "Aucun",
|
|
2527
2608
|
layoutHelp: "Les blocs du groupe s'affichent en grille dans le formulaire, avec le nombre de colonnes de ce bloc.",
|
|
2528
|
-
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"
|
|
2529
2626
|
};
|
|
2530
2627
|
|
|
2531
2628
|
// admin/translations/es.json
|
|
@@ -2583,10 +2680,10 @@ var es_default = {
|
|
|
2583
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.",
|
|
2584
2681
|
previewUrl: "URL base de la ruta de vista previa",
|
|
2585
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).",
|
|
2586
|
-
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.",
|
|
2587
2684
|
previewMode: "Modo inicial de la vista previa",
|
|
2588
|
-
"modes.form": "
|
|
2589
|
-
"modes.split": "Campos +
|
|
2685
|
+
"modes.form": "Solo campos",
|
|
2686
|
+
"modes.split": "Campos + vista previa",
|
|
2590
2687
|
"modes.preview": "Editor visual",
|
|
2591
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.",
|
|
2592
2689
|
lazyEdit: "Haz clic para editar",
|
|
@@ -2594,8 +2691,8 @@ var es_default = {
|
|
|
2594
2691
|
lazyFields: "Campos personalizados cargados bajo demanda",
|
|
2595
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.",
|
|
2596
2693
|
lazyFieldsInvalid: "Usa hasta {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor o global::mi-campo.",
|
|
2597
|
-
modeForm: "
|
|
2598
|
-
modeSplit: "Campos +
|
|
2694
|
+
modeForm: "Solo campos",
|
|
2695
|
+
modeSplit: "Campos + vista previa",
|
|
2599
2696
|
modePreview: "Editor visual",
|
|
2600
2697
|
previewPane: "Vista previa de la p\xE1gina",
|
|
2601
2698
|
resize: "Redimensionar el panel de vista previa",
|
|
@@ -2690,6 +2787,9 @@ var es_default = {
|
|
|
2690
2787
|
unstar: "Quitar de favoritos",
|
|
2691
2788
|
quickInsert: "Insertar {label}",
|
|
2692
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",
|
|
2693
2793
|
closeDetail: "Cerrar detalles",
|
|
2694
2794
|
typology: "Tipolog\xEDa",
|
|
2695
2795
|
typologyAuto: "Autom\xE1tica ({name})",
|
|
@@ -2946,7 +3046,23 @@ var es_default = {
|
|
|
2946
3046
|
layoutOff: "Sin cuadr\xEDcula",
|
|
2947
3047
|
layoutNoMobile: "Ninguno",
|
|
2948
3048
|
layoutHelp: "Los bloques del grupo se muestran en cuadr\xEDcula en el formulario, con el n\xFAmero de columnas de este bloque.",
|
|
2949
|
-
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"
|
|
2950
3066
|
};
|
|
2951
3067
|
|
|
2952
3068
|
// admin/translations/de.json
|
|
@@ -3004,10 +3120,10 @@ var de_default = {
|
|
|
3004
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.",
|
|
3005
3121
|
previewUrl: "Basis-URL der Vorschauroute",
|
|
3006
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).",
|
|
3007
|
-
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.",
|
|
3008
3124
|
previewMode: "Anf\xE4nglicher Vorschaumodus",
|
|
3009
|
-
"modes.form": "Felder",
|
|
3010
|
-
"modes.split": "Felder +
|
|
3125
|
+
"modes.form": "Nur Felder",
|
|
3126
|
+
"modes.split": "Felder + Vorschau",
|
|
3011
3127
|
"modes.preview": "Visueller Editor",
|
|
3012
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.",
|
|
3013
3129
|
lazyEdit: "Zum Bearbeiten klicken",
|
|
@@ -3015,8 +3131,8 @@ var de_default = {
|
|
|
3015
3131
|
lazyFields: "Bei Bedarf geladene benutzerdefinierte Felder",
|
|
3016
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.",
|
|
3017
3133
|
lazyFieldsInvalid: "Bis zu {max} Uids benutzerdefinierter Felder verwenden, z. B. plugin::ckeditor5.CKEditor oder global::mein-feld.",
|
|
3018
|
-
modeForm: "Felder",
|
|
3019
|
-
modeSplit: "Felder +
|
|
3134
|
+
modeForm: "Nur Felder",
|
|
3135
|
+
modeSplit: "Felder + Vorschau",
|
|
3020
3136
|
modePreview: "Visueller Editor",
|
|
3021
3137
|
previewPane: "Seitenvorschau",
|
|
3022
3138
|
resize: "Vorschaubereich anpassen",
|
|
@@ -3111,6 +3227,9 @@ var de_default = {
|
|
|
3111
3227
|
unstar: "Aus Favoriten entfernen",
|
|
3112
3228
|
quickInsert: "{label} einf\xFCgen",
|
|
3113
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",
|
|
3114
3233
|
closeDetail: "Details schlie\xDFen",
|
|
3115
3234
|
typology: "Typologie",
|
|
3116
3235
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -3367,7 +3486,23 @@ var de_default = {
|
|
|
3367
3486
|
layoutOff: "Kein Raster",
|
|
3368
3487
|
layoutNoMobile: "Keines",
|
|
3369
3488
|
layoutHelp: "Die Bl\xF6cke der Gruppe erscheinen im Formular als Raster, mit der Spaltenzahl dieses Blocks.",
|
|
3370
|
-
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"
|
|
3371
3506
|
};
|
|
3372
3507
|
|
|
3373
3508
|
// admin/translations/it.json
|
|
@@ -3425,10 +3560,10 @@ var it_default = {
|
|
|
3425
3560
|
rememberHelp: "Solo i pulsanti espliciti apri tutti / chiudi tutti aggiornano la memoria, per utente e browser. Aprire un singolo blocco non la cambia.",
|
|
3426
3561
|
previewUrl: "URL di base della route di anteprima",
|
|
3427
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).",
|
|
3428
|
-
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.",
|
|
3429
3564
|
previewMode: "Modalit\xE0 iniziale dell'anteprima",
|
|
3430
|
-
"modes.form": "
|
|
3431
|
-
"modes.split": "Campi +
|
|
3565
|
+
"modes.form": "Solo campi",
|
|
3566
|
+
"modes.split": "Campi + anteprima",
|
|
3432
3567
|
"modes.preview": "Editor visivo",
|
|
3433
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.",
|
|
3434
3569
|
lazyEdit: "Fai clic per modificare",
|
|
@@ -3436,8 +3571,8 @@ var it_default = {
|
|
|
3436
3571
|
lazyFields: "Campi personalizzati caricati su richiesta",
|
|
3437
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.",
|
|
3438
3573
|
lazyFieldsInvalid: "Usa fino a {max} uid di campi personalizzati, come plugin::ckeditor5.CKEditor o global::mio-campo.",
|
|
3439
|
-
modeForm: "
|
|
3440
|
-
modeSplit: "Campi +
|
|
3574
|
+
modeForm: "Solo campi",
|
|
3575
|
+
modeSplit: "Campi + anteprima",
|
|
3441
3576
|
modePreview: "Editor visivo",
|
|
3442
3577
|
previewPane: "Anteprima della pagina",
|
|
3443
3578
|
resize: "Ridimensiona il pannello di anteprima",
|
|
@@ -3532,6 +3667,9 @@ var it_default = {
|
|
|
3532
3667
|
unstar: "Rimuovi dai preferiti",
|
|
3533
3668
|
quickInsert: "Inserisci {label}",
|
|
3534
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",
|
|
3535
3673
|
closeDetail: "Chiudi dettagli",
|
|
3536
3674
|
typology: "Tipologia",
|
|
3537
3675
|
typologyAuto: "Automatica ({name})",
|
|
@@ -3788,7 +3926,23 @@ var it_default = {
|
|
|
3788
3926
|
layoutOff: "Nessuna griglia",
|
|
3789
3927
|
layoutNoMobile: "Nessuno",
|
|
3790
3928
|
layoutHelp: "I blocchi del gruppo appaiono in griglia nel modulo, con il numero di colonne di questo blocco.",
|
|
3791
|
-
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"
|
|
3792
3946
|
};
|
|
3793
3947
|
|
|
3794
3948
|
// admin/translations/nl.json
|
|
@@ -3846,10 +4000,10 @@ var nl_default = {
|
|
|
3846
4000
|
rememberHelp: "Alleen de expliciete knoppen alles openen / alles sluiten werken het geheugen bij, per gebruiker en browser. E\xE9n blok openen verandert niets.",
|
|
3847
4001
|
previewUrl: "Basis-URL van de voorbeeldroute",
|
|
3848
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).",
|
|
3849
|
-
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.",
|
|
3850
4004
|
previewMode: "Beginmodus van het voorbeeld",
|
|
3851
|
-
"modes.form": "
|
|
3852
|
-
"modes.split": "Velden +
|
|
4005
|
+
"modes.form": "Alleen velden",
|
|
4006
|
+
"modes.split": "Velden + voorbeeld",
|
|
3853
4007
|
"modes.preview": "Visuele editor",
|
|
3854
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.",
|
|
3855
4009
|
lazyEdit: "Klik om te bewerken",
|
|
@@ -3857,8 +4011,8 @@ var nl_default = {
|
|
|
3857
4011
|
lazyFields: "Aangepaste velden die op aanvraag laden",
|
|
3858
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.",
|
|
3859
4013
|
lazyFieldsInvalid: "Gebruik maximaal {max} uids van aangepaste velden, zoals plugin::ckeditor5.CKEditor of global::mijn-veld.",
|
|
3860
|
-
modeForm: "
|
|
3861
|
-
modeSplit: "Velden +
|
|
4014
|
+
modeForm: "Alleen velden",
|
|
4015
|
+
modeSplit: "Velden + voorbeeld",
|
|
3862
4016
|
modePreview: "Visuele editor",
|
|
3863
4017
|
previewPane: "Paginavoorbeeld",
|
|
3864
4018
|
resize: "Voorbeeldpaneel aanpassen",
|
|
@@ -3953,6 +4107,9 @@ var nl_default = {
|
|
|
3953
4107
|
unstar: "Uit favorieten verwijderen",
|
|
3954
4108
|
quickInsert: "{label} invoegen",
|
|
3955
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",
|
|
3956
4113
|
closeDetail: "Details sluiten",
|
|
3957
4114
|
typology: "Typologie",
|
|
3958
4115
|
typologyAuto: "Automatisch ({name})",
|
|
@@ -4209,7 +4366,23 @@ var nl_default = {
|
|
|
4209
4366
|
layoutOff: "Geen raster",
|
|
4210
4367
|
layoutNoMobile: "Geen",
|
|
4211
4368
|
layoutHelp: "De blokken van de groep verschijnen als raster in het formulier, met het aantal kolommen van dit blok.",
|
|
4212
|
-
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"
|
|
4213
4386
|
};
|
|
4214
4387
|
|
|
4215
4388
|
// admin/messages.ts
|
|
@@ -5866,6 +6039,10 @@ var Round = import_styled_components5.default.button`
|
|
|
5866
6039
|
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
5867
6040
|
color: ${({ theme, $on }) => $on ? theme.colors.warning500 : theme.colors.neutral600};
|
|
5868
6041
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
6042
|
+
transition: transform 120ms ease-out;
|
|
6043
|
+
&:active {
|
|
6044
|
+
transform: scale(0.97);
|
|
6045
|
+
}
|
|
5869
6046
|
&:focus-visible {
|
|
5870
6047
|
outline: 2px solid ${({ theme }) => theme.colors.primary600};
|
|
5871
6048
|
outline-offset: 1px;
|
|
@@ -6559,7 +6736,7 @@ function ZoneGallery({
|
|
|
6559
6736
|
gap: 4,
|
|
6560
6737
|
style: { overflowY: "auto", flex: 1, minHeight: 0, padding: "4px" },
|
|
6561
6738
|
children: (view === "recent" ? [{ typology: "recent", entries }] : groupEntries(entries)).map(
|
|
6562
|
-
({ 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: [
|
|
6563
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})` }),
|
|
6564
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)(
|
|
6565
6742
|
Card,
|
|
@@ -6845,7 +7022,7 @@ var import_styled_components6 = __toESM(require("styled-components"));
|
|
|
6845
7022
|
var import_design_system4 = require("@strapi/design-system");
|
|
6846
7023
|
|
|
6847
7024
|
// admin/pane.mjs
|
|
6848
|
-
var TOOLBAR = ["modes", "history", "devices", "status", "actions"];
|
|
7025
|
+
var TOOLBAR = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
6849
7026
|
var RIGHT = ["status", "actions"];
|
|
6850
7027
|
function toolbarLayout(list2) {
|
|
6851
7028
|
const ids = Array.isArray(list2) ? list2.filter((id, i) => TOOLBAR.includes(id) && list2.indexOf(id) === i) : TOOLBAR;
|
|
@@ -7296,7 +7473,8 @@ function PagePreview({
|
|
|
7296
7473
|
hiddenAttribute = null,
|
|
7297
7474
|
form = null,
|
|
7298
7475
|
Modal: Modal3,
|
|
7299
|
-
Toggle
|
|
7476
|
+
Toggle,
|
|
7477
|
+
versions
|
|
7300
7478
|
}) {
|
|
7301
7479
|
const t = useMessages();
|
|
7302
7480
|
const { values, zone, zoneLabel, canEdit, latest, insertRows: insertRows2 } = usePreviewZone(host);
|
|
@@ -7319,6 +7497,7 @@ function PagePreview({
|
|
|
7319
7497
|
const vw = main.width;
|
|
7320
7498
|
const [dragging, setDragging] = React8.useState(false);
|
|
7321
7499
|
const [ready, setReady] = React8.useState(false);
|
|
7500
|
+
const [readOnlyBridge, setReadOnlyBridge] = React8.useState(false);
|
|
7322
7501
|
const [failed, setFailed] = React8.useState(false);
|
|
7323
7502
|
const [attempt, retry] = React8.useReducer((n) => n + 1, 0);
|
|
7324
7503
|
const [picking, setPicking] = React8.useState(null);
|
|
@@ -7363,7 +7542,11 @@ function PagePreview({
|
|
|
7363
7542
|
const iframe = React8.useRef(null);
|
|
7364
7543
|
const loaded = React8.useRef(false);
|
|
7365
7544
|
const anchor = React8.useRef(null);
|
|
7366
|
-
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]);
|
|
7367
7550
|
const { base, source } = state.preview;
|
|
7368
7551
|
const url = base ? new URL(base) : null;
|
|
7369
7552
|
url?.searchParams.set("channel", channel);
|
|
@@ -7382,7 +7565,8 @@ function PagePreview({
|
|
|
7382
7565
|
setMode,
|
|
7383
7566
|
onChange,
|
|
7384
7567
|
clip,
|
|
7385
|
-
clipCount
|
|
7568
|
+
clipCount,
|
|
7569
|
+
readOnly
|
|
7386
7570
|
});
|
|
7387
7571
|
live.current = {
|
|
7388
7572
|
mode,
|
|
@@ -7392,7 +7576,8 @@ function PagePreview({
|
|
|
7392
7576
|
setMode,
|
|
7393
7577
|
onChange,
|
|
7394
7578
|
clip,
|
|
7395
|
-
clipCount
|
|
7579
|
+
clipCount,
|
|
7580
|
+
readOnly
|
|
7396
7581
|
};
|
|
7397
7582
|
const send = React8.useCallback(() => {
|
|
7398
7583
|
iframe.current?.contentWindow?.postMessage(
|
|
@@ -7401,19 +7586,29 @@ function PagePreview({
|
|
|
7401
7586
|
channel,
|
|
7402
7587
|
type: "update-page",
|
|
7403
7588
|
blocks: projectPage(
|
|
7404
|
-
|
|
7589
|
+
viewRows.current,
|
|
7405
7590
|
live.current.components,
|
|
7406
7591
|
window.location.origin,
|
|
7407
7592
|
hiddenAttribute
|
|
7408
|
-
),
|
|
7593
|
+
).map((block) => live.current.readOnly ? { ...block, fields: [], media: {} } : block),
|
|
7409
7594
|
groups,
|
|
7410
7595
|
locale: t.locale,
|
|
7411
7596
|
mode: live.current.mode,
|
|
7412
|
-
clipboard: live.current.clipCount
|
|
7597
|
+
clipboard: live.current.readOnly ? 0 : live.current.clipCount,
|
|
7598
|
+
readOnly: live.current.readOnly
|
|
7413
7599
|
},
|
|
7414
7600
|
origin
|
|
7415
7601
|
);
|
|
7416
|
-
}, [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]);
|
|
7417
7612
|
const indexOf = (key) => latest.current.findIndex((row) => blockKey(row) === key);
|
|
7418
7613
|
const path = (key, field) => `${zone}.${indexOf(key)}.${field}`;
|
|
7419
7614
|
React8.useEffect(() => {
|
|
@@ -7570,9 +7765,11 @@ function PagePreview({
|
|
|
7570
7765
|
React8.useEffect(() => {
|
|
7571
7766
|
if (!active) return;
|
|
7572
7767
|
setReady(false);
|
|
7768
|
+
setReadOnlyBridge(false);
|
|
7573
7769
|
setFailed(false);
|
|
7574
7770
|
const timeout = setTimeout(() => setFailed(true), 15e3);
|
|
7575
7771
|
const receive = (event) => {
|
|
7772
|
+
if (!previewMessageAllowed(event, origin, iframe.current?.contentWindow, channel, live.current.readOnly)) return;
|
|
7576
7773
|
const is = (type) => isPreviewMessage(
|
|
7577
7774
|
event,
|
|
7578
7775
|
origin,
|
|
@@ -7585,6 +7782,7 @@ function PagePreview({
|
|
|
7585
7782
|
clearTimeout(timeout);
|
|
7586
7783
|
setReady(true);
|
|
7587
7784
|
setFailed(false);
|
|
7785
|
+
setReadOnlyBridge(Array.isArray(event.data.capabilities) && event.data.capabilities.includes("readOnly"));
|
|
7588
7786
|
send();
|
|
7589
7787
|
return;
|
|
7590
7788
|
}
|
|
@@ -7712,9 +7910,9 @@ function PagePreview({
|
|
|
7712
7910
|
if (!ready || !active) return;
|
|
7713
7911
|
const timer = setTimeout(send, 120);
|
|
7714
7912
|
return () => clearTimeout(timer);
|
|
7715
|
-
}, [values, host.components, ready, active, send, mode, clipCount]);
|
|
7913
|
+
}, [values, version, host.components, ready, active, send, mode, clipCount]);
|
|
7716
7914
|
React8.useEffect(() => {
|
|
7717
|
-
if (!active || !ready) return;
|
|
7915
|
+
if (!active || !ready || readOnly) return;
|
|
7718
7916
|
let last = null;
|
|
7719
7917
|
const post = (key) => {
|
|
7720
7918
|
if (key === last) return;
|
|
@@ -7737,7 +7935,7 @@ function PagePreview({
|
|
|
7737
7935
|
document.removeEventListener("pointerout", onOut);
|
|
7738
7936
|
post(null);
|
|
7739
7937
|
};
|
|
7740
|
-
}, [active, ready, channel, origin]);
|
|
7938
|
+
}, [active, ready, channel, origin, readOnly]);
|
|
7741
7939
|
React8.useEffect(() => {
|
|
7742
7940
|
const item = hovered && active ? findZoneList(live.current.zoneLabel)?.querySelectorAll(":scope > li")[indexOf(hovered)] : void 0;
|
|
7743
7941
|
hoverRow.current = item || null;
|
|
@@ -7791,7 +7989,7 @@ function PagePreview({
|
|
|
7791
7989
|
}
|
|
7792
7990
|
) });
|
|
7793
7991
|
const layout = toolbarLayout(editor?.previewToolbar);
|
|
7794
|
-
const tools = { modes: switcher, history: historyTools, devices };
|
|
7992
|
+
const tools = { modes: switcher, history: !readOnly && historyTools, versions: versions?.button, devices };
|
|
7795
7993
|
const toolbarShown = !ready || layout.before.length + layout.right.length + layout.after.length > 0;
|
|
7796
7994
|
const onKey = (event) => {
|
|
7797
7995
|
const map = {
|
|
@@ -7900,7 +8098,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7900
8098
|
children: [
|
|
7901
8099
|
!ready && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Typography, { variant: "pi", role: "status", textColor: "neutral600", children: failed ? t.previewFailed : t.previewLoading }),
|
|
7902
8100
|
failed && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Button, { size: "S", variant: "secondary", onClick: retry, children: t.retry }),
|
|
7903
|
-
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 })
|
|
7904
8102
|
]
|
|
7905
8103
|
}
|
|
7906
8104
|
),
|
|
@@ -7908,62 +8106,68 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7908
8106
|
]
|
|
7909
8107
|
}
|
|
7910
8108
|
),
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
{
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
}
|
|
7942
|
-
) }),
|
|
7943
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7944
|
-
"div",
|
|
7945
|
-
{
|
|
7946
|
-
ref: setStage,
|
|
7947
|
-
"data-testid": "page-preview-stage",
|
|
7948
|
-
"data-device": device.id,
|
|
7949
|
-
style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
|
|
7950
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7951
|
-
Frame2,
|
|
7952
|
-
{
|
|
7953
|
-
ref: iframe,
|
|
7954
|
-
title: t.previewPane,
|
|
7955
|
-
src: url.href,
|
|
7956
|
-
sandbox: "allow-scripts allow-same-origin",
|
|
7957
|
-
referrerPolicy: "no-referrer",
|
|
7958
|
-
onLoad: () => {
|
|
7959
|
-
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
|
+
]
|
|
7960
8139
|
},
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
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
|
|
7967
8171
|
] })
|
|
7968
8172
|
]
|
|
7969
8173
|
}
|
|
@@ -7990,6 +8194,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
7990
8194
|
if (!open) setInserting(null);
|
|
7991
8195
|
},
|
|
7992
8196
|
onSelect: (uid, values2) => {
|
|
8197
|
+
if (live.current.readOnly) return;
|
|
7993
8198
|
const rows = inserting.zone === zone ? latest.current : Array.isArray(host.values?.[inserting.zone]) ? host.values[inserting.zone] : [];
|
|
7994
8199
|
const index = insertIndex(rows, inserting.after);
|
|
7995
8200
|
setInserting(null);
|
|
@@ -8114,6 +8319,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
|
|
|
8114
8319
|
multiple: picking.attr.multiple === true,
|
|
8115
8320
|
onClose: () => setPicking(null),
|
|
8116
8321
|
onSelectAssets: (assets) => {
|
|
8322
|
+
if (live.current.readOnly) return;
|
|
8117
8323
|
const index = indexOf(picking.key);
|
|
8118
8324
|
setPicking(null);
|
|
8119
8325
|
if (index < 0 || !assets?.length) return;
|
|
@@ -8438,6 +8644,8 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8438
8644
|
const initialValues = (0, import_admin2.useForm)("BlocksceneVersions", (state) => state.initialValues);
|
|
8439
8645
|
const setValues = (0, import_admin2.useForm)("BlocksceneVersions", (state) => state.setValues);
|
|
8440
8646
|
const [events, setEvents] = React10.useState(null);
|
|
8647
|
+
const [pagination, setPagination] = React10.useState(null);
|
|
8648
|
+
const [moreLoading, setMoreLoading] = React10.useState(false);
|
|
8441
8649
|
const [failed, setFailed] = React10.useState(false);
|
|
8442
8650
|
const [shown, setShown] = React10.useState(PAGE);
|
|
8443
8651
|
const [open, setOpen] = React10.useState(null);
|
|
@@ -8445,11 +8653,19 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8445
8653
|
const [loading, setLoading] = React10.useState(false);
|
|
8446
8654
|
const [refresh, reload] = React10.useReducer((n) => n + 1, 0);
|
|
8447
8655
|
const allowed = Boolean(allowedActions?.canRead);
|
|
8656
|
+
const scope = `${model}:${documentId}:${locale}:${allowed}`;
|
|
8657
|
+
const latestScope = React10.useRef(scope);
|
|
8658
|
+
latestScope.current = scope;
|
|
8448
8659
|
React10.useEffect(() => {
|
|
8449
8660
|
if (!allowed || !documentId) return;
|
|
8450
8661
|
let active = true;
|
|
8451
8662
|
setFailed(false);
|
|
8452
|
-
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));
|
|
8453
8669
|
return () => {
|
|
8454
8670
|
active = false;
|
|
8455
8671
|
};
|
|
@@ -8458,7 +8674,26 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8458
8674
|
setOpen(null);
|
|
8459
8675
|
setReport(null);
|
|
8460
8676
|
setShown(PAGE);
|
|
8677
|
+
setEvents(null);
|
|
8678
|
+
setPagination(null);
|
|
8679
|
+
setMoreLoading(false);
|
|
8461
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
|
+
};
|
|
8462
8697
|
if (isLoading || !allowed || !documentId) return null;
|
|
8463
8698
|
const name = (uid) => components?.[uid]?.info?.displayName || uid;
|
|
8464
8699
|
const when2 = (at) => {
|
|
@@ -8554,30 +8789,270 @@ function History({ model, documentId, schema, components, editable, disabled, ge
|
|
|
8554
8789
|
] }) })
|
|
8555
8790
|
] }, event.id);
|
|
8556
8791
|
}),
|
|
8557
|
-
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 }) })
|
|
8558
8793
|
] })
|
|
8559
8794
|
] });
|
|
8560
8795
|
}
|
|
8561
8796
|
|
|
8562
|
-
// admin/
|
|
8797
|
+
// admin/Versions.tsx
|
|
8563
8798
|
var React11 = __toESM(require("react"));
|
|
8564
|
-
var import_design_system7 = require("@strapi/design-system");
|
|
8565
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");
|
|
8566
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");
|
|
8567
9042
|
var COLOR2 = /^#[0-9A-Fa-f]{6}$/;
|
|
8568
|
-
var Grid2 =
|
|
8569
|
-
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`
|
|
8570
9045
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8571
9046
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral0};
|
|
8572
9047
|
`;
|
|
8573
|
-
var Bar =
|
|
9048
|
+
var Bar = import_styled_components8.default.div`
|
|
8574
9049
|
position: fixed; top: 0; z-index: 4; padding: 12px 32px;
|
|
8575
9050
|
background: ${({ theme }) => theme.colors.neutral100}; border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8576
9051
|
box-shadow: 0 1px 4px rgba(33, 33, 52, 0.1);
|
|
8577
9052
|
`;
|
|
8578
9053
|
function useMainRect2(anchor) {
|
|
8579
|
-
const [rect, setRect] =
|
|
8580
|
-
|
|
9054
|
+
const [rect, setRect] = React12.useState({ left: 0, width: 0 });
|
|
9055
|
+
React12.useEffect(() => {
|
|
8581
9056
|
const read3 = () => {
|
|
8582
9057
|
let host = document.getElementById("main-content");
|
|
8583
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;
|
|
@@ -8590,15 +9065,15 @@ function useMainRect2(anchor) {
|
|
|
8590
9065
|
});
|
|
8591
9066
|
return rect;
|
|
8592
9067
|
}
|
|
8593
|
-
var Swatches =
|
|
8594
|
-
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; `;
|
|
8595
9070
|
function ColorField({ name, label, value, onChange, disabled }) {
|
|
8596
9071
|
const valid = COLOR2.test(value);
|
|
8597
|
-
return /* @__PURE__ */ (0,
|
|
8598
|
-
/* @__PURE__ */ (0,
|
|
8599
|
-
/* @__PURE__ */ (0,
|
|
8600
|
-
/* @__PURE__ */ (0,
|
|
8601
|
-
/* @__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)(
|
|
8602
9077
|
"input",
|
|
8603
9078
|
{
|
|
8604
9079
|
name,
|
|
@@ -8614,14 +9089,14 @@ function ColorField({ name, label, value, onChange, disabled }) {
|
|
|
8614
9089
|
] });
|
|
8615
9090
|
}
|
|
8616
9091
|
function TagsField({ name, label, hint, value, onChange, disabled }) {
|
|
8617
|
-
const [text, setText] =
|
|
8618
|
-
return /* @__PURE__ */ (0,
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8620
|
-
/* @__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) => {
|
|
8621
9096
|
setText(e.target.value);
|
|
8622
9097
|
onChange([...new Set(e.target.value.split(",").map((tag) => tag.replace(/[<>]/g, "").trim().slice(0, 24)).filter(Boolean))].slice(0, 10));
|
|
8623
9098
|
}, style: { padding: "6px 8px", border: "1px solid #dcdce4", borderRadius: 4, fontSize: 13 } }),
|
|
8624
|
-
/* @__PURE__ */ (0,
|
|
9099
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: hint })
|
|
8625
9100
|
] });
|
|
8626
9101
|
}
|
|
8627
9102
|
var FIELD_UID = /^(plugin|global)::[\w.-]+$/;
|
|
@@ -8629,11 +9104,11 @@ var LAZY_MAX = 20;
|
|
|
8629
9104
|
var parseUids = (text) => [...new Set(text.split(/[\s,]+/).filter(Boolean))];
|
|
8630
9105
|
var badUids = (uids = []) => uids.length > LAZY_MAX || uids.some((uid) => !FIELD_UID.test(uid));
|
|
8631
9106
|
function UidListField({ TextField: TextField2, value, onChange, ...props }) {
|
|
8632
|
-
const [text, setText] =
|
|
8633
|
-
|
|
9107
|
+
const [text, setText] = React12.useState(value.join(", "));
|
|
9108
|
+
React12.useEffect(() => {
|
|
8634
9109
|
if (parseUids(text).join() !== value.join()) setText(value.join(", "));
|
|
8635
9110
|
}, [value.join()]);
|
|
8636
|
-
return /* @__PURE__ */ (0,
|
|
9111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TextField2, { ...props, value: text, onChange: (v) => {
|
|
8637
9112
|
setText(v);
|
|
8638
9113
|
onChange(parseUids(v));
|
|
8639
9114
|
} });
|
|
@@ -8643,31 +9118,31 @@ var SIDEBAR_MAX = 12;
|
|
|
8643
9118
|
var ITEM_LABEL = /^[^<>]{1,40}$/;
|
|
8644
9119
|
var badItem = (item) => !ITEM_LABEL.test(String(item.label || "").trim()) || !item.fields?.length;
|
|
8645
9120
|
var SYSTEM_FIELDS2 = ["createdAt", "updatedAt", "publishedAt", "createdBy", "updatedBy", "locale", "localizations"];
|
|
8646
|
-
var Item =
|
|
9121
|
+
var Item = import_styled_components8.default.div`
|
|
8647
9122
|
display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
|
|
8648
9123
|
border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral100};
|
|
8649
9124
|
`;
|
|
8650
|
-
var Checks =
|
|
9125
|
+
var Checks = import_styled_components8.default.fieldset`
|
|
8651
9126
|
display: flex; flex-wrap: wrap; gap: 4px 16px; border: 0; padding: 0; margin: 0; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800};
|
|
8652
9127
|
legend { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
|
|
8653
9128
|
label { display: inline-flex; align-items: center; gap: 6px; }
|
|
8654
9129
|
`;
|
|
8655
|
-
var TOOLBAR2 = ["modes", "history", "devices", "status", "actions"];
|
|
9130
|
+
var TOOLBAR2 = ["modes", "history", "versions", "devices", "status", "actions"];
|
|
8656
9131
|
var DEVICE_NAMES = ["fit", "mobile", "tablet", "desktop"];
|
|
8657
9132
|
var DEVICE_LABEL = /^[^<>]{1,24}$/;
|
|
8658
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;
|
|
8659
|
-
var Row =
|
|
8660
|
-
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 }) {
|
|
8661
9136
|
const move = (list2, index, by) => {
|
|
8662
9137
|
const next = [...list2];
|
|
8663
9138
|
[next[index], next[index + by]] = [next[index + by], next[index]];
|
|
8664
9139
|
return next;
|
|
8665
9140
|
};
|
|
8666
|
-
const arrows = (list2, index, key) => /* @__PURE__ */ (0,
|
|
8667
|
-
/* @__PURE__ */ (0,
|
|
8668
|
-
/* @__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)) })
|
|
8669
9144
|
] });
|
|
8670
|
-
const check = (list2, item, key) => /* @__PURE__ */ (0,
|
|
9145
|
+
const check = (list2, item, key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8671
9146
|
"input",
|
|
8672
9147
|
{
|
|
8673
9148
|
type: "checkbox",
|
|
@@ -8678,27 +9153,27 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8678
9153
|
}
|
|
8679
9154
|
);
|
|
8680
9155
|
const width = (index, patch) => set2("previewDevices", devices.map((item, i) => i === index ? { ...item, ...patch } : item));
|
|
8681
|
-
return /* @__PURE__ */ (0,
|
|
8682
|
-
/* @__PURE__ */ (0,
|
|
8683
|
-
/* @__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: [
|
|
8684
9159
|
arrows(toolbar, toolbar.indexOf(item), "previewToolbar"),
|
|
8685
|
-
/* @__PURE__ */ (0,
|
|
9160
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
|
|
8686
9161
|
check(toolbar, item, "previewToolbar"),
|
|
8687
9162
|
t.toolbar[item]
|
|
8688
9163
|
] })
|
|
8689
9164
|
] }, item)) }),
|
|
8690
|
-
/* @__PURE__ */ (0,
|
|
8691
|
-
/* @__PURE__ */ (0,
|
|
8692
|
-
/* @__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) => {
|
|
8693
9168
|
const index = devices.indexOf(item);
|
|
8694
|
-
return /* @__PURE__ */ (0,
|
|
9169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Row, { "data-testid": `${id}-device-${typeof item === "string" ? item : index}`, children: [
|
|
8695
9170
|
arrows(devices, index, "previewDevices"),
|
|
8696
|
-
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: [
|
|
8697
9172
|
check(devices, item, "previewDevices"),
|
|
8698
9173
|
t.device[item]
|
|
8699
|
-
] }) : /* @__PURE__ */ (0,
|
|
8700
|
-
/* @__PURE__ */ (0,
|
|
8701
|
-
/* @__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)(
|
|
8702
9177
|
TextField2,
|
|
8703
9178
|
{
|
|
8704
9179
|
name: `${id}-device-width-${index}`,
|
|
@@ -8708,12 +9183,12 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8708
9183
|
onChange: (v) => width(index, { width: /^\d{1,4}$/.test(v.trim()) ? Number(v.trim()) : NaN })
|
|
8709
9184
|
}
|
|
8710
9185
|
) }),
|
|
8711
|
-
/* @__PURE__ */ (0,
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tool, { icon: "close", label: t.paneRemoveWidth, disabled, onClick: () => set2("previewDevices", devices.filter((_, i) => i !== index)) })
|
|
8712
9187
|
] })
|
|
8713
9188
|
] }, typeof item === "string" ? item : `px-${index}`);
|
|
8714
9189
|
}) }),
|
|
8715
|
-
/* @__PURE__ */ (0,
|
|
8716
|
-
|
|
9190
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Flex, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9191
|
+
import_design_system8.Button,
|
|
8717
9192
|
{
|
|
8718
9193
|
variant: "secondary",
|
|
8719
9194
|
size: "S",
|
|
@@ -8723,7 +9198,7 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
|
|
|
8723
9198
|
children: t.paneAddWidth
|
|
8724
9199
|
}
|
|
8725
9200
|
) }),
|
|
8726
|
-
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 })
|
|
8727
9202
|
] });
|
|
8728
9203
|
}
|
|
8729
9204
|
var DAYS = (n) => Number.isInteger(n) && n >= 1 && n <= 3650;
|
|
@@ -8731,7 +9206,7 @@ var badRetention = (h) => !h || !DAYS(h.retentionDays) || !DAYS(h.eventDays) ||
|
|
|
8731
9206
|
function HistorySettings({ types, history, set: set2, t, disabled, ToggleField: ToggleField2, TextField: TextField2 }) {
|
|
8732
9207
|
const all = history.contentTypes === "all";
|
|
8733
9208
|
const list2 = all ? [] : history.contentTypes;
|
|
8734
|
-
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)(
|
|
8735
9210
|
TextField2,
|
|
8736
9211
|
{
|
|
8737
9212
|
name: `history-${key}`,
|
|
@@ -8741,15 +9216,15 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8741
9216
|
onChange: (v) => set2(key, /^\d{1,5}$/.test(v.trim()) ? Number(v.trim()) : NaN)
|
|
8742
9217
|
}
|
|
8743
9218
|
) });
|
|
8744
|
-
return /* @__PURE__ */ (0,
|
|
8745
|
-
/* @__PURE__ */ (0,
|
|
8746
|
-
/* @__PURE__ */ (0,
|
|
8747
|
-
/* @__PURE__ */ (0,
|
|
8748
|
-
/* @__PURE__ */ (0,
|
|
8749
|
-
!all && /* @__PURE__ */ (0,
|
|
8750
|
-
/* @__PURE__ */ (0,
|
|
8751
|
-
types.map((type) => /* @__PURE__ */ (0,
|
|
8752
|
-
/* @__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)(
|
|
8753
9228
|
"input",
|
|
8754
9229
|
{
|
|
8755
9230
|
type: "checkbox",
|
|
@@ -8761,13 +9236,13 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
|
|
|
8761
9236
|
type.displayName
|
|
8762
9237
|
] }, type.uid))
|
|
8763
9238
|
] }),
|
|
8764
|
-
/* @__PURE__ */ (0,
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Flex, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
|
|
8765
9240
|
number("retentionDays"),
|
|
8766
9241
|
number("maxSnapshots"),
|
|
8767
9242
|
number("eventDays"),
|
|
8768
9243
|
number("trashDays")
|
|
8769
9244
|
] }),
|
|
8770
|
-
/* @__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}` })
|
|
8771
9246
|
] }) });
|
|
8772
9247
|
}
|
|
8773
9248
|
function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: SelectField2, TextField: TextField2 }) {
|
|
@@ -8781,10 +9256,10 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8781
9256
|
};
|
|
8782
9257
|
const fields = (type.attributes || []).filter((attr) => !SYSTEM_FIELDS2.includes(attr.name));
|
|
8783
9258
|
const id = (name, index) => `sidebar-${name}-${type.uid}${index === void 0 ? "" : `-${index}`}`;
|
|
8784
|
-
return /* @__PURE__ */ (0,
|
|
8785
|
-
/* @__PURE__ */ (0,
|
|
8786
|
-
/* @__PURE__ */ (0,
|
|
8787
|
-
/* @__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)(
|
|
8788
9263
|
SelectField2,
|
|
8789
9264
|
{
|
|
8790
9265
|
name: id("position"),
|
|
@@ -8795,21 +9270,21 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8795
9270
|
onChange: (v) => set2("sidebarPosition", v, "left")
|
|
8796
9271
|
}
|
|
8797
9272
|
) }),
|
|
8798
|
-
items2.map((item, index) => /* @__PURE__ */ (0,
|
|
8799
|
-
/* @__PURE__ */ (0,
|
|
8800
|
-
/* @__PURE__ */ (0,
|
|
8801
|
-
/* @__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)(
|
|
8802
9277
|
SelectField2,
|
|
8803
9278
|
{
|
|
8804
9279
|
name: id("icon", index),
|
|
8805
9280
|
label: t.sidebarIcon,
|
|
8806
9281
|
value: item.icon || "none",
|
|
8807
9282
|
disabled,
|
|
8808
|
-
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 }) }))],
|
|
8809
9284
|
onChange: (v) => edit(index, { icon: v === "none" ? void 0 : v })
|
|
8810
9285
|
}
|
|
8811
9286
|
) }),
|
|
8812
|
-
/* @__PURE__ */ (0,
|
|
9287
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 160 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8813
9288
|
SelectField2,
|
|
8814
9289
|
{
|
|
8815
9290
|
name: id("open", index),
|
|
@@ -8820,16 +9295,16 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8820
9295
|
onChange: (v) => edit(index, { open: v })
|
|
8821
9296
|
}
|
|
8822
9297
|
) }),
|
|
8823
|
-
/* @__PURE__ */ (0,
|
|
8824
|
-
/* @__PURE__ */ (0,
|
|
8825
|
-
/* @__PURE__ */ (0,
|
|
8826
|
-
/* @__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)) })
|
|
8827
9302
|
] })
|
|
8828
9303
|
] }),
|
|
8829
|
-
/* @__PURE__ */ (0,
|
|
8830
|
-
/* @__PURE__ */ (0,
|
|
8831
|
-
fields.map((attr) => /* @__PURE__ */ (0,
|
|
8832
|
-
/* @__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)(
|
|
8833
9308
|
"input",
|
|
8834
9309
|
{
|
|
8835
9310
|
type: "checkbox",
|
|
@@ -8841,11 +9316,11 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8841
9316
|
attr.name
|
|
8842
9317
|
] }, attr.name))
|
|
8843
9318
|
] }),
|
|
8844
|
-
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 })
|
|
8845
9320
|
] }, index)),
|
|
8846
|
-
/* @__PURE__ */ (0,
|
|
8847
|
-
/* @__PURE__ */ (0,
|
|
8848
|
-
|
|
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,
|
|
8849
9324
|
{
|
|
8850
9325
|
variant: "secondary",
|
|
8851
9326
|
size: "S",
|
|
@@ -8855,7 +9330,7 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
|
|
|
8855
9330
|
children: t.sidebarAdd
|
|
8856
9331
|
}
|
|
8857
9332
|
),
|
|
8858
|
-
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 }) })
|
|
8859
9334
|
] })
|
|
8860
9335
|
] });
|
|
8861
9336
|
}
|
|
@@ -8864,18 +9339,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8864
9339
|
const t = useMessages();
|
|
8865
9340
|
const { get, put, del } = useClient();
|
|
8866
9341
|
const { canRead, canUpdate, isLoading } = usePermissions2();
|
|
8867
|
-
const [data, setData] =
|
|
8868
|
-
const [catalog, setCatalog] =
|
|
8869
|
-
const [settings, setSettings] =
|
|
8870
|
-
const [media, setMedia] =
|
|
8871
|
-
const [sources, setSources] =
|
|
8872
|
-
const [dirty, setDirty] =
|
|
8873
|
-
const [saving, setSaving] =
|
|
8874
|
-
const [status, setStatus] =
|
|
8875
|
-
const [failed, setFailed] =
|
|
8876
|
-
const [filter, setFilter] =
|
|
8877
|
-
const [picking, setPicking] =
|
|
8878
|
-
|
|
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(() => {
|
|
8879
9354
|
if (!canRead || isLoading) return;
|
|
8880
9355
|
let active = true;
|
|
8881
9356
|
Promise.all([get("/blockscene/settings"), get("/blockscene/catalog")]).then(([s, c]) => {
|
|
@@ -8953,36 +9428,36 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8953
9428
|
return index === 0 && manual ? t.manual : t.automatic;
|
|
8954
9429
|
};
|
|
8955
9430
|
const ready = !isLoading && canRead && !failed && settings && catalog;
|
|
8956
|
-
const header =
|
|
8957
|
-
const [floating, setFloating] =
|
|
9431
|
+
const header = React12.useRef(null);
|
|
9432
|
+
const [floating, setFloating] = React12.useState(false);
|
|
8958
9433
|
const main = useMainRect2(header);
|
|
8959
|
-
|
|
9434
|
+
React12.useEffect(() => {
|
|
8960
9435
|
const el = header.current;
|
|
8961
9436
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
8962
9437
|
const observer = new IntersectionObserver(([entry]) => setFloating(!entry.isIntersecting && entry.boundingClientRect.top < 0));
|
|
8963
9438
|
observer.observe(el);
|
|
8964
9439
|
return () => observer.disconnect();
|
|
8965
9440
|
}, [ready]);
|
|
8966
|
-
const controls = (suffix) => ready && /* @__PURE__ */ (0,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
8968
|
-
!suffix && /* @__PURE__ */ (0,
|
|
8969
|
-
/* @__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 })
|
|
8970
9445
|
] });
|
|
8971
|
-
return /* @__PURE__ */ (0,
|
|
8972
|
-
/* @__PURE__ */ (0,
|
|
8973
|
-
/* @__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 }),
|
|
8974
9449
|
controls("")
|
|
8975
9450
|
] }) }),
|
|
8976
|
-
floating && main.width > 0 && /* @__PURE__ */ (0,
|
|
8977
|
-
/* @__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 }),
|
|
8978
9453
|
controls("-floating")
|
|
8979
9454
|
] }) }),
|
|
8980
|
-
/* @__PURE__ */ (0,
|
|
8981
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8982
|
-
data.disabled && /* @__PURE__ */ (0,
|
|
8983
|
-
/* @__PURE__ */ (0,
|
|
8984
|
-
/* @__PURE__ */ (0,
|
|
8985
|
-
/* @__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)(
|
|
8986
9461
|
ColorField,
|
|
8987
9462
|
{
|
|
8988
9463
|
name: `palette-${key}`,
|
|
@@ -8996,43 +9471,43 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
8996
9471
|
},
|
|
8997
9472
|
key
|
|
8998
9473
|
)) }),
|
|
8999
|
-
badColor && /* @__PURE__ */ (0,
|
|
9000
|
-
/* @__PURE__ */ (0,
|
|
9001
|
-
/* @__PURE__ */ (0,
|
|
9002
|
-
/* @__PURE__ */ (0,
|
|
9003
|
-
/* @__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] })
|
|
9004
9479
|
] }, template)) }),
|
|
9005
|
-
/* @__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) => {
|
|
9006
9481
|
s.palette = { ...DEFAULT_PALETTE };
|
|
9007
9482
|
return s;
|
|
9008
9483
|
}), children: t.resetPalette }) })
|
|
9009
9484
|
] }) }),
|
|
9010
|
-
/* @__PURE__ */ (0,
|
|
9011
|
-
/* @__PURE__ */ (0,
|
|
9012
|
-
/* @__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) => {
|
|
9013
9488
|
s.editor.enabled = v;
|
|
9014
9489
|
return s;
|
|
9015
9490
|
}) }),
|
|
9016
|
-
/* @__PURE__ */ (0,
|
|
9017
|
-
/* @__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) => {
|
|
9018
9493
|
s.editor.showOpenAll = v;
|
|
9019
9494
|
return s;
|
|
9020
9495
|
}) }),
|
|
9021
|
-
/* @__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) => {
|
|
9022
9497
|
s.editor.showCloseAll = v;
|
|
9023
9498
|
return s;
|
|
9024
9499
|
}) }),
|
|
9025
|
-
/* @__PURE__ */ (0,
|
|
9026
|
-
/* @__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) => {
|
|
9027
9502
|
s.editor.showRowThumbnails = v;
|
|
9028
9503
|
return s;
|
|
9029
9504
|
}) }),
|
|
9030
|
-
/* @__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) => {
|
|
9031
9506
|
s.editor.friendlyLabels = v;
|
|
9032
9507
|
return s;
|
|
9033
9508
|
}) }),
|
|
9034
|
-
/* @__PURE__ */ (0,
|
|
9035
|
-
/* @__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)(
|
|
9036
9511
|
SelectField2,
|
|
9037
9512
|
{
|
|
9038
9513
|
name: "editor-initialState",
|
|
@@ -9046,8 +9521,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9046
9521
|
})
|
|
9047
9522
|
}
|
|
9048
9523
|
),
|
|
9049
|
-
/* @__PURE__ */ (0,
|
|
9050
|
-
/* @__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)(
|
|
9051
9526
|
TextField2,
|
|
9052
9527
|
{
|
|
9053
9528
|
name: "editor-blockPreviewUrl",
|
|
@@ -9061,8 +9536,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9061
9536
|
})
|
|
9062
9537
|
}
|
|
9063
9538
|
),
|
|
9064
|
-
/* @__PURE__ */ (0,
|
|
9065
|
-
/* @__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)(
|
|
9066
9541
|
TextField2,
|
|
9067
9542
|
{
|
|
9068
9543
|
name: "editor-previewUrl",
|
|
@@ -9076,9 +9551,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9076
9551
|
})
|
|
9077
9552
|
}
|
|
9078
9553
|
),
|
|
9079
|
-
/* @__PURE__ */ (0,
|
|
9080
|
-
!editor.previewUrl && /* @__PURE__ */ (0,
|
|
9081
|
-
/* @__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)(
|
|
9082
9557
|
SelectField2,
|
|
9083
9558
|
{
|
|
9084
9559
|
name: "editor-previewMode",
|
|
@@ -9092,12 +9567,13 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9092
9567
|
})
|
|
9093
9568
|
}
|
|
9094
9569
|
),
|
|
9095
|
-
/* @__PURE__ */ (0,
|
|
9096
|
-
/* @__PURE__ */ (0,
|
|
9097
|
-
/* @__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)(
|
|
9098
9573
|
PaneEditor,
|
|
9099
9574
|
{
|
|
9100
9575
|
id: "editor",
|
|
9576
|
+
versions: Boolean(data.historyTypes),
|
|
9101
9577
|
toolbar: editor.previewToolbar || TOOLBAR2,
|
|
9102
9578
|
devices: editor.previewDevices || DEVICE_NAMES,
|
|
9103
9579
|
t,
|
|
@@ -9109,12 +9585,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9109
9585
|
})
|
|
9110
9586
|
}
|
|
9111
9587
|
),
|
|
9112
|
-
lazyEditors && /* @__PURE__ */ (0,
|
|
9113
|
-
/* @__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) => {
|
|
9114
9590
|
s.editor.lazyEditors = v;
|
|
9115
9591
|
return s;
|
|
9116
9592
|
}) }),
|
|
9117
|
-
/* @__PURE__ */ (0,
|
|
9593
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9118
9594
|
UidListField,
|
|
9119
9595
|
{
|
|
9120
9596
|
TextField: TextField2,
|
|
@@ -9129,31 +9605,31 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9129
9605
|
})
|
|
9130
9606
|
}
|
|
9131
9607
|
),
|
|
9132
|
-
/* @__PURE__ */ (0,
|
|
9133
|
-
data.blockPreviewAvailable && /* @__PURE__ */ (0,
|
|
9134
|
-
/* @__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) => {
|
|
9135
9611
|
s.editor.blockPreviewInForm = v;
|
|
9136
9612
|
return s;
|
|
9137
9613
|
}) }),
|
|
9138
|
-
/* @__PURE__ */ (0,
|
|
9614
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
|
|
9139
9615
|
] })
|
|
9140
9616
|
] })
|
|
9141
9617
|
] }) }),
|
|
9142
|
-
/* @__PURE__ */ (0,
|
|
9143
|
-
/* @__PURE__ */ (0,
|
|
9144
|
-
/* @__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) => {
|
|
9145
9621
|
s.editor.confirmDelete = v;
|
|
9146
9622
|
return s;
|
|
9147
9623
|
}) }),
|
|
9148
|
-
/* @__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) => {
|
|
9149
9625
|
s.editor.duplicate = v;
|
|
9150
9626
|
return s;
|
|
9151
9627
|
}) }),
|
|
9152
|
-
/* @__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) => {
|
|
9153
9629
|
s.editor.clipboard = v;
|
|
9154
9630
|
return s;
|
|
9155
9631
|
}) }),
|
|
9156
|
-
/* @__PURE__ */ (0,
|
|
9632
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9157
9633
|
SelectField2,
|
|
9158
9634
|
{
|
|
9159
9635
|
name: "editor-hiddenBlocks",
|
|
@@ -9167,9 +9643,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9167
9643
|
})
|
|
9168
9644
|
}
|
|
9169
9645
|
),
|
|
9170
|
-
/* @__PURE__ */ (0,
|
|
9646
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: data.hiddenAttribute ? t.hiddenBlocksHelp : t.hiddenAttributeOff })
|
|
9171
9647
|
] }) }),
|
|
9172
|
-
data.historyTypes && settings.history && /* @__PURE__ */ (0,
|
|
9648
|
+
data.historyTypes && settings.history && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9173
9649
|
HistorySettings,
|
|
9174
9650
|
{
|
|
9175
9651
|
types: data.historyTypes,
|
|
@@ -9184,9 +9660,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9184
9660
|
})
|
|
9185
9661
|
}
|
|
9186
9662
|
),
|
|
9187
|
-
(data.contentTypes || []).length > 0 && /* @__PURE__ */ (0,
|
|
9188
|
-
/* @__PURE__ */ (0,
|
|
9189
|
-
/* @__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 }),
|
|
9190
9666
|
data.contentTypes.map((type) => {
|
|
9191
9667
|
const entry = settings.contentTypes?.[type.uid] || {};
|
|
9192
9668
|
const set2 = (key, value, fallback) => update((s) => {
|
|
@@ -9198,9 +9674,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9198
9674
|
else delete s.contentTypes[type.uid];
|
|
9199
9675
|
return s;
|
|
9200
9676
|
});
|
|
9201
|
-
return /* @__PURE__ */ (0,
|
|
9202
|
-
/* @__PURE__ */ (0,
|
|
9203
|
-
/* @__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)(
|
|
9204
9680
|
ToggleField2,
|
|
9205
9681
|
{
|
|
9206
9682
|
name: `type-enabled-${type.uid}`,
|
|
@@ -9210,7 +9686,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9210
9686
|
onChange: (v) => set2("enabled", v, true)
|
|
9211
9687
|
}
|
|
9212
9688
|
) }),
|
|
9213
|
-
/* @__PURE__ */ (0,
|
|
9689
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Box, { style: { minWidth: 240 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9214
9690
|
SelectField2,
|
|
9215
9691
|
{
|
|
9216
9692
|
name: `type-mode-${type.uid}`,
|
|
@@ -9222,9 +9698,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9222
9698
|
}
|
|
9223
9699
|
) })
|
|
9224
9700
|
] }),
|
|
9225
|
-
entry.enabled !== false && /* @__PURE__ */ (0,
|
|
9226
|
-
entry.enabled !== false && /* @__PURE__ */ (0,
|
|
9227
|
-
/* @__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)(
|
|
9228
9704
|
ToggleField2,
|
|
9229
9705
|
{
|
|
9230
9706
|
name: `type-pane-${type.uid}`,
|
|
@@ -9237,10 +9713,11 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9237
9713
|
}
|
|
9238
9714
|
}
|
|
9239
9715
|
),
|
|
9240
|
-
(entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ (0,
|
|
9716
|
+
(entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9241
9717
|
PaneEditor,
|
|
9242
9718
|
{
|
|
9243
9719
|
id: `type-${type.uid}`,
|
|
9720
|
+
versions: Boolean(data.historyTypes),
|
|
9244
9721
|
toolbar: entry.previewToolbar || editor.previewToolbar || TOOLBAR2,
|
|
9245
9722
|
devices: entry.previewDevices || editor.previewDevices || DEVICE_NAMES,
|
|
9246
9723
|
t,
|
|
@@ -9252,18 +9729,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9252
9729
|
] })
|
|
9253
9730
|
] }, type.uid);
|
|
9254
9731
|
}),
|
|
9255
|
-
badSidebar && /* @__PURE__ */ (0,
|
|
9732
|
+
badSidebar && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { role: "alert", textColor: "danger600", children: t.sidebarInvalidSave })
|
|
9256
9733
|
] }) }),
|
|
9257
|
-
/* @__PURE__ */ (0,
|
|
9258
|
-
/* @__PURE__ */ (0,
|
|
9259
|
-
/* @__PURE__ */ (0,
|
|
9260
|
-
/* @__PURE__ */ (0,
|
|
9261
|
-
/* @__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) => {
|
|
9262
9739
|
const entry = settings.components[component.uid] || {};
|
|
9263
9740
|
const meta = { ...catalog.components?.[component.uid] || {}, ...media[component.uid] || {} };
|
|
9264
9741
|
const candidates = candidatesFor(component.uid, meta, catalog);
|
|
9265
|
-
return /* @__PURE__ */ (0,
|
|
9266
|
-
/* @__PURE__ */ (0,
|
|
9742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Card2, { "data-testid": `settings-${component.uid}`, children: [
|
|
9743
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9267
9744
|
Thumb,
|
|
9268
9745
|
{
|
|
9269
9746
|
candidates,
|
|
@@ -9274,23 +9751,23 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9274
9751
|
onResolved: (index) => setSources((current) => current[component.uid] === index ? current : { ...current, [component.uid]: index })
|
|
9275
9752
|
}
|
|
9276
9753
|
),
|
|
9277
|
-
/* @__PURE__ */ (0,
|
|
9278
|
-
/* @__PURE__ */ (0,
|
|
9279
|
-
/* @__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: [
|
|
9280
9757
|
component.uid,
|
|
9281
9758
|
" \xB7 ",
|
|
9282
9759
|
component.category
|
|
9283
9760
|
] }),
|
|
9284
|
-
/* @__PURE__ */ (0,
|
|
9761
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system8.Typography, { variant: "pi", "data-testid": `source-${component.uid}`, children: [
|
|
9285
9762
|
t.source,
|
|
9286
9763
|
": ",
|
|
9287
9764
|
sourceOf(component.uid, Boolean(meta.manualImage)),
|
|
9288
9765
|
meta.manualName ? ` (${meta.manualName})` : ""
|
|
9289
9766
|
] }),
|
|
9290
|
-
meta.manualMissing && /* @__PURE__ */ (0,
|
|
9291
|
-
/* @__PURE__ */ (0,
|
|
9292
|
-
/* @__PURE__ */ (0,
|
|
9293
|
-
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: () => {
|
|
9294
9771
|
update((s) => {
|
|
9295
9772
|
delete s.components[component.uid]?.mediaId;
|
|
9296
9773
|
if (!Object.keys(s.components[component.uid] || {}).length) delete s.components[component.uid];
|
|
@@ -9303,7 +9780,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9303
9780
|
});
|
|
9304
9781
|
}, children: t.useAutomatic })
|
|
9305
9782
|
] }),
|
|
9306
|
-
/* @__PURE__ */ (0,
|
|
9783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9307
9784
|
SelectField2,
|
|
9308
9785
|
{
|
|
9309
9786
|
name: `template-${component.uid}`,
|
|
@@ -9317,7 +9794,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9317
9794
|
})
|
|
9318
9795
|
}
|
|
9319
9796
|
),
|
|
9320
|
-
/* @__PURE__ */ (0,
|
|
9797
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9321
9798
|
SelectField2,
|
|
9322
9799
|
{
|
|
9323
9800
|
name: `typology-${component.uid}`,
|
|
@@ -9328,7 +9805,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9328
9805
|
onChange: (v) => setComponent(component.uid, "typology", v === "auto" ? void 0 : v)
|
|
9329
9806
|
}
|
|
9330
9807
|
),
|
|
9331
|
-
/* @__PURE__ */ (0,
|
|
9808
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9332
9809
|
TagsField,
|
|
9333
9810
|
{
|
|
9334
9811
|
name: `tags-${component.uid}`,
|
|
@@ -9339,12 +9816,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9339
9816
|
onChange: (tags) => setComponent(component.uid, "tags", tags.length ? tags : void 0)
|
|
9340
9817
|
}
|
|
9341
9818
|
),
|
|
9342
|
-
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: [
|
|
9343
9820
|
t.variantsFromCode,
|
|
9344
9821
|
": ",
|
|
9345
9822
|
meta.variants.map((item) => localized(item.label, t.locale) || item.id).join(", ")
|
|
9346
9823
|
] }),
|
|
9347
|
-
catalog.groups?.[component.uid] && /* @__PURE__ */ (0,
|
|
9824
|
+
catalog.groups?.[component.uid] && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9348
9825
|
LayoutFields,
|
|
9349
9826
|
{
|
|
9350
9827
|
component,
|
|
@@ -9359,7 +9836,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9359
9836
|
] }, component.uid);
|
|
9360
9837
|
}) })
|
|
9361
9838
|
] }) }),
|
|
9362
|
-
picking && /* @__PURE__ */ (0,
|
|
9839
|
+
picking && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MediaPicker2, { onClose: () => setPicking(null), onSelect: (asset) => {
|
|
9363
9840
|
const uid = picking;
|
|
9364
9841
|
setPicking(null);
|
|
9365
9842
|
if (!asset?.id) return;
|
|
@@ -9375,8 +9852,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
|
|
|
9375
9852
|
function LayoutFields({ component, layout, set: set2, t, disabled, SelectField: SelectField2 }) {
|
|
9376
9853
|
const fields = (component.layoutFields || []).map((name) => ({ value: name, label: name }));
|
|
9377
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)));
|
|
9378
|
-
return /* @__PURE__ */ (0,
|
|
9379
|
-
/* @__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)(
|
|
9380
9857
|
SelectField2,
|
|
9381
9858
|
{
|
|
9382
9859
|
name: `layout-columns-${component.uid}`,
|
|
@@ -9387,8 +9864,8 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9387
9864
|
onChange: (v) => change("columnsField", v)
|
|
9388
9865
|
}
|
|
9389
9866
|
),
|
|
9390
|
-
layout?.columnsField && /* @__PURE__ */ (0,
|
|
9391
|
-
/* @__PURE__ */ (0,
|
|
9867
|
+
layout?.columnsField && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9868
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9392
9869
|
SelectField2,
|
|
9393
9870
|
{
|
|
9394
9871
|
name: `layout-mobile-${component.uid}`,
|
|
@@ -9399,7 +9876,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9399
9876
|
onChange: (v) => change("mobileColumnsField", v)
|
|
9400
9877
|
}
|
|
9401
9878
|
),
|
|
9402
|
-
/* @__PURE__ */ (0,
|
|
9879
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9403
9880
|
SelectField2,
|
|
9404
9881
|
{
|
|
9405
9882
|
name: `layout-max-${component.uid}`,
|
|
@@ -9411,7 +9888,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
|
|
|
9411
9888
|
}
|
|
9412
9889
|
)
|
|
9413
9890
|
] }),
|
|
9414
|
-
/* @__PURE__ */ (0,
|
|
9891
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system8.Typography, { variant: "pi", textColor: "neutral600", children: fields.length ? t.layoutHelp : t.layoutNoFields })
|
|
9415
9892
|
] });
|
|
9416
9893
|
}
|
|
9417
9894
|
function register(app, Component2, to) {
|
|
@@ -9430,27 +9907,27 @@ function register(app, Component2, to) {
|
|
|
9430
9907
|
}
|
|
9431
9908
|
|
|
9432
9909
|
// admin/catalog.ts
|
|
9433
|
-
var
|
|
9910
|
+
var React14 = __toESM(require("react"));
|
|
9434
9911
|
|
|
9435
9912
|
// admin/FieldHelp.tsx
|
|
9436
|
-
var
|
|
9437
|
-
var
|
|
9438
|
-
var
|
|
9439
|
-
var
|
|
9440
|
-
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`
|
|
9441
9918
|
display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: help; color: inherit;
|
|
9442
9919
|
&:hover, &:focus-visible { color: ${({ theme }) => theme.colors.primary600}; }
|
|
9443
9920
|
&:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
|
|
9444
9921
|
`;
|
|
9445
9922
|
function FieldHelp({ text, previous, title }) {
|
|
9446
9923
|
const m = useMessages();
|
|
9447
|
-
const kept2 =
|
|
9448
|
-
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: [
|
|
9449
9926
|
kept2,
|
|
9450
|
-
/* @__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 }) }) })
|
|
9451
9928
|
] });
|
|
9452
9929
|
}
|
|
9453
|
-
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" } });
|
|
9454
9931
|
|
|
9455
9932
|
// admin/catalog.ts
|
|
9456
9933
|
var cached = null;
|
|
@@ -9463,8 +9940,8 @@ var load = (get) => flight || (flight = get("/blockscene/catalog").then(({ data
|
|
|
9463
9940
|
flight = null;
|
|
9464
9941
|
}));
|
|
9465
9942
|
function useCatalog(get) {
|
|
9466
|
-
const [catalog, setCatalog] =
|
|
9467
|
-
|
|
9943
|
+
const [catalog, setCatalog] = React14.useState(null);
|
|
9944
|
+
React14.useEffect(() => {
|
|
9468
9945
|
let active = true;
|
|
9469
9946
|
load(get).then((data) => {
|
|
9470
9947
|
if (active) setCatalog(data);
|
|
@@ -9500,9 +9977,9 @@ var labelsHook = (get, relabel, drop) => (args) => {
|
|
|
9500
9977
|
};
|
|
9501
9978
|
|
|
9502
9979
|
// admin/LazyInput.tsx
|
|
9503
|
-
var
|
|
9504
|
-
var
|
|
9505
|
-
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"));
|
|
9506
9983
|
|
|
9507
9984
|
// admin/sanitize.mjs
|
|
9508
9985
|
var DROP = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "IFRAME", "FRAME", "OBJECT", "EMBED", "LINK", "META", "BASE", "FORM", "TEMPLATE", "NOSCRIPT"]);
|
|
@@ -9556,7 +10033,7 @@ function sanitizeHtml(html) {
|
|
|
9556
10033
|
}
|
|
9557
10034
|
|
|
9558
10035
|
// admin/LazyInput.tsx
|
|
9559
|
-
var
|
|
10036
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
9560
10037
|
var config = { on: false, fields: [] };
|
|
9561
10038
|
var listeners = /* @__PURE__ */ new Set();
|
|
9562
10039
|
function setLazyConfig(next) {
|
|
@@ -9572,7 +10049,7 @@ var subscribe = (run) => {
|
|
|
9572
10049
|
};
|
|
9573
10050
|
var read2 = () => config;
|
|
9574
10051
|
var lazyFor = (uid) => config.on && config.fields.includes(uid);
|
|
9575
|
-
var Preview =
|
|
10052
|
+
var Preview = import_styled_components10.default.div`
|
|
9576
10053
|
min-height: 240px; border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px; overflow: hidden;
|
|
9577
10054
|
background: ${({ theme, $disabled }) => $disabled ? theme.colors.neutral150 : theme.colors.neutral0};
|
|
9578
10055
|
color: ${({ theme }) => theme.colors.neutral800}; font-size: 1.4rem; line-height: 1.5;
|
|
@@ -9591,14 +10068,14 @@ var Preview = import_styled_components9.default.div`
|
|
|
9591
10068
|
`;
|
|
9592
10069
|
function Placeholder({ name, label, hint, error, required, labelAction, placeholder, value, disabled, onActivate }) {
|
|
9593
10070
|
const t = useMessages();
|
|
9594
|
-
const html =
|
|
10071
|
+
const html = React15.useMemo(() => typeof value === "string" ? sanitizeHtml(value) : value == null ? "" : null, [value]);
|
|
9595
10072
|
const activate = disabled ? void 0 : (event) => {
|
|
9596
10073
|
event.preventDefault();
|
|
9597
10074
|
onActivate();
|
|
9598
10075
|
};
|
|
9599
|
-
return /* @__PURE__ */ (0,
|
|
9600
|
-
/* @__PURE__ */ (0,
|
|
9601
|
-
/* @__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)(
|
|
9602
10079
|
Preview,
|
|
9603
10080
|
{
|
|
9604
10081
|
id: name,
|
|
@@ -9614,22 +10091,22 @@ function Placeholder({ name, label, hint, error, required, labelAction, placehol
|
|
|
9614
10091
|
if (e.key === "Enter" || e.key === " ") activate?.(e);
|
|
9615
10092
|
},
|
|
9616
10093
|
children: [
|
|
9617
|
-
/* @__PURE__ */ (0,
|
|
9618
|
-
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 || "" }) })
|
|
9619
10096
|
]
|
|
9620
10097
|
}
|
|
9621
10098
|
),
|
|
9622
|
-
/* @__PURE__ */ (0,
|
|
9623
|
-
/* @__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, {})
|
|
9624
10101
|
] }) });
|
|
9625
10102
|
}
|
|
9626
10103
|
function lazyInput(uid, Real) {
|
|
9627
|
-
const Lazy =
|
|
9628
|
-
|
|
9629
|
-
const [active, setActive] =
|
|
9630
|
-
const box =
|
|
9631
|
-
const focus =
|
|
9632
|
-
|
|
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(() => {
|
|
9633
10110
|
if (!active || !focus.current) return;
|
|
9634
10111
|
focus.current = false;
|
|
9635
10112
|
let frame2 = 0;
|
|
@@ -9642,7 +10119,7 @@ function lazyInput(uid, Real) {
|
|
|
9642
10119
|
poll();
|
|
9643
10120
|
return () => cancelAnimationFrame(frame2);
|
|
9644
10121
|
}, [active]);
|
|
9645
|
-
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: () => {
|
|
9646
10123
|
focus.current = true;
|
|
9647
10124
|
setActive(true);
|
|
9648
10125
|
} }) });
|
|
@@ -9662,17 +10139,17 @@ function wrapCustomFields(app) {
|
|
|
9662
10139
|
}
|
|
9663
10140
|
|
|
9664
10141
|
// admin/Activity.tsx
|
|
9665
|
-
var
|
|
9666
|
-
var
|
|
9667
|
-
var
|
|
9668
|
-
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");
|
|
9669
10146
|
var ACTIVITY = [{ action: "plugin::blockscene.activity.read", subject: null }];
|
|
9670
10147
|
var TRASH = ["read", "restore", "purge"].map((name) => ({ action: `plugin::blockscene.trash.${name}`, subject: null }));
|
|
9671
10148
|
var ACTIONS = ["create", "update", "publish", "unpublish", "discard", "delete", "restore", "purge"];
|
|
9672
10149
|
var DAY = 24 * 60 * 60 * 1e3;
|
|
9673
10150
|
var contentMenuLink = (Component2) => ({
|
|
9674
10151
|
to: "plugins/blockscene",
|
|
9675
|
-
icon: () => /* @__PURE__ */ (0,
|
|
10152
|
+
icon: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "clock", size: 20 }),
|
|
9676
10153
|
intlLabel: { id: "blockscene.contentMenu", defaultMessage: "Activity and trash" },
|
|
9677
10154
|
permissions: [...ACTIVITY, TRASH[0]],
|
|
9678
10155
|
// Not an `async` function: Strapi 5 warns on AsyncFunction loaders.
|
|
@@ -9691,29 +10168,29 @@ var editUrl = (type, documentId, locale) => {
|
|
|
9691
10168
|
return `${base}/content-manager/${kind}/${type.uid}${kind === "single-types" ? "" : `/${encodeURIComponent(documentId)}`}${locale ? `?plugins[i18n][locale]=${encodeURIComponent(locale)}` : ""}`;
|
|
9692
10169
|
};
|
|
9693
10170
|
var query = (params) => new URLSearchParams(Object.entries(params).filter(([, v]) => v !== "" && v != null).map(([k, v]) => [k, String(v)])).toString();
|
|
9694
|
-
var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ (0,
|
|
9695
|
-
/* @__PURE__ */ (0,
|
|
9696
|
-
/* @__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)) })
|
|
9697
10174
|
] }) });
|
|
9698
|
-
var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ (0,
|
|
9699
|
-
/* @__PURE__ */ (0,
|
|
9700
|
-
/* @__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) })
|
|
9701
10178
|
] }) });
|
|
9702
10179
|
function Pager({ t, pagination, setPage }) {
|
|
9703
10180
|
if (!pagination?.total) return null;
|
|
9704
10181
|
const { page, pageCount, total } = pagination;
|
|
9705
|
-
return /* @__PURE__ */ (0,
|
|
9706
|
-
/* @__PURE__ */ (0,
|
|
9707
|
-
/* @__PURE__ */ (0,
|
|
9708
|
-
/* @__PURE__ */ (0,
|
|
9709
|
-
/* @__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 })
|
|
9710
10187
|
] })
|
|
9711
10188
|
] });
|
|
9712
10189
|
}
|
|
9713
10190
|
function useList(get, path, params, refresh = 0) {
|
|
9714
|
-
const [state, setState] =
|
|
10191
|
+
const [state, setState] = React16.useState({ data: null, failed: false });
|
|
9715
10192
|
const key = `${path}?${query(params)}`;
|
|
9716
|
-
|
|
10193
|
+
React16.useEffect(() => {
|
|
9717
10194
|
let active = true;
|
|
9718
10195
|
setState((s) => ({ data: s.data, failed: false, loading: true }));
|
|
9719
10196
|
get(`/blockscene${key}`).then(({ data }) => active && setState({ data, failed: false })).catch(() => active && setState({ data: null, failed: true }));
|
|
@@ -9725,9 +10202,9 @@ function useList(get, path, params, refresh = 0) {
|
|
|
9725
10202
|
}
|
|
9726
10203
|
var Doc = ({ t, type, row, documentId, locale }) => {
|
|
9727
10204
|
const title = row.title || t.contentUntitled;
|
|
9728
|
-
return /* @__PURE__ */ (0,
|
|
9729
|
-
row.exists && type ? /* @__PURE__ */ (0,
|
|
9730
|
-
/* @__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: [
|
|
9731
10208
|
type?.displayName || row.contentType,
|
|
9732
10209
|
locale ? ` \xB7 ${locale}` : "",
|
|
9733
10210
|
row.exists === false ? ` \xB7 ${t.contentGone}` : ""
|
|
@@ -9735,9 +10212,9 @@ var Doc = ({ t, type, row, documentId, locale }) => {
|
|
|
9735
10212
|
] });
|
|
9736
10213
|
};
|
|
9737
10214
|
function ActivityTab({ t, get }) {
|
|
9738
|
-
const [filters, setFilters] =
|
|
9739
|
-
const [search, setSearch] =
|
|
9740
|
-
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);
|
|
9741
10218
|
const set2 = (key, value) => {
|
|
9742
10219
|
setFilters((f) => ({ ...f, [key]: value }));
|
|
9743
10220
|
setPage(1);
|
|
@@ -9749,13 +10226,13 @@ function ActivityTab({ t, get }) {
|
|
|
9749
10226
|
};
|
|
9750
10227
|
const { data, failed } = useList(get, "/activity", { ...filters, from: day(filters.from, false), to: day(filters.to, true), page, pageSize: 25 });
|
|
9751
10228
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9752
|
-
return /* @__PURE__ */ (0,
|
|
9753
|
-
data && !data.enabled && /* @__PURE__ */ (0,
|
|
9754
|
-
/* @__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) => {
|
|
9755
10232
|
e.preventDefault();
|
|
9756
10233
|
set2("q", search.trim());
|
|
9757
10234
|
}, children: [
|
|
9758
|
-
/* @__PURE__ */ (0,
|
|
10235
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9759
10236
|
Select,
|
|
9760
10237
|
{
|
|
9761
10238
|
name: "actor",
|
|
@@ -9765,7 +10242,7 @@ function ActivityTab({ t, get }) {
|
|
|
9765
10242
|
options: [{ value: "", label: t.activityAnyone }, ...(data?.actors || []).map((a) => ({ value: a.actor, label: a.actorName || (a.actor === "system" ? t.historySystem : a.actor) }))]
|
|
9766
10243
|
}
|
|
9767
10244
|
),
|
|
9768
|
-
/* @__PURE__ */ (0,
|
|
10245
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9769
10246
|
Select,
|
|
9770
10247
|
{
|
|
9771
10248
|
name: "contentType",
|
|
@@ -9775,7 +10252,7 @@ function ActivityTab({ t, get }) {
|
|
|
9775
10252
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9776
10253
|
}
|
|
9777
10254
|
),
|
|
9778
|
-
/* @__PURE__ */ (0,
|
|
10255
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9779
10256
|
Select,
|
|
9780
10257
|
{
|
|
9781
10258
|
name: "action",
|
|
@@ -9785,35 +10262,35 @@ function ActivityTab({ t, get }) {
|
|
|
9785
10262
|
options: [{ value: "", label: t.activityAnyAction }, ...ACTIONS.map((a) => ({ value: a, label: t.historyActions[a] || a }))]
|
|
9786
10263
|
}
|
|
9787
10264
|
),
|
|
9788
|
-
/* @__PURE__ */ (0,
|
|
9789
|
-
/* @__PURE__ */ (0,
|
|
9790
|
-
/* @__PURE__ */ (0,
|
|
9791
|
-
/* @__PURE__ */ (0,
|
|
9792
|
-
/* @__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: () => {
|
|
9793
10270
|
setSearch("");
|
|
9794
10271
|
setFilters({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
|
|
9795
10272
|
setPage(1);
|
|
9796
10273
|
}, children: t.contentClear })
|
|
9797
10274
|
] }),
|
|
9798
|
-
failed ? /* @__PURE__ */ (0,
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9800
|
-
/* @__PURE__ */ (0,
|
|
9801
|
-
/* @__PURE__ */ (0,
|
|
9802
|
-
/* @__PURE__ */ (0,
|
|
9803
|
-
/* @__PURE__ */ (0,
|
|
9804
|
-
/* @__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 }) })
|
|
9805
10282
|
] }) }),
|
|
9806
|
-
/* @__PURE__ */ (0,
|
|
9807
|
-
/* @__PURE__ */ (0,
|
|
9808
|
-
/* @__PURE__ */ (0,
|
|
9809
|
-
/* @__PURE__ */ (0,
|
|
9810
|
-
/* @__PURE__ */ (0,
|
|
9811
|
-
/* @__PURE__ */ (0,
|
|
9812
|
-
/* @__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 ") })
|
|
9813
10290
|
] }) })
|
|
9814
10291
|
] }, event.id)) })
|
|
9815
10292
|
] }),
|
|
9816
|
-
/* @__PURE__ */ (0,
|
|
10293
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pager, { t, pagination: data.pagination, setPage })
|
|
9817
10294
|
] })
|
|
9818
10295
|
] });
|
|
9819
10296
|
}
|
|
@@ -9822,57 +10299,57 @@ function Report({ t, report }) {
|
|
|
9822
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(", ") });
|
|
9823
10300
|
const incoming = report.incoming && (report.incoming.reconnect || report.incoming.gone || report.incoming.replaced || report.incoming.published) ? [{ code: "incoming", ...report.incoming }] : [];
|
|
9824
10301
|
const warnings = [...report.warnings || [], ...incoming];
|
|
9825
|
-
return /* @__PURE__ */ (0,
|
|
9826
|
-
report.blocking?.length > 0 && /* @__PURE__ */ (0,
|
|
9827
|
-
/* @__PURE__ */ (0,
|
|
9828
|
-
/* @__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)) })
|
|
9829
10306
|
] }),
|
|
9830
|
-
warnings.length > 0 && /* @__PURE__ */ (0,
|
|
9831
|
-
/* @__PURE__ */ (0,
|
|
9832
|
-
/* @__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)) })
|
|
9833
10310
|
] })
|
|
9834
10311
|
] });
|
|
9835
10312
|
}
|
|
9836
10313
|
function Preview2({ t, id, get, onClose }) {
|
|
9837
|
-
const [row, setRow] =
|
|
9838
|
-
const [failed, setFailed] =
|
|
9839
|
-
|
|
10314
|
+
const [row, setRow] = React16.useState(null);
|
|
10315
|
+
const [failed, setFailed] = React16.useState(false);
|
|
10316
|
+
React16.useEffect(() => {
|
|
9840
10317
|
get(`/blockscene/trash/${id}`).then(({ data }) => setRow(data)).catch(() => setFailed(true));
|
|
9841
10318
|
}, [get, id]);
|
|
9842
|
-
return /* @__PURE__ */ (0,
|
|
9843
|
-
/* @__PURE__ */ (0,
|
|
9844
|
-
/* @__PURE__ */ (0,
|
|
9845
|
-
row.incoming > 0 && /* @__PURE__ */ (0,
|
|
9846
|
-
row.entries.map((entry, i) => /* @__PURE__ */ (0,
|
|
9847
|
-
/* @__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: [
|
|
9848
10325
|
entry.locale || t.contentNone,
|
|
9849
10326
|
entry.status ? ` \xB7 ${entry.status === "published" ? t.trashPublished : t.trashDraft}` : ""
|
|
9850
10327
|
] }),
|
|
9851
|
-
/* @__PURE__ */ (0,
|
|
9852
|
-
/* @__PURE__ */ (0,
|
|
9853
|
-
/* @__PURE__ */ (0,
|
|
9854
|
-
/* @__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 }) })
|
|
9855
10332
|
] }, field.name)) }),
|
|
9856
|
-
entry.blocks.length > 0 && /* @__PURE__ */ (0,
|
|
9857
|
-
/* @__PURE__ */ (0,
|
|
9858
|
-
/* @__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)) })
|
|
9859
10336
|
] })
|
|
9860
10337
|
] }, i))
|
|
9861
10338
|
] }) }),
|
|
9862
|
-
/* @__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 }) }) })
|
|
9863
10340
|
] }) });
|
|
9864
10341
|
}
|
|
9865
10342
|
function TrashTab({ t, get, post, del, can }) {
|
|
9866
|
-
const { toggleNotification } = (0,
|
|
9867
|
-
const [contentType, setType] =
|
|
9868
|
-
const [restored, setRestored] =
|
|
9869
|
-
const [page, setPage] =
|
|
9870
|
-
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);
|
|
9871
10348
|
const { data, failed } = useList(get, "/trash", { contentType, status: restored ? "restored" : "trashed", page, pageSize: 20 }, refresh);
|
|
9872
|
-
const [preview, setPreview] =
|
|
9873
|
-
const [restore, setRestore] =
|
|
9874
|
-
const [remove, setRemove] =
|
|
9875
|
-
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);
|
|
9876
10353
|
const types = new Map((data?.types || []).map((type) => [type.uid, type]));
|
|
9877
10354
|
const title = (row) => row.title || t.contentUntitled;
|
|
9878
10355
|
const check = async (row) => {
|
|
@@ -9918,9 +10395,9 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9918
10395
|
const days = Math.floor((new Date(at).getTime() - Date.now()) / DAY);
|
|
9919
10396
|
return days < 1 ? t.trashExpiresToday : t.f("trashExpiresIn", { days });
|
|
9920
10397
|
};
|
|
9921
|
-
return /* @__PURE__ */ (0,
|
|
9922
|
-
/* @__PURE__ */ (0,
|
|
9923
|
-
/* @__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)(
|
|
9924
10401
|
Select,
|
|
9925
10402
|
{
|
|
9926
10403
|
name: "trash-type",
|
|
@@ -9933,108 +10410,163 @@ function TrashTab({ t, get, post, del, can }) {
|
|
|
9933
10410
|
options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
|
|
9934
10411
|
}
|
|
9935
10412
|
),
|
|
9936
|
-
/* @__PURE__ */ (0,
|
|
9937
|
-
/* @__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) => {
|
|
9938
10415
|
setRestored(v);
|
|
9939
10416
|
setPage(1);
|
|
9940
10417
|
} }),
|
|
9941
|
-
/* @__PURE__ */ (0,
|
|
10418
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system11.Typography, { variant: "pi", children: t.trashShowRestored })
|
|
9942
10419
|
] })
|
|
9943
10420
|
] }),
|
|
9944
|
-
failed ? /* @__PURE__ */ (0,
|
|
9945
|
-
/* @__PURE__ */ (0,
|
|
9946
|
-
/* @__PURE__ */ (0,
|
|
9947
|
-
/* @__PURE__ */ (0,
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
9950
|
-
/* @__PURE__ */ (0,
|
|
9951
|
-
/* @__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: " " }) })
|
|
9952
10429
|
] }) }),
|
|
9953
|
-
/* @__PURE__ */ (0,
|
|
9954
|
-
/* @__PURE__ */ (0,
|
|
9955
|
-
/* @__PURE__ */ (0,
|
|
9956
|
-
/* @__PURE__ */ (0,
|
|
9957
|
-
/* @__PURE__ */ (0,
|
|
9958
|
-
/* @__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) })
|
|
9959
10436
|
] }) }),
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
9961
|
-
/* @__PURE__ */ (0,
|
|
9962
|
-
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 }) })
|
|
9963
10440
|
] }),
|
|
9964
|
-
/* @__PURE__ */ (0,
|
|
9965
|
-
/* @__PURE__ */ (0,
|
|
9966
|
-
!restored && can.canRestore && /* @__PURE__ */ (0,
|
|
9967
|
-
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 })
|
|
9968
10445
|
] }) })
|
|
9969
10446
|
] }, row.id)) })
|
|
9970
10447
|
] }),
|
|
9971
|
-
/* @__PURE__ */ (0,
|
|
10448
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pager, { t, pagination: data.pagination, setPage })
|
|
9972
10449
|
] }),
|
|
9973
|
-
preview !== null && /* @__PURE__ */ (0,
|
|
9974
|
-
restore && /* @__PURE__ */ (0,
|
|
9975
|
-
/* @__PURE__ */ (0,
|
|
9976
|
-
/* @__PURE__ */ (0,
|
|
9977
|
-
/* @__PURE__ */ (0,
|
|
9978
|
-
restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ (0,
|
|
9979
|
-
!restore.done.already && /* @__PURE__ */ (0,
|
|
9980
|
-
] }) : !restore.report ? /* @__PURE__ */ (0,
|
|
9981
|
-
/* @__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: [
|
|
9982
10459
|
t.restoreIntro,
|
|
9983
10460
|
" ",
|
|
9984
10461
|
restore.report.documentId ? t.restoreInto : t.restoreNew
|
|
9985
10462
|
] }),
|
|
9986
|
-
restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ (0,
|
|
9987
|
-
/* @__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 })
|
|
9988
10465
|
] }) }) }),
|
|
9989
|
-
/* @__PURE__ */ (0,
|
|
9990
|
-
/* @__PURE__ */ (0,
|
|
9991
|
-
!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 })
|
|
9992
10469
|
] })
|
|
9993
10470
|
] }) }),
|
|
9994
|
-
remove && /* @__PURE__ */ (0,
|
|
9995
|
-
/* @__PURE__ */ (0,
|
|
9996
|
-
/* @__PURE__ */ (0,
|
|
9997
|
-
/* @__PURE__ */ (0,
|
|
9998
|
-
/* @__PURE__ */ (0,
|
|
9999
|
-
/* @__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 })
|
|
10000
10477
|
] })
|
|
10001
10478
|
] }) })
|
|
10002
10479
|
] });
|
|
10003
10480
|
}
|
|
10004
10481
|
function ContentPage() {
|
|
10005
10482
|
const t = useMessages();
|
|
10006
|
-
const { get, post, del } = (0,
|
|
10007
|
-
const activity = (0,
|
|
10008
|
-
const trash = (0,
|
|
10009
|
-
const [tab, setTab] =
|
|
10010
|
-
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, {});
|
|
10011
10488
|
const canActivity = Boolean(activity.allowedActions?.canRead), canTrash = Boolean(trash.allowedActions?.canRead);
|
|
10012
|
-
if (!canActivity && !canTrash) return /* @__PURE__ */ (0,
|
|
10489
|
+
if (!canActivity && !canTrash) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_admin4.Page.NoPermissions, {});
|
|
10013
10490
|
const current = tab || (canActivity ? "activity" : "trash");
|
|
10014
|
-
return /* @__PURE__ */ (0,
|
|
10015
|
-
/* @__PURE__ */ (0,
|
|
10016
|
-
/* @__PURE__ */ (0,
|
|
10017
|
-
/* @__PURE__ */ (0,
|
|
10018
|
-
/* @__PURE__ */ (0,
|
|
10019
|
-
canActivity && /* @__PURE__ */ (0,
|
|
10020
|
-
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 })
|
|
10021
10498
|
] }),
|
|
10022
|
-
/* @__PURE__ */ (0,
|
|
10023
|
-
canActivity && /* @__PURE__ */ (0,
|
|
10024
|
-
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 }) })
|
|
10025
10502
|
] })
|
|
10026
10503
|
] }) })
|
|
10027
10504
|
] });
|
|
10028
10505
|
}
|
|
10029
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
|
+
|
|
10030
10562
|
// admin/strapi5.tsx
|
|
10031
|
-
var
|
|
10563
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
10032
10564
|
function Modal2({ open, onOpenChange, trigger, title, children, width = "80vw" }) {
|
|
10033
|
-
return /* @__PURE__ */ (0,
|
|
10034
|
-
trigger && /* @__PURE__ */ (0,
|
|
10035
|
-
/* @__PURE__ */ (0,
|
|
10036
|
-
/* @__PURE__ */ (0,
|
|
10037
|
-
/* @__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 })
|
|
10038
10570
|
] })
|
|
10039
10571
|
] });
|
|
10040
10572
|
}
|
|
@@ -10049,10 +10581,10 @@ async function relationsOf(get, { uid, id, field }, locale) {
|
|
|
10049
10581
|
return out.reverse();
|
|
10050
10582
|
}
|
|
10051
10583
|
function useRowForm(c, values, get) {
|
|
10052
|
-
const onChange = (0,
|
|
10053
|
-
const errors = (0,
|
|
10054
|
-
const { toggleNotification } = (0,
|
|
10055
|
-
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);
|
|
10056
10588
|
latest.current = values;
|
|
10057
10589
|
const locale = c.form?.initialValues?.locale || void 0;
|
|
10058
10590
|
if (typeof onChange !== "function") return null;
|
|
@@ -10076,8 +10608,8 @@ function useRowForm(c, values, get) {
|
|
|
10076
10608
|
function useScope() {
|
|
10077
10609
|
const c = (0, import_strapi_admin2.unstable_useContentManagerContext)();
|
|
10078
10610
|
const rbac = (0, import_strapi_admin2.useDocumentRBAC)("Blockscene", (state) => state);
|
|
10079
|
-
const { get, put } = (0,
|
|
10080
|
-
const formValues = (0,
|
|
10611
|
+
const { get, put } = (0, import_admin5.useFetchClient)();
|
|
10612
|
+
const formValues = (0, import_admin5.useForm)("Blockscene", (state) => state.values);
|
|
10081
10613
|
const catalog = useCatalog(get);
|
|
10082
10614
|
const creating = !c.id && !c.form?.initialValues?.id && !c.form?.initialValues?.documentId;
|
|
10083
10615
|
const allowed = (creating ? rbac.canCreateFields : rbac.canUpdateFields) || [];
|
|
@@ -10096,8 +10628,8 @@ function useScope() {
|
|
|
10096
10628
|
const history = !creating && Boolean(c.id) && Boolean(catalog?.history?.contentTypes?.includes(c.model));
|
|
10097
10629
|
return { c, rbac, get, put, formValues, catalog, creating, zones, typeSettings, gallery, history };
|
|
10098
10630
|
}
|
|
10099
|
-
var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ (0,
|
|
10100
|
-
/* @__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 }),
|
|
10101
10633
|
item.label
|
|
10102
10634
|
] }) }, item.testid)) }) });
|
|
10103
10635
|
function Editor() {
|
|
@@ -10105,17 +10637,17 @@ function Editor() {
|
|
|
10105
10637
|
const { catalog, typeSettings, gallery } = scope;
|
|
10106
10638
|
const lazy = Boolean(catalog?.editor?.enabled && catalog.editor.lazyEditors !== false && typeSettings.enabled !== false);
|
|
10107
10639
|
const lazyFields = (catalog?.editor?.lazyFields || []).join(",");
|
|
10108
|
-
|
|
10640
|
+
React18.useEffect(() => {
|
|
10109
10641
|
if (catalog) setLazyConfig({ on: lazy, fields: lazyFields ? lazyFields.split(",") : [] });
|
|
10110
10642
|
}, [catalog, lazy, lazyFields]);
|
|
10111
|
-
const kept2 =
|
|
10643
|
+
const kept2 = React18.useRef(false);
|
|
10112
10644
|
if (!scope.c.isLoading) kept2.current = gallery;
|
|
10113
10645
|
if (!kept2.current) return null;
|
|
10114
|
-
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 }) }) });
|
|
10115
10647
|
}
|
|
10116
10648
|
function Workspace({ scope }) {
|
|
10117
10649
|
const { c, get, put, formValues, catalog, creating, zones, typeSettings } = scope;
|
|
10118
|
-
const user = (0,
|
|
10650
|
+
const user = (0, import_admin5.useAuth)("Blockscene", (state2) => state2.user);
|
|
10119
10651
|
const form = useRowForm(c, formValues ?? c.form?.values, get);
|
|
10120
10652
|
const editor = {
|
|
10121
10653
|
...catalog.editor,
|
|
@@ -10127,6 +10659,8 @@ function Workspace({ scope }) {
|
|
|
10127
10659
|
};
|
|
10128
10660
|
const host = usePreviewHost5();
|
|
10129
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 || ""}`;
|
|
10130
10664
|
const add = (zone, uid, preset) => {
|
|
10131
10665
|
const values = formValues ?? c.form.values;
|
|
10132
10666
|
const close = catalog?.groups?.[uid];
|
|
@@ -10144,8 +10678,9 @@ function Workspace({ scope }) {
|
|
|
10144
10678
|
if (close) c.form.addFieldRow(zone.name, { __component: close }, at + 1);
|
|
10145
10679
|
return true;
|
|
10146
10680
|
};
|
|
10147
|
-
return /* @__PURE__ */ (0,
|
|
10148
|
-
/* @__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)(
|
|
10149
10684
|
Gallery,
|
|
10150
10685
|
{
|
|
10151
10686
|
zones,
|
|
@@ -10158,18 +10693,19 @@ function Workspace({ scope }) {
|
|
|
10158
10693
|
put,
|
|
10159
10694
|
editor: catalog.editor,
|
|
10160
10695
|
catalog,
|
|
10161
|
-
docKey
|
|
10696
|
+
docKey,
|
|
10162
10697
|
contentType: c.model,
|
|
10163
10698
|
userId: user?.id,
|
|
10164
10699
|
form,
|
|
10165
|
-
zoneTools: /* @__PURE__ */ (0,
|
|
10700
|
+
zoneTools: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ZoneBarTools, { state }),
|
|
10166
10701
|
openBlock: state.openBlock,
|
|
10167
10702
|
openInsert: state.openInsert
|
|
10168
10703
|
}
|
|
10169
10704
|
),
|
|
10170
|
-
/* @__PURE__ */ (0,
|
|
10705
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10171
10706
|
PagePreview,
|
|
10172
10707
|
{
|
|
10708
|
+
versions,
|
|
10173
10709
|
editor,
|
|
10174
10710
|
state,
|
|
10175
10711
|
host,
|
|
@@ -10184,7 +10720,7 @@ function Workspace({ scope }) {
|
|
|
10184
10720
|
}
|
|
10185
10721
|
function Panel2() {
|
|
10186
10722
|
const { c, rbac, get, catalog, gallery, history } = useScope();
|
|
10187
|
-
const canReadHistory = Boolean((0,
|
|
10723
|
+
const canReadHistory = Boolean((0, import_admin5.useRBAC)(HISTORY_READ).allowedActions?.canRead);
|
|
10188
10724
|
const preview = usePreviewZone(usePreviewHost5());
|
|
10189
10725
|
const groups = gallery ? catalog?.groups : null;
|
|
10190
10726
|
const problems = groups && preview.zone ? (0, import_groups.validateGroups)(preview.rows, groups) : [];
|
|
@@ -10192,9 +10728,9 @@ function Panel2() {
|
|
|
10192
10728
|
if (!versions && !problems.length) return null;
|
|
10193
10729
|
return {
|
|
10194
10730
|
title: "Blockscene",
|
|
10195
|
-
content: /* @__PURE__ */ (0,
|
|
10196
|
-
problems.length > 0 && /* @__PURE__ */ (0,
|
|
10197
|
-
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)(
|
|
10198
10734
|
History,
|
|
10199
10735
|
{
|
|
10200
10736
|
model: c.model,
|
|
@@ -10210,9 +10746,9 @@ function Panel2() {
|
|
|
10210
10746
|
] }) })
|
|
10211
10747
|
};
|
|
10212
10748
|
}
|
|
10213
|
-
var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ (0,
|
|
10214
|
-
/* @__PURE__ */ (0,
|
|
10215
|
-
|
|
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,
|
|
10216
10752
|
{
|
|
10217
10753
|
name,
|
|
10218
10754
|
"aria-label": label,
|
|
@@ -10221,7 +10757,7 @@ var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ *
|
|
|
10221
10757
|
onCheckedChange: onChange
|
|
10222
10758
|
}
|
|
10223
10759
|
),
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10760
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system13.Typography, { children: label })
|
|
10225
10761
|
] });
|
|
10226
10762
|
var TextField = ({
|
|
10227
10763
|
name,
|
|
@@ -10230,10 +10766,10 @@ var TextField = ({
|
|
|
10230
10766
|
onChange,
|
|
10231
10767
|
disabled,
|
|
10232
10768
|
placeholder
|
|
10233
|
-
}) => /* @__PURE__ */ (0,
|
|
10234
|
-
/* @__PURE__ */ (0,
|
|
10235
|
-
/* @__PURE__ */ (0,
|
|
10236
|
-
|
|
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,
|
|
10237
10773
|
{
|
|
10238
10774
|
name,
|
|
10239
10775
|
value,
|
|
@@ -10250,30 +10786,30 @@ var SelectField = ({
|
|
|
10250
10786
|
onChange,
|
|
10251
10787
|
disabled,
|
|
10252
10788
|
options
|
|
10253
|
-
}) => /* @__PURE__ */ (0,
|
|
10254
|
-
/* @__PURE__ */ (0,
|
|
10255
|
-
/* @__PURE__ */ (0,
|
|
10256
|
-
|
|
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,
|
|
10257
10793
|
{
|
|
10258
10794
|
value,
|
|
10259
10795
|
disabled,
|
|
10260
10796
|
startIcon: options.find((o) => o.value === value)?.icon,
|
|
10261
10797
|
onChange: (v) => onChange(String(v)),
|
|
10262
|
-
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))
|
|
10263
10799
|
}
|
|
10264
10800
|
)
|
|
10265
10801
|
] });
|
|
10266
10802
|
function MediaPicker({ onClose, onSelect }) {
|
|
10267
|
-
const components = (0,
|
|
10803
|
+
const components = (0, import_admin5.useStrapiApp)(
|
|
10268
10804
|
"Blockscene",
|
|
10269
10805
|
(state) => state.components
|
|
10270
10806
|
);
|
|
10271
10807
|
const Dialog3 = components?.["media-library"];
|
|
10272
|
-
|
|
10808
|
+
React18.useEffect(() => {
|
|
10273
10809
|
if (!Dialog3) onClose();
|
|
10274
10810
|
}, [Dialog3, onClose]);
|
|
10275
10811
|
if (!Dialog3) return null;
|
|
10276
|
-
return /* @__PURE__ */ (0,
|
|
10812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10277
10813
|
Dialog3,
|
|
10278
10814
|
{
|
|
10279
10815
|
onClose,
|
|
@@ -10284,7 +10820,7 @@ function MediaPicker({ onClose, onSelect }) {
|
|
|
10284
10820
|
);
|
|
10285
10821
|
}
|
|
10286
10822
|
function usePermissions() {
|
|
10287
|
-
const { allowedActions, isLoading } = (0,
|
|
10823
|
+
const { allowedActions, isLoading } = (0, import_admin5.useRBAC)(
|
|
10288
10824
|
Object.values(permissions).flat()
|
|
10289
10825
|
);
|
|
10290
10826
|
return {
|
|
@@ -10293,10 +10829,10 @@ function usePermissions() {
|
|
|
10293
10829
|
isLoading
|
|
10294
10830
|
};
|
|
10295
10831
|
}
|
|
10296
|
-
var SettingsPage = () => /* @__PURE__ */ (0,
|
|
10832
|
+
var SettingsPage = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
10297
10833
|
Settings,
|
|
10298
10834
|
{
|
|
10299
|
-
useClient:
|
|
10835
|
+
useClient: import_admin5.useFetchClient,
|
|
10300
10836
|
usePermissions,
|
|
10301
10837
|
MediaPicker,
|
|
10302
10838
|
ToggleField,
|
|
@@ -10311,13 +10847,13 @@ var strapi5_default = {
|
|
|
10311
10847
|
strapiApp = app;
|
|
10312
10848
|
register(app, SettingsPage, "blockscene");
|
|
10313
10849
|
app.registerPlugin({ id: "blockscene", name: "Blockscene", apis: { registerPanel: (panel) => registerPanel(panel, ICON_NAMES) } });
|
|
10314
|
-
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ (0,
|
|
10850
|
+
app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Guard, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContentPage, {}) })));
|
|
10315
10851
|
},
|
|
10316
10852
|
registerTrads,
|
|
10317
10853
|
bootstrap(app) {
|
|
10318
10854
|
app.getPlugin("content-manager").apis.addEditViewSidePanel([Panel2]);
|
|
10319
10855
|
app.getPlugin("content-manager").injectComponent("editView", "right-links", { name: "blockscene", Component: Editor });
|
|
10320
|
-
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));
|
|
10321
10857
|
wrapCustomFields(strapiApp);
|
|
10322
10858
|
}
|
|
10323
10859
|
};
|