@aduptive/strapi-blockscene 2.0.0-alpha.10 → 2.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/admin.mjs CHANGED
@@ -43,6 +43,10 @@ var require_groups = __commonJS({
43
43
  return Object.keys(out).length ? out : null;
44
44
  }
45
45
  var uidOf = (row) => typeof row?.__component === "string" ? row.__component : "";
46
+ var invalidComponents = (rows, allowed) => {
47
+ const uids = new Set(Array.isArray(allowed) ? allowed : []);
48
+ return (Array.isArray(rows) ? rows : []).flatMap((row, index) => uidOf(row) && !uids.has(uidOf(row)) ? [{ index, uid: uidOf(row) }] : []);
49
+ };
46
50
  var isOpener2 = (row, g) => Boolean(g) && Object.prototype.hasOwnProperty.call(g, uidOf(row));
47
51
  var isClose2 = (row, g) => Boolean(g) && Object.values(g).includes(uidOf(row));
48
52
  var blockKey3 = (row) => row && row.id != null ? `${row.__component}#${row.id}` : row && row.__temp_key__ != null ? String(row.__temp_key__) : null;
@@ -149,6 +153,7 @@ var require_groups = __commonJS({
149
153
  module.exports = {
150
154
  safeGroups: safeGroups2,
151
155
  validateGroups: validateGroups3,
156
+ invalidComponents,
152
157
  groupRange: groupRange3,
153
158
  groupRows: groupRows2,
154
159
  topLevelRanges: topLevelRanges2,
@@ -250,8 +255,8 @@ var require_diff = __commonJS({
250
255
  }
251
256
  function summarize(before, after, schema) {
252
257
  const zones = Object.entries(schema?.attributes || {}).filter(([, attr]) => attr?.type === "dynamiczone").map(([name]) => name);
253
- const blocks = { added: 0, removed: 0, changed: 0 };
254
- if (!before) return { initial: true, fields: [], blocks };
258
+ const blocks = { total: zones.reduce((n, name) => n + (Array.isArray(after?.[name]) ? after[name].length : 0), 0), added: 0, removed: 0, changed: 0 };
259
+ if (!before) return { initial: true, fields: [], blocks: { ...blocks, added: blocks.total } };
255
260
  const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after || {})])];
256
261
  const fields = names.filter((name) => !zones.includes(name) && !same2(before[name], after?.[name])).sort();
257
262
  for (const name of zones) for (const { op } of diffRows2(before[name], after?.[name])) if (op !== "same") blocks[op]++;
@@ -262,23 +267,23 @@ var require_diff = __commonJS({
262
267
  });
263
268
 
264
269
  // admin/strapi5.tsx
265
- import * as React16 from "react";
270
+ import * as React18 from "react";
266
271
  import {
267
- Box as Box8,
272
+ Box as Box10,
268
273
  Modal as Dialog2,
269
274
  MenuItem as MenuItem2,
270
275
  SimpleMenu as SimpleMenu2,
271
276
  Switch as Switch2,
272
- Flex as Flex10,
273
- Typography as Typography10,
277
+ Flex as Flex12,
278
+ Typography as Typography12,
274
279
  Field as Field3,
275
- SingleSelect as SingleSelect2,
276
- SingleSelectOption as SingleSelectOption2,
280
+ SingleSelect as SingleSelect3,
281
+ SingleSelectOption as SingleSelectOption3,
277
282
  TextInput as TextInput2
278
283
  } from "@strapi/design-system";
279
284
  import {
280
285
  useFetchClient as useFetchClient3,
281
- useRBAC as useRBAC3,
286
+ useRBAC as useRBAC4,
282
287
  useStrapiApp as useStrapiApp2,
283
288
  useAuth,
284
289
  useForm as useForm3,
@@ -344,6 +349,26 @@ function variantRow(schema, components, values, keys = fractional) {
344
349
  }
345
350
  return row;
346
351
  }
352
+ function starterKitRows(kit, zones, components, form) {
353
+ const out = {};
354
+ for (const [name, items2] of Object.entries(kit?.zones || {})) {
355
+ const zone = zones.find((entry) => entry.name === name);
356
+ const current = form.rows(name);
357
+ if (!zone || current.length || current.length + items2.length > (zone.max ?? Infinity) || items2.some((item) => !zone.components.includes(item.__component) || !components[item.__component])) return null;
358
+ const keys = form.keys(current, current.length, items2.length);
359
+ out[name] = items2.map((item, index) => ({ ...variantRow(components[item.__component], components, item.values), __component: item.__component, __temp_key__: keys[index] }));
360
+ }
361
+ return out;
362
+ }
363
+ function starterKitsForLocale(kits, locale) {
364
+ if (!Array.isArray(kits)) return [];
365
+ const current = String(locale || "").toLowerCase();
366
+ const language = current.split("-")[0];
367
+ return kits.filter((kit) => !Array.isArray(kit.locales) || kit.locales.some((entry) => {
368
+ const wanted = String(entry).toLowerCase();
369
+ return wanted === current || !wanted.includes("-") && wanted === language;
370
+ }));
371
+ }
347
372
  function editableZones(schema, values, canEdit, disabled = false) {
348
373
  if (disabled) return [];
349
374
  return Object.entries(schema?.attributes || {}).filter(
@@ -659,6 +684,7 @@ var hoverKey = (key, rows) => key === null ? null : typeof key === "string" && k
659
684
  function isPreviewMessage(event, origin, source, channel, type) {
660
685
  return event.origin === origin && event.source === source && event.data?.protocol === PROTOCOL && event.data?.channel === channel && event.data?.type === type;
661
686
  }
687
+ var previewMessageAllowed = (event, origin, source, channel, readOnly) => isPreviewMessage(event, origin, source, channel, event.data?.type) && (!readOnly || event.data?.type === "ready");
662
688
  function insertIndex(rows, after) {
663
689
  if (after === null || after === void 0) return 0;
664
690
  const index = (Array.isArray(rows) ? rows : []).findIndex((row) => blockKey(row) === String(after));
@@ -913,10 +939,10 @@ var en_default = {
913
939
  rememberHelp: "Only the explicit open all / close all buttons update the memory, per user and browser. Opening one block does not.",
914
940
  previewUrl: "Preview route base URL",
915
941
  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).",
916
- previewUrlEmpty: "No preview URL is set: editors get the Fields + page and Visual editor modes only on content types where Strapi's native Preview is configured. Elsewhere the mode menu is not shown.",
942
+ 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.",
917
943
  previewMode: "Initial preview mode",
918
- "modes.form": "Fields",
919
- "modes.split": "Fields + page",
944
+ "modes.form": "Fields only",
945
+ "modes.split": "Fields + preview",
920
946
  "modes.preview": "Visual editor",
921
947
  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.",
922
948
  lazyEdit: "Click to edit",
@@ -924,8 +950,8 @@ var en_default = {
924
950
  lazyFields: "Custom fields loaded on demand",
925
951
  lazyEditorsHelp: "Listed custom fields show a read-only preview until clicked or focused, so opening large pages stays fast. Separate uids with commas.",
926
952
  lazyFieldsInvalid: "Use up to {max} custom field uids such as plugin::ckeditor5.CKEditor or global::my-field.",
927
- modeForm: "Fields",
928
- modeSplit: "Fields + page",
953
+ modeForm: "Fields only",
954
+ modeSplit: "Fields + preview",
929
955
  modePreview: "Visual editor",
930
956
  previewPane: "Page preview",
931
957
  resize: "Resize preview pane",
@@ -1020,6 +1046,9 @@ var en_default = {
1020
1046
  unstar: "Remove star",
1021
1047
  quickInsert: "Insert {label}",
1022
1048
  insert: "Insert",
1049
+ starterKits: "Start with a kit",
1050
+ starterKitsHelp: "Choose a starting structure. Everything is inserted as an unsaved, editable draft.",
1051
+ startBlank: "Start blank",
1023
1052
  closeDetail: "Close details",
1024
1053
  typology: "Typology",
1025
1054
  typologyAuto: "Automatic ({name})",
@@ -1063,7 +1092,7 @@ var en_default = {
1063
1092
  blockPreview: "Live block preview",
1064
1093
  livePreviewFailed: "Live preview unavailable, showing the image.",
1065
1094
  blockPreviewUrl: "Block preview URL",
1066
- blockPreviewUrlHelp: "Optional. A page of your frontend that renders one block on its own, shown large when a gallery card is clicked, e.g. http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Placeholders: '{uid}', '{name}' (after the dot), '{category}' (before the dot), '{variant}' (default), '{locale}'. Empty uses the page preview route when there is one, else the image.",
1095
+ blockPreviewUrlHelp: "Optional. A page of your frontend that renders one block on its own, shown large from a gallery card's magnifying glass, e.g. http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Placeholders: '{uid}', '{name}' (after the dot), '{category}' (before the dot), '{variant}' (default), '{locale}'. Empty uses the page preview route when there is one, else the image.",
1067
1096
  rowActions: "Actions for {label}",
1068
1097
  selectBlock: "Select {label}",
1069
1098
  hiddenBadge: "Hidden",
@@ -1276,7 +1305,23 @@ var en_default = {
1276
1305
  layoutOff: "No grid",
1277
1306
  layoutNoMobile: "None",
1278
1307
  layoutHelp: "The group's blocks show as a grid in the form, with the column count this block holds.",
1279
- layoutNoFields: "This block has no field that can hold a column count."
1308
+ layoutNoFields: "This block has no field that can hold a column count.",
1309
+ "toolbar.versions": "Version history",
1310
+ versionsDenied: "Ask an administrator to grant the Blockscene Read version history permission.",
1311
+ versionsDisabled: "History is not enabled for this content type. Ask an administrator to enable it in Settings > Blockscene (settings.history.enabled).",
1312
+ versionsNew: "Save this entry first to start its history.",
1313
+ versionsPerson: "Filter by person",
1314
+ versionsEveryone: "Everyone",
1315
+ versionsCounts: "{total} blocks",
1316
+ versionsCountsMissing: "Block counts unavailable (older or unrecorded event).",
1317
+ versionsPage: "Page {page} of {count}",
1318
+ versionsPrevious: "Previous",
1319
+ versionsNext: "Next",
1320
+ versionsViewing: "Viewing version of {date} by {person} (read-only).",
1321
+ versionsCurrent: "Back to current draft",
1322
+ versionsMissing: "Some blocks, fields, media or relations are no longer available in this preview.",
1323
+ versionsBridgeLegacy: "This preview bridge does not support read-only browsing. Interaction is disabled; update the bridge to support readOnly.",
1324
+ historyExpired: "Snapshot no longer available"
1280
1325
  };
1281
1326
 
1282
1327
  // admin/translations/pt-BR.json
@@ -1334,10 +1379,10 @@ var pt_BR_default = {
1334
1379
  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.",
1335
1380
  previewUrl: "URL base da rota de preview",
1336
1381
  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).",
1337
- previewUrlEmpty: "Nenhuma URL de preview definida: os editores s\xF3 t\xEAm os modos Campos + p\xE1gina e Editor visual nos tipos de conte\xFAdo com o Preview nativo do Strapi configurado. Nos demais, o menu de modos n\xE3o aparece.",
1382
+ 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.",
1338
1383
  previewMode: "Modo inicial da preview",
1339
- "modes.form": "Campos",
1340
- "modes.split": "Campos + p\xE1gina",
1384
+ "modes.form": "Somente campos",
1385
+ "modes.split": "Campos + preview",
1341
1386
  "modes.preview": "Editor visual",
1342
1387
  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.",
1343
1388
  lazyEdit: "Clique para editar",
@@ -1345,8 +1390,8 @@ var pt_BR_default = {
1345
1390
  lazyFields: "Campos personalizados carregados sob demanda",
1346
1391
  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.",
1347
1392
  lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
1348
- modeForm: "Campos",
1349
- modeSplit: "Campos + p\xE1gina",
1393
+ modeForm: "Somente campos",
1394
+ modeSplit: "Campos + preview",
1350
1395
  modePreview: "Editor visual",
1351
1396
  previewPane: "Preview da p\xE1gina",
1352
1397
  resize: "Redimensionar painel de preview",
@@ -1441,6 +1486,9 @@ var pt_BR_default = {
1441
1486
  unstar: "Remover dos favoritos",
1442
1487
  quickInsert: "Inserir {label}",
1443
1488
  insert: "Inserir",
1489
+ starterKits: "Come\xE7ar com um kit",
1490
+ starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como rascunho edit\xE1vel e ainda n\xE3o salvo.",
1491
+ startBlank: "Come\xE7ar em branco",
1444
1492
  closeDetail: "Fechar detalhes",
1445
1493
  typology: "Tipologia",
1446
1494
  typologyAuto: "Autom\xE1tica ({name})",
@@ -1484,7 +1532,7 @@ var pt_BR_default = {
1484
1532
  blockPreview: "Preview ao vivo do bloco",
1485
1533
  livePreviewFailed: "Preview ao vivo indispon\xEDvel, mostrando a imagem.",
1486
1534
  blockPreviewUrl: "URL de preview do bloco",
1487
- blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco sozinho, mostrada em tamanho grande ao clicar num card da galeria, por exemplo http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de preview de p\xE1gina quando existir, sen\xE3o a imagem.",
1535
+ blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco sozinho, mostrada em tamanho grande pela lupa do card da galeria, por exemplo http://localhost:3026/pt-BR/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de preview de p\xE1gina quando existir, sen\xE3o a imagem.",
1488
1536
  rowActions: "A\xE7\xF5es de {label}",
1489
1537
  selectBlock: "Selecionar {label}",
1490
1538
  hiddenBadge: "Oculto",
@@ -1697,7 +1745,23 @@ var pt_BR_default = {
1697
1745
  layoutOff: "Sem grade",
1698
1746
  layoutNoMobile: "Nenhum",
1699
1747
  layoutHelp: "Os blocos do grupo aparecem em grade no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
1700
- layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
1748
+ layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
1749
+ "toolbar.versions": "Hist\xF3rico de vers\xF5es",
1750
+ versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
1751
+ 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).",
1752
+ versionsNew: "Salve este conte\xFAdo primeiro para iniciar seu hist\xF3rico.",
1753
+ versionsPerson: "Filtrar por pessoa",
1754
+ versionsEveryone: "Todas as pessoas",
1755
+ versionsCounts: "{total} blocos",
1756
+ versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registrado).",
1757
+ versionsPage: "P\xE1gina {page} de {count}",
1758
+ versionsPrevious: "Anterior",
1759
+ versionsNext: "Pr\xF3xima",
1760
+ versionsViewing: "Vendo vers\xE3o de {date} por {person} (somente leitura).",
1761
+ versionsCurrent: "Voltar ao rascunho atual",
1762
+ versionsMissing: "Alguns blocos, campos, m\xEDdias ou rela\xE7\xF5es n\xE3o est\xE3o mais dispon\xEDveis nesta preview.",
1763
+ versionsBridgeLegacy: "Esta bridge n\xE3o suporta navega\xE7\xE3o somente leitura. A intera\xE7\xE3o est\xE1 desativada; atualize a bridge para suportar readOnly.",
1764
+ historyExpired: "Snapshot n\xE3o est\xE1 mais dispon\xEDvel"
1701
1765
  };
1702
1766
 
1703
1767
  // admin/translations/pt.json
@@ -1755,10 +1819,10 @@ var pt_default = {
1755
1819
  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.",
1756
1820
  previewUrl: "URL base da rota de pr\xE9-visualiza\xE7\xE3o",
1757
1821
  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).",
1758
- previewUrlEmpty: "Nenhum URL de pr\xE9-visualiza\xE7\xE3o definido: os editores s\xF3 t\xEAm os modos Campos + p\xE1gina e Editor visual nos tipos de conte\xFAdo com a Preview nativa do Strapi configurada. Nos restantes, o menu de modos n\xE3o aparece.",
1822
+ 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.",
1759
1823
  previewMode: "Modo inicial da pr\xE9-visualiza\xE7\xE3o",
1760
- "modes.form": "Campos",
1761
- "modes.split": "Campos + p\xE1gina",
1824
+ "modes.form": "Apenas campos",
1825
+ "modes.split": "Campos + pr\xE9-visualiza\xE7\xE3o",
1762
1826
  "modes.preview": "Editor visual",
1763
1827
  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.",
1764
1828
  lazyEdit: "Clique para editar",
@@ -1766,8 +1830,8 @@ var pt_default = {
1766
1830
  lazyFields: "Campos personalizados carregados a pedido",
1767
1831
  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.",
1768
1832
  lazyFieldsInvalid: "Use at\xE9 {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor ou global::meu-campo.",
1769
- modeForm: "Campos",
1770
- modeSplit: "Campos + p\xE1gina",
1833
+ modeForm: "Apenas campos",
1834
+ modeSplit: "Campos + pr\xE9-visualiza\xE7\xE3o",
1771
1835
  modePreview: "Editor visual",
1772
1836
  previewPane: "Pr\xE9-visualiza\xE7\xE3o da p\xE1gina",
1773
1837
  resize: "Redimensionar painel de pr\xE9-visualiza\xE7\xE3o",
@@ -1862,6 +1926,9 @@ var pt_default = {
1862
1926
  unstar: "Remover dos favoritos",
1863
1927
  quickInsert: "Inserir {label}",
1864
1928
  insert: "Inserir",
1929
+ starterKits: "Come\xE7ar com um kit",
1930
+ starterKitsHelp: "Escolha uma estrutura inicial. Tudo \xE9 inserido como um rascunho edit\xE1vel e ainda n\xE3o guardado.",
1931
+ startBlank: "Come\xE7ar em branco",
1865
1932
  closeDetail: "Fechar detalhes",
1866
1933
  typology: "Tipologia",
1867
1934
  typologyAuto: "Autom\xE1tica ({name})",
@@ -1905,7 +1972,7 @@ var pt_default = {
1905
1972
  blockPreview: "Pr\xE9-visualiza\xE7\xE3o ao vivo do bloco",
1906
1973
  livePreviewFailed: "Pr\xE9-visualiza\xE7\xE3o ao vivo indispon\xEDvel, a mostrar a imagem.",
1907
1974
  blockPreviewUrl: "URL de pr\xE9-visualiza\xE7\xE3o do bloco",
1908
- blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco isolado, mostrada em grande ao clicar num cart\xE3o da galeria, por exemplo http://localhost:3026/pt-PT/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de pr\xE9-visualiza\xE7\xE3o de p\xE1gina quando existir, caso contr\xE1rio a imagem.",
1975
+ blockPreviewUrlHelp: "Opcional. Uma p\xE1gina do seu frontend que renderiza um bloco isolado, mostrada em grande pela lupa do cart\xE3o da galeria, por exemplo http://localhost:3026/pt-PT/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (depois do ponto), '{category}' (antes do ponto), '{variant}' (default), '{locale}'. Vazio usa a rota de pr\xE9-visualiza\xE7\xE3o de p\xE1gina quando existir, caso contr\xE1rio a imagem.",
1909
1976
  rowActions: "A\xE7\xF5es de {label}",
1910
1977
  selectBlock: "Selecionar {label}",
1911
1978
  hiddenBadge: "Oculto",
@@ -2118,7 +2185,23 @@ var pt_default = {
2118
2185
  layoutOff: "Sem grelha",
2119
2186
  layoutNoMobile: "Nenhum",
2120
2187
  layoutHelp: "Os blocos do grupo aparecem em grelha no formul\xE1rio, com o n\xFAmero de colunas deste bloco.",
2121
- layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas."
2188
+ layoutNoFields: "Este bloco n\xE3o tem campo que guarde um n\xFAmero de colunas.",
2189
+ "toolbar.versions": "Hist\xF3rico de vers\xF5es",
2190
+ versionsDenied: "Pe\xE7a a um administrador a permiss\xE3o Ler hist\xF3rico de vers\xF5es do Blockscene.",
2191
+ 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).",
2192
+ versionsNew: "Guarde este conte\xFAdo primeiro para iniciar o hist\xF3rico.",
2193
+ versionsPerson: "Filtrar por pessoa",
2194
+ versionsEveryone: "Todas as pessoas",
2195
+ versionsCounts: "{total} blocos",
2196
+ versionsCountsMissing: "Contagem de blocos indispon\xEDvel (evento antigo ou n\xE3o registado).",
2197
+ versionsPage: "P\xE1gina {page} de {count}",
2198
+ versionsPrevious: "Anterior",
2199
+ versionsNext: "Seguinte",
2200
+ versionsViewing: "A ver a vers\xE3o de {date} por {person} (s\xF3 de leitura).",
2201
+ versionsCurrent: "Voltar ao rascunho atual",
2202
+ versionsMissing: "Alguns blocos, campos, ficheiros ou rela\xE7\xF5es j\xE1 n\xE3o est\xE3o dispon\xEDveis nesta pr\xE9via.",
2203
+ 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.",
2204
+ historyExpired: "Snapshot j\xE1 n\xE3o est\xE1 dispon\xEDvel"
2122
2205
  };
2123
2206
 
2124
2207
  // admin/translations/fr.json
@@ -2176,10 +2259,10 @@ var fr_default = {
2176
2259
  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.",
2177
2260
  previewUrl: "URL de base de la route d'aper\xE7u",
2178
2261
  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).",
2179
- previewUrlEmpty: "Aucune URL d'aper\xE7u : les \xE9diteurs n'ont les modes Champs + page 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.",
2262
+ 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.",
2180
2263
  previewMode: "Mode d'aper\xE7u initial",
2181
- "modes.form": "Champs",
2182
- "modes.split": "Champs + page",
2264
+ "modes.form": "Champs uniquement",
2265
+ "modes.split": "Champs + aper\xE7u",
2183
2266
  "modes.preview": "\xC9diteur visuel",
2184
2267
  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.",
2185
2268
  lazyEdit: "Cliquer pour modifier",
@@ -2187,8 +2270,8 @@ var fr_default = {
2187
2270
  lazyFields: "Champs personnalis\xE9s charg\xE9s \xE0 la demande",
2188
2271
  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.",
2189
2272
  lazyFieldsInvalid: "Utilisez jusqu'\xE0 {max} uids de champs personnalis\xE9s, comme plugin::ckeditor5.CKEditor ou global::mon-champ.",
2190
- modeForm: "Champs",
2191
- modeSplit: "Champs + page",
2273
+ modeForm: "Champs uniquement",
2274
+ modeSplit: "Champs + aper\xE7u",
2192
2275
  modePreview: "\xC9diteur visuel",
2193
2276
  previewPane: "Aper\xE7u de la page",
2194
2277
  resize: "Redimensionner le panneau d'aper\xE7u",
@@ -2283,6 +2366,9 @@ var fr_default = {
2283
2366
  unstar: "Retirer des favoris",
2284
2367
  quickInsert: "Ins\xE9rer {label}",
2285
2368
  insert: "Ins\xE9rer",
2369
+ starterKits: "D\xE9marrer avec un kit",
2370
+ starterKitsHelp: "Choisissez une structure de d\xE9part. Tout est ins\xE9r\xE9 comme brouillon modifiable et non enregistr\xE9.",
2371
+ startBlank: "Commencer vide",
2286
2372
  closeDetail: "Fermer les d\xE9tails",
2287
2373
  typology: "Typologie",
2288
2374
  typologyAuto: "Automatique ({name})",
@@ -2326,7 +2412,7 @@ var fr_default = {
2326
2412
  blockPreview: "Aper\xE7u en direct du bloc",
2327
2413
  livePreviewFailed: "Aper\xE7u en direct indisponible, l'image est affich\xE9e.",
2328
2414
  blockPreviewUrl: "URL d'aper\xE7u de bloc",
2329
- blockPreviewUrlHelp: "Facultatif. Une page de votre frontend qui affiche un seul bloc, montr\xE9e en grand quand on clique sur une carte de la galerie, par ex. http://localhost:3026/fr/block-preview/'{name}'/'{variant}'. Variables : '{uid}', '{name}' (apr\xE8s le point), '{category}' (avant le point), '{variant}' (default), '{locale}'. Vide : la route d'aper\xE7u de page si elle existe, sinon l'image.",
2415
+ blockPreviewUrlHelp: "Facultatif. Une page de votre frontend qui affiche un seul bloc, montr\xE9e en grand depuis la loupe d'une carte de la galerie, par ex. http://localhost:3026/fr/block-preview/'{name}'/'{variant}'. Variables : '{uid}', '{name}' (apr\xE8s le point), '{category}' (avant le point), '{variant}' (default), '{locale}'. Vide : la route d'aper\xE7u de page si elle existe, sinon l'image.",
2330
2416
  rowActions: "Actions pour {label}",
2331
2417
  selectBlock: "S\xE9lectionner {label}",
2332
2418
  hiddenBadge: "Masqu\xE9",
@@ -2539,7 +2625,23 @@ var fr_default = {
2539
2625
  layoutOff: "Pas de grille",
2540
2626
  layoutNoMobile: "Aucun",
2541
2627
  layoutHelp: "Les blocs du groupe s'affichent en grille dans le formulaire, avec le nombre de colonnes de ce bloc.",
2542
- layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes."
2628
+ layoutNoFields: "Ce bloc n'a aucun champ pouvant contenir un nombre de colonnes.",
2629
+ "toolbar.versions": "Historique des versions",
2630
+ versionsDenied: "Demandez \xE0 un administrateur la permission Lire l\u2019historique des versions de Blockscene.",
2631
+ 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).",
2632
+ versionsNew: "Enregistrez d\u2019abord ce contenu pour commencer son historique.",
2633
+ versionsPerson: "Filtrer par personne",
2634
+ versionsEveryone: "Tout le monde",
2635
+ versionsCounts: "{total} blocs",
2636
+ versionsCountsMissing: "Nombre de blocs indisponible (\xE9v\xE9nement ancien ou non enregistr\xE9).",
2637
+ versionsPage: "Page {page} sur {count}",
2638
+ versionsPrevious: "Pr\xE9c\xE9dente",
2639
+ versionsNext: "Suivante",
2640
+ versionsViewing: "Version du {date} par {person} (lecture seule).",
2641
+ versionsCurrent: "Revenir au brouillon actuel",
2642
+ versionsMissing: "Certains blocs, champs, m\xE9dias ou relations ne sont plus disponibles dans cet aper\xE7u.",
2643
+ 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.",
2644
+ historyExpired: "Snapshot indisponible"
2543
2645
  };
2544
2646
 
2545
2647
  // admin/translations/es.json
@@ -2597,10 +2699,10 @@ var es_default = {
2597
2699
  rememberHelp: "Solo los botones expl\xEDcitos de abrir/cerrar todos actualizan la memoria, por usuario y navegador. Abrir un solo bloque no la cambia.",
2598
2700
  previewUrl: "URL base de la ruta de vista previa",
2599
2701
  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).",
2600
- previewUrlEmpty: "No hay URL de vista previa: los editores solo tienen los modos Campos + p\xE1gina 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.",
2702
+ 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.",
2601
2703
  previewMode: "Modo inicial de la vista previa",
2602
- "modes.form": "Campos",
2603
- "modes.split": "Campos + p\xE1gina",
2704
+ "modes.form": "Solo campos",
2705
+ "modes.split": "Campos + vista previa",
2604
2706
  "modes.preview": "Editor visual",
2605
2707
  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.",
2606
2708
  lazyEdit: "Haz clic para editar",
@@ -2608,8 +2710,8 @@ var es_default = {
2608
2710
  lazyFields: "Campos personalizados cargados bajo demanda",
2609
2711
  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.",
2610
2712
  lazyFieldsInvalid: "Usa hasta {max} uids de campos personalizados, como plugin::ckeditor5.CKEditor o global::mi-campo.",
2611
- modeForm: "Campos",
2612
- modeSplit: "Campos + p\xE1gina",
2713
+ modeForm: "Solo campos",
2714
+ modeSplit: "Campos + vista previa",
2613
2715
  modePreview: "Editor visual",
2614
2716
  previewPane: "Vista previa de la p\xE1gina",
2615
2717
  resize: "Redimensionar el panel de vista previa",
@@ -2704,6 +2806,9 @@ var es_default = {
2704
2806
  unstar: "Quitar de favoritos",
2705
2807
  quickInsert: "Insertar {label}",
2706
2808
  insert: "Insertar",
2809
+ starterKits: "Comenzar con un kit",
2810
+ starterKitsHelp: "Elige una estructura inicial. Todo se inserta como un borrador editable y sin guardar.",
2811
+ startBlank: "Comenzar en blanco",
2707
2812
  closeDetail: "Cerrar detalles",
2708
2813
  typology: "Tipolog\xEDa",
2709
2814
  typologyAuto: "Autom\xE1tica ({name})",
@@ -2747,7 +2852,7 @@ var es_default = {
2747
2852
  blockPreview: "Vista previa en vivo del bloque",
2748
2853
  livePreviewFailed: "Vista previa en vivo no disponible, se muestra la imagen.",
2749
2854
  blockPreviewUrl: "URL de vista previa del bloque",
2750
- blockPreviewUrlHelp: "Opcional. Una p\xE1gina de su frontend que renderiza un solo bloque, mostrada en grande al hacer clic en una tarjeta de la galer\xEDa, p. ej. http://localhost:3026/es/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (tras el punto), '{category}' (antes del punto), '{variant}' (default), '{locale}'. Vac\xEDa usa la ruta de vista previa de p\xE1gina si existe; si no, la imagen.",
2855
+ blockPreviewUrlHelp: "Opcional. Una p\xE1gina de su frontend que renderiza un solo bloque, mostrada en grande desde la lupa de una tarjeta de la galer\xEDa, p. ej. http://localhost:3026/es/block-preview/'{name}'/'{variant}'. Marcadores: '{uid}', '{name}' (tras el punto), '{category}' (antes del punto), '{variant}' (default), '{locale}'. Vac\xEDa usa la ruta de vista previa de p\xE1gina si existe; si no, la imagen.",
2751
2856
  rowActions: "Acciones de {label}",
2752
2857
  selectBlock: "Seleccionar {label}",
2753
2858
  hiddenBadge: "Oculto",
@@ -2960,7 +3065,23 @@ var es_default = {
2960
3065
  layoutOff: "Sin cuadr\xEDcula",
2961
3066
  layoutNoMobile: "Ninguno",
2962
3067
  layoutHelp: "Los bloques del grupo se muestran en cuadr\xEDcula en el formulario, con el n\xFAmero de columnas de este bloque.",
2963
- layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas."
3068
+ layoutNoFields: "Este bloque no tiene ning\xFAn campo que pueda guardar un n\xFAmero de columnas.",
3069
+ "toolbar.versions": "Historial de versiones",
3070
+ versionsDenied: "Pide a un administrador el permiso Leer historial de versiones de Blockscene.",
3071
+ 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).",
3072
+ versionsNew: "Guarda primero este contenido para iniciar su historial.",
3073
+ versionsPerson: "Filtrar por persona",
3074
+ versionsEveryone: "Todas las personas",
3075
+ versionsCounts: "{total} bloques",
3076
+ versionsCountsMissing: "Recuento de bloques no disponible (evento antiguo o no registrado).",
3077
+ versionsPage: "P\xE1gina {page} de {count}",
3078
+ versionsPrevious: "Anterior",
3079
+ versionsNext: "Siguiente",
3080
+ versionsViewing: "Viendo la versi\xF3n del {date} por {person} (solo lectura).",
3081
+ versionsCurrent: "Volver al borrador actual",
3082
+ versionsMissing: "Algunos bloques, campos, archivos o relaciones ya no est\xE1n disponibles en esta vista previa.",
3083
+ versionsBridgeLegacy: "Esta bridge no admite navegaci\xF3n de solo lectura. La interacci\xF3n est\xE1 desactivada; actualiza la bridge para admitir readOnly.",
3084
+ historyExpired: "Snapshot ya no disponible"
2964
3085
  };
2965
3086
 
2966
3087
  // admin/translations/de.json
@@ -3018,10 +3139,10 @@ var de_default = {
3018
3139
  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.",
3019
3140
  previewUrl: "Basis-URL der Vorschauroute",
3020
3141
  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).",
3021
- previewUrlEmpty: "Keine Vorschau-URL gesetzt: Redakteure erhalten die Modi Felder + Seite und Visueller Editor nur bei Inhaltstypen, f\xFCr die Strapis native Vorschau konfiguriert ist. Sonst wird das Modusmen\xFC nicht angezeigt.",
3142
+ 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.",
3022
3143
  previewMode: "Anf\xE4nglicher Vorschaumodus",
3023
- "modes.form": "Felder",
3024
- "modes.split": "Felder + Seite",
3144
+ "modes.form": "Nur Felder",
3145
+ "modes.split": "Felder + Vorschau",
3025
3146
  "modes.preview": "Visueller Editor",
3026
3147
  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.",
3027
3148
  lazyEdit: "Zum Bearbeiten klicken",
@@ -3029,8 +3150,8 @@ var de_default = {
3029
3150
  lazyFields: "Bei Bedarf geladene benutzerdefinierte Felder",
3030
3151
  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.",
3031
3152
  lazyFieldsInvalid: "Bis zu {max} Uids benutzerdefinierter Felder verwenden, z. B. plugin::ckeditor5.CKEditor oder global::mein-feld.",
3032
- modeForm: "Felder",
3033
- modeSplit: "Felder + Seite",
3153
+ modeForm: "Nur Felder",
3154
+ modeSplit: "Felder + Vorschau",
3034
3155
  modePreview: "Visueller Editor",
3035
3156
  previewPane: "Seitenvorschau",
3036
3157
  resize: "Vorschaubereich anpassen",
@@ -3125,6 +3246,9 @@ var de_default = {
3125
3246
  unstar: "Aus Favoriten entfernen",
3126
3247
  quickInsert: "{label} einf\xFCgen",
3127
3248
  insert: "Einf\xFCgen",
3249
+ starterKits: "Mit einem Kit starten",
3250
+ starterKitsHelp: "W\xE4hlen Sie eine Ausgangsstruktur. Alles wird als ungespeicherter, bearbeitbarer Entwurf eingef\xFCgt.",
3251
+ startBlank: "Leer beginnen",
3128
3252
  closeDetail: "Details schlie\xDFen",
3129
3253
  typology: "Typologie",
3130
3254
  typologyAuto: "Automatisch ({name})",
@@ -3168,7 +3292,7 @@ var de_default = {
3168
3292
  blockPreview: "Live-Vorschau des Blocks",
3169
3293
  livePreviewFailed: "Live-Vorschau nicht verf\xFCgbar, das Bild wird angezeigt.",
3170
3294
  blockPreviewUrl: "Block-Vorschau-URL",
3171
- blockPreviewUrlHelp: "Optional. Eine Seite Ihres Frontends, die einen einzelnen Block rendert und beim Klick auf eine Galeriekarte gro\xDF angezeigt wird, z. B. http://localhost:3026/de/block-preview/'{name}'/'{variant}'. Platzhalter: '{uid}', '{name}' (nach dem Punkt), '{category}' (vor dem Punkt), '{variant}' (default), '{locale}'. Leer verwendet die Seitenvorschau-Route, falls vorhanden, sonst das Bild.",
3295
+ blockPreviewUrlHelp: "Optional. Eine Seite Ihres Frontends, die einen einzelnen Block rendert und \xFCber die Lupe einer Galeriekarte gro\xDF angezeigt wird, z. B. http://localhost:3026/de/block-preview/'{name}'/'{variant}'. Platzhalter: '{uid}', '{name}' (nach dem Punkt), '{category}' (vor dem Punkt), '{variant}' (default), '{locale}'. Leer verwendet die Seitenvorschau-Route, falls vorhanden, sonst das Bild.",
3172
3296
  rowActions: "Aktionen f\xFCr {label}",
3173
3297
  selectBlock: "{label} ausw\xE4hlen",
3174
3298
  hiddenBadge: "Ausgeblendet",
@@ -3381,7 +3505,23 @@ var de_default = {
3381
3505
  layoutOff: "Kein Raster",
3382
3506
  layoutNoMobile: "Keines",
3383
3507
  layoutHelp: "Die Bl\xF6cke der Gruppe erscheinen im Formular als Raster, mit der Spaltenzahl dieses Blocks.",
3384
- layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann."
3508
+ layoutNoFields: "Dieser Block hat kein Feld, das eine Spaltenzahl enthalten kann.",
3509
+ "toolbar.versions": "Versionsverlauf",
3510
+ versionsDenied: "Bitte einen Administrator um die Blockscene-Berechtigung zum Lesen des Versionsverlaufs.",
3511
+ versionsDisabled: "Der Verlauf ist f\xFCr diesen Inhaltstyp nicht aktiviert. Bitte einen Administrator, ihn unter Settings > Blockscene zu aktivieren (settings.history.enabled).",
3512
+ versionsNew: "Speichere diesen Eintrag zuerst, um seinen Verlauf zu beginnen.",
3513
+ versionsPerson: "Nach Person filtern",
3514
+ versionsEveryone: "Alle Personen",
3515
+ versionsCounts: "{total} Bl\xF6cke",
3516
+ versionsCountsMissing: "Blockanzahl nicht verf\xFCgbar (\xE4lteres oder nicht aufgezeichnetes Ereignis).",
3517
+ versionsPage: "Seite {page} von {count}",
3518
+ versionsPrevious: "Zur\xFCck",
3519
+ versionsNext: "Weiter",
3520
+ versionsViewing: "Version vom {date} von {person} (schreibgesch\xFCtzt).",
3521
+ versionsCurrent: "Zur\xFCck zum aktuellen Entwurf",
3522
+ versionsMissing: "Einige Bl\xF6cke, Felder, Medien oder Beziehungen sind in dieser Vorschau nicht mehr verf\xFCgbar.",
3523
+ versionsBridgeLegacy: "Diese Bridge unterst\xFCtzt keine schreibgesch\xFCtzte Navigation. Interaktion ist deaktiviert; aktualisiere die Bridge f\xFCr readOnly.",
3524
+ historyExpired: "Snapshot nicht mehr verf\xFCgbar"
3385
3525
  };
3386
3526
 
3387
3527
  // admin/translations/it.json
@@ -3439,10 +3579,10 @@ var it_default = {
3439
3579
  rememberHelp: "Solo i pulsanti espliciti apri tutti / chiudi tutti aggiornano la memoria, per utente e browser. Aprire un singolo blocco non la cambia.",
3440
3580
  previewUrl: "URL di base della route di anteprima",
3441
3581
  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).",
3442
- previewUrlEmpty: "Nessun URL di anteprima impostato: gli editor hanno le modalit\xE0 Campi + pagina ed Editor visivo solo sui tipi di contenuto con l'anteprima nativa di Strapi configurata. Altrove il menu delle modalit\xE0 non compare.",
3582
+ 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.",
3443
3583
  previewMode: "Modalit\xE0 iniziale dell'anteprima",
3444
- "modes.form": "Campi",
3445
- "modes.split": "Campi + pagina",
3584
+ "modes.form": "Solo campi",
3585
+ "modes.split": "Campi + anteprima",
3446
3586
  "modes.preview": "Editor visivo",
3447
3587
  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.",
3448
3588
  lazyEdit: "Fai clic per modificare",
@@ -3450,8 +3590,8 @@ var it_default = {
3450
3590
  lazyFields: "Campi personalizzati caricati su richiesta",
3451
3591
  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.",
3452
3592
  lazyFieldsInvalid: "Usa fino a {max} uid di campi personalizzati, come plugin::ckeditor5.CKEditor o global::mio-campo.",
3453
- modeForm: "Campi",
3454
- modeSplit: "Campi + pagina",
3593
+ modeForm: "Solo campi",
3594
+ modeSplit: "Campi + anteprima",
3455
3595
  modePreview: "Editor visivo",
3456
3596
  previewPane: "Anteprima della pagina",
3457
3597
  resize: "Ridimensiona il pannello di anteprima",
@@ -3546,6 +3686,9 @@ var it_default = {
3546
3686
  unstar: "Rimuovi dai preferiti",
3547
3687
  quickInsert: "Inserisci {label}",
3548
3688
  insert: "Inserisci",
3689
+ starterKits: "Inizia con un kit",
3690
+ starterKitsHelp: "Scegli una struttura iniziale. Tutto viene inserito come bozza modificabile e non salvata.",
3691
+ startBlank: "Inizia da zero",
3549
3692
  closeDetail: "Chiudi dettagli",
3550
3693
  typology: "Tipologia",
3551
3694
  typologyAuto: "Automatica ({name})",
@@ -3589,7 +3732,7 @@ var it_default = {
3589
3732
  blockPreview: "Anteprima dal vivo del blocco",
3590
3733
  livePreviewFailed: "Anteprima dal vivo non disponibile, viene mostrata l'immagine.",
3591
3734
  blockPreviewUrl: "URL di anteprima del blocco",
3592
- blockPreviewUrlHelp: "Facoltativo. Una pagina del tuo frontend che renderizza un singolo blocco, mostrata in grande quando si clicca una scheda della galleria, ad es. http://localhost:3026/it/block-preview/'{name}'/'{variant}'. Segnaposto: '{uid}', '{name}' (dopo il punto), '{category}' (prima del punto), '{variant}' (default), '{locale}'. Vuoto usa la route di anteprima pagina se esiste, altrimenti l'immagine.",
3735
+ blockPreviewUrlHelp: "Facoltativo. Una pagina del tuo frontend che renderizza un singolo blocco, mostrata in grande dalla lente di ingrandimento di una scheda della galleria, ad es. http://localhost:3026/it/block-preview/'{name}'/'{variant}'. Segnaposto: '{uid}', '{name}' (dopo il punto), '{category}' (prima del punto), '{variant}' (default), '{locale}'. Vuoto usa la route di anteprima pagina se esiste, altrimenti l'immagine.",
3593
3736
  rowActions: "Azioni per {label}",
3594
3737
  selectBlock: "Seleziona {label}",
3595
3738
  hiddenBadge: "Nascosto",
@@ -3802,7 +3945,23 @@ var it_default = {
3802
3945
  layoutOff: "Nessuna griglia",
3803
3946
  layoutNoMobile: "Nessuno",
3804
3947
  layoutHelp: "I blocchi del gruppo appaiono in griglia nel modulo, con il numero di colonne di questo blocco.",
3805
- layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne."
3948
+ layoutNoFields: "Questo blocco non ha un campo che possa contenere un numero di colonne.",
3949
+ "toolbar.versions": "Cronologia delle versioni",
3950
+ versionsDenied: "Chiedi a un amministratore il permesso Leggere la cronologia delle versioni di Blockscene.",
3951
+ versionsDisabled: "La cronologia non \xE8 attiva per questo tipo di contenuto. Chiedi a un amministratore di attivarla in Settings > Blockscene (settings.history.enabled).",
3952
+ versionsNew: "Salva prima questo contenuto per avviare la cronologia.",
3953
+ versionsPerson: "Filtra per persona",
3954
+ versionsEveryone: "Tutte le persone",
3955
+ versionsCounts: "{total} blocchi",
3956
+ versionsCountsMissing: "Conteggio dei blocchi non disponibile (evento vecchio o non registrato).",
3957
+ versionsPage: "Pagina {page} di {count}",
3958
+ versionsPrevious: "Precedente",
3959
+ versionsNext: "Successiva",
3960
+ versionsViewing: "Versione del {date} di {person} (sola lettura).",
3961
+ versionsCurrent: "Torna alla bozza attuale",
3962
+ versionsMissing: "Alcuni blocchi, campi, media o relazioni non sono pi\xF9 disponibili in questa anteprima.",
3963
+ versionsBridgeLegacy: "Questa bridge non supporta la navigazione in sola lettura. Interazione disattivata; aggiorna la bridge per supportare readOnly.",
3964
+ historyExpired: "Snapshot non pi\xF9 disponibile"
3806
3965
  };
3807
3966
 
3808
3967
  // admin/translations/nl.json
@@ -3860,10 +4019,10 @@ var nl_default = {
3860
4019
  rememberHelp: "Alleen de expliciete knoppen alles openen / alles sluiten werken het geheugen bij, per gebruiker en browser. E\xE9n blok openen verandert niets.",
3861
4020
  previewUrl: "Basis-URL van de voorbeeldroute",
3862
4021
  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).",
3863
- previewUrlEmpty: "Geen preview-URL ingesteld: redacteuren krijgen de modi Velden + pagina en Visuele editor alleen bij inhoudstypes waarvoor de native Preview van Strapi is ingesteld. Elders verschijnt het modusmenu niet.",
4022
+ 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.",
3864
4023
  previewMode: "Beginmodus van het voorbeeld",
3865
- "modes.form": "Velden",
3866
- "modes.split": "Velden + pagina",
4024
+ "modes.form": "Alleen velden",
4025
+ "modes.split": "Velden + voorbeeld",
3867
4026
  "modes.preview": "Visuele editor",
3868
4027
  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.",
3869
4028
  lazyEdit: "Klik om te bewerken",
@@ -3871,8 +4030,8 @@ var nl_default = {
3871
4030
  lazyFields: "Aangepaste velden die op aanvraag laden",
3872
4031
  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.",
3873
4032
  lazyFieldsInvalid: "Gebruik maximaal {max} uids van aangepaste velden, zoals plugin::ckeditor5.CKEditor of global::mijn-veld.",
3874
- modeForm: "Velden",
3875
- modeSplit: "Velden + pagina",
4033
+ modeForm: "Alleen velden",
4034
+ modeSplit: "Velden + voorbeeld",
3876
4035
  modePreview: "Visuele editor",
3877
4036
  previewPane: "Paginavoorbeeld",
3878
4037
  resize: "Voorbeeldpaneel aanpassen",
@@ -3967,6 +4126,9 @@ var nl_default = {
3967
4126
  unstar: "Uit favorieten verwijderen",
3968
4127
  quickInsert: "{label} invoegen",
3969
4128
  insert: "Invoegen",
4129
+ starterKits: "Start met een kit",
4130
+ starterKitsHelp: "Kies een beginstructuur. Alles wordt ingevoegd als een onopgeslagen, bewerkbaar concept.",
4131
+ startBlank: "Leeg beginnen",
3970
4132
  closeDetail: "Details sluiten",
3971
4133
  typology: "Typologie",
3972
4134
  typologyAuto: "Automatisch ({name})",
@@ -4010,7 +4172,7 @@ var nl_default = {
4010
4172
  blockPreview: "Livevoorbeeld van het blok",
4011
4173
  livePreviewFailed: "Livevoorbeeld niet beschikbaar, de afbeelding wordt getoond.",
4012
4174
  blockPreviewUrl: "URL van blokvoorbeeld",
4013
- blockPreviewUrlHelp: "Optioneel. Een pagina van uw frontend die \xE9\xE9n blok rendert, groot getoond wanneer op een galerijkaart wordt geklikt, bijv. http://localhost:3026/nl/block-preview/'{name}'/'{variant}'. Plaatshouders: '{uid}', '{name}' (na de punt), '{category}' (voor de punt), '{variant}' (default), '{locale}'. Leeg gebruikt de paginavoorbeeldroute als die er is, anders de afbeelding.",
4175
+ blockPreviewUrlHelp: "Optioneel. Een pagina van uw frontend die \xE9\xE9n blok rendert, groot getoond via het vergrootglas van een galerijkaart, bijv. http://localhost:3026/nl/block-preview/'{name}'/'{variant}'. Plaatshouders: '{uid}', '{name}' (na de punt), '{category}' (voor de punt), '{variant}' (default), '{locale}'. Leeg gebruikt de paginavoorbeeldroute als die er is, anders de afbeelding.",
4014
4176
  rowActions: "Acties voor {label}",
4015
4177
  selectBlock: "{label} selecteren",
4016
4178
  hiddenBadge: "Verborgen",
@@ -4223,7 +4385,23 @@ var nl_default = {
4223
4385
  layoutOff: "Geen raster",
4224
4386
  layoutNoMobile: "Geen",
4225
4387
  layoutHelp: "De blokken van de groep verschijnen als raster in het formulier, met het aantal kolommen van dit blok.",
4226
- layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten."
4388
+ layoutNoFields: "Dit blok heeft geen veld dat een aantal kolommen kan bevatten.",
4389
+ "toolbar.versions": "Versiegeschiedenis",
4390
+ versionsDenied: "Vraag een beheerder om de Blockscene-machtiging Versiegeschiedenis lezen.",
4391
+ versionsDisabled: "Geschiedenis is niet ingeschakeld voor dit inhoudstype. Vraag een beheerder dit in Settings > Blockscene in te schakelen (settings.history.enabled).",
4392
+ versionsNew: "Sla dit item eerst op om de geschiedenis te starten.",
4393
+ versionsPerson: "Filter op persoon",
4394
+ versionsEveryone: "Iedereen",
4395
+ versionsCounts: "{total} blokken",
4396
+ versionsCountsMissing: "Aantal blokken niet beschikbaar (oudere of niet vastgelegde gebeurtenis).",
4397
+ versionsPage: "Pagina {page} van {count}",
4398
+ versionsPrevious: "Vorige",
4399
+ versionsNext: "Volgende",
4400
+ versionsViewing: "Versie van {date} door {person} bekijken (alleen-lezen).",
4401
+ versionsCurrent: "Terug naar huidig concept",
4402
+ versionsMissing: "Sommige blokken, velden, media of relaties zijn niet meer beschikbaar in dit voorbeeld.",
4403
+ versionsBridgeLegacy: "Deze bridge ondersteunt geen alleen-lezen navigatie. Interactie is uitgeschakeld; werk de bridge bij voor readOnly.",
4404
+ historyExpired: "Snapshot niet meer beschikbaar"
4227
4405
  };
4228
4406
 
4229
4407
  // admin/messages.ts
@@ -5855,10 +6033,6 @@ var Badge = styled5.span`
5855
6033
  `;
5856
6034
  var CardBox = styled5.div`
5857
6035
  position: relative;
5858
- &:hover .bs-quick,
5859
- &:focus-within .bs-quick {
5860
- opacity: 1;
5861
- }
5862
6036
  `;
5863
6037
  var CardBadges = styled5.div`
5864
6038
  position: absolute;
@@ -5881,17 +6055,17 @@ var Round = styled5.button`
5881
6055
  padding: 0;
5882
6056
  border-radius: 50%;
5883
6057
  cursor: pointer;
5884
- border: 1px solid ${({ theme, $primary }) => $primary ? theme.colors.primary600 : theme.colors.neutral200};
5885
- color: ${({ theme, $on, $primary }) => $primary ? theme.colors.neutral0 : $on ? theme.colors.warning500 : theme.colors.neutral600};
5886
- background: ${({ theme, $primary }) => $primary ? theme.colors.primary600 : theme.colors.neutral0};
6058
+ border: 1px solid ${({ theme }) => theme.colors.neutral200};
6059
+ color: ${({ theme, $on }) => $on ? theme.colors.warning500 : theme.colors.neutral600};
6060
+ background: ${({ theme }) => theme.colors.neutral0};
6061
+ transition: transform 120ms ease-out;
6062
+ &:active {
6063
+ transform: scale(0.97);
6064
+ }
5887
6065
  &:focus-visible {
5888
6066
  outline: 2px solid ${({ theme }) => theme.colors.primary600};
5889
6067
  outline-offset: 1px;
5890
6068
  }
5891
- &.bs-quick {
5892
- opacity: 0;
5893
- transition: opacity 120ms;
5894
- }
5895
6069
  `;
5896
6070
  var Mono = styled5.code`
5897
6071
  font-size: 12px;
@@ -5966,25 +6140,13 @@ function Badges({ entry, t, tags }) {
5966
6140
  }
5967
6141
  function Card({ entry, palette, showFields, starred, active, onOpen, onInsert, onStar }) {
5968
6142
  const t = useMessages();
5969
- const timer = React6.useRef(null);
5970
- React6.useEffect(() => () => clearTimeout(timer.current), []);
5971
6143
  return /* @__PURE__ */ jsxs5(CardBox, { title: entry.uid, "data-testid": `blockscene-${entry.uid}`, children: [
5972
6144
  /* @__PURE__ */ jsxs5(
5973
6145
  Tile,
5974
6146
  {
5975
6147
  type: "button",
5976
6148
  $active: active,
5977
- onClick: (event) => {
5978
- clearTimeout(timer.current);
5979
- if (event.detail === 2) onInsert();
5980
- else if (event.detail === 1) timer.current = setTimeout(onOpen, 220);
5981
- else onOpen();
5982
- },
5983
- onKeyDown: (event) => {
5984
- if (event.key !== "Enter") return;
5985
- event.preventDefault();
5986
- onInsert();
5987
- },
6149
+ onClick: onInsert,
5988
6150
  children: [
5989
6151
  /* @__PURE__ */ jsx7(
5990
6152
  Thumb,
@@ -6029,14 +6191,12 @@ function Card({ entry, palette, showFields, starred, active, onOpen, onInsert, o
6029
6191
  Round,
6030
6192
  {
6031
6193
  type: "button",
6032
- className: "bs-quick",
6033
6194
  style: { top: 46 },
6034
- $primary: true,
6035
- "aria-label": t.f("quickInsert", { label: entry.label }),
6036
- title: t.f("quickInsert", { label: entry.label }),
6037
- onClick: onInsert,
6038
- "data-testid": `gallery-quick-${entry.uid}`,
6039
- children: /* @__PURE__ */ jsx7(Icon, { name: "plus", size: 16 })
6195
+ "aria-label": t.f("rowPreview", { label: entry.label }),
6196
+ title: t.f("rowPreview", { label: entry.label }),
6197
+ onClick: onOpen,
6198
+ "data-testid": `gallery-preview-${entry.uid}`,
6199
+ children: /* @__PURE__ */ jsx7(Icon, { name: "seo", size: 16 })
6040
6200
  }
6041
6201
  )
6042
6202
  ] });
@@ -6595,7 +6755,7 @@ function ZoneGallery({
6595
6755
  gap: 4,
6596
6756
  style: { overflowY: "auto", flex: 1, minHeight: 0, padding: "4px" },
6597
6757
  children: (view === "recent" ? [{ typology: "recent", entries }] : groupEntries(entries)).map(
6598
- ({ typology, entries: items2 }) => /* @__PURE__ */ jsxs5(Flex2, { direction: "column", alignItems: "stretch", gap: 2, children: [
6758
+ ({ typology, entries: items2 }) => /* @__PURE__ */ jsxs5(Flex2, { direction: "column", alignItems: "stretch", gap: 2, flex: "0 0 auto", children: [
6599
6759
  /* @__PURE__ */ jsx7(Typography2, { variant: "sigma", textColor: "neutral600", "data-testid": `block-group-${typology}`, children: `${typology === "recent" ? t.nav.recent : t.typologies[typology] || typology} (${items2.length})` }),
6600
6760
  /* @__PURE__ */ jsx7(Columns, { $columns: columns, children: items2.map((entry) => /* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7(
6601
6761
  Card,
@@ -6881,7 +7041,7 @@ import styled6, { useTheme as useTheme2 } from "styled-components";
6881
7041
  import { Box as Box4, Button as Button3, Flex as Flex3, MenuItem, SimpleMenu, Typography as Typography4 } from "@strapi/design-system";
6882
7042
 
6883
7043
  // admin/pane.mjs
6884
- var TOOLBAR = ["modes", "history", "devices", "status", "actions"];
7044
+ var TOOLBAR = ["modes", "history", "versions", "devices", "status", "actions"];
6885
7045
  var RIGHT = ["status", "actions"];
6886
7046
  function toolbarLayout(list2) {
6887
7047
  const ids = Array.isArray(list2) ? list2.filter((id, i) => TOOLBAR.includes(id) && list2.indexOf(id) === i) : TOOLBAR;
@@ -7332,7 +7492,8 @@ function PagePreview({
7332
7492
  hiddenAttribute = null,
7333
7493
  form = null,
7334
7494
  Modal: Modal3,
7335
- Toggle
7495
+ Toggle,
7496
+ versions
7336
7497
  }) {
7337
7498
  const t = useMessages();
7338
7499
  const { values, zone, zoneLabel, canEdit, latest, insertRows: insertRows2 } = usePreviewZone(host);
@@ -7355,6 +7516,7 @@ function PagePreview({
7355
7516
  const vw = main.width;
7356
7517
  const [dragging, setDragging] = React8.useState(false);
7357
7518
  const [ready, setReady] = React8.useState(false);
7519
+ const [readOnlyBridge, setReadOnlyBridge] = React8.useState(false);
7358
7520
  const [failed, setFailed] = React8.useState(false);
7359
7521
  const [attempt, retry] = React8.useReducer((n) => n + 1, 0);
7360
7522
  const [picking, setPicking] = React8.useState(null);
@@ -7399,7 +7561,11 @@ function PagePreview({
7399
7561
  const iframe = React8.useRef(null);
7400
7562
  const loaded = React8.useRef(false);
7401
7563
  const anchor = React8.useRef(null);
7402
- const channel = React8.useMemo(() => crypto.randomUUID(), []);
7564
+ const version = versions?.view;
7565
+ const readOnly = Boolean(version);
7566
+ const viewRows = React8.useRef([]);
7567
+ viewRows.current = version ? version.values?.[zone] || [] : latest.current;
7568
+ const channel = React8.useMemo(() => crypto.randomUUID(), [host.model, host.documentId, host.locale, version?.scope, version?.event.id]);
7403
7569
  const { base, source } = state.preview;
7404
7570
  const url = base ? new URL(base) : null;
7405
7571
  url?.searchParams.set("channel", channel);
@@ -7418,7 +7584,8 @@ function PagePreview({
7418
7584
  setMode,
7419
7585
  onChange,
7420
7586
  clip,
7421
- clipCount
7587
+ clipCount,
7588
+ readOnly
7422
7589
  });
7423
7590
  live.current = {
7424
7591
  mode,
@@ -7428,7 +7595,8 @@ function PagePreview({
7428
7595
  setMode,
7429
7596
  onChange,
7430
7597
  clip,
7431
- clipCount
7598
+ clipCount,
7599
+ readOnly
7432
7600
  };
7433
7601
  const send = React8.useCallback(() => {
7434
7602
  iframe.current?.contentWindow?.postMessage(
@@ -7437,19 +7605,29 @@ function PagePreview({
7437
7605
  channel,
7438
7606
  type: "update-page",
7439
7607
  blocks: projectPage(
7440
- latest.current,
7608
+ viewRows.current,
7441
7609
  live.current.components,
7442
7610
  window.location.origin,
7443
7611
  hiddenAttribute
7444
- ),
7612
+ ).map((block) => live.current.readOnly ? { ...block, fields: [], media: {} } : block),
7445
7613
  groups,
7446
7614
  locale: t.locale,
7447
7615
  mode: live.current.mode,
7448
- clipboard: live.current.clipCount
7616
+ clipboard: live.current.readOnly ? 0 : live.current.clipCount,
7617
+ readOnly: live.current.readOnly
7449
7618
  },
7450
7619
  origin
7451
7620
  );
7452
- }, [channel, origin, hiddenAttribute]);
7621
+ }, [channel, origin, hiddenAttribute, groups]);
7622
+ React8.useEffect(() => {
7623
+ if (readOnly) {
7624
+ setInserting(null);
7625
+ setBlockModal(null);
7626
+ setPicking(null);
7627
+ setFieldsPanel(null);
7628
+ setHovered(null);
7629
+ }
7630
+ }, [readOnly]);
7453
7631
  const indexOf = (key) => latest.current.findIndex((row) => blockKey(row) === key);
7454
7632
  const path = (key, field) => `${zone}.${indexOf(key)}.${field}`;
7455
7633
  React8.useEffect(() => {
@@ -7606,9 +7784,11 @@ function PagePreview({
7606
7784
  React8.useEffect(() => {
7607
7785
  if (!active) return;
7608
7786
  setReady(false);
7787
+ setReadOnlyBridge(false);
7609
7788
  setFailed(false);
7610
7789
  const timeout = setTimeout(() => setFailed(true), 15e3);
7611
7790
  const receive = (event) => {
7791
+ if (!previewMessageAllowed(event, origin, iframe.current?.contentWindow, channel, live.current.readOnly)) return;
7612
7792
  const is = (type) => isPreviewMessage(
7613
7793
  event,
7614
7794
  origin,
@@ -7621,6 +7801,7 @@ function PagePreview({
7621
7801
  clearTimeout(timeout);
7622
7802
  setReady(true);
7623
7803
  setFailed(false);
7804
+ setReadOnlyBridge(Array.isArray(event.data.capabilities) && event.data.capabilities.includes("readOnly"));
7624
7805
  send();
7625
7806
  return;
7626
7807
  }
@@ -7748,9 +7929,9 @@ function PagePreview({
7748
7929
  if (!ready || !active) return;
7749
7930
  const timer = setTimeout(send, 120);
7750
7931
  return () => clearTimeout(timer);
7751
- }, [values, host.components, ready, active, send, mode, clipCount]);
7932
+ }, [values, version, host.components, ready, active, send, mode, clipCount]);
7752
7933
  React8.useEffect(() => {
7753
- if (!active || !ready) return;
7934
+ if (!active || !ready || readOnly) return;
7754
7935
  let last = null;
7755
7936
  const post = (key) => {
7756
7937
  if (key === last) return;
@@ -7773,7 +7954,7 @@ function PagePreview({
7773
7954
  document.removeEventListener("pointerout", onOut);
7774
7955
  post(null);
7775
7956
  };
7776
- }, [active, ready, channel, origin]);
7957
+ }, [active, ready, channel, origin, readOnly]);
7777
7958
  React8.useEffect(() => {
7778
7959
  const item = hovered && active ? findZoneList(live.current.zoneLabel)?.querySelectorAll(":scope > li")[indexOf(hovered)] : void 0;
7779
7960
  hoverRow.current = item || null;
@@ -7827,7 +8008,7 @@ function PagePreview({
7827
8008
  }
7828
8009
  ) });
7829
8010
  const layout = toolbarLayout(editor?.previewToolbar);
7830
- const tools = { modes: switcher, history: historyTools, devices };
8011
+ const tools = { modes: switcher, history: !readOnly && historyTools, versions: versions?.button, devices };
7831
8012
  const toolbarShown = !ready || layout.before.length + layout.right.length + layout.after.length > 0;
7832
8013
  const onKey = (event) => {
7833
8014
  const map = {
@@ -7936,7 +8117,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
7936
8117
  children: [
7937
8118
  !ready && /* @__PURE__ */ jsx9(Typography4, { variant: "pi", role: "status", textColor: "neutral600", children: failed ? t.previewFailed : t.previewLoading }),
7938
8119
  failed && /* @__PURE__ */ jsx9(Button3, { size: "S", variant: "secondary", onClick: retry, children: t.retry }),
7939
- layout.right.length > 0 && /* @__PURE__ */ jsx9(Actions2, { parts: layout.right })
8120
+ !readOnly && layout.right.length > 0 && /* @__PURE__ */ jsx9(Actions2, { parts: layout.right })
7940
8121
  ]
7941
8122
  }
7942
8123
  ),
@@ -7944,62 +8125,68 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
7944
8125
  ]
7945
8126
  }
7946
8127
  ),
7947
- /* @__PURE__ */ jsxs6("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: sidebarPosition === "bottom" ? "column-reverse" : sidebarPosition === "right" ? "row-reverse" : "row" }, children: [
7948
- mode === "preview" && sidebar.length > 0 && /* @__PURE__ */ jsx9("div", { ref: setRailEl, style: { display: "flex" }, children: /* @__PURE__ */ jsx9(
7949
- Flex3,
7950
- {
7951
- "data-testid": "page-preview-sidebar",
7952
- "data-position": sidebarPosition,
7953
- role: "toolbar",
7954
- "aria-label": t.sidebarLabel,
7955
- direction: sidebarPosition === "bottom" ? "row" : "column",
7956
- gap: 1,
7957
- padding: 1,
7958
- background: "neutral100",
7959
- justifyContent: sidebarPosition === "bottom" ? "center" : "flex-start",
7960
- style: { [sidebarPosition === "bottom" ? "borderTop" : sidebarPosition === "right" ? "borderLeft" : "borderRight"]: `1px solid ${theme?.colors?.neutral200 || "#dcdce4"}`, overflow: "auto" },
7961
- children: sidebar.map((item, i) => /* @__PURE__ */ jsxs6(
7962
- RailButton,
7963
- {
7964
- type: "button",
7965
- $active: fieldsPanel === item,
7966
- "aria-pressed": fieldsPanel === item,
7967
- title: item.label,
7968
- "data-testid": item.custom ? `sidebar-panel-${item.id}` : `sidebar-item-${i}`,
7969
- onClick: () => setFieldsPanel(fieldsPanel === item ? null : item),
7970
- children: [
7971
- typeof item.icon === "string" ? item.icon && /* @__PURE__ */ jsx9(Icon, { name: item.icon }) : item.icon,
7972
- /* @__PURE__ */ jsx9("span", { children: item.label })
7973
- ]
7974
- },
7975
- `${item.label}-${i}`
7976
- ))
7977
- }
7978
- ) }),
7979
- /* @__PURE__ */ jsx9(
7980
- "div",
7981
- {
7982
- ref: setStage,
7983
- "data-testid": "page-preview-stage",
7984
- "data-device": device.id,
7985
- style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
7986
- children: /* @__PURE__ */ jsx9(
7987
- Frame2,
7988
- {
7989
- ref: iframe,
7990
- title: t.previewPane,
7991
- src: url.href,
7992
- sandbox: "allow-scripts allow-same-origin",
7993
- referrerPolicy: "no-referrer",
7994
- onLoad: () => {
7995
- loaded.current = true;
8128
+ versions?.banner,
8129
+ readOnly && ready && !readOnlyBridge && /* @__PURE__ */ jsx9(Box4, { padding: 2, background: "neutral100", children: /* @__PURE__ */ jsx9(Typography4, { variant: "pi", role: "status", children: t.versionsBridgeLegacy }) }),
8130
+ /* @__PURE__ */ jsxs6("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: [
8131
+ /* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: sidebarPosition === "bottom" ? "column-reverse" : sidebarPosition === "right" ? "row-reverse" : "row" }, children: [
8132
+ !readOnly && mode === "preview" && sidebar.length > 0 && /* @__PURE__ */ jsx9("div", { ref: setRailEl, style: { display: "flex" }, children: /* @__PURE__ */ jsx9(
8133
+ Flex3,
8134
+ {
8135
+ "data-testid": "page-preview-sidebar",
8136
+ "data-position": sidebarPosition,
8137
+ role: "toolbar",
8138
+ "aria-label": t.sidebarLabel,
8139
+ direction: sidebarPosition === "bottom" ? "row" : "column",
8140
+ gap: 1,
8141
+ padding: 1,
8142
+ background: "neutral100",
8143
+ justifyContent: sidebarPosition === "bottom" ? "center" : "flex-start",
8144
+ style: { [sidebarPosition === "bottom" ? "borderTop" : sidebarPosition === "right" ? "borderLeft" : "borderRight"]: `1px solid ${theme?.colors?.neutral200 || "#dcdce4"}`, overflow: "auto" },
8145
+ children: sidebar.map((item, i) => /* @__PURE__ */ jsxs6(
8146
+ RailButton,
8147
+ {
8148
+ type: "button",
8149
+ $active: fieldsPanel === item,
8150
+ "aria-pressed": fieldsPanel === item,
8151
+ title: item.label,
8152
+ "data-testid": item.custom ? `sidebar-panel-${item.id}` : `sidebar-item-${i}`,
8153
+ onClick: () => setFieldsPanel(fieldsPanel === item ? null : item),
8154
+ children: [
8155
+ typeof item.icon === "string" ? item.icon && /* @__PURE__ */ jsx9(Icon, { name: item.icon }) : item.icon,
8156
+ /* @__PURE__ */ jsx9("span", { children: item.label })
8157
+ ]
7996
8158
  },
7997
- style: { ...frameStyle(device.width, stageSize), ...dragging ? { pointerEvents: "none" } : {} }
7998
- },
7999
- attempt
8000
- )
8001
- }
8002
- )
8159
+ `${item.label}-${i}`
8160
+ ))
8161
+ }
8162
+ ) }),
8163
+ /* @__PURE__ */ jsx9(
8164
+ "div",
8165
+ {
8166
+ ref: setStage,
8167
+ "data-testid": "page-preview-stage",
8168
+ "data-device": device.id,
8169
+ style: { position: "relative", flex: 1, overflow: "hidden", ...stageBackground(theme) },
8170
+ children: /* @__PURE__ */ jsx9(
8171
+ Frame2,
8172
+ {
8173
+ ref: iframe,
8174
+ title: t.previewPane,
8175
+ src: url.href,
8176
+ sandbox: "allow-scripts allow-same-origin",
8177
+ referrerPolicy: "no-referrer",
8178
+ ...readOnly && !readOnlyBridge ? { inert: "", tabIndex: -1 } : {},
8179
+ onLoad: () => {
8180
+ loaded.current = true;
8181
+ },
8182
+ style: { ...frameStyle(device.width, stageSize), ...dragging || readOnly && !readOnlyBridge ? { pointerEvents: "none" } : {} }
8183
+ },
8184
+ attempt
8185
+ )
8186
+ }
8187
+ )
8188
+ ] }),
8189
+ versions?.drawer
8003
8190
  ] })
8004
8191
  ]
8005
8192
  }
@@ -8026,6 +8213,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
8026
8213
  if (!open) setInserting(null);
8027
8214
  },
8028
8215
  onSelect: (uid, values2) => {
8216
+ if (live.current.readOnly) return;
8029
8217
  const rows = inserting.zone === zone ? latest.current : Array.isArray(host.values?.[inserting.zone]) ? host.values[inserting.zone] : [];
8030
8218
  const index = insertIndex(rows, inserting.after);
8031
8219
  setInserting(null);
@@ -8150,6 +8338,7 @@ ${/* Strapi 4's scrolled header is fixed to the viewport's right edge: beside th
8150
8338
  multiple: picking.attr.multiple === true,
8151
8339
  onClose: () => setPicking(null),
8152
8340
  onSelectAssets: (assets) => {
8341
+ if (live.current.readOnly) return;
8153
8342
  const index = indexOf(picking.key);
8154
8343
  setPicking(null);
8155
8344
  if (index < 0 || !assets?.length) return;
@@ -8485,6 +8674,8 @@ function History({ model, documentId, schema, components, editable, disabled, ge
8485
8674
  const initialValues = useForm2("BlocksceneVersions", (state) => state.initialValues);
8486
8675
  const setValues = useForm2("BlocksceneVersions", (state) => state.setValues);
8487
8676
  const [events, setEvents] = React10.useState(null);
8677
+ const [pagination, setPagination] = React10.useState(null);
8678
+ const [moreLoading, setMoreLoading] = React10.useState(false);
8488
8679
  const [failed, setFailed] = React10.useState(false);
8489
8680
  const [shown, setShown] = React10.useState(PAGE);
8490
8681
  const [open, setOpen] = React10.useState(null);
@@ -8492,11 +8683,19 @@ function History({ model, documentId, schema, components, editable, disabled, ge
8492
8683
  const [loading, setLoading] = React10.useState(false);
8493
8684
  const [refresh, reload] = React10.useReducer((n) => n + 1, 0);
8494
8685
  const allowed = Boolean(allowedActions?.canRead);
8686
+ const scope = `${model}:${documentId}:${locale}:${allowed}`;
8687
+ const latestScope = React10.useRef(scope);
8688
+ latestScope.current = scope;
8495
8689
  React10.useEffect(() => {
8496
8690
  if (!allowed || !documentId) return;
8497
8691
  let active = true;
8498
8692
  setFailed(false);
8499
- get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) => active && setEvents(Array.isArray(data?.results) ? data.results : [])).catch(() => active && setFailed(true));
8693
+ get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}${locale ? `?locale=${encodeURIComponent(locale)}` : ""}`).then(({ data }) => {
8694
+ if (active) {
8695
+ setEvents(Array.isArray(data?.results) ? data.results : []);
8696
+ setPagination(data?.pagination);
8697
+ }
8698
+ }).catch(() => active && setFailed(true));
8500
8699
  return () => {
8501
8700
  active = false;
8502
8701
  };
@@ -8505,7 +8704,26 @@ function History({ model, documentId, schema, components, editable, disabled, ge
8505
8704
  setOpen(null);
8506
8705
  setReport(null);
8507
8706
  setShown(PAGE);
8707
+ setEvents(null);
8708
+ setPagination(null);
8709
+ setMoreLoading(false);
8508
8710
  }, [model, documentId, locale]);
8711
+ const more = async () => {
8712
+ if (shown < (events?.length || 0)) return setShown(shown + PAGE);
8713
+ setMoreLoading(true);
8714
+ try {
8715
+ const params = new URLSearchParams({ page: String((pagination?.page || 1) + 1), ...locale && { locale } });
8716
+ const { data } = await get(`/blockscene/history/${encodeURIComponent(model)}/${encodeURIComponent(documentId)}?${params}`);
8717
+ if (latestScope.current !== scope) return;
8718
+ setEvents((previous) => [...previous || [], ...data?.results || []]);
8719
+ setPagination(data?.pagination);
8720
+ setShown(shown + PAGE);
8721
+ } catch {
8722
+ if (latestScope.current === scope) setFailed(true);
8723
+ } finally {
8724
+ if (latestScope.current === scope) setMoreLoading(false);
8725
+ }
8726
+ };
8509
8727
  if (isLoading || !allowed || !documentId) return null;
8510
8728
  const name = (uid) => components?.[uid]?.info?.displayName || uid;
8511
8729
  const when2 = (at) => {
@@ -8601,30 +8819,270 @@ function History({ model, documentId, schema, components, editable, disabled, ge
8601
8819
  ] }) })
8602
8820
  ] }, event.id);
8603
8821
  }),
8604
- events.length > shown && /* @__PURE__ */ jsx11(Flex5, { children: /* @__PURE__ */ jsx11(Button5, { variant: "tertiary", size: "S", onClick: () => setShown(shown + PAGE), children: t.historyShowMore }) })
8822
+ (events.length > shown || pagination?.page < pagination?.pageCount) && /* @__PURE__ */ jsx11(Flex5, { children: /* @__PURE__ */ jsx11(Button5, { variant: "tertiary", size: "S", onClick: more, loading: moreLoading, disabled: moreLoading, children: t.historyShowMore }) })
8605
8823
  ] })
8606
8824
  ] });
8607
8825
  }
8608
8826
 
8609
- // admin/Settings.tsx
8827
+ // admin/Versions.tsx
8610
8828
  import * as React11 from "react";
8611
- import { Box as Box6, Button as Button6, Flex as Flex6, Searchbar as Searchbar2, Typography as Typography7 } from "@strapi/design-system";
8612
8829
  import styled7 from "styled-components";
8613
- import { Fragment as Fragment9, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
8830
+ import { Box as Box6, Button as Button6, Flex as Flex6, SingleSelect, SingleSelectOption, Typography as Typography7 } from "@strapi/design-system";
8831
+ import { useQueryParams as useQueryParams3, useRBAC as useRBAC2 } from "@strapi/strapi/admin";
8832
+ import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
8833
+ var Drawer = styled7.aside`
8834
+ width: min(36rem, 55%); flex: 0 0 auto; overflow: auto;
8835
+ border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
8836
+ background: ${({ theme }) => theme.colors.neutral0};
8837
+ `;
8838
+ var Entry = styled7.button`
8839
+ display: block; width: 100%; text-align: left; padding: 12px; margin: 4px 0;
8840
+ border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px;
8841
+ background: ${({ theme }) => theme.colors.neutral0}; cursor: pointer;
8842
+ &[aria-pressed="true"] { background: ${({ theme }) => theme.colors.primary100}; border-color: ${({ theme }) => theme.colors.primary600}; }
8843
+ &:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
8844
+ &:disabled { cursor: default; opacity: .65; }
8845
+ overflow-wrap: anywhere;
8846
+ `;
8847
+ var PAGE_SIZE = 25;
8848
+ function useVersions(host, config2) {
8849
+ const t = useMessages();
8850
+ const [{ query: query2 }] = useQueryParams3();
8851
+ const locale = typeof query2?.plugins?.i18n?.locale === "string" ? query2.plugins.i18n.locale : host.locale || "";
8852
+ const rbac = useRBAC2(HISTORY_READ);
8853
+ const allowed = !rbac.isLoading && Boolean(rbac.allowedActions?.canRead);
8854
+ const enabled = Boolean(config2?.contentTypes?.includes(host.model));
8855
+ const scope = `${host.model}:${host.documentId || ""}:${locale}:${allowed}:${enabled}`;
8856
+ const currentScope = React11.useRef(scope);
8857
+ currentScope.current = scope;
8858
+ const requests = React11.useRef(0);
8859
+ const [open, setOpen] = React11.useState(false);
8860
+ const [actor, setActor] = React11.useState("");
8861
+ const [page, setPage] = React11.useState(1);
8862
+ const [list2, setList] = React11.useState(null);
8863
+ const [people, setPeople] = React11.useState(null);
8864
+ const [selection, setSelection] = React11.useState(null);
8865
+ const [failed, setFailed] = React11.useState(false);
8866
+ const [refresh, retry] = React11.useReducer((n) => n + 1, 0);
8867
+ const trigger = React11.useRef(null);
8868
+ const closeButton = React11.useRef(null);
8869
+ const titleId = React11.useId(), drawerId = React11.useId();
8870
+ const available = allowed && enabled && Boolean(host.documentId) && !host.creating;
8871
+ const reason = rbac.isLoading ? t.historyLoading : !allowed ? t.versionsDenied : !enabled ? t.versionsDisabled : !host.documentId || host.creating ? t.versionsNew : "";
8872
+ const view = selection?.scope === scope ? selection : null;
8873
+ const close = () => {
8874
+ setOpen(false);
8875
+ trigger.current?.focus();
8876
+ };
8877
+ const back = () => {
8878
+ requests.current++;
8879
+ setSelection(null);
8880
+ setFailed(false);
8881
+ trigger.current?.focus();
8882
+ };
8883
+ React11.useEffect(() => {
8884
+ requests.current++;
8885
+ setSelection(null);
8886
+ setList(null);
8887
+ setPeople(null);
8888
+ setActor("");
8889
+ setPage(1);
8890
+ setFailed(false);
8891
+ return () => {
8892
+ requests.current++;
8893
+ };
8894
+ }, [scope]);
8895
+ React11.useEffect(() => {
8896
+ if (open) closeButton.current?.focus();
8897
+ }, [open]);
8898
+ React11.useEffect(() => {
8899
+ if (!open || !available) return;
8900
+ let active = true;
8901
+ setList(null);
8902
+ setFailed(false);
8903
+ const params = new URLSearchParams({ page: String(page), pageSize: String(PAGE_SIZE), ...locale && { locale }, ...actor && { actor } });
8904
+ host.get(`/blockscene/history/${encodeURIComponent(host.model)}/${encodeURIComponent(String(host.documentId))}?${params}`).then(({ data }) => {
8905
+ if (active && currentScope.current === scope) {
8906
+ setList({ ...data, scope });
8907
+ setPeople({ scope, actors: data.actors || [] });
8908
+ }
8909
+ }).catch(() => {
8910
+ if (active && currentScope.current === scope) setFailed(true);
8911
+ });
8912
+ return () => {
8913
+ active = false;
8914
+ };
8915
+ }, [scope, open, page, actor, refresh, host.get, host.history?.epoch]);
8916
+ const select = async (event) => {
8917
+ if (!available || !event.stored) return;
8918
+ const request = ++requests.current;
8919
+ setSelection({ scope, event, pending: true, values: view?.values });
8920
+ setFailed(false);
8921
+ try {
8922
+ const { data } = await host.get(`/blockscene/history-events/${event.id}`);
8923
+ if (requests.current !== request || currentScope.current !== scope) return;
8924
+ const localized2 = host.contentType?.pluginOptions?.i18n?.localized;
8925
+ 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");
8926
+ const loaded = loadVersion(data.snapshot, {
8927
+ schema: host.contentType,
8928
+ components: host.components,
8929
+ media: data.media,
8930
+ relations: data.relations,
8931
+ editable: host.readable
8932
+ });
8933
+ for (const [name, attr] of Object.entries(host.contentType?.attributes || {}))
8934
+ if (attr.type === "dynamiczone") loaded.values[name]?.forEach((row, i) => {
8935
+ row.__temp_key__ = `version:${event.id}:${i}`;
8936
+ });
8937
+ setSelection({ scope, event, values: loaded.values, report: loaded.report, pending: false });
8938
+ } catch {
8939
+ if (requests.current === request && currentScope.current === scope) {
8940
+ setFailed(true);
8941
+ setSelection(null);
8942
+ }
8943
+ }
8944
+ };
8945
+ const when2 = (at, day = false) => new Date(at).toLocaleString(t.locale, { dateStyle: "medium", ...!day && { timeStyle: "short" } });
8946
+ const events = list2?.scope === scope ? list2.results || [] : [];
8947
+ let previousDay = "";
8948
+ const drawer = open && /* @__PURE__ */ jsx12(
8949
+ Drawer,
8950
+ {
8951
+ id: drawerId,
8952
+ role: "region",
8953
+ "aria-labelledby": titleId,
8954
+ "data-testid": "versions-drawer",
8955
+ onKeyDown: (event) => {
8956
+ if (event.key === "Escape") {
8957
+ event.preventDefault();
8958
+ event.stopPropagation();
8959
+ close();
8960
+ }
8961
+ },
8962
+ children: /* @__PURE__ */ jsxs9(Box6, { padding: 4, children: [
8963
+ /* @__PURE__ */ jsxs9(Flex6, { gap: 2, justifyContent: "space-between", children: [
8964
+ /* @__PURE__ */ jsx12(Typography7, { id: titleId, tag: "h2", variant: "delta", children: t.historyTitle }),
8965
+ /* @__PURE__ */ jsx12(Button6, { ref: closeButton, size: "S", variant: "tertiary", "aria-label": t.close, onClick: close, children: /* @__PURE__ */ jsx12(Icon, { name: "close" }) })
8966
+ ] }),
8967
+ reason ? /* @__PURE__ */ jsx12(Typography7, { tag: "p", textColor: "neutral600", children: reason }) : /* @__PURE__ */ jsxs9(Fragment10, { children: [
8968
+ /* @__PURE__ */ jsx12(Box6, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ jsxs9(SingleSelect, { "aria-label": t.versionsPerson, value: actor, onChange: (value) => {
8969
+ setActor(value);
8970
+ setPage(1);
8971
+ }, children: [
8972
+ /* @__PURE__ */ jsx12(SingleSelectOption, { value: "", children: t.versionsEveryone }),
8973
+ (people?.scope === scope ? people.actors : []).map((person) => /* @__PURE__ */ jsx12(SingleSelectOption, { value: person.actor, children: person.actorName || person.actor }, person.actor))
8974
+ ] }) }),
8975
+ !list2 && !failed && /* @__PURE__ */ jsx12(Typography7, { role: "status", children: t.historyLoading }),
8976
+ list2 && !events.length && /* @__PURE__ */ jsx12(Typography7, { children: t.historyEmpty }),
8977
+ events.map((event) => {
8978
+ const day = when2(event.at, true), heading = day !== previousDay;
8979
+ previousDay = day;
8980
+ const blocks = event.summary?.blocks;
8981
+ const counted = ["total", "added", "removed", "changed"].every((key) => Number.isInteger(blocks?.[key]));
8982
+ return /* @__PURE__ */ jsxs9(React11.Fragment, { children: [
8983
+ heading && /* @__PURE__ */ jsx12(Typography7, { tag: "h3", variant: "omega", fontWeight: "bold", style: { marginTop: 12 }, children: day }),
8984
+ /* @__PURE__ */ jsxs9(
8985
+ Entry,
8986
+ {
8987
+ "aria-pressed": view?.event.id === event.id,
8988
+ disabled: !event.stored,
8989
+ title: !event.stored ? t.historyExpired : void 0,
8990
+ "data-testid": `version-${event.id}`,
8991
+ onClick: () => select(event),
8992
+ children: [
8993
+ /* @__PURE__ */ jsx12(Typography7, { tag: "span", fontWeight: "bold", children: event.actorName || event.actor }),
8994
+ /* @__PURE__ */ jsxs9(Typography7, { tag: "p", variant: "pi", children: [
8995
+ when2(event.at),
8996
+ " \xB7 ",
8997
+ t.historyActions[event.action] || event.action
8998
+ ] }),
8999
+ counted ? /* @__PURE__ */ jsxs9(Fragment10, { children: [
9000
+ /* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", textColor: "neutral600", children: t.f("versionsCounts", blocks) }),
9001
+ /* @__PURE__ */ jsxs9(Flex6, { gap: 2, wrap: "wrap", children: [
9002
+ /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "success700", children: [
9003
+ "+",
9004
+ blocks.added,
9005
+ " ",
9006
+ t.diffOps.added
9007
+ ] }),
9008
+ /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "danger700", children: [
9009
+ "\u2212",
9010
+ blocks.removed,
9011
+ " ",
9012
+ t.diffOps.removed
9013
+ ] }),
9014
+ /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "warning700", children: [
9015
+ "~",
9016
+ blocks.changed,
9017
+ " ",
9018
+ t.diffOps.changed
9019
+ ] })
9020
+ ] })
9021
+ ] }) : /* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", textColor: "neutral600", children: t.versionsCountsMissing }),
9022
+ !event.stored && /* @__PURE__ */ jsx12(Typography7, { tag: "p", variant: "pi", children: t.historyExpired })
9023
+ ]
9024
+ }
9025
+ )
9026
+ ] }, event.id);
9027
+ }),
9028
+ list2 && /* @__PURE__ */ jsxs9(Flex6, { gap: 2, paddingTop: 3, justifyContent: "space-between", children: [
9029
+ /* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.versionsPrevious }),
9030
+ /* @__PURE__ */ jsx12(Typography7, { variant: "pi", children: t.f("versionsPage", { page, count: Math.max(1, list2.pagination?.pageCount || 0) }) }),
9031
+ /* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", disabled: page >= (list2.pagination?.pageCount || 0), onClick: () => setPage(page + 1), children: t.versionsNext })
9032
+ ] })
9033
+ ] }),
9034
+ failed && /* @__PURE__ */ jsxs9(Box6, { paddingTop: 3, children: [
9035
+ /* @__PURE__ */ jsx12(Typography7, { role: "alert", textColor: "danger600", children: t.historyFailed }),
9036
+ /* @__PURE__ */ jsx12(Button6, { size: "S", variant: "tertiary", onClick: retry, children: t.retry })
9037
+ ] })
9038
+ ] })
9039
+ }
9040
+ );
9041
+ return {
9042
+ view,
9043
+ drawer,
9044
+ button: /* @__PURE__ */ jsx12(
9045
+ Button6,
9046
+ {
9047
+ ref: trigger,
9048
+ size: "S",
9049
+ variant: "tertiary",
9050
+ startIcon: /* @__PURE__ */ jsx12(Icon, { name: "clock" }),
9051
+ "data-testid": "versions-toggle",
9052
+ "aria-expanded": open,
9053
+ "aria-controls": open ? drawerId : void 0,
9054
+ title: reason || t.historyTitle,
9055
+ onClick: () => setOpen(!open),
9056
+ children: t.historyTitle
9057
+ }
9058
+ ),
9059
+ banner: view && /* @__PURE__ */ jsxs9(Flex6, { padding: 3, gap: 3, wrap: "wrap", background: "primary100", "data-testid": "versions-banner", children: [
9060
+ /* @__PURE__ */ jsx12(Typography7, { role: "status", children: view.pending ? t.historyLoading : t.f("versionsViewing", { date: when2(view.event.at), person: view.event.actorName || view.event.actor }) }),
9061
+ /* @__PURE__ */ jsx12(Button6, { size: "S", variant: "secondary", onClick: back, children: t.versionsCurrent }),
9062
+ !view.pending && (view.report?.blocks || view.report?.media || view.report?.relations || view.report?.removed.length) > 0 && /* @__PURE__ */ jsx12(Typography7, { variant: "pi", children: t.versionsMissing })
9063
+ ] })
9064
+ };
9065
+ }
9066
+
9067
+ // admin/Settings.tsx
9068
+ import * as React12 from "react";
9069
+ import { Box as Box7, Button as Button7, Flex as Flex7, Searchbar as Searchbar2, Typography as Typography8 } from "@strapi/design-system";
9070
+ import styled8 from "styled-components";
9071
+ import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
8614
9072
  var COLOR2 = /^#[0-9A-Fa-f]{6}$/;
8615
- var Grid2 = styled7.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; `;
8616
- var Card2 = styled7.div`
9073
+ var Grid2 = styled8.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; `;
9074
+ var Card2 = styled8.div`
8617
9075
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
8618
9076
  border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral0};
8619
9077
  `;
8620
- var Bar = styled7.div`
9078
+ var Bar = styled8.div`
8621
9079
  position: fixed; top: 0; z-index: 4; padding: 12px 32px;
8622
9080
  background: ${({ theme }) => theme.colors.neutral100}; border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
8623
9081
  box-shadow: 0 1px 4px rgba(33, 33, 52, 0.1);
8624
9082
  `;
8625
9083
  function useMainRect2(anchor) {
8626
- const [rect, setRect] = React11.useState({ left: 0, width: 0 });
8627
- React11.useEffect(() => {
9084
+ const [rect, setRect] = React12.useState({ left: 0, width: 0 });
9085
+ React12.useEffect(() => {
8628
9086
  const read3 = () => {
8629
9087
  let host = document.getElementById("main-content");
8630
9088
  for (let el = anchor.current?.parentElement; !host && el; el = el.parentElement) if (["auto", "scroll"].includes(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) host = el;
@@ -8637,15 +9095,15 @@ function useMainRect2(anchor) {
8637
9095
  });
8638
9096
  return rect;
8639
9097
  }
8640
- var Swatches = styled7.div` display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; `;
8641
- var Label = styled7.label` display: flex; flex-direction: column; gap: 4px; font-size: 12px; `;
9098
+ var Swatches = styled8.div` display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; `;
9099
+ var Label = styled8.label` display: flex; flex-direction: column; gap: 4px; font-size: 12px; `;
8642
9100
  function ColorField({ name, label, value, onChange, disabled }) {
8643
9101
  const valid = COLOR2.test(value);
8644
- return /* @__PURE__ */ jsxs9(Label, { children: [
8645
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
8646
- /* @__PURE__ */ jsxs9(Flex6, { gap: 2, children: [
8647
- /* @__PURE__ */ jsx12("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" } }),
8648
- /* @__PURE__ */ jsx12(
9102
+ return /* @__PURE__ */ jsxs10(Label, { children: [
9103
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
9104
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 2, children: [
9105
+ /* @__PURE__ */ jsx13("input", { type: "color", "aria-label": label, value: valid ? value : "#000000", disabled, onChange: (e) => onChange(e.target.value.toUpperCase()), style: { width: 40, height: 32, padding: 0, border: 0, background: "none" } }),
9106
+ /* @__PURE__ */ jsx13(
8649
9107
  "input",
8650
9108
  {
8651
9109
  name,
@@ -8661,14 +9119,14 @@ function ColorField({ name, label, value, onChange, disabled }) {
8661
9119
  ] });
8662
9120
  }
8663
9121
  function TagsField({ name, label, hint, value, onChange, disabled }) {
8664
- const [text, setText] = React11.useState(value.join(", "));
8665
- return /* @__PURE__ */ jsxs9(Label, { children: [
8666
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
8667
- /* @__PURE__ */ jsx12("input", { name, value: text, disabled, onChange: (e) => {
9122
+ const [text, setText] = React12.useState(value.join(", "));
9123
+ return /* @__PURE__ */ jsxs10(Label, { children: [
9124
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: label }),
9125
+ /* @__PURE__ */ jsx13("input", { name, value: text, disabled, onChange: (e) => {
8668
9126
  setText(e.target.value);
8669
9127
  onChange([...new Set(e.target.value.split(",").map((tag) => tag.replace(/[<>]/g, "").trim().slice(0, 24)).filter(Boolean))].slice(0, 10));
8670
9128
  }, style: { padding: "6px 8px", border: "1px solid #dcdce4", borderRadius: 4, fontSize: 13 } }),
8671
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: hint })
9129
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: hint })
8672
9130
  ] });
8673
9131
  }
8674
9132
  var FIELD_UID = /^(plugin|global)::[\w.-]+$/;
@@ -8676,11 +9134,11 @@ var LAZY_MAX = 20;
8676
9134
  var parseUids = (text) => [...new Set(text.split(/[\s,]+/).filter(Boolean))];
8677
9135
  var badUids = (uids = []) => uids.length > LAZY_MAX || uids.some((uid) => !FIELD_UID.test(uid));
8678
9136
  function UidListField({ TextField: TextField2, value, onChange, ...props }) {
8679
- const [text, setText] = React11.useState(value.join(", "));
8680
- React11.useEffect(() => {
9137
+ const [text, setText] = React12.useState(value.join(", "));
9138
+ React12.useEffect(() => {
8681
9139
  if (parseUids(text).join() !== value.join()) setText(value.join(", "));
8682
9140
  }, [value.join()]);
8683
- return /* @__PURE__ */ jsx12(TextField2, { ...props, value: text, onChange: (v) => {
9141
+ return /* @__PURE__ */ jsx13(TextField2, { ...props, value: text, onChange: (v) => {
8684
9142
  setText(v);
8685
9143
  onChange(parseUids(v));
8686
9144
  } });
@@ -8690,31 +9148,31 @@ var SIDEBAR_MAX = 12;
8690
9148
  var ITEM_LABEL = /^[^<>]{1,40}$/;
8691
9149
  var badItem = (item) => !ITEM_LABEL.test(String(item.label || "").trim()) || !item.fields?.length;
8692
9150
  var SYSTEM_FIELDS2 = ["createdAt", "updatedAt", "publishedAt", "createdBy", "updatedBy", "locale", "localizations"];
8693
- var Item = styled7.div`
9151
+ var Item = styled8.div`
8694
9152
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px;
8695
9153
  border: 1px solid ${({ theme }) => theme.colors.neutral200}; background: ${({ theme }) => theme.colors.neutral100};
8696
9154
  `;
8697
- var Checks = styled7.fieldset`
9155
+ var Checks = styled8.fieldset`
8698
9156
  display: flex; flex-wrap: wrap; gap: 4px 16px; border: 0; padding: 0; margin: 0; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800};
8699
9157
  legend { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
8700
9158
  label { display: inline-flex; align-items: center; gap: 6px; }
8701
9159
  `;
8702
- var TOOLBAR2 = ["modes", "history", "devices", "status", "actions"];
9160
+ var TOOLBAR2 = ["modes", "history", "versions", "devices", "status", "actions"];
8703
9161
  var DEVICE_NAMES = ["fit", "mobile", "tablet", "desktop"];
8704
9162
  var DEVICE_LABEL = /^[^<>]{1,24}$/;
8705
9163
  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;
8706
- var Row = styled7.div` display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800}; `;
8707
- function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2 }) {
9164
+ var Row = styled8.div` display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: ${({ theme }) => theme.colors.neutral800}; `;
9165
+ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: TextField2, versions }) {
8708
9166
  const move = (list2, index, by) => {
8709
9167
  const next = [...list2];
8710
9168
  [next[index], next[index + by]] = [next[index + by], next[index]];
8711
9169
  return next;
8712
9170
  };
8713
- const arrows = (list2, index, key) => /* @__PURE__ */ jsxs9(Fragment9, { children: [
8714
- /* @__PURE__ */ jsx12(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index < 0 || index === 0, onClick: () => set2(key, move(list2, index, -1)) }),
8715
- /* @__PURE__ */ jsx12(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index < 0 || index === list2.length - 1, onClick: () => set2(key, move(list2, index, 1)) })
9171
+ const arrows = (list2, index, key) => /* @__PURE__ */ jsxs10(Fragment11, { children: [
9172
+ /* @__PURE__ */ jsx13(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index < 0 || index === 0, onClick: () => set2(key, move(list2, index, -1)) }),
9173
+ /* @__PURE__ */ jsx13(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index < 0 || index === list2.length - 1, onClick: () => set2(key, move(list2, index, 1)) })
8716
9174
  ] });
8717
- const check = (list2, item, key) => /* @__PURE__ */ jsx12(
9175
+ const check = (list2, item, key) => /* @__PURE__ */ jsx13(
8718
9176
  "input",
8719
9177
  {
8720
9178
  type: "checkbox",
@@ -8725,27 +9183,27 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
8725
9183
  }
8726
9184
  );
8727
9185
  const width = (index, patch) => set2("previewDevices", devices.map((item, i) => i === index ? { ...item, ...patch } : item));
8728
- return /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 3, "data-testid": `pane-editor-${id}`, children: [
8729
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.paneHelp }),
8730
- /* @__PURE__ */ jsx12(Box6, { children: [...toolbar, ...TOOLBAR2.filter((item) => !toolbar.includes(item))].map((item) => /* @__PURE__ */ jsxs9(Row, { "data-testid": `${id}-toolbar-${item}`, children: [
9186
+ return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 3, "data-testid": `pane-editor-${id}`, children: [
9187
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.paneHelp }),
9188
+ /* @__PURE__ */ jsx13(Box7, { children: [...toolbar, ...TOOLBAR2.filter((item) => !toolbar.includes(item))].filter((item) => item !== "versions" || versions).map((item) => /* @__PURE__ */ jsxs10(Row, { "data-testid": `${id}-toolbar-${item}`, children: [
8731
9189
  arrows(toolbar, toolbar.indexOf(item), "previewToolbar"),
8732
- /* @__PURE__ */ jsxs9("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
9190
+ /* @__PURE__ */ jsxs10("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
8733
9191
  check(toolbar, item, "previewToolbar"),
8734
9192
  t.toolbar[item]
8735
9193
  ] })
8736
9194
  ] }, item)) }),
8737
- /* @__PURE__ */ jsx12(Typography7, { variant: "delta", tag: "h3", children: t.paneDevices }),
8738
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.paneDevicesHelp }),
8739
- /* @__PURE__ */ jsx12(Box6, { children: [...devices, ...DEVICE_NAMES.filter((item) => !devices.includes(item))].map((item) => {
9195
+ /* @__PURE__ */ jsx13(Typography8, { variant: "delta", tag: "h3", children: t.paneDevices }),
9196
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.paneDevicesHelp }),
9197
+ /* @__PURE__ */ jsx13(Box7, { children: [...devices, ...DEVICE_NAMES.filter((item) => !devices.includes(item))].map((item) => {
8740
9198
  const index = devices.indexOf(item);
8741
- return /* @__PURE__ */ jsxs9(Row, { "data-testid": `${id}-device-${typeof item === "string" ? item : index}`, children: [
9199
+ return /* @__PURE__ */ jsxs10(Row, { "data-testid": `${id}-device-${typeof item === "string" ? item : index}`, children: [
8742
9200
  arrows(devices, index, "previewDevices"),
8743
- typeof item === "string" ? /* @__PURE__ */ jsxs9("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
9201
+ typeof item === "string" ? /* @__PURE__ */ jsxs10("label", { style: { display: "inline-flex", gap: 6, alignItems: "center" }, children: [
8744
9202
  check(devices, item, "previewDevices"),
8745
9203
  t.device[item]
8746
- ] }) : /* @__PURE__ */ jsxs9(Fragment9, { children: [
8747
- /* @__PURE__ */ jsx12(Box6, { style: { flex: "1 1 160px" }, children: /* @__PURE__ */ jsx12(TextField2, { name: `${id}-device-label-${index}`, label: t.paneWidthLabel, value: item.label, disabled, onChange: (v) => width(index, { label: v }) }) }),
8748
- /* @__PURE__ */ jsx12(Box6, { style: { width: 140 }, children: /* @__PURE__ */ jsx12(
9204
+ ] }) : /* @__PURE__ */ jsxs10(Fragment11, { children: [
9205
+ /* @__PURE__ */ jsx13(Box7, { style: { flex: "1 1 160px" }, children: /* @__PURE__ */ jsx13(TextField2, { name: `${id}-device-label-${index}`, label: t.paneWidthLabel, value: item.label, disabled, onChange: (v) => width(index, { label: v }) }) }),
9206
+ /* @__PURE__ */ jsx13(Box7, { style: { width: 140 }, children: /* @__PURE__ */ jsx13(
8749
9207
  TextField2,
8750
9208
  {
8751
9209
  name: `${id}-device-width-${index}`,
@@ -8755,12 +9213,12 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
8755
9213
  onChange: (v) => width(index, { width: /^\d{1,4}$/.test(v.trim()) ? Number(v.trim()) : NaN })
8756
9214
  }
8757
9215
  ) }),
8758
- /* @__PURE__ */ jsx12(Tool, { icon: "close", label: t.paneRemoveWidth, disabled, onClick: () => set2("previewDevices", devices.filter((_, i) => i !== index)) })
9216
+ /* @__PURE__ */ jsx13(Tool, { icon: "close", label: t.paneRemoveWidth, disabled, onClick: () => set2("previewDevices", devices.filter((_, i) => i !== index)) })
8759
9217
  ] })
8760
9218
  ] }, typeof item === "string" ? item : `px-${index}`);
8761
9219
  }) }),
8762
- /* @__PURE__ */ jsx12(Flex6, { children: /* @__PURE__ */ jsx12(
8763
- Button6,
9220
+ /* @__PURE__ */ jsx13(Flex7, { children: /* @__PURE__ */ jsx13(
9221
+ Button7,
8764
9222
  {
8765
9223
  variant: "secondary",
8766
9224
  size: "S",
@@ -8770,7 +9228,7 @@ function PaneEditor({ id, toolbar, devices, set: set2, t, disabled, TextField: T
8770
9228
  children: t.paneAddWidth
8771
9229
  }
8772
9230
  ) }),
8773
- badDevices(devices) && /* @__PURE__ */ jsx12(Typography7, { role: "alert", variant: "pi", textColor: "danger600", children: t.paneInvalid })
9231
+ badDevices(devices) && /* @__PURE__ */ jsx13(Typography8, { role: "alert", variant: "pi", textColor: "danger600", children: t.paneInvalid })
8774
9232
  ] });
8775
9233
  }
8776
9234
  var DAYS = (n) => Number.isInteger(n) && n >= 1 && n <= 3650;
@@ -8778,7 +9236,7 @@ var badRetention = (h) => !h || !DAYS(h.retentionDays) || !DAYS(h.eventDays) ||
8778
9236
  function HistorySettings({ types, history, set: set2, t, disabled, ToggleField: ToggleField2, TextField: TextField2 }) {
8779
9237
  const all = history.contentTypes === "all";
8780
9238
  const list2 = all ? [] : history.contentTypes;
8781
- const number = (key) => /* @__PURE__ */ jsx12(Box6, { style: { minWidth: 200 }, children: /* @__PURE__ */ jsx12(
9239
+ const number = (key) => /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 200 }, children: /* @__PURE__ */ jsx13(
8782
9240
  TextField2,
8783
9241
  {
8784
9242
  name: `history-${key}`,
@@ -8788,15 +9246,15 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
8788
9246
  onChange: (v) => set2(key, /^\d{1,5}$/.test(v.trim()) ? Number(v.trim()) : NaN)
8789
9247
  }
8790
9248
  ) });
8791
- return /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "history-settings", children: [
8792
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.historySettings }),
8793
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.historySettingsHelp }),
8794
- /* @__PURE__ */ jsx12(ToggleField2, { name: "history-enabled", label: t.historyEnabled, value: history.enabled, disabled, onChange: (v) => set2("enabled", v) }),
8795
- /* @__PURE__ */ jsx12(ToggleField2, { name: "history-all", label: t.historyAll, value: all, disabled: disabled || !history.enabled, onChange: (v) => set2("contentTypes", v ? "all" : types.map((type) => type.uid)) }),
8796
- !all && /* @__PURE__ */ jsxs9(Checks, { disabled: disabled || !history.enabled, children: [
8797
- /* @__PURE__ */ jsx12("legend", { children: t.historyTypes }),
8798
- types.map((type) => /* @__PURE__ */ jsxs9("label", { children: [
8799
- /* @__PURE__ */ jsx12(
9249
+ return /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "history-settings", children: [
9250
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.historySettings }),
9251
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.historySettingsHelp }),
9252
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "history-enabled", label: t.historyEnabled, value: history.enabled, disabled, onChange: (v) => set2("enabled", v) }),
9253
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "history-all", label: t.historyAll, value: all, disabled: disabled || !history.enabled, onChange: (v) => set2("contentTypes", v ? "all" : types.map((type) => type.uid)) }),
9254
+ !all && /* @__PURE__ */ jsxs10(Checks, { disabled: disabled || !history.enabled, children: [
9255
+ /* @__PURE__ */ jsx13("legend", { children: t.historyTypes }),
9256
+ types.map((type) => /* @__PURE__ */ jsxs10("label", { children: [
9257
+ /* @__PURE__ */ jsx13(
8800
9258
  "input",
8801
9259
  {
8802
9260
  type: "checkbox",
@@ -8808,13 +9266,13 @@ function HistorySettings({ types, history, set: set2, t, disabled, ToggleField:
8808
9266
  type.displayName
8809
9267
  ] }, type.uid))
8810
9268
  ] }),
8811
- /* @__PURE__ */ jsxs9(Flex6, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
9269
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
8812
9270
  number("retentionDays"),
8813
9271
  number("maxSnapshots"),
8814
9272
  number("eventDays"),
8815
9273
  number("trashDays")
8816
9274
  ] }),
8817
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: badRetention(history) ? "danger600" : "neutral600", role: badRetention(history) ? "alert" : void 0, children: badRetention(history) ? t.historyInvalid : `${t.historyRetentionHelp} ${t.trashDaysHelp}` })
9275
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: badRetention(history) ? "danger600" : "neutral600", role: badRetention(history) ? "alert" : void 0, children: badRetention(history) ? t.historyInvalid : `${t.historyRetentionHelp} ${t.trashDaysHelp}` })
8818
9276
  ] }) });
8819
9277
  }
8820
9278
  function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: SelectField2, TextField: TextField2 }) {
@@ -8828,10 +9286,10 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
8828
9286
  };
8829
9287
  const fields = (type.attributes || []).filter((attr) => !SYSTEM_FIELDS2.includes(attr.name));
8830
9288
  const id = (name, index) => `sidebar-${name}-${type.uid}${index === void 0 ? "" : `-${index}`}`;
8831
- return /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, "data-testid": `sidebar-editor-${type.uid}`, children: [
8832
- /* @__PURE__ */ jsx12(Typography7, { variant: "delta", tag: "h3", children: t.f("sidebarTitle", { name: type.displayName }) }),
8833
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.sidebarHelp }),
8834
- /* @__PURE__ */ jsx12(Box6, { style: { maxWidth: 240 }, children: /* @__PURE__ */ jsx12(
9289
+ return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, "data-testid": `sidebar-editor-${type.uid}`, children: [
9290
+ /* @__PURE__ */ jsx13(Typography8, { variant: "delta", tag: "h3", children: t.f("sidebarTitle", { name: type.displayName }) }),
9291
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.sidebarHelp }),
9292
+ /* @__PURE__ */ jsx13(Box7, { style: { maxWidth: 240 }, children: /* @__PURE__ */ jsx13(
8835
9293
  SelectField2,
8836
9294
  {
8837
9295
  name: id("position"),
@@ -8842,21 +9300,21 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
8842
9300
  onChange: (v) => set2("sidebarPosition", v, "left")
8843
9301
  }
8844
9302
  ) }),
8845
- items2.map((item, index) => /* @__PURE__ */ jsxs9(Item, { "data-testid": id("item", index), children: [
8846
- /* @__PURE__ */ jsxs9(Flex6, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
8847
- /* @__PURE__ */ jsx12(Box6, { style: { flex: "1 1 200px" }, children: /* @__PURE__ */ jsx12(TextField2, { name: id("label", index), label: t.sidebarItemLabel, value: item.label, disabled, onChange: (v) => edit(index, { label: v }) }) }),
8848
- /* @__PURE__ */ jsx12(Box6, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsx12(
9303
+ items2.map((item, index) => /* @__PURE__ */ jsxs10(Item, { "data-testid": id("item", index), children: [
9304
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
9305
+ /* @__PURE__ */ jsx13(Box7, { style: { flex: "1 1 200px" }, children: /* @__PURE__ */ jsx13(TextField2, { name: id("label", index), label: t.sidebarItemLabel, value: item.label, disabled, onChange: (v) => edit(index, { label: v }) }) }),
9306
+ /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsx13(
8849
9307
  SelectField2,
8850
9308
  {
8851
9309
  name: id("icon", index),
8852
9310
  label: t.sidebarIcon,
8853
9311
  value: item.icon || "none",
8854
9312
  disabled,
8855
- options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */ jsx12(Icon, { name: value, size: 16 }) }))],
9313
+ options: [{ value: "none", label: t.noIcon }, ...SIDEBAR_ICONS.map((value) => ({ value, label: t.icons[value], icon: /* @__PURE__ */ jsx13(Icon, { name: value, size: 16 }) }))],
8856
9314
  onChange: (v) => edit(index, { icon: v === "none" ? void 0 : v })
8857
9315
  }
8858
9316
  ) }),
8859
- /* @__PURE__ */ jsx12(Box6, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsx12(
9317
+ /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsx13(
8860
9318
  SelectField2,
8861
9319
  {
8862
9320
  name: id("open", index),
@@ -8867,16 +9325,16 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
8867
9325
  onChange: (v) => edit(index, { open: v })
8868
9326
  }
8869
9327
  ) }),
8870
- /* @__PURE__ */ jsxs9(Flex6, { gap: 1, paddingBottom: 1, children: [
8871
- /* @__PURE__ */ jsx12(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index === 0, onClick: () => move(index, -1) }),
8872
- /* @__PURE__ */ jsx12(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index === items2.length - 1, onClick: () => move(index, 1) }),
8873
- /* @__PURE__ */ jsx12(Tool, { icon: "close", label: t.sidebarRemove, disabled, onClick: () => save(items2.filter((_, i) => i !== index)) })
9328
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 1, paddingBottom: 1, children: [
9329
+ /* @__PURE__ */ jsx13(Tool, { icon: "up", label: t.moveUp, disabled: disabled || index === 0, onClick: () => move(index, -1) }),
9330
+ /* @__PURE__ */ jsx13(Tool, { icon: "down", label: t.moveDown, disabled: disabled || index === items2.length - 1, onClick: () => move(index, 1) }),
9331
+ /* @__PURE__ */ jsx13(Tool, { icon: "close", label: t.sidebarRemove, disabled, onClick: () => save(items2.filter((_, i) => i !== index)) })
8874
9332
  ] })
8875
9333
  ] }),
8876
- /* @__PURE__ */ jsxs9(Checks, { disabled, children: [
8877
- /* @__PURE__ */ jsx12("legend", { children: t.sidebarFields }),
8878
- fields.map((attr) => /* @__PURE__ */ jsxs9("label", { children: [
8879
- /* @__PURE__ */ jsx12(
9334
+ /* @__PURE__ */ jsxs10(Checks, { disabled, children: [
9335
+ /* @__PURE__ */ jsx13("legend", { children: t.sidebarFields }),
9336
+ fields.map((attr) => /* @__PURE__ */ jsxs10("label", { children: [
9337
+ /* @__PURE__ */ jsx13(
8880
9338
  "input",
8881
9339
  {
8882
9340
  type: "checkbox",
@@ -8888,11 +9346,11 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
8888
9346
  attr.name
8889
9347
  ] }, attr.name))
8890
9348
  ] }),
8891
- badItem(item) && /* @__PURE__ */ jsx12(Typography7, { role: "alert", variant: "pi", textColor: "danger600", children: t.sidebarInvalid })
9349
+ badItem(item) && /* @__PURE__ */ jsx13(Typography8, { role: "alert", variant: "pi", textColor: "danger600", children: t.sidebarInvalid })
8892
9350
  ] }, index)),
8893
- /* @__PURE__ */ jsxs9(Flex6, { gap: 2, alignItems: "center", children: [
8894
- /* @__PURE__ */ jsx12(
8895
- Button6,
9351
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 2, alignItems: "center", children: [
9352
+ /* @__PURE__ */ jsx13(
9353
+ Button7,
8896
9354
  {
8897
9355
  variant: "secondary",
8898
9356
  size: "S",
@@ -8902,7 +9360,7 @@ function SidebarEditor({ type, entry, set: set2, t, disabled, SelectField: Selec
8902
9360
  children: t.sidebarAdd
8903
9361
  }
8904
9362
  ),
8905
- items2.length >= SIDEBAR_MAX && /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.f("sidebarLimit", { max: SIDEBAR_MAX }) })
9363
+ items2.length >= SIDEBAR_MAX && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.f("sidebarLimit", { max: SIDEBAR_MAX }) })
8906
9364
  ] })
8907
9365
  ] });
8908
9366
  }
@@ -8911,18 +9369,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
8911
9369
  const t = useMessages();
8912
9370
  const { get, put, del } = useClient();
8913
9371
  const { canRead, canUpdate, isLoading } = usePermissions2();
8914
- const [data, setData] = React11.useState(null);
8915
- const [catalog, setCatalog] = React11.useState(null);
8916
- const [settings, setSettings] = React11.useState(null);
8917
- const [media, setMedia] = React11.useState({});
8918
- const [sources, setSources] = React11.useState({});
8919
- const [dirty, setDirty] = React11.useState(false);
8920
- const [saving, setSaving] = React11.useState(false);
8921
- const [status, setStatus] = React11.useState("");
8922
- const [failed, setFailed] = React11.useState(false);
8923
- const [filter, setFilter] = React11.useState("");
8924
- const [picking, setPicking] = React11.useState(null);
8925
- React11.useEffect(() => {
9372
+ const [data, setData] = React12.useState(null);
9373
+ const [catalog, setCatalog] = React12.useState(null);
9374
+ const [settings, setSettings] = React12.useState(null);
9375
+ const [media, setMedia] = React12.useState({});
9376
+ const [sources, setSources] = React12.useState({});
9377
+ const [dirty, setDirty] = React12.useState(false);
9378
+ const [saving, setSaving] = React12.useState(false);
9379
+ const [status, setStatus] = React12.useState("");
9380
+ const [failed, setFailed] = React12.useState(false);
9381
+ const [filter, setFilter] = React12.useState("");
9382
+ const [picking, setPicking] = React12.useState(null);
9383
+ React12.useEffect(() => {
8926
9384
  if (!canRead || isLoading) return;
8927
9385
  let active = true;
8928
9386
  Promise.all([get("/blockscene/settings"), get("/blockscene/catalog")]).then(([s, c]) => {
@@ -9000,36 +9458,36 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9000
9458
  return index === 0 && manual ? t.manual : t.automatic;
9001
9459
  };
9002
9460
  const ready = !isLoading && canRead && !failed && settings && catalog;
9003
- const header = React11.useRef(null);
9004
- const [floating, setFloating] = React11.useState(false);
9461
+ const header = React12.useRef(null);
9462
+ const [floating, setFloating] = React12.useState(false);
9005
9463
  const main = useMainRect2(header);
9006
- React11.useEffect(() => {
9464
+ React12.useEffect(() => {
9007
9465
  const el = header.current;
9008
9466
  if (!el || typeof IntersectionObserver === "undefined") return;
9009
9467
  const observer = new IntersectionObserver(([entry]) => setFloating(!entry.isIntersecting && entry.boundingClientRect.top < 0));
9010
9468
  observer.observe(el);
9011
9469
  return () => observer.disconnect();
9012
9470
  }, [ready]);
9013
- const controls = (suffix) => ready && /* @__PURE__ */ jsxs9(Flex6, { gap: 3, alignItems: "center", wrap: "wrap", children: [
9014
- /* @__PURE__ */ jsx12(Typography7, { role: "status", "aria-live": "polite", textColor: dirty ? "warning700" : "neutral600", "data-testid": `${dirty ? "unsaved-indicator" : "save-status"}${suffix}`, children: dirty ? t.unsaved : status || t.noChanges }),
9015
- !suffix && /* @__PURE__ */ jsx12(Button6, { variant: "tertiary", onClick: restore, disabled: !canUpdate || saving, "data-testid": "restore-blockscene-settings", children: data.projectDefaults ? t.restoreProject : t.resetAll }),
9016
- /* @__PURE__ */ jsx12(Button6, { onClick: save, disabled: !canUpdate || invalid || !dirty, loading: saving, "data-testid": `save-blockscene-settings${suffix}`, children: t.save })
9471
+ const controls = (suffix) => ready && /* @__PURE__ */ jsxs10(Flex7, { gap: 3, alignItems: "center", wrap: "wrap", children: [
9472
+ /* @__PURE__ */ jsx13(Typography8, { role: "status", "aria-live": "polite", textColor: dirty ? "warning700" : "neutral600", "data-testid": `${dirty ? "unsaved-indicator" : "save-status"}${suffix}`, children: dirty ? t.unsaved : status || t.noChanges }),
9473
+ !suffix && /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", onClick: restore, disabled: !canUpdate || saving, "data-testid": "restore-blockscene-settings", children: data.projectDefaults ? t.restoreProject : t.resetAll }),
9474
+ /* @__PURE__ */ jsx13(Button7, { onClick: save, disabled: !canUpdate || invalid || !dirty, loading: saving, "data-testid": `save-blockscene-settings${suffix}`, children: t.save })
9017
9475
  ] });
9018
- return /* @__PURE__ */ jsx12(Box6, { padding: 8, background: "neutral100", children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 5, children: [
9019
- /* @__PURE__ */ jsx12("div", { ref: header, children: /* @__PURE__ */ jsxs9(Flex6, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
9020
- /* @__PURE__ */ jsx12(Typography7, { variant: "alpha", tag: "h1", children: t.settingsTitle }),
9476
+ return /* @__PURE__ */ jsx13(Box7, { padding: 8, background: "neutral100", children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 5, children: [
9477
+ /* @__PURE__ */ jsx13("div", { ref: header, children: /* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
9478
+ /* @__PURE__ */ jsx13(Typography8, { variant: "alpha", tag: "h1", children: t.settingsTitle }),
9021
9479
  controls("")
9022
9480
  ] }) }),
9023
- floating && main.width > 0 && /* @__PURE__ */ jsx12(Bar, { style: { left: main.left, width: main.width }, "data-testid": "settings-floating-bar", children: /* @__PURE__ */ jsxs9(Flex6, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
9024
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "p", children: t.settingsTitle }),
9481
+ floating && main.width > 0 && /* @__PURE__ */ jsx13(Bar, { style: { left: main.left, width: main.width }, "data-testid": "settings-floating-bar", children: /* @__PURE__ */ jsxs10(Flex7, { gap: 4, alignItems: "center", justifyContent: "space-between", wrap: "wrap", children: [
9482
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "p", children: t.settingsTitle }),
9025
9483
  controls("-floating")
9026
9484
  ] }) }),
9027
- /* @__PURE__ */ jsx12(Typography7, { textColor: "neutral600", children: t.settingsIntro }),
9028
- isLoading ? /* @__PURE__ */ jsx12(Typography7, { children: "\u2026" }) : !canRead ? /* @__PURE__ */ jsx12(Typography7, { role: "alert", children: t.denied }) : failed ? /* @__PURE__ */ jsx12(Typography7, { role: "alert", children: t.loadFailed }) : !settings || !catalog ? /* @__PURE__ */ jsx12(Typography7, { children: t.loading }) : /* @__PURE__ */ jsxs9(Fragment9, { children: [
9029
- data.disabled && /* @__PURE__ */ jsx12(Box6, { padding: 4, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx12(Typography7, { role: "alert", textColor: "warning700", children: t.disabledByServer }) }),
9030
- /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, children: [
9031
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.palette }),
9032
- /* @__PURE__ */ jsx12(Swatches, { children: Object.keys(DEFAULT_PALETTE).map((key) => /* @__PURE__ */ jsx12(
9485
+ /* @__PURE__ */ jsx13(Typography8, { textColor: "neutral600", children: t.settingsIntro }),
9486
+ isLoading ? /* @__PURE__ */ jsx13(Typography8, { children: "\u2026" }) : !canRead ? /* @__PURE__ */ jsx13(Typography8, { role: "alert", children: t.denied }) : failed ? /* @__PURE__ */ jsx13(Typography8, { role: "alert", children: t.loadFailed }) : !settings || !catalog ? /* @__PURE__ */ jsx13(Typography8, { children: t.loading }) : /* @__PURE__ */ jsxs10(Fragment11, { children: [
9487
+ data.disabled && /* @__PURE__ */ jsx13(Box7, { padding: 4, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "warning700", children: t.disabledByServer }) }),
9488
+ /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
9489
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.palette }),
9490
+ /* @__PURE__ */ jsx13(Swatches, { children: Object.keys(DEFAULT_PALETTE).map((key) => /* @__PURE__ */ jsx13(
9033
9491
  ColorField,
9034
9492
  {
9035
9493
  name: `palette-${key}`,
@@ -9043,43 +9501,43 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9043
9501
  },
9044
9502
  key
9045
9503
  )) }),
9046
- badColor && /* @__PURE__ */ jsx12(Typography7, { role: "alert", textColor: "danger600", children: t.invalidColor }),
9047
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.previewLabel }),
9048
- /* @__PURE__ */ jsx12(Swatches, { "data-testid": "palette-preview", children: TEMPLATES.map((template) => /* @__PURE__ */ jsxs9(Flex6, { direction: "column", gap: 1, children: [
9049
- /* @__PURE__ */ jsx12(Box6, { style: { aspectRatio: "16 / 9", overflow: "hidden" }, hasRadius: true, children: /* @__PURE__ */ jsx12(Wireframe, { template, palette: settings.palette }) }),
9050
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.templates[template] })
9504
+ badColor && /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "danger600", children: t.invalidColor }),
9505
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewLabel }),
9506
+ /* @__PURE__ */ jsx13(Swatches, { "data-testid": "palette-preview", children: TEMPLATES.map((template) => /* @__PURE__ */ jsxs10(Flex7, { direction: "column", gap: 1, children: [
9507
+ /* @__PURE__ */ jsx13(Box7, { style: { aspectRatio: "16 / 9", overflow: "hidden" }, hasRadius: true, children: /* @__PURE__ */ jsx13(Wireframe, { template, palette: settings.palette }) }),
9508
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.templates[template] })
9051
9509
  ] }, template)) }),
9052
- /* @__PURE__ */ jsx12(Flex6, { children: /* @__PURE__ */ jsx12(Button6, { variant: "tertiary", size: "S", disabled: !canUpdate, onClick: () => update((s) => {
9510
+ /* @__PURE__ */ jsx13(Flex7, { children: /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", size: "S", disabled: !canUpdate, onClick: () => update((s) => {
9053
9511
  s.palette = { ...DEFAULT_PALETTE };
9054
9512
  return s;
9055
9513
  }), children: t.resetPalette }) })
9056
9514
  ] }) }),
9057
- /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, children: [
9058
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.editor }),
9059
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-enabled", label: t.enabled, value: editor.enabled, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9515
+ /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
9516
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.editor }),
9517
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-enabled", label: t.enabled, value: editor.enabled, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9060
9518
  s.editor.enabled = v;
9061
9519
  return s;
9062
9520
  }) }),
9063
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.enabledHelp }),
9064
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-showOpenAll", label: t.showOpenAll, value: editor.showOpenAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9521
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.enabledHelp }),
9522
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showOpenAll", label: t.showOpenAll, value: editor.showOpenAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9065
9523
  s.editor.showOpenAll = v;
9066
9524
  return s;
9067
9525
  }) }),
9068
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-showCloseAll", label: t.showCloseAll, value: editor.showCloseAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9526
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showCloseAll", label: t.showCloseAll, value: editor.showCloseAll, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9069
9527
  s.editor.showCloseAll = v;
9070
9528
  return s;
9071
9529
  }) }),
9072
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.toggleHelp }),
9073
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-showRowThumbnails", label: t.showRowThumbnails, value: editor.showRowThumbnails !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9530
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.toggleHelp }),
9531
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-showRowThumbnails", label: t.showRowThumbnails, value: editor.showRowThumbnails !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9074
9532
  s.editor.showRowThumbnails = v;
9075
9533
  return s;
9076
9534
  }) }),
9077
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-friendlyLabels", label: t.friendlyLabels, value: editor.friendlyLabels !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9535
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-friendlyLabels", label: t.friendlyLabels, value: editor.friendlyLabels !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9078
9536
  s.editor.friendlyLabels = v;
9079
9537
  return s;
9080
9538
  }) }),
9081
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.friendlyLabelsHelp }),
9082
- /* @__PURE__ */ jsx12(
9539
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.friendlyLabelsHelp }),
9540
+ /* @__PURE__ */ jsx13(
9083
9541
  SelectField2,
9084
9542
  {
9085
9543
  name: "editor-initialState",
@@ -9093,8 +9551,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9093
9551
  })
9094
9552
  }
9095
9553
  ),
9096
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.rememberHelp }),
9097
- /* @__PURE__ */ jsx12(
9554
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.rememberHelp }),
9555
+ /* @__PURE__ */ jsx13(
9098
9556
  TextField2,
9099
9557
  {
9100
9558
  name: "editor-blockPreviewUrl",
@@ -9108,8 +9566,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9108
9566
  })
9109
9567
  }
9110
9568
  ),
9111
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.blockPreviewUrlHelp }),
9112
- /* @__PURE__ */ jsx12(
9569
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.blockPreviewUrlHelp }),
9570
+ /* @__PURE__ */ jsx13(
9113
9571
  TextField2,
9114
9572
  {
9115
9573
  name: "editor-previewUrl",
@@ -9123,9 +9581,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9123
9581
  })
9124
9582
  }
9125
9583
  ),
9126
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.previewUrlHelp }),
9127
- !editor.previewUrl && /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "warning700", "data-testid": "preview-url-empty", children: t.previewUrlEmpty }),
9128
- /* @__PURE__ */ jsx12(
9584
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewUrlHelp }),
9585
+ !editor.previewUrl && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "warning700", "data-testid": "preview-url-empty", children: t.previewUrlEmpty }),
9586
+ /* @__PURE__ */ jsx13(
9129
9587
  SelectField2,
9130
9588
  {
9131
9589
  name: "editor-previewMode",
@@ -9139,12 +9597,13 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9139
9597
  })
9140
9598
  }
9141
9599
  ),
9142
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.previewModeHelp }),
9143
- /* @__PURE__ */ jsx12(Typography7, { variant: "delta", tag: "h3", children: t.paneTitle }),
9144
- /* @__PURE__ */ jsx12(
9600
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.previewModeHelp }),
9601
+ /* @__PURE__ */ jsx13(Typography8, { variant: "delta", tag: "h3", children: t.paneTitle }),
9602
+ /* @__PURE__ */ jsx13(
9145
9603
  PaneEditor,
9146
9604
  {
9147
9605
  id: "editor",
9606
+ versions: Boolean(data.historyTypes),
9148
9607
  toolbar: editor.previewToolbar || TOOLBAR2,
9149
9608
  devices: editor.previewDevices || DEVICE_NAMES,
9150
9609
  t,
@@ -9156,12 +9615,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9156
9615
  })
9157
9616
  }
