@mattisvensson/strapi-plugin-webatlas 0.9.6 → 0.10.0

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.
Files changed (81) hide show
  1. package/README.md +24 -36
  2. package/dist/_chunks/{SettingTitle-77mvMRg_.mjs → SettingTitle-CdR3SVn_.mjs} +1 -1
  3. package/dist/_chunks/{SettingTitle-DLj_Wwqy.js → SettingTitle-RU1azFIM.js} +1 -1
  4. package/dist/_chunks/{de-C-uxto84.mjs → de-B5pRvs13.mjs} +13 -7
  5. package/dist/_chunks/{de-CGXL_3o_.js → de-CqU1FU8C.js} +13 -7
  6. package/dist/_chunks/{en-B1CHnIH7.mjs → en-BE-zzIv8.mjs} +13 -7
  7. package/dist/_chunks/{en-DWEd5BXK.js → en-C7I90FwV.js} +13 -7
  8. package/dist/_chunks/{index-DwaKIwAz.mjs → index-B07UVUOa.mjs} +387 -229
  9. package/dist/_chunks/{index-3pYLMhui.mjs → index-BmyxSosC.mjs} +3 -3
  10. package/dist/_chunks/{index-Dt-AXdaw.js → index-BucL4va6.js} +38 -82
  11. package/dist/_chunks/{index-BRKi-K-v.mjs → index-BvcX9hcc.mjs} +61 -24
  12. package/dist/_chunks/{index-COfk3YSm.js → index-BxpDM360.js} +386 -228
  13. package/dist/_chunks/{index-5OG4i6qO.mjs → index-CIM-JzLK.mjs} +38 -82
  14. package/dist/_chunks/{index-BWzalvVi.mjs → index-CNKWb8pn.mjs} +614 -320
  15. package/dist/_chunks/{index-VXuAEnpX.js → index-D-vJE_K8.js} +3 -3
  16. package/dist/_chunks/{index-BOtvXSPU.js → index-IRSCe8PX.js} +609 -315
  17. package/dist/_chunks/{index-DTsHvlTa.js → index-d09V61nm.js} +61 -24
  18. package/dist/admin/index.js +1 -1
  19. package/dist/admin/index.mjs +1 -1
  20. package/dist/admin/src/components/CMEditViewAside/NewPathInfo.d.ts +2 -0
  21. package/dist/admin/src/components/CMEditViewAside/OverrideCheckbox.d.ts +7 -0
  22. package/dist/admin/src/components/CMEditViewAside/Panel.d.ts +5 -0
  23. package/dist/admin/src/components/CMEditViewAside/PathInput.d.ts +11 -0
  24. package/dist/admin/src/components/CMEditViewAside/RouteStructure.d.ts +3 -0
  25. package/dist/admin/src/components/CMEditViewAside/UidPathDisplay.d.ts +4 -0
  26. package/dist/admin/src/components/PathInfo.d.ts +2 -3
  27. package/dist/admin/src/components/modals/externalItem/index.d.ts +1 -1
  28. package/dist/admin/src/components/modals/internalItem/ItemDetails.d.ts +13 -0
  29. package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +1 -1
  30. package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +1 -1
  31. package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +1 -1
  32. package/dist/admin/src/components/modals/wrapperItem/index.d.ts +1 -1
  33. package/dist/admin/src/hooks/useApi.d.ts +4 -3
  34. package/dist/admin/src/pages/Navigation/RouteItem.d.ts +1 -15
  35. package/dist/admin/src/pages/Navigation/RouteItemBadge.d.ts +4 -0
  36. package/dist/admin/src/pages/Navigation/RouteItemIcon.d.ts +5 -0
  37. package/dist/admin/src/pages/Navigation/RouteItemMenu.d.ts +10 -0
  38. package/dist/admin/src/pages/Navigation/RouteItemStatus.d.ts +5 -0
  39. package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +1 -1
  40. package/dist/admin/src/types/index.d.ts +3 -0
  41. package/dist/admin/src/types/modal.d.ts +56 -0
  42. package/dist/admin/src/types/navigation.d.ts +18 -0
  43. package/dist/admin/src/types/panel.d.ts +41 -0
  44. package/dist/admin/src/types/route.d.ts +1 -1
  45. package/dist/admin/src/utils/buildBreadcrumbString.d.ts +16 -0
  46. package/dist/admin/src/utils/createTempNavItemObject.d.ts +6 -8
  47. package/dist/admin/src/utils/duplicateCheck.d.ts +10 -4
  48. package/dist/admin/src/utils/findParentNavItem.d.ts +13 -0
  49. package/dist/admin/src/utils/index.d.ts +3 -2
  50. package/dist/server/index.js +630 -200
  51. package/dist/server/index.mjs +630 -200
  52. package/dist/server/src/content-types/index.d.ts +18 -0
  53. package/dist/server/src/content-types/route/index.d.ts +18 -0
  54. package/dist/server/src/content-types/route/schema.d.ts +18 -0
  55. package/dist/server/src/controllers/admin.d.ts +3 -2
  56. package/dist/server/src/controllers/index.d.ts +3 -2
  57. package/dist/server/src/index.d.ts +24 -4
  58. package/dist/server/src/migrations/001-canonical-path.d.ts +7 -0
  59. package/dist/server/src/migrations/index.d.ts +3 -0
  60. package/dist/server/src/services/admin.d.ts +3 -2
  61. package/dist/server/src/services/index.d.ts +3 -2
  62. package/dist/server/src/utils/buildCanonicalPath.d.ts +1 -0
  63. package/dist/server/src/utils/buildNavigationPath.d.ts +5 -0
  64. package/dist/server/src/utils/cascadeCanonicalPathUpdates.d.ts +1 -0
  65. package/dist/server/src/utils/getNonInternalRouteIds.d.ts +1 -0
  66. package/dist/server/src/utils/getRouteAncestors.d.ts +1 -0
  67. package/dist/server/src/utils/getRouteDescendants.d.ts +1 -0
  68. package/dist/server/src/utils/index.d.ts +10 -2
  69. package/dist/server/src/utils/navigationItemStructure.d.ts +27 -0
  70. package/dist/server/src/utils/routeHandler.d.ts +4 -2
  71. package/dist/server/src/utils/validateRouteDependencies.d.ts +4 -0
  72. package/dist/types/index.d.ts +0 -1
  73. package/dist/types/navigation.d.ts +13 -12
  74. package/dist/types/route.d.ts +7 -2
  75. package/dist/types/strapi.d.ts +1 -2
  76. package/dist/utils/index.d.ts +1 -2
  77. package/package.json +1 -1
  78. package/dist/admin/src/components/CMEditViewAside/Path.d.ts +0 -5
  79. package/dist/admin/src/utils/countChildren.d.ts +0 -2
  80. package/dist/types/modal.d.ts +0 -36
  81. package/dist/utils/getPath.d.ts +0 -1
