strapi-plugin-magic-mark 4.0.2 → 4.0.4

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.
@@ -197,19 +197,20 @@ const buildFieldOptions = (uid, init, metadatas, readable) => {
197
197
  };
198
198
  let initCache = null;
199
199
  const configCache = /* @__PURE__ */ new Map();
200
- const loadInit = (get) => {
200
+ const sessionGet = (url) => admin.getFetchClient().get(url);
201
+ const loadInit = () => {
201
202
  if (!initCache) {
202
- initCache = get("/content-manager/init").then(({ data }) => data.data).catch((error) => {
203
+ initCache = sessionGet("/content-manager/init").then(({ data }) => data.data).catch((error) => {
203
204
  initCache = null;
204
205
  throw error;
205
206
  });
206
207
  }
207
208
  return initCache;
208
209
  };
209
- const loadMetadatas = (get, uid) => {
210
+ const loadMetadatas = (uid) => {
210
211
  let promise = configCache.get(uid);
211
212
  if (!promise) {
212
- promise = get(
213
+ promise = sessionGet(
213
214
  `/content-manager/content-types/${uid}/configuration`
214
215
  ).then(({ data }) => data.data.contentType.metadatas ?? {}).catch((error) => {
215
216
  configCache.delete(uid);
@@ -220,7 +221,6 @@ const loadMetadatas = (get, uid) => {
220
221
  return promise;
221
222
  };
222
223
  const useContentTypeNames = () => {
223
- const { get } = admin.useFetchClient();
224
224
  const [state, setState] = react.useState({
225
225
  names: /* @__PURE__ */ new Map(),
226
226
  isLoading: true,
@@ -228,7 +228,7 @@ const useContentTypeNames = () => {
228
228
  });
229
229
  react.useEffect(() => {
230
230
  let active = true;
231
- loadInit(get).then((init) => {
231
+ loadInit().then((init) => {
232
232
  if (!active) return;
233
233
  setState({
234
234
  names: new Map(init.contentTypes.map((ct) => [ct.uid, ct.info?.displayName ?? ct.uid])),
@@ -239,11 +239,10 @@ const useContentTypeNames = () => {
239
239
  return () => {
240
240
  active = false;
241
241
  };
242
- }, [get]);
242
+ }, []);
243
243
  return state;
244
244
  };
245
245
  const useFilterFields = (uid) => {
246
- const { get } = admin.useFetchClient();
247
246
  const permissions = admin.useAuth("MagicMarkFilters", (state2) => state2.permissions);
248
247
  const [attempt, setAttempt] = react.useState(0);
249
248
  const [state, setState] = react.useState({
@@ -262,7 +261,7 @@ const useFilterFields = (uid) => {
262
261
  react.useEffect(() => {
263
262
  if (!uid) return void 0;
264
263
  let active = true;
265
- Promise.all([loadInit(get), loadMetadatas(get, uid)]).then(([init, metadatas]) => {
264
+ Promise.all([loadInit(), loadMetadatas(uid)]).then(([init, metadatas]) => {
266
265
  if (active) {
267
266
  setState({ key, fields: buildFieldOptions(uid, init, metadatas, readable), error: null });
268
267
  }
@@ -270,7 +269,7 @@ const useFilterFields = (uid) => {
270
269
  return () => {
271
270
  active = false;
272
271
  };
273
- }, [get, uid, readable, key]);
272
+ }, [uid, readable, key]);
274
273
  const current = state.key === key;
275
274
  return {
276
275
  fields: current ? state.fields : [],
@@ -283,6 +282,9 @@ const ADMIN_QUERY_DEPTH = 5;
283
282
  const NO_VALUE_OPERATORS = ["$null", "$notNull"];
284
283
  const LIST_OPERATORS = ["$in", "$notIn"];
285
284
  const RANGE_OPERATORS = ["$between"];
285
+ const MAX_LIST_ITEMS = 100;
286
+ const MAX_ALL_CONDITIONS = 20;
287
+ const maxConditions = (match) => match === "all" ? MAX_ALL_CONDITIONS : MAX_LIST_ITEMS;
286
288
  const BASE$1 = ["$eq", "$ne", "$null", "$notNull"];
287
289
  const NUMERIC = ["$gt", "$gte", "$lt", "$lte"];
288
290
  const SENSITIVE = ["$eqi", "$nei"];
@@ -345,6 +347,7 @@ const inputToDatetime = (value) => {
345
347
  return Number.isNaN(date.getTime()) ? value : date.toISOString();
346
348
  };
347
349
  const splitList = (value) => value.split(",").map((item) => item.trim()).filter(Boolean);
350
+ const hasTooManyValues = (row) => LIST_OPERATORS.includes(row.operator) && splitList(row.value).length > MAX_LIST_ITEMS;
348
351
  const validateRow = (row, fields) => {
349
352
  const field = fields.get(row.field);
350
353
  if (!field) return "field";
@@ -353,7 +356,10 @@ const validateRow = (row, fields) => {
353
356
  }
354
357
  if (NO_VALUE_OPERATORS.includes(row.operator)) return null;
355
358
  if (field.type === "boolean") return BOOLEAN_VALUES.includes(row.value) ? null : "value";
356
- if (LIST_OPERATORS.includes(row.operator)) return splitList(row.value).length ? null : "value";
359
+ if (LIST_OPERATORS.includes(row.operator)) {
360
+ const count = splitList(row.value).length;
361
+ return count && count <= MAX_LIST_ITEMS ? null : "value";
362
+ }
357
363
  if (!row.value.trim()) return "value";
358
364
  if (RANGE_OPERATORS.includes(row.operator) && !(row.valueTo ?? "").trim()) return "valueTo";
359
365
  return null;
@@ -464,6 +470,31 @@ const countConditions = (filters) => {
464
470
  }
465
471
  return count;
466
472
  };
473
+ const INDEX_KEY = /^\d+$/;
474
+ const listLength = (value) => {
475
+ if (Array.isArray(value)) return value.length;
476
+ if (!value || typeof value !== "object") return 0;
477
+ const keys = Object.keys(value);
478
+ return keys.length && keys.every((key) => INDEX_KEY.test(key)) ? Math.max(...keys.map(Number)) + 1 : 0;
479
+ };
480
+ const exceedsItemLimit = (value) => {
481
+ if (Array.isArray(value)) {
482
+ return value.length > MAX_LIST_ITEMS || value.some(exceedsItemLimit);
483
+ }
484
+ if (!value || typeof value !== "object") return false;
485
+ const keys = Object.keys(value);
486
+ if (keys.length && keys.every((key) => INDEX_KEY.test(key))) {
487
+ if (keys.some((key) => Number(key) >= MAX_LIST_ITEMS)) return true;
488
+ }
489
+ return Object.values(value).some(exceedsItemLimit);
490
+ };
491
+ const exceedsListLimit = (value) => {
492
+ const filters = value?.filters;
493
+ if (filters && typeof filters === "object") {
494
+ if (listLength(filters.$and) > MAX_ALL_CONDITIONS) return true;
495
+ }
496
+ return exceedsItemLimit(value);
497
+ };
467
498
  const FOCUSABLE = [
468
499
  "a[href]",
469
500
  "button:not([disabled])",
@@ -539,7 +570,10 @@ const AdvancedFiltersModal = ({ open, onOpenChange, uid }) => {
539
570
  const updateRow = (id, patch) => setRows((prev) => prev.map((row) => row.id === id ? { ...row, ...patch } : row));
540
571
  const activeRows = rows.filter((row) => row.field || row.value);
541
572
  const rowErrors = new Map(activeRows.map((row) => [row.id, validateRow(row, fieldMap)]));
542
- const hasErrors = [...rowErrors.values()].some(Boolean);
573
+ const rowLimit = maxConditions(match);
574
+ const tooManyRows = activeRows.length > rowLimit;
575
+ const atRowLimit = rows.length >= rowLimit;
576
+ const hasErrors = tooManyRows || [...rowErrors.values()].some(Boolean);
543
577
  const apply = () => {
544
578
  setShowErrors(true);
545
579
  if (hasErrors) return;
@@ -567,13 +601,22 @@ const AdvancedFiltersModal = ({ open, onOpenChange, uid }) => {
567
601
  onOpenChange(false);
568
602
  };
569
603
  const errorText = (row, part) => {
604
+ if (part === "value" && hasTooManyValues(row)) {
605
+ return formatMessage(
606
+ msg(
607
+ "filters.errorTooManyValues",
608
+ "Enter at most {max} values. Strapi does not accept longer lists."
609
+ ),
610
+ { max: MAX_LIST_ITEMS }
611
+ );
612
+ }
570
613
  if (!showErrors || rowErrors.get(row.id) !== part) return void 0;
571
614
  if (part === "field") return formatMessage(msg("filters.errorField", "Choose a field."));
572
615
  if (part === "operator")
573
616
  return formatMessage(msg("filters.errorOperator", "Choose a condition."));
574
617
  return formatMessage(msg("filters.errorValue", "Enter a value."));
575
618
  };
576
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { onKeyDown: keepFocusInside, children: [
619
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { onKeyDown: keepFocusInside, "aria-describedby": void 0, children: [
577
620
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { closeLabel: formatMessage(msg("form.close", "Close")), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: formatMessage(msg("filters.title", "Advanced filters")) }) }),
578
621
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage(msg("state.loading", "Loading")) }) }) : error ? /* @__PURE__ */ jsxRuntime.jsx(
579
622
  designSystem.Alert,
@@ -653,15 +696,44 @@ const AdvancedFiltersModal = ({ open, onOpenChange, uid }) => {
653
696
  ) }, row.id))
654
697
  }
655
698
  ),
656
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
657
- designSystem.TextButton,
658
- {
659
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}),
660
- ...TEXT_BUTTON_TARGET,
661
- onClick: () => setRows((prev) => [...prev, emptyRow()]),
662
- children: formatMessage(msg("filters.add", "Add condition"))
663
- }
664
- ) })
699
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 2, children: [
700
+ /* @__PURE__ */ jsxRuntime.jsx(
701
+ designSystem.TextButton,
702
+ {
703
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}),
704
+ ...TEXT_BUTTON_TARGET,
705
+ disabled: atRowLimit,
706
+ "aria-describedby": atRowLimit ? "magic-mark-filters-row-limit" : void 0,
707
+ onClick: () => setRows((prev) => [...prev, emptyRow()]),
708
+ children: formatMessage(msg("filters.add", "Add condition"))
709
+ }
710
+ ),
711
+ atRowLimit ? /* @__PURE__ */ jsxRuntime.jsx(
712
+ designSystem.Typography,
713
+ {
714
+ id: "magic-mark-filters-row-limit",
715
+ variant: "pi",
716
+ textColor: tooManyRows ? "danger600" : "neutral600",
717
+ role: tooManyRows ? "alert" : void 0,
718
+ children: formatMessage(
719
+ match === "all" ? tooManyRows ? msg(
720
+ "filters.errorTooManyConditionsAll",
721
+ "With All conditions, keep at most {max} conditions: the Content Manager list does not open with more. Remove conditions or choose Any condition."
722
+ ) : msg(
723
+ "filters.maxConditionsAll",
724
+ "With All conditions, a filter can have at most {max} conditions. The Content Manager list does not open with more."
725
+ ) : tooManyRows ? msg(
726
+ "filters.errorTooManyConditions",
727
+ "Remove conditions until at most {max} are left. Strapi does not accept more."
728
+ ) : msg(
729
+ "filters.maxConditions",
730
+ "A filter can have at most {max} conditions, the most Strapi accepts."
731
+ ),
732
+ { max: rowLimit }
733
+ )
734
+ }
735
+ ) : null
736
+ ] })
665
737
  ] }) }),
666
738
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
667
739
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "danger-light", onClick: clearAll, disabled: !query.filters, children: formatMessage(msg("filters.clear", "Clear all")) }),
@@ -974,7 +1046,6 @@ const normalizeSavedQuery = (query, init, uid) => {
974
1046
  };
975
1047
  const useOpenBookmark = () => {
976
1048
  const navigate = reactRouterDom.useNavigate();
977
- const { get } = admin.useFetchClient();
978
1049
  const { toggleNotification } = admin.useNotification();
979
1050
  const { formatMessage } = reactIntl.useIntl();
980
1051
  return react.useCallback(
@@ -990,9 +1061,22 @@ const useOpenBookmark = () => {
990
1061
  return;
991
1062
  }
992
1063
  const parsed = parseQuery(bookmark.query);
1064
+ if (exceedsListLimit(parsed)) {
1065
+ toggleNotification({
1066
+ type: "warning",
1067
+ timeout: 15e3,
1068
+ message: formatMessage(
1069
+ msg(
1070
+ "notification.listTooLong",
1071
+ "This bookmark was not opened: its filters have more values or conditions than Strapi accepts. Open the list, narrow the filters, then save the current view in this bookmark."
1072
+ )
1073
+ )
1074
+ });
1075
+ return;
1076
+ }
993
1077
  let saved = parsed;
994
1078
  try {
995
- saved = normalizeSavedQuery(parsed, await loadInit(get), location.uid);
1079
+ saved = normalizeSavedQuery(parsed, await loadInit(), location.uid);
996
1080
  } catch {
997
1081
  }
998
1082
  const search = saved === parsed ? bookmark.query ?? "" : stringifyQuery(saved);
@@ -1002,7 +1086,7 @@ const useOpenBookmark = () => {
1002
1086
  }
1003
1087
  navigate({ pathname: location.path, search: search ? `?${search}` : "" });
1004
1088
  },
1005
- [get, navigate, toggleNotification, formatMessage]
1089
+ [navigate, toggleNotification, formatMessage]
1006
1090
  );
1007
1091
  };
1008
1092
  const errorBody = (error) => error?.response?.data?.error;
@@ -1415,83 +1499,90 @@ const BookmarkFormModal = ({
1415
1499
  const contentType = view?.contentType ?? loaded?.contentType ?? null;
1416
1500
  const query = view?.query ?? loaded?.query ?? "";
1417
1501
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1418
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { onKeyDown: keepFocusInside, children: [
1419
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { closeLabel: formatMessage(msg("form.close", "Close")), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title }) }),
1420
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage(msg("state.loading", "Loading")) }) }) : loadFailed ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", children: formatMessage(msg("form.loadError", "The bookmark could not be loaded.")) }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
1421
- queryRejected ? /* @__PURE__ */ jsxRuntime.jsx(
1422
- designSystem.Alert,
1423
- {
1424
- variant: "danger",
1425
- closeLabel: formatMessage(msg("form.close", "Close")),
1426
- onClose: () => setQueryRejected(false),
1427
- children: formatMessage(
1428
- msg(
1429
- "form.queryTooLong",
1430
- "This view cannot be saved: the search text or a filter value is too long. Shorten it in the list and try again."
1431
- )
1432
- )
1433
- }
1434
- ) : null,
1435
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral100", hasRadius: true, padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
1436
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", tag: "h3", children: formatMessage(msg("form.savedView", "Saved view")) }),
1437
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold", children: view?.contentTypeName ?? (contentType ? names.get(contentType) ?? contentType : "") }),
1438
- /* @__PURE__ */ jsxRuntime.jsx(FilterSummary, { contentType, query })
1439
- ] }) }),
1440
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
1441
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.name", "Name")) }),
1442
- /* @__PURE__ */ jsxRuntime.jsx(
1443
- designSystem.TextInput,
1444
- {
1445
- value: name,
1446
- maxLength: NAME_MAX,
1447
- onChange: (event) => setName(event.target.value),
1448
- placeholder: formatMessage(
1449
- msg("form.namePlaceholder", "e.g. Drafts waiting for review")
1450
- )
1451
- }
1452
- ),
1453
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
1454
- ] }),
1455
- /* @__PURE__ */ jsxRuntime.jsxs(
1456
- designSystem.Field.Root,
1457
- {
1458
- name: "description",
1459
- error: errors.description,
1460
- hint: formatMessage(
1461
- msg("form.descriptionHint", "Optional. Shown below the name.")
1462
- ),
1463
- children: [
1464
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.description", "Description")) }),
1502
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
1503
+ designSystem.Modal.Content,
1504
+ {
1505
+ onKeyDown: keepFocusInside,
1506
+ "aria-describedby": void 0,
1507
+ children: [
1508
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { closeLabel: formatMessage(msg("form.close", "Close")), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title }) }),
1509
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage(msg("state.loading", "Loading")) }) }) : loadFailed ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", children: formatMessage(msg("form.loadError", "The bookmark could not be loaded.")) }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
1510
+ queryRejected ? /* @__PURE__ */ jsxRuntime.jsx(
1511
+ designSystem.Alert,
1512
+ {
1513
+ variant: "danger",
1514
+ closeLabel: formatMessage(msg("form.close", "Close")),
1515
+ onClose: () => setQueryRejected(false),
1516
+ children: formatMessage(
1517
+ msg(
1518
+ "form.queryTooLong",
1519
+ "This view cannot be saved: the search text or a filter value is too long. Shorten it in the list and try again."
1520
+ )
1521
+ )
1522
+ }
1523
+ ) : null,
1524
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral100", hasRadius: true, padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
1525
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", tag: "h3", children: formatMessage(msg("form.savedView", "Saved view")) }),
1526
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold", children: view?.contentTypeName ?? (contentType ? names.get(contentType) ?? contentType : "") }),
1527
+ /* @__PURE__ */ jsxRuntime.jsx(FilterSummary, { contentType, query })
1528
+ ] }) }),
1529
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
1530
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.name", "Name")) }),
1465
1531
  /* @__PURE__ */ jsxRuntime.jsx(
1466
- designSystem.Textarea,
1532
+ designSystem.TextInput,
1467
1533
  {
1468
- value: description,
1469
- onChange: (event) => setDescription(event.target.value)
1534
+ value: name,
1535
+ maxLength: NAME_MAX,
1536
+ onChange: (event) => setName(event.target.value),
1537
+ placeholder: formatMessage(
1538
+ msg("form.namePlaceholder", "e.g. Drafts waiting for review")
1539
+ )
1470
1540
  }
1471
1541
  ),