9158
9617
  ),
9159
- lazyEditors && /* @__PURE__ */ jsxs9(Fragment9, { children: [
9160
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-lazyEditors", label: t.lazyEditors, value: editor.lazyEditors !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9618
+ lazyEditors && /* @__PURE__ */ jsxs10(Fragment11, { children: [
9619
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-lazyEditors", label: t.lazyEditors, value: editor.lazyEditors !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9161
9620
  s.editor.lazyEditors = v;
9162
9621
  return s;
9163
9622
  }) }),
9164
- /* @__PURE__ */ jsx12(
9623
+ /* @__PURE__ */ jsx13(
9165
9624
  UidListField,
9166
9625
  {
9167
9626
  TextField: TextField2,
@@ -9176,31 +9635,31 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9176
9635
  })
9177
9636
  }
9178
9637
  ),
9179
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: badLazy ? "danger600" : "neutral600", role: badLazy ? "alert" : void 0, children: badLazy ? t.f("lazyFieldsInvalid", { max: LAZY_MAX }) : t.lazyEditorsHelp }),
9180
- data.blockPreviewAvailable && /* @__PURE__ */ jsxs9(Fragment9, { children: [
9181
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-blockPreviewInForm", label: t.blockPreviewInForm, value: editor.blockPreviewInForm, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9638
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: badLazy ? "danger600" : "neutral600", role: badLazy ? "alert" : void 0, children: badLazy ? t.f("lazyFieldsInvalid", { max: LAZY_MAX }) : t.lazyEditorsHelp }),
9639
+ data.blockPreviewAvailable && /* @__PURE__ */ jsxs10(Fragment11, { children: [
9640
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-blockPreviewInForm", label: t.blockPreviewInForm, value: editor.blockPreviewInForm, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9182
9641
  s.editor.blockPreviewInForm = v;
9183
9642
  return s;
9184
9643
  }) }),
