@mattisvensson/strapi-plugin-webatlas 0.13.0 → 0.14.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.
- package/dist/admin/{ContentBox-D4PGQ8eh.js → ContentBox-CHwpYMiB.js} +1 -1
- package/dist/admin/{ContentBox-KyQN2KGV.mjs → ContentBox-CYnyB_5a.mjs} +1 -1
- package/dist/admin/{RoutePicker-CgndSXoF.mjs → RoutePicker-43YnYCpH.mjs} +1 -1
- package/dist/admin/{RoutePicker-CwoMMhf_.js → RoutePicker-D9zf-VdN.js} +1 -1
- package/dist/admin/{de-Cl0vM1wA.js → de-DolV3m7M.js} +64 -1
- package/dist/admin/{de-DWs5ckOd.mjs → de-Dt3jjL3h.mjs} +64 -1
- package/dist/admin/{en-CyhISGZi.mjs → en-CCRmKJEV.mjs} +63 -0
- package/dist/admin/{en-DSmtmPYk.js → en-jWdO5RMZ.js} +63 -0
- package/dist/admin/{index-uOC1Clyv.js → index-7iO5UsYI.js} +2 -2
- package/dist/admin/{index-Bv5Ri-ri.mjs → index-B2k8Pikg.mjs} +2 -2
- package/dist/admin/{index-Ctm4TBT5.mjs → index-CK4JyItR.mjs} +63 -8
- package/dist/admin/{index-BKhrfzjO.mjs → index-CMuhLgfi.mjs} +16 -11
- package/dist/admin/{index-BxGPKxr_.js → index-Ciem6YTr.js} +2 -2
- package/dist/admin/{index-FvaXwOH0.mjs → index-DGYmrx3f.mjs} +2 -2
- package/dist/admin/index-Ddnt9W-v.mjs +1025 -0
- package/dist/admin/{index-JBUU7dE6.js → index-DfG_hSMk.js} +60 -5
- package/dist/admin/{index-DTrsl_uN.js → index-DmOWQK6g.js} +12 -7
- package/dist/admin/index-dB79zyxi.js +1025 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMEditViewAside/NewPathInfo.d.ts +5 -0
- package/dist/admin/src/components/CMEditViewAside/OverrideCheckbox.d.ts +7 -0
- package/dist/admin/src/components/CMEditViewAside/Panel.d.ts +5 -0
- package/dist/admin/src/components/CMEditViewAside/PathInput.d.ts +12 -0
- package/dist/admin/src/components/CMEditViewAside/RouteStructure.d.ts +3 -0
- package/dist/admin/src/components/CMEditViewAside/UidPathDisplay.d.ts +4 -0
- package/dist/admin/src/components/CMEditViewAside/index.d.ts +3 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PathInfo.d.ts +8 -0
- package/dist/admin/src/components/PluginIcon.d.ts +3 -0
- package/dist/admin/src/components/Tooltip.d.ts +3 -0
- package/dist/admin/src/components/UI/Center.d.ts +4 -0
- package/dist/admin/src/components/UI/EmptyBox.d.ts +5 -0
- package/dist/admin/src/components/UI/FullLoader.d.ts +3 -0
- package/dist/admin/src/components/UI/WarningBox.d.ts +4 -0
- package/dist/admin/src/components/UI/index.d.ts +5 -0
- package/dist/admin/src/components/customFields/RoutePicker.d.ts +25 -0
- package/dist/admin/src/components/modals/Delete.d.ts +7 -0
- package/dist/admin/src/components/modals/DiscardChanges.d.ts +3 -0
- package/dist/admin/src/components/modals/NavCreate.d.ts +1 -0
- package/dist/admin/src/components/modals/NavEdit.d.ts +7 -0
- package/dist/admin/src/components/modals/NavModal.d.ts +16 -0
- package/dist/admin/src/components/modals/NavOverview.d.ts +10 -0
- package/dist/admin/src/components/modals/SaveConfirm.d.ts +8 -0
- package/dist/admin/src/components/modals/externalItem/index.d.ts +15 -0
- package/dist/admin/src/components/modals/index.d.ts +14 -0
- package/dist/admin/src/components/modals/internalItem/EntrySelection.d.ts +17 -0
- package/dist/admin/src/components/modals/internalItem/ItemDetails.d.ts +13 -0
- package/dist/admin/src/components/modals/internalItem/MultiItemReview.d.ts +23 -0
- package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +2 -0
- package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +2 -0
- package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +2 -0
- package/dist/admin/src/components/modals/withModalSharedLogic.d.ts +3 -0
- package/dist/admin/src/components/modals/wrapperItem/index.d.ts +15 -0
- package/dist/admin/src/contexts/index.d.ts +17 -0
- package/dist/admin/src/hooks/index.d.ts +7 -0
- package/dist/admin/src/hooks/useAllContentTypes.d.ts +7 -0
- package/dist/admin/src/hooks/useAllEntities.d.ts +7 -0
- package/dist/admin/src/hooks/useApi.d.ts +23 -0
- package/dist/admin/src/hooks/useEntrySearch.d.ts +13 -0
- package/dist/admin/src/hooks/useErrorMessage.d.ts +8 -0
- package/dist/admin/src/hooks/usePluginConfig.d.ts +9 -0
- package/dist/admin/src/pages/Navigation/Page.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/PageWrapper.d.ts +8 -0
- package/dist/admin/src/pages/Navigation/RouteItem.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/RouteItemBadge.d.ts +4 -0
- package/dist/admin/src/pages/Navigation/RouteItemIcon.d.ts +5 -0
- package/dist/admin/src/pages/Navigation/RouteItemMenu.d.ts +12 -0
- package/dist/admin/src/pages/Navigation/RouteItemStatus.d.ts +5 -0
- package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/UnsavedChangesBlocker.d.ts +8 -0
- package/dist/admin/src/pages/Navigation/index.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/useCollapsedItems.d.ts +13 -0
- package/dist/admin/src/pages/Paths/HealthSummary.d.ts +8 -0
- package/dist/admin/src/pages/Paths/IssueBadges.d.ts +4 -0
- package/dist/admin/src/pages/Paths/PageWrapper.d.ts +5 -0
- package/dist/admin/src/pages/Paths/PathActionsMenu.d.ts +7 -0
- package/dist/admin/src/pages/Paths/PathFilters.d.ts +14 -0
- package/dist/admin/src/pages/Paths/PathTable.d.ts +18 -0
- package/dist/admin/src/pages/Paths/SearchInput.d.ts +5 -0
- package/dist/admin/src/pages/Paths/TableHeader.d.ts +6 -0
- package/dist/admin/src/pages/Paths/TableRow.d.ts +9 -0
- package/dist/admin/src/pages/Paths/compareBy.d.ts +3 -0
- package/dist/admin/src/pages/Paths/hasPathDeviation.d.ts +2 -0
- package/dist/admin/src/pages/Paths/healthMessages.d.ts +11 -0
- package/dist/admin/src/pages/Paths/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/ContentBox.d.ts +4 -0
- package/dist/admin/src/pages/Settings/General/ContentTypeAccordion.d.ts +9 -0
- package/dist/admin/src/pages/Settings/General/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/Navigation/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/PageWrapper.d.ts +7 -0
- package/dist/admin/src/pages/Settings/SettingTitle.d.ts +3 -0
- package/dist/admin/src/pages/Settings/index.d.ts +4 -0
- package/dist/admin/src/permissions.d.ts +51 -0
- package/dist/admin/src/types/index.d.ts +4 -0
- package/dist/admin/src/types/modal.d.ts +60 -0
- package/dist/admin/src/types/navigation.d.ts +24 -0
- package/dist/admin/src/types/panel.d.ts +50 -0
- package/dist/admin/src/types/route.d.ts +3 -0
- package/dist/admin/src/utils/buildBreadcrumbString.d.ts +16 -0
- package/dist/admin/src/utils/createTempNavItemObject.d.ts +22 -0
- package/dist/admin/src/utils/debounce.d.ts +1 -0
- package/dist/admin/src/utils/dnd.d.ts +13 -0
- package/dist/admin/src/utils/duplicateCheck.d.ts +19 -0
- package/dist/admin/src/utils/findParentNavItem.d.ts +13 -0
- package/dist/admin/src/utils/getRouteSourceFields.d.ts +2 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +11 -0
- package/dist/admin/src/utils/isAbortError.d.ts +5 -0
- package/dist/admin/src/utils/navTree.d.ts +39 -0
- package/dist/admin/src/utils/syncNavItemPaths.d.ts +12 -0
- package/dist/admin/src/utils/typeChecks.d.ts +3 -0
- package/dist/server/index.js +270 -2
- package/dist/server/index.mjs +270 -2
- package/dist/server/src/bootstrap/documentMiddleware.d.ts +18 -0
- package/dist/server/src/bootstrap/index.d.ts +5 -0
- package/dist/server/src/bootstrap/permissions.d.ts +2 -0
- package/dist/server/src/bootstrap/syncConfig.d.ts +3 -0
- package/dist/server/src/bootstrap/webatlasMiddleware.d.ts +2 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +8 -0
- package/dist/server/src/content-types/index.d.ts +208 -0
- package/dist/server/src/content-types/navigation/index.d.ts +56 -0
- package/dist/server/src/content-types/navigation/schema.d.ts +54 -0
- package/dist/server/src/content-types/navitem/index.d.ts +51 -0
- package/dist/server/src/content-types/navitem/schema.d.ts +49 -0
- package/dist/server/src/content-types/route/index.d.ts +101 -0
- package/dist/server/src/content-types/route/schema.d.ts +99 -0
- package/dist/server/src/controllers/admin.d.ts +19 -0
- package/dist/server/src/controllers/client.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +27 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +15 -5
- package/dist/server/src/middlewares/addWebatlasField.d.ts +10 -0
- package/dist/server/src/middlewares/enrichRoutePicker.d.ts +10 -0
- package/dist/server/src/middlewares/index.d.ts +9 -0
- package/dist/server/src/migrations/001-canonical-path.d.ts +7 -0
- package/dist/server/src/migrations/002-webatlas-json-field.d.ts +7 -0
- package/dist/server/src/migrations/003-route-source-field.d.ts +7 -0
- package/dist/server/src/migrations/004-navigation-max-depth.d.ts +7 -0
- package/dist/server/src/migrations/index.d.ts +3 -0
- package/dist/server/src/policies/has-permissions.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +4 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +17 -0
- package/dist/server/src/routes/client.d.ts +12 -0
- package/dist/server/src/routes/index.d.ts +30 -0
- package/dist/server/src/services/admin.d.ts +33 -0
- package/dist/server/src/services/client.d.ts +48 -0
- package/dist/server/src/services/health.d.ts +5 -0
- package/dist/server/src/services/index.d.ts +83 -0
- package/dist/server/src/utils/addWebatlasBreadcrumb.d.ts +14 -0
- package/dist/server/src/utils/assertDescendantPathsAllowed.d.ts +19 -0
- package/dist/server/src/utils/assertPathAllowed.d.ts +2 -0
- package/dist/server/src/utils/buildCanonicalPath.d.ts +1 -0
- package/dist/server/src/utils/buildNavigationPath.d.ts +5 -0
- package/dist/server/src/utils/buildStructuredNavigation.d.ts +12 -0
- package/dist/server/src/utils/cascadePathUpdates.d.ts +6 -0
- package/dist/server/src/utils/cleanRootKeys.d.ts +1 -0
- package/dist/server/src/utils/duplicateCheck.d.ts +1 -0
- package/dist/server/src/utils/enrichRoutePickerFields.d.ts +7 -0
- package/dist/server/src/utils/enrichWebatlasData.d.ts +6 -0
- package/dist/server/src/utils/extractRouteAndItems.d.ts +32 -0
- package/dist/server/src/utils/getDocumentStatuses.d.ts +12 -0
- package/dist/server/src/utils/getNonInternalRouteIds.d.ts +1 -0
- package/dist/server/src/utils/getPublishedDocumentIds.d.ts +11 -0
- package/dist/server/src/utils/getRouteAncestors.d.ts +1 -0
- package/dist/server/src/utils/getRouteDescendants.d.ts +1 -0
- package/dist/server/src/utils/health/checks.d.ts +48 -0
- package/dist/server/src/utils/index.d.ts +29 -0
- package/dist/server/src/utils/isBlacklistedPath.d.ts +1 -0
- package/dist/server/src/utils/navItemHandler.d.ts +5 -0
- package/dist/server/src/utils/navigationItemStructure.d.ts +27 -0
- package/dist/server/src/utils/normalizeRouteBlacklist.d.ts +5 -0
- package/dist/server/src/utils/pluginHelpers.d.ts +4 -0
- package/dist/server/src/utils/populateDeep.d.ts +4 -0
- package/dist/server/src/utils/reduceDepthOfOrphanedItems.d.ts +2 -0
- package/dist/server/src/utils/removeUnpublishedNavItems.d.ts +7 -0
- package/dist/server/src/utils/removeWaFields.d.ts +1 -0
- package/dist/server/src/utils/routeHandler.d.ts +5 -0
- package/dist/server/src/utils/validateRouteDependencies.d.ts +4 -0
- package/package.json +5 -5
- package/dist/admin/index-D2O7sLKs.mjs +0 -249
- package/dist/admin/index-jOCO4_-k.js +0 -249
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HealthIssue, Route } from '../../../../types';
|
|
2
|
+
export default function TableRow({ route, isSingleType, contentTypeLabel, issues, canReadNavigation, canEdit, }: {
|
|
3
|
+
route: Route;
|
|
4
|
+
isSingleType: boolean;
|
|
5
|
+
contentTypeLabel?: string;
|
|
6
|
+
issues?: HealthIssue[];
|
|
7
|
+
canReadNavigation: boolean;
|
|
8
|
+
canEdit: boolean;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HealthCheck, HealthIssue, HealthSeverity } from '../../../../types';
|
|
2
|
+
import { IntlShape } from 'react-intl';
|
|
3
|
+
export declare const HEALTH_CHECKS: HealthCheck[];
|
|
4
|
+
export declare const SEVERITY_COLORS: Record<HealthSeverity, {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getCheckLabel: (check: HealthCheck, { formatMessage }: IntlShape) => string;
|
|
10
|
+
export declare const getCheckDescription: (check: HealthCheck, { formatMessage }: IntlShape) => string;
|
|
11
|
+
export declare function getIssueMessage({ check, details }: HealthIssue, intl: IntlShape): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContentType, ConfigContentType, GroupedEntities } from '../../../../../types';
|
|
2
|
+
export default function ContentTypeAccordion({ contentType, contentTypeSettings, dispatch, allGroupedEntities, entitiesLoading, disabled, }: {
|
|
3
|
+
contentType: ContentType | undefined;
|
|
4
|
+
contentTypeSettings: ConfigContentType;
|
|
5
|
+
dispatch: React.Dispatch<any>;
|
|
6
|
+
allGroupedEntities: GroupedEntities[];
|
|
7
|
+
entitiesLoading: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
declare const pluginPermissions: {
|
|
2
|
+
'cm.aside': {
|
|
3
|
+
action: string;
|
|
4
|
+
subject: null;
|
|
5
|
+
}[];
|
|
6
|
+
'cm.edit-path': {
|
|
7
|
+
action: string;
|
|
8
|
+
subject: null;
|
|
9
|
+
}[];
|
|
10
|
+
'navigation.read': {
|
|
11
|
+
action: string;
|
|
12
|
+
subject: null;
|
|
13
|
+
}[];
|
|
14
|
+
'navigation.create': {
|
|
15
|
+
action: string;
|
|
16
|
+
subject: null;
|
|
17
|
+
}[];
|
|
18
|
+
'navigation.update': {
|
|
19
|
+
action: string;
|
|
20
|
+
subject: null;
|
|
21
|
+
}[];
|
|
22
|
+
'navigation.delete': {
|
|
23
|
+
action: string;
|
|
24
|
+
subject: null;
|
|
25
|
+
}[];
|
|
26
|
+
'navigation.edit-items': {
|
|
27
|
+
action: string;
|
|
28
|
+
subject: null;
|
|
29
|
+
}[];
|
|
30
|
+
'page.routes': {
|
|
31
|
+
action: string;
|
|
32
|
+
subject: null;
|
|
33
|
+
}[];
|
|
34
|
+
'settings.general.read': {
|
|
35
|
+
action: string;
|
|
36
|
+
subject: null;
|
|
37
|
+
}[];
|
|
38
|
+
'settings.general.update': {
|
|
39
|
+
action: string;
|
|
40
|
+
subject: null;
|
|
41
|
+
}[];
|
|
42
|
+
'settings.navigation.read': {
|
|
43
|
+
action: string;
|
|
44
|
+
subject: null;
|
|
45
|
+
}[];
|
|
46
|
+
'settings.navigation.update': {
|
|
47
|
+
action: string;
|
|
48
|
+
subject: null;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
export default pluginPermissions;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ConfigContentType, NestedNavItem, NestedNavigation, RouteSettings } from '../../../types';
|
|
2
|
+
import { PanelPathState, PanelAction, ValidationState } from '../types';
|
|
3
|
+
export type ModalItem_VariantCreate = {
|
|
4
|
+
actionItemParent: NestedNavItem | null;
|
|
5
|
+
navigationItems?: NestedNavItem[] | null;
|
|
6
|
+
navigations: NestedNavigation[] | null;
|
|
7
|
+
onCreate: (newItems: NestedNavItem[]) => void;
|
|
8
|
+
};
|
|
9
|
+
export type ModalItem_VariantEdit = {
|
|
10
|
+
item: NestedNavItem;
|
|
11
|
+
navigationItems?: NestedNavItem[] | null;
|
|
12
|
+
onEdit: (editedItem: NestedNavItem) => void;
|
|
13
|
+
};
|
|
14
|
+
export type modalSharedLogic = {
|
|
15
|
+
availableContentTypes: ConfigContentType[];
|
|
16
|
+
selectedContentType: ConfigContentType | undefined;
|
|
17
|
+
setSelectedContentType: (value: ConfigContentType) => void;
|
|
18
|
+
contentTypes: ConfigContentType[];
|
|
19
|
+
validationState: ValidationState;
|
|
20
|
+
setValidationState: (value: ValidationState) => void;
|
|
21
|
+
isBlacklisted: boolean;
|
|
22
|
+
initialState: React.MutableRefObject<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
|
+
cancelUrlCheck: () => void;
|
|
33
|
+
debouncedCheckBlacklist: ({ url }: {
|
|
34
|
+
url: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
modalType: string;
|
|
37
|
+
setModalType: (value: string) => void;
|
|
38
|
+
selectedNavigation: NestedNavigation | undefined;
|
|
39
|
+
};
|
|
40
|
+
export type ExtendedPanelPathState = PanelPathState & {
|
|
41
|
+
initialPath: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
};
|
|
44
|
+
export type ExtendedPanelAction = PanelAction | {
|
|
45
|
+
type: 'SET_INITIALPATH';
|
|
46
|
+
payload: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'SET_SLUG';
|
|
49
|
+
payload: string;
|
|
50
|
+
};
|
|
51
|
+
export type navItemStateAction = {
|
|
52
|
+
type: 'SET_TITLE';
|
|
53
|
+
payload: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'SET_ACTIVE';
|
|
56
|
+
payload: boolean;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'SET_OVERRIDE';
|
|
59
|
+
payload: boolean;
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NestedNavItem, NestedNavigation } from '../../../types';
|
|
2
|
+
export type RouteItemProps = {
|
|
3
|
+
item: NestedNavItem;
|
|
4
|
+
isMoved?: boolean;
|
|
5
|
+
movedChildCount?: number;
|
|
6
|
+
onInsertBelow?: (item: NestedNavItem) => void;
|
|
7
|
+
setActionItemParent: (item: NestedNavItem | null) => void;
|
|
8
|
+
setActionItem: React.Dispatch<React.SetStateAction<NestedNavItem | NestedNavigation | undefined>>;
|
|
9
|
+
setNavigationItems: React.Dispatch<React.SetStateAction<NestedNavItem[] | undefined>>;
|
|
10
|
+
ghost?: boolean;
|
|
11
|
+
depth?: number;
|
|
12
|
+
maxDepth: number;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
wrapperRef?(node: HTMLDivElement): void;
|
|
15
|
+
handleProps?: any;
|
|
16
|
+
disableInteraction?: boolean;
|
|
17
|
+
indentationWidth?: number;
|
|
18
|
+
navigationItems?: NestedNavItem[] | null;
|
|
19
|
+
hasChildren?: boolean;
|
|
20
|
+
collapsed?: boolean;
|
|
21
|
+
onToggleCollapse?: (documentId: string) => void;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
highlighted?: boolean;
|
|
24
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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: 'SET_URL_CHECK_FLAG';
|
|
13
|
+
payload?: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'SET_REPLACEMENT';
|
|
16
|
+
payload: string | null;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'SET_UIDPATH';
|
|
19
|
+
payload: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'SET_SLUG';
|
|
22
|
+
payload: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'SET_CANONICALPATH';
|
|
25
|
+
payload: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'SET_OVERRIDEPATH';
|
|
28
|
+
payload: string;
|
|
29
|
+
};
|
|
30
|
+
export type PanelPathState = {
|
|
31
|
+
value?: string;
|
|
32
|
+
prevValue?: string;
|
|
33
|
+
uidPath?: string;
|
|
34
|
+
needsUrlCheck: boolean;
|
|
35
|
+
replacement: string | null;
|
|
36
|
+
canonicalPath?: string;
|
|
37
|
+
slug?: string;
|
|
38
|
+
overridePath?: string;
|
|
39
|
+
};
|
|
40
|
+
export type RouteStructureProps = {
|
|
41
|
+
canonicalPath?: string;
|
|
42
|
+
routes: Route[];
|
|
43
|
+
selectedParent: Route | null;
|
|
44
|
+
setSelectedParent: (value: Route | null) => void;
|
|
45
|
+
prohibitedRouteIds?: string[];
|
|
46
|
+
defaultParentRoute?: string;
|
|
47
|
+
isCreatingEntry: boolean;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type ValidationState = 'initial' | 'checking' | 'done' | 'idle';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { 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;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NestedNavItem, Entity, ConfigContentType, RouteType } from '../../../types';
|
|
2
|
+
import { ExtendedPanelPathState } from '../types';
|
|
3
|
+
type CreateTempNavItemObjectParams = {
|
|
4
|
+
actionItemParentId: string | undefined;
|
|
5
|
+
entityRoute: {
|
|
6
|
+
documentId: string;
|
|
7
|
+
} | null;
|
|
8
|
+
selectedNavigation: {
|
|
9
|
+
documentId: string;
|
|
10
|
+
} | null;
|
|
11
|
+
navItemState: {
|
|
12
|
+
active?: boolean;
|
|
13
|
+
isOverride?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
};
|
|
16
|
+
selectedEntity: Entity | undefined | null;
|
|
17
|
+
selectedContentType: ConfigContentType | undefined | null;
|
|
18
|
+
path?: ExtendedPanelPathState;
|
|
19
|
+
type?: RouteType;
|
|
20
|
+
};
|
|
21
|
+
export default function createTempNavItemObject({ actionItemParentId, entityRoute, selectedNavigation, navItemState, selectedEntity, selectedContentType, path, type, }: CreateTempNavItemObjectParams): NestedNavItem;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function debounce<T extends any[]>(func: (...args: T) => void, wait: number): (...args: T) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../types';
|
|
2
|
+
import { UniqueIdentifier, MeasuringStrategy } from '@dnd-kit/core';
|
|
3
|
+
export declare const measuring: {
|
|
4
|
+
droppable: {
|
|
5
|
+
strategy: MeasuringStrategy;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const indentationWidth = 32;
|
|
9
|
+
export declare function getProjection(items: NestedNavItem[] | undefined, activeId: UniqueIdentifier, overId: UniqueIdentifier, dragOffset: number, maxDepthValue: number): {
|
|
10
|
+
depth: number;
|
|
11
|
+
maxDepth: number;
|
|
12
|
+
minDepth: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a URL is unique by making a GET request to the checkUniquePath endpoint.
|
|
3
|
+
* @param fetchFunction The authenticated fetch function to make the request
|
|
4
|
+
* @param path The path to check for uniqueness.
|
|
5
|
+
* @param routeDocumentId The ID of the route to exclude from the check.
|
|
6
|
+
* @param withoutTransform If true, the path will not be transformed/normalized before checking.
|
|
7
|
+
* @returns A promise that resolves to the unique path, or `blacklisted` if the path is blocked by
|
|
8
|
+
* the route blacklist.
|
|
9
|
+
* @throws {Error} Throws an error if the request fails or the network response is not ok.
|
|
10
|
+
*/
|
|
11
|
+
export default function duplicateCheck({ fetchFunction, path, routeDocumentId, withoutTransform, }: {
|
|
12
|
+
fetchFunction: (path: string) => Promise<any>;
|
|
13
|
+
path: string;
|
|
14
|
+
routeDocumentId?: string | null;
|
|
15
|
+
withoutTransform?: boolean;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
uniquePath: string | null;
|
|
18
|
+
blacklisted: boolean;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { 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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as debounce } from './debounce';
|
|
2
|
+
import { default as duplicateCheck } from './duplicateCheck';
|
|
3
|
+
import { isNestedNavigation, isNestedNavItem } from './typeChecks';
|
|
4
|
+
import { default as getTranslation } from './getTranslation';
|
|
5
|
+
import { default as createTempNavItemObject } from './createTempNavItemObject';
|
|
6
|
+
import { default as findParentNavItem } from './findParentNavItem';
|
|
7
|
+
import { default as buildBreadcrumbString } from './buildBreadcrumbString';
|
|
8
|
+
import { default as getRouteSourceFields } from './getRouteSourceFields';
|
|
9
|
+
import { default as isAbortError } from './isAbortError';
|
|
10
|
+
import { default as syncNavItemPaths, getNavItemPath } from './syncNavItemPaths';
|
|
11
|
+
export { debounce, duplicateCheck, isNestedNavigation, isNestedNavItem, getTranslation, createTempNavItemObject, findParentNavItem, buildBreadcrumbString, getRouteSourceFields, isAbortError, syncNavItemPaths, getNavItemPath, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strapi's useFetchClient aborts every in-flight request when its component unmounts. The resulting
|
|
3
|
+
* rejection is expected behaviour, not a failure, and must not reach the user as a notification.
|
|
4
|
+
*/
|
|
5
|
+
export default function isAbortError(error: unknown): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
2
|
+
import { NestedNavItem } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the documentIds of all items that have at least one child.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getItemsWithChildren(items: NestedNavItem[]): Set<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the items without the descendants of collapsed items.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCollapsedVisibleItems(items: NestedNavItem[], collapsedIds: Set<string>): NestedNavItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns the items whose title or path contains the query, together with all their ancestors.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSearchVisibleItems(items: NestedNavItem[], query: string): NestedNavItem[];
|
|
15
|
+
/**
|
|
16
|
+
* Returns the documentIds of the items that were moved compared to the initial items: their depth
|
|
17
|
+
* changed, or their position among the siblings they had before and still have changed. Siblings that
|
|
18
|
+
* were added, removed or moved to another parent do not count, so the remaining siblings are not
|
|
19
|
+
* marked just because they shift.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getMovedItemIds(initialItems: NestedNavItem[], items: NestedNavItem[]): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns how many levels the descendants of the item reach below it, 0 if it has no children.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSubtreeDepth(items: NestedNavItem[], index: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the number of descendants of the item, including grandchildren.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getDescendantCount(items: NestedNavItem[], index: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the closest item above the given item with a lower depth.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getParentItem(items: NestedNavItem[], id: UniqueIdentifier): NestedNavItem | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Moves the active item to the position of the over item and gives it the new depth. Positions refer
|
|
36
|
+
* to the visible items: every visible item is moved together with the hidden items that follow it,
|
|
37
|
+
* so a collapsed item takes its children along while the children of an expanded item stay in place.
|
|
38
|
+
*/
|
|
39
|
+
export declare function moveNavItem(items: NestedNavItem[], visibleItems: NestedNavItem[], activeId: UniqueIdentifier, overId: UniqueIdentifier, depth: number): NestedNavItem[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the path of a navigation item. Internal items are built from the path of their closest
|
|
4
|
+
* internal parent and their own slug, other items keep the path of their route.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getNavItemPath(navigationItems: NestedNavItem[], item: NestedNavItem): string;
|
|
7
|
+
/**
|
|
8
|
+
* Keeps clientModifications.path of all internal items in sync with their computed path.
|
|
9
|
+
* Items are processed in order, so parents are already synced when the path of their children is
|
|
10
|
+
* computed. Returns the given array if nothing changed.
|
|
11
|
+
*/
|
|
12
|
+
export default function syncNavItemPaths(navigationItems: NestedNavItem[], initialNavigationItems: NestedNavItem[] | null): NestedNavItem[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NestedNavItem, NestedNavigation } from '../../../types';
|
|
2
|
+
export declare function isNestedNavigation(item: NestedNavItem | NestedNavigation | undefined): item is NestedNavigation;
|
|
3
|
+
export declare function isNestedNavItem(item: NestedNavItem | NestedNavigation | undefined): item is NestedNavItem;
|