@mattisvensson/strapi-plugin-webatlas 0.9.5 → 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 (117) hide show
  1. package/README.md +24 -36
  2. package/dist/_chunks/FullLoader-Cmsf8xS6.js +0 -1
  3. package/dist/_chunks/FullLoader-CrPED_dY.mjs +0 -1
  4. package/dist/_chunks/{SettingTitle-CiMKrd_1.mjs → SettingTitle-CdR3SVn_.mjs} +1 -2
  5. package/dist/_chunks/{SettingTitle-CAoYbTar.js → SettingTitle-RU1azFIM.js} +1 -1
  6. package/dist/_chunks/{de-C-uxto84.mjs → de-B5pRvs13.mjs} +13 -8
  7. package/dist/_chunks/{de-CGXL_3o_.js → de-CqU1FU8C.js} +13 -8
  8. package/dist/_chunks/{en-B1CHnIH7.mjs → en-BE-zzIv8.mjs} +13 -8
  9. package/dist/_chunks/{en-DWEd5BXK.js → en-C7I90FwV.js} +13 -8
  10. package/dist/_chunks/{index-Bqsd7oPS.mjs → index-B07UVUOa.mjs} +387 -230
  11. package/dist/_chunks/{index-DJBnQbrp.mjs → index-BmyxSosC.mjs} +3 -3
  12. package/dist/_chunks/{index-BOZDZiAv.js → index-BucL4va6.js} +38 -82
  13. package/dist/_chunks/{index-DU58LJ2w.mjs → index-BvcX9hcc.mjs} +61 -25
  14. package/dist/_chunks/{index-ezabqLEP.js → index-BxpDM360.js} +386 -228
  15. package/dist/_chunks/{index-qrC_n9-7.mjs → index-CIM-JzLK.mjs} +38 -82
  16. package/dist/_chunks/{index-qrrfKpw1.mjs → index-CNKWb8pn.mjs} +615 -321
  17. package/dist/_chunks/{index-m2ivL3ht.js → index-D-vJE_K8.js} +3 -3
  18. package/dist/_chunks/{index-BkB1x9Sn.js → index-IRSCe8PX.js} +610 -316
  19. package/dist/_chunks/{index-CC073vGB.js → index-d09V61nm.js} +61 -24
  20. package/dist/admin/index.js +1 -2
  21. package/dist/admin/index.mjs +1 -2
  22. package/dist/admin/src/components/CMEditViewAside/NewPathInfo.d.ts +2 -0
  23. package/dist/admin/src/components/CMEditViewAside/OverrideCheckbox.d.ts +7 -0
  24. package/dist/admin/src/components/CMEditViewAside/Panel.d.ts +5 -0
  25. package/dist/admin/src/components/CMEditViewAside/PathInput.d.ts +11 -0
  26. package/dist/admin/src/components/CMEditViewAside/RouteStructure.d.ts +3 -0
  27. package/dist/admin/src/components/CMEditViewAside/UidPathDisplay.d.ts +4 -0
  28. package/dist/admin/src/components/PathInfo.d.ts +2 -3
  29. package/dist/admin/src/components/modals/externalItem/index.d.ts +1 -1
  30. package/dist/admin/src/components/modals/internalItem/ItemDetails.d.ts +13 -0
  31. package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +1 -1
  32. package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +1 -1
  33. package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +1 -1
  34. package/dist/admin/src/components/modals/wrapperItem/index.d.ts +1 -1
  35. package/dist/admin/src/hooks/useApi.d.ts +4 -3
  36. package/dist/admin/src/pages/Navigation/RouteItem.d.ts +1 -15
  37. package/dist/admin/src/pages/Navigation/RouteItemBadge.d.ts +4 -0
  38. package/dist/admin/src/pages/Navigation/RouteItemIcon.d.ts +5 -0
  39. package/dist/admin/src/pages/Navigation/RouteItemMenu.d.ts +10 -0
  40. package/dist/admin/src/pages/Navigation/RouteItemStatus.d.ts +5 -0
  41. package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +1 -1
  42. package/dist/admin/src/types/index.d.ts +3 -0
  43. package/dist/admin/src/types/modal.d.ts +56 -0
  44. package/dist/admin/src/types/navigation.d.ts +18 -0
  45. package/dist/admin/src/types/panel.d.ts +41 -0
  46. package/dist/admin/src/types/route.d.ts +1 -1
  47. package/dist/admin/src/utils/buildBreadcrumbString.d.ts +16 -0
  48. package/dist/admin/src/utils/createTempNavItemObject.d.ts +6 -8
  49. package/dist/admin/src/utils/duplicateCheck.d.ts +10 -4
  50. package/dist/admin/src/utils/findParentNavItem.d.ts +13 -0
  51. package/dist/admin/src/utils/index.d.ts +3 -2
  52. package/dist/server/index.js +636 -209
  53. package/dist/server/index.mjs +636 -209
  54. package/dist/server/src/content-types/index.d.ts +18 -0
  55. package/dist/server/src/content-types/route/index.d.ts +18 -0
  56. package/dist/server/src/content-types/route/schema.d.ts +18 -0
  57. package/dist/server/src/controllers/admin.d.ts +3 -2
  58. package/dist/server/src/controllers/index.d.ts +3 -2
  59. package/dist/server/src/index.d.ts +24 -4
  60. package/dist/server/src/migrations/001-canonical-path.d.ts +7 -0
  61. package/dist/server/src/migrations/index.d.ts +3 -0
  62. package/dist/server/src/services/admin.d.ts +3 -2
  63. package/dist/server/src/services/index.d.ts +3 -2
  64. package/dist/server/src/utils/buildCanonicalPath.d.ts +1 -0
  65. package/dist/server/src/utils/buildNavigationPath.d.ts +5 -0
  66. package/dist/server/src/utils/cascadeCanonicalPathUpdates.d.ts +1 -0
  67. package/dist/server/src/utils/getNonInternalRouteIds.d.ts +1 -0
  68. package/dist/server/src/utils/getRouteAncestors.d.ts +1 -0
  69. package/dist/server/src/utils/getRouteDescendants.d.ts +1 -0
  70. package/dist/server/src/utils/index.d.ts +10 -2
  71. package/dist/server/src/utils/navigationItemStructure.d.ts +27 -0
  72. package/dist/server/src/utils/routeHandler.d.ts +4 -2
  73. package/dist/server/src/utils/validateRouteDependencies.d.ts +4 -0
  74. package/dist/types/index.d.ts +0 -1
  75. package/dist/types/navigation.d.ts +13 -12
  76. package/dist/types/route.d.ts +7 -2
  77. package/dist/types/strapi.d.ts +1 -2
  78. package/dist/utils/index.d.ts +1 -2
  79. package/package.json +1 -1
  80. package/dist/_chunks/FullLoader-Cmsf8xS6.js.map +0 -1
  81. package/dist/_chunks/FullLoader-CrPED_dY.mjs.map +0 -1
  82. package/dist/_chunks/SettingTitle-ByAhjihc.js +0 -68
  83. package/dist/_chunks/SettingTitle-ByAhjihc.js.map +0 -1
  84. package/dist/_chunks/SettingTitle-CiMKrd_1.mjs.map +0 -1
  85. package/dist/_chunks/SettingTitle-ZM5Yf2b4.mjs +0 -68
  86. package/dist/_chunks/de-C-uxto84.mjs.map +0 -1
  87. package/dist/_chunks/de-CGXL_3o_.js.map +0 -1
  88. package/dist/_chunks/en-B1CHnIH7.mjs.map +0 -1
  89. package/dist/_chunks/en-DWEd5BXK.js.map +0 -1
  90. package/dist/_chunks/index-BqceJPRl.js +0 -235
  91. package/dist/_chunks/index-BqceJPRl.js.map +0 -1
  92. package/dist/_chunks/index-Bqsd7oPS.mjs.map +0 -1
  93. package/dist/_chunks/index-CK1wisw5.mjs +0 -129
  94. package/dist/_chunks/index-CK1wisw5.mjs.map +0 -1
  95. package/dist/_chunks/index-CQ2raqxe.js +0 -129
  96. package/dist/_chunks/index-CQ2raqxe.js.map +0 -1
  97. package/dist/_chunks/index-Ca9T36AU.mjs +0 -263
  98. package/dist/_chunks/index-Ca9T36AU.mjs.map +0 -1
  99. package/dist/_chunks/index-DDN4T6c7.mjs +0 -4188
  100. package/dist/_chunks/index-DH4Rd7aA.mjs +0 -8311
  101. package/dist/_chunks/index-DH4Rd7aA.mjs.map +0 -1
  102. package/dist/_chunks/index-DU58LJ2w.mjs.map +0 -1
  103. package/dist/_chunks/index-DnE_cDwy.js +0 -8311
  104. package/dist/_chunks/index-DnE_cDwy.js.map +0 -1
  105. package/dist/_chunks/index-DzpXVfQ_.js +0 -263
  106. package/dist/_chunks/index-DzpXVfQ_.js.map +0 -1
  107. package/dist/_chunks/index-R7qsEu2N.js +0 -4205
  108. package/dist/_chunks/index-R7qsEu2N.js.map +0 -1
  109. package/dist/_chunks/index-fbC3magu.mjs +0 -234
  110. package/dist/admin/index.js.map +0 -1
  111. package/dist/admin/index.mjs.map +0 -1
  112. package/dist/admin/src/components/CMEditViewAside/Path.d.ts +0 -5
  113. package/dist/admin/src/utils/countChildren.d.ts +0 -2
  114. package/dist/server/index.js.map +0 -1
  115. package/dist/server/index.mjs.map +0 -1
  116. package/dist/types/modal.d.ts +0 -36
  117. package/dist/utils/getPath.d.ts +0 -1
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const index = require("./index-ezabqLEP.js");
5
+ const index = require("./index-BxpDM360.js");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  require("@strapi/icons/symbols");
@@ -41,6 +41,15 @@ function compareBy(field, direction) {
41
41
  return (a, b) => {
42
42
  const aValue = a[field];
43
43
  const bValue = b[field];
44
+ if (aValue == null && bValue == null) {
45
+ return 0;
46
+ }
47
+ if (aValue == null) {
48
+ return direction === "asc" ? 1 : -1;
49
+ }
50
+ if (bValue == null) {
51
+ return direction === "asc" ? -1 : 1;
52
+ }
44
53
  if (typeof aValue === "string" && typeof bValue === "string") {
45
54
  return direction === "asc" ? aValue.localeCompare(bValue) : bValue.localeCompare(aValue);
46
55
  }
@@ -88,6 +97,13 @@ function TableHeader({
88
97
  }) }),
