@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.
Files changed (94) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +140 -0
  3. package/dist/_chunks/_commonjsHelpers-BxmBWJD2.mjs +33 -0
  4. package/dist/_chunks/_commonjsHelpers-Cq6wktVC.js +32 -0
  5. package/dist/_chunks/en-B4KWt_jN.js +4 -0
  6. package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
  7. package/dist/_chunks/index-B76GOOtR.js +18024 -0
  8. package/dist/_chunks/index-B8hoZtTR.js +47 -0
  9. package/dist/_chunks/index-B8i-28Jt.mjs +774 -0
  10. package/dist/_chunks/index-BFv_JAKx.mjs +6814 -0
  11. package/dist/_chunks/index-CJUhT0VV.js +773 -0
  12. package/dist/_chunks/index-D9yK1vNq.js +6814 -0
  13. package/dist/_chunks/index-DClS2XL-.mjs +47 -0
  14. package/dist/_chunks/index-DbKqIKw_.mjs +17984 -0
  15. package/dist/admin/index.js +4 -0
  16. package/dist/admin/index.mjs +5 -0
  17. package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +5 -0
  18. package/dist/admin/src/components/CMEditViewAside/index.d.ts +2 -0
  19. package/dist/admin/src/components/Initializer.d.ts +5 -0
  20. package/dist/admin/src/components/PluginIcon.d.ts +3 -0
  21. package/dist/admin/src/components/Tooltip.d.ts +3 -0
  22. package/dist/admin/src/components/UI/Center.d.ts +5 -0
  23. package/dist/admin/src/components/URLInfo.d.ts +6 -0
  24. package/dist/admin/src/components/modals/Delete.d.ts +14 -0
  25. package/dist/admin/src/components/modals/NavCreate.d.ts +1 -0
  26. package/dist/admin/src/components/modals/NavEdit.d.ts +7 -0
  27. package/dist/admin/src/components/modals/NavModal.d.ts +15 -0
  28. package/dist/admin/src/components/modals/NavOverview.d.ts +8 -0
  29. package/dist/admin/src/components/modals/externalItem/index.d.ts +9 -0
  30. package/dist/admin/src/components/modals/index.d.ts +12 -0
  31. package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +3 -0
  32. package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +3 -0
  33. package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +2 -0
  34. package/dist/admin/src/components/modals/withModalSharedLogic.d.ts +3 -0
  35. package/dist/admin/src/components/modals/wrapperItem/index.d.ts +9 -0
  36. package/dist/admin/src/contexts/index.d.ts +13 -0
  37. package/dist/admin/src/hooks/index.d.ts +6 -0
  38. package/dist/admin/src/hooks/useAllContentTypes.d.ts +7 -0
  39. package/dist/admin/src/hooks/useAllEntities.d.ts +7 -0
  40. package/dist/admin/src/hooks/useApi.d.ts +15 -0
  41. package/dist/admin/src/hooks/useNavigations.d.ts +5 -0
  42. package/dist/admin/src/hooks/usePluginConfig.d.ts +9 -0
  43. package/dist/admin/src/index.d.ts +12 -0
  44. package/dist/admin/src/pages/Navigation/EmptyNav.d.ts +5 -0
  45. package/dist/admin/src/pages/Navigation/Header.d.ts +6 -0
  46. package/dist/admin/src/pages/Navigation/RouteItem.d.ts +15 -0
  47. package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +2 -0
  48. package/dist/admin/src/pages/Navigation/index.d.ts +2 -0
  49. package/dist/admin/src/pages/Routes/index.d.ts +2 -0
  50. package/dist/admin/src/pages/Settings/index.d.ts +2 -0
  51. package/dist/admin/src/utils/countChildren.d.ts +2 -0
  52. package/dist/admin/src/utils/debounce.d.ts +1 -0
  53. package/dist/admin/src/utils/dnd.d.ts +13 -0
  54. package/dist/admin/src/utils/duplicateCheck.d.ts +8 -0
  55. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  56. package/dist/admin/src/utils/index.d.ts +6 -0
  57. package/dist/admin/src/utils/typeChecks.d.ts +3 -0
  58. package/dist/pluginId.d.ts +3 -0
  59. package/dist/server/index.js +1861 -0
  60. package/dist/server/index.mjs +1862 -0
  61. package/dist/server/src/bootstrap.d.ts +5 -0
  62. package/dist/server/src/config/index.d.ts +5 -0
  63. package/dist/server/src/content-types/index.d.ts +189 -0
  64. package/dist/server/src/content-types/navigation/index.d.ts +49 -0
  65. package/dist/server/src/content-types/navigation/schema.d.ts +47 -0
  66. package/dist/server/src/content-types/navitem/index.d.ts +50 -0
  67. package/dist/server/src/content-types/navitem/schema.d.ts +48 -0
  68. package/dist/server/src/content-types/route/index.d.ts +90 -0
  69. package/dist/server/src/content-types/route/schema.d.ts +88 -0
  70. package/dist/server/src/controllers/admin.d.ts +16 -0
  71. package/dist/server/src/controllers/client.d.ts +8 -0
  72. package/dist/server/src/controllers/index.d.ts +24 -0
  73. package/dist/server/src/destroy.d.ts +5 -0
  74. package/dist/server/src/index.d.ts +279 -0
  75. package/dist/server/src/middlewares/index.d.ts +2 -0
  76. package/dist/server/src/policies/index.d.ts +2 -0
  77. package/dist/server/src/register.d.ts +5 -0
  78. package/dist/server/src/routes/admin.d.ts +13 -0
  79. package/dist/server/src/routes/client.d.ts +12 -0
  80. package/dist/server/src/routes/index.d.ts +26 -0
  81. package/dist/server/src/services/admin.d.ts +19 -0
  82. package/dist/server/src/services/client.d.ts +8 -0
  83. package/dist/server/src/services/index.d.ts +26 -0
  84. package/dist/server/src/utils/duplicateCheck.d.ts +1 -0
  85. package/dist/server/src/utils/pluginHelpers.d.ts +6 -0
  86. package/dist/utils/buildStructuredNavigation.d.ts +11 -0
  87. package/dist/utils/cleanRootKeys.d.ts +1 -0
  88. package/dist/utils/extractRouteAndItems.d.ts +2 -0
  89. package/dist/utils/getFullPath.d.ts +1 -0
  90. package/dist/utils/index.d.ts +9 -0
  91. package/dist/utils/populateDeep.d.ts +4 -0
  92. package/dist/utils/removeWaFields.d.ts +1 -0
  93. package/dist/utils/transformToUrl.d.ts +1 -0
  94. package/package.json +102 -0
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ const index = require("../_chunks/index-CJUhT0VV.js");
3
+ require("react/jsx-runtime");
4
+ module.exports = index.index;
@@ -0,0 +1,5 @@
1
+ import { i } from "../_chunks/index-B8i-28Jt.mjs";
2
+ import "react/jsx-runtime";
3
+ export {
4
+ i as default
5
+ };
@@ -0,0 +1,5 @@
1
+ import { ConfigContentType } from '../../../../types';
2
+ declare const Alias: ({ config }: {
3
+ config: ConfigContentType;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
5
+ export default Alias;
@@ -0,0 +1,2 @@
1
+ declare const CMEditViewAside: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CMEditViewAside;
@@ -0,0 +1,5 @@
1
+ type InitializerProps = {
2
+ setPlugin: (id: string) => void;
3
+ };
4
+ declare const Initializer: ({ setPlugin }: InitializerProps) => null;
5
+ export { Initializer };
@@ -0,0 +1,3 @@
1
+ declare const RouteIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ declare const NavigationIcon: () => import("react/jsx-runtime").JSX.Element;
3
+ export { RouteIcon, NavigationIcon };
@@ -0,0 +1,3 @@
1
+ export default function Tooltip({ description }: {
2
+ description: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function Center({ height, children }: {
3
+ height?: number;
4
+ children: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ interface URLInfoProps {
2
+ validationState: 'initial' | 'checking' | 'done';
3
+ replacement: string;
4
+ }
5
+ export default function URLInfo({ validationState, replacement }: URLInfoProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ import { ModalItem_VariantCreate } from '../../../../../types';
3
+ export declare const ItemCreate: import("react").FC<ModalItem_VariantCreate>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ModalItem_VariantEdit } from '../../../../../types';
3
+ export declare const ItemEdit: import("react").FC<ModalItem_VariantEdit>;
@@ -0,0 +1,2 @@
1
+ import { modalSharedLogic } from '../../../../types';
2
+ export declare function useModalSharedLogic(): modalSharedLogic;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { useModalSharedLogic } from './useModalSharedLogic';
3
+ export declare function withModalSharedLogic<T>(Component: React.FunctionComponent<T & ReturnType<typeof useModalSharedLogic>>): React.FC<T>;
@@ -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,7 @@
1
+ import { ContentType } from '../../../types';
2
+ declare const useAllContentTypes: () => {
3
+ contentTypes: ContentType[];
4
+ loading: boolean;
5
+ error: null;
6
+ };
7
+ export default useAllContentTypes;
@@ -0,0 +1,7 @@
1
+ import { GroupedEntities } from '../../../types';
2
+ declare const useAllEntities: () => {
3
+ entities: GroupedEntities[];
4
+ loading: boolean;
5
+ error: null;
6
+ };
7
+ export default useAllEntities;
@@ -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,5 @@
1
+ import { NestedNavigation } from '../../../types';
2
+ export default function useNavigations(): {
3
+ navigations: NestedNavigation[];
4
+ fetchNavigations: () => Promise<void>;
5
+ };
@@ -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,5 @@
1
+ type EmptyNavProps = {
2
+ msg: string;
3
+ };
4
+ export default function EmptyNav({ msg }: EmptyNavProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { NestedNavigation } from '../../../../types';
2
+ type HeaderProps = {
3
+ navigations: NestedNavigation[];
4
+ };
5
+ export default function Header({ navigations }: HeaderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -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,2 @@
1
+ import { RouteItemProps } from './RouteItem';
2
+ export default function SortableRouteItem({ item, depth, ...props }: RouteItemProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ declare const Navigation: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default Navigation;
@@ -0,0 +1,2 @@
1
+ declare const Routes: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Routes;
@@ -0,0 +1,2 @@
1
+ declare const Settings: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Settings;
@@ -0,0 +1,2 @@
1
+ import { NestedNavItem } from '../../../types';
2
+ export default function countChildren(item: NestedNavItem): number;
@@ -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,2 @@
1
+ declare const getTranslation: (id: string) => string;
2
+ export default getTranslation;
@@ -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;
@@ -0,0 +1,3 @@
1
+ declare const PLUGIN_ID: string;
2
+ declare const PLUGIN_NAME: string;
3
+ export { PLUGIN_ID, PLUGIN_NAME };