strapi-plugin-navigation 3.0.0-beta.0 → 3.0.0-beta.2
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 +23 -28
- package/dist/_chunks/ca-Bjfh0w36.js +480 -0
- package/dist/_chunks/ca-DIZHA0OL.mjs +480 -0
- package/dist/_chunks/en-BPYZYsnc.mjs +490 -0
- package/dist/_chunks/en-CT7eKHZS.js +490 -0
- package/dist/_chunks/fr-BTVWPkax.mjs +490 -0
- package/dist/_chunks/fr-ybbSdjZO.js +490 -0
- package/dist/admin/index.js +55426 -0
- package/dist/admin/index.mjs +55408 -0
- package/dist/admin/src/api/client.d.ts +192 -0
- package/dist/admin/src/api/validators.d.ts +1828 -0
- package/dist/admin/src/components/ConfirmationDialog/index.d.ts +20 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/RestartAlert/index.d.ts +2 -0
- package/dist/admin/src/components/TextArrayInput/index.d.ts +12 -0
- package/dist/admin/src/components/icons/navigation.d.ts +4 -0
- package/dist/admin/src/components/icons/pluginIcon.d.ts +7 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/AdditionalFieldInput/index.d.ts +12 -0
- package/dist/admin/src/pages/HomePage/components/CollapseButton/index.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/components/DragButton/index.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/I18nCopyNavigationItems/index.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationContentHeader/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/hooks.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/index.d.ts +23 -0
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/styles.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/index.d.ts +22 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/types.d.ts +45 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +184 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/hooks.d.ts +1 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/properties.d.ts +33 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/Wrapper.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/index.d.ts +25 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardBadge/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/Wrapper.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/icons.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/index.d.ts +16 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardRemovedOverlay/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/Wrapper.d.ts +6 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/index.d.ts +44 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupHeader.d.ts +4 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/index.d.ts +19 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/AllNavigations/icons.d.ts +3 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/AllNavigations/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/DeletionConfirm/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/ErrorDetails/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Footer/index.d.ts +26 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/hooks.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/Form/index.d.ts +10 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/NavigationUpdate/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/NewNavigation/index.d.ts +8 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/PurgeCacheConfirm/index.d.ts +7 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/index.d.ts +9 -0
- package/dist/admin/src/pages/HomePage/components/NavigationManager/types.d.ts +46 -0
- package/dist/admin/src/pages/HomePage/components/Search/index.d.ts +11 -0
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +144 -0
- package/dist/admin/src/pages/HomePage/index.d.ts +2 -0
- package/dist/admin/src/pages/HomePage/utils/index.d.ts +5 -0
- package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +46 -0
- package/dist/admin/src/pages/SettingsPage/common/const.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldModal/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/components/CustomFieldTable/index.d.ts +11 -0
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +369 -0
- package/dist/admin/src/pages/SettingsPage/index.d.ts +1 -0
- package/dist/admin/src/pages/SettingsPage/types.d.ts +7 -0
- package/dist/admin/src/pages/SettingsPage/utils/index.d.ts +9 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/schemas/config.d.ts +453 -0
- package/dist/admin/src/schemas/content-type.d.ts +49 -0
- package/dist/admin/src/translations/ca.d.ts +478 -0
- package/dist/admin/src/translations/en.d.ts +489 -0
- package/dist/admin/src/translations/fr.d.ts +488 -0
- package/dist/admin/src/translations/index.d.ts +14 -0
- package/dist/admin/src/types.d.ts +6 -0
- package/dist/admin/src/utils/constants.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +3 -0
- package/dist/admin/src/utils/permissions.d.ts +15 -0
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
- package/dist/assets/configuration.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/assets/manager-view.png +0 -0
- package/dist/assets/marketplace.png +0 -0
- package/dist/assets/preview.png +0 -0
- package/dist/server/index.js +16171 -0
- package/dist/server/index.mjs +16135 -0
- package/dist/server/src/app-errors.d.ts +11 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/cache/index.d.ts +4 -0
- package/dist/server/src/config/index.d.ts +20 -0
- package/dist/server/src/config/setup.d.ts +41 -0
- package/dist/server/src/content-types/audience/index.d.ts +26 -0
- package/dist/server/src/content-types/audience/schema.d.ts +24 -0
- package/dist/server/src/content-types/index.d.ts +190 -0
- package/dist/server/src/content-types/navigation/index.d.ts +56 -0
- package/dist/server/src/content-types/navigation/lifecycles.d.ts +2 -0
- package/dist/server/src/content-types/navigation/schema.d.ts +53 -0
- package/dist/server/src/content-types/navigation-item/index.d.ts +108 -0
- package/dist/server/src/content-types/navigation-item/lifecycles.d.ts +2 -0
- package/dist/server/src/content-types/navigation-item/schema.d.ts +105 -0
- package/dist/server/src/controllers/admin.d.ts +241 -0
- package/dist/server/src/controllers/client.d.ts +192 -0
- package/dist/server/src/controllers/index.d.ts +7 -0
- package/dist/server/src/controllers/utils.d.ts +4 -0
- package/dist/server/src/controllers/validators.d.ts +62 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/dtos/config.d.ts +28 -0
- package/dist/server/src/dtos/index.d.ts +3 -0
- package/dist/server/src/dtos/navigation-item.d.ts +52 -0
- package/dist/server/src/dtos/navigation.d.ts +5 -0
- package/dist/server/src/graphql/config.d.ts +5 -0
- package/dist/server/src/graphql/index.d.ts +1 -0
- package/dist/server/src/graphql/queries/index.d.ts +1 -0
- package/dist/server/src/graphql/queries/render-navigation-child.d.ts +31 -0
- package/dist/server/src/graphql/queries/render-navigation.d.ts +32 -0
- package/dist/server/src/graphql/resolvers-config.d.ts +8 -0
- package/dist/server/src/graphql/setup.d.ts +4 -0
- package/dist/server/src/graphql/types/content-types-name-fields.d.ts +2 -0
- package/dist/server/src/graphql/types/content-types.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation-item.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation-related.d.ts +2 -0
- package/dist/server/src/graphql/types/create-navigation.d.ts +2 -0
- package/dist/server/src/graphql/types/index.d.ts +1 -0
- package/dist/server/src/graphql/types/navigation-config.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-details.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-additional-field-media.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-additional-fields.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-related-data.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item-related.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-item.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation-render-type.d.ts +2 -0
- package/dist/server/src/graphql/types/navigation.d.ts +2 -0
- package/dist/server/src/i18n/index.d.ts +4 -0
- package/dist/server/src/index.d.ts +582 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/permissions/index.d.ts +3 -0
- package/dist/server/src/permissions/permissions.d.ts +9 -0
- package/dist/server/src/permissions/setup.d.ts +4 -0
- package/dist/server/src/permissions.d.ts +13 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/repositories/audience.d.ts +11 -0
- package/dist/server/src/repositories/generic.d.ts +23 -0
- package/dist/server/src/repositories/index.d.ts +4 -0
- package/dist/server/src/repositories/navigation-item.d.ts +24 -0
- package/dist/server/src/repositories/navigation.d.ts +47 -0
- package/dist/server/src/routes/admin.d.ts +24 -0
- package/dist/server/src/routes/client.d.ts +17 -0
- package/dist/server/src/routes/index.d.ts +37 -0
- package/dist/server/src/schemas/config.d.ts +424 -0
- package/dist/server/src/schemas/content-type.d.ts +918 -0
- package/dist/server/src/schemas/index.d.ts +3 -0
- package/dist/server/src/schemas/navigation.d.ts +237 -0
- package/dist/server/src/services/admin/admin.d.ts +32 -0
- package/dist/server/src/services/admin/index.d.ts +3 -0
- package/dist/server/src/services/admin/types.d.ts +47 -0
- package/dist/server/src/services/admin/utils.d.ts +32 -0
- package/dist/server/src/services/client/client.d.ts +93 -0
- package/dist/server/src/services/client/index.d.ts +3 -0
- package/dist/server/src/services/client/types.d.ts +66 -0
- package/dist/server/src/services/client/utils.d.ts +12 -0
- package/dist/server/src/services/common/common.d.ts +31 -0
- package/dist/server/src/services/common/index.d.ts +3 -0
- package/dist/server/src/services/common/types.d.ts +68 -0
- package/dist/server/src/services/common/utils.d.ts +12 -0
- package/dist/server/src/services/index.d.ts +320 -0
- package/dist/server/src/services/migration/index.d.ts +3 -0
- package/dist/server/src/services/migration/migration.d.ts +8 -0
- package/dist/server/src/types.d.ts +40 -0
- package/dist/server/src/utils/constants.d.ts +13 -0
- package/dist/server/src/utils/functions.d.ts +30 -0
- package/dist/server/src/utils/index.d.ts +2 -0
- package/package.json +116 -35
- package/admin/api/client.js +0 -107
- package/admin/api/validators.js +0 -248
- package/admin/components/ConfirmationDialog/index.js +0 -21
- package/admin/components/Initializer.js +0 -10
- package/admin/components/RestartAlert/index.js +0 -7
- package/admin/components/TextArrayInput/index.js +0 -18
- package/admin/components/icons/navigation.js +0 -9
- package/admin/components/icons/pluginIcon.js +0 -9
- package/admin/index.js +0 -48
- package/admin/pages/App.js +0 -10
- package/admin/pages/HomePage/components/AdditionalFieldInput/index.js +0 -58
- package/admin/pages/HomePage/components/CollapseButton/index.js +0 -15
- package/admin/pages/HomePage/components/DragButton/index.js +0 -55
- package/admin/pages/HomePage/components/I18nCopyNavigationItems/index.js +0 -9
- package/admin/pages/HomePage/components/NavigationContentHeader/index.js +0 -5
- package/admin/pages/HomePage/components/NavigationHeader/hooks.js +0 -14
- package/admin/pages/HomePage/components/NavigationHeader/index.js +0 -29
- package/admin/pages/HomePage/components/NavigationHeader/styles.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemForm/index.js +0 -277
- package/admin/pages/HomePage/components/NavigationItemForm/types.js +0 -1
- package/admin/pages/HomePage/components/NavigationItemForm/utils/form.js +0 -105
- package/admin/pages/HomePage/components/NavigationItemForm/utils/hooks.js +0 -12
- package/admin/pages/HomePage/components/NavigationItemForm/utils/properties.js +0 -51
- package/admin/pages/HomePage/components/NavigationItemList/Wrapper.js +0 -21
- package/admin/pages/HomePage/components/NavigationItemList/index.js +0 -6
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardBadge/index.js +0 -20
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/Wrapper.js +0 -14
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/icons.js +0 -6
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/index.js +0 -19
- package/admin/pages/HomePage/components/NavigationItemListItem/ItemCardRemovedOverlay/index.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemListItem/Wrapper.js +0 -38
- package/admin/pages/HomePage/components/NavigationItemListItem/index.js +0 -165
- package/admin/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupFooter.js +0 -11
- package/admin/pages/HomePage/components/NavigationItemPopup/NavigationItemPopupHeader.js +0 -12
- package/admin/pages/HomePage/components/NavigationItemPopup/index.js +0 -34
- package/admin/pages/HomePage/components/NavigationManager/AllNavigations/icons.js +0 -5
- package/admin/pages/HomePage/components/NavigationManager/AllNavigations/index.js +0 -79
- package/admin/pages/HomePage/components/NavigationManager/DeletionConfirm/index.js +0 -25
- package/admin/pages/HomePage/components/NavigationManager/ErrorDetails/index.js +0 -29
- package/admin/pages/HomePage/components/NavigationManager/Footer/index.js +0 -6
- package/admin/pages/HomePage/components/NavigationManager/Form/hooks.js +0 -19
- package/admin/pages/HomePage/components/NavigationManager/Form/index.js +0 -26
- package/admin/pages/HomePage/components/NavigationManager/NavigationUpdate/index.js +0 -32
- package/admin/pages/HomePage/components/NavigationManager/NewNavigation/index.js +0 -35
- package/admin/pages/HomePage/components/NavigationManager/PurgeCacheConfirm/index.js +0 -25
- package/admin/pages/HomePage/components/NavigationManager/index.js +0 -236
- package/admin/pages/HomePage/components/NavigationManager/types.js +0 -1
- package/admin/pages/HomePage/components/Search/index.js +0 -58
- package/admin/pages/HomePage/hooks/index.js +0 -165
- package/admin/pages/HomePage/index.js +0 -231
- package/admin/pages/HomePage/utils/index.js +0 -16
- package/admin/pages/HomePage/utils/parsers.js +0 -187
- package/admin/pages/SettingsPage/common/const.js +0 -1
- package/admin/pages/SettingsPage/components/CustomFieldForm/hooks/index.js +0 -10
- package/admin/pages/SettingsPage/components/CustomFieldForm/index.js +0 -36
- package/admin/pages/SettingsPage/components/CustomFieldModal/index.js +0 -16
- package/admin/pages/SettingsPage/components/CustomFieldTable/index.js +0 -45
- package/admin/pages/SettingsPage/hooks/index.js +0 -111
- package/admin/pages/SettingsPage/index.js +0 -189
- package/admin/pages/SettingsPage/types.js +0 -1
- package/admin/pages/SettingsPage/utils/index.js +0 -25
- package/admin/pluginId.js +0 -1
- package/admin/schemas/config.js +0 -53
- package/admin/schemas/content-type.js +0 -14
- package/admin/translations/ca.json +0 -199
- package/admin/translations/en.json +0 -218
- package/admin/translations/fr.json +0 -48
- package/admin/translations/index.js +0 -15
- package/admin/types.js +0 -1
- package/admin/utils/constants.js +0 -1
- package/admin/utils/getTranslation.js +0 -4
- package/admin/utils/permissions.js +0 -16
- package/admin/utils/prefixPluginTranslations.js +0 -3
- package/server/app-errors.js +0 -20
- package/server/bootstrap.js +0 -13
- package/server/cache/index.js +0 -37
- package/server/config/index.js +0 -39
- package/server/config/setup.js +0 -59
- package/server/content-types/audience/index.js +0 -9
- package/server/content-types/audience/schema.js +0 -25
- package/server/content-types/index.js +0 -13
- package/server/content-types/navigation/index.js +0 -11
- package/server/content-types/navigation/lifecycles.js +0 -6
- package/server/content-types/navigation/schema.js +0 -54
- package/server/content-types/navigation-item/index.js +0 -11
- package/server/content-types/navigation-item/lifecycles.js +0 -6
- package/server/content-types/navigation-item/schema.js +0 -106
- package/server/controllers/admin.js +0 -125
- package/server/controllers/client.js +0 -86
- package/server/controllers/index.js +0 -11
- package/server/controllers/utils.js +0 -22
- package/server/controllers/validators.js +0 -48
- package/server/destroy.js +0 -6
- package/server/dtos/config.js +0 -2
- package/server/dtos/index.js +0 -19
- package/server/dtos/navigation-item.js +0 -2
- package/server/dtos/navigation.js +0 -2
- package/server/graphql/config.js +0 -26
- package/server/graphql/index.js +0 -17
- package/server/graphql/queries/index.js +0 -21
- package/server/graphql/queries/render-navigation-child.js +0 -36
- package/server/graphql/queries/render-navigation.js +0 -48
- package/server/graphql/resolvers-config.js +0 -8
- package/server/graphql/setup.js +0 -14
- package/server/graphql/types/content-types-name-fields.js +0 -15
- package/server/graphql/types/content-types.js +0 -18
- package/server/graphql/types/create-navigation-item.js +0 -19
- package/server/graphql/types/create-navigation-related.js +0 -10
- package/server/graphql/types/create-navigation.js +0 -9
- package/server/graphql/types/index.js +0 -38
- package/server/graphql/types/navigation-config.js +0 -11
- package/server/graphql/types/navigation-details.js +0 -12
- package/server/graphql/types/navigation-item-additional-field-media.js +0 -13
- package/server/graphql/types/navigation-item-related-data.js +0 -9
- package/server/graphql/types/navigation-item-related.js +0 -25
- package/server/graphql/types/navigation-item.js +0 -58
- package/server/graphql/types/navigation-render-type.js +0 -6
- package/server/graphql/types/navigation.js +0 -11
- package/server/i18n/index.js +0 -32
- package/server/index.js +0 -33
- package/server/middlewares/index.js +0 -3
- package/server/permissions/index.js +0 -10
- package/server/permissions/permissions.js +0 -12
- package/server/permissions/setup.js +0 -32
- package/server/permissions.js +0 -39
- package/server/policies/index.js +0 -3
- package/server/register.js +0 -6
- package/server/repositories/audience.js +0 -12
- package/server/repositories/generic.js +0 -20
- package/server/repositories/index.js +0 -11
- package/server/repositories/navigation-item.js +0 -51
- package/server/repositories/navigation.js +0 -65
- package/server/routes/admin.js +0 -216
- package/server/routes/client.js +0 -32
- package/server/routes/index.js +0 -12
- package/server/schemas/config.js +0 -68
- package/server/schemas/content-type.js +0 -140
- package/server/schemas/index.js +0 -19
- package/server/schemas/navigation.js +0 -107
- package/server/services/admin/admin.js +0 -483
- package/server/services/admin/index.js +0 -7
- package/server/services/admin/types.js +0 -2
- package/server/services/admin/utils.js +0 -84
- package/server/services/client/client.js +0 -397
- package/server/services/client/index.js +0 -7
- package/server/services/client/types.js +0 -2
- package/server/services/client/utils.js +0 -88
- package/server/services/common/common.js +0 -307
- package/server/services/common/index.js +0 -7
- package/server/services/common/types.js +0 -2
- package/server/services/common/utils.js +0 -24
- package/server/services/index.js +0 -13
- package/server/types.js +0 -2
- package/server/utils/constants.js +0 -35
- package/server/utils/functions.js +0 -111
- package/server/utils/index.js +0 -18
- package/strapi-admin.js +0 -5
- package/strapi-server.js +0 -3
- package/tsconfig.tsbuildinfo +0 -1
- /package/{admin/api/index.js → dist/admin/src/api/index.d.ts} +0 -0
- /package/{admin/components/icons/index.js → dist/admin/src/components/icons/index.d.ts} +0 -0
- /package/{admin/pages/HomePage/components/index.js → dist/admin/src/pages/HomePage/components/index.d.ts} +0 -0
- /package/{admin/pages/SettingsPage/common/index.js → dist/admin/src/pages/SettingsPage/common/index.d.ts} +0 -0
- /package/{admin/schemas/index.js → dist/admin/src/schemas/index.d.ts} +0 -0
package/admin/api/client.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { once } from 'lodash';
|
|
2
|
-
import { strapiContentTypeSchema } from '../schemas';
|
|
3
|
-
import { configFromServerSchema, i18nCopyItemDetails, localeSchema, navigationSchema, slugifyResult, strapiContentTypeItemSchema, } from './validators';
|
|
4
|
-
const URL_PREFIX = 'navigation';
|
|
5
|
-
export const getApiClient = once((fetch) => ({
|
|
6
|
-
getIndexPrefix() {
|
|
7
|
-
return [URL_PREFIX];
|
|
8
|
-
},
|
|
9
|
-
readAll() {
|
|
10
|
-
return fetch.get(`/${URL_PREFIX}`).then(({ data }) => navigationSchema.array().parse(data));
|
|
11
|
-
},
|
|
12
|
-
readAllIndex() {
|
|
13
|
-
return [URL_PREFIX, 'navigations'];
|
|
14
|
-
},
|
|
15
|
-
delete(id) {
|
|
16
|
-
return fetch.del(`/${URL_PREFIX}/${id}`);
|
|
17
|
-
},
|
|
18
|
-
create(body) {
|
|
19
|
-
return fetch.post(`/${URL_PREFIX}/`, body);
|
|
20
|
-
},
|
|
21
|
-
update(body) {
|
|
22
|
-
return fetch.put(`/${URL_PREFIX}/${body.id}`, body);
|
|
23
|
-
},
|
|
24
|
-
purge({ id, withLangVersions }) {
|
|
25
|
-
return fetch.del(`/${URL_PREFIX}/cache/purge/${id ?? ''}?clearLocalisations=${!!withLangVersions}`);
|
|
26
|
-
},
|
|
27
|
-
slugify(query) {
|
|
28
|
-
const queryParams = new URLSearchParams();
|
|
29
|
-
queryParams.append('q', query);
|
|
30
|
-
return fetch
|
|
31
|
-
.get(`/${URL_PREFIX}/slug?${queryParams.toString()}`)
|
|
32
|
-
.then(({ data }) => slugifyResult.parse(data))
|
|
33
|
-
.then(({ slug }) => slug);
|
|
34
|
-
},
|
|
35
|
-
readConfig() {
|
|
36
|
-
return fetch
|
|
37
|
-
.get(`/${URL_PREFIX}/config`)
|
|
38
|
-
.then(({ data }) => configFromServerSchema.parse(data));
|
|
39
|
-
},
|
|
40
|
-
readConfigIndex() {
|
|
41
|
-
return [URL_PREFIX, 'config'];
|
|
42
|
-
},
|
|
43
|
-
readNavigationItemFromLocale({ source, structureId, target, }) {
|
|
44
|
-
return fetch.get(`/${URL_PREFIX}/i18n/item/read/${source}/${target}?path=${structureId}`);
|
|
45
|
-
},
|
|
46
|
-
updateConfig(body) {
|
|
47
|
-
return fetch.put(`/${URL_PREFIX}/config`, body).then(() => { });
|
|
48
|
-
},
|
|
49
|
-
restart() {
|
|
50
|
-
return fetch.get(`/${URL_PREFIX}/settings/restart`).then(() => { });
|
|
51
|
-
},
|
|
52
|
-
restoreConfig() {
|
|
53
|
-
return fetch.del(`/${URL_PREFIX}/config`).then(() => { });
|
|
54
|
-
},
|
|
55
|
-
readSettingsConfig() {
|
|
56
|
-
return fetch.get(`/${URL_PREFIX}/settings/config`).then(({ data }) => {
|
|
57
|
-
const fromServer = configFromServerSchema.parse(data);
|
|
58
|
-
return {
|
|
59
|
-
...fromServer,
|
|
60
|
-
contentTypes: fromServer.contentTypes.map(({ uid }) => uid),
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
readSettingsConfigIndex() {
|
|
65
|
-
return [URL_PREFIX, 'config'];
|
|
66
|
-
},
|
|
67
|
-
readContentType() {
|
|
68
|
-
return fetch
|
|
69
|
-
.get(`/content-manager/content-types`)
|
|
70
|
-
.then(({ data }) => strapiContentTypeSchema.array().parse(data.data));
|
|
71
|
-
},
|
|
72
|
-
readContentTypeIndex() {
|
|
73
|
-
return [URL_PREFIX, 'content-manager', 'content-types'];
|
|
74
|
-
},
|
|
75
|
-
readContentTypeItems({ uid, locale, query }) {
|
|
76
|
-
const queryParams = new URLSearchParams();
|
|
77
|
-
queryParams.append('_publicationState', 'preview');
|
|
78
|
-
if (query) {
|
|
79
|
-
queryParams.append('_q', query);
|
|
80
|
-
}
|
|
81
|
-
if (locale) {
|
|
82
|
-
queryParams.append('localeCode', locale);
|
|
83
|
-
}
|
|
84
|
-
return fetch
|
|
85
|
-
.get(`/${URL_PREFIX}/content-type-items/${uid}?${queryParams.toString()}`)
|
|
86
|
-
.then(({ data }) => strapiContentTypeItemSchema.array().parse(data));
|
|
87
|
-
},
|
|
88
|
-
readContentTypeItemsIndex({ uid, locale, query, }) {
|
|
89
|
-
return [URL_PREFIX, 'content-manager', 'content-type-items', uid, locale, query];
|
|
90
|
-
},
|
|
91
|
-
readLocale() {
|
|
92
|
-
return fetch
|
|
93
|
-
.get(`/${URL_PREFIX}/settings/locale`)
|
|
94
|
-
.then((data) => localeSchema.parse(data.data));
|
|
95
|
-
},
|
|
96
|
-
readLocaleIndex() {
|
|
97
|
-
return [URL_PREFIX, 'locale'];
|
|
98
|
-
},
|
|
99
|
-
copyNavigationLocale({ source, target }) {
|
|
100
|
-
return fetch.put(`/${URL_PREFIX}/i18n/copy/${source}/${target}`);
|
|
101
|
-
},
|
|
102
|
-
copyNavigationItemLocale({ source, structureId = '', target, }) {
|
|
103
|
-
return fetch
|
|
104
|
-
.get(`/${URL_PREFIX}/i18n/item/read/${source}/${target}?path=${structureId}`)
|
|
105
|
-
.then((data) => i18nCopyItemDetails.parse(data.data));
|
|
106
|
-
},
|
|
107
|
-
}));
|
package/admin/api/validators.js
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export const audienceDBSchema = z.object({
|
|
3
|
-
id: z.number(),
|
|
4
|
-
name: z.string(),
|
|
5
|
-
key: z.string(),
|
|
6
|
-
});
|
|
7
|
-
export const navigationItemTypeSchema = z.enum(['INTERNAL', 'EXTERNAL']);
|
|
8
|
-
const navigationItemBaseSchema = z.object({
|
|
9
|
-
id: z.number(),
|
|
10
|
-
title: z.string(),
|
|
11
|
-
type: navigationItemTypeSchema,
|
|
12
|
-
path: z.string(),
|
|
13
|
-
externalPath: z.string().or(z.null()).optional(),
|
|
14
|
-
uiRouterKey: z.string(),
|
|
15
|
-
menuAttached: z.boolean(),
|
|
16
|
-
order: z.number().int(),
|
|
17
|
-
collapsed: z.boolean(),
|
|
18
|
-
autoSync: z.boolean().or(z.null()).optional(),
|
|
19
|
-
related: z.string().or(z.null()).optional(),
|
|
20
|
-
additionalFields: z.record(z.string(), z.unknown()).or(z.null()).optional(),
|
|
21
|
-
audience: z.array(audienceDBSchema).or(z.null()).optional(),
|
|
22
|
-
viewId: z.number().optional(),
|
|
23
|
-
viewParentId: z.number().optional(),
|
|
24
|
-
structureId: z.string().optional(),
|
|
25
|
-
removed: z.boolean().optional(),
|
|
26
|
-
isSearchActive: z.boolean().optional(),
|
|
27
|
-
updated: z.boolean().optional(),
|
|
28
|
-
});
|
|
29
|
-
export const navigationItemSchema = navigationItemBaseSchema.extend({
|
|
30
|
-
items: z.lazy(() => navigationItemSchema.array().or(z.null())).optional(),
|
|
31
|
-
});
|
|
32
|
-
export const navigationSchema = z.object({
|
|
33
|
-
id: z.number(),
|
|
34
|
-
documentId: z.string(),
|
|
35
|
-
name: z.string(),
|
|
36
|
-
slug: z.string(),
|
|
37
|
-
localeCode: z.string(),
|
|
38
|
-
visible: z.boolean(),
|
|
39
|
-
items: z.array(navigationItemSchema),
|
|
40
|
-
});
|
|
41
|
-
const navigationCustomFieldBase = z.object({
|
|
42
|
-
name: z.string(),
|
|
43
|
-
label: z.string(),
|
|
44
|
-
required: z.boolean().optional(),
|
|
45
|
-
enabled: z.boolean().optional(),
|
|
46
|
-
});
|
|
47
|
-
const navigationItemCustomFieldSelect = navigationCustomFieldBase.extend({
|
|
48
|
-
type: z.literal('select'),
|
|
49
|
-
multi: z.boolean(),
|
|
50
|
-
options: z.array(z.string()),
|
|
51
|
-
});
|
|
52
|
-
const navigationItemCustomFieldPrimitive = navigationCustomFieldBase.extend({
|
|
53
|
-
type: z.enum(['boolean', 'string']),
|
|
54
|
-
multi: z.literal(false).optional(),
|
|
55
|
-
options: z.array(z.string()).max(0).optional(),
|
|
56
|
-
});
|
|
57
|
-
const navigationItemCustomFieldMedia = navigationCustomFieldBase.extend({
|
|
58
|
-
type: z.literal('media'),
|
|
59
|
-
multi: z.literal(false).optional(),
|
|
60
|
-
options: z.array(z.string()).max(0).optional(),
|
|
61
|
-
});
|
|
62
|
-
export const navigationItemCustomField = navigationItemCustomFieldPrimitive
|
|
63
|
-
.or(navigationItemCustomFieldMedia)
|
|
64
|
-
.or(navigationItemCustomFieldSelect);
|
|
65
|
-
export const navigationItemAdditionalField = z.union([
|
|
66
|
-
z.literal('audience'),
|
|
67
|
-
navigationItemCustomField,
|
|
68
|
-
]);
|
|
69
|
-
export const configContentTypeSchema = z.object({
|
|
70
|
-
uid: z.string(),
|
|
71
|
-
name: z.string(),
|
|
72
|
-
draftAndPublish: z.boolean(),
|
|
73
|
-
isSingle: z.boolean(),
|
|
74
|
-
description: z.string(),
|
|
75
|
-
collectionName: z.string(),
|
|
76
|
-
contentTypeName: z.string(),
|
|
77
|
-
label: z.string(),
|
|
78
|
-
labelSingular: z.string(),
|
|
79
|
-
endpoint: z.string(),
|
|
80
|
-
available: z.boolean(),
|
|
81
|
-
visible: z.boolean(),
|
|
82
|
-
});
|
|
83
|
-
export const configSchema = z.object({
|
|
84
|
-
additionalFields: z.array(navigationItemAdditionalField),
|
|
85
|
-
allowedLevels: z.number(),
|
|
86
|
-
availableAudience: z
|
|
87
|
-
.object({
|
|
88
|
-
id: z.number(),
|
|
89
|
-
name: z.string(),
|
|
90
|
-
key: z.string(),
|
|
91
|
-
})
|
|
92
|
-
.array(),
|
|
93
|
-
contentTypes: z.array(z.string()),
|
|
94
|
-
contentTypesNameFields: z.record(z.string(), z.array(z.string())),
|
|
95
|
-
contentTypesPopulate: z.record(z.string(), z.array(z.string())),
|
|
96
|
-
gql: z.object({
|
|
97
|
-
navigationItemRelated: z.array(z.string()),
|
|
98
|
-
}),
|
|
99
|
-
pathDefaultFields: z.record(z.string(), z.string().array()),
|
|
100
|
-
cascadeMenuAttached: z.boolean(),
|
|
101
|
-
preferCustomContentTypes: z.boolean(),
|
|
102
|
-
allowedContentTypes: z.string().array(),
|
|
103
|
-
restrictedContentTypes: z.string().array(),
|
|
104
|
-
isCacheEnabled: z.boolean().optional(),
|
|
105
|
-
isCachePluginEnabled: z.boolean().optional(),
|
|
106
|
-
});
|
|
107
|
-
export const configFromServerSchema = configSchema
|
|
108
|
-
.omit({
|
|
109
|
-
contentTypes: true,
|
|
110
|
-
})
|
|
111
|
-
.extend({
|
|
112
|
-
contentTypes: configContentTypeSchema.array(),
|
|
113
|
-
});
|
|
114
|
-
export const localeSchema = z.object({
|
|
115
|
-
defaultLocale: z.string(),
|
|
116
|
-
restLocale: z.string().array(),
|
|
117
|
-
});
|
|
118
|
-
export const contentType = z.enum(['collectionType', 'singleType']);
|
|
119
|
-
export const contentTypeInfo = z.object({
|
|
120
|
-
singularName: z.string(),
|
|
121
|
-
pluralName: z.string(),
|
|
122
|
-
displayName: z.string(),
|
|
123
|
-
description: z.string().optional(),
|
|
124
|
-
name: z.string().optional(),
|
|
125
|
-
});
|
|
126
|
-
export const contentTypeAttributeValidator = z.object({
|
|
127
|
-
required: z.boolean().optional(),
|
|
128
|
-
max: z.number().optional(),
|
|
129
|
-
min: z.number().optional(),
|
|
130
|
-
minLength: z.number().optional(),
|
|
131
|
-
maxLength: z.number().optional(),
|
|
132
|
-
private: z.boolean().optional(),
|
|
133
|
-
configurable: z.boolean().optional(),
|
|
134
|
-
default: z.any().optional(),
|
|
135
|
-
});
|
|
136
|
-
export const contentTypeFieldTypeSchema = z.enum([
|
|
137
|
-
'string',
|
|
138
|
-
'text',
|
|
139
|
-
'richtext',
|
|
140
|
-
'blocks',
|
|
141
|
-
'email',
|
|
142
|
-
'password',
|
|
143
|
-
'date',
|
|
144
|
-
'time',
|
|
145
|
-
'datetime',
|
|
146
|
-
'timestamp',
|
|
147
|
-
'boolean',
|
|
148
|
-
'integer',
|
|
149
|
-
'biginteger',
|
|
150
|
-
'float',
|
|
151
|
-
'decimal',
|
|
152
|
-
'json',
|
|
153
|
-
'relation',
|
|
154
|
-
]);
|
|
155
|
-
export const simpleContentTypeAttribute = contentTypeAttributeValidator.extend({
|
|
156
|
-
type: contentTypeFieldTypeSchema,
|
|
157
|
-
});
|
|
158
|
-
export const contentTypeEnumerationAttribute = contentTypeAttributeValidator.extend({
|
|
159
|
-
type: z.literal('enumeration'),
|
|
160
|
-
enum: z.string().array(),
|
|
161
|
-
});
|
|
162
|
-
export const contentTypeComponentAttribute = z.object({
|
|
163
|
-
type: z.literal('component'),
|
|
164
|
-
component: z.string(),
|
|
165
|
-
repeatable: z.boolean().optional(),
|
|
166
|
-
});
|
|
167
|
-
export const contentTypeDynamicZoneAttribute = z.object({
|
|
168
|
-
type: z.literal('dynamiczone'),
|
|
169
|
-
components: z.string().array(),
|
|
170
|
-
});
|
|
171
|
-
export const contentTypeMediaAttribute = z.object({
|
|
172
|
-
media: z.literal('media'),
|
|
173
|
-
allowedTypes: z.enum(['images', 'videos', 'files']).array(),
|
|
174
|
-
required: z.boolean().optional(),
|
|
175
|
-
});
|
|
176
|
-
export const contentTypeRelationType = z.enum([
|
|
177
|
-
'oneToOne',
|
|
178
|
-
'oneToMany',
|
|
179
|
-
'manyToOne',
|
|
180
|
-
'manyToMany',
|
|
181
|
-
'morphToMany',
|
|
182
|
-
'manyToMorph',
|
|
183
|
-
]);
|
|
184
|
-
export const contentTypeRelationAttribute = z.object({
|
|
185
|
-
type: z.literal('relation'),
|
|
186
|
-
relation: contentTypeRelationType,
|
|
187
|
-
target: z.string(),
|
|
188
|
-
mappedBy: z.string().optional(),
|
|
189
|
-
inversedBy: z.string().optional(),
|
|
190
|
-
});
|
|
191
|
-
export const contentTypeAttributes = z.record(z.string(), z.union([
|
|
192
|
-
simpleContentTypeAttribute,
|
|
193
|
-
contentTypeEnumerationAttribute,
|
|
194
|
-
contentTypeComponentAttribute,
|
|
195
|
-
contentTypeDynamicZoneAttribute,
|
|
196
|
-
contentTypeRelationAttribute,
|
|
197
|
-
contentTypeMediaAttribute,
|
|
198
|
-
]));
|
|
199
|
-
export const contentTypeFullSchema = z.object({
|
|
200
|
-
kind: contentType,
|
|
201
|
-
collectionName: z.string(),
|
|
202
|
-
info: contentTypeInfo,
|
|
203
|
-
options: z
|
|
204
|
-
.object({
|
|
205
|
-
draftAndPublish: z.boolean().optional(),
|
|
206
|
-
hidden: z.boolean().optional(),
|
|
207
|
-
templateName: z.string().optional(),
|
|
208
|
-
})
|
|
209
|
-
.optional(),
|
|
210
|
-
attributes: contentTypeAttributes,
|
|
211
|
-
actions: z.record(z.string(), z.any()).optional(),
|
|
212
|
-
lifecycles: z.record(z.string(), z.any()).optional(),
|
|
213
|
-
uid: z.string(),
|
|
214
|
-
apiName: z.string().optional(),
|
|
215
|
-
// TODO?: remove
|
|
216
|
-
associations: z
|
|
217
|
-
.object({
|
|
218
|
-
model: z.string(),
|
|
219
|
-
alias: z.string(),
|
|
220
|
-
})
|
|
221
|
-
.array()
|
|
222
|
-
.optional(),
|
|
223
|
-
modelName: z.string().optional(),
|
|
224
|
-
plugin: z.string().optional(),
|
|
225
|
-
pluginOptions: z.record(z.string(), z.any()).optional(),
|
|
226
|
-
isSingle: z.boolean().optional(),
|
|
227
|
-
});
|
|
228
|
-
export const contentTypeSchema = contentTypeFullSchema.pick({
|
|
229
|
-
info: true,
|
|
230
|
-
kind: true,
|
|
231
|
-
attributes: true,
|
|
232
|
-
options: true,
|
|
233
|
-
});
|
|
234
|
-
export const strapiContentTypeItemSchema = z
|
|
235
|
-
.object({
|
|
236
|
-
id: z.number(),
|
|
237
|
-
locale: z.string().optional(),
|
|
238
|
-
})
|
|
239
|
-
.and(z.record(z.string(), z.any()));
|
|
240
|
-
export const slugifyResult = z.object({ slug: z.string() });
|
|
241
|
-
export const i18nCopyItemDetails = z.object({
|
|
242
|
-
externalPath: z.string().or(z.null()).optional(),
|
|
243
|
-
path: z.string().or(z.null()).optional(),
|
|
244
|
-
related: z.string().or(z.null()).optional(),
|
|
245
|
-
title: z.string(),
|
|
246
|
-
type: navigationItemTypeSchema,
|
|
247
|
-
uiRouterKey: z.string(),
|
|
248
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Entity Details
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
import { Button, Dialog, Flex, Typography } from '@strapi/design-system';
|
|
8
|
-
import { Check, WarningCircle } from '@strapi/icons';
|
|
9
|
-
import { useIntl } from 'react-intl';
|
|
10
|
-
import { getTrad } from '../../translations';
|
|
11
|
-
const DEFAULT_ICON = _jsx(WarningCircle, {});
|
|
12
|
-
export const ConfirmationDialog = ({ isVisible = false, isActionAsync = false, children, onConfirm, onCancel, header, labelCancel, labelConfirm, iconConfirm, mainIcon = DEFAULT_ICON, }) => {
|
|
13
|
-
const { formatMessage } = useIntl();
|
|
14
|
-
return isVisible ? (_jsx(Dialog.Root, { open: isVisible, onOpenChange: (isOpen) => {
|
|
15
|
-
if (!isOpen && isVisible) {
|
|
16
|
-
onCancel?.(undefined);
|
|
17
|
-
}
|
|
18
|
-
}, title: header || formatMessage(getTrad('components.confirmation.dialog.header', 'Confirmation')), children: _jsxs(Dialog.Content, { children: [_jsx(Dialog.Body, { icon: mainIcon, children: _jsx(Flex, { justifyContent: "center", children: _jsx(Typography, { id: "dialog-confirm-description", children: children || formatMessage(getTrad('components.confirmation.dialog.description')) }) }) }), _jsxs(Dialog.Footer, { children: [_jsx(Dialog.Cancel, { children: _jsx(Button, { fullWidth: true, onClick: onCancel, variant: "tertiary", disabled: isActionAsync, children: labelCancel ||
|
|
19
|
-
formatMessage(getTrad('components.confirmation.dialog.button.cancel', 'Cancel')) }) }), _jsx(Button, { fullWidth: true, onClick: onConfirm, variant: "danger-light", startIcon: iconConfirm || _jsx(Check, {}), disabled: isActionAsync, children: labelConfirm ||
|
|
20
|
-
formatMessage(getTrad('components.confirmation.dialog.button.confirm', 'Confirm')) })] })] }) })) : null;
|
|
21
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { PLUGIN_ID } from '../pluginId';
|
|
3
|
-
const Initializer = ({ setPlugin }) => {
|
|
4
|
-
const ref = useRef(setPlugin);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
ref.current?.(PLUGIN_ID);
|
|
7
|
-
}, []);
|
|
8
|
-
return null;
|
|
9
|
-
};
|
|
10
|
-
export { Initializer };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TextInput } from '@strapi/design-system';
|
|
3
|
-
import { isArray } from 'lodash';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
const TextArrayInput = ({ onChange, initialValue, ...props }) => {
|
|
6
|
-
const [value, setValue] = useState(isArray(initialValue) ? initialValue.reduce((acc, cur) => `${acc}${cur}; `, '') : '');
|
|
7
|
-
const handleOnChange = ({ target: { value } }) => {
|
|
8
|
-
const newValue = value;
|
|
9
|
-
const valuesArray = newValue
|
|
10
|
-
.split(';')
|
|
11
|
-
.map((v) => v.trim())
|
|
12
|
-
.filter((v) => !!v.length);
|
|
13
|
-
setValue(value);
|
|
14
|
-
onChange(valuesArray);
|
|
15
|
-
};
|
|
16
|
-
return _jsx(TextInput, { ...props, onChange: handleOnChange, value: value });
|
|
17
|
-
};
|
|
18
|
-
export default TextArrayInput;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
const initSize = 92;
|
|
4
|
-
const NavigationIconSvg = styled.svg `
|
|
5
|
-
path {
|
|
6
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
7
|
-
}
|
|
8
|
-
`;
|
|
9
|
-
export const NavigationIcon = ({ width = 24, height = 24 }) => (_jsx(NavigationIconSvg, { viewBox: `0px 0px ${width}px ${height}px`, xmlns: "http://www.w3.org/2000/svg", height: height, width: width, children: _jsx("g", { style: { transform: `scale(${width / initSize})` }, children: _jsx("path", { d: "M78,23.5H14c-3.6,0-6.5-2.9-6.5-6.5s2.9-6.5,6.5-6.5h64c3.6,0,6.5,2.9,6.5,6.5S81.6,23.5,78,23.5z M84.5,46\n c0-3.6-2.9-6.5-6.5-6.5H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,52.5,84.5,49.6,84.5,46z M84.5,75c0-3.6-2.9-6.5-6.5-6.5\n H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z" }) }) }));
|
package/admin/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Initializer } from './components/Initializer';
|
|
2
|
-
import { PluginIcon } from './components/icons/pluginIcon';
|
|
3
|
-
import App from './pages/App';
|
|
4
|
-
import SettingsPage from './pages/SettingsPage';
|
|
5
|
-
import { PLUGIN_ID } from './pluginId';
|
|
6
|
-
import trads, { getTrad } from './translations';
|
|
7
|
-
import pluginPermissions from './utils/permissions';
|
|
8
|
-
import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
|
|
9
|
-
export default {
|
|
10
|
-
register(app) {
|
|
11
|
-
app.createSettingSection({
|
|
12
|
-
id: PLUGIN_ID,
|
|
13
|
-
intlLabel: getTrad('pages.settings.section.title', 'Navigation Plugin'),
|
|
14
|
-
}, [
|
|
15
|
-
{
|
|
16
|
-
intlLabel: getTrad('pages.settings.section.subtitle', 'Configuration'),
|
|
17
|
-
id: 'navigation',
|
|
18
|
-
to: PLUGIN_ID,
|
|
19
|
-
Component() {
|
|
20
|
-
return SettingsPage;
|
|
21
|
-
},
|
|
22
|
-
permissions: pluginPermissions.settings,
|
|
23
|
-
},
|
|
24
|
-
]);
|
|
25
|
-
app.addMenuLink({
|
|
26
|
-
to: `plugins/${PLUGIN_ID}`,
|
|
27
|
-
icon: PluginIcon,
|
|
28
|
-
intlLabel: getTrad('plugin.name', 'Navigation'),
|
|
29
|
-
Component() {
|
|
30
|
-
return App;
|
|
31
|
-
},
|
|
32
|
-
permissions: pluginPermissions.access,
|
|
33
|
-
position: 1,
|
|
34
|
-
});
|
|
35
|
-
app.registerPlugin({
|
|
36
|
-
id: PLUGIN_ID,
|
|
37
|
-
initializer: Initializer,
|
|
38
|
-
isReady: false,
|
|
39
|
-
name: PLUGIN_ID,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
registerTrads() {
|
|
43
|
-
return Object.entries(trads).map(([locale, translations]) => ({
|
|
44
|
-
locale,
|
|
45
|
-
data: prefixPluginTranslations(translations, PLUGIN_ID),
|
|
46
|
-
}));
|
|
47
|
-
},
|
|
48
|
-
};
|
package/admin/pages/App.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Page } from '@strapi/strapi/admin';
|
|
3
|
-
import { DndProvider } from 'react-dnd';
|
|
4
|
-
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
5
|
-
import { Route, Routes } from 'react-router-dom';
|
|
6
|
-
import { HomePage } from './HomePage';
|
|
7
|
-
const App = () => {
|
|
8
|
-
return (_jsx(DndProvider, { backend: HTML5Backend, children: _jsxs(Routes, { children: [_jsx(Route, { path: `/`, index: true, Component: HomePage }), _jsx(Route, { path: `/*`, Component: Page.Error })] }) }));
|
|
9
|
-
};
|
|
10
|
-
export default App;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { MultiSelect, MultiSelectOption, SingleSelect, SingleSelectOption, TextInput, } from '@strapi/design-system';
|
|
3
|
-
import { useNotification, useStrapiApp } from '@strapi/strapi/admin';
|
|
4
|
-
import { isNil } from 'lodash';
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
import { useIntl } from 'react-intl';
|
|
7
|
-
import { Toggle } from '@strapi/design-system';
|
|
8
|
-
import { getTrad } from '../../../../translations';
|
|
9
|
-
const DEFAULT_STRING_VALUE = '';
|
|
10
|
-
const handlerFactory = ({ field, prop, onChange, }) => ({ target }) => {
|
|
11
|
-
onChange(field.name, target[prop], field.type);
|
|
12
|
-
};
|
|
13
|
-
const mediaAttribute = {
|
|
14
|
-
type: 'media',
|
|
15
|
-
multiple: false,
|
|
16
|
-
required: false,
|
|
17
|
-
allowedTypes: ['images'],
|
|
18
|
-
pluginOptions: {
|
|
19
|
-
i18n: {
|
|
20
|
-
localized: false,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
export const AdditionalFieldInput = ({ field, isLoading, onChange, value: baseValue, disabled, }) => {
|
|
25
|
-
const { toggleNotification } = useNotification();
|
|
26
|
-
const { formatMessage } = useIntl();
|
|
27
|
-
const fields = useStrapiApp('AdditionalFieldInput', (state) => state.fields);
|
|
28
|
-
// TODO?: typing
|
|
29
|
-
const MediaLibrary = fields.media;
|
|
30
|
-
const value = useMemo(() => (field.type === 'media' && baseValue ? JSON.parse(baseValue) : baseValue), [baseValue, field.type]);
|
|
31
|
-
const defaultInputProps = useMemo(() => ({
|
|
32
|
-
id: field.name,
|
|
33
|
-
name: field.name,
|
|
34
|
-
label: field.label,
|
|
35
|
-
disabled: isLoading || disabled,
|
|
36
|
-
}), [field, isLoading]);
|
|
37
|
-
const handleBoolean = useMemo(() => handlerFactory({ field, onChange, prop: 'checked' }), [onChange, field]);
|
|
38
|
-
const handleString = useMemo(() => handlerFactory({ field, onChange, prop: 'value' }), [onChange, field]);
|
|
39
|
-
const handleMedia = useMemo(() => handlerFactory({ field, onChange, prop: 'value' }), [onChange, field]);
|
|
40
|
-
switch (field.type) {
|
|
41
|
-
case 'boolean':
|
|
42
|
-
return (_jsx(Toggle, { ...defaultInputProps, checked: !!value, onChange: ({ currentTarget: { checked } }) => {
|
|
43
|
-
onChange(field.name, checked, field.type);
|
|
44
|
-
}, onLabel: "true", offLabel: "false", type: "checkbox" }));
|
|
45
|
-
case 'string':
|
|
46
|
-
return (_jsx(TextInput, { ...defaultInputProps, onChange: handleString, value: value || DEFAULT_STRING_VALUE }));
|
|
47
|
-
case 'select':
|
|
48
|
-
return field.multi ? (_jsx(MultiSelect, { ...defaultInputProps, onChange: (v) => onChange(field.name, v, 'select'), value: isNil(value) ? (field.multi ? [] : null) : value, multi: field.multi, withTags: field.multi, children: field.options.map((option, index) => (_jsx(MultiSelectOption, { value: option, children: option }, `${field.name}-option-${index}`))) })) : (_jsx(SingleSelect, { ...defaultInputProps, onChange: (v) => onChange(field.name, v, 'select'), value: isNil(value) ? (field.multi ? [] : null) : value, multi: field.multi, withTags: field.multi, children: field.options.map((option, index) => (_jsx(SingleSelectOption, { value: option, children: option }, `${field.name}-option-${index}`))) }));
|
|
49
|
-
case 'media':
|
|
50
|
-
return (_jsx(MediaLibrary, { ...defaultInputProps, onChange: handleMedia, value: value || [], intlLabel: defaultInputProps.label, attribute: mediaAttribute }));
|
|
51
|
-
default:
|
|
52
|
-
toggleNotification({
|
|
53
|
-
type: 'warning',
|
|
54
|
-
message: formatMessage(getTrad('notification.error.customField.type')),
|
|
55
|
-
});
|
|
56
|
-
throw new Error(`Type of custom field is unsupported`);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, Typography } from '@strapi/design-system';
|
|
3
|
-
import { CaretDown, CaretUp } from '@strapi/icons';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
const Wrapper = styled.div `
|
|
6
|
-
border-radius: 50%;
|
|
7
|
-
background: #dcdce4;
|
|
8
|
-
width: 25px;
|
|
9
|
-
height: 25px;
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
margin-right: 8px;
|
|
14
|
-
`;
|
|
15
|
-
export const CollapseButton = ({ toggle, collapsed, itemsCount }) => (_jsxs(Flex, { justifyContent: "space-between", alignItems: "center", onClick: toggle, cursor: "pointer", style: { marginRight: '16px' }, children: [_jsx(Wrapper, { children: collapsed ? _jsx(CaretDown, { width: "7px", height: "4px" }) : _jsx(CaretUp, { width: "7px", height: "4px" }) }), _jsxs(Typography, { variant: "pi", children: [itemsCount, " nested items"] })] }));
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Drag } from '@strapi/icons';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
const DragButtonWrapper = styled.span `
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
|
|
10
|
-
height: 32px;
|
|
11
|
-
width: 32px;
|
|
12
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
|
13
|
-
|
|
14
|
-
background: ${({ theme, isActive }) => isActive ? theme.colors.neutral150 : theme.colors.neutral0};
|
|
15
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
16
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
transition: background-color 0.3s ease-in;
|
|
19
|
-
|
|
20
|
-
svg {
|
|
21
|
-
height: ${({ theme }) => theme.spaces[3]};
|
|
22
|
-
width: ${({ theme }) => theme.spaces[3]};
|
|
23
|
-
|
|
24
|
-
> g,
|
|
25
|
-
path {
|
|
26
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
&:hover {
|
|
30
|
-
svg {
|
|
31
|
-
> g,
|
|
32
|
-
path {
|
|
33
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
&:active {
|
|
38
|
-
svg {
|
|
39
|
-
> g,
|
|
40
|
-
path {
|
|
41
|
-
fill: ${({ theme }) => theme.colors.neutral400};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
&[aria-disabled='true'] {
|
|
46
|
-
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
47
|
-
svg {
|
|
48
|
-
path {
|
|
49
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
const DragButton = React.forwardRef((props, ref) => (_jsx(DragButtonWrapper, { ...props, ref: ref, children: _jsx(Drag, {}) })));
|
|
55
|
-
export default DragButton;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ConfirmationDialog } from '../../../../components/ConfirmationDialog';
|
|
4
|
-
import { getTrad } from '../../../../translations';
|
|
5
|
-
const refreshIcon = _jsx(_Fragment, {});
|
|
6
|
-
export const I18nCopyNavigationItemsModal = ({ onConfirm, onCancel }) => {
|
|
7
|
-
const { formatMessage } = useIntl();
|
|
8
|
-
return (_jsx(ConfirmationDialog, { isVisible: true, header: formatMessage(getTrad('pages.view.actions.i18nCopyItems.confirmation.header')), labelConfirm: formatMessage(getTrad('pages.view.actions.i18nCopyItems.confirmation.confirm')), iconConfirm: refreshIcon, mainIcon: refreshIcon, onConfirm: onConfirm, onCancel: onCancel, children: formatMessage(getTrad('pages.view.actions.i18nCopyItems.confirmation.content')) }));
|
|
9
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex } from '@strapi/design-system';
|
|
3
|
-
export const NavigationContentHeader = ({ startActions, endActions }) => {
|
|
4
|
-
return (_jsxs(Flex, { justifyContent: "space-between", width: "100%", children: [_jsx(Flex, { alignItems: "space-between", children: startActions }), _jsx(Flex, { alignItems: "space-between", children: endActions })] }));
|
|
5
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { NavigationManager } from '../NavigationManager';
|
|
4
|
-
export const useNavigationManager = () => {
|
|
5
|
-
const [isOpened, setIsOpened] = useState(false);
|
|
6
|
-
const open = useCallback(() => setIsOpened(true), [setIsOpened]);
|
|
7
|
-
const close = useCallback(() => setIsOpened(false), [setIsOpened]);
|
|
8
|
-
const modal = useMemo(() => isOpened ? (_jsx(NavigationManager, { initialState: { view: 'INITIAL' }, isOpened: true, onClose: close })) : null, [isOpened, close]);
|
|
9
|
-
return useMemo(() => ({
|
|
10
|
-
navigationManagerModal: modal,
|
|
11
|
-
openNavigationManagerModal: open,
|
|
12
|
-
closeNavigationManagerModal: close,
|
|
13
|
-
}), [modal, open, close]);
|
|
14
|
-
};
|