@@ -3,10 +3,10 @@ import { useRef, useEffect, useState, useCallback, createContext, useMemo, creat
3
3
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
4
4
  import { Link, List, Information } from "@strapi/icons";
5
5
  import { useFetchClient, unstable_useContentManagerContext, useRBAC } from "@strapi/strapi/admin";
6
- import { Box, Typography, Flex, Divider, Field, Checkbox } from "@strapi/design-system";
6
+ import { Box, Typography, Flex, Checkbox, Field, SingleSelect, SingleSelectOption, Divider } from "@strapi/design-system";
7
+ import { useIntl } from "react-intl";
7
8
  import * as ReactDOM from "react-dom";
8
9
  import ReactDOM__default, { flushSync } from "react-dom";
9
- import { useIntl } from "react-intl";
10
10
  const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
11
11
  const v = glob[path];
12
12
  if (v) {
@@ -34,6 +34,7 @@ function transformToUrl(input) {
34
34
  input = input.replace(/\/+/g, "/");
35
35
  input = input.startsWith("/") ? input.slice(1) : input;
36
36
  input = input.endsWith("/") ? input.slice(0, -1) : input;
37
+ input = input.replace(/\//g, "-");
37
38
  for (const char in specialCharMap) {
38
39
  const regex = new RegExp(char, "g");
39
40
  input = input.replace(regex, specialCharMap[char]);
@@ -44,7 +45,7 @@ function transformToUrl(input) {
44
45
  input = input.replace(/-+/g, "-");
45
46
  return input;
46
47
  }
47
- const version = "0.9.5";
48
+ const version = "0.9.6";
48
49
  const keywords = [];
49
50
  const type = "commonjs";
50
51
  const exports = {
@@ -111,7 +112,7 @@ const peerDependencies = {
111
112
  "styled-components": "^6.0.0"
112
113
  };
113
114
  const description = "A strapi plugin to manage URL routes and navigations.";
114
- const strapi = {
115
+ const strapi$1 = {
115
116
  name: "webatlas",
116
117
  displayName: "Webatlas",
117
118
  description: "A strapi plugin to manage URL routes and navigations.",
@@ -151,7 +152,7 @@ const pluginPkg = {
151
152
  devDependencies,
152
153
  peerDependencies,
153
154
  description,
154
- strapi,
155
+ strapi: strapi$1,
155
156
  name,
156
157
  license,
157
158
  repository,
@@ -180,7 +181,7 @@ function useApi() {
180
181
  const { data } = await get("/content-manager/content-types");
181
182
  return data.data;
182
183
  } catch (error) {
183
- console.warn("Cannot fetch all content types:", error);
184
+ strapi.log.error("Cannot fetch all content types:", error);
184
185
  return [];
185
186
  }
186
187
  };
@@ -195,7 +196,7 @@ function useApi() {
195
196
  const configuredUIDs = new Set(configuredTypes.map((ct) => ct.uid));
196
197
  return allContentTypes.filter((ct) => configuredUIDs.has(ct.uid));
197
198
  } catch (err) {
198
- console.error("Error fetching configured content types:", err);
199
+ strapi.log.error("Error fetching configured content types:", err);
199
200
  return [];
200
201
  }
201
202
  };
@@ -219,7 +220,7 @@ function useApi() {
219
220
  contentType
220
221
  };
221
222
  } catch (err) {
222
- console.warn(`Cannot access entities for ${contentType.uid}:`, err);
223
+ strapi.log.error(`Cannot access entities for ${contentType.uid}:`, err);
223
224
  return null;
224
225
  }
225
226
  })
@@ -227,7 +228,7 @@ function useApi() {
227
228
  entities = entityResults.map((result) => result.status === "fulfilled" ? result.value : null).filter(Boolean);
228
229
  return entities;
229
230
  } catch (err) {
230
- console.error("Error fetching entities:", err);
231
+ strapi.log.error("Error fetching entities:", err);
231
232
  throw err;
232
233
  }
233
234
  };
@@ -235,16 +236,16 @@ function useApi() {
235
236
  const { data } = await get(`/${PLUGIN_ID}/route/related?documentId=${relatedDocumentId}`);
236
237
  return data;
237
238
  };
238
- const getRoutes = async () => {
239
+ const getRoute = async (documentId) => {
240
+ const { data } = await get(`/${PLUGIN_ID}/route/${documentId}`);
241
+ return data;
242
+ };
243
+ const getAllRoutes = async () => {
239
244
  const { data } = await get(`/${PLUGIN_ID}/route`);
240
245
  return data;
241
246
  };
242
- const updateRoute = async (body, documentId) => {
243
- const { data } = await put(`/${PLUGIN_ID}/route?documentId=${documentId}`, {
244
- data: {
245
- ...body
246
- }
247
- });
247
+ const getProhibitedRouteIds = async (documentId) => {
248
+ const { data } = await get(`/${PLUGIN_ID}/route/prohibitedIds/${documentId ? `${documentId}` : ""}`);
248
249
  return data;
249
250
  };
250
251
  const getNavigation = async ({ documentId, variant } = {}) => {
@@ -282,8 +283,9 @@ function useApi() {
282
283
  fetchConfiguredContentTypes,
283
284
  fetchAllEntities,
284
285
  getRelatedRoute,
285
- getRoutes,
286
- updateRoute,
286
+ getRoute,
287
+ getAllRoutes,
288
+ getProhibitedRouteIds,
287
289
  getNavigation,
288
290
  createNavigation,
289
291
  deleteNavigation,
@@ -353,6 +355,113 @@ function usePluginConfig() {
353
355
  }
354
356
  return { config, loading, fetchError, setConfig };
355
357
  }
358
+ function debounce(func, wait) {
359
+ let timeout;
360
+ return function executedFunction(...args) {
361
+ const later = () => {
362
+ clearTimeout(timeout);
363
+ func(...args);
364
+ };
365
+ clearTimeout(timeout);
366
+ timeout = setTimeout(later, wait);
367
+ };
368
+ }
369
+ async function duplicateCheck({
370
+ fetchFunction,
371
+ path,
372
+ routeDocumentId,
373
+ withoutTransform = false
374
+ }) {
375
+ if (!path) throw new Error("URL is required");
376
+ try {
377
+ const pathToCheck = withoutTransform ? path : transformToUrl(path);
378
+ const { data } = await fetchFunction(`/${PLUGIN_ID}/checkUniquePath?path=${pathToCheck}${routeDocumentId ? `&targetRouteDocumentId=${routeDocumentId}` : ""}`);
379
+ if (!data.uniquePath) {
380
+ throw new Error("Network response was not ok");
381
+ }
382
+ return data.uniquePath;
383
+ } catch (err) {
384
+ throw new Error("Failed to check URL uniqueness: " + err.message);
385
+ }
386
+ }
387
+ const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
388
+ function PathInfo({ validationState, replacement }) {
389
+ const [color, setColor] = useState(null);
390
+ const [text, setText] = useState(null);
391
+ const { formatMessage } = useIntl();
392
+ useEffect(() => {
393
+ if (validationState === "initial") return;
394
+ if (validationState === "checking") {
395
+ setColor("neutral800");
396
+ setText(formatMessage({
397
+ id: getTranslation("components.pathInfo.checking"),
398
+ defaultMessage: "Checking if path is available..."
399
+ }));
400
+ } else if (validationState === "done") {
401
+ setColor(replacement ? "danger500" : "success500");
402
+ setText(replacement ? `${formatMessage({
403
+ id: getTranslation("components.pathInfo.notAvailable"),
404
+ defaultMessage: "Path is not available. Replaced with"
405
+ })} "${replacement}".` : formatMessage({
406
+ id: getTranslation("components.pathInfo.available"),
407
+ defaultMessage: "Path is available."
408
+ }));
409
+ }
410
+ }, [validationState, replacement, formatMessage]);
411
+ return /* @__PURE__ */ jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsx(Typography, { textColor: color, children: text }) });
412
+ }
413
+ function OverrideCheckbox({ isOverride, setIsOverride, disabledCondition }) {
414
+ const { formatMessage } = useIntl();
415
+ return /* @__PURE__ */ jsx(
416
+ Flex,
417
+ {
418
+ gap: 2,
419
+ paddingTop: 2,
420
+ children: /* @__PURE__ */ jsx(
421
+ Checkbox,
422
+ {
423
+ id: "path-override-checkbox",
424
+ checked: isOverride,
425
+ onCheckedChange: () => setIsOverride(!isOverride),
426
+ disabled: disabledCondition,
427
+ children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", children: formatMessage({
428
+ id: getTranslation("components.CMEditViewAside.path.overrideCheckbox"),
429
+ defaultMessage: "Override automatic path generation"
430
+ }) })
431
+ }
432
+ )
433
+ }
434
+ );
435
+ }
436
+ function NewPathInfo() {
437
+ const { formatMessage } = useIntl();
438
+ return /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", children: formatMessage({
439
+ id: getTranslation("components.CMEditViewAside.path.newPathInfo"),
440
+ defaultMessage: "A new path will be created upon saving this entry."
441
+ }) });
442
+ }
443
+ function UidPathDisplay({ path }) {
444
+ const { formatMessage } = useIntl();
445
+ return /* @__PURE__ */ jsxs(
446
+ Field.Root,
447
+ {
448
+ hint: formatMessage({
449
+ id: getTranslation("components.CMEditViewAside.path.uidPath.hint"),
450
+ defaultMessage: "Permanent UID path, cannot be changed"
451
+ }),
452
+ children: [
453
+ /* @__PURE__ */ jsx(
454
+ Field.Input,
455
+ {
456
+ value: path,
457
+ disabled: true
458
+ }
459
+ ),
460
+ /* @__PURE__ */ jsx(Field.Hint, {})
461
+ ]
462
+ }
463
+ );
464
+ }
356
465
  function _extends() {
357
466
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
358
467
  for (var e = 1; e < arguments.length; e++) {
@@ -3652,70 +3761,132 @@ function Tooltip({ description: description2 }) {
3652
3761
  ) }) })