1472
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
1473
1542
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
1474
- ]
1475
- }
1476
- ),
1477
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "icon", children: [
1478
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.icon", "Icon")) }),
1479
- /* @__PURE__ */ jsxRuntime.jsx(
1480
- designSystem.SingleSelect,
1481
- {
1482
- value: icon,
1483
- onChange: (value) => setIcon(String(value)),
1484
- children: ICON_OPTIONS.map(({ key, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: key, startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": true }), children: formatMessage(ICON_LABELS[key]) }, key))
1485
- }
1486
- )
1487
- ] }),
1488
- canShare ? /* @__PURE__ */ jsxRuntime.jsx(SharingFields, { value: sharing, onChange: setSharing, error: errors.roles }) : null
1489
- ] }) }),
1490
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
1491
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage(msg("form.cancel", "Cancel")) }) }),
1492
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: submit, loading: saving, disabled: loading || loadFailed, children: formatMessage(msg("form.save", "Save")) })
1493
- ] })
1494
- ] }) }),
1543
+ ] }),
1544
+ /* @__PURE__ */ jsxRuntime.jsxs(
1545
+ designSystem.Field.Root,
1546
+ {
1547
+ name: "description",
1548
+ error: errors.description,
1549
+ hint: formatMessage(
1550
+ msg("form.descriptionHint", "Optional. Shown below the name.")
1551
+ ),
1552
+ children: [
1553
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.description", "Description")) }),
1554
+ /* @__PURE__ */ jsxRuntime.jsx(
1555
+ designSystem.Textarea,
1556
+ {
1557
+ value: description,
1558
+ onChange: (event) => setDescription(event.target.value)
1559
+ }
1560
+ ),
1561
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
1562
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
1563
+ ]
1564
+ }
1565
+ ),
1566
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "icon", children: [
1567
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage(msg("form.icon", "Icon")) }),
1568
+ /* @__PURE__ */ jsxRuntime.jsx(
1569
+ designSystem.SingleSelect,
1570
+ {
1571
+ value: icon,
1572
+ onChange: (value) => setIcon(String(value)),
1573
+ children: ICON_OPTIONS.map(({ key, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: key, startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": true }), children: formatMessage(ICON_LABELS[key]) }, key))
1574
+ }
1575
+ )
1576
+ ] }),
1577
+ canShare ? /* @__PURE__ */ jsxRuntime.jsx(SharingFields, { value: sharing, onChange: setSharing, error: errors.roles }) : null
1578
+ ] }) }),
1579
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
1580
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage(msg("form.cancel", "Cancel")) }) }),
1581
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: submit, loading: saving, disabled: loading || loadFailed, children: formatMessage(msg("form.save", "Save")) })
1582
+ ] })
1583
+ ]
1584
+ }
1585
+ ) }),
1495
1586
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: confirmDiscard, onOpenChange: setConfirmDiscard, children: /* @__PURE__ */ jsxRuntime.jsx(
1496
1587
  admin.ConfirmDialog,
1497
1588
  {
@@ -1798,7 +1889,7 @@ const index = {
1798
1889
  to: `plugins/${pluginId}`,
1799
1890
  icon: PluginIcon,
1800
1891
  intlLabel: { id: `${pluginId}.plugin.name`, defaultMessage: "Magic Mark" },
1801
- Component: () => Promise.resolve().then(() => require("./App-DxALpMK_.js")),
1892
+ Component: () => Promise.resolve().then(() => require("./App-BZiGgFPL.js")),
1802
1893
  permissions: PERMISSIONS.read
1803
1894
  });
1804
1895
  app.registerPlugin({ id: pluginId, name: "Magic Mark" });
@@ -1813,7 +1904,7 @@ const index = {
1813
1904
  label: { id: `${pluginId}.widget.link`, defaultMessage: "Manage bookmarks" },
1814
1905
  href: `/plugins/${pluginId}`
1815
1906
  },
1816
- component: async () => (await Promise.resolve().then(() => require("./PinnedBookmarksWidget-VM6buexr.js"))).default,
1907
+ component: async () => (await Promise.resolve().then(() => require("./PinnedBookmarksWidget-BLphsESy.js"))).default,
1817
1908
  permissions: PERMISSIONS.read
1818
1909
  });
1819
1910
  }
@@ -1829,7 +1920,7 @@ const index = {
1829
1920
  return Promise.all(
1830
1921
  locales.map(async (locale) => {
1831
1922
  try {
1832
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-Cn90CcnC.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-GDfO_EfL.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-6o-_RABX.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BOZS5mJT.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-D13SxuK2.js")) }), `./translations/${locale}.json`, 3);
1923
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-D9BJ4u7r.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BIMTC0Id.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-YRbu_LzT.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-b0q34Kvn.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-DkmTAK17.js")) }), `./translations/${locale}.json`, 3);
1833
1924
  return {
1834
1925
  data: Object.fromEntries(
1835
1926
  Object.entries(data).map(([key, value]) => [