@mattisvensson/strapi-plugin-webatlas 0.1.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/LICENSE.md +9 -0
- package/README.md +140 -0
- package/dist/_chunks/_commonjsHelpers-BxmBWJD2.mjs +33 -0
- package/dist/_chunks/_commonjsHelpers-Cq6wktVC.js +32 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/_chunks/index-B76GOOtR.js +18024 -0
- package/dist/_chunks/index-B8hoZtTR.js +47 -0
- package/dist/_chunks/index-B8i-28Jt.mjs +774 -0
- package/dist/_chunks/index-BFv_JAKx.mjs +6814 -0
- package/dist/_chunks/index-CJUhT0VV.js +773 -0
- package/dist/_chunks/index-D9yK1vNq.js +6814 -0
- package/dist/_chunks/index-DClS2XL-.mjs +47 -0
- package/dist/_chunks/index-DbKqIKw_.mjs +17984 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +5 -0
- package/dist/admin/src/components/CMEditViewAside/index.d.ts +2 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -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 +5 -0
- package/dist/admin/src/components/URLInfo.d.ts +6 -0
- package/dist/admin/src/components/modals/Delete.d.ts +14 -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 +15 -0
- package/dist/admin/src/components/modals/NavOverview.d.ts +8 -0
- package/dist/admin/src/components/modals/externalItem/index.d.ts +9 -0
- package/dist/admin/src/components/modals/index.d.ts +12 -0
- package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +3 -0
- package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +3 -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 +9 -0
- package/dist/admin/src/contexts/index.d.ts +13 -0
- package/dist/admin/src/hooks/index.d.ts +6 -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 +15 -0
- package/dist/admin/src/hooks/useNavigations.d.ts +5 -0
- package/dist/admin/src/hooks/usePluginConfig.d.ts +9 -0
- package/dist/admin/src/index.d.ts +12 -0
- package/dist/admin/src/pages/Navigation/EmptyNav.d.ts +5 -0
- package/dist/admin/src/pages/Navigation/Header.d.ts +6 -0
- package/dist/admin/src/pages/Navigation/RouteItem.d.ts +15 -0
- package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +2 -0
- package/dist/admin/src/pages/Navigation/index.d.ts +2 -0
- package/dist/admin/src/pages/Routes/index.d.ts +2 -0
- package/dist/admin/src/pages/Settings/index.d.ts +2 -0
- package/dist/admin/src/utils/countChildren.d.ts +2 -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 +8 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +6 -0
- package/dist/admin/src/utils/typeChecks.d.ts +3 -0
- package/dist/pluginId.d.ts +3 -0
- package/dist/server/index.js +1861 -0
- package/dist/server/index.mjs +1862 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/index.d.ts +189 -0
- package/dist/server/src/content-types/navigation/index.d.ts +49 -0
- package/dist/server/src/content-types/navigation/schema.d.ts +47 -0
- package/dist/server/src/content-types/navitem/index.d.ts +50 -0
- package/dist/server/src/content-types/navitem/schema.d.ts +48 -0
- package/dist/server/src/content-types/route/index.d.ts +90 -0
- package/dist/server/src/content-types/route/schema.d.ts +88 -0
- package/dist/server/src/controllers/admin.d.ts +16 -0
- package/dist/server/src/controllers/client.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +24 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +279 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +13 -0
- package/dist/server/src/routes/client.d.ts +12 -0
- package/dist/server/src/routes/index.d.ts +26 -0
- package/dist/server/src/services/admin.d.ts +19 -0
- package/dist/server/src/services/client.d.ts +8 -0
- package/dist/server/src/services/index.d.ts +26 -0
- package/dist/server/src/utils/duplicateCheck.d.ts +1 -0
- package/dist/server/src/utils/pluginHelpers.d.ts +6 -0
- package/dist/utils/buildStructuredNavigation.d.ts +11 -0
- package/dist/utils/cleanRootKeys.d.ts +1 -0
- package/dist/utils/extractRouteAndItems.d.ts +2 -0
- package/dist/utils/getFullPath.d.ts +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/populateDeep.d.ts +4 -0
- package/dist/utils/removeWaFields.d.ts +1 -0
- package/dist/utils/transformToUrl.d.ts +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NestedNavigation, NestedNavItem } from '../../../../types';
|
|
2
|
+
type NavDelete = {
|
|
3
|
+
variant: "NavDelete";
|
|
4
|
+
item: NestedNavigation;
|
|
5
|
+
fetchNavigations: () => void;
|
|
6
|
+
};
|
|
7
|
+
type ItemDelete = {
|
|
8
|
+
variant: "ItemDelete";
|
|
9
|
+
item: NestedNavItem;
|
|
10
|
+
fetchNavigations: () => void;
|
|
11
|
+
};
|
|
12
|
+
type DeleteProps = NavDelete | ItemDelete;
|
|
13
|
+
export default function Delete({ variant, item, fetchNavigations }: DeleteProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function NavCreate(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NestedNavigation } from '../../../../types';
|
|
2
|
+
type NavEditProps = {
|
|
3
|
+
item: NestedNavigation;
|
|
4
|
+
fetchNavigations: () => void;
|
|
5
|
+
};
|
|
6
|
+
export default function NavEdit({ item, fetchNavigations }: NavEditProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export default function NavModal({ triggerText, triggerVariant, confirmText, closeText, titleText, loadingText, children, onConfirm, loading, modalToOpen, footer, currentModalType, }: {
|
|
3
|
+
triggerText?: string;
|
|
4
|
+
triggerVariant?: "primary" | "secondary";
|
|
5
|
+
confirmText: string;
|
|
6
|
+
closeText: string;
|
|
7
|
+
titleText: string;
|
|
8
|
+
loadingText?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
onConfirm?: () => void;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
modalToOpen?: string;
|
|
13
|
+
footer?: React.ReactNode;
|
|
14
|
+
currentModalType?: 'ItemCreate' | 'WrapperCreate' | 'ExternalCreate' | null;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NestedNavItem, NestedNavigation } from '../../../../types';
|
|
3
|
+
type NavOverviewProps = {
|
|
4
|
+
navigations: NestedNavigation[];
|
|
5
|
+
setActionItem: React.Dispatch<React.SetStateAction<NestedNavItem | NestedNavigation | undefined>>;
|
|
6
|
+
};
|
|
7
|
+
export default function NavOverview({ navigations, setActionItem }: NavOverviewProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type externalItemProps = {
|
|
4
|
+
variant: 'ExternalCreate' | 'ExternalEdit';
|
|
5
|
+
item?: NestedNavItem;
|
|
6
|
+
parentDocumentId?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ExternalItem: React.FC<externalItemProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Delete from "./Delete";
|
|
2
|
+
import NavCreate from "./NavCreate";
|
|
3
|
+
import NavEdit from "./NavEdit";
|
|
4
|
+
import 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 NavModal from "./NavModal";
|
|
12
|
+
export { Delete, NavCreate, NavEdit, NavOverview, useModalSharedLogic, withModalSharedLogic, ExternalItem, ItemCreate, ItemEdit, WrapperItem, NavModal };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NestedNavItem } from '../../../../../types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type externalItemProps = {
|
|
4
|
+
variant: 'WrapperCreate' | 'WrapperEdit';
|
|
5
|
+
item?: NestedNavItem;
|
|
6
|
+
parentDocumentId?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const WrapperItem: React.FC<externalItemProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { 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
|
+
export declare const ModalContext: import("react").Context<ModalContextType>;
|
|
12
|
+
export declare const SelectedNavigationContext: import("react").Context<SelectedNavigationContextType>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import useAllContentTypes from "./useAllContentTypes";
|
|
2
|
+
import useAllEntities from "./useAllEntities";
|
|
3
|
+
import useApi from "./useApi";
|
|
4
|
+
import useNavigations from "./useNavigations";
|
|
5
|
+
import usePluginConfig from "./usePluginConfig";
|
|
6
|
+
export { useAllContentTypes, useAllEntities, useApi, useNavigations, usePluginConfig };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GroupedEntities, RouteSettings, NavItemSettings, ConfigContentType, StructuredNavigationVariant, NavigationInput } from '../../../types';
|
|
2
|
+
export default function useApi(): {
|
|
3
|
+
fetchAllContentTypes: () => Promise<any>;
|
|
4
|
+
fetchAllEntities: (contentTypes?: ConfigContentType[]) => Promise<GroupedEntities[]>;
|
|
5
|
+
getRouteByRelated: (relatedDocumentId: string, populate?: string) => Promise<any>;
|
|
6
|
+
createExternalRoute: (body: RouteSettings) => Promise<any>;
|
|
7
|
+
getRoutes: () => Promise<any>;
|
|
8
|
+
updateRoute: (body: RouteSettings, documentId: string) => Promise<any>;
|
|
9
|
+
createNavItem: (body: NavItemSettings) => Promise<any>;
|
|
10
|
+
updateNavItem: (documentId: string, body: NavItemSettings) => Promise<any>;
|
|
11
|
+
deleteNavItem: (documentId: string) => Promise<any>;
|
|
12
|
+
getStructuredNavigation: (documentId: string, variant?: StructuredNavigationVariant) => Promise<any>;
|
|
13
|
+
deleteNavigation: (documentId: string) => Promise<any>;
|
|
14
|
+
updateNavigation: (documentId: string, body: NavigationInput) => Promise<any>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PluginConfig } from '../../../types';
|
|
2
|
+
type UsePluginConfigResponse = {
|
|
3
|
+
data: PluginConfig | null;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
setConfig: (body: PluginConfig) => Promise<boolean | void>;
|
|
7
|
+
};
|
|
8
|
+
export default function usePluginConfig(): UsePluginConfigResponse;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StrapiApp } from '@strapi/admin/strapi-admin';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
register(app: StrapiApp): void;
|
|
4
|
+
bootstrap(app: StrapiApp): void;
|
|
5
|
+
registerTrads({ locales }: {
|
|
6
|
+
locales: string[];
|
|
7
|
+
}): Promise<{
|
|
8
|
+
data: any;
|
|
9
|
+
locale: string;
|
|
10
|
+
}[]>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
ghost?: boolean;
|
|
8
|
+
depth?: number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
wrapperRef?(node: HTMLLIElement): void;
|
|
11
|
+
handleProps?: any;
|
|
12
|
+
disableInteraction?: boolean;
|
|
13
|
+
indentationWidth?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const RouteItem: import("react").ForwardRefExoticComponent<RouteItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -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 = 48;
|
|
9
|
+
export declare function getProjection(items: NestedNavItem[] | undefined, activeId: UniqueIdentifier, overId: UniqueIdentifier, dragOffset: number): {
|
|
10
|
+
depth: number;
|
|
11
|
+
maxDepth: number;
|
|
12
|
+
minDepth: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a URL is unique by making a POST request.
|
|
3
|
+
* @param url The URL to check.
|
|
4
|
+
* @param routeId The ID of the route to exclude from the check.
|
|
5
|
+
* @returns A promise that resolves to the response text if the request is successful.
|
|
6
|
+
* @throws {Error} Throws an error if the request fails or the network response is not ok.
|
|
7
|
+
*/
|
|
8
|
+
export default function duplicateCheck(url: string, routeDocumentId?: string | null): Promise<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import debounce from "./debounce";
|
|
2
|
+
import duplicateCheck from "./duplicateCheck";
|
|
3
|
+
import { isNestedNavigation, isNestedNavItem } from "./typeChecks";
|
|
4
|
+
import getTranslation from "./getTranslation";
|
|
5
|
+
import countChildren from "./countChildren";
|
|
6
|
+
export { debounce, duplicateCheck, isNestedNavigation, isNestedNavItem, getTranslation, countChildren };
|
|
@@ -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;
|