3653
3762
  ] }) });
3654
3763
  }
3655
- function debounce(func, wait) {
3656
- let timeout;
3657
- return function executedFunction(...args) {
3658
- const later = () => {
3659
- clearTimeout(timeout);
3660
- func(...args);
3661
- };
3662
- clearTimeout(timeout);
3663
- timeout = setTimeout(later, wait);
3664
- };
3665
- }
3666
- async function duplicateCheck(get, url, routeDocumentId) {
3667
- if (!url) throw new Error("URL is required");
3668
- try {
3669
- const { data } = await get(`/${PLUGIN_ID}/checkUniquePath?path=${transformToUrl(url)}${routeDocumentId ? `&targetRouteDocumentId=${routeDocumentId}` : ""}`);
3670
- if (!data.uniquePath) {
3671
- throw new Error("Network response was not ok");
3764
+ function PathInput({ path, dispatchPath, isOverride, config }) {
3765
+ const { formatMessage } = useIntl();
3766
+ const displayedPath = isOverride && path.overridePath !== void 0 ? path.overridePath : path.value ?? "";
3767
+ const inputBorder = path.replacement === null ? "" : path.replacement ? "1px solid #ee5e52" : "1px solid #5cb176";
3768
+ return /* @__PURE__ */ jsxs(
3769
+ Field.Root,
3770
+ {
3771
+ hint: config.default ? formatMessage({
3772
+ id: getTranslation("components.CMEditViewAside.path.input.start"),
3773
+ defaultMessage: "Edit the"
3774
+ }) + ' "' + config.default + '" ' + formatMessage({
3775
+ id: getTranslation("components.CMEditViewAside.path.input.end"),
3776
+ defaultMessage: "field to generate a path"
3777
+ }) : formatMessage({
3778
+ id: getTranslation("components.CMEditViewAside.path.input.noSourceField"),
3779
+ defaultMessage: "Use the override option to set a custom path"
3780
+ }),
3781
+ children: [
3782
+ /* @__PURE__ */ jsxs(Field.Label, { children: [
3783
+ formatMessage({
3784
+ id: getTranslation("components.CMEditViewAside.path.input.label"),
3785
+ defaultMessage: "Path"
3786
+ }),
3787
+ /* @__PURE__ */ jsx(Tooltip, { description: formatMessage({
3788
+ id: getTranslation("components.CMEditViewAside.path.input.tooltip"),
3789
+ defaultMessage: "The following characters are valid: A-Z, a-z, 0-9, /, -, _, $, ., +, !, *, ', (, )"
3790
+ }) })
3791
+ ] }),
3792
+ /* @__PURE__ */ jsx(
3793
+ Field.Input,
3794
+ {
3795
+ id: "path-input",
3796
+ value: displayedPath,
3797
+ onChange: (e) => dispatchPath({ type: "SET_OVERRIDEPATH", payload: e.target.value }),
3798
+ disabled: !isOverride,
3799
+ onBlur: (e) => {
3800
+ if (e.target.value === path.prevValue) return;
3801
+ dispatchPath({ type: "DEFAULT", payload: e.target.value });
3802
+ },
3803
+ style: { outline: inputBorder }
3804
+ }
3805
+ ),
3806
+ /* @__PURE__ */ jsx(Field.Hint, {})
3807
+ ]
3672
3808
  }
3673
- return data.uniquePath;
3674
- } catch (err) {
3675
- console.error("Error in duplicateCheck:", err);
3676
- throw new Error("Failed to check URL uniqueness");
3677
- }
3809
+ );
3678
3810
  }
3679
- const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
3680
- function PathInfo({ validationState, replacement, setUrlStatus }) {
3681
- const [color, setColor] = useState(null);
3682
- const [text, setText] = useState(null);
3811
+ function RouteStructure({ routes, selectedParent, setSelectedParent, canonicalPath, prohibitedRouteIds }) {
3683
3812
  const { formatMessage } = useIntl();
3684
- useEffect(() => {
3685
- if (validationState === "initial") return;
3686
- if (validationState === "checking") {
3687
- setColor("neutral800");
3688
- setText(formatMessage({
3689
- id: getTranslation("components.pathInfo.checking"),
3690
- defaultMessage: "Checking if path is available..."
3691
- }));
3692
- } else if (validationState === "done") {
3693
- setColor(replacement ? "danger500" : "success500");
3694
- setText(replacement ? `${formatMessage({
3695
- id: getTranslation("components.pathInfo.notAvailable"),
3696
- defaultMessage: "Path is not available. Replaced with"
3697
- })} "${replacement}".` : formatMessage({
3698
- id: getTranslation("components.pathInfo.available"),
3699
- defaultMessage: "Path is available."
3700
- }));
3701
- if (setUrlStatus) setUrlStatus(replacement ? "invalid" : "valid");
3702
- }
3703
- }, [validationState, replacement, formatMessage, setUrlStatus]);
3704
- return /* @__PURE__ */ jsx(Box, { paddingTop: 2, children: /* @__PURE__ */ jsx(Typography, { textColor: color, children: text }) });
3813
+ const sortedRoutes = useMemo(() => {
3814
+ return [...routes].sort((a, b) => a.title.localeCompare(b.title));
3815
+ }, [routes]);
3816
+ const handleSelectParent = (value) => {
3817
+ const parentRoute = routes.find((route) => route.documentId === value) || null;
3818
+ setSelectedParent(parentRoute);
3819
+ };
3820
+ return /* @__PURE__ */ jsxs(Box, { paddingBottom: 2, children: [
3821
+ /* @__PURE__ */ jsxs(Field.Root, { children: [
3822
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
3823
+ id: getTranslation("components.CMEditViewAside.path.input.parentSelect.label"),
3824
+ defaultMessage: "Place under"
3825
+ }) }),
3826
+ /* @__PURE__ */ jsxs(
3827
+ SingleSelect,
3828
+ {
3829
+ value: selectedParent?.documentId || "",
3830
+ onValueChange: handleSelectParent,
3831
+ children: [
3832
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "", children: formatMessage({
3833
+ id: getTranslation("components.CMEditViewAside.path.input.parentSelect.rootPath"),
3834
+ defaultMessage: "None (root path)"
3835
+ }) }),
3836
+ sortedRoutes.filter((route) => !prohibitedRouteIds?.includes(route.documentId) || route.documentId === selectedParent?.documentId).map(
3837
+ (route) => /* @__PURE__ */ jsx(
3838
+ SingleSelectOption,
3839
+ {
3840
+ value: route.documentId,
3841
+ children: route.title
3842
+ },
3843
+ route.documentId
3844
+ )
3845
+ )
3846
+ ]
3847
+ }
3848
+ )
3849
+ ] }),
3850
+ /* @__PURE__ */ jsxs(Field.Root, { marginTop: 4, children: [
3851
+ /* @__PURE__ */ jsxs(Field.Label, { children: [
3852
+ formatMessage({
3853
+ id: getTranslation("components.CMEditViewAside.canonicalPath.input.label"),
3854
+ defaultMessage: "Canonical Path"
3855
+ }),
3856
+ /* @__PURE__ */ jsx(Tooltip, { description: formatMessage({
3857
+ id: getTranslation("components.CMEditViewAside.canonicalPath.input.tooltip"),
3858
+ defaultMessage: "The path determined by your content's natural hierarchy, independent of where it appears in navigation menus."
3859
+ }) })
3860
+ ] }),
3861
+ /* @__PURE__ */ jsx(
3862
+ Field.Input,
3863
+ {
3864
+ id: "canonicalPath-input",
3865
+ value: canonicalPath,
3866
+ disabled: true
3867
+ }
3868
+ ),
3869
+ /* @__PURE__ */ jsx(Field.Hint, {})
3870
+ ] })
3871
+ ] });
3872
+ }
3873
+ function getCanonicalPath(selectedParent, sourceFieldValue) {
3874
+ const parentPath = selectedParent ? selectedParent.canonicalPath + "/" : "";
3875
+ return `${parentPath}${transformToUrl(sourceFieldValue)}`;
3705
3876
  }
