@mattisvensson/strapi-plugin-webatlas 0.12.2 → 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/README.md +46 -1
- package/dist/admin/{SettingTitle-DXGCUfum.js → ContentBox-CHwpYMiB.js} +1 -5
- package/dist/admin/{SettingTitle-C1_2epDJ.mjs → ContentBox-CYnyB_5a.mjs} +2 -6
- package/dist/admin/{RoutePicker-C6LpgVMi.mjs → RoutePicker-43YnYCpH.mjs} +1 -1
- package/dist/admin/{RoutePicker-DvzQH2CX.js → RoutePicker-D9zf-VdN.js} +1 -1
- package/dist/admin/WarningBox-AyYq0Onj.mjs +18 -0
- package/dist/admin/{WarningBox-BHlYlKQ8.js → WarningBox-FF1yYDXP.js} +0 -24
- package/dist/admin/{de-BWUGdpM0.js → de-DolV3m7M.js} +115 -5
- package/dist/admin/{de-Dnk_hvMW.mjs → de-Dt3jjL3h.mjs} +115 -5
- package/dist/admin/{en-D5EqZSGy.mjs → en-CCRmKJEV.mjs} +114 -4
- package/dist/admin/{en-DOk8P6X5.js → en-jWdO5RMZ.js} +114 -4
- package/dist/admin/index-7iO5UsYI.js +174 -0
- package/dist/admin/{index-DuSnxRbO.mjs → index-B2k8Pikg.mjs} +44 -12
- package/dist/admin/index-CK4JyItR.mjs +5363 -0
- package/dist/admin/{index-CVrufPeL.mjs → index-CMuhLgfi.mjs} +74 -30
- package/dist/admin/{index-D7zg69uM.js → index-Ciem6YTr.js} +50 -18
- package/dist/admin/index-DGYmrx3f.mjs +174 -0
- package/dist/admin/index-Ddnt9W-v.mjs +1025 -0
- package/dist/admin/index-DfG_hSMk.js +5363 -0
- package/dist/admin/{index-DHNPW0YT.js → index-DmOWQK6g.js} +70 -26
- 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 +584 -53
- package/dist/server/index.mjs +585 -54
- 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 +31 -8
- 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/WarningBox-CfIVF0O-.mjs +0 -42
- package/dist/admin/index-DC-2-FsX.mjs +0 -9622
- package/dist/admin/index-Dp_eCRFS.js +0 -249
- package/dist/admin/index-Dx4gvFWK.mjs +0 -147
- package/dist/admin/index-FuvoHpAT.js +0 -147
- package/dist/admin/index-RmZ3LQPu.js +0 -9622
- package/dist/admin/index-Y4uwBSjP.mjs +0 -249
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -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.Element;
|
|
7
|
+
export default OverrideCheckbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConfigContentType } from '../../../../types';
|
|
2
|
+
import { PanelAction, PanelPathState } from '../../types';
|
|
3
|
+
type PathInputProps = {
|
|
4
|
+
path: PanelPathState;
|
|
5
|
+
dispatchPath: React.Dispatch<PanelAction>;
|
|
6
|
+
isOverride: boolean;
|
|
7
|
+
config: ConfigContentType;
|
|
8
|
+
hasUserInteracted: React.MutableRefObject<boolean>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function PathInput({ path, dispatchPath, isOverride, config, hasUserInteracted, disabled, }: PathInputProps): import("react").JSX.Element;
|
|
12
|
+
export default PathInput;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RouteStructureProps } from '../../types';
|
|
2
|
+
declare function RouteStructure({ routes, selectedParent, setSelectedParent, canonicalPath, prohibitedRouteIds, defaultParentRoute, isCreatingEntry, disabled, }: RouteStructureProps): import("react").JSX.Element;
|
|
3
|
+
export default RouteStructure;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationState } from '../types';
|
|
2
|
+
interface PathProps {
|
|
3
|
+
validationState: ValidationState;
|
|
4
|
+
replacement: string | null;
|
|
5
|
+
isBlacklisted?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function PathInfo({ validationState, replacement, isBlacklisted }: PathProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface InputProps {
|
|
2
|
+
attribute: {
|
|
3
|
+
type: string;
|
|
4
|
+
};
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
intlLabel: {
|
|
9
|
+
id: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
name: string;
|
|
13
|
+
onChange: (event: {
|
|
14
|
+
target: {
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
}) => void;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
value?: string;
|
|
22
|
+
hint?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export default Input;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NestedNavigation } from '../../../../types';
|
|
2
|
+
type DeleteProps = {
|
|
3
|
+
item: NestedNavigation;
|
|
4
|
+
onDelete: (editedItem: NestedNavigation) => void;
|
|
5
|
+
};
|
|
6
|
+
export default function Delete({ item, onDelete }: DeleteProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function NavCreate(): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NestedNavigation } from '../../../../types';
|
|
2
|
+
type NavEditProps = {
|
|
3
|
+
item: NestedNavigation;
|
|
4
|
+
onEdit: (editedNavigation: NestedNavigation) => void;
|
|
5
|
+
};
|
|
6
|
+
export default function NavEdit({ item, onEdit }: NavEditProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function NavModal({ triggerText, triggerVariant, confirmText, closeText, titleText, loadingText, children, onConfirm, loading, modalToOpen, footer, currentModalType, currentModalMode, disabled, }: {
|
|
2
|
+
triggerText?: string;
|
|
3
|
+
triggerVariant?: 'default' | 'secondary';
|
|
4
|
+
confirmText: string;
|
|
5
|
+
closeText: string;
|
|
6
|
+
titleText: string;
|
|
7
|
+
loadingText?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
onConfirm?: () => void;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
modalToOpen?: string;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
currentModalType?: 'ItemCreate' | 'WrapperCreate' | 'ExternalCreate' | null;
|
|
14
|
+
currentModalMode?: 'create' | 'edit';
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NestedNavItem, NestedNavigation } from '../../../../types';
|
|
2
|
+
type NavOverviewProps = {
|
|
3
|
+
navigations: NestedNavigation[];
|
|
4
|
+
setActionItem: React.Dispatch<React.SetStateAction<NestedNavItem | NestedNavigation | undefined>>;
|
|
5
|
+
canCreate: boolean;
|
|
6
|
+
canUpdate: boolean;
|
|
7
|
+
canDelete: boolean;
|
|
8
|
+
};
|
|
9
|
+
export default function NavOverview({ navigations, setActionItem, canCreate, canUpdate, canDelete, }: NavOverviewProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../types';
|
|
2
|
+
type SaveConfirmProps = {
|
|
3
|
+
deletedItems: NestedNavItem[];
|
|
4
|
+
hasOrphanedChildren: boolean;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
};
|
|
7
|
+
export default function SaveConfirm({ deletedItems, hasOrphanedChildren, onConfirm, }: SaveConfirmProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../../types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type externalCreateProps = {
|
|
4
|
+
variant: 'ExternalCreate';
|
|
5
|
+
actionItemParentId?: string;
|
|
6
|
+
onCreate: (newItem: NestedNavItem) => void;
|
|
7
|
+
};
|
|
8
|
+
type externalEditProps = {
|
|
9
|
+
variant: 'ExternalEdit';
|
|
10
|
+
item: NestedNavItem;
|
|
11
|
+
onSave: (editedItem: NestedNavItem) => void;
|
|
12
|
+
};
|
|
13
|
+
type externalItemProps = externalCreateProps | externalEditProps;
|
|
14
|
+
export declare const ExternalItem: React.FC<externalItemProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as Delete } from './Delete';
|
|
2
|
+
import { default as NavCreate } from './NavCreate';
|
|
3
|
+
import { default as NavEdit } from './NavEdit';
|
|
4
|
+
import { default as NavOverview } from './NavOverview';
|
|
5
|
+
import { useModalSharedLogic } from './useModalSharedLogic';
|
|
6
|
+
import { withModalSharedLogic } from './withModalSharedLogic';
|
|
7
|
+
import { ExternalItem } from './externalItem';
|
|
8
|
+
import { ItemCreate } from './internalItem/internalItemCreate';
|
|
9
|
+
import { ItemEdit } from './internalItem/internalItemEdit';
|
|
10
|
+
import { WrapperItem } from './wrapperItem';
|
|
11
|
+
import { default as NavModal } from './NavModal';
|
|
12
|
+
import { default as SaveConfirm } from './SaveConfirm';
|
|
13
|
+
import { default as DiscardChanges } from './DiscardChanges';
|
|
14
|
+
export { Delete, NavCreate, NavEdit, NavOverview, useModalSharedLogic, withModalSharedLogic, ExternalItem, ItemCreate, ItemEdit, WrapperItem, NavModal, SaveConfirm, DiscardChanges, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConfigContentType, Entity } from '../../../../../types';
|
|
2
|
+
export type SelectedEntry = {
|
|
3
|
+
entry: Entity;
|
|
4
|
+
contentType: ConfigContentType;
|
|
5
|
+
};
|
|
6
|
+
export declare const getSelectionKey: (contentType: ConfigContentType, entry: Entity) => string;
|
|
7
|
+
export default function EntrySelection({ contentTypes, contentType, setContentType, query, setQuery, selectedEntries, onToggle, onClear, getUsage, }: {
|
|
8
|
+
contentTypes: ConfigContentType[];
|
|
9
|
+
contentType: ConfigContentType | undefined;
|
|
10
|
+
setContentType: (contentType: ConfigContentType) => void;
|
|
11
|
+
query: string;
|
|
12
|
+
setQuery: (query: string) => void;
|
|
13
|
+
selectedEntries: Map<string, SelectedEntry>;
|
|
14
|
+
onToggle: (selectedEntry: SelectedEntry) => void;
|
|
15
|
+
onClear: () => void;
|
|
16
|
+
getUsage: (entry: Entity) => string | null;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Route, NestedNavItem, NestedNavigation } from '../../../../../types';
|
|
2
|
+
import { ModalItem_VariantCreate } from '../../../types';
|
|
3
|
+
import { useModalSharedLogic } from '../useModalSharedLogic';
|
|
4
|
+
type ItemDetailsProps = Pick<ModalItem_VariantCreate & ReturnType<typeof useModalSharedLogic>, 'navItemState' | 'dispatchNavItemState' | 'path' | 'dispatchPath' | 'validationState' | 'isBlacklisted' | 'debouncedCheckUrl' | 'cancelUrlCheck' | 'debouncedCheckBlacklist'> & {
|
|
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, isBlacklisted, parentNavItem, navigationItems, navigations, debouncedCheckUrl, cancelUrlCheck, debouncedCheckBlacklist, item, route, modalVariant, }: ItemDetailsProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ConfigContentType, Entity, NestedNavItem, Route } from '../../../../../types';
|
|
2
|
+
import { SelectedEntry } from './EntrySelection';
|
|
3
|
+
type RowStatus = 'loading' | 'checking' | 'ok' | 'replaced' | 'blacklisted' | 'duplicate' | 'noRoute' | 'error';
|
|
4
|
+
export type ReviewRow = {
|
|
5
|
+
key: string;
|
|
6
|
+
entry: Entity;
|
|
7
|
+
contentType: ConfigContentType;
|
|
8
|
+
route: Route | null;
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
path: string;
|
|
12
|
+
status: RowStatus;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A row can be added when its path is checked and unique, also among the other selected entries.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isRowValid: (row: ReviewRow) => boolean;
|
|
18
|
+
export default function MultiItemReview({ selectedEntries, parentNavItem, onRowsChange, }: {
|
|
19
|
+
selectedEntries: SelectedEntry[];
|
|
20
|
+
parentNavItem: NestedNavItem | null;
|
|
21
|
+
onRowsChange: (rows: ReviewRow[]) => void;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../../types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type wrapperCreateProps = {
|
|
4
|
+
variant: 'WrapperCreate';
|
|
5
|
+
actionItemParentId?: string;
|
|
6
|
+
onCreate: (newItem: NestedNavItem) => void;
|
|
7
|
+
};
|
|
8
|
+
type wrapperEditProps = {
|
|
9
|
+
variant: 'WrapperEdit';
|
|
10
|
+
item: NestedNavItem;
|
|
11
|
+
onSave: (editedItem: NestedNavItem) => void;
|
|
12
|
+
};
|
|
13
|
+
type wrapperItemProps = wrapperCreateProps | wrapperEditProps;
|
|
14
|
+
export declare const WrapperItem: React.FC<wrapperItemProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ConfigContentType, NestedNavigation } from '../../../types';
|
|
3
|
+
type ModalContextType = {
|
|
4
|
+
modalType: string;
|
|
5
|
+
setModalType: Dispatch<SetStateAction<string>>;
|
|
6
|
+
};
|
|
7
|
+
type SelectedNavigationContextType = {
|
|
8
|
+
selectedNavigation: NestedNavigation | undefined;
|
|
9
|
+
setSelectedNavigation: Dispatch<SetStateAction<NestedNavigation | undefined>>;
|
|
10
|
+
};
|
|
11
|
+
type ContentTypesContextType = {
|
|
12
|
+
contentTypes: ConfigContentType[];
|
|
13
|
+
};
|
|
14
|
+
export declare const ModalContext: import('react').Context<ModalContextType>;
|
|
15
|
+
export declare const SelectedNavigationContext: import('react').Context<SelectedNavigationContextType>;
|
|
16
|
+
export declare const ContentTypesContext: import('react').Context<ContentTypesContextType>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as useAllContentTypes } from './useAllContentTypes';
|
|
2
|
+
import { default as useAllEntities } from './useAllEntities';
|
|
3
|
+
import { default as useApi } from './useApi';
|
|
4
|
+
import { default as useErrorMessage } from './useErrorMessage';
|
|
5
|
+
import { default as usePluginConfig } from './usePluginConfig';
|
|
6
|
+
import { default as useEntrySearch } from './useEntrySearch';
|
|
7
|
+
export { useAllContentTypes, useAllEntities, useApi, useErrorMessage, usePluginConfig, useEntrySearch, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Route, GroupedEntities, StructuredNavigationVariant, NavigationInput, NestedNavItem, NavigationDepth, HealthReport } from '../../../types';
|
|
2
|
+
export default function useApi(): {
|
|
3
|
+
fetchAllContentTypes: () => Promise<any>;
|
|
4
|
+
fetchAllEntities: () => Promise<GroupedEntities[]>;
|
|
5
|
+
getRelatedRoute: (relatedDocumentId: string) => Promise<Route>;
|
|
6
|
+
getRoute: (documentId: string) => Promise<Route>;
|
|
7
|
+
getAllRoutes: () => Promise<Route[]>;
|
|
8
|
+
getHealthReport: () => Promise<HealthReport>;
|
|
9
|
+
getProhibitedRouteIds: (documentId?: string) => Promise<string[]>;
|
|
10
|
+
getNavigation: ({ documentId, variant, }?: {
|
|
11
|
+
documentId?: string;
|
|
12
|
+
variant?: StructuredNavigationVariant | "namesOnly";
|
|
13
|
+
}) => Promise<any>;
|
|
14
|
+
createNavigation: (body: NavigationInput) => Promise<any>;
|
|
15
|
+
deleteNavigation: (documentId: string) => Promise<any>;
|
|
16
|
+
updateNavigation: (documentId: string, body: NavigationInput) => Promise<any>;
|
|
17
|
+
updateNavigationItemStructure: (documentId: string, navigationItems: NestedNavItem[]) => Promise<any>;
|
|
18
|
+
getNavigationDepths: () => Promise<NavigationDepth[]>;
|
|
19
|
+
updateNavigationDepths: (depths: {
|
|
20
|
+
documentId: string;
|
|
21
|
+
maxDepth: number;
|
|
22
|
+
}[]) => Promise<NavigationDepth[]>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConfigContentType, Entity } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Searches the entries of a content type page by page through the content manager, so content types
|
|
4
|
+
* with many entries never have to be loaded completely. Sorted by the route source field.
|
|
5
|
+
*/
|
|
6
|
+
export default function useEntrySearch(contentType: ConfigContentType | undefined, query: string): {
|
|
7
|
+
entries: Entity[];
|
|
8
|
+
paths: Map<string, string | null>;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
hasError: boolean;
|
|
11
|
+
hasMore: boolean;
|
|
12
|
+
loadMore: () => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a helper that prefers the message the API sent (ApplicationError, ValidationError, ...)
|
|
3
|
+
* over the generic fallback, so users see why an action failed instead of
|
|
4
|
+
* "Request failed with status code 400". Non-API errors fall back to the passed message.
|
|
5
|
+
*
|
|
6
|
+
* The helper is memoized so it can be used as an effect dependency.
|
|
7
|
+
*/
|
|
8
|
+
export default function useErrorMessage(): (error: unknown, fallback: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PluginConfig } from '../../../types';
|
|
2
|
+
type UsePluginConfigResponse = {
|
|
3
|
+
config: PluginConfig | null;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
fetchError: unknown;
|
|
6
|
+
setConfig: (body: Partial<PluginConfig>) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export default function usePluginConfig(): UsePluginConfigResponse;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NestedNavigation } from '../../../../types';
|
|
2
|
+
export default function PageWrapper({ navigations, loading, itemCount, actions, children, }: {
|
|
3
|
+
navigations: NestedNavigation[];
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
itemCount?: number;
|
|
6
|
+
actions?: React.ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../types';
|
|
2
|
+
export default function RouteItemMenu({ item, depth, maxDepth, readOnly, handleEdit, handleAddChildren, handleDelete, handleRestore, handleUndoDelete, }: {
|
|
3
|
+
item: NestedNavItem;
|
|
4
|
+
depth?: number;
|
|
5
|
+
maxDepth: number;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
handleEdit: () => void;
|
|
8
|
+
handleAddChildren: () => void;
|
|
9
|
+
handleDelete: () => void;
|
|
10
|
+
handleRestore: () => void;
|
|
11
|
+
handleUndoDelete: () => void;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asks for confirmation before leaving the page with unsaved changes, like the forms of the content
|
|
3
|
+
* manager. Uses the translations of the Strapi admin, so the dialog matches the rest of the admin.
|
|
4
|
+
*/
|
|
5
|
+
export default function UnsavedChangesBlocker({ when, skipRef, }: {
|
|
6
|
+
when: boolean;
|
|
7
|
+
skipRef: React.RefObject<boolean>;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes the remembered collapsed items of a navigation, e.g. when the navigation is deleted.
|
|
3
|
+
*/
|
|
4
|
+
export declare function removeCollapsedItems(navigationDocumentId: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* Collapsed items of a navigation, remembered per navigation in the localStorage of the browser.
|
|
7
|
+
*/
|
|
8
|
+
export default function useCollapsedItems(navigationDocumentId: string | undefined): {
|
|
9
|
+
collapsedIds: Set<string>;
|
|
10
|
+
toggleCollapsed: (documentId: string) => void;
|
|
11
|
+
expand: (documentId: string) => void;
|
|
12
|
+
setCollapsedIds: (ids: Set<string>) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HealthCheck, HealthReport } from '../../../../types';
|
|
2
|
+
export default function HealthSummary({ report, loading, activeCheck, handleSelectCheck, handleRecheck, }: {
|
|
3
|
+
report: HealthReport | null;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
activeCheck: string | null;
|
|
6
|
+
handleSelectCheck: (check: HealthCheck | null) => void;
|
|
7
|
+
handleRecheck: () => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Route } from '../../../../types';
|
|
2
|
+
export default function PathActionsMenu({ route, isSingleType, canReadNavigation, canEdit, }: {
|
|
3
|
+
route: Route;
|
|
4
|
+
isSingleType: boolean;
|
|
5
|
+
canReadNavigation: boolean;
|
|
6
|
+
canEdit: boolean;
|
|
7
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RouteFilterKey } from '../../types';
|
|
2
|
+
export default function PathFilters({ contentTypeOptions, selectedContentTypes, type, deviation, navigation, handleFilterChange, handleResetFilters, hasActiveFilters, }: {
|
|
3
|
+
contentTypeOptions: {
|
|
4
|
+
uid: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
selectedContentTypes: string[];
|
|
8
|
+
type: string | null;
|
|
9
|
+
deviation: string | null;
|
|
10
|
+
navigation: string | null;
|
|
11
|
+
handleFilterChange: (key: RouteFilterKey, values: string[]) => void;
|
|
12
|
+
handleResetFilters: () => void;
|
|
13
|
+
hasActiveFilters: boolean;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HealthIssue, Route } from '../../../../types';
|
|
2
|
+
import { RouteSortKey } from '../../types';
|
|
3
|
+
declare function PathTable({ routes, sortKey, sortDirection, handleSort, singleTypeUids, contentTypeLabels, issuesByRoute, canReadNavigation, readableContentTypes, hasSearch, hasActiveFilters, handleClearSearch, handleResetFilters, }: {
|
|
4
|
+
routes: Route[];
|
|
5
|
+
sortKey: RouteSortKey;
|
|
6
|
+
sortDirection: 'asc' | 'desc';
|
|
7
|
+
handleSort: (key: RouteSortKey) => void;
|
|
8
|
+
singleTypeUids: Set<string>;
|
|
9
|
+
contentTypeLabels: Map<string, string>;
|
|
10
|
+
issuesByRoute: Map<string, HealthIssue[]>;
|
|
11
|
+
canReadNavigation: boolean;
|
|
12
|
+
readableContentTypes: Set<string>;
|
|
13
|
+
hasSearch: boolean;
|
|
14
|
+
hasActiveFilters: boolean;
|
|
15
|
+
handleClearSearch: () => void;
|
|
16
|
+
handleResetFilters: () => void;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export default PathTable;
|