@mattisvensson/strapi-plugin-webatlas 0.6.1 → 0.7.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 +9 -2
- package/dist/_chunks/{de-CL1TIZPg.js → de-BZc1BkzH.js} +4 -1
- package/dist/_chunks/{de-CL1TIZPg.js.map → de-BZc1BkzH.js.map} +1 -1
- package/dist/_chunks/{de-CzVD4dbZ.mjs → de-oxxH8hft.mjs} +4 -1
- package/dist/_chunks/{de-CzVD4dbZ.mjs.map → de-oxxH8hft.mjs.map} +1 -1
- package/dist/_chunks/{en-Du-Ap60j.js → en-Deg4n_IM.js} +4 -1
- package/dist/_chunks/{en-Du-Ap60j.js.map → en-Deg4n_IM.js.map} +1 -1
- package/dist/_chunks/{en-Nk6QcTdr.mjs → en-DqC5aDzA.mjs} +4 -1
- package/dist/_chunks/{en-Nk6QcTdr.mjs.map → en-DqC5aDzA.mjs.map} +1 -1
- package/dist/_chunks/{index-C2V-ZFHK.mjs → index-B6MYtu3A.mjs} +79 -53
- package/dist/_chunks/{index-DCCE7rxt.js.map → index-B6MYtu3A.mjs.map} +1 -1
- package/dist/_chunks/index-BEgpEtto.mjs +247 -0
- package/dist/_chunks/index-BEgpEtto.mjs.map +1 -0
- package/dist/_chunks/{index-BvqWnL1-.js → index-BOEv4jIJ.js} +6 -6
- package/dist/_chunks/{index-BvqWnL1-.js.map → index-BOEv4jIJ.js.map} +1 -1
- package/dist/_chunks/{index-DYKhGn15.mjs → index-BPhRQoGD.mjs} +2 -2
- package/dist/_chunks/{index-DYKhGn15.mjs.map → index-BPhRQoGD.mjs.map} +1 -1
- package/dist/_chunks/index-BdlPAWj6.mjs +246 -0
- package/dist/_chunks/index-Bg96TqDm.js +247 -0
- package/dist/_chunks/index-Bg96TqDm.js.map +1 -0
- package/dist/_chunks/{index-Bfu5AVqu.mjs → index-BgzZLDPv.mjs} +78 -52
- package/dist/_chunks/index-BoVX1KF8.js +246 -0
- package/dist/_chunks/{index-B5ji2Qhs.js → index-ByU38WNH.js} +5 -5
- package/dist/_chunks/{index-JVvkmiKE.mjs → index-CZ5qsGXH.mjs} +6 -6
- package/dist/_chunks/{index-JVvkmiKE.mjs.map → index-CZ5qsGXH.mjs.map} +1 -1
- package/dist/_chunks/{index-DesLqdi-.mjs → index-D3xDvB4d.mjs} +5 -5
- package/dist/_chunks/{index-BKds0CRq.mjs → index-DKdAgBbF.mjs} +1 -1
- package/dist/_chunks/{index-Cp_UPsle.js → index-D_QCV5Z5.js} +2 -2
- package/dist/_chunks/{index-Cp_UPsle.js.map → index-D_QCV5Z5.js.map} +1 -1
- package/dist/_chunks/{index-D2CkoDhN.js → index-UJ0LQ3Y3.js} +1 -1
- package/dist/_chunks/{index-BJHlAfrS.js → index-dSU20yZ4.js} +78 -52
- package/dist/_chunks/{index-DCCE7rxt.js → index-mObQ5NXj.js} +79 -53
- package/dist/_chunks/index-mObQ5NXj.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/pages/Routes/TableHeader.d.ts +5 -1
- package/dist/admin/src/pages/Routes/compareBy.d.ts +2 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/_chunks/EmptyBox-BM4IscSk.mjs +0 -13
- package/dist/_chunks/EmptyBox-BM4IscSk.mjs.map +0 -1
- package/dist/_chunks/EmptyBox-T8t29l25.js +0 -12
- package/dist/_chunks/EmptyBox-T8t29l25.js.map +0 -1
- package/dist/_chunks/index-BEwslndX.js +0 -127
- package/dist/_chunks/index-BEwslndX.js.map +0 -1
- package/dist/_chunks/index-C-4C6ezO.mjs +0 -126
- package/dist/_chunks/index-C2V-ZFHK.mjs.map +0 -1
- package/dist/_chunks/index-DBVU2KOj.js +0 -126
- package/dist/_chunks/index-mUDowsKQ.mjs +0 -127
- package/dist/_chunks/index-mUDowsKQ.mjs.map +0 -1
|
@@ -23,7 +23,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
|
23
23
|
);
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
const version = "0.6.
|
|
26
|
+
const version = "0.6.2";
|
|
27
27
|
const keywords = [];
|
|
28
28
|
const type = "commonjs";
|
|
29
29
|
const exports = {
|
|
@@ -4059,7 +4059,7 @@ const index = {
|
|
|
4059
4059
|
defaultMessage: "Routes"
|
|
4060
4060
|
},
|
|
4061
4061
|
Component: async () => {
|
|
4062
|
-
const component = await import("./index-
|
|
4062
|
+
const component = await import("./index-BdlPAWj6.mjs");
|
|
4063
4063
|
return { default: component.default };
|
|
4064
4064
|
},
|
|
4065
4065
|
permissions: [
|
|
@@ -4078,7 +4078,7 @@ const index = {
|
|
|
4078
4078
|
defaultMessage: "Navigation"
|
|
4079
4079
|
},
|
|
4080
4080
|
Component: async () => {
|
|
4081
|
-
const component = await import("./index-
|
|
4081
|
+
const component = await import("./index-BgzZLDPv.mjs");
|
|
4082
4082
|
return { default: component.default };
|
|
4083
4083
|
},
|
|
4084
4084
|
permissions: [
|
|
@@ -4107,7 +4107,7 @@ const index = {
|
|
|
4107
4107
|
Component: async () => {
|
|
4108
4108
|
return await import(
|
|
4109
4109
|
/* webpackChunkName: "webatlas-settings-page" */
|
|
4110
|
-
"./index-
|
|
4110
|
+
"./index-DKdAgBbF.mjs"
|
|
4111
4111
|
);
|
|
4112
4112
|
},
|
|
4113
4113
|
permissions: [
|
|
@@ -4136,7 +4136,7 @@ const index = {
|
|
|
4136
4136
|
return Promise.all(
|
|
4137
4137
|
locales.map(async (locale) => {
|
|
4138
4138
|
try {
|
|
4139
|
-
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-
|
|
4139
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-oxxH8hft.mjs"), "./translations/en.json": () => import("./en-DqC5aDzA.mjs") }), `./translations/${locale}.json`, 3);
|
|
4140
4140
|
return { data, locale };
|
|
4141
4141
|
} catch {
|
|
4142
4142
|
return { data: {}, locale };
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useReducer, useState, useEffect } from "react";
|
|
3
3
|
import { Button, Box, Accordion, Field, SingleSelect, SingleSelectOption, MultiSelect, MultiSelectOption } from "@strapi/design-system";
|
|
4
4
|
import { Page, Layouts, useNotification } from "@strapi/strapi/admin";
|
|
5
|
-
import { P as PLUGIN_NAME, g as getTranslation, T as Tooltip, b as usePluginConfig, c as useAllContentTypes, t as transformToUrl } from "./index-
|
|
5
|
+
import { P as PLUGIN_NAME, g as getTranslation, T as Tooltip, b as usePluginConfig, c as useAllContentTypes, t as transformToUrl } from "./index-D3xDvB4d.mjs";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
import "@strapi/icons/symbols";
|
|
8
8
|
import { F as FullLoader } from "./FullLoader-CrPED_dY.mjs";
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-BOEv4jIJ.js");
|
|
8
8
|
const reactIntl = require("react-intl");
|
|
9
9
|
require("@strapi/icons/symbols");
|
|
10
10
|
const FullLoader = require("./FullLoader-Cmsf8xS6.js");
|
|
@@ -279,4 +279,4 @@ const Settings = () => {
|
|
|
279
279
|
] });
|
|
280
280
|
};
|
|
281
281
|
exports.default = Settings;
|
|
282
|
-
//# sourceMappingURL=index-
|
|
282
|
+
//# sourceMappingURL=index-D_QCV5Z5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-Cp_UPsle.js","sources":["../../admin/src/pages/Settings/PageWrapper.tsx","../../admin/src/pages/Settings/ContentTypeAccordion.tsx","../../admin/src/pages/Settings/index.tsx"],"sourcesContent":["import { Button, Box } from '@strapi/design-system';\nimport { Page, Layouts} from '@strapi/strapi/admin'\nimport { PLUGIN_NAME } from '../../../../pluginId';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport type { ConfigContentType } from '../../../../types';\n\nexport default function PageWrapper({ \n settingsState, \n initialState, \n save, \n isSaving,\n children\n}: { \n settingsState?: any, \n initialState?: any, \n save?: () => void, \n isSaving?: boolean,\n children: React.ReactNode \n}) {\n\n const { formatMessage } = useIntl();\n \n return (\n <Page.Main>\n <Layouts.Header\n title={PLUGIN_NAME}\n subtitle={formatMessage({\n id: getTranslation('settings.page.subtitle'),\n defaultMessage: 'Settings',\n })}\n primaryAction={ settingsState && initialState && save &&\n <Button\n type=\"submit\"\n onClick={() => save()}\n loading={isSaving}\n disabled={\n JSON.stringify(settingsState) === JSON.stringify(initialState)\n || settingsState.selectedContentTypes.find((cta: ConfigContentType) => !cta.default) !== undefined\n || isSaving\n }\n >\n {formatMessage({\n id: getTranslation('save'),\n defaultMessage: 'Save',\n })}\n </Button>\n }\n />\n <Layouts.Content>\n <Box\n background='neutral0'\n borderColor=\"neutral150\"\n hasRadius\n paddingBottom={4}\n paddingLeft={4}\n paddingRight={4}\n paddingTop={6}\n shadow=\"tableShadow\"\n >\n {children}\n </Box>\n </Layouts.Content>\n </Page.Main>\n )\n}","import { SingleSelect, SingleSelectOption } from '@strapi/design-system';\nimport Tooltip from '../../components/Tooltip'\nimport { Box, Accordion, Field } from '@strapi/design-system';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport type { ContentType, ConfigContentType } from '../../../../types';\n\nexport default function ContentTypeAccordion({ \n contentType,\n contentTypeSettings,\n dispatch\n}: { \n contentType: ContentType | undefined, \n contentTypeSettings: ConfigContentType, \n dispatch: React.Dispatch<any>\n}) {\n \n const { formatMessage } = useIntl();\n\n if (!contentType) return null\n\n return (\n <Box\n borderColor={!contentTypeSettings.default && 'danger500'}\n key={contentType.uid}\n >\n <Accordion.Item key={contentType.uid} value={contentType.uid} size=\"S\">\n <Accordion.Header>\n <Accordion.Trigger>\n {contentType?.info.displayName}\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <Box padding={3}>\n <Field.Root\n name=\"selectedContentTypes\"\n hint={formatMessage({\n id: getTranslation('settings.page.defaultField.hint'),\n defaultMessage: 'The selected field from the content type will be used to generate the URL alias. Use a field that is unique and descriptive, such as a \"title\" or \"name\".',\n })}\n error={!contentTypeSettings.default && formatMessage({\n id: getTranslation('settings.page.defaultField.error'),\n defaultMessage: 'Please select a default field',\n })}\n required\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.defaultField'),\n defaultMessage: 'Default URL Alias field',\n })}\n </Field.Label>\n <SingleSelect\n name={`defaultField-${contentType.uid}`}\n onClear={() => dispatch({ type: 'SET_DEFAULT_FIELD', payload: { ctUid: contentType.uid, field: '' } })}\n value={contentTypeSettings?.default || ''}\n onChange={(value: string) => dispatch({ type: 'SET_DEFAULT_FIELD', payload: { ctUid: contentType.uid, field: value } })}\n >\n {Object.entries(contentType.attributes).map(([key], index) => {\n if (\n key === 'id' || \n key === 'documentId' ||\n key === 'createdAt' || \n key === 'updatedAt' || \n key === 'createdBy' || \n key === 'updatedBy' ||\n key === 'webatlas_path' ||\n key === 'webatlas_override'\n ) return null\n return <SingleSelectOption key={index} value={key}>{key}</SingleSelectOption>\n })}\n </SingleSelect>\n <Field.Hint/>\n </Field.Root>\n <Box paddingTop={4}>\n <Field.Root\n name=\"urlAliasPattern\"\n hint={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.hint'),\n defaultMessage: 'The pattern to prepend to the generated URL alias. For example, if you enter \"blog\" and the value of default field is \"My First Post\", the generated URL alias will be \"blog/my-first-post\". Leave empty for no prefix.',\n })}\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.urlAliasPattern'),\n defaultMessage: 'URL Alias Pattern',\n })}\n <Tooltip description={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.tooltip'),\n defaultMessage: 'Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded.',\n })} />\n </Field.Label>\n <Field.Input\n value={contentTypeSettings.pattern}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => dispatch({ type: 'SET_PATTERN', payload: { ctUid: contentType.uid, pattern: e.target.value } })}\n disabled={!contentTypeSettings.default}\n type=\"text\"\n placeholder={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.placeholder'),\n defaultMessage: 'e.g. blog',\n })}\n />\n <Field.Hint />\n </Field.Root>\n </Box>\n </Box>\n </Accordion.Content>\n </Accordion.Item>\n </Box>\n \n )\n}","/*\n *\n * Settings\n * This file contains the settings page for the Webatlas plugin in Strapi.\n * It allows users to configure which content types are enabled for URL aliases and navigations,\n * as well as setting default fields and the URL alias patterns for each content type. \n *\n*/\n\nimport { useEffect, useState, useReducer } from 'react';\nimport { Box, Accordion, Field } from '@strapi/design-system';\nimport { useNotification } from '@strapi/strapi/admin'\nimport { MultiSelect, MultiSelectOption } from '@strapi/design-system';\nimport usePluginConfig from '../../hooks/usePluginConfig';\nimport type { ContentType, ConfigContentType, PluginConfig } from '../../../../types';\nimport transformToUrl from '../../../../utils/transformToUrl';\nimport useAllContentTypes from '../../hooks/useAllContentTypes';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport { FullLoader } from '../../components/UI';\nimport PageWrapper from './PageWrapper';\nimport ContentTypeAccordion from './ContentTypeAccordion';\n\ntype Action =\n | { type: 'SET_SELECTED_CONTENT_TYPES'; payload: ConfigContentType[] }\n | { type: 'SET_DEFAULT_FIELD'; payload: { ctUid: string; field: string } }\n | { type: 'SET_PATTERN'; payload: { ctUid: string; pattern: string } }\n\nfunction reducer(settingsState: PluginConfig, action: Action): PluginConfig {\n let updatedContentTypes\n switch (action.type) {\n case 'SET_SELECTED_CONTENT_TYPES':\n updatedContentTypes = action.payload.map(ct => {\n return settingsState.selectedContentTypes.find((cta: ConfigContentType) => cta.uid === ct.uid) || ct\n })\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n case 'SET_DEFAULT_FIELD':\n updatedContentTypes = settingsState.selectedContentTypes.map(ct =>\n ct.uid === action.payload.ctUid ? { ...ct, default: action.payload.field } : ct\n );\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n case 'SET_PATTERN':\n updatedContentTypes = settingsState.selectedContentTypes.map(ct =>\n ct.uid === action.payload.ctUid ? { ...ct, pattern: transformToUrl(action.payload.pattern) } : ct\n );\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n default:\n throw new Error();\n }\n}\n\nconst Settings = () => {\n const { config, setConfig, loading, fetchError } = usePluginConfig();\n const [settingsState, dispatch] = useReducer(reducer, config || { selectedContentTypes: [] });\n const { contentTypes: allContentTypesData } = useAllContentTypes();\n const allContentTypes = allContentTypesData?.filter((ct: ContentType) => ct.pluginOptions?.webatlas?.active === true);\n const [initialState, setInitialState] = useState(config || { selectedContentTypes: [] })\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const [isSaving, setIsSaving] = useState(false);\n\n useEffect(() => {\n setInitialState(config || { selectedContentTypes: [] })\n }, [config]);\n\n useEffect(() => {\n if (!config) return;\n dispatch({ type: 'SET_SELECTED_CONTENT_TYPES', payload: config.selectedContentTypes });\n }, [config]);\n \n useEffect(() => {\n if (fetchError) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: getTranslation('notification.error'),\n defaultMessage: 'An error occurred',\n }) + ': ' + fetchError,\n });\n }\n }, [fetchError, toggleNotification, formatMessage]);\n\n async function save() {\n if (\n !settingsState \n || settingsState.selectedContentTypes.find((cta: ConfigContentType) => !cta.default) !== undefined\n ) return\n\n setIsSaving(true);\n try {\n await setConfig(settingsState)\n setInitialState(settingsState)\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('notification.settings.saved'),\n defaultMessage: 'Settings saved successfully',\n }),\n });\n setIsSaving(false);\n } catch (err) {\n setIsSaving(false);\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: getTranslation('notification.error'),\n defaultMessage: 'An error occurred',\n }) + ': ' + err,\n });\n console.error(err);\n }\n }\n\n if (loading) {\n return <PageWrapper>\n <FullLoader height={200} />\n </PageWrapper>\n }\n\n return (\n <PageWrapper settingsState={settingsState} initialState={initialState} save={save} isSaving={isSaving}>\n <Field.Root\n name=\"selectedContentTypes\"\n hint={formatMessage({\n id: getTranslation('settings.page.enabledContentTypes.hint'),\n defaultMessage: 'Select the content types for which you want to enable URL aliases',\n })}\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.enabledContentTypes'),\n defaultMessage: 'Enabled Content Types',\n })}\n </Field.Label>\n <MultiSelect\n placeholder={formatMessage({\n id: getTranslation('settings.page.enabledContentTypes.placeholder'),\n defaultMessage: 'Select content types...',\n })}\n onClear={() => dispatch({ type: 'SET_SELECTED_CONTENT_TYPES', payload: [] })}\n value={[...settingsState.selectedContentTypes.map((ct: ConfigContentType) => ct.uid)]}\n onChange={(value: string[]) =>\n dispatch({\n type: 'SET_SELECTED_CONTENT_TYPES',\n payload: value.map(v => ({\n uid: v,\n default: '',\n pattern: '',\n })),\n })\n }\n withTags\n >\n {allContentTypes && allContentTypes.map(item => \n <MultiSelectOption key={item.uid} value={item.uid}>{item.info.displayName}</MultiSelectOption>\n )}\n </MultiSelect>\n <Field.Hint/>\n </Field.Root>\n {settingsState.selectedContentTypes && settingsState.selectedContentTypes.length > 0 && \n <Box paddingTop={4}>\n <Field.Root name=\"selectedContentTypesAccordion\">\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.contentTypeSettings'),\n defaultMessage: 'Content Type settings',\n })}\n </Field.Label>\n <Accordion.Root>\n {settingsState.selectedContentTypes?.map((contentTypeSettings: ConfigContentType) => {\n const ct: ContentType | undefined = allContentTypes?.find((item) => item.uid === contentTypeSettings.uid)\n return <ContentTypeAccordion key={contentTypeSettings.uid} contentType={ct} contentTypeSettings={contentTypeSettings} dispatch={dispatch} />\n })}\n </Accordion.Root>\n </Field.Root>\n </Box>\n }\n </PageWrapper>\n );\n};\n\nexport default Settings;\n"],"names":["useIntl","jsxs","Page","jsx","Layouts","PLUGIN_NAME","getTranslation","Button","Box","Accordion","Field","SingleSelect","index","SingleSelectOption","Tooltip","transformToUrl","usePluginConfig","useReducer","useAllContentTypes","useState","useNotification","useEffect","FullLoader","MultiSelect","MultiSelectOption"],"mappings":";;;;;;;;;;AAOA,SAAwB,YAAY;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AAEK,QAAA,EAAE,cAAc,IAAIA,kBAAQ;AAGhC,SAAAC,gCAACC,MAAAA,KAAK,MAAL,EACC,UAAA;AAAA,IAAAC,2BAAA;AAAA,MAACC,MAAAA,QAAQ;AAAA,MAAR;AAAA,QACC,OAAOC,MAAA;AAAA,QACP,UAAU,cAAc;AAAA,UACtB,IAAIC,qBAAe,wBAAwB;AAAA,UAC3C,gBAAgB;AAAA,QAAA,CACjB;AAAA,QACD,eAAgB,iBAAiB,gBAAgB,QAC/CH,2BAAA;AAAA,UAACI,aAAA;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM,KAAK;AAAA,YACpB,SAAS;AAAA,YACT,UACE,KAAK,UAAU,aAAa,MAAM,KAAK,UAAU,YAAY,KAC1D,cAAc,qBAAqB,KAAK,CAAC,QAA2B,CAAC,IAAI,OAAO,MAAM,UACtF;AAAA,YAGJ,UAAc,cAAA;AAAA,cACb,IAAID,qBAAe,MAAM;AAAA,cACzB,gBAAgB;AAAA,YACjB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAEJ;AAAA,IACAH,2BAAAA,IAACC,MAAQ,QAAA,SAAR,EACC,UAAAD,2BAAA;AAAA,MAACK,aAAA;AAAA,MAAA;AAAA,QACC,YAAW;AAAA,QACX,aAAY;AAAA,QACZ,WA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AAEJ;;"}
|
|
1
|
+
{"version":3,"file":"index-D_QCV5Z5.js","sources":["../../admin/src/pages/Settings/PageWrapper.tsx","../../admin/src/pages/Settings/ContentTypeAccordion.tsx","../../admin/src/pages/Settings/index.tsx"],"sourcesContent":["import { Button, Box } from '@strapi/design-system';\nimport { Page, Layouts} from '@strapi/strapi/admin'\nimport { PLUGIN_NAME } from '../../../../pluginId';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport type { ConfigContentType } from '../../../../types';\n\nexport default function PageWrapper({ \n settingsState, \n initialState, \n save, \n isSaving,\n children\n}: { \n settingsState?: any, \n initialState?: any, \n save?: () => void, \n isSaving?: boolean,\n children: React.ReactNode \n}) {\n\n const { formatMessage } = useIntl();\n \n return (\n <Page.Main>\n <Layouts.Header\n title={PLUGIN_NAME}\n subtitle={formatMessage({\n id: getTranslation('settings.page.subtitle'),\n defaultMessage: 'Settings',\n })}\n primaryAction={ settingsState && initialState && save &&\n <Button\n type=\"submit\"\n onClick={() => save()}\n loading={isSaving}\n disabled={\n JSON.stringify(settingsState) === JSON.stringify(initialState)\n || settingsState.selectedContentTypes.find((cta: ConfigContentType) => !cta.default) !== undefined\n || isSaving\n }\n >\n {formatMessage({\n id: getTranslation('save'),\n defaultMessage: 'Save',\n })}\n </Button>\n }\n />\n <Layouts.Content>\n <Box\n background='neutral0'\n borderColor=\"neutral150\"\n hasRadius\n paddingBottom={4}\n paddingLeft={4}\n paddingRight={4}\n paddingTop={6}\n shadow=\"tableShadow\"\n >\n {children}\n </Box>\n </Layouts.Content>\n </Page.Main>\n )\n}","import { SingleSelect, SingleSelectOption } from '@strapi/design-system';\nimport Tooltip from '../../components/Tooltip'\nimport { Box, Accordion, Field } from '@strapi/design-system';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport type { ContentType, ConfigContentType } from '../../../../types';\n\nexport default function ContentTypeAccordion({ \n contentType,\n contentTypeSettings,\n dispatch\n}: { \n contentType: ContentType | undefined, \n contentTypeSettings: ConfigContentType, \n dispatch: React.Dispatch<any>\n}) {\n \n const { formatMessage } = useIntl();\n\n if (!contentType) return null\n\n return (\n <Box\n borderColor={!contentTypeSettings.default && 'danger500'}\n key={contentType.uid}\n >\n <Accordion.Item key={contentType.uid} value={contentType.uid} size=\"S\">\n <Accordion.Header>\n <Accordion.Trigger>\n {contentType?.info.displayName}\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <Box padding={3}>\n <Field.Root\n name=\"selectedContentTypes\"\n hint={formatMessage({\n id: getTranslation('settings.page.defaultField.hint'),\n defaultMessage: 'The selected field from the content type will be used to generate the URL alias. Use a field that is unique and descriptive, such as a \"title\" or \"name\".',\n })}\n error={!contentTypeSettings.default && formatMessage({\n id: getTranslation('settings.page.defaultField.error'),\n defaultMessage: 'Please select a default field',\n })}\n required\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.defaultField'),\n defaultMessage: 'Default URL Alias field',\n })}\n </Field.Label>\n <SingleSelect\n name={`defaultField-${contentType.uid}`}\n onClear={() => dispatch({ type: 'SET_DEFAULT_FIELD', payload: { ctUid: contentType.uid, field: '' } })}\n value={contentTypeSettings?.default || ''}\n onChange={(value: string) => dispatch({ type: 'SET_DEFAULT_FIELD', payload: { ctUid: contentType.uid, field: value } })}\n >\n {Object.entries(contentType.attributes).map(([key], index) => {\n if (\n key === 'id' || \n key === 'documentId' ||\n key === 'createdAt' || \n key === 'updatedAt' || \n key === 'createdBy' || \n key === 'updatedBy' ||\n key === 'webatlas_path' ||\n key === 'webatlas_override'\n ) return null\n return <SingleSelectOption key={index} value={key}>{key}</SingleSelectOption>\n })}\n </SingleSelect>\n <Field.Hint/>\n </Field.Root>\n <Box paddingTop={4}>\n <Field.Root\n name=\"urlAliasPattern\"\n hint={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.hint'),\n defaultMessage: 'The pattern to prepend to the generated URL alias. For example, if you enter \"blog\" and the value of default field is \"My First Post\", the generated URL alias will be \"blog/my-first-post\". Leave empty for no prefix.',\n })}\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.urlAliasPattern'),\n defaultMessage: 'URL Alias Pattern',\n })}\n <Tooltip description={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.tooltip'),\n defaultMessage: 'Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded.',\n })} />\n </Field.Label>\n <Field.Input\n value={contentTypeSettings.pattern}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => dispatch({ type: 'SET_PATTERN', payload: { ctUid: contentType.uid, pattern: e.target.value } })}\n disabled={!contentTypeSettings.default}\n type=\"text\"\n placeholder={formatMessage({\n id: getTranslation('settings.page.urlAliasPattern.placeholder'),\n defaultMessage: 'e.g. blog',\n })}\n />\n <Field.Hint />\n </Field.Root>\n </Box>\n </Box>\n </Accordion.Content>\n </Accordion.Item>\n </Box>\n \n )\n}","/*\n *\n * Settings\n * This file contains the settings page for the Webatlas plugin in Strapi.\n * It allows users to configure which content types are enabled for URL aliases and navigations,\n * as well as setting default fields and the URL alias patterns for each content type. \n *\n*/\n\nimport { useEffect, useState, useReducer } from 'react';\nimport { Box, Accordion, Field } from '@strapi/design-system';\nimport { useNotification } from '@strapi/strapi/admin'\nimport { MultiSelect, MultiSelectOption } from '@strapi/design-system';\nimport usePluginConfig from '../../hooks/usePluginConfig';\nimport type { ContentType, ConfigContentType, PluginConfig } from '../../../../types';\nimport transformToUrl from '../../../../utils/transformToUrl';\nimport useAllContentTypes from '../../hooks/useAllContentTypes';\nimport { getTranslation } from '../../utils';\nimport { useIntl } from 'react-intl';\nimport { FullLoader } from '../../components/UI';\nimport PageWrapper from './PageWrapper';\nimport ContentTypeAccordion from './ContentTypeAccordion';\n\ntype Action =\n | { type: 'SET_SELECTED_CONTENT_TYPES'; payload: ConfigContentType[] }\n | { type: 'SET_DEFAULT_FIELD'; payload: { ctUid: string; field: string } }\n | { type: 'SET_PATTERN'; payload: { ctUid: string; pattern: string } }\n\nfunction reducer(settingsState: PluginConfig, action: Action): PluginConfig {\n let updatedContentTypes\n switch (action.type) {\n case 'SET_SELECTED_CONTENT_TYPES':\n updatedContentTypes = action.payload.map(ct => {\n return settingsState.selectedContentTypes.find((cta: ConfigContentType) => cta.uid === ct.uid) || ct\n })\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n case 'SET_DEFAULT_FIELD':\n updatedContentTypes = settingsState.selectedContentTypes.map(ct =>\n ct.uid === action.payload.ctUid ? { ...ct, default: action.payload.field } : ct\n );\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n case 'SET_PATTERN':\n updatedContentTypes = settingsState.selectedContentTypes.map(ct =>\n ct.uid === action.payload.ctUid ? { ...ct, pattern: transformToUrl(action.payload.pattern) } : ct\n );\n return { ...settingsState, selectedContentTypes: updatedContentTypes };\n default:\n throw new Error();\n }\n}\n\nconst Settings = () => {\n const { config, setConfig, loading, fetchError } = usePluginConfig();\n const [settingsState, dispatch] = useReducer(reducer, config || { selectedContentTypes: [] });\n const { contentTypes: allContentTypesData } = useAllContentTypes();\n const allContentTypes = allContentTypesData?.filter((ct: ContentType) => ct.pluginOptions?.webatlas?.active === true);\n const [initialState, setInitialState] = useState(config || { selectedContentTypes: [] })\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const [isSaving, setIsSaving] = useState(false);\n\n useEffect(() => {\n setInitialState(config || { selectedContentTypes: [] })\n }, [config]);\n\n useEffect(() => {\n if (!config) return;\n dispatch({ type: 'SET_SELECTED_CONTENT_TYPES', payload: config.selectedContentTypes });\n }, [config]);\n \n useEffect(() => {\n if (fetchError) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: getTranslation('notification.error'),\n defaultMessage: 'An error occurred',\n }) + ': ' + fetchError,\n });\n }\n }, [fetchError, toggleNotification, formatMessage]);\n\n async function save() {\n if (\n !settingsState \n || settingsState.selectedContentTypes.find((cta: ConfigContentType) => !cta.default) !== undefined\n ) return\n\n setIsSaving(true);\n try {\n await setConfig(settingsState)\n setInitialState(settingsState)\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('notification.settings.saved'),\n defaultMessage: 'Settings saved successfully',\n }),\n });\n setIsSaving(false);\n } catch (err) {\n setIsSaving(false);\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: getTranslation('notification.error'),\n defaultMessage: 'An error occurred',\n }) + ': ' + err,\n });\n console.error(err);\n }\n }\n\n if (loading) {\n return <PageWrapper>\n <FullLoader height={200} />\n </PageWrapper>\n }\n\n return (\n <PageWrapper settingsState={settingsState} initialState={initialState} save={save} isSaving={isSaving}>\n <Field.Root\n name=\"selectedContentTypes\"\n hint={formatMessage({\n id: getTranslation('settings.page.enabledContentTypes.hint'),\n defaultMessage: 'Select the content types for which you want to enable URL aliases',\n })}\n >\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.enabledContentTypes'),\n defaultMessage: 'Enabled Content Types',\n })}\n </Field.Label>\n <MultiSelect\n placeholder={formatMessage({\n id: getTranslation('settings.page.enabledContentTypes.placeholder'),\n defaultMessage: 'Select content types...',\n })}\n onClear={() => dispatch({ type: 'SET_SELECTED_CONTENT_TYPES', payload: [] })}\n value={[...settingsState.selectedContentTypes.map((ct: ConfigContentType) => ct.uid)]}\n onChange={(value: string[]) =>\n dispatch({\n type: 'SET_SELECTED_CONTENT_TYPES',\n payload: value.map(v => ({\n uid: v,\n default: '',\n pattern: '',\n })),\n })\n }\n withTags\n >\n {allContentTypes && allContentTypes.map(item => \n <MultiSelectOption key={item.uid} value={item.uid}>{item.info.displayName}</MultiSelectOption>\n )}\n </MultiSelect>\n <Field.Hint/>\n </Field.Root>\n {settingsState.selectedContentTypes && settingsState.selectedContentTypes.length > 0 && \n <Box paddingTop={4}>\n <Field.Root name=\"selectedContentTypesAccordion\">\n <Field.Label>\n {formatMessage({\n id: getTranslation('settings.page.contentTypeSettings'),\n defaultMessage: 'Content Type settings',\n })}\n </Field.Label>\n <Accordion.Root>\n {settingsState.selectedContentTypes?.map((contentTypeSettings: ConfigContentType) => {\n const ct: ContentType | undefined = allContentTypes?.find((item) => item.uid === contentTypeSettings.uid)\n return <ContentTypeAccordion key={contentTypeSettings.uid} contentType={ct} contentTypeSettings={contentTypeSettings} dispatch={dispatch} />\n })}\n </Accordion.Root>\n </Field.Root>\n </Box>\n }\n </PageWrapper>\n );\n};\n\nexport default Settings;\n"],"names":["useIntl","jsxs","Page","jsx","Layouts","PLUGIN_NAME","getTranslation","Button","Box","Accordion","Field","SingleSelect","index","SingleSelectOption","Tooltip","transformToUrl","usePluginConfig","useReducer","useAllContentTypes","useState","useNotification","useEffect","FullLoader","MultiSelect","MultiSelectOption"],"mappings":";;;;;;;;;;AAOA,SAAwB,YAAY;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AAEK,QAAA,EAAE,cAAc,IAAIA,kBAAQ;AAGhC,SAAAC,gCAACC,MAAAA,KAAK,MAAL,EACC,UAAA;AAAA,IAAAC,2BAAA;AAAA,MAACC,MAAAA,QAAQ;AAAA,MAAR;AAAA,QACC,OAAOC,MAAA;AAAA,QACP,UAAU,cAAc;AAAA,UACtB,IAAIC,qBAAe,wBAAwB;AAAA,UAC3C,gBAAgB;AAAA,QAAA,CACjB;AAAA,QACD,eAAgB,iBAAiB,gBAAgB,QAC/CH,2BAAA;AAAA,UAACI,aAAA;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM,KAAK;AAAA,YACpB,SAAS;AAAA,YACT,UACE,KAAK,UAAU,aAAa,MAAM,KAAK,UAAU,YAAY,KAC1D,cAAc,qBAAqB,KAAK,CAAC,QAA2B,CAAC,IAAI,OAAO,MAAM,UACtF;AAAA,YAGJ,UAAc,cAAA;AAAA,cACb,IAAID,qBAAe,MAAM;AAAA,cACzB,gBAAgB;AAAA,YACjB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAEJ;AAAA,IACAH,2BAAAA,I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I,qBAA0C,SAAA,GAApF,oBAAoB,GAAoF;AAAA,MAAA,CAC3I,EACH,CAAA;AAAA,IAAA,EAAA,CACF,EACF,CAAA;AAAA,EAAA,GAEJ;AAEJ;;"}
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-ByU38WNH.js");
|
|
8
8
|
const reactIntl = require("react-intl");
|
|
9
9
|
require("@strapi/icons/symbols");
|
|
10
10
|
const FullLoader = require("./FullLoader-Cmsf8xS6.js");
|
|
@@ -7,10 +7,10 @@ const designSystem = require("@strapi/design-system");
|
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const ReactDOM = require("react-dom");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-ByU38WNH.js");
|
|
11
11
|
const admin = require("@strapi/strapi/admin");
|
|
12
12
|
const FullLoader = require("./FullLoader-Cmsf8xS6.js");
|
|
13
|
-
const
|
|
13
|
+
const symbols = require("@strapi/icons/symbols");
|
|
14
14
|
const core = require("@dnd-kit/core");
|
|
15
15
|
const sortable = require("@dnd-kit/sortable");
|
|
16
16
|
const utilities = require("@dnd-kit/utilities");
|
|
@@ -83,6 +83,12 @@ function createTempNavItemObject({
|
|
|
83
83
|
};
|
|
84
84
|
return tempNavItem;
|
|
85
85
|
}
|
|
86
|
+
function EmptyBox({ msg }) {
|
|
87
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "10rem", height: "6rem" }),
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral600", children: msg }) })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
86
92
|
const ModalContext = React.createContext({ modalType: "", setModalType: () => {
|
|
87
93
|
} });
|
|
88
94
|
const SelectedNavigationContext = React.createContext({ selectedNavigation: void 0, setSelectedNavigation: () => {
|
|
@@ -4631,6 +4637,7 @@ function ItemCreateComponent({
|
|
|
4631
4637
|
onCreate
|
|
4632
4638
|
}) {
|
|
4633
4639
|
const [loading, setLoading] = React.useState(false);
|
|
4640
|
+
const [loadingRoute, setLoadingRoute] = React.useState(true);
|
|
4634
4641
|
const { formatMessage } = reactIntl.useIntl();
|
|
4635
4642
|
React.useEffect(() => {
|
|
4636
4643
|
if (!entities) return;
|
|
@@ -4646,9 +4653,10 @@ function ItemCreateComponent({
|
|
|
4646
4653
|
React.useEffect(() => {
|
|
4647
4654
|
async function fetchRoute() {
|
|
4648
4655
|
if (selectedContentType?.contentType && selectedEntity?.id) {
|
|
4656
|
+
setLoadingRoute(true);
|
|
4649
4657
|
try {
|
|
4650
4658
|
const route = await getRelatedRoute(selectedEntity.documentId);
|
|
4651
|
-
if (!route)
|
|
4659
|
+
if (!route) throw new Error("No route found for the selected entity");
|
|
4652
4660
|
dispatchPath({ type: "NO_URL_CHECK", payload: route.fullPath });
|
|
4653
4661
|
dispatchPath({ type: "SET_UIDPATH", payload: route.uidPath });
|
|
4654
4662
|
dispatchPath({ type: "SET_INITIALPATH", payload: route.fullPath });
|
|
@@ -4666,6 +4674,8 @@ function ItemCreateComponent({
|
|
|
4666
4674
|
setEntityRoute(route);
|
|
4667
4675
|
} catch (err) {
|
|
4668
4676
|
console.log(err);
|
|
4677
|
+
} finally {
|
|
4678
|
+
setLoadingRoute(false);
|
|
4669
4679
|
}
|
|
4670
4680
|
}
|
|
4671
4681
|
}
|
|
@@ -4692,6 +4702,68 @@ function ItemCreateComponent({
|
|
|
4692
4702
|
setLoading(false);
|
|
4693
4703
|
}
|
|
4694
4704
|
};
|
|
4705
|
+
function ItemDetails() {
|
|
4706
|
+
if (loadingRoute) return /* @__PURE__ */ jsxRuntime.jsx(FullLoader.FullLoader, { height: 50 });
|
|
4707
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
4708
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4709
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4710
|
+
id: index.getTranslation("modal.item.titleField.label"),
|
|
4711
|
+
defaultMessage: "Title"
|
|
4712
|
+
}) }),
|
|
4713
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4714
|
+
designSystem.Field.Input,
|
|
4715
|
+
{
|
|
4716
|
+
placeholder: formatMessage({
|
|
4717
|
+
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
4718
|
+
defaultMessage: "e.g. About us"
|
|
4719
|
+
}),
|
|
4720
|
+
name: "title",
|
|
4721
|
+
value: navItemState.title || "",
|
|
4722
|
+
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
4723
|
+
required: true
|
|
4724
|
+
}
|
|
4725
|
+
)
|
|
4726
|
+
] }) }) }),
|
|
4727
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
4728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4729
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4730
|
+
id: index.getTranslation("modal.item.routeField.label"),
|
|
4731
|
+
defaultMessage: "Route"
|
|
4732
|
+
}) }),
|
|
4733
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4734
|
+
designSystem.Field.Input,
|
|
4735
|
+
{
|
|
4736
|
+
required: true,
|
|
4737
|
+
placeholder: formatMessage({
|
|
4738
|
+
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
4739
|
+
defaultMessage: "e.g. about/"
|
|
4740
|
+
}),
|
|
4741
|
+
name: "slug",
|
|
4742
|
+
value: path?.value || "",
|
|
4743
|
+
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
4744
|
+
onBlur: (e) => {
|
|
4745
|
+
if (e.target.value === path.prevValue) return;
|
|
4746
|
+
dispatchPath({ type: "DEFAULT", payload: e.target.value });
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
)
|
|
4750
|
+
] }),
|
|
4751
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.URLInfo, { validationState, replacement })
|
|
4752
|
+
] }) })
|
|
4753
|
+
] }) });
|
|
4754
|
+
}
|
|
4755
|
+
if (availableEntities && availableEntities.length === 0) {
|
|
4756
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4757
|
+
NavModal,
|
|
4758
|
+
{
|
|
4759
|
+
confirmText: formatMessage({ id: index.getTranslation("add"), defaultMessage: "Add" }),
|
|
4760
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
4761
|
+
titleText: formatMessage({ id: index.getTranslation("modal.internalItem.titleText.create"), defaultMessage: "Add new navigation item" }),
|
|
4762
|
+
footer: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
4763
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(FullLoader.FullLoader, { height: 50 })
|
|
4764
|
+
}
|
|
4765
|
+
);
|
|
4766
|
+
}
|
|
4695
4767
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4696
4768
|
NavModal,
|
|
4697
4769
|
{
|
|
@@ -4762,53 +4834,7 @@ function ItemCreateComponent({
|
|
|
4762
4834
|
] }),
|
|
4763
4835
|
selectedEntity && selectedContentType && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4764
4836
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
|
|
4765
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4766
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4767
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4768
|
-
id: index.getTranslation("modal.item.titleField.label"),
|
|
4769
|
-
defaultMessage: "Title"
|
|
4770
|
-
}) }),
|
|
4771
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4772
|
-
designSystem.Field.Input,
|
|
4773
|
-
{
|
|
4774
|
-
placeholder: formatMessage({
|
|
4775
|
-
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
4776
|
-
defaultMessage: "e.g. About us"
|
|
4777
|
-
}),
|
|
4778
|
-
name: "title",
|
|
4779
|
-
value: navItemState.title || "",
|
|
4780
|
-
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
4781
|
-
required: true
|
|
4782
|
-
}
|
|
4783
|
-
)
|
|
4784
|
-
] }) }) }),
|
|
4785
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
4786
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4787
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4788
|
-
id: index.getTranslation("modal.item.routeField.label"),
|
|
4789
|
-
defaultMessage: "Route"
|
|
4790
|
-
}) }),
|
|
4791
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4792
|
-
designSystem.Field.Input,
|
|
4793
|
-
{
|
|
4794
|
-
required: true,
|
|
4795
|
-
placeholder: formatMessage({
|
|
4796
|
-
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
4797
|
-
defaultMessage: "e.g. about/"
|
|
4798
|
-
}),
|
|
4799
|
-
name: "slug",
|
|
4800
|
-
value: path?.value || "",
|
|
4801
|
-
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
4802
|
-
onBlur: (e) => {
|
|
4803
|
-
if (e.target.value === path.prevValue) return;
|
|
4804
|
-
dispatchPath({ type: "DEFAULT", payload: e.target.value });
|
|
4805
|
-
}
|
|
4806
|
-
}
|
|
4807
|
-
)
|
|
4808
|
-
] }),
|
|
4809
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.URLInfo, { validationState, replacement })
|
|
4810
|
-
] }) })
|
|
4811
|
-
] })
|
|
4837
|
+
/* @__PURE__ */ jsxRuntime.jsx(ItemDetails, {})
|
|
4812
4838
|
] })
|
|
4813
4839
|
]
|
|
4814
4840
|
}
|
|
@@ -12071,7 +12097,7 @@ const Navigation = () => {
|
|
|
12071
12097
|
}
|
|
12072
12098
|
) }),
|
|
12073
12099
|
navigations?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(FullLoader.Center, { height: 400, children: [
|
|
12074
|
-
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox
|
|
12100
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox, { msg: formatMessage({
|
|
12075
12101
|
id: index.getTranslation("navigation.page.emptyNavigation"),
|
|
12076
12102
|
defaultMessage: "You have no navigations yet..."
|
|
12077
12103
|
}) }),
|
|
@@ -12081,7 +12107,7 @@ const Navigation = () => {
|
|
|
12081
12107
|
}) })
|
|
12082
12108
|
] }),
|
|
12083
12109
|
navigations && navigationItems?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(FullLoader.Center, { height: 400, children: [
|
|
12084
|
-
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox
|
|
12110
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox, { msg: "Your navigation is empty..." }),
|
|
12085
12111
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
12086
12112
|
id: index.getTranslation("navigation.page.createNewItem"),
|
|
12087
12113
|
defaultMessage: "Create new item"
|
|
@@ -7,10 +7,10 @@ const designSystem = require("@strapi/design-system");
|
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const ReactDOM = require("react-dom");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-BOEv4jIJ.js");
|
|
11
11
|
const admin = require("@strapi/strapi/admin");
|
|
12
12
|
const FullLoader = require("./FullLoader-Cmsf8xS6.js");
|
|
13
|
-
const
|
|
13
|
+
const symbols = require("@strapi/icons/symbols");
|
|
14
14
|
const core = require("@dnd-kit/core");
|
|
15
15
|
const sortable = require("@dnd-kit/sortable");
|
|
16
16
|
const utilities = require("@dnd-kit/utilities");
|
|
@@ -83,6 +83,12 @@ function createTempNavItemObject({
|
|
|
83
83
|
};
|
|
84
84
|
return tempNavItem;
|
|
85
85
|
}
|
|
86
|
+
function EmptyBox({ msg }) {
|
|
87
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "10rem", height: "6rem" }),
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral600", children: msg }) })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
86
92
|
const ModalContext = React.createContext({ modalType: "", setModalType: () => {
|
|
87
93
|
} });
|
|
88
94
|
const SelectedNavigationContext = React.createContext({ selectedNavigation: void 0, setSelectedNavigation: () => {
|
|
@@ -4631,6 +4637,7 @@ function ItemCreateComponent({
|
|
|
4631
4637
|
onCreate
|
|
4632
4638
|
}) {
|
|
4633
4639
|
const [loading, setLoading] = React.useState(false);
|
|
4640
|
+
const [loadingRoute, setLoadingRoute] = React.useState(true);
|
|
4634
4641
|
const { formatMessage } = reactIntl.useIntl();
|
|
4635
4642
|
React.useEffect(() => {
|
|
4636
4643
|
if (!entities) return;
|
|
@@ -4646,9 +4653,10 @@ function ItemCreateComponent({
|
|
|
4646
4653
|
React.useEffect(() => {
|
|
4647
4654
|
async function fetchRoute() {
|
|
4648
4655
|
if (selectedContentType?.contentType && selectedEntity?.id) {
|
|
4656
|
+
setLoadingRoute(true);
|
|
4649
4657
|
try {
|
|
4650
4658
|
const route = await getRelatedRoute(selectedEntity.documentId);
|
|
4651
|
-
if (!route)
|
|
4659
|
+
if (!route) throw new Error("No route found for the selected entity");
|
|
4652
4660
|
dispatchPath({ type: "NO_URL_CHECK", payload: route.fullPath });
|
|
4653
4661
|
dispatchPath({ type: "SET_UIDPATH", payload: route.uidPath });
|
|
4654
4662
|
dispatchPath({ type: "SET_INITIALPATH", payload: route.fullPath });
|
|
@@ -4666,6 +4674,8 @@ function ItemCreateComponent({
|
|
|
4666
4674
|
setEntityRoute(route);
|
|
4667
4675
|
} catch (err) {
|
|
4668
4676
|
console.log(err);
|
|
4677
|
+
} finally {
|
|
4678
|
+
setLoadingRoute(false);
|
|
4669
4679
|
}
|
|
4670
4680
|
}
|
|
4671
4681
|
}
|
|
@@ -4692,6 +4702,68 @@ function ItemCreateComponent({
|
|
|
4692
4702
|
setLoading(false);
|
|
4693
4703
|
}
|
|
4694
4704
|
};
|
|
4705
|
+
function ItemDetails() {
|
|
4706
|
+
if (loadingRoute) return /* @__PURE__ */ jsxRuntime.jsx(FullLoader.FullLoader, { height: 50 });
|
|
4707
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
4708
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4709
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4710
|
+
id: index.getTranslation("modal.item.titleField.label"),
|
|
4711
|
+
defaultMessage: "Title"
|
|
4712
|
+
}) }),
|
|
4713
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4714
|
+
designSystem.Field.Input,
|
|
4715
|
+
{
|
|
4716
|
+
placeholder: formatMessage({
|
|
4717
|
+
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
4718
|
+
defaultMessage: "e.g. About us"
|
|
4719
|
+
}),
|
|
4720
|
+
name: "title",
|
|
4721
|
+
value: navItemState.title || "",
|
|
4722
|
+
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
4723
|
+
required: true
|
|
4724
|
+
}
|
|
4725
|
+
)
|
|
4726
|
+
] }) }) }),
|
|
4727
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
4728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4729
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4730
|
+
id: index.getTranslation("modal.item.routeField.label"),
|
|
4731
|
+
defaultMessage: "Route"
|
|
4732
|
+
}) }),
|
|
4733
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4734
|
+
designSystem.Field.Input,
|
|
4735
|
+
{
|
|
4736
|
+
required: true,
|
|
4737
|
+
placeholder: formatMessage({
|
|
4738
|
+
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
4739
|
+
defaultMessage: "e.g. about/"
|
|
4740
|
+
}),
|
|
4741
|
+
name: "slug",
|
|
4742
|
+
value: path?.value || "",
|
|
4743
|
+
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
4744
|
+
onBlur: (e) => {
|
|
4745
|
+
if (e.target.value === path.prevValue) return;
|
|
4746
|
+
dispatchPath({ type: "DEFAULT", payload: e.target.value });
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
)
|
|
4750
|
+
] }),
|
|
4751
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.URLInfo, { validationState, replacement })
|
|
4752
|
+
] }) })
|
|
4753
|
+
] }) });
|
|
4754
|
+
}
|
|
4755
|
+
if (availableEntities && availableEntities.length === 0) {
|
|
4756
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4757
|
+
NavModal,
|
|
4758
|
+
{
|
|
4759
|
+
confirmText: formatMessage({ id: index.getTranslation("add"), defaultMessage: "Add" }),
|
|
4760
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
4761
|
+
titleText: formatMessage({ id: index.getTranslation("modal.internalItem.titleText.create"), defaultMessage: "Add new navigation item" }),
|
|
4762
|
+
footer: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
4763
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(FullLoader.FullLoader, { height: 50 })
|
|
4764
|
+
}
|
|
4765
|
+
);
|
|
4766
|
+
}
|
|
4695
4767
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4696
4768
|
NavModal,
|
|
4697
4769
|
{
|
|
@@ -4762,53 +4834,7 @@ function ItemCreateComponent({
|
|
|
4762
4834
|
] }),
|
|
4763
4835
|
selectedEntity && selectedContentType && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4764
4836
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
|
|
4765
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4766
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4767
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4768
|
-
id: index.getTranslation("modal.item.titleField.label"),
|
|
4769
|
-
defaultMessage: "Title"
|
|
4770
|
-
}) }),
|
|
4771
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4772
|
-
designSystem.Field.Input,
|
|
4773
|
-
{
|
|
4774
|
-
placeholder: formatMessage({
|
|
4775
|
-
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
4776
|
-
defaultMessage: "e.g. About us"
|
|
4777
|
-
}),
|
|
4778
|
-
name: "title",
|
|
4779
|
-
value: navItemState.title || "",
|
|
4780
|
-
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
4781
|
-
required: true
|
|
4782
|
-
}
|
|
4783
|
-
)
|
|
4784
|
-
] }) }) }),
|
|
4785
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
4786
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
4787
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
4788
|
-
id: index.getTranslation("modal.item.routeField.label"),
|
|
4789
|
-
defaultMessage: "Route"
|
|
4790
|
-
}) }),
|
|
4791
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4792
|
-
designSystem.Field.Input,
|
|
4793
|
-
{
|
|
4794
|
-
required: true,
|
|
4795
|
-
placeholder: formatMessage({
|
|
4796
|
-
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
4797
|
-
defaultMessage: "e.g. about/"
|
|
4798
|
-
}),
|
|
4799
|
-
name: "slug",
|
|
4800
|
-
value: path?.value || "",
|
|
4801
|
-
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
4802
|
-
onBlur: (e) => {
|
|
4803
|
-
if (e.target.value === path.prevValue) return;
|
|
4804
|
-
dispatchPath({ type: "DEFAULT", payload: e.target.value });
|
|
4805
|
-
}
|
|
4806
|
-
}
|
|
4807
|
-
)
|
|
4808
|
-
] }),
|
|
4809
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.URLInfo, { validationState, replacement })
|
|
4810
|
-
] }) })
|
|
4811
|
-
] })
|
|
4837
|
+
/* @__PURE__ */ jsxRuntime.jsx(ItemDetails, {})
|
|
4812
4838
|
] })
|
|
4813
4839
|
]
|
|
4814
4840
|
}
|
|
@@ -12071,7 +12097,7 @@ const Navigation = () => {
|
|
|
12071
12097
|
}
|
|
12072
12098
|
) }),
|
|
12073
12099
|
navigations?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(FullLoader.Center, { height: 400, children: [
|
|
12074
|
-
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox
|
|
12100
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox, { msg: formatMessage({
|
|
12075
12101
|
id: index.getTranslation("navigation.page.emptyNavigation"),
|
|
12076
12102
|
defaultMessage: "You have no navigations yet..."
|
|
12077
12103
|
}) }),
|
|
@@ -12081,7 +12107,7 @@ const Navigation = () => {
|
|
|
12081
12107
|
}) })
|
|
12082
12108
|
] }),
|
|
12083
12109
|
navigations && navigationItems?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(FullLoader.Center, { height: 400, children: [
|
|
12084
|
-
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox
|
|
12110
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox, { msg: "Your navigation is empty..." }),
|
|
12085
12111
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
12086
12112
|
id: index.getTranslation("navigation.page.createNewItem"),
|
|
12087
12113
|
defaultMessage: "Create new item"
|
|
@@ -12201,4 +12227,4 @@ const App = () => {
|
|
|
12201
12227
|
] });
|
|
12202
12228
|
};
|
|
12203
12229
|
exports.default = App;
|
|
12204
|
-
//# sourceMappingURL=index-
|
|
12230
|
+
//# sourceMappingURL=index-mObQ5NXj.js.map
|