3706
3877
  function reducer(state, action) {
3707
3878
  switch (action.type) {
3708
3879
  case "DEFAULT":
3709
3880
  return {
3710
3881
  ...state,
3711
- value: transformToUrl(action.payload),
3882
+ value: action.payload,
3712
3883
  prevValue: state.value,
3713
3884
  needsUrlCheck: true
3714
3885
  };
3715
3886
  case "NO_URL_CHECK":
3716
3887
  return {
3717
3888
  ...state,
3718
- value: transformToUrl(action.payload),
3889
+ value: action.payload,
3719
3890
  prevValue: state.value,
3720
3891
  needsUrlCheck: false
3721
3892
  };
@@ -3728,16 +3899,22 @@ function reducer(state, action) {
3728
3899
  };
3729
3900
  case "RESET_URL_CHECK_FLAG":
3730
3901
  return { ...state, needsUrlCheck: false };
3902
+ case "SET_REPLACEMENT":
3903
+ return { ...state, replacement: action.payload };
3731
3904
  case "SET_UIDPATH":
3732
- return { ...state, uIdPath: action.payload };
3905
+ return { ...state, uidPath: action.payload };
3906
+ case "SET_CANONICALPATH":
3907
+ return { ...state, canonicalPath: action.payload };
3908
+ case "SET_OVERRIDEPATH":
3909
+ return { ...state, overridePath: action.payload };
3733
3910
  default:
3734
3911
  throw new Error();
3735
3912
  }
3736
3913
  }