9185
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
9644
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.blockPreviewInFormHelp })
9186
9645
  ] })
9187
9646
  ] })
9188
9647
  ] }) }),
9189
- /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "row-actions-settings", children: [
9190
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.rowActionsTitle }),
9191
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-confirmDelete", label: t.confirmDeleteOption, value: editor.confirmDelete !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9648
+ /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "row-actions-settings", children: [
9649
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.rowActionsTitle }),
9650
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-confirmDelete", label: t.confirmDeleteOption, value: editor.confirmDelete !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9192
9651
  s.editor.confirmDelete = v;
9193
9652
  return s;
9194
9653
  }) }),
9195
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-duplicate", label: t.duplicateOption, value: editor.duplicate !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9654
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-duplicate", label: t.duplicateOption, value: editor.duplicate !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9196
9655
  s.editor.duplicate = v;
9197
9656
  return s;
9198
9657
  }) }),
9199
- /* @__PURE__ */ jsx12(ToggleField2, { name: "editor-clipboard", label: t.clipboardOption, value: editor.clipboard !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9658
+ /* @__PURE__ */ jsx13(ToggleField2, { name: "editor-clipboard", label: t.clipboardOption, value: editor.clipboard !== false, disabled: !canUpdate || saving, onChange: (v) => update((s) => {
9200
9659
  s.editor.clipboard = v;
9201
9660
  return s;
9202
9661
  }) }),
9203
- /* @__PURE__ */ jsx12(
9662
+ /* @__PURE__ */ jsx13(
9204
9663
  SelectField2,
9205
9664
  {
9206
9665
  name: "editor-hiddenBlocks",
@@ -9214,9 +9673,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9214
9673
  })
9215
9674
  }
9216
9675
  ),
9217
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: data.hiddenAttribute ? t.hiddenBlocksHelp : t.hiddenAttributeOff })
9676
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: data.hiddenAttribute ? t.hiddenBlocksHelp : t.hiddenAttributeOff })
9218
9677
  ] }) }),