89
98
  sortKey === "title" && /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDown, {})
90
99
  ] }),
100
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Th, { onClick: () => handleSort("canonicalPath"), cursor: "pointer", children: [
101
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: formatMessage({
102
+ id: index.getTranslation("canonicalPath"),
103
+ defaultMessage: "Canonical Path"
104
+ }) }),
105
+ sortKey === "canonicalPath" && /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDown, {})
106
+ ] }),
91
107
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Th, { onClick: () => handleSort("path"), cursor: "pointer", children: [
92
108
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: formatMessage({
93
109
  id: index.getTranslation("path"),
@@ -111,12 +127,25 @@ function TableHeader({
111
127
  function TableRow({ route }) {
112
128
  const { formatMessage } = reactIntl.useIntl();
113
129
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
114
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.title }) }),
115
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: route.path }) }),
116
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
117
- id: index.getTranslation(`path.type.${route.type}`),
118
- defaultMessage: "-"
119
- }) }) }),
130
+ [route.title, route.canonicalPath, route.path].map((field, index2) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(
131
+ designSystem.Typography,
132
+ {
133
+ title: field,
134
+ textColor: "neutral800",
135
+ children: field || "-"
136
+ }
137
+ ) }, index2)),
138
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(
139
+ designSystem.Typography,
140
+ {
141
+ title: route.type,
142
+ textColor: "neutral800",
143
+ children: formatMessage({
144
+ id: index.getTranslation(`path.type.${route.type}`),
145
+ defaultMessage: "-"
146
+ })
147
+ }
148
+ ) }),
120
149
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, justifyContent: "end", children: route.type === "internal" && /* @__PURE__ */ jsxRuntime.jsx(
121
150
  designSystem.LinkButton,
122
151
  {
@@ -137,22 +166,30 @@ function PathTable({
137
166
  handleSort
138
167
  }) {
139
168
  const { formatMessage } = reactIntl.useIntl();
140
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 4, rowCount: routes.length, children: [
141
- /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { sortKey, handleSort }),
142
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: routes.length > 0 ? routes.map((route) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { route }, route.id)) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
143
- designSystem.EmptyStateLayout,
144
- {
145
- content: formatMessage({
146
- id: index.getTranslation("paths.page.emptyPaths"),
147
- defaultMessage: "No paths found"
148
- }),
149
- shadow: false
150
- }
151
- ) }) }) })
152
- ] });
169
+ const TABLE_COL_COUNT = 5;
170
+ return /* @__PURE__ */ jsxRuntime.jsxs(
171
+ designSystem.Table,
172
+ {
173
+ colCount: TABLE_COL_COUNT,
174
+ rowCount: routes.length,
175
+ children: [
176
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { sortKey, handleSort }),
177
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: routes.length > 0 ? routes.map((route) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { route }, route.id)) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: TABLE_COL_COUNT, children: /* @__PURE__ */ jsxRuntime.jsx(
178
+ designSystem.EmptyStateLayout,
179
+ {
180
+ content: formatMessage({
181
+ id: index.getTranslation("paths.page.emptyPaths"),
182
+ defaultMessage: "No paths found"
183
+ }),
184
+ shadow: false
185
+ }
186
+ ) }) }) })
187
+ ]
188
+ }
189
+ );
153
190
  }