3737
- const Path = ({ config }) => {
3914
+ const Panel = ({ config }) => {
3738
3915
  const { form, model } = unstable_useContentManagerContext();
3739
3916
  const { initialValues, values, onChange } = form;
3740
- const { getRelatedRoute } = useApi();
3917
+ const { getRelatedRoute, getAllRoutes, getProhibitedRouteIds } = useApi();
3741
3918
  const { formatMessage } = useIntl();
3742
3919
  const { get } = useFetchClient();
3743
3920
  const { allowedActions: {
@@ -3757,26 +3934,39 @@ const Path = ({ config }) => {
3757
3934
  conditions: []
3758
3935
  }
3759
3936
  ]);
3760
- const [routeId, setRouteId] = useState();
3937
+ const [route, setRoute] = useState(null);
3938
+ const [routes, setRoutes] = useState([]);
3939
+ const [prohibitedRouteIds, setProhibitedRouteIds] = useState([]);
3940
+ const [selectedParent, setSelectedParent] = useState(null);
3761
3941
  const [isOverride, setIsOverride] = useState(false);
3762
3942
  const [validationState, setValidationState] = useState("initial");
3763
- const [replacement, setReplacement] = useState("");
3764
3943
  const [initialLoadComplete, setInitialLoadComplete] = useState(false);
3765
- const [urlIsValid, setUrlIsValid] = useState(null);
3766
3944
  const [path, dispatchPath] = useReducer(reducer, {
3767
3945
  needsUrlCheck: false,
3768
3946
  value: "",
3769
3947
  prevValue: "",
3770
- uIdPath: ""
3948
+ replacement: null,
3949
+ uidPath: "",
3950
+ canonicalPath: "",
3951
+ overridePath: ""
3771
3952
  });
3772
3953
  const hasUserChangedField = useRef(false);
3773
3954
  const initialPath = useRef("");
3774
- const prevValueRef = useRef(null);
3775
- const debouncedCheckUrl = useCallback(debounce(checkUrl, 250), []);
3955
+ const prevSourceValueRef = useRef(null);
3956
+ const sourceFieldValue = useMemo(() => {
3957
+ const key = config?.default;
3958
+ if (!key) return "";
3959
+ const currentValue = values[key];
3960
+ if (!currentValue) return "";
3961
+ return currentValue;
3962
+ }, [values, config]);
3963
+ const debouncedCheckPath = useCallback(debounce(checkPath, 250), []);
3964
+ const debouncedCheckCanonicalPath = useCallback(debounce(checkCanonicalPath, 250), []);
3776
3965
  useEffect(() => {
3777
- onChange("webatlas_path", path.value);
3966
+ if (isOverride) onChange("webatlas_path", path.overridePath);
3778
3967
  onChange("webatlas_override", isOverride);
3779
- }, [path.value, isOverride]);
3968
+ onChange("webatlas_parent", selectedParent?.documentId || null);
3969
+ }, [path.value, path.overridePath, isOverride, selectedParent]);
3780
3970
  const debouncedValueEffect = useMemo(() => debounce((currentValues) => {
3781
3971
  const key = config?.default;
3782
3972
  if (!key) return;
@@ -3785,38 +3975,37 @@ const Path = ({ config }) => {
3785
3975
  dispatchPath({ type: "NO_URL_CHECK", payload: "" });
3786
3976
  return;
3787
3977
  }
3788
- if (initialLoadComplete && (hasUserChangedField.current || !routeId) && prevValueRef.current !== currentValue && !isOverride) {
3789
- const path2 = config.pattern ? `${config.pattern}/${currentValue}` : `${currentValue}`;
3978
+ if (initialLoadComplete && (hasUserChangedField.current || !route) && prevSourceValueRef.current !== currentValue && !isOverride) {
3979
+ const path2 = getCanonicalPath(selectedParent, currentValue);
3790
3980
  if (currentValue === initialValues[key]) {
3791
3981
  dispatchPath({ type: "NO_URL_CHECK", payload: path2 });
3792
3982
  } else {
3793
3983
  dispatchPath({ type: "DEFAULT", payload: path2 });
3794
3984
  }
3795
- prevValueRef.current = currentValue;
3985
+ prevSourceValueRef.current = currentValue;
3796
3986
  }
3797
- }, 500), [config?.default, config?.pattern, initialValues, isOverride, initialLoadComplete, routeId]);
3987
+ }, 500), [config?.default, initialValues, isOverride, initialLoadComplete, route, selectedParent]);
3798
3988
  useEffect(() => {
3799
3989
  const key = config?.default;
3800
3990
  if (!key) return;
3801
3991
  const currentValue = values[key];
3802
3992
  const initialValue = initialValues[key];
3803
- if (currentValue && !isOverride) {
3804
- const path2 = config.pattern ? `${config.pattern}/${currentValue}` : `${currentValue}`;
3805
- onChange("webatlas_path", transformToUrl(path2));
3993
+ if (currentValue !== initialValue && currentValue && !isOverride) {
3994
+ onChange("webatlas_path", transformToUrl(currentValue));
3806
3995
  }
3807
3996
  if (!initialLoadComplete) return;
3808
3997
  if (currentValue !== initialValue) {
3809
3998
  hasUserChangedField.current = true;
3810
3999
  }
3811
4000
  debouncedValueEffect(values);
3812
- }, [values, debouncedValueEffect, initialLoadComplete]);
4001
+ }, [values, debouncedValueEffect, initialLoadComplete, selectedParent]);
3813
4002
  useEffect(() => {
3814
4003
  if (path.needsUrlCheck && path.value) {
3815
- if (path.uIdPath === path.value || initialPath.current === path.value) return;
3816
- debouncedCheckUrl(path.value);
4004
+ if (path.uidPath === path.value || initialPath.current === path.value) return;
4005
+ debouncedCheckPath(path.value, route?.documentId || null);
3817
4006
  dispatchPath({ type: "RESET_URL_CHECK_FLAG" });
3818
4007
  }
3819
- }, [path.needsUrlCheck]);
4008
+ }, [path.needsUrlCheck, path.value, path.uidPath, route]);
3820
4009
  useEffect(() => {
3821
4010
  async function getTypes() {
3822
4011
  if (!initialValues.documentId) {
@@ -3824,42 +4013,84 @@ const Path = ({ config }) => {
3824
4013
  return;
3825
4014
  }
3826
4015
  try {
3827
- const route = await getRelatedRoute(initialValues.documentId);
3828
- if (!route) return;
3829
- initialPath.current = initialValues.webatlas_path || route.uidPath;
3830
- setRouteId(route.id);
3831
- setIsOverride(route.isOverride || false);
3832
- dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: route.path || "" });
3833
- dispatchPath({ type: "SET_UIDPATH", payload: route.uidPath || "" });
4016
+ const route2 = await getRelatedRoute(initialValues.documentId);
4017
+ if (!route2) return;
4018
+ initialPath.current = initialValues.webatlas_path || route2.uidPath;
4019
+ setRoute(route2);
4020
+ setIsOverride(route2.isOverride || false);
4021
+ if (route2.isOverride) {
4022
+ dispatchPath({ type: "SET_OVERRIDEPATH", payload: route2.path || "" });
4023
+ } else {
4024
+ dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: route2.path || "" });
4025
+ }
4026
+ dispatchPath({ type: "SET_UIDPATH", payload: route2.uidPath || "" });
3834
4027
  const key = config?.default;
3835
4028
  if (key) {
3836
- prevValueRef.current = values[key];
4029
+ prevSourceValueRef.current = values[key];
3837
4030
  }
3838
4031
  } catch (err) {
3839
- setRouteId(null);
3840
- console.log(err);
4032
+ setRoute(null);
4033
+ strapi.log.error(err);
3841
4034
  }