9219
- data.historyTypes && settings.history && /* @__PURE__ */ jsx12(
9678
+ data.historyTypes && settings.history && /* @__PURE__ */ jsx13(
9220
9679
  HistorySettings,
9221
9680
  {
9222
9681
  types: data.historyTypes,
@@ -9231,9 +9690,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9231
9690
  })
9232
9691
  }
9233
9692
  ),
9234
- (data.contentTypes || []).length > 0 && /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "content-types", children: [
9235
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.contentTypes }),
9236
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: t.contentTypesHelp }),
9693
+ (data.contentTypes || []).length > 0 && /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, "data-testid": "content-types", children: [
9694
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.contentTypes }),
9695
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: t.contentTypesHelp }),
9237
9696
  data.contentTypes.map((type) => {
9238
9697
  const entry = settings.contentTypes?.[type.uid] || {};
9239
9698
  const set2 = (key, value, fallback) => update((s) => {
@@ -9245,9 +9704,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9245
9704
  else delete s.contentTypes[type.uid];
9246
9705
  return s;
9247
9706
  });
9248
- return /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, children: [
9249
- /* @__PURE__ */ jsxs9(Flex6, { gap: 6, alignItems: "flex-end", wrap: "wrap", "data-testid": `content-type-${type.uid}`, children: [
9250
- /* @__PURE__ */ jsx12(Box6, { style: { minWidth: 220 }, children: /* @__PURE__ */ jsx12(
9707
+ return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
9708
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 6, alignItems: "flex-end", wrap: "wrap", "data-testid": `content-type-${type.uid}`, children: [
9709
+ /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 220 }, children: /* @__PURE__ */ jsx13(
9251
9710
  ToggleField2,
9252
9711
  {
9253
9712
  name: `type-enabled-${type.uid}`,
@@ -9257,7 +9716,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9257
9716
  onChange: (v) => set2("enabled", v, true)
9258
9717
  }
9259
9718
  ) }),
9260
- /* @__PURE__ */ jsx12(Box6, { style: { minWidth: 240 }, children: /* @__PURE__ */ jsx12(
9719
+ /* @__PURE__ */ jsx13(Box7, { style: { minWidth: 240 }, children: /* @__PURE__ */ jsx13(
9261
9720
  SelectField2,
9262
9721
  {
9263
9722
  name: `type-mode-${type.uid}`,
@@ -9269,9 +9728,9 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9269
9728
  }
9270
9729
  ) })
9271
9730
  ] }),
9272
- entry.enabled !== false && /* @__PURE__ */ jsx12(SidebarEditor, { type, entry, set: set2, t, disabled: !canUpdate || saving, SelectField: SelectField2, TextField: TextField2 }),
9273
- entry.enabled !== false && /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, children: [
9274
- /* @__PURE__ */ jsx12(
9731
+ entry.enabled !== false && /* @__PURE__ */ jsx13(SidebarEditor, { type, entry, set: set2, t, disabled: !canUpdate || saving, SelectField: SelectField2, TextField: TextField2 }),
9732
+ entry.enabled !== false && /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 3, paddingLeft: 4, children: [
9733
+ /* @__PURE__ */ jsx13(
9275
9734
  ToggleField2,
9276
9735
  {
9277
9736
  name: `type-pane-${type.uid}`,
@@ -9284,10 +9743,11 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9284
9743
  }
9285
9744
  }
9286
9745
  ),
9287
- (entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ jsx12(
9746
+ (entry.previewToolbar || entry.previewDevices) && /* @__PURE__ */ jsx13(
9288
9747
  PaneEditor,
9289
9748
  {
9290
9749
  id: `type-${type.uid}`,
9750
+ versions: Boolean(data.historyTypes),
9291
9751
  toolbar: entry.previewToolbar || editor.previewToolbar || TOOLBAR2,
9292
9752
  devices: entry.previewDevices || editor.previewDevices || DEVICE_NAMES,
9293
9753
  t,
@@ -9299,18 +9759,18 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9299
9759
  ] })
9300
9760
  ] }, type.uid);
9301
9761
  }),
9302
- badSidebar && /* @__PURE__ */ jsx12(Typography7, { role: "alert", textColor: "danger600", children: t.sidebarInvalidSave })
9762
+ badSidebar && /* @__PURE__ */ jsx13(Typography8, { role: "alert", textColor: "danger600", children: t.sidebarInvalidSave })
9303
9763
  ] }) }),