154
191
  const Paths = () => {
155
- const { getRoutes } = index.useApi();
192
+ const { getAllRoutes } = index.useApi();
156
193
  const { formatMessage } = reactIntl.useIntl();
157
194
  const { toggleNotification } = admin.useNotification();
158
195
  const [allRoutes, setAllRoutes] = React.useState([]);
@@ -161,7 +198,7 @@ const Paths = () => {
161
198
  const [searchParams, setSearchParams] = reactRouterDom.useSearchParams();
162
199
  const initialQuery = searchParams.get("search") || "";
163
200
  const [searchQuery, setSearchQuery] = React.useState(initialQuery);
164
- const [sortKey, setSortKey] = React.useState("title");
201
+ const [sortKey, setSortKey] = React.useState("canonicalPath");
165
202
  const [sortDirection, setSortDirection] = React.useState("asc");
166
203
  React.useEffect(() => {
167
204
  const query = searchQuery.toLowerCase();
@@ -185,11 +222,11 @@ const Paths = () => {
185
222
  React.useEffect(() => {
186
223
  async function fetchRoutes() {
187
224
  try {
188
- const data = await getRoutes();
225
+ const data = await getAllRoutes();
189
226
  setAllRoutes(data);
190
227
  setRoutes(data);
191
228
  } catch (err) {
192
- console.error("Failed to fetch paths:", err);
229
+ strapi.log.error("Failed to fetch paths:", err);
193
230
  toggleNotification({
194
231
  type: "danger",
195
232
  message: formatMessage({
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-R7qsEu2N.js");
2
+ const index = require("../_chunks/index-BxpDM360.js");
3
3
  module.exports = index.index;
4
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,4 @@
1
- import { i } from "../_chunks/index-Bqsd7oPS.mjs";
1
+ import { i } from "../_chunks/index-B07UVUOa.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
5
- //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,2 @@
1
+ declare function NewPathInfo(): import("react/jsx-runtime").JSX.Element;
2
+ export default NewPathInfo;
@@ -0,0 +1,7 @@
1
+ type OverrideCheckboxProps = {
2
+ isOverride: boolean;
3
+ setIsOverride: (value: boolean) => void;
4
+ disabledCondition?: boolean;
5
+ };
6
+ declare function OverrideCheckbox({ isOverride, setIsOverride, disabledCondition }: OverrideCheckboxProps): import("react/jsx-runtime").JSX.Element;
7
+ export default OverrideCheckbox;
@@ -0,0 +1,5 @@
1
+ import type { ConfigContentType } from '../../../../types';
2
+ declare const Panel: ({ config }: {
3
+ config: ConfigContentType;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default Panel;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { ConfigContentType } from '../../../../types';
3
+ import type { PanelAction, PanelPathState } from '../../types';
4
+ type PathInputProps = {
5
+ path: PanelPathState;
6
+ dispatchPath: React.Dispatch<PanelAction>;
7
+ isOverride: boolean;
8
+ config: ConfigContentType;
9
+ };
10
+ declare function PathInput({ path, dispatchPath, isOverride, config }: PathInputProps): import("react/jsx-runtime").JSX.Element;
11
+ export default PathInput;
@@ -0,0 +1,3 @@
1
+ import { RouteStructureProps } from "../../types";
2
+ declare function RouteStructure({ routes, selectedParent, setSelectedParent, canonicalPath, prohibitedRouteIds }: RouteStructureProps): import("react/jsx-runtime").JSX.Element;
3
+ export default RouteStructure;
@@ -0,0 +1,4 @@
1
+ declare function UidPathDisplay({ path }: {
2
+ path: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default UidPathDisplay;
@@ -1,7 +1,6 @@
1
1
  interface PathProps {
2
2
  validationState: 'initial' | 'checking' | 'done';
3
- replacement: string;
4
- setUrlStatus?: (isValid: 'valid' | 'invalid') => void;
3
+ replacement: string | null;
5
4
  }
6
- export default function PathInfo({ validationState, replacement, setUrlStatus }: PathProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function PathInfo({ validationState, replacement }: PathProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -2,7 +2,7 @@ import { NestedNavItem } from '../../../../../types';
2
2
  import React from 'react';
3
3
  type externalCreateProps = {
4
4
  variant: 'ExternalCreate';
5
- parentId?: string;
5
+ actionItemParentId?: string;
6
6
  onCreate: (newItem: NestedNavItem) => void;
7
7
  };
8
8
  type externalEditProps = {
@@ -0,0 +1,13 @@
1
+ import type { Route, NestedNavItem, NestedNavigation } from '../../../../../types';
2
+ import type { ModalItem_VariantCreate } from '../../../types';
3
+ import { useModalSharedLogic } from '../useModalSharedLogic';
4
+ type ItemDetailsProps = Pick<ModalItem_VariantCreate & ReturnType<typeof useModalSharedLogic>, 'navItemState' | 'dispatchNavItemState' | 'path' | 'dispatchPath' | 'validationState' | 'debouncedCheckUrl'> & {
5
+ route: Route;
6
+ parentNavItem?: NestedNavItem | null;
7
+ navigationItems?: NestedNavItem[] | null;
8
+ navigations?: NestedNavigation[] | null;
9
+ item?: NestedNavItem;
10
+ modalVariant: 'create' | 'edit';
11
+ };
12
+ export default function ItemDetails({ navItemState, dispatchNavItemState, path, dispatchPath, validationState, parentNavItem, navigationItems, navigations, debouncedCheckUrl, item, route, modalVariant, }: ItemDetailsProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { ModalItem_VariantCreate } from '../../../../../types';
2
+ import type { ModalItem_VariantCreate } from '../../../types';
3
3
  export declare const ItemCreate: import("react").FC<ModalItem_VariantCreate>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { ModalItem_VariantEdit } from '../../../../../types';
2
+ import type { ModalItem_VariantEdit } from '../../../types';
3
3
  export declare const ItemEdit: import("react").FC<ModalItem_VariantEdit>;
@@ -1,2 +1,2 @@
1
- import { modalSharedLogic } from '../../../../types';
1
+ import type { modalSharedLogic } from '../../types';
2
2
  export declare function useModalSharedLogic(): modalSharedLogic;
@@ -2,7 +2,7 @@ import { NestedNavItem } from '../../../../../types';
2
2
  import React from 'react';
3
3
  type wrapperCreateProps = {
4
4
  variant: 'WrapperCreate';
5
- parentId?: string;
5
+ actionItemParentId?: string;
6
6
  onCreate: (newItem: NestedNavItem) => void;
7
7
  };
8
8
  type wrapperEditProps = {
@@ -1,11 +1,12 @@
1
- import { Route, GroupedEntities, RouteSettings, StructuredNavigationVariant, NavigationInput, NestedNavItem } from '../../../types';
1
+ import { Route, GroupedEntities, StructuredNavigationVariant, NavigationInput, NestedNavItem } from '../../../types';
2
2
  export default function useApi(): {
3
3
  fetchAllContentTypes: () => Promise<any>;
4
4
  fetchConfiguredContentTypes: () => Promise<any>;
5
5
  fetchAllEntities: () => Promise<GroupedEntities[]>;
6
6
  getRelatedRoute: (relatedDocumentId: string) => Promise<Route>;
7
- getRoutes: () => Promise<any>;
8
- updateRoute: (body: RouteSettings, documentId: string) => Promise<any>;
7
+ getRoute: (documentId: string) => Promise<Route>;
8
+ getAllRoutes: () => Promise<Route[]>;
9
+ getProhibitedRouteIds: (documentId?: string) => Promise<string[]>;
9
10
  getNavigation: ({ documentId, variant }?: {
10
11
  documentId?: string;
11
12
  variant?: StructuredNavigationVariant | "namesOnly";
@@ -1,17 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { NestedNavItem, NestedNavigation } from '../../../../types';
3
- export interface RouteItemProps {
4
- item: NestedNavItem;
5
- setParentId: (id: string) => void;
6
- setActionItem: React.Dispatch<React.SetStateAction<NestedNavItem | NestedNavigation | undefined>>;
7
- setNavigationItems: React.Dispatch<React.SetStateAction<NestedNavItem[] | undefined>>;
8
- ghost?: boolean;
9
- depth?: number;
10
- maxDepth: number;
11
- style?: React.CSSProperties;
12
- wrapperRef?(node: HTMLLIElement): void;
13
- handleProps?: any;
14
- disableInteraction?: boolean;
15
- indentationWidth?: number;
16
- }
2
+ import { RouteItemProps } from '../../types';
17
3
  export declare const RouteItem: import("react").ForwardRefExoticComponent<RouteItemProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ import type { NestedNavItem } from '../../../../types';
2
+ export default function RouteItemBadge({ item }: {
3
+ item: NestedNavItem;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+ export default function RouteItemIcon({ type, color }: {
3
+ type: 'internal' | 'external' | 'wrapper' | undefined;
4
+ color?: string;
5
+ }): ReactElement;
@@ -0,0 +1,10 @@
1
+ import type { NestedNavItem } from '../../../../types';
2
+ export default function RouteItemMenu({ item, depth, maxDepth, handleEdit, handleAddChildren, handleDelete, handleRestore }: {
3
+ item: NestedNavItem;
4
+ depth?: number;
5
+ maxDepth: number;
6
+ handleEdit: () => void;
7
+ handleAddChildren: () => void;
8
+ handleDelete: () => void;
9
+ handleRestore: () => void;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { NestedNavItem } from '../../../../types';
2
+ export default function RouteItemStatus({ item, isUpdated, }: {
3
+ item: NestedNavItem;
4
+ isUpdated?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +1,2 @@
1
- import { RouteItemProps } from './RouteItem';
1
+ import { RouteItemProps } from '../../types';
2
2
  export default function SortableRouteItem({ item, depth, setNavigationItems, ...props }: RouteItemProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +1,4 @@
1
1
  export * from './route';
2
+ export * from './panel';
3
+ export * from './modal';
4
+ export * from './navigation';
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ import type { GroupedEntities, NestedNavItem, NestedNavigation, RouteSettings } from '../../../types';
3
+ import type { PanelPathState, PanelAction } from '../types';
4
+ export type ModalItem_VariantCreate = {
5
+ actionItemParent: NestedNavItem | null;
6
+ navigationItems?: NestedNavItem[] | null;
7
+ navigations: NestedNavigation[] | null;
8
+ onCreate: (newItem: NestedNavItem) => void;
9
+ };
10
+ export type ModalItem_VariantEdit = {
11
+ item: NestedNavItem;
12
+ navigationItems?: NestedNavItem[] | null;
13
+ onEdit: (editedItem: NestedNavItem) => void;
14
+ };
15
+ export type modalSharedLogic = {
16
+ availableEntities: GroupedEntities[];
17
+ selectedContentType: GroupedEntities | undefined;
18
+ setSelectedContentType: (value: GroupedEntities) => void;
19
+ entities: GroupedEntities[];
20
+ validationState: 'initial' | 'checking' | 'done';
21
+ setValidationState: (value: 'initial' | 'checking' | 'done') => void;
22
+ initialState: React.RefObject<RouteSettings>;
23
+ navItemState: RouteSettings;
24
+ dispatchNavItemState: React.Dispatch<any>;
25
+ path: ExtendedPanelPathState;
26
+ dispatchPath: React.Dispatch<ExtendedPanelAction>;
27
+ debouncedCheckUrl: ({ url, routeDocumentId, withoutTransform }: {
28
+ url: string;
29
+ routeDocumentId?: string | null;
30
+ withoutTransform?: boolean;
31
+ }) => void;
32
+ modalType: string;
33
+ setModalType: (value: string) => void;
34
+ selectedNavigation: NestedNavigation | undefined;
35
+ };
36
+ export type ExtendedPanelPathState = PanelPathState & {
37
+ initialPath: string;
38
+ slug: string;
39
+ };
40
+ export type ExtendedPanelAction = PanelAction | {
41
+ type: 'SET_INITIALPATH';
42
+ payload: string;
43
+ } | {
44
+ type: 'SET_SLUG';
45
+ payload: string;
46
+ };
47
+ export type navItemStateAction = {
48
+ type: 'SET_TITLE';
49
+ payload: string;
50
+ } | {
51
+ type: 'SET_ACTIVE';
52
+ payload: boolean;
53
+ } | {
54
+ type: 'SET_OVERRIDE';
55
+ payload: boolean;
56
+ };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { NestedNavItem, NestedNavigation } from '../../../types';
3
+ export type RouteItemProps = {
4
+ item: NestedNavItem;
5
+ initialItem?: NestedNavItem;
6
+ setActionItemParent: (item: NestedNavItem | null) => void;
7
+ setActionItem: React.Dispatch<React.SetStateAction<NestedNavItem | NestedNavigation | undefined>>;
8
+ setNavigationItems: React.Dispatch<React.SetStateAction<NestedNavItem[] | undefined>>;
9
+ ghost?: boolean;
10
+ depth?: number;
11
+ maxDepth: number;
12
+ style?: React.CSSProperties;
13
+ wrapperRef?(node: HTMLLIElement): void;
14
+ handleProps?: any;
15
+ disableInteraction?: boolean;
16
+ indentationWidth?: number;
17
+ navigationItems?: NestedNavItem[] | null;
18
+ };
@@ -0,0 +1,41 @@
1
+ import { Route } from "../../../types";
2
+ export type PanelAction = {
3
+ type: 'DEFAULT';
4
+ payload: string;
5
+ } | {
6
+ type: 'NO_URL_CHECK';
7
+ payload: string;
8
+ } | {
9
+ type: 'NO_TRANSFORM_AND_CHECK';
10
+ payload: string;
11
+ } | {
12
+ type: 'RESET_URL_CHECK_FLAG';
13
+ } | {
14
+ type: 'SET_REPLACEMENT';
15
+ payload: string;
16
+ } | {
17
+ type: 'SET_UIDPATH';
18
+ payload: string;
19
+ } | {
20
+ type: 'SET_CANONICALPATH';
21
+ payload: string;
22
+ } | {
23
+ type: 'SET_OVERRIDEPATH';
24
+ payload: string;
25
+ };
26
+ export type PanelPathState = {
27
+ value?: string;
28
+ prevValue?: string;
29
+ uidPath?: string;
30
+ needsUrlCheck: boolean;
31
+ replacement: string | null;
32
+ canonicalPath?: string;
33
+ overridePath?: string;
34
+ };
35
+ export type RouteStructureProps = {
36
+ canonicalPath?: string;
37
+ routes: Route[];
38
+ selectedParent: Route | null;
39
+ setSelectedParent: (value: Route | null) => void;
40
+ prohibitedRouteIds?: string[];
41
+ };
@@ -1,2 +1,2 @@
1
1
  import type { Route } from '../../../types/';
2
- export type RouteSortKey = keyof Pick<Route, 'title' | 'path' | 'type'>;
2
+ export type RouteSortKey = keyof Pick<Route, 'title' | 'canonicalPath' | 'path' | 'type'>;
@@ -0,0 +1,16 @@
1
+ import type { NestedNavItem } from '../../../types';
2
+ /**
3
+ * Builds a string representing the navigation hierarchy for a given target item.
4
+ *
5
+ * Traverses a flat, depth-annotated array of navigation items to construct a breadcrumb-like
6
+ * hierarchy string (e.g., "Parent > Child > Target") for the specified target item.
7
+ *
8
+ * @param navigationItems - Flat array of NestedNavItem, ordered so that parents precede children.
9
+ * @param targetItem - The navigation item for which to build the hierarchy string. Must have a valid depth property.
10
+ * @returns The navigation hierarchy as a string (e.g., "Parent > Child > Target"), or null if the target is not found or input is invalid.
11
+ */
12
+ export default function buildBreadcrumbString({ navigationItems, targetItem, includeTarget, }: {
13
+ navigationItems?: NestedNavItem[] | null;
14
+ targetItem: NestedNavItem;
15
+ includeTarget?: boolean;
16
+ }): string | null;
@@ -1,6 +1,7 @@
1
- import type { NestedNavItem, Entity, GroupedEntities } from '../../../types';
1
+ import type { NestedNavItem, Entity, GroupedEntities, RouteType } from '../../../types';
2
+ import type { ExtendedPanelPathState } from '../types';
2
3
  type CreateTempNavItemObjectParams = {
3
- parentId: string | undefined;
4
+ actionItemParentId: string | undefined;
4
5
  entityRoute: {
5
6
  documentId: string;
6
7
  } | null;
@@ -14,11 +15,8 @@ type CreateTempNavItemObjectParams = {
14
15
  };
15
16
  selectedEntity: Entity | undefined | null;
16
17
  selectedContentType: GroupedEntities | undefined | null;
17
- path?: {
18
- value: string;
19
- uidPath: string;
20
- };
21
- type?: 'internal' | 'external' | 'wrapper';
18
+ path?: ExtendedPanelPathState;
19
+ type?: RouteType;
22
20
  };
23
- export default function createTempNavItemObject({ parentId, entityRoute, selectedNavigation, navItemState, selectedEntity, selectedContentType, path, type, }: CreateTempNavItemObjectParams): NestedNavItem;
21
+ export default function createTempNavItemObject({ actionItemParentId, entityRoute, selectedNavigation, navItemState, selectedEntity, selectedContentType, path, type, }: CreateTempNavItemObjectParams): NestedNavItem;
24
22
  export {};
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * Checks if a URL is unique by making a GET request to the checkUniquePath endpoint.
3
- * @param get The authenticated GET function from useFetchClient
4
- * @param url The URL to check.
3
+ * @param fetchFunction The authenticated fetch function to make the request
4
+ * @param path The path to check for uniqueness.
5
5
  * @param routeDocumentId The ID of the route to exclude from the check.
6
- * @returns A promise that resolves to the response text if the request is successful.
6
+ * @param withoutTransform If true, the path will not be transformed/normalized before checking.
7
+ * @returns A promise that resolves to the unique path if the request is successful.
7
8
  * @throws {Error} Throws an error if the request fails or the network response is not ok.
8
9
  */
9
- export default function duplicateCheck(get: (url: string) => Promise<any>, url: string, routeDocumentId?: string | null): Promise<string>;
10
+ export default function duplicateCheck({ fetchFunction, path, routeDocumentId, withoutTransform, }: {
11
+ fetchFunction: (path: string) => Promise<any>;
12
+ path: string;
13
+ routeDocumentId?: string | null;
14
+ withoutTransform?: boolean;
15
+ }): Promise<string>;
@@ -0,0 +1,13 @@
1
+ import type { NestedNavItem } from '../../../types';
2
+ /**
3
+ * Finds the parent navigation item of a given target item in a flat, depth-annotated array.
4
+ *
5
+ * @param navigationItems - Flat array of NestedNavItem, ordered such that parents precede children.
6
+ * @param targetItem - The item whose parent is to be found. Must have a valid depth property.
7
+ * @returns The parent NestedNavItem if found, otherwise null.
8
+ */
9
+ export default function findParentNavItem({ navigationItems, targetItem, onlyInternalItems, }: {
10
+ navigationItems?: NestedNavItem[] | null;
11
+ targetItem: NestedNavItem;
12
+ onlyInternalItems?: boolean;
13
+ }): NestedNavItem | null;
@@ -2,6 +2,7 @@ import debounce from "./debounce";
2
2
  import duplicateCheck from "./duplicateCheck";
3
3
  import { isNestedNavigation, isNestedNavItem } from "./typeChecks";
4
4
  import getTranslation from "./getTranslation";
5
- import countChildren from "./countChildren";
6
5
  import createTempNavItemObject from "./createTempNavItemObject";
7
- export { debounce, duplicateCheck, isNestedNavigation, isNestedNavItem, getTranslation, countChildren, createTempNavItemObject };
6
+ import findParentNavItem from "./findParentNavItem";
7
+ import buildBreadcrumbString from "./buildBreadcrumbString";
8
+ export { debounce, duplicateCheck, isNestedNavigation, isNestedNavItem, getTranslation, createTempNavItemObject, findParentNavItem, buildBreadcrumbString, };