3842
4035
  setInitialLoadComplete(true);
3843
4036
  }
3844
4037
  getTypes();
3845
4038
  }, [config]);
4039
+ useEffect(() => {
4040
+ if (initialValues.webatlas_parent && routes.length > 0 && !selectedParent) {
4041
+ const parentRoute = routes.find((route2) => route2.documentId === initialValues.webatlas_parent);
4042
+ if (parentRoute) {
4043
+ setSelectedParent(parentRoute);
4044
+ const canonicalPath = getCanonicalPath(parentRoute, sourceFieldValue);
4045
+ dispatchPath({ type: "DEFAULT", payload: canonicalPath });
4046
+ }
4047
+ }
4048
+ }, [initialValues, routes]);
3846
4049
  useEffect(() => {
3847
4050
  if (initialValues.webatlas_path) dispatchPath({ type: "NO_URL_CHECK", payload: initialValues.webatlas_path });
3848
4051
  if (initialValues.webatlas_override) setIsOverride(initialValues.webatlas_override);
4052
+ async function fetchAllRoutes() {
4053
+ const allRoutes = await getAllRoutes();
4054
+ setRoutes(allRoutes);
4055
+ }
4056
+ fetchAllRoutes();
3849
4057
  }, []);
3850
- async function checkUrl(url) {
3851
- if (!url) return;
4058
+ useEffect(() => {
4059
+ async function fetchProhibitedRouteIds() {
4060
+ const prohibitedIds = await getProhibitedRouteIds(route?.documentId);
4061
+ setProhibitedRouteIds(prohibitedIds);
4062
+ }
4063
+ fetchProhibitedRouteIds();
4064
+ }, [route]);
4065
+ useEffect(() => {
4066
+ if (!sourceFieldValue) return;
4067
+ const canonicalPath = getCanonicalPath(selectedParent, sourceFieldValue);
4068
+ !isOverride && dispatchPath({ type: "DEFAULT", payload: canonicalPath });
4069
+ dispatchPath({ type: "SET_CANONICALPATH", payload: canonicalPath });
4070
+ debouncedCheckCanonicalPath(canonicalPath, route?.documentId || null);
4071
+ dispatchPath({ type: "RESET_URL_CHECK_FLAG" });
4072
+ }, [selectedParent, sourceFieldValue, route, isOverride]);
4073
+ async function checkCanonicalPath(path2, documentId) {
4074
+ if (!path2) return;
4075
+ try {
4076
+ const result = await duplicateCheck({ fetchFunction: get, path: path2, routeDocumentId: documentId, withoutTransform: true });
4077
+ dispatchPath({ type: "SET_CANONICALPATH", payload: result });
4078
+ } catch (err) {
4079
+ strapi.log.error(err);
4080
+ }
4081
+ }
4082
+ async function checkPath(path2, route2) {
4083
+ if (!path2) return;
3852
4084
  setValidationState("checking");
3853
- setReplacement("");
4085
+ dispatchPath({ type: "SET_REPLACEMENT", payload: "" });
3854
4086
  try {
3855
- const data = await duplicateCheck(get, url);
3856
- if (!data || data === url) return;
4087
+ const data = await duplicateCheck({ fetchFunction: get, path: path2, routeDocumentId: route2, withoutTransform: true });
4088
+ if (!data || data === path2) return;
3857
4089
  dispatchPath({ type: "NO_URL_CHECK", payload: data });
3858
- setReplacement(data);
4090
+ dispatchPath({ type: "SET_REPLACEMENT", payload: data });
3859
4091
  } catch (err) {
3860
- console.log(err);
4092
+ strapi.log.error(err);
3861
4093
  } finally {
3862
- setUrlIsValid(null);
3863
4094
  setValidationState("done");
3864
4095
  }
3865
4096
  }
@@ -3878,101 +4109,52 @@ const Path = ({ config }) => {
3878
4109
  {
3879
4110
  direction: "column",
3880
4111
  alignItems: "stretch",
3881
- gap: 4,
4112
+ gap: 1,
3882
4113
  children: [
4114
+ !route && /* @__PURE__ */ jsxs(Fragment$1, { children: [
4115
+ /* @__PURE__ */ jsx(NewPathInfo, {}),
4116
+ /* @__PURE__ */ jsx(Divider, { marginTop: 2, marginBottom: 2 })
4117
+ ] }),
4118
+ /* @__PURE__ */ jsx(
4119
+ RouteStructure,
4120
+ {
4121
+ canonicalPath: path.canonicalPath,
4122
+ routes,
4123
+ selectedParent,
4124
+ setSelectedParent,
4125
+ prohibitedRouteIds
4126
+ }
4127
+ ),
4128
+ /* @__PURE__ */ jsx(Divider, { marginTop: 2, marginBottom: 2 }),
3883
4129
  /* @__PURE__ */ jsxs(Box, { children: [
3884
- !routeId && /* @__PURE__ */ jsxs(Fragment$1, { children: [
3885
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", marginBottom: 2, children: formatMessage({
3886
- id: getTranslation("components.CMEditViewAside.path.newPathInfo"),
3887
- defaultMessage: "A new path will be created upon saving this entry."
3888
- }) }),
3889
- /* @__PURE__ */ jsx(Box, { paddingBottom: 2, paddingTop: 2, children: /* @__PURE__ */ jsx(Divider, {}) })
3890
- ] }),
3891
- /* @__PURE__ */ jsxs(
3892
- Field.Root,
4130
+ /* @__PURE__ */ jsx(
4131
+ PathInput,
3893
4132
  {
3894
- hint: config.default ? formatMessage({
3895
- id: getTranslation("components.CMEditViewAside.path.input.start"),
3896
- defaultMessage: "Edit the"
3897
- }) + ' "' + config.default + '" ' + formatMessage({
3898
- id: getTranslation("components.CMEditViewAside.path.input.end"),
3899
- defaultMessage: "field to generate a path"
3900
- }) : formatMessage({
3901
- id: getTranslation("components.CMEditViewAside.path.input.noSourceField"),
3902
- defaultMessage: "Use the override option to set a custom path"
3903
- }),
3904
- children: [
3905
- /* @__PURE__ */ jsxs(Field.Label, { children: [
3906
- formatMessage({
3907
- id: getTranslation("components.CMEditViewAside.path.input.label"),
3908
- defaultMessage: "Path"
3909
- }),
3910
- /* @__PURE__ */ jsx(Tooltip, { description: formatMessage({
3911
- id: getTranslation("components.CMEditViewAside.path.input.tooltip"),
3912
- defaultMessage: "The following characters are valid: A-Z, a-z, 0-9, /, -, _, $, ., +, !, *, ', (, )"
3913
- }) })
3914
- ] }),
3915
- /* @__PURE__ */ jsx(
3916
- Field.Input,
3917
- {
3918
- id: "path-input",
3919
- value: path.value,
3920
- onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
3921
- disabled: !isOverride,
3922
- onBlur: (e) => {
3923
- if (e.target.value === path.prevValue) return;
3924
- dispatchPath({ type: "DEFAULT", payload: e.target.value });
3925
- },
3926
- style: { outline: urlIsValid !== null ? urlIsValid === "valid" ? "1px solid #5cb176" : "1px solid #ee5e52" : void 0 }
3927
- }
3928
- ),
3929
- /* @__PURE__ */ jsx(Field.Hint, {})
3930
- ]
4133
+ path,
4134
+ dispatchPath,
4135
+ isOverride,
4136
+ config
3931
4137
  }
3932
4138
  ),
3933
- /* @__PURE__ */ jsx(PathInfo, { validationState, replacement, setUrlStatus: setUrlIsValid }),
3934
- /* @__PURE__ */ jsx(
3935
- Flex,
4139
+ validationState !== "initial" && /* @__PURE__ */ jsx(
4140
+ PathInfo,
3936
4141
  {
3937
- gap: 2,
3938
- paddingTop: 2,
3939
- children: /* @__PURE__ */ jsx(
3940
- Checkbox,
3941
- {
3942
- id: "path-override-checkbox",
3943
- checked: isOverride,
3944
- onCheckedChange: () => setIsOverride((prev) => !prev),
3945
- disabled: !routeId && !canCreate || routeId && !canUpdate,
3946
- children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", children: formatMessage({
3947
- id: getTranslation("components.CMEditViewAside.path.overrideCheckbox"),
3948
- defaultMessage: "Override automatic path generation"
3949
- }) })
3950
- }
3951
- )
4142
+ validationState,
4143
+ replacement: path.replacement
3952
4144
  }
3953
4145
  )
3954
4146
  ] }),