9304
- /* @__PURE__ */ jsx12(Box6, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 4, children: [
9305
- /* @__PURE__ */ jsx12(Typography7, { variant: "beta", tag: "h2", children: t.components }),
9306
- /* @__PURE__ */ jsx12(Searchbar2, { name: "component-filter", value: filter, placeholder: t.filter, clearLabel: t.clear, onClear: () => setFilter(""), onChange: (e) => setFilter(e.target.value), children: t.filter }),
9307
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", "data-testid": "components-count", children: t.f("countAll", { count: components.length }) }),
9308
- /* @__PURE__ */ jsx12(Grid2, { "data-testid": "components-grid", children: components.map((component) => {
9764
+ /* @__PURE__ */ jsx13(Box7, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 4, children: [
9765
+ /* @__PURE__ */ jsx13(Typography8, { variant: "beta", tag: "h2", children: t.components }),
9766
+ /* @__PURE__ */ jsx13(Searchbar2, { name: "component-filter", value: filter, placeholder: t.filter, clearLabel: t.clear, onClear: () => setFilter(""), onChange: (e) => setFilter(e.target.value), children: t.filter }),
9767
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", "data-testid": "components-count", children: t.f("countAll", { count: components.length }) }),
9768
+ /* @__PURE__ */ jsx13(Grid2, { "data-testid": "components-grid", children: components.map((component) => {
9309
9769
  const entry = settings.components[component.uid] || {};
9310
9770
  const meta = { ...catalog.components?.[component.uid] || {}, ...media[component.uid] || {} };
9311
9771
  const candidates = candidatesFor(component.uid, meta, catalog);
9312
- return /* @__PURE__ */ jsxs9(Card2, { "data-testid": `settings-${component.uid}`, children: [
9313
- /* @__PURE__ */ jsx12(
9772
+ return /* @__PURE__ */ jsxs10(Card2, { "data-testid": `settings-${component.uid}`, children: [
9773
+ /* @__PURE__ */ jsx13(
9314
9774
  Thumb,
9315
9775
  {
9316
9776
  candidates,
@@ -9321,23 +9781,23 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9321
9781
  onResolved: (index) => setSources((current) => current[component.uid] === index ? current : { ...current, [component.uid]: index })
9322
9782
  }
9323
9783
  ),
9324
- /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "flex-start", gap: 2, children: [
9325
- /* @__PURE__ */ jsx12(Typography7, { fontWeight: "bold", textColor: "neutral800", children: component.displayName }),
9326
- /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "neutral600", children: [
9784
+ /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "flex-start", gap: 2, children: [
9785
+ /* @__PURE__ */ jsx13(Typography8, { fontWeight: "bold", textColor: "neutral800", children: component.displayName }),
9786
+ /* @__PURE__ */ jsxs10(Typography8, { variant: "pi", textColor: "neutral600", children: [
9327
9787
  component.uid,
9328
9788
  " \xB7 ",
9329
9789
  component.category
9330
9790
  ] }),
9331
- /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", "data-testid": `source-${component.uid}`, children: [
9791
+ /* @__PURE__ */ jsxs10(Typography8, { variant: "pi", "data-testid": `source-${component.uid}`, children: [
9332
9792
  t.source,
9333
9793
  ": ",
9334
9794
  sourceOf(component.uid, Boolean(meta.manualImage)),
9335
9795
  meta.manualName ? ` (${meta.manualName})` : ""
9336
9796
  ] }),
9337
- meta.manualMissing && /* @__PURE__ */ jsx12(Typography7, { variant: "pi", role: "alert", textColor: "danger600", children: t.brokenMedia }),
9338
- /* @__PURE__ */ jsxs9(Flex6, { gap: 2, wrap: "wrap", children: [
9339
- /* @__PURE__ */ jsx12(Button6, { variant: "secondary", size: "S", disabled: !canUpdate || saving, onClick: () => setPicking(component.uid), children: entry.mediaId ? t.replace : t.choose }),
9340
- entry.mediaId && /* @__PURE__ */ jsx12(Button6, { variant: "tertiary", size: "S", disabled: !canUpdate || saving, onClick: () => {
9797
+ meta.manualMissing && /* @__PURE__ */ jsx13(Typography8, { variant: "pi", role: "alert", textColor: "danger600", children: t.brokenMedia }),
9798
+ /* @__PURE__ */ jsxs10(Flex7, { gap: 2, wrap: "wrap", children: [
9799
+ /* @__PURE__ */ jsx13(Button7, { variant: "secondary", size: "S", disabled: !canUpdate || saving, onClick: () => setPicking(component.uid), children: entry.mediaId ? t.replace : t.choose }),
9800
+ entry.mediaId && /* @__PURE__ */ jsx13(Button7, { variant: "tertiary", size: "S", disabled: !canUpdate || saving, onClick: () => {
9341
9801
  update((s) => {
9342
9802
  delete s.components[component.uid]?.mediaId;
9343
9803
  if (!Object.keys(s.components[component.uid] || {}).length) delete s.components[component.uid];
@@ -9350,7 +9810,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9350
9810
  });
9351
9811
  }, children: t.useAutomatic })
9352
9812
  ] }),
9353
- /* @__PURE__ */ jsx12(
9813
+ /* @__PURE__ */ jsx13(
9354
9814
  SelectField2,
9355
9815
  {
9356
9816
  name: `template-${component.uid}`,
@@ -9364,7 +9824,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9364
9824
  })
9365
9825
  }
9366
9826
  ),
9367
- /* @__PURE__ */ jsx12(
9827
+ /* @__PURE__ */ jsx13(
9368
9828
  SelectField2,
9369
9829
  {
9370
9830
  name: `typology-${component.uid}`,
@@ -9375,7 +9835,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9375
9835
  onChange: (v) => setComponent(component.uid, "typology", v === "auto" ? void 0 : v)
9376
9836
  }
9377
9837
  ),
9378
- /* @__PURE__ */ jsx12(
9838
+ /* @__PURE__ */ jsx13(
9379
9839
  TagsField,
9380
9840
  {
9381
9841
  name: `tags-${component.uid}`,
@@ -9386,12 +9846,12 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9386
9846
  onChange: (tags) => setComponent(component.uid, "tags", tags.length ? tags : void 0)
9387
9847
  }
9388
9848
  ),
9389
- meta.variants?.length > 0 && /* @__PURE__ */ jsxs9(Typography7, { variant: "pi", textColor: "neutral600", "data-testid": `variants-${component.uid}`, children: [
9849
+ meta.variants?.length > 0 && /* @__PURE__ */ jsxs10(Typography8, { variant: "pi", textColor: "neutral600", "data-testid": `variants-${component.uid}`, children: [
9390
9850
  t.variantsFromCode,
9391
9851
  ": ",
9392
9852
  meta.variants.map((item) => localized(item.label, t.locale) || item.id).join(", ")
9393
9853
  ] }),
9394
- catalog.groups?.[component.uid] && /* @__PURE__ */ jsx12(
9854
+ catalog.groups?.[component.uid] && /* @__PURE__ */ jsx13(
9395
9855
  LayoutFields,
9396
9856
  {
9397
9857
  component,
@@ -9406,7 +9866,7 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9406
9866
  ] }, component.uid);
9407
9867
  }) })
9408
9868
  ] }) }),
9409
- picking && /* @__PURE__ */ jsx12(MediaPicker2, { onClose: () => setPicking(null), onSelect: (asset) => {
9869
+ picking && /* @__PURE__ */ jsx13(MediaPicker2, { onClose: () => setPicking(null), onSelect: (asset) => {
9410
9870
  const uid = picking;
9411
9871
  setPicking(null);
9412
9872
  if (!asset?.id) return;
@@ -9422,8 +9882,8 @@ function Settings({ useClient, usePermissions: usePermissions2, MediaPicker: Med
9422
9882
  function LayoutFields({ component, layout, set: set2, t, disabled, SelectField: SelectField2 }) {
9423
9883
  const fields = (component.layoutFields || []).map((name) => ({ value: name, label: name }));
9424
9884
  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)));
9425
- return /* @__PURE__ */ jsxs9(Flex6, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": `layout-${component.uid}`, style: { width: "100%" }, children: [
9426
- /* @__PURE__ */ jsx12(
9885
+ return /* @__PURE__ */ jsxs10(Flex7, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": `layout-${component.uid}`, style: { width: "100%" }, children: [
9886
+ /* @__PURE__ */ jsx13(
9427
9887
  SelectField2,
9428
9888
  {
9429
9889
  name: `layout-columns-${component.uid}`,
@@ -9434,8 +9894,8 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
9434
9894
  onChange: (v) => change("columnsField", v)
9435
9895
  }
9436
9896
  ),
9437
- layout?.columnsField && /* @__PURE__ */ jsxs9(Fragment9, { children: [
9438
- /* @__PURE__ */ jsx12(
9897
+ layout?.columnsField && /* @__PURE__ */ jsxs10(Fragment11, { children: [
9898
+ /* @__PURE__ */ jsx13(
9439
9899
  SelectField2,
9440
9900
  {
9441
9901
  name: `layout-mobile-${component.uid}`,
@@ -9446,7 +9906,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
9446
9906
  onChange: (v) => change("mobileColumnsField", v)
9447
9907
  }
9448
9908
  ),
9449
- /* @__PURE__ */ jsx12(
9909
+ /* @__PURE__ */ jsx13(
9450
9910
  SelectField2,
9451
9911
  {
9452
9912
  name: `layout-max-${component.uid}`,
@@ -9458,7 +9918,7 @@ function LayoutFields({ component, layout, set: set2, t, disabled, SelectField:
9458
9918
  }
9459
9919
  )
9460
9920
  ] }),
9461
- /* @__PURE__ */ jsx12(Typography7, { variant: "pi", textColor: "neutral600", children: fields.length ? t.layoutHelp : t.layoutNoFields })
9921
+ /* @__PURE__ */ jsx13(Typography8, { variant: "pi", textColor: "neutral600", children: fields.length ? t.layoutHelp : t.layoutNoFields })
9462
9922
  ] });
9463
9923
  }
9464
9924
  function register(app, Component2, to) {
@@ -9477,27 +9937,27 @@ function register(app, Component2, to) {
9477
9937
  }
9478
9938
 
9479
9939
  // admin/catalog.ts
9480
- import * as React13 from "react";
9940
+ import * as React14 from "react";
9481
9941
 
9482
9942
  // admin/FieldHelp.tsx
9483
- import * as React12 from "react";
9484
- import styled8 from "styled-components";
9485
- import { Flex as Flex7, Tooltip } from "@strapi/design-system";
9486
- import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
9487
- var HelpButton = styled8.button`
9943
+ import * as React13 from "react";
9944
+ import styled9 from "styled-components";
9945
+ import { Flex as Flex8, Tooltip } from "@strapi/design-system";
9946
+ import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
9947
+ var HelpButton = styled9.button`
9488
9948
  display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: help; color: inherit;
9489
9949
  &:hover, &:focus-visible { color: ${({ theme }) => theme.colors.primary600}; }
9490
9950
  &:focus-visible { outline: 2px solid ${({ theme }) => theme.colors.primary600}; outline-offset: 2px; }
9491
9951
  `;
9492
9952
  function FieldHelp({ text, previous, title }) {
9493
9953
  const m = useMessages();
9494
- const kept2 = React12.isValidElement(previous) && previous.props.title ? React12.cloneElement(previous, { title }) : previous;
9495
- return /* @__PURE__ */ jsxs10(Flex7, { gap: 1, alignItems: "center", children: [
9954
+ const kept2 = React13.isValidElement(previous) && previous.props.title ? React13.cloneElement(previous, { title }) : previous;
9955
+ return /* @__PURE__ */ jsxs11(Flex8, { gap: 1, alignItems: "center", children: [
9496
9956
  kept2,
9497
- /* @__PURE__ */ jsx13(Tooltip, { label: text, style: { maxWidth: 320 }, children: /* @__PURE__ */ jsx13(HelpButton, { type: "button", "aria-label": m.fieldHelp, children: /* @__PURE__ */ jsx13(Icon, { name: "info", size: 14 }) }) })
9957
+ /* @__PURE__ */ jsx14(Tooltip, { label: text, style: { maxWidth: 320 }, children: /* @__PURE__ */ jsx14(HelpButton, { type: "button", "aria-label": m.fieldHelp, children: /* @__PURE__ */ jsx14(Icon, { name: "info", size: 14 }) }) })
9498
9958
  ] });
9499
9959
  }
9500
- var helpAction = (text, previous) => /* @__PURE__ */ jsx13(FieldHelp, { text, previous, title: React12.isValidElement(previous) && previous.props.title || { id: "blockscene.fieldHelp" } });
9960
+ var helpAction = (text, previous) => /* @__PURE__ */ jsx14(FieldHelp, { text, previous, title: React13.isValidElement(previous) && previous.props.title || { id: "blockscene.fieldHelp" } });
9501
9961
 
9502
9962
  // admin/catalog.ts
9503
9963
  var cached = null;
@@ -9510,8 +9970,8 @@ var load = (get) => flight || (flight = get("/blockscene/catalog").then(({ data
9510
9970
  flight = null;
9511
9971
  }));
9512
9972
  function useCatalog(get) {
9513
- const [catalog, setCatalog] = React13.useState(null);
9514
- React13.useEffect(() => {
9973
+ const [catalog, setCatalog] = React14.useState(null);
9974
+ React14.useEffect(() => {
9515
9975
  let active = true;
9516
9976
  load(get).then((data) => {
9517
9977
  if (active) setCatalog(data);
@@ -9547,9 +10007,9 @@ var labelsHook = (get, relabel, drop) => (args) => {
9547
10007
  };
9548
10008
 
9549
10009
  // admin/LazyInput.tsx
9550
- import * as React14 from "react";
9551
- import { Field, Flex as Flex8, Typography as Typography8 } from "@strapi/design-system";
9552
- import styled9 from "styled-components";
10010
+ import * as React15 from "react";
10011
+ import { Field, Flex as Flex9, Typography as Typography9 } from "@strapi/design-system";
10012
+ import styled10 from "styled-components";
9553
10013
 
9554
10014
  // admin/sanitize.mjs
9555
10015
  var DROP = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "IFRAME", "FRAME", "OBJECT", "EMBED", "LINK", "META", "BASE", "FORM", "TEMPLATE", "NOSCRIPT"]);
@@ -9603,7 +10063,7 @@ function sanitizeHtml(html) {
9603
10063
  }
9604
10064
 
9605
10065
  // admin/LazyInput.tsx
9606
- import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
10066
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
9607
10067
  var config = { on: false, fields: [] };
9608
10068
  var listeners = /* @__PURE__ */ new Set();
9609
10069
  function setLazyConfig(next) {
@@ -9619,7 +10079,7 @@ var subscribe = (run) => {
9619
10079
  };
9620
10080
  var read2 = () => config;
9621
10081
  var lazyFor = (uid) => config.on && config.fields.includes(uid);
9622
- var Preview = styled9.div`
10082
+ var Preview = styled10.div`
9623
10083
  min-height: 240px; border: 1px solid ${({ theme }) => theme.colors.neutral200}; border-radius: 4px; overflow: hidden;
9624
10084
  background: ${({ theme, $disabled }) => $disabled ? theme.colors.neutral150 : theme.colors.neutral0};
9625
10085
  color: ${({ theme }) => theme.colors.neutral800}; font-size: 1.4rem; line-height: 1.5;
@@ -9638,14 +10098,14 @@ var Preview = styled9.div`
9638
10098
  `;
9639
10099
  function Placeholder({ name, label, hint, error, required, labelAction, placeholder, value, disabled, onActivate }) {
9640
10100
  const t = useMessages();
9641
- const html = React14.useMemo(() => typeof value === "string" ? sanitizeHtml(value) : value == null ? "" : null, [value]);
10101
+ const html = React15.useMemo(() => typeof value === "string" ? sanitizeHtml(value) : value == null ? "" : null, [value]);
9642
10102
  const activate = disabled ? void 0 : (event) => {
9643
10103
  event.preventDefault();
9644
10104
  onActivate();
9645
10105
  };
9646
- return /* @__PURE__ */ jsx14(Field.Root, { id: name, name, error, hint, required, children: /* @__PURE__ */ jsxs11(Flex8, { direction: "column", alignItems: "stretch", gap: 1, children: [
9647
- /* @__PURE__ */ jsx14(Field.Label, { action: labelAction, children: label }),
9648
- /* @__PURE__ */ jsxs11(
10106
+ return /* @__PURE__ */ jsx15(Field.Root, { id: name, name, error, hint, required, children: /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 1, children: [
10107
+ /* @__PURE__ */ jsx15(Field.Label, { action: labelAction, children: label }),
10108
+ /* @__PURE__ */ jsxs12(
9649
10109
  Preview,
9650
10110
  {
9651
10111
  id: name,
@@ -9661,22 +10121,22 @@ function Placeholder({ name, label, hint, error, required, labelAction, placehol
9661
10121
  if (e.key === "Enter" || e.key === " ") activate?.(e);
9662
10122
  },
9663
10123
  children: [
9664
- /* @__PURE__ */ jsx14("div", { "data-bar": true, children: /* @__PURE__ */ jsx14(Typography8, { variant: "pi", textColor: "neutral500", children: disabled ? "" : t.lazyEdit }) }),
9665
- html === null ? /* @__PURE__ */ jsx14("div", { "data-body": true, children: JSON.stringify(value) }) : html ? /* @__PURE__ */ jsx14("div", { "data-body": true, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx14("div", { "data-body": true, children: /* @__PURE__ */ jsx14(Typography8, { textColor: "neutral500", children: placeholder || "" }) })
10124
+ /* @__PURE__ */ jsx15("div", { "data-bar": true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "neutral500", children: disabled ? "" : t.lazyEdit }) }),
10125
+ html === null ? /* @__PURE__ */ jsx15("div", { "data-body": true, children: JSON.stringify(value) }) : html ? /* @__PURE__ */ jsx15("div", { "data-body": true, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx15("div", { "data-body": true, children: /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral500", children: placeholder || "" }) })
9666
10126
  ]
9667
10127
  }
9668
10128
  ),
9669
- /* @__PURE__ */ jsx14(Field.Hint, {}),
9670
- /* @__PURE__ */ jsx14(Field.Error, {})
10129
+ /* @__PURE__ */ jsx15(Field.Hint, {}),
10130
+ /* @__PURE__ */ jsx15(Field.Error, {})
9671
10131
  ] }) });
9672
10132
  }
9673
10133
  function lazyInput(uid, Real) {
9674
- const Lazy = React14.forwardRef((props, ref) => {
9675
- React14.useSyncExternalStore(subscribe, read2);
9676
- const [active, setActive] = React14.useState(() => !lazyFor(uid));
9677
- const box = React14.useRef(null);
9678
- const focus = React14.useRef(false);
9679
- React14.useEffect(() => {
10134
+ const Lazy = React15.forwardRef((props, ref) => {
10135
+ React15.useSyncExternalStore(subscribe, read2);
10136
+ const [active, setActive] = React15.useState(() => !lazyFor(uid));
10137
+ const box = React15.useRef(null);
10138
+ const focus = React15.useRef(false);
10139
+ React15.useEffect(() => {
9680
10140
  if (!active || !focus.current) return;
9681
10141
  focus.current = false;
9682
10142
  let frame2 = 0;
@@ -9689,7 +10149,7 @@ function lazyInput(uid, Real) {
9689
10149
  poll();
9690
10150
  return () => cancelAnimationFrame(frame2);
9691
10151
  }, [active]);
9692
- return /* @__PURE__ */ jsx14("div", { ref: box, style: { display: "contents" }, children: active || !lazyFor(uid) ? /* @__PURE__ */ jsx14(Real, { ...props, ref }) : /* @__PURE__ */ jsx14(Placeholder, { ...props, onActivate: () => {
10152
+ return /* @__PURE__ */ jsx15("div", { ref: box, style: { display: "contents" }, children: active || !lazyFor(uid) ? /* @__PURE__ */ jsx15(Real, { ...props, ref }) : /* @__PURE__ */ jsx15(Placeholder, { ...props, onActivate: () => {
9693
10153
  focus.current = true;
9694
10154
  setActive(true);
9695
10155
  } }) });
@@ -9709,17 +10169,17 @@ function wrapCustomFields(app) {
9709
10169
  }
9710
10170
 
9711
10171
  // admin/Activity.tsx
9712
- import * as React15 from "react";
10172
+ import * as React16 from "react";
9713
10173
  import {
9714
- Box as Box7,
9715
- Button as Button7,
10174
+ Box as Box8,
10175
+ Button as Button8,
9716
10176
  Dialog,
9717
10177
  Field as Field2,
9718
- Flex as Flex9,
10178
+ Flex as Flex10,
9719
10179
  Link,
9720
10180
  Modal,
9721
- SingleSelect,
9722
- SingleSelectOption,
10181
+ SingleSelect as SingleSelect2,
10182
+ SingleSelectOption as SingleSelectOption2,
9723
10183
  Switch,
9724
10184
  Table,
9725
10185
  Tabs,
@@ -9729,17 +10189,17 @@ import {
9729
10189
  Th,
9730
10190
  Thead,
9731
10191
  Tr,
9732
- Typography as Typography9
10192
+ Typography as Typography10
9733
10193
  } from "@strapi/design-system";
9734
- import { Layouts, Page, useFetchClient as useFetchClient2, useNotification as useNotification2, useRBAC as useRBAC2 } from "@strapi/strapi/admin";
9735
- import { Fragment as Fragment11, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
10194
+ import { Layouts, Page, useFetchClient as useFetchClient2, useNotification as useNotification2, useRBAC as useRBAC3 } from "@strapi/strapi/admin";
10195
+ import { Fragment as Fragment13, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
9736
10196
  var ACTIVITY = [{ action: "plugin::blockscene.activity.read", subject: null }];
9737
10197
  var TRASH = ["read", "restore", "purge"].map((name) => ({ action: `plugin::blockscene.trash.${name}`, subject: null }));
9738
10198
  var ACTIONS = ["create", "update", "publish", "unpublish", "discard", "delete", "restore", "purge"];
9739
10199
  var DAY = 24 * 60 * 60 * 1e3;
9740
10200
  var contentMenuLink = (Component2) => ({
9741
10201
  to: "plugins/blockscene",
9742
- icon: () => /* @__PURE__ */ jsx15(Icon, { name: "clock", size: 20 }),
10202
+ icon: () => /* @__PURE__ */ jsx16(Icon, { name: "clock", size: 20 }),
9743
10203
  intlLabel: { id: "blockscene.contentMenu", defaultMessage: "Activity and trash" },
9744
10204
  permissions: [...ACTIVITY, TRASH[0]],
9745
10205
  // Not an `async` function: Strapi 5 warns on AsyncFunction loaders.
@@ -9758,29 +10218,29 @@ var editUrl = (type, documentId, locale) => {
9758
10218
  return `${base}/content-manager/${kind}/${type.uid}${kind === "single-types" ? "" : `/${encodeURIComponent(documentId)}`}${locale ? `?plugins[i18n][locale]=${encodeURIComponent(locale)}` : ""}`;
9759
10219
  };
9760
10220
  var query = (params) => new URLSearchParams(Object.entries(params).filter(([, v]) => v !== "" && v != null).map(([k, v]) => [k, String(v)])).toString();
9761
- var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ jsx15(Box7, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsxs12(Field2.Root, { name, children: [
9762
- /* @__PURE__ */ jsx15(Field2.Label, { children: label }),
9763
- /* @__PURE__ */ jsx15(SingleSelect, { value, onChange: (v) => onChange(String(v)), children: options.map((o) => /* @__PURE__ */ jsx15(SingleSelectOption, { value: o.value, children: o.label }, o.value)) })
10221
+ var Select = ({ label, value, onChange, options, name }) => /* @__PURE__ */ jsx16(Box8, { style: { minWidth: 180 }, children: /* @__PURE__ */ jsxs13(Field2.Root, { name, children: [
10222
+ /* @__PURE__ */ jsx16(Field2.Label, { children: label }),
10223
+ /* @__PURE__ */ jsx16(SingleSelect2, { value, onChange: (v) => onChange(String(v)), children: options.map((o) => /* @__PURE__ */ jsx16(SingleSelectOption2, { value: o.value, children: o.label }, o.value)) })
9764
10224
  ] }) });
9765
- var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ jsx15(Box7, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsxs12(Field2.Root, { name, children: [
9766
- /* @__PURE__ */ jsx15(Field2.Label, { children: label }),
9767
- /* @__PURE__ */ jsx15(TextInput, { name, type, value, onChange: (e) => onChange(e.target.value) })
10225
+ var Input = ({ label, value, onChange, name, type = "text" }) => /* @__PURE__ */ jsx16(Box8, { style: { minWidth: 160 }, children: /* @__PURE__ */ jsxs13(Field2.Root, { name, children: [
10226
+ /* @__PURE__ */ jsx16(Field2.Label, { children: label }),
10227
+ /* @__PURE__ */ jsx16(TextInput, { name, type, value, onChange: (e) => onChange(e.target.value) })
9768
10228
  ] }) });
9769
10229
  function Pager({ t, pagination, setPage }) {
9770
10230
  if (!pagination?.total) return null;
9771
10231
  const { page, pageCount, total } = pagination;
9772
- return /* @__PURE__ */ jsxs12(Flex9, { justifyContent: "space-between", alignItems: "center", paddingTop: 4, children: [
9773
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "neutral600", children: t.f("contentPage", { page, pages: Math.max(pageCount, 1), total }) }),
9774
- /* @__PURE__ */ jsxs12(Flex9, { gap: 2, children: [
9775
- /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", size: "S", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.contentPrevious }),
9776
- /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", size: "S", disabled: page >= pageCount, onClick: () => setPage(page + 1), children: t.contentNext })
10232
+ return /* @__PURE__ */ jsxs13(Flex10, { justifyContent: "space-between", alignItems: "center", paddingTop: 4, children: [
10233
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: t.f("contentPage", { page, pages: Math.max(pageCount, 1), total }) }),
10234
+ /* @__PURE__ */ jsxs13(Flex10, { gap: 2, children: [
10235
+ /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", disabled: page <= 1, onClick: () => setPage(page - 1), children: t.contentPrevious }),
10236
+ /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", disabled: page >= pageCount, onClick: () => setPage(page + 1), children: t.contentNext })
9777
10237
  ] })
9778
10238
  ] });
9779
10239
  }
9780
10240
  function useList(get, path, params, refresh = 0) {
9781
- const [state, setState] = React15.useState({ data: null, failed: false });
10241
+ const [state, setState] = React16.useState({ data: null, failed: false });
9782
10242
  const key = `${path}?${query(params)}`;
9783
- React15.useEffect(() => {
10243
+ React16.useEffect(() => {
9784
10244
  let active = true;
9785
10245
  setState((s) => ({ data: s.data, failed: false, loading: true }));
9786
10246
  get(`/blockscene${key}`).then(({ data }) => active && setState({ data, failed: false })).catch(() => active && setState({ data: null, failed: true }));
@@ -9792,9 +10252,9 @@ function useList(get, path, params, refresh = 0) {
9792
10252
  }
9793
10253
  var Doc = ({ t, type, row, documentId, locale }) => {
9794
10254
  const title = row.title || t.contentUntitled;
9795
- return /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "flex-start", gap: 1, children: [
9796
- row.exists && type ? /* @__PURE__ */ jsx15(Link, { href: editUrl(type, documentId, locale), children: title }) : /* @__PURE__ */ jsx15(Typography9, { fontWeight: "bold", children: title }),
9797
- /* @__PURE__ */ jsxs12(Typography9, { variant: "pi", textColor: "neutral600", children: [
10255
+ return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 1, children: [
10256
+ row.exists && type ? /* @__PURE__ */ jsx16(Link, { href: editUrl(type, documentId, locale), children: title }) : /* @__PURE__ */ jsx16(Typography10, { fontWeight: "bold", children: title }),
10257
+ /* @__PURE__ */ jsxs13(Typography10, { variant: "pi", textColor: "neutral600", children: [
9798
10258
  type?.displayName || row.contentType,
9799
10259
  locale ? ` \xB7 ${locale}` : "",
9800
10260
  row.exists === false ? ` \xB7 ${t.contentGone}` : ""
@@ -9802,9 +10262,9 @@ var Doc = ({ t, type, row, documentId, locale }) => {
9802
10262
  ] });
9803
10263
  };
9804
10264
  function ActivityTab({ t, get }) {
9805
- const [filters, setFilters] = React15.useState({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
9806
- const [search, setSearch] = React15.useState("");
9807
- const [page, setPage] = React15.useState(1);
10265
+ const [filters, setFilters] = React16.useState({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
10266
+ const [search, setSearch] = React16.useState("");
10267
+ const [page, setPage] = React16.useState(1);
9808
10268
  const set2 = (key, value) => {
9809
10269
  setFilters((f) => ({ ...f, [key]: value }));
9810
10270
  setPage(1);
@@ -9816,13 +10276,13 @@ function ActivityTab({ t, get }) {
9816
10276
  };
9817
10277
  const { data, failed } = useList(get, "/activity", { ...filters, from: day(filters.from, false), to: day(filters.to, true), page, pageSize: 25 });
9818
10278
  const types = new Map((data?.types || []).map((type) => [type.uid, type]));
9819
- return /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 4, children: [
9820
- data && !data.enabled && /* @__PURE__ */ jsx15(Box7, { padding: 3, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "warning700", children: t.contentOff }) }),
9821
- /* @__PURE__ */ jsxs12(Flex9, { tag: "form", gap: 3, wrap: "wrap", alignItems: "flex-end", onSubmit: (e) => {
10279
+ return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 4, children: [
10280
+ data && !data.enabled && /* @__PURE__ */ jsx16(Box8, { padding: 3, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "warning700", children: t.contentOff }) }),
10281
+ /* @__PURE__ */ jsxs13(Flex10, { tag: "form", gap: 3, wrap: "wrap", alignItems: "flex-end", onSubmit: (e) => {
9822
10282
  e.preventDefault();
9823
10283
  set2("q", search.trim());
9824
10284
  }, children: [
9825
- /* @__PURE__ */ jsx15(
10285
+ /* @__PURE__ */ jsx16(
9826
10286
  Select,
9827
10287
  {
9828
10288
  name: "actor",
@@ -9832,7 +10292,7 @@ function ActivityTab({ t, get }) {
9832
10292
  options: [{ value: "", label: t.activityAnyone }, ...(data?.actors || []).map((a) => ({ value: a.actor, label: a.actorName || (a.actor === "system" ? t.historySystem : a.actor) }))]
9833
10293
  }
9834
10294
  ),
9835
- /* @__PURE__ */ jsx15(
10295
+ /* @__PURE__ */ jsx16(
9836
10296
  Select,
9837
10297
  {
9838
10298
  name: "contentType",
@@ -9842,7 +10302,7 @@ function ActivityTab({ t, get }) {
9842
10302
  options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
9843
10303
  }
9844
10304
  ),
9845
- /* @__PURE__ */ jsx15(
10305
+ /* @__PURE__ */ jsx16(
9846
10306
  Select,
9847
10307
  {
9848
10308
  name: "action",
@@ -9852,35 +10312,35 @@ function ActivityTab({ t, get }) {
9852
10312
  options: [{ value: "", label: t.activityAnyAction }, ...ACTIONS.map((a) => ({ value: a, label: t.historyActions[a] || a }))]
9853
10313
  }
9854
10314
  ),
9855
- /* @__PURE__ */ jsx15(Input, { name: "from", type: "date", label: t.activityFrom, value: filters.from, onChange: (v) => set2("from", v) }),
9856
- /* @__PURE__ */ jsx15(Input, { name: "to", type: "date", label: t.activityTo, value: filters.to, onChange: (v) => set2("to", v) }),
9857
- /* @__PURE__ */ jsx15(Input, { name: "q", label: t.activitySearch, value: search, onChange: setSearch }),
9858
- /* @__PURE__ */ jsx15(Button7, { type: "submit", variant: "secondary", children: t.activitySearchButton }),
9859
- /* @__PURE__ */ jsx15(Button7, { type: "button", variant: "tertiary", onClick: () => {
10315
+ /* @__PURE__ */ jsx16(Input, { name: "from", type: "date", label: t.activityFrom, value: filters.from, onChange: (v) => set2("from", v) }),
10316
+ /* @__PURE__ */ jsx16(Input, { name: "to", type: "date", label: t.activityTo, value: filters.to, onChange: (v) => set2("to", v) }),
10317
+ /* @__PURE__ */ jsx16(Input, { name: "q", label: t.activitySearch, value: search, onChange: setSearch }),
10318
+ /* @__PURE__ */ jsx16(Button8, { type: "submit", variant: "secondary", children: t.activitySearchButton }),
10319
+ /* @__PURE__ */ jsx16(Button8, { type: "button", variant: "tertiary", onClick: () => {
9860
10320
  setSearch("");
9861
10321
  setFilters({ actor: "", contentType: "", action: "", from: "", to: "", q: "" });
9862
10322
  setPage(1);
9863
10323
  }, children: t.contentClear })
9864
10324
  ] }),
9865
- failed ? /* @__PURE__ */ jsx15(Typography9, { role: "alert", textColor: "danger600", children: t.activityFailed }) : !data ? /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral600", children: t.activityEmpty }) : /* @__PURE__ */ jsxs12(Box7, { children: [
9866
- /* @__PURE__ */ jsxs12(Table, { colCount: 4, rowCount: data.results.length + 1, "data-testid": "blockscene-activity", children: [
9867
- /* @__PURE__ */ jsx15(Thead, { children: /* @__PURE__ */ jsxs12(Tr, { children: [
9868
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.activityWhen }) }),
9869
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.activityDocument }) }),
9870
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.activityWho }) }),
9871
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.activityWhat }) })
10325
+ failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.activityFailed }) : !data ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.activityEmpty }) : /* @__PURE__ */ jsxs13(Box8, { children: [
10326
+ /* @__PURE__ */ jsxs13(Table, { colCount: 4, rowCount: data.results.length + 1, "data-testid": "blockscene-activity", children: [
10327
+ /* @__PURE__ */ jsx16(Thead, { children: /* @__PURE__ */ jsxs13(Tr, { children: [
10328
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWhen }) }),
10329
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityDocument }) }),
10330
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWho }) }),
10331
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityWhat }) })
9872
10332
  ] }) }),
9873
- /* @__PURE__ */ jsx15(Tbody, { children: data.results.map((event) => /* @__PURE__ */ jsxs12(Tr, { "data-testid": `activity-${event.id}`, children: [
9874
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: when(t, event.at) }) }),
9875
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsx15(Doc, { t, type: types.get(event.contentType), row: event, documentId: event.relatedDocumentId, locale: event.locale }) }),
9876
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: event.actorName || (event.actor === "system" ? t.historySystem : event.actor) }) }),
9877
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "flex-start", gap: 1, children: [
9878
- /* @__PURE__ */ jsx15(Typography9, { variant: "omega", fontWeight: "bold", children: t.historyActions[event.action] || event.action }),
9879
- /* @__PURE__ */ jsx15(Typography9, { 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 ") })
10333
+ /* @__PURE__ */ jsx16(Tbody, { children: data.results.map((event) => /* @__PURE__ */ jsxs13(Tr, { "data-testid": `activity-${event.id}`, children: [
10334
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: when(t, event.at) }) }),
10335
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Doc, { t, type: types.get(event.contentType), row: event, documentId: event.relatedDocumentId, locale: event.locale }) }),
10336
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: event.actorName || (event.actor === "system" ? t.historySystem : event.actor) }) }),
10337
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 1, children: [
10338
+ /* @__PURE__ */ jsx16(Typography10, { variant: "omega", fontWeight: "bold", children: t.historyActions[event.action] || event.action }),
10339
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: event.summary?.missing ? "warning700" : "neutral700", children: ["delete", "purge"].includes(event.action) ? "" : [event.summary?.restoredFrom ? t.activityRestoredFrom : "", summaryText(t, event.summary)].filter(Boolean).join(" \xB7 ") })
9880
10340
  ] }) })
9881
10341
  ] }, event.id)) })
9882
10342
  ] }),
9883
- /* @__PURE__ */ jsx15(Pager, { t, pagination: data.pagination, setPage })
10343
+ /* @__PURE__ */ jsx16(Pager, { t, pagination: data.pagination, setPage })
9884
10344
  ] })
9885
10345
  ] });
9886
10346
  }
@@ -9889,57 +10349,57 @@ function Report({ t, report }) {
9889
10349
  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(", ") });
9890
10350
  const incoming = report.incoming && (report.incoming.reconnect || report.incoming.gone || report.incoming.replaced || report.incoming.published) ? [{ code: "incoming", ...report.incoming }] : [];
9891
10351
  const warnings = [...report.warnings || [], ...incoming];
9892
- return /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": "restore-report", children: [
9893
- report.blocking?.length > 0 && /* @__PURE__ */ jsxs12(Box7, { padding: 3, background: "danger100", hasRadius: true, children: [
9894
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", fontWeight: "bold", textColor: "danger700", children: t.restoreBlocked }),
9895
- /* @__PURE__ */ jsx15("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: report.blocking.map((item, i) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "danger700", children: line(item) }) }, i)) })
10352
+ return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 2, "data-testid": "restore-report", children: [
10353
+ report.blocking?.length > 0 && /* @__PURE__ */ jsxs13(Box8, { padding: 3, background: "danger100", hasRadius: true, children: [
10354
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", textColor: "danger700", children: t.restoreBlocked }),
10355
+ /* @__PURE__ */ jsx16("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: report.blocking.map((item, i) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "danger700", children: line(item) }) }, i)) })
9896
10356
  ] }),
9897
- warnings.length > 0 && /* @__PURE__ */ jsxs12(Box7, { padding: 3, background: "warning100", hasRadius: true, children: [
9898
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", fontWeight: "bold", textColor: "warning700", children: t.restoreWarnings }),
9899
- /* @__PURE__ */ jsx15("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: warnings.map((item, i) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "warning700", children: line(item) }) }, i)) })
10357
+ warnings.length > 0 && /* @__PURE__ */ jsxs13(Box8, { padding: 3, background: "warning100", hasRadius: true, children: [
10358
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", textColor: "warning700", children: t.restoreWarnings }),
10359
+ /* @__PURE__ */ jsx16("ul", { style: { margin: "4px 0 0", paddingLeft: 16 }, children: warnings.map((item, i) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "warning700", children: line(item) }) }, i)) })
9900
10360
  ] })
9901
10361
  ] });
9902
10362
  }
9903
10363
  function Preview2({ t, id, get, onClose }) {
9904
- const [row, setRow] = React15.useState(null);
9905
- const [failed, setFailed] = React15.useState(false);
9906
- React15.useEffect(() => {
10364
+ const [row, setRow] = React16.useState(null);
10365
+ const [failed, setFailed] = React16.useState(false);
10366
+ React16.useEffect(() => {
9907
10367
  get(`/blockscene/trash/${id}`).then(({ data }) => setRow(data)).catch(() => setFailed(true));
9908
10368
  }, [get, id]);
9909
- return /* @__PURE__ */ jsx15(Modal.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs12(Modal.Content, { style: { width: "min(900px, 92vw)" }, children: [
9910
- /* @__PURE__ */ jsx15(Modal.Header, { children: /* @__PURE__ */ jsx15(Modal.Title, { children: row?.title || t.trashPreview }) }),
9911
- /* @__PURE__ */ jsx15(Modal.Body, { children: failed ? /* @__PURE__ */ jsx15(Typography9, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !row ? /* @__PURE__ */ jsx15(Typography9, { children: t.contentLoading }) : /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 5, "data-testid": "trash-preview", children: [
9912
- row.incoming > 0 && /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "neutral600", children: t.f("trashIncoming", { count: row.incoming }) }),
9913
- row.entries.map((entry, i) => /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 2, children: [
9914
- /* @__PURE__ */ jsxs12(Typography9, { variant: "delta", tag: "h3", children: [
10369
+ return /* @__PURE__ */ jsx16(Modal.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(Modal.Content, { style: { width: "min(900px, 92vw)" }, children: [
10370
+ /* @__PURE__ */ jsx16(Modal.Header, { children: /* @__PURE__ */ jsx16(Modal.Title, { children: row?.title || t.trashPreview }) }),
10371
+ /* @__PURE__ */ jsx16(Modal.Body, { children: failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !row ? /* @__PURE__ */ jsx16(Typography10, { children: t.contentLoading }) : /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 5, "data-testid": "trash-preview", children: [
10372
+ row.incoming > 0 && /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: t.f("trashIncoming", { count: row.incoming }) }),
10373
+ row.entries.map((entry, i) => /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 2, children: [
10374
+ /* @__PURE__ */ jsxs13(Typography10, { variant: "delta", tag: "h3", children: [
9915
10375
  entry.locale || t.contentNone,
9916
10376
  entry.status ? ` \xB7 ${entry.status === "published" ? t.trashPublished : t.trashDraft}` : ""
9917
10377
  ] }),
9918
- /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", textColor: "neutral600", children: t.trashFields }),
9919
- /* @__PURE__ */ jsx15("dl", { style: { display: "grid", gridTemplateColumns: "minmax(120px, max-content) 1fr", gap: "4px 16px", margin: 0 }, children: entry.fields.map((field) => /* @__PURE__ */ jsxs12(React15.Fragment, { children: [
9920
- /* @__PURE__ */ jsx15("dt", { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", fontWeight: "bold", children: field.name }) }),
9921
- /* @__PURE__ */ jsx15("dd", { style: { margin: 0, wordBreak: "break-word" }, children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: field.count !== void 0 ? t.f("trashItems", { count: field.count }) : field.value }) })
10378
+ /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", textColor: "neutral600", children: t.trashFields }),
10379
+ /* @__PURE__ */ jsx16("dl", { style: { display: "grid", gridTemplateColumns: "minmax(120px, max-content) 1fr", gap: "4px 16px", margin: 0 }, children: entry.fields.map((field) => /* @__PURE__ */ jsxs13(React16.Fragment, { children: [
10380
+ /* @__PURE__ */ jsx16("dt", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", fontWeight: "bold", children: field.name }) }),
10381
+ /* @__PURE__ */ jsx16("dd", { style: { margin: 0, wordBreak: "break-word" }, children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: field.count !== void 0 ? t.f("trashItems", { count: field.count }) : field.value }) })
9922
10382
  ] }, field.name)) }),
9923
- entry.blocks.length > 0 && /* @__PURE__ */ jsxs12(Fragment11, { children: [
9924
- /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", textColor: "neutral600", children: t.trashBlocks }),
9925
- /* @__PURE__ */ jsx15("ol", { style: { margin: 0, paddingLeft: 20 }, children: entry.blocks.map((block, j) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: block.name }) }, j)) })
10383
+ entry.blocks.length > 0 && /* @__PURE__ */ jsxs13(Fragment13, { children: [
10384
+ /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", textColor: "neutral600", children: t.trashBlocks }),
10385
+ /* @__PURE__ */ jsx16("ol", { style: { margin: 0, paddingLeft: 20 }, children: entry.blocks.map((block, j) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: block.name }) }, j)) })
9926
10386
  ] })
9927
10387
  ] }, i))
9928
10388
  ] }) }),
9929
- /* @__PURE__ */ jsx15(Modal.Footer, { children: /* @__PURE__ */ jsx15(Modal.Close, { children: /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", children: t.trashClose }) }) })
10389
+ /* @__PURE__ */ jsx16(Modal.Footer, { children: /* @__PURE__ */ jsx16(Modal.Close, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", children: t.trashClose }) }) })
9930
10390
  ] }) });
9931
10391
  }
9932
10392
  function TrashTab({ t, get, post, del, can }) {
9933
10393
  const { toggleNotification } = useNotification2();
9934
- const [contentType, setType] = React15.useState("");
9935
- const [restored, setRestored] = React15.useState(false);
9936
- const [page, setPage] = React15.useState(1);
9937
- const [refresh, reload] = React15.useReducer((n) => n + 1, 0);
10394
+ const [contentType, setType] = React16.useState("");
10395
+ const [restored, setRestored] = React16.useState(false);
10396
+ const [page, setPage] = React16.useState(1);
10397
+ const [refresh, reload] = React16.useReducer((n) => n + 1, 0);
9938
10398
  const { data, failed } = useList(get, "/trash", { contentType, status: restored ? "restored" : "trashed", page, pageSize: 20 }, refresh);
9939
- const [preview, setPreview] = React15.useState(null);
9940
- const [restore, setRestore] = React15.useState(null);
9941
- const [remove, setRemove] = React15.useState(null);
9942
- const [busy, setBusy] = React15.useState(false);
10399
+ const [preview, setPreview] = React16.useState(null);
10400
+ const [restore, setRestore] = React16.useState(null);
10401
+ const [remove, setRemove] = React16.useState(null);
10402
+ const [busy, setBusy] = React16.useState(false);
9943
10403
  const types = new Map((data?.types || []).map((type) => [type.uid, type]));
9944
10404
  const title = (row) => row.title || t.contentUntitled;
9945
10405
  const check = async (row) => {
@@ -9985,9 +10445,9 @@ function TrashTab({ t, get, post, del, can }) {
9985
10445
  const days = Math.floor((new Date(at).getTime() - Date.now()) / DAY);
9986
10446
  return days < 1 ? t.trashExpiresToday : t.f("trashExpiresIn", { days });
9987
10447
  };
9988
- return /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "stretch", gap: 4, children: [
9989
- /* @__PURE__ */ jsxs12(Flex9, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
9990
- /* @__PURE__ */ jsx15(
10448
+ return /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 4, children: [
10449
+ /* @__PURE__ */ jsxs13(Flex10, { gap: 4, wrap: "wrap", alignItems: "flex-end", children: [
10450
+ /* @__PURE__ */ jsx16(
9991
10451
  Select,
9992
10452
  {
9993
10453
  name: "trash-type",
@@ -10000,70 +10460,70 @@ function TrashTab({ t, get, post, del, can }) {
10000
10460
  options: [{ value: "", label: t.activityAnyType }, ...(data?.types || []).map((type) => ({ value: type.uid, label: type.displayName }))]
10001
10461
  }
10002
10462
  ),
10003
- /* @__PURE__ */ jsxs12(Flex9, { gap: 2, paddingBottom: 2, children: [
10004
- /* @__PURE__ */ jsx15(Switch, { "aria-label": t.trashShowRestored, checked: restored, onCheckedChange: (v) => {
10463
+ /* @__PURE__ */ jsxs13(Flex10, { gap: 2, paddingBottom: 2, children: [
10464
+ /* @__PURE__ */ jsx16(Switch, { "aria-label": t.trashShowRestored, checked: restored, onCheckedChange: (v) => {
10005
10465
  setRestored(v);
10006
10466
  setPage(1);
10007
10467
  } }),
10008
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: t.trashShowRestored })
10468
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: t.trashShowRestored })
10009
10469
  ] })
10010
10470
  ] }),
10011
- failed ? /* @__PURE__ */ jsx15(Typography9, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !data ? /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx15(Typography9, { textColor: "neutral600", children: t.trashEmpty }) : /* @__PURE__ */ jsxs12(Box7, { children: [
10012
- /* @__PURE__ */ jsxs12(Table, { colCount: 5, rowCount: data.results.length + 1, "data-testid": "blockscene-trash", children: [
10013
- /* @__PURE__ */ jsx15(Thead, { children: /* @__PURE__ */ jsxs12(Tr, { children: [
10014
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.activityDocument }) }),
10015
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.trashLocales }) }),
10016
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: t.trashDeletedBy }) }),
10017
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: restored ? t.trashRestoredAs : t.trashExpires }) }),
10018
- /* @__PURE__ */ jsx15(Th, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "sigma", children: " " }) })
10471
+ failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.trashFailed }) : !data ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.contentLoading }) : !data.results.length ? /* @__PURE__ */ jsx16(Typography10, { textColor: "neutral600", children: t.trashEmpty }) : /* @__PURE__ */ jsxs13(Box8, { children: [
10472
+ /* @__PURE__ */ jsxs13(Table, { colCount: 5, rowCount: data.results.length + 1, "data-testid": "blockscene-trash", children: [
10473
+ /* @__PURE__ */ jsx16(Thead, { children: /* @__PURE__ */ jsxs13(Tr, { children: [
10474
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.activityDocument }) }),
10475
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.trashLocales }) }),
10476
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: t.trashDeletedBy }) }),
10477
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: restored ? t.trashRestoredAs : t.trashExpires }) }),
10478
+ /* @__PURE__ */ jsx16(Th, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "sigma", children: " " }) })
10019
10479
  ] }) }),
10020
- /* @__PURE__ */ jsx15(Tbody, { children: data.results.map((row) => /* @__PURE__ */ jsxs12(Tr, { "data-testid": `trash-${row.id}`, children: [
10021
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsx15(Doc, { t, type: types.get(row.contentType), row: { ...row, exists: void 0 }, documentId: row.relatedDocumentId, locale: null }) }),
10022
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: (row.locales || []).map((l) => l ?? t.contentNone).join(", ") }) }),
10023
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "flex-start", children: [
10024
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: row.actorName || (row.actor === "system" ? t.historySystem : row.actor) }),
10025
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", textColor: "neutral600", children: when(t, row.deletedAt) })
10480
+ /* @__PURE__ */ jsx16(Tbody, { children: data.results.map((row) => /* @__PURE__ */ jsxs13(Tr, { "data-testid": `trash-${row.id}`, children: [
10481
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Doc, { t, type: types.get(row.contentType), row: { ...row, exists: void 0 }, documentId: row.relatedDocumentId, locale: null }) }),
10482
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: (row.locales || []).map((l) => l ?? t.contentNone).join(", ") }) }),
10483
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", children: [
10484
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: row.actorName || (row.actor === "system" ? t.historySystem : row.actor) }),
10485
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", textColor: "neutral600", children: when(t, row.deletedAt) })
10026
10486
  ] }) }),
10027
- /* @__PURE__ */ jsxs12(Td, { children: [
10028
- /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: restored ? row.restoredAt ? when(t, row.restoredAt) : "" : expires(row.expiresAt) }),
10029
- restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */ jsx15(Box7, { children: /* @__PURE__ */ jsx15(Link, { href: editUrl(types.get(row.contentType), row.restoredAs, null), children: t.contentOpen }) })
10487
+ /* @__PURE__ */ jsxs13(Td, { children: [
10488
+ /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: restored ? row.restoredAt ? when(t, row.restoredAt) : "" : expires(row.expiresAt) }),
10489
+ restored && row.restoredAs && types.get(row.contentType) && /* @__PURE__ */ jsx16(Box8, { children: /* @__PURE__ */ jsx16(Link, { href: editUrl(types.get(row.contentType), row.restoredAs, null), children: t.contentOpen }) })
10030
10490
  ] }),
10031
- /* @__PURE__ */ jsx15(Td, { children: /* @__PURE__ */ jsxs12(Flex9, { gap: 2, justifyContent: "flex-end", children: [
10032
- /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", size: "S", onClick: () => setPreview(row.id), children: t.trashPreview }),
10033
- !restored && can.canRestore && /* @__PURE__ */ jsx15(Button7, { variant: "secondary", size: "S", onClick: () => check(row), "data-testid": `trash-restore-${row.id}`, children: t.trashRestore }),
10034
- can.canPurge && /* @__PURE__ */ jsx15(Button7, { variant: "danger-light", size: "S", onClick: () => setRemove(row), "data-testid": `trash-delete-${row.id}`, children: t.trashDelete })
10491
+ /* @__PURE__ */ jsx16(Td, { children: /* @__PURE__ */ jsxs13(Flex10, { gap: 2, justifyContent: "flex-end", children: [
10492
+ /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", size: "S", onClick: () => setPreview(row.id), children: t.trashPreview }),
10493
+ !restored && can.canRestore && /* @__PURE__ */ jsx16(Button8, { variant: "secondary", size: "S", onClick: () => check(row), "data-testid": `trash-restore-${row.id}`, children: t.trashRestore }),
10494
+ can.canPurge && /* @__PURE__ */ jsx16(Button8, { variant: "danger-light", size: "S", onClick: () => setRemove(row), "data-testid": `trash-delete-${row.id}`, children: t.trashDelete })
10035
10495
  ] }) })
10036
10496
  ] }, row.id)) })
10037
10497
  ] }),
10038
- /* @__PURE__ */ jsx15(Pager, { t, pagination: data.pagination, setPage })
10498
+ /* @__PURE__ */ jsx16(Pager, { t, pagination: data.pagination, setPage })
10039
10499
  ] }),
10040
- preview !== null && /* @__PURE__ */ jsx15(Preview2, { t, id: preview, get, onClose: () => setPreview(null) }),
10041
- restore && /* @__PURE__ */ jsx15(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRestore(null), children: /* @__PURE__ */ jsxs12(Dialog.Content, { children: [
10042
- /* @__PURE__ */ jsx15(Dialog.Header, { children: t.f("restoreTitle", { title: title(restore.row) }) }),
10043
- /* @__PURE__ */ jsx15(Dialog.Body, { children: /* @__PURE__ */ jsx15(Flex9, { direction: "column", alignItems: "stretch", gap: 3, width: "100%", children: restore.done ? /* @__PURE__ */ jsxs12(Flex9, { direction: "column", alignItems: "flex-start", gap: 2, role: "status", "data-testid": "restore-done", children: [
10044
- /* @__PURE__ */ jsx15(Typography9, { textColor: "success700", children: restore.done.already ? t.restoreAlready : t.restoreDone }),
10045
- restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ jsx15(Link, { href: editUrl(types.get(restore.row.contentType), restore.done.documentId, restore.done.locales?.[0] ?? null), children: t.restoreOpen }),
10046
- !restore.done.already && /* @__PURE__ */ jsx15(Report, { t, report: { warnings: restore.done.warnings, incoming: restore.done.incoming && { ...restore.done.incoming, reconnect: restore.done.incoming.reconnected } } })
10047
- ] }) : !restore.report ? /* @__PURE__ */ jsx15(Typography9, { children: t.restoreChecking }) : restore.failed ? /* @__PURE__ */ jsx15(Typography9, { role: "alert", textColor: "danger600", children: t.restoreFailed }) : /* @__PURE__ */ jsxs12(Fragment11, { children: [
10048
- /* @__PURE__ */ jsxs12(Typography9, { variant: "pi", children: [
10500
+ preview !== null && /* @__PURE__ */ jsx16(Preview2, { t, id: preview, get, onClose: () => setPreview(null) }),
10501
+ restore && /* @__PURE__ */ jsx16(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRestore(null), children: /* @__PURE__ */ jsxs13(Dialog.Content, { children: [
10502
+ /* @__PURE__ */ jsx16(Dialog.Header, { children: t.f("restoreTitle", { title: title(restore.row) }) }),
10503
+ /* @__PURE__ */ jsx16(Dialog.Body, { children: /* @__PURE__ */ jsx16(Flex10, { direction: "column", alignItems: "stretch", gap: 3, width: "100%", children: restore.done ? /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "flex-start", gap: 2, role: "status", "data-testid": "restore-done", children: [
10504
+ /* @__PURE__ */ jsx16(Typography10, { textColor: "success700", children: restore.done.already ? t.restoreAlready : t.restoreDone }),
10505
+ restore.done.documentId && types.get(restore.row.contentType) && /* @__PURE__ */ jsx16(Link, { href: editUrl(types.get(restore.row.contentType), restore.done.documentId, restore.done.locales?.[0] ?? null), children: t.restoreOpen }),
10506
+ !restore.done.already && /* @__PURE__ */ jsx16(Report, { t, report: { warnings: restore.done.warnings, incoming: restore.done.incoming && { ...restore.done.incoming, reconnect: restore.done.incoming.reconnected } } })
10507
+ ] }) : !restore.report ? /* @__PURE__ */ jsx16(Typography10, { children: t.restoreChecking }) : restore.failed ? /* @__PURE__ */ jsx16(Typography10, { role: "alert", textColor: "danger600", children: t.restoreFailed }) : /* @__PURE__ */ jsxs13(Fragment13, { children: [
10508
+ /* @__PURE__ */ jsxs13(Typography10, { variant: "pi", children: [
10049
10509
  t.restoreIntro,
10050
10510
  " ",
10051
10511
  restore.report.documentId ? t.restoreInto : t.restoreNew
10052
10512
  ] }),
10053
- restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ jsx15(Typography9, { variant: "pi", children: t.f("restoreLocales", { locales: restore.report.locales.join(", ") }) }),
10054
- /* @__PURE__ */ jsx15(Report, { t, report: restore.report })
10513
+ restore.report.locales?.length > 0 && restore.report.locales[0] !== null && /* @__PURE__ */ jsx16(Typography10, { variant: "pi", children: t.f("restoreLocales", { locales: restore.report.locales.join(", ") }) }),
10514
+ /* @__PURE__ */ jsx16(Report, { t, report: restore.report })
10055
10515
  ] }) }) }),
10056
- /* @__PURE__ */ jsxs12(Dialog.Footer, { children: [
10057
- /* @__PURE__ */ jsx15(Dialog.Cancel, { children: /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", disabled: busy, children: restore.done ? t.trashClose : t.restoreCancel }) }),
10058
- !restore.done && /* @__PURE__ */ jsx15(Button7, { onClick: confirmRestore, loading: busy, disabled: busy || !restore.report || restore.failed || restore.report.blocking?.length > 0, "data-testid": "restore-confirm", children: t.restoreConfirm })
10516
+ /* @__PURE__ */ jsxs13(Dialog.Footer, { children: [
10517
+ /* @__PURE__ */ jsx16(Dialog.Cancel, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", disabled: busy, children: restore.done ? t.trashClose : t.restoreCancel }) }),
10518
+ !restore.done && /* @__PURE__ */ jsx16(Button8, { onClick: confirmRestore, loading: busy, disabled: busy || !restore.report || restore.failed || restore.report.blocking?.length > 0, "data-testid": "restore-confirm", children: t.restoreConfirm })
10059
10519
  ] })
10060
10520
  ] }) }),
10061
- remove && /* @__PURE__ */ jsx15(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRemove(null), children: /* @__PURE__ */ jsxs12(Dialog.Content, { children: [
10062
- /* @__PURE__ */ jsx15(Dialog.Header, { children: t.trashDeleteTitle }),
10063
- /* @__PURE__ */ jsx15(Dialog.Body, { children: /* @__PURE__ */ jsx15(Typography9, { children: t.f("trashDeleteConfirm", { title: title(remove) }) }) }),
10064
- /* @__PURE__ */ jsxs12(Dialog.Footer, { children: [
10065
- /* @__PURE__ */ jsx15(Dialog.Cancel, { children: /* @__PURE__ */ jsx15(Button7, { variant: "tertiary", disabled: busy, children: t.restoreCancel }) }),
10066
- /* @__PURE__ */ jsx15(Button7, { variant: "danger", onClick: confirmRemove, loading: busy, disabled: busy, "data-testid": "delete-confirm", children: t.trashDelete })
10521
+ remove && /* @__PURE__ */ jsx16(Dialog.Root, { open: true, onOpenChange: (open) => !open && !busy && setRemove(null), children: /* @__PURE__ */ jsxs13(Dialog.Content, { children: [
10522
+ /* @__PURE__ */ jsx16(Dialog.Header, { children: t.trashDeleteTitle }),
10523
+ /* @__PURE__ */ jsx16(Dialog.Body, { children: /* @__PURE__ */ jsx16(Typography10, { children: t.f("trashDeleteConfirm", { title: title(remove) }) }) }),
10524
+ /* @__PURE__ */ jsxs13(Dialog.Footer, { children: [
10525
+ /* @__PURE__ */ jsx16(Dialog.Cancel, { children: /* @__PURE__ */ jsx16(Button8, { variant: "tertiary", disabled: busy, children: t.restoreCancel }) }),
10526
+ /* @__PURE__ */ jsx16(Button8, { variant: "danger", onClick: confirmRemove, loading: busy, disabled: busy, "data-testid": "delete-confirm", children: t.trashDelete })
10067
10527
  ] })
10068
10528
  ] }) })
10069
10529
  ] });
@@ -10071,37 +10531,92 @@ function TrashTab({ t, get, post, del, can }) {
10071
10531
  function ContentPage() {
10072
10532
  const t = useMessages();
10073
10533
  const { get, post, del } = useFetchClient2();
10074
- const activity = useRBAC2(ACTIVITY);
10075
- const trash = useRBAC2(TRASH);
10076
- const [tab, setTab] = React15.useState(null);
10077
- if (activity.isLoading || trash.isLoading) return /* @__PURE__ */ jsx15(Page.Loading, {});
10534
+ const activity = useRBAC3(ACTIVITY);
10535
+ const trash = useRBAC3(TRASH);
10536
+ const [tab, setTab] = React16.useState(null);
10537
+ if (activity.isLoading || trash.isLoading) return /* @__PURE__ */ jsx16(Page.Loading, {});
10078
10538
  const canActivity = Boolean(activity.allowedActions?.canRead), canTrash = Boolean(trash.allowedActions?.canRead);
10079
- if (!canActivity && !canTrash) return /* @__PURE__ */ jsx15(Page.NoPermissions, {});
10539
+ if (!canActivity && !canTrash) return /* @__PURE__ */ jsx16(Page.NoPermissions, {});
10080
10540
  const current = tab || (canActivity ? "activity" : "trash");
10081
- return /* @__PURE__ */ jsxs12(Page.Main, { children: [
10082
- /* @__PURE__ */ jsx15(Page.Title, { children: t.contentTitle }),
10083
- /* @__PURE__ */ jsx15(Layouts.Header, { title: t.contentTitle, subtitle: t.contentSubtitle }),
10084
- /* @__PURE__ */ jsx15(Layouts.Content, { children: /* @__PURE__ */ jsxs12(Tabs.Root, { value: current, onValueChange: setTab, children: [
10085
- /* @__PURE__ */ jsxs12(Tabs.List, { "aria-label": t.contentTitle, children: [
10086
- canActivity && /* @__PURE__ */ jsx15(Tabs.Trigger, { value: "activity", children: t.activityTab }),
10087
- canTrash && /* @__PURE__ */ jsx15(Tabs.Trigger, { value: "trash", children: t.trashTab })
10541
+ return /* @__PURE__ */ jsxs13(Page.Main, { children: [
10542
+ /* @__PURE__ */ jsx16(Page.Title, { children: t.contentTitle }),
10543
+ /* @__PURE__ */ jsx16(Layouts.Header, { title: t.contentTitle, subtitle: t.contentSubtitle }),
10544
+ /* @__PURE__ */ jsx16(Layouts.Content, { children: /* @__PURE__ */ jsxs13(Tabs.Root, { value: current, onValueChange: setTab, children: [
10545
+ /* @__PURE__ */ jsxs13(Tabs.List, { "aria-label": t.contentTitle, children: [
10546
+ canActivity && /* @__PURE__ */ jsx16(Tabs.Trigger, { value: "activity", children: t.activityTab }),
10547
+ canTrash && /* @__PURE__ */ jsx16(Tabs.Trigger, { value: "trash", children: t.trashTab })
10088
10548
  ] }),
10089
- /* @__PURE__ */ jsxs12(Box7, { paddingTop: 6, paddingBottom: 6, background: "neutral0", hasRadius: true, paddingLeft: 6, paddingRight: 6, marginTop: 4, children: [
10090
- canActivity && /* @__PURE__ */ jsx15(Tabs.Content, { value: "activity", children: /* @__PURE__ */ jsx15(ActivityTab, { t, get }) }),
10091
- canTrash && /* @__PURE__ */ jsx15(Tabs.Content, { value: "trash", children: /* @__PURE__ */ jsx15(TrashTab, { t, get, post, del, can: trash.allowedActions }) })
10549
+ /* @__PURE__ */ jsxs13(Box8, { paddingTop: 6, paddingBottom: 6, background: "neutral0", hasRadius: true, paddingLeft: 6, paddingRight: 6, marginTop: 4, children: [
10550
+ canActivity && /* @__PURE__ */ jsx16(Tabs.Content, { value: "activity", children: /* @__PURE__ */ jsx16(ActivityTab, { t, get }) }),
10551
+ canTrash && /* @__PURE__ */ jsx16(Tabs.Content, { value: "trash", children: /* @__PURE__ */ jsx16(TrashTab, { t, get, post, del, can: trash.allowedActions }) })
10092
10552
  ] })
10093
10553
  ] }) })
10094
10554
  ] });
10095
10555
  }
10096
10556
 
10557
+ // admin/StarterKits.tsx
10558
+ import * as React17 from "react";
10559
+ import { Box as Box9, Button as Button9, Flex as Flex11, Typography as Typography11 } from "@strapi/design-system";
10560
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
10561
+ var marker = (docKey) => {
10562
+ try {
10563
+ const entry = window.history.state?.key ?? window.history.state?.idx ?? "route";
10564
+ return `blockscene:starter-kit:${entry}:${docKey}`;
10565
+ } catch {
10566
+ return `blockscene:starter-kit:${docKey}`;
10567
+ }
10568
+ };
10569
+ var wasHandled = (key) => {
10570
+ try {
10571
+ return window.sessionStorage.getItem(key) === "handled";
10572
+ } catch {
10573
+ return false;
10574
+ }
10575
+ };
10576
+ var remember2 = (key) => {
10577
+ try {
10578
+ window.sessionStorage.setItem(key, "handled");
10579
+ } catch {
10580
+ }
10581
+ };
10582
+ function StarterKits({ creating, kits, zones, components, form, Modal: Modal3, docKey }) {
10583
+ const t = useMessages();
10584
+ const key = marker(docKey);
10585
+ const handled = React17.useRef({ key, value: wasHandled(key) });
10586
+ if (handled.current.key !== key) handled.current = { key, value: wasHandled(key) };
10587
+ const usable = starterKitsForLocale(kits, form?.locale).filter((kit) => Object.keys(kit.zones || {}).every((name) => zones.some((zone) => zone.name === name)));
10588
+ const available = creating && form && !handled.current.value && usable.length > 0 && zones.length > 0 && zones.every((zone) => form.rows(zone.name).length === 0);
10589
+ const [open, setOpen] = React17.useState(available);
10590
+ React17.useEffect(() => {
10591
+ if (available) setOpen(true);
10592
+ }, [available, key]);
10593
+ if (!available) return null;
10594
+ const finish = () => {
10595
+ handled.current.value = true;
10596
+ remember2(key);
10597
+ setOpen(false);
10598
+ };
10599
+ const apply = (kit) => {
10600
+ const rows = starterKitRows(kit, zones, components, form);
10601
+ if (!rows) return;
10602
+ for (const [zone, value] of Object.entries(rows)) form.setRows(zone, value);
10603
+ finish();
10604
+ };
10605
+ return /* @__PURE__ */ jsx17(Modal3, { open, onOpenChange: (next) => next ? setOpen(true) : finish(), title: t.starterKits, width: "560px", children: /* @__PURE__ */ jsxs14(Flex11, { direction: "column", alignItems: "stretch", gap: 3, children: [
10606
+ /* @__PURE__ */ jsx17(Typography11, { textColor: "neutral600", children: t.starterKitsHelp }),
10607
+ usable.map((kit) => /* @__PURE__ */ jsx17(Button9, { variant: "secondary", fullWidth: true, onClick: () => apply(kit), "data-testid": `starter-kit-${kit.id}`, children: localized(kit.label, t.locale) }, kit.id)),
10608
+ /* @__PURE__ */ jsx17(Box9, { paddingTop: 1, children: /* @__PURE__ */ jsx17(Button9, { variant: "tertiary", onClick: finish, children: t.startBlank }) })
10609
+ ] }) });
10610
+ }
10611
+
10097
10612
  // admin/strapi5.tsx
10098
- import { Fragment as Fragment12, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
10613
+ import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
10099
10614
  function Modal2({ open, onOpenChange, trigger, title, children, width = "80vw" }) {
10100
- return /* @__PURE__ */ jsxs13(Dialog2.Root, { open, onOpenChange, children: [
10101
- trigger && /* @__PURE__ */ jsx16(Dialog2.Trigger, { children: trigger }),
10102
- /* @__PURE__ */ jsxs13(Dialog2.Content, { style: { width, maxWidth: "92vw" }, children: [
10103
- /* @__PURE__ */ jsx16(Dialog2.Header, { children: /* @__PURE__ */ jsx16(Dialog2.Title, { children: title }) }),
10104
- /* @__PURE__ */ jsx16(Dialog2.Body, { children })
10615
+ return /* @__PURE__ */ jsxs15(Dialog2.Root, { open, onOpenChange, children: [
10616
+ trigger && /* @__PURE__ */ jsx18(Dialog2.Trigger, { children: trigger }),
10617
+ /* @__PURE__ */ jsxs15(Dialog2.Content, { style: { width, maxWidth: "92vw" }, children: [
10618
+ /* @__PURE__ */ jsx18(Dialog2.Header, { children: /* @__PURE__ */ jsx18(Dialog2.Title, { children: title }) }),
10619
+ /* @__PURE__ */ jsx18(Dialog2.Body, { children })
10105
10620
  ] })
10106
10621
  ] });
10107
10622
  }
@@ -10119,7 +10634,7 @@ function useRowForm(c, values, get) {
10119
10634
  const onChange = useForm3("Blockscene", (state) => state.onChange);
10120
10635
  const errors = useForm3("Blockscene", (state) => state.errors);
10121
10636
  const { toggleNotification } = useNotification3();
10122
- const latest = React16.useRef(values);
10637
+ const latest = React18.useRef(values);
10123
10638
  latest.current = values;
10124
10639
  const locale = c.form?.initialValues?.locale || void 0;
10125
10640
  if (typeof onChange !== "function") return null;
@@ -10163,8 +10678,8 @@ function useScope() {
10163
10678
  const history = !creating && Boolean(c.id) && Boolean(catalog?.history?.contentTypes?.includes(c.model));
10164
10679
  return { c, rbac, get, put, formValues, catalog, creating, zones, typeSettings, gallery, history };
10165
10680
  }
10166
- var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ jsx16(Box8, { "data-testid": testid, children: /* @__PURE__ */ jsx16(SimpleMenu2, { variant: "tertiary", size: "S", "aria-label": label, title: label, endIcon: null, label: /* @__PURE__ */ jsx16(Icon, { name: "more", size: 16 }), children: items2.map((item) => /* @__PURE__ */ jsx16(MenuItem2, { onSelect: item.onSelect, "data-testid": item.testid, children: /* @__PURE__ */ jsxs13(Flex10, { gap: 2, alignItems: "center", children: [
10167
- /* @__PURE__ */ jsx16(Icon, { name: item.icon, size: 16 }),
10681
+ var Menu2 = ({ label, testid, items: items2 }) => /* @__PURE__ */ jsx18(Box10, { "data-testid": testid, children: /* @__PURE__ */ jsx18(SimpleMenu2, { variant: "tertiary", size: "S", "aria-label": label, title: label, endIcon: null, label: /* @__PURE__ */ jsx18(Icon, { name: "more", size: 16 }), children: items2.map((item) => /* @__PURE__ */ jsx18(MenuItem2, { onSelect: item.onSelect, "data-testid": item.testid, children: /* @__PURE__ */ jsxs15(Flex12, { gap: 2, alignItems: "center", children: [
10682
+ /* @__PURE__ */ jsx18(Icon, { name: item.icon, size: 16 }),
10168
10683
  item.label
10169
10684
  ] }) }, item.testid)) }) });
10170
10685
  function Editor() {
@@ -10172,13 +10687,13 @@ function Editor() {
10172
10687
  const { catalog, typeSettings, gallery } = scope;
10173
10688
  const lazy = Boolean(catalog?.editor?.enabled && catalog.editor.lazyEditors !== false && typeSettings.enabled !== false);
10174
10689
  const lazyFields = (catalog?.editor?.lazyFields || []).join(",");
10175
- React16.useEffect(() => {
10690
+ React18.useEffect(() => {
10176
10691
  if (catalog) setLazyConfig({ on: lazy, fields: lazyFields ? lazyFields.split(",") : [] });
10177
10692
  }, [catalog, lazy, lazyFields]);
10178
- const kept2 = React16.useRef(false);
10693
+ const kept2 = React18.useRef(false);
10179
10694
  if (!scope.c.isLoading) kept2.current = gallery;
10180
10695
  if (!kept2.current) return null;
10181
- return /* @__PURE__ */ jsx16(Guard, { children: /* @__PURE__ */ jsx16("div", { hidden: true, "data-blockscene-editor": "", children: /* @__PURE__ */ jsx16(Workspace, { scope }) }) });
10696
+ return /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18("div", { hidden: true, "data-blockscene-editor": "", children: /* @__PURE__ */ jsx18(Workspace, { scope }) }) });
10182
10697
  }
10183
10698
  function Workspace({ scope }) {
10184
10699
  const { c, get, put, formValues, catalog, creating, zones, typeSettings } = scope;
@@ -10194,6 +10709,8 @@ function Workspace({ scope }) {
10194
10709
  };
10195
10710
  const host = usePreviewHost5();
10196
10711
  const state = useEditorState(editor, host);
10712
+ const versions = useVersions(host, catalog?.history);
10713
+ const docKey = `${c.model}:${creating ? "new" : c.id}:${c.form?.initialValues?.locale || ""}`;
10197
10714
  const add = (zone, uid, preset) => {
10198
10715
  const values = formValues ?? c.form.values;
10199
10716
  const close = catalog?.groups?.[uid];
@@ -10211,8 +10728,9 @@ function Workspace({ scope }) {
10211
10728
  if (close) c.form.addFieldRow(zone.name, { __component: close }, at + 1);
10212
10729
  return true;
10213
10730
  };
10214
- return /* @__PURE__ */ jsxs13(Fragment12, { children: [
10215
- /* @__PURE__ */ jsx16(
10731
+ return /* @__PURE__ */ jsxs15(Fragment14, { children: [
10732
+ /* @__PURE__ */ jsx18(StarterKits, { creating, kits: catalog.kits?.[c.model], zones, components: c.components, form, Modal: Modal2, docKey }),
10733
+ /* @__PURE__ */ jsx18(
10216
10734
  Gallery,
10217
10735
  {
10218
10736
  zones,
@@ -10225,18 +10743,19 @@ function Workspace({ scope }) {
10225
10743
  put,
10226
10744
  editor: catalog.editor,
10227
10745
  catalog,
10228
- docKey: `${c.model}:${creating ? "new" : c.id}:${c.form?.initialValues?.locale || ""}`,
10746
+ docKey,
10229
10747
  contentType: c.model,
10230
10748
  userId: user?.id,
10231
10749
  form,
10232
- zoneTools: /* @__PURE__ */ jsx16(ZoneBarTools, { state }),
10750
+ zoneTools: /* @__PURE__ */ jsx18(ZoneBarTools, { state }),
10233
10751
  openBlock: state.openBlock,
10234
10752
  openInsert: state.openInsert
10235
10753
  }
10236
10754
  ),
10237
- /* @__PURE__ */ jsx16(
10755
+ /* @__PURE__ */ jsx18(
10238
10756
  PagePreview,
10239
10757
  {
10758
+ versions,
10240
10759
  editor,
10241
10760
  state,
10242
10761
  host,
@@ -10251,7 +10770,7 @@ function Workspace({ scope }) {
10251
10770
  }
10252
10771
  function Panel2() {
10253
10772
  const { c, rbac, get, catalog, gallery, history } = useScope();
10254
- const canReadHistory = Boolean(useRBAC3(HISTORY_READ).allowedActions?.canRead);
10773
+ const canReadHistory = Boolean(useRBAC4(HISTORY_READ).allowedActions?.canRead);
10255
10774
  const preview = usePreviewZone(usePreviewHost5());
10256
10775
  const groups = gallery ? catalog?.groups : null;
10257
10776
  const problems = groups && preview.zone ? (0, import_groups.validateGroups)(preview.rows, groups) : [];
@@ -10259,9 +10778,9 @@ function Panel2() {
10259
10778
  if (!versions && !problems.length) return null;
10260
10779
  return {
10261
10780
  title: "Blockscene",
10262
- content: /* @__PURE__ */ jsx16(Guard, { children: /* @__PURE__ */ jsxs13(Flex10, { direction: "column", alignItems: "stretch", gap: 4, children: [
10263
- problems.length > 0 && /* @__PURE__ */ jsx16(GroupDiagnostics, { scope: preview, groups, problems }),
10264
- versions && /* @__PURE__ */ jsx16(
10781
+ content: /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsxs15(Flex12, { direction: "column", alignItems: "stretch", gap: 4, children: [
10782
+ problems.length > 0 && /* @__PURE__ */ jsx18(GroupDiagnostics, { scope: preview, groups, problems }),
10783
+ versions && /* @__PURE__ */ jsx18(
10265
10784
  History,
10266
10785
  {
10267
10786
  model: c.model,
@@ -10277,8 +10796,8 @@ function Panel2() {
10277
10796
  ] }) })
10278
10797
  };
10279
10798
  }
10280
- var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ jsxs13(Flex10, { gap: 3, children: [
10281
- /* @__PURE__ */ jsx16(
10799
+ var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ */ jsxs15(Flex12, { gap: 3, children: [
10800
+ /* @__PURE__ */ jsx18(
10282
10801
  Switch2,
10283
10802
  {
10284
10803
  name,
@@ -10288,7 +10807,7 @@ var ToggleField = ({ name, label, value, onChange, disabled }) => /* @__PURE__ *
10288
10807
  onCheckedChange: onChange
10289
10808
  }
10290
10809
  ),
10291
- /* @__PURE__ */ jsx16(Typography10, { children: label })
10810
+ /* @__PURE__ */ jsx18(Typography12, { children: label })
10292
10811
  ] });
10293
10812
  var TextField = ({
10294
10813
  name,
@@ -10297,9 +10816,9 @@ var TextField = ({
10297
10816
  onChange,
10298
10817
  disabled,
10299
10818
  placeholder
10300
- }) => /* @__PURE__ */ jsxs13(Field3.Root, { name, children: [
10301
- /* @__PURE__ */ jsx16(Field3.Label, { children: label }),
10302
- /* @__PURE__ */ jsx16(
10819
+ }) => /* @__PURE__ */ jsxs15(Field3.Root, { name, children: [
10820
+ /* @__PURE__ */ jsx18(Field3.Label, { children: label }),
10821
+ /* @__PURE__ */ jsx18(
10303
10822
  TextInput2,
10304
10823
  {
10305
10824
  name,
@@ -10317,16 +10836,16 @@ var SelectField = ({
10317
10836
  onChange,
10318
10837
  disabled,
10319
10838
  options
10320
- }) => /* @__PURE__ */ jsxs13(Field3.Root, { name, children: [
10321
- /* @__PURE__ */ jsx16(Field3.Label, { children: label }),
10322
- /* @__PURE__ */ jsx16(
10323
- SingleSelect2,
10839
+ }) => /* @__PURE__ */ jsxs15(Field3.Root, { name, children: [
10840
+ /* @__PURE__ */ jsx18(Field3.Label, { children: label }),
10841
+ /* @__PURE__ */ jsx18(
10842
+ SingleSelect3,
10324
10843
  {
10325
10844
  value,
10326
10845
  disabled,
10327
10846
  startIcon: options.find((o) => o.value === value)?.icon,
10328
10847
  onChange: (v) => onChange(String(v)),
10329
- children: options.map((o) => /* @__PURE__ */ jsx16(SingleSelectOption2, { value: o.value, startIcon: o.icon, children: o.label }, o.value))
10848
+ children: options.map((o) => /* @__PURE__ */ jsx18(SingleSelectOption3, { value: o.value, startIcon: o.icon, children: o.label }, o.value))
10330
10849
  }
10331
10850
  )
10332
10851
  ] });
@@ -10336,11 +10855,11 @@ function MediaPicker({ onClose, onSelect }) {
10336
10855
  (state) => state.components
10337
10856
  );
10338
10857
  const Dialog3 = components?.["media-library"];
10339
- React16.useEffect(() => {
10858
+ React18.useEffect(() => {
10340
10859
  if (!Dialog3) onClose();
10341
10860
  }, [Dialog3, onClose]);
10342
10861
  if (!Dialog3) return null;
10343
- return /* @__PURE__ */ jsx16(
10862
+ return /* @__PURE__ */ jsx18(
10344
10863
  Dialog3,
10345
10864
  {
10346
10865
  onClose,
@@ -10351,7 +10870,7 @@ function MediaPicker({ onClose, onSelect }) {
10351
10870
  );
10352
10871
  }
10353
10872
  function usePermissions() {
10354
- const { allowedActions, isLoading } = useRBAC3(
10873
+ const { allowedActions, isLoading } = useRBAC4(
10355
10874
  Object.values(permissions).flat()
10356
10875
  );
10357
10876
  return {
@@ -10360,7 +10879,7 @@ function usePermissions() {
10360
10879
  isLoading
10361
10880
  };
10362
10881
  }
10363
- var SettingsPage = () => /* @__PURE__ */ jsx16(Guard, { children: /* @__PURE__ */ jsx16(
10882
+ var SettingsPage = () => /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18(
10364
10883
  Settings,
10365
10884
  {
10366
10885
  useClient: useFetchClient3,
@@ -10378,7 +10897,7 @@ var strapi5_default = {
10378
10897
  strapiApp = app;
10379
10898
  register(app, SettingsPage, "blockscene");
10380
10899
  app.registerPlugin({ id: "blockscene", name: "Blockscene", apis: { registerPanel: (panel) => registerPanel(panel, ICON_NAMES) } });
10381
- app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ jsx16(Guard, { children: /* @__PURE__ */ jsx16(ContentPage, {}) })));
10900
+ app.addMenuLink(contentMenuLink(() => /* @__PURE__ */ jsx18(Guard, { children: /* @__PURE__ */ jsx18(ContentPage, {}) })));
10382
10901
  },
10383
10902
  registerTrads,
10384
10903
  bootstrap(app) {