3955
- path.uIdPath && /* @__PURE__ */ jsxs(Fragment$1, { children: [
3956
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Divider, {}) }),
3957
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(
3958
- Field.Root,
3959
- {
3960
- hint: formatMessage({
3961
- id: getTranslation("components.CMEditViewAside.path.uidPath.hint"),
3962
- defaultMessage: "Permanent UID path, cannot be changed"
3963
- }),
3964
- children: [
3965
- /* @__PURE__ */ jsx(
3966
- Field.Input,
3967
- {
3968
- value: path.uIdPath,
3969
- disabled: true
3970
- }
3971
- ),
3972
- /* @__PURE__ */ jsx(Field.Hint, {})
3973
- ]
3974
- }
3975
- ) })
4147
+ /* @__PURE__ */ jsx(
4148
+ OverrideCheckbox,
4149
+ {
4150
+ isOverride,
4151
+ setIsOverride,
4152
+ disabledCondition: !canCreate && !canUpdate
4153
+ }
4154
+ ),
4155
+ path.uidPath && /* @__PURE__ */ jsxs(Fragment$1, { children: [
4156
+ /* @__PURE__ */ jsx(Divider, { marginTop: 2, marginBottom: 2 }),
4157
+ /* @__PURE__ */ jsx(UidPathDisplay, { path: path.uidPath })
3976
4158
  ] })
3977
4159
  ]
3978
4160
  }
@@ -3987,14 +4169,7 @@ const pluginPermissions = {
3987
4169
  "settings.general": [{ action: `plugin::${PLUGIN_ID}.settings.general`, subject: null }],
3988
4170
  "settings.navigation": [{ action: `plugin::${PLUGIN_ID}.settings.navigation`, subject: null }]
3989
4171
  };
3990
- const CMEditViewAside = ({
3991
- // activeTab,
3992
- // collectionType,
3993
- // document,
3994
- documentId,
3995
- // meta,
3996
- model
3997
- }) => {
4172
+ const CMEditViewAside = ({ documentId, model }) => {
3998
4173
  const { contentTypes } = useAllContentTypes();
3999
4174
  const { config } = usePluginConfig();
4000
4175
  const { formatMessage } = useIntl();
@@ -4054,7 +4229,7 @@ const CMEditViewAside = ({
4054
4229
  });
4055
4230
  if (!canAside || !isAllowedContentType || !isActiveContentType || !contentTypeConfig) return null;
4056
4231
  if (!config) {
4057
- console.error("CMEditViewAside: Plugin is not configured.");
4232
+ strapi.log.error("CMEditViewAside: Plugin is not configured.");
4058
4233
  return null;
4059
4234
  }
4060
4235
  if (isLoading) return {
@@ -4066,37 +4241,31 @@ const CMEditViewAside = ({
4066
4241
  };
4067
4242
  return {
4068
4243
  title: panelTitle,
4069
- content: /* @__PURE__ */ jsx(Path, { config: contentTypeConfig })
4244
+ content: /* @__PURE__ */ jsx(Panel, { config: contentTypeConfig })
4070
4245
  };
4071
4246
  };
4072
4247
  const index = {
4073
4248
  register(app) {
4074
4249
  app.addMenuLink({
4075
- to: `/plugins/${PLUGIN_ID}/paths`,
4250
+ to: `plugins/${PLUGIN_ID}/paths`,
4076
4251
  icon: PathIcon,
4077
4252
  intlLabel: {
4078
4253
  id: `${PLUGIN_ID}.link.paths`,
4079
4254
  defaultMessage: "Paths"
4080
4255
  },
4081
- Component: async () => {
4082
- const component = await import("./index-BRKi-K-v.mjs");
4083
- return { default: component.default };
4084
- },
4256
+ Component: () => import("./index-BvcX9hcc.mjs"),
4085
4257
  permissions: [
4086
4258
  pluginPermissions["page.routes"][0]
4087
4259
  ]
4088
4260
  });
4089
4261
  app.addMenuLink({
4090
- to: `/plugins/${PLUGIN_ID}/navigation`,
4262
+ to: `plugins/${PLUGIN_ID}/navigation`,
4091
4263
  icon: NavigationIcon,
4092
4264
  intlLabel: {
4093
4265
  id: `${PLUGIN_ID}.link.navigation`,
4094
4266
  defaultMessage: "Navigation"
4095
4267
  },
4096
- Component: async () => {
4097
- const component = await import("./index-BWzalvVi.mjs");
4098
- return { default: component.default };
4099
- },
4268
+ Component: () => import("./index-CNKWb8pn.mjs"),
4100
4269
  permissions: [
4101
4270
  pluginPermissions["page.navigation"][0]
4102
4271
  ]
@@ -4115,13 +4284,8 @@ const index = {
4115
4284
  defaultMessage: "General"
4116
4285
  },
4117
4286
  id: `${PLUGIN_ID}-general`,
4118
- to: `/settings/${PLUGIN_ID}/general`,
4119
- Component: async () => {
4120
- return await import(
4121
- /* webpackChunkName: "webatlas-settings-general-page" */
4122
- "./index-5OG4i6qO.mjs"
4123
- );
4124
- },
4287
+ to: `${PLUGIN_ID}/general`,
4288
+ Component: () => import("./index-CIM-JzLK.mjs"),
4125
4289
  permissions: [
4126
4290
  pluginPermissions["settings.general"][0]
4127
4291
  ]
@@ -4135,13 +4299,8 @@ const index = {
4135
4299
  defaultMessage: "Navigation"
4136
4300
  },
4137
4301
  id: `${PLUGIN_ID}-navigation`,
4138
- to: `/settings/${PLUGIN_ID}/navigation`,
4139
- Component: async () => {
4140
- return await import(
4141
- /* webpackChunkName: "webatlas-settings-navigation-page" */
4142
- "./index-3pYLMhui.mjs"
4143
- );
4144
- },
4302
+ to: `${PLUGIN_ID}/navigation`,
4303
+ Component: () => import("./index-BmyxSosC.mjs"),
4145
4304
  permissions: [
4146
4305
  pluginPermissions["settings.navigation"][0]
4147
4306
  ]
@@ -4161,7 +4320,7 @@ const index = {
4161
4320
  return Promise.all(
4162
4321
  locales.map(async (locale) => {
4163
4322
  try {
4164
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-C-uxto84.mjs"), "./translations/en.json": () => import("./en-B1CHnIH7.mjs") }), `./translations/${locale}.json`, 3);
4323
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-B5pRvs13.mjs"), "./translations/en.json": () => import("./en-BE-zzIv8.mjs") }), `./translations/${locale}.json`, 3);
4165
4324
  return { data, locale };
4166
4325
  } catch {
4167
4326
  return { data: {}, locale };
@@ -4183,6 +4342,5 @@ export {
4183
4342
  PLUGIN_VERSION as h,
4184
4343
  index as i,
4185
4344
  pluginPermissions as p,
4186
- transformToUrl as t,
4187
4345
  useApi as u
4188
4346
  };