@websolutespa/payload-plugin-bowl 2.0.1 → 3.0.1
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/CHANGELOG.md +23 -4
- package/README.md +1 -1
- package/dist/blocks/MenuItem.js +219 -0
- package/dist/blocks/MenuItem.js.map +1 -0
- package/dist/blocks/index.js +4 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/withComponentBlock.js +31 -0
- package/dist/blocks/withComponentBlock.js.map +1 -0
- package/dist/bowl.js +331 -0
- package/dist/bowl.js.map +1 -0
- package/dist/collections/Address.js +7 -0
- package/dist/collections/Address.js.map +1 -0
- package/dist/collections/Category.js +94 -0
- package/dist/collections/Category.js.map +1 -0
- package/dist/collections/ConsentPreference.js +34 -0
- package/dist/collections/ConsentPreference.js.map +1 -0
- package/dist/collections/Continent.js +24 -0
- package/dist/collections/Continent.js.map +1 -0
- package/dist/collections/Country.js +66 -0
- package/dist/collections/Country.js.map +1 -0
- package/dist/collections/CountryZone.js +24 -0
- package/dist/collections/CountryZone.js.map +1 -0
- package/dist/collections/EmailConfig.js +84 -0
- package/dist/collections/EmailConfig.js.map +1 -0
- package/dist/collections/EndUsers.js +24 -0
- package/dist/collections/EndUsers.js.map +1 -0
- package/dist/collections/Label.js +26 -0
- package/dist/collections/Label.js.map +1 -0
- package/dist/collections/Language.js +35 -0
- package/dist/collections/Language.js.map +1 -0
- package/dist/collections/LegalNotice.js +29 -0
- package/dist/collections/LegalNotice.js.map +1 -0
- package/dist/collections/Market.js +106 -0
- package/dist/collections/Market.js.map +1 -0
- package/dist/collections/Media.js +40 -0
- package/dist/collections/Media.js.map +1 -0
- package/dist/collections/Menu.js +49 -0
- package/dist/collections/Menu.js.map +1 -0
- package/dist/collections/Municipality.js +68 -0
- package/dist/collections/Municipality.js.map +1 -0
- package/dist/collections/Province.js +59 -0
- package/dist/collections/Province.js.map +1 -0
- package/dist/collections/Redirect.js +90 -0
- package/dist/collections/Redirect.js.map +1 -0
- package/dist/collections/Region.js +45 -0
- package/dist/collections/Region.js.map +1 -0
- package/dist/collections/SubContinent.js +36 -0
- package/dist/collections/SubContinent.js.map +1 -0
- package/dist/collections/Template.js +79 -0
- package/dist/collections/Template.js.map +1 -0
- package/dist/collections/Users.js +11 -0
- package/dist/collections/Users.js.map +1 -0
- package/dist/components/Category/CategoryMenu.js +47 -0
- package/dist/components/Category/CategoryMenu.js.map +1 -0
- package/dist/components/Category/CategoryTree.js +430 -0
- package/dist/components/Category/CategoryTree.js.map +1 -0
- package/dist/components/Category/CategoryTree.scss +330 -0
- package/dist/components/Category/CategoryTreeRoute.js +51 -0
- package/dist/components/Category/CategoryTreeRoute.js.map +1 -0
- package/dist/components/Category/category.service.js +32 -0
- package/dist/components/Category/category.service.js.map +1 -0
- package/dist/components/DataTree/DataTree.js +281 -0
- package/dist/components/DataTree/DataTree.js.map +1 -0
- package/dist/components/DataTree/DataTree.scss +363 -0
- package/dist/components/DataTree/DataTreeProvider.js +67 -0
- package/dist/components/DataTree/DataTreeProvider.js.map +1 -0
- package/dist/components/DataTree/EventEmitter.js +38 -0
- package/dist/components/DataTree/EventEmitter.js.map +1 -0
- package/dist/components/DataTree/useDataTree.js +52 -0
- package/dist/components/DataTree/useDataTree.js.map +1 -0
- package/dist/components/DecoratedList/DecoratedList.js +17 -0
- package/dist/components/DecoratedList/DecoratedList.js.map +1 -0
- package/dist/components/IconServer/IconServer.js +15 -0
- package/dist/components/IconServer/IconServer.js.map +1 -0
- package/dist/components/IconServer/IconServer.scss +14 -0
- package/dist/components/ImportExport/ImportExportList.js +91 -0
- package/dist/components/ImportExport/ImportExportList.js.map +1 -0
- package/dist/components/ImportExport/ImportExportList.scss +70 -0
- package/dist/components/ImportExport/ImportExportRedirect.js +142 -0
- package/dist/components/ImportExport/ImportExportRedirect.js.map +1 -0
- package/dist/components/ImportExport/ImportModal.js +458 -0
- package/dist/components/ImportExport/ImportModal.js.map +1 -0
- package/dist/components/ImportExport/ImportModal.scss +99 -0
- package/dist/components/ImportExport/types.js +3 -0
- package/dist/components/ImportExport/types.js.map +1 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.js +83 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.js.map +1 -0
- package/dist/components/LeaveWithoutSaving/LeaveWithoutSaving.scss +46 -0
- package/dist/components/LeaveWithoutSaving/usePreventLeave.js +119 -0
- package/dist/components/LeaveWithoutSaving/usePreventLeave.js.map +1 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionClient.js +15 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionClient.js.map +1 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionServer.js +13 -0
- package/dist/components/LocalizedDescription/LocalizedDescriptionServer.js.map +1 -0
- package/dist/components/LogoServer/LogoServer.js +20 -0
- package/dist/components/LogoServer/LogoServer.js.map +1 -0
- package/dist/components/LogoServer/LogoServer.scss +21 -0
- package/dist/core/access/access.js +181 -0
- package/dist/core/access/access.js.map +1 -0
- package/dist/core/access/access.test.js +454 -0
- package/dist/core/access/access.test.js.map +1 -0
- package/dist/core/access/index.js +3 -0
- package/dist/core/access/index.js.map +1 -0
- package/dist/core/api/action.service.js +441 -0
- package/dist/core/api/action.service.js.map +1 -0
- package/dist/core/api/action.service.test.js +218 -0
- package/dist/core/api/action.service.test.js.map +1 -0
- package/dist/core/api/cache.service.js +33 -0
- package/dist/core/api/cache.service.js.map +1 -0
- package/dist/core/api/cache.service.test.js +33 -0
- package/dist/core/api/cache.service.test.js.map +1 -0
- package/dist/core/api/category.service.js +53 -0
- package/dist/core/api/category.service.js.map +1 -0
- package/dist/core/api/collection.service.js +457 -0
- package/dist/core/api/collection.service.js.map +1 -0
- package/dist/core/api/collection.service.test.js +318 -0
- package/dist/core/api/collection.service.test.js.map +1 -0
- package/dist/core/api/email.service.js +84 -0
- package/dist/core/api/email.service.js.map +1 -0
- package/dist/core/api/global.service.js +18 -0
- package/dist/core/api/global.service.js.map +1 -0
- package/dist/core/api/health.service.js +12 -0
- package/dist/core/api/health.service.js.map +1 -0
- package/dist/core/api/index.js +16 -0
- package/dist/core/api/index.js.map +1 -0
- package/dist/core/api/locale.service.js +58 -0
- package/dist/core/api/locale.service.js.map +1 -0
- package/dist/core/api/locale.service.test.js +46 -0
- package/dist/core/api/locale.service.test.js.map +1 -0
- package/dist/core/api/menu.service.js +81 -0
- package/dist/core/api/menu.service.js.map +1 -0
- package/dist/core/api/menu.service.test.js +300 -0
- package/dist/core/api/menu.service.test.js.map +1 -0
- package/dist/core/api/page.service.js +171 -0
- package/dist/core/api/page.service.js.map +1 -0
- package/dist/core/api/page.service.test.js +68 -0
- package/dist/core/api/page.service.test.js.map +1 -0
- package/dist/core/api/pagination.service.js +29 -0
- package/dist/core/api/pagination.service.js.map +1 -0
- package/dist/core/api/pagination.service.test.js +175 -0
- package/dist/core/api/pagination.service.test.js.map +1 -0
- package/dist/core/api/redirect.service.js +106 -0
- package/dist/core/api/redirect.service.js.map +1 -0
- package/dist/core/api/redirect.service.test.js +106 -0
- package/dist/core/api/redirect.service.test.js.map +1 -0
- package/dist/core/api/route.service.js +451 -0
- package/dist/core/api/route.service.js.map +1 -0
- package/dist/core/api/route.service.test.js +214 -0
- package/dist/core/api/route.service.test.js.map +1 -0
- package/dist/core/api/static.service.js +249 -0
- package/dist/core/api/static.service.js.map +1 -0
- package/dist/core/api/static.service.test.js +240 -0
- package/dist/core/api/static.service.test.js.map +1 -0
- package/dist/core/api/store.service.js +336 -0
- package/dist/core/api/store.service.js.map +1 -0
- package/dist/core/api/store.service.test.js +105 -0
- package/dist/core/api/store.service.test.js.map +1 -0
- package/dist/core/api/types.js +21 -0
- package/dist/core/api/types.js.map +1 -0
- package/dist/core/api/utils.js +83 -0
- package/dist/core/api/utils.js.map +1 -0
- package/dist/core/api/where.service.js +231 -0
- package/dist/core/api/where.service.js.map +1 -0
- package/dist/core/collections/index.js +12 -0
- package/dist/core/collections/index.js.map +1 -0
- package/dist/core/collections/withAction.js +91 -0
- package/dist/core/collections/withAction.js.map +1 -0
- package/dist/core/collections/withAction.test.js +68 -0
- package/dist/core/collections/withAction.test.js.map +1 -0
- package/dist/core/collections/withAddress.js +122 -0
- package/dist/core/collections/withAddress.js.map +1 -0
- package/dist/core/collections/withBlock.js +17 -0
- package/dist/core/collections/withBlock.js.map +1 -0
- package/dist/core/collections/withBlock.test.js +68 -0
- package/dist/core/collections/withBlock.test.js.map +1 -0
- package/dist/core/collections/withCollection.js +61 -0
- package/dist/core/collections/withCollection.js.map +1 -0
- package/dist/core/collections/withCollection.test.js +64 -0
- package/dist/core/collections/withCollection.test.js.map +1 -0
- package/dist/core/collections/withEndUser.js +301 -0
- package/dist/core/collections/withEndUser.js.map +1 -0
- package/dist/core/collections/withGlobal.js +27 -0
- package/dist/core/collections/withGlobal.js.map +1 -0
- package/dist/core/collections/withGlobal.test.js +57 -0
- package/dist/core/collections/withGlobal.test.js.map +1 -0
- package/dist/core/collections/withMenu.js +19 -0
- package/dist/core/collections/withMenu.js.map +1 -0
- package/dist/core/collections/withMenu.test.js +63 -0
- package/dist/core/collections/withMenu.test.js.map +1 -0
- package/dist/core/collections/withPage.js +126 -0
- package/dist/core/collections/withPage.js.map +1 -0
- package/dist/core/collections/withPage.test.js +103 -0
- package/dist/core/collections/withPage.test.js.map +1 -0
- package/dist/core/collections/withStaticCollection.js +60 -0
- package/dist/core/collections/withStaticCollection.js.map +1 -0
- package/dist/core/collections/withStaticCollection.test.js +84 -0
- package/dist/core/collections/withStaticCollection.test.js.map +1 -0
- package/dist/core/collections/withUser.js +56 -0
- package/dist/core/collections/withUser.js.map +1 -0
- package/dist/core/decorators/category.js +28 -0
- package/dist/core/decorators/category.js.map +1 -0
- package/dist/core/decorators/components.js +9 -0
- package/dist/core/decorators/components.js.map +1 -0
- package/dist/core/decorators/href.js +25 -0
- package/dist/core/decorators/href.js.map +1 -0
- package/dist/core/decorators/index.js +11 -0
- package/dist/core/decorators/index.js.map +1 -0
- package/dist/core/decorators/localize.js +27 -0
- package/dist/core/decorators/localize.js.map +1 -0
- package/dist/core/decorators/menu.js +246 -0
- package/dist/core/decorators/menu.js.map +1 -0
- package/dist/core/decorators/nav.js +42 -0
- package/dist/core/decorators/nav.js.map +1 -0
- package/dist/core/decorators/rich-text.js +39 -0
- package/dist/core/decorators/rich-text.js.map +1 -0
- package/dist/core/decorators/schema.js +16 -0
- package/dist/core/decorators/schema.js.map +1 -0
- package/dist/core/decorators/upload.js +44 -0
- package/dist/core/decorators/upload.js.map +1 -0
- package/dist/core/encryption/encryption.js +66 -0
- package/dist/core/encryption/encryption.js.map +1 -0
- package/dist/core/encryption/index.js +3 -0
- package/dist/core/encryption/index.js.map +1 -0
- package/dist/core/fields/index.js +28 -0
- package/dist/core/fields/index.js.map +1 -0
- package/dist/core/fields/withAbstract.js +15 -0
- package/dist/core/fields/withAbstract.js.map +1 -0
- package/dist/core/fields/withAbstract.test.js +72 -0
- package/dist/core/fields/withAbstract.test.js.map +1 -0
- package/dist/core/fields/withAnchor.js +56 -0
- package/dist/core/fields/withAnchor.js.map +1 -0
- package/dist/core/fields/withCategory.js +21 -0
- package/dist/core/fields/withCategory.js.map +1 -0
- package/dist/core/fields/withCategory.test.js +63 -0
- package/dist/core/fields/withCategory.test.js.map +1 -0
- package/dist/core/fields/withCheckbox.js +19 -0
- package/dist/core/fields/withCheckbox.js.map +1 -0
- package/dist/core/fields/withCheckbox.test.js +59 -0
- package/dist/core/fields/withCheckbox.test.js.map +1 -0
- package/dist/core/fields/withComponents.js +17 -0
- package/dist/core/fields/withComponents.js.map +1 -0
- package/dist/core/fields/withComponents.test.js +62 -0
- package/dist/core/fields/withComponents.test.js.map +1 -0
- package/dist/core/fields/withDate.js +18 -0
- package/dist/core/fields/withDate.js.map +1 -0
- package/dist/core/fields/withDate.test.js +56 -0
- package/dist/core/fields/withDate.test.js.map +1 -0
- package/dist/core/fields/withDescription.js +15 -0
- package/dist/core/fields/withDescription.js.map +1 -0
- package/dist/core/fields/withDescription.test.js +72 -0
- package/dist/core/fields/withDescription.test.js.map +1 -0
- package/dist/core/fields/withId.js +19 -0
- package/dist/core/fields/withId.js.map +1 -0
- package/dist/core/fields/withId.test.js +61 -0
- package/dist/core/fields/withId.test.js.map +1 -0
- package/dist/core/fields/withIsActive.js +15 -0
- package/dist/core/fields/withIsActive.js.map +1 -0
- package/dist/core/fields/withIsActive.test.js +59 -0
- package/dist/core/fields/withIsActive.test.js.map +1 -0
- package/dist/core/fields/withIsDefault.js +15 -0
- package/dist/core/fields/withIsDefault.js.map +1 -0
- package/dist/core/fields/withIsDefault.test.js +59 -0
- package/dist/core/fields/withIsDefault.test.js.map +1 -0
- package/dist/core/fields/withLink.js +116 -0
- package/dist/core/fields/withLink.js.map +1 -0
- package/dist/core/fields/withLink.test.js +144 -0
- package/dist/core/fields/withLink.test.js.map +1 -0
- package/dist/core/fields/withMarkets.js +21 -0
- package/dist/core/fields/withMarkets.js.map +1 -0
- package/dist/core/fields/withMarkets.test.js +65 -0
- package/dist/core/fields/withMarkets.test.js.map +1 -0
- package/dist/core/fields/withMedia.js +20 -0
- package/dist/core/fields/withMedia.js.map +1 -0
- package/dist/core/fields/withMedia.test.js +41 -0
- package/dist/core/fields/withMedia.test.js.map +1 -0
- package/dist/core/fields/withMedias.js +25 -0
- package/dist/core/fields/withMedias.js.map +1 -0
- package/dist/core/fields/withMedias.test.js +46 -0
- package/dist/core/fields/withMedias.test.js.map +1 -0
- package/dist/core/fields/withName.js +17 -0
- package/dist/core/fields/withName.js.map +1 -0
- package/dist/core/fields/withName.test.js +59 -0
- package/dist/core/fields/withName.test.js.map +1 -0
- package/dist/core/fields/withNav.js +28 -0
- package/dist/core/fields/withNav.js.map +1 -0
- package/dist/core/fields/withNavs.js +53 -0
- package/dist/core/fields/withNavs.js.map +1 -0
- package/dist/core/fields/withOrder.js +80 -0
- package/dist/core/fields/withOrder.js.map +1 -0
- package/dist/core/fields/withOrder.test.js +56 -0
- package/dist/core/fields/withOrder.test.js.map +1 -0
- package/dist/core/fields/withRelated.js +18 -0
- package/dist/core/fields/withRelated.js.map +1 -0
- package/dist/core/fields/withRelated.test.js +62 -0
- package/dist/core/fields/withRelated.test.js.map +1 -0
- package/dist/core/fields/withRichText.js +68 -0
- package/dist/core/fields/withRichText.js.map +1 -0
- package/dist/core/fields/withRichText.test.js +72 -0
- package/dist/core/fields/withRichText.test.js.map +1 -0
- package/dist/core/fields/withRoles.js +27 -0
- package/dist/core/fields/withRoles.js.map +1 -0
- package/dist/core/fields/withRoles.test.js +49 -0
- package/dist/core/fields/withRoles.test.js.map +1 -0
- package/dist/core/fields/withSelect.js +23 -0
- package/dist/core/fields/withSelect.js.map +1 -0
- package/dist/core/fields/withSelect.test.js +59 -0
- package/dist/core/fields/withSelect.test.js.map +1 -0
- package/dist/core/fields/withSeoWeight.js +19 -0
- package/dist/core/fields/withSeoWeight.js.map +1 -0
- package/dist/core/fields/withSlug.js +33 -0
- package/dist/core/fields/withSlug.js.map +1 -0
- package/dist/core/fields/withSlug.test.js +71 -0
- package/dist/core/fields/withSlug.test.js.map +1 -0
- package/dist/core/fields/withTemplate.js +49 -0
- package/dist/core/fields/withTemplate.js.map +1 -0
- package/dist/core/fields/withTemplate.test.js +93 -0
- package/dist/core/fields/withTemplate.test.js.map +1 -0
- package/dist/core/fields/withTenants.js +21 -0
- package/dist/core/fields/withTenants.js.map +1 -0
- package/dist/core/fields/withTenants.test.js +42 -0
- package/dist/core/fields/withTenants.test.js.map +1 -0
- package/dist/core/fields/withText.js +18 -0
- package/dist/core/fields/withText.js.map +1 -0
- package/dist/core/fields/withText.test.js +56 -0
- package/dist/core/fields/withText.test.js.map +1 -0
- package/dist/core/fields/withTitle.js +17 -0
- package/dist/core/fields/withTitle.js.map +1 -0
- package/dist/core/fields/withTitle.test.js +58 -0
- package/dist/core/fields/withTitle.test.js.map +1 -0
- package/dist/core/index.js +11 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger/index.js +3 -0
- package/dist/core/logger/index.js.map +1 -0
- package/dist/core/logger/logger.js +9 -0
- package/dist/core/logger/logger.js.map +1 -0
- package/dist/core/translations/index.js +3 -0
- package/dist/core/translations/index.js.map +1 -0
- package/dist/core/translations/translations.js +137 -0
- package/dist/core/translations/translations.js.map +1 -0
- package/dist/core/translations/translations.test.js +72 -0
- package/dist/core/translations/translations.test.js.map +1 -0
- package/dist/core/utils/findByIDHandler.js +28 -0
- package/dist/core/utils/findByIDHandler.js.map +1 -0
- package/dist/core/utils/findHandler.js +31 -0
- package/dist/core/utils/findHandler.js.map +1 -0
- package/dist/core/utils/getPreviewURL.js +45 -0
- package/dist/core/utils/getPreviewURL.js.map +1 -0
- package/dist/core/utils/getRequestCollection.js +49 -0
- package/dist/core/utils/getRequestCollection.js.map +1 -0
- package/dist/core/utils/index.js +7 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/core/utils/mergeCollections.js +18 -0
- package/dist/core/utils/mergeCollections.js.map +1 -0
- package/dist/core/utils/mergeFields.js +20 -0
- package/dist/core/utils/mergeFields.js.map +1 -0
- package/dist/core/utils/mergeGlobals.js +17 -0
- package/dist/core/utils/mergeGlobals.js.map +1 -0
- package/dist/core/utils/richText.js +29 -0
- package/dist/core/utils/richText.js.map +1 -0
- package/dist/core/utils/sortByGroup.js +36 -0
- package/dist/core/utils/sortByGroup.js.map +1 -0
- package/dist/debug.js +25 -0
- package/dist/debug.js.map +1 -0
- package/dist/declaration.d.js +3 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/exports/client.d.ts +36 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +8 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +18 -0
- package/dist/exports/rsc.d.ts.map +1 -0
- package/dist/exports/rsc.js +5 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/fields/color-picker/ColorCell.js +19 -0
- package/dist/fields/color-picker/ColorCell.js.map +1 -0
- package/dist/fields/color-picker/ColorField.js +131 -0
- package/dist/fields/color-picker/ColorField.js.map +1 -0
- package/dist/fields/color-picker/index.js +26 -0
- package/dist/fields/color-picker/index.js.map +1 -0
- package/dist/fields/color-picker/styles.scss +113 -0
- package/dist/fields/color-picker/utils.js +6 -0
- package/dist/fields/color-picker/utils.js.map +1 -0
- package/dist/fields/index.js +3 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/globals/App.js +97 -0
- package/dist/globals/App.js.map +1 -0
- package/dist/globals/Locale.js +82 -0
- package/dist/globals/Locale.js.map +1 -0
- package/dist/globals/LocaleRowLabel.js +16 -0
- package/dist/globals/LocaleRowLabel.js.map +1 -0
- package/dist/index.d.ts +891 -844
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -9263
- package/dist/index.js.map +1 -0
- package/dist/mapper.js +199 -0
- package/dist/mapper.js.map +1 -0
- package/dist/options.js +76 -0
- package/dist/options.js.map +1 -0
- package/dist/test/blocks/blocks.js +13 -0
- package/dist/test/blocks/blocks.js.map +1 -0
- package/dist/test/collections/ActionCollection.js +12 -0
- package/dist/test/collections/ActionCollection.js.map +1 -0
- package/dist/test/collections/AdminCollection.js +18 -0
- package/dist/test/collections/AdminCollection.js.map +1 -0
- package/dist/test/collections/BlockCollection.js +16 -0
- package/dist/test/collections/BlockCollection.js.map +1 -0
- package/dist/test/collections/Collection.js +12 -0
- package/dist/test/collections/Collection.js.map +1 -0
- package/dist/test/collections/FieldCollection.js +84 -0
- package/dist/test/collections/FieldCollection.js.map +1 -0
- package/dist/test/collections/GlobalCollection.js +12 -0
- package/dist/test/collections/GlobalCollection.js.map +1 -0
- package/dist/test/collections/LinkCollection.js +12 -0
- package/dist/test/collections/LinkCollection.js.map +1 -0
- package/dist/test/collections/MenuCollection.js +12 -0
- package/dist/test/collections/MenuCollection.js.map +1 -0
- package/dist/test/collections/PageCollection.js +12 -0
- package/dist/test/collections/PageCollection.js.map +1 -0
- package/dist/test/collections/RoleCollection.js +19 -0
- package/dist/test/collections/RoleCollection.js.map +1 -0
- package/dist/test/collections/RoleFieldCollection.js +40 -0
- package/dist/test/collections/RoleFieldCollection.js.map +1 -0
- package/dist/test/collections/StaticCollection.js +56 -0
- package/dist/test/collections/StaticCollection.js.map +1 -0
- package/dist/test/collections/StorePageCollection.js +12 -0
- package/dist/test/collections/StorePageCollection.js.map +1 -0
- package/dist/test/collections/TenantCollection.js +22 -0
- package/dist/test/collections/TenantCollection.js.map +1 -0
- package/dist/test/collections/TranslationCollection.js +16 -0
- package/dist/test/collections/TranslationCollection.js.map +1 -0
- package/dist/test/collections/TypeACollection.js +18 -0
- package/dist/test/collections/TypeACollection.js.map +1 -0
- package/dist/test/collections/TypeBCollection.js +18 -0
- package/dist/test/collections/TypeBCollection.js.map +1 -0
- package/dist/test/collections/actions/NewsletterAction.js +29 -0
- package/dist/test/collections/actions/NewsletterAction.js.map +1 -0
- package/dist/test/collections/actions/RegisterAction.js +44 -0
- package/dist/test/collections/actions/RegisterAction.js.map +1 -0
- package/dist/test/collections/users/EndUsers.js +40 -0
- package/dist/test/collections/users/EndUsers.js.map +1 -0
- package/dist/test/collections/users/Users.js +20 -0
- package/dist/test/collections/users/Users.js.map +1 -0
- package/dist/test/index.js +32 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/payload.config.js +106 -0
- package/dist/test/payload.config.js.map +1 -0
- package/dist/test/utils.js +52 -0
- package/dist/test/utils.js.map +1 -0
- package/dist/translations.js +467 -0
- package/dist/translations.js.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/package.json +119 -37
- package/scss/styles.scss +0 -1
- package/dist/index.css +0 -796
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
# @websolutespa/payload-plugin-bowl
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Modified: whereService clause value
|
|
7
|
+
- 56c6d12: Modified: whereService clause value parser
|
|
8
|
+
- ad80c2c: - Add page revalidation on page change
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## 3.0.0
|
|
10
11
|
|
|
11
12
|
### Major Changes
|
|
12
13
|
|
|
13
|
-
- Release: Bom
|
|
14
|
+
- Release: Bom 3.0
|
|
15
|
+
|
|
16
|
+
## 2.0.1-next.4
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- - Fix redirect response in route post handler
|
|
21
|
+
|
|
22
|
+
## 2.0.1-next.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 2508714: - Fix: preserve custom endpoints in withPage collections
|
|
27
|
+
|
|
28
|
+
## 2.0.1-next.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updating: dependencies and build step
|
|
14
33
|
|
|
15
34
|
## 1.10.3
|
|
16
35
|
|
package/README.md
CHANGED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
export const MenuItem = (pages, customBlocks = [], depth = 0, maxDepth = 10)=>{
|
|
2
|
+
const menuItem = {
|
|
3
|
+
type: 'withBlock',
|
|
4
|
+
slug: `Level ${depth}`,
|
|
5
|
+
fields: [
|
|
6
|
+
// type
|
|
7
|
+
{
|
|
8
|
+
name: 'type',
|
|
9
|
+
type: 'select',
|
|
10
|
+
defaultValue: 'category',
|
|
11
|
+
/*
|
|
12
|
+
admin: {
|
|
13
|
+
layout: 'horizontal',
|
|
14
|
+
},
|
|
15
|
+
*/ options: [
|
|
16
|
+
{
|
|
17
|
+
label: 'Page',
|
|
18
|
+
value: 'page'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: 'Category',
|
|
22
|
+
value: 'category'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: 'Link',
|
|
26
|
+
value: 'link'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Group',
|
|
30
|
+
value: 'group'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
// tabs
|
|
35
|
+
{
|
|
36
|
+
type: 'tabs',
|
|
37
|
+
tabs: [
|
|
38
|
+
// tab data
|
|
39
|
+
{
|
|
40
|
+
label: 'Data',
|
|
41
|
+
fields: [
|
|
42
|
+
// category fields
|
|
43
|
+
{
|
|
44
|
+
type: 'row',
|
|
45
|
+
fields: [
|
|
46
|
+
// category
|
|
47
|
+
{
|
|
48
|
+
type: 'withCategory',
|
|
49
|
+
required: true,
|
|
50
|
+
admin: {
|
|
51
|
+
width: '50%',
|
|
52
|
+
condition: (_, siblingData)=>siblingData?.type === 'category'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
// maxDepth
|
|
56
|
+
{
|
|
57
|
+
name: 'maxDepth',
|
|
58
|
+
type: 'number',
|
|
59
|
+
admin: {
|
|
60
|
+
width: '50%',
|
|
61
|
+
condition: (_, siblingData)=>siblingData?.type === 'category'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
// strategy
|
|
65
|
+
{
|
|
66
|
+
name: 'strategy',
|
|
67
|
+
type: 'select',
|
|
68
|
+
defaultValue: 'default',
|
|
69
|
+
admin: {
|
|
70
|
+
condition: (_, siblingData)=>siblingData?.type === 'category'
|
|
71
|
+
},
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
label: 'Default',
|
|
75
|
+
value: 'default'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: 'Exclude hidden categories',
|
|
79
|
+
value: 'exclude-hidden'
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
admin: {
|
|
85
|
+
condition: (_, siblingData)=>siblingData?.type === 'category'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
// page fields
|
|
89
|
+
{
|
|
90
|
+
type: 'row',
|
|
91
|
+
fields: [
|
|
92
|
+
// page
|
|
93
|
+
{
|
|
94
|
+
name: 'page',
|
|
95
|
+
type: 'relationship',
|
|
96
|
+
relationTo: pages,
|
|
97
|
+
hasMany: false,
|
|
98
|
+
required: true,
|
|
99
|
+
maxDepth: 2,
|
|
100
|
+
admin: {
|
|
101
|
+
width: '50%',
|
|
102
|
+
condition: (_, siblingData)=>siblingData?.type === 'page'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
admin: {
|
|
107
|
+
condition: (_, siblingData)=>siblingData?.type === 'page'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
// title field
|
|
111
|
+
{
|
|
112
|
+
type: 'withTitle',
|
|
113
|
+
required: true,
|
|
114
|
+
admin: {
|
|
115
|
+
condition: (_, siblingData)=>siblingData?.type === 'group' || siblingData?.type === 'link'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
// link fields
|
|
119
|
+
{
|
|
120
|
+
type: 'row',
|
|
121
|
+
fields: [
|
|
122
|
+
// href
|
|
123
|
+
{
|
|
124
|
+
name: 'href',
|
|
125
|
+
type: 'text',
|
|
126
|
+
required: true,
|
|
127
|
+
localized: true,
|
|
128
|
+
admin: {
|
|
129
|
+
width: '50%',
|
|
130
|
+
condition: (_, siblingData)=>siblingData?.type === 'link'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
// target
|
|
134
|
+
{
|
|
135
|
+
name: 'target',
|
|
136
|
+
type: 'text',
|
|
137
|
+
required: true,
|
|
138
|
+
defaultValue: '_blank',
|
|
139
|
+
admin: {
|
|
140
|
+
width: '50%',
|
|
141
|
+
condition: (_, siblingData)=>siblingData?.type === 'link'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
admin: {
|
|
146
|
+
condition: (_, siblingData)=>siblingData?.type === 'link'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
// markets
|
|
152
|
+
{
|
|
153
|
+
label: 'Markets',
|
|
154
|
+
// description: 'Configure the list of available markets for this item. Leave empty for all markets.',
|
|
155
|
+
fields: [
|
|
156
|
+
// markets
|
|
157
|
+
{
|
|
158
|
+
type: 'withMarkets'
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
// details
|
|
163
|
+
{
|
|
164
|
+
label: 'Details',
|
|
165
|
+
fields: [
|
|
166
|
+
// title
|
|
167
|
+
{
|
|
168
|
+
type: 'withText',
|
|
169
|
+
name: 'customTitle',
|
|
170
|
+
localized: true,
|
|
171
|
+
admin: {
|
|
172
|
+
condition: (_, siblingData)=>siblingData?.type === 'category' || siblingData?.type === 'page'
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
// abstract
|
|
176
|
+
{
|
|
177
|
+
type: 'withAbstract'
|
|
178
|
+
},
|
|
179
|
+
// media
|
|
180
|
+
{
|
|
181
|
+
type: 'withMedia'
|
|
182
|
+
},
|
|
183
|
+
// custom class
|
|
184
|
+
{
|
|
185
|
+
type: 'withText',
|
|
186
|
+
name: 'customClass'
|
|
187
|
+
},
|
|
188
|
+
// extra
|
|
189
|
+
{
|
|
190
|
+
type: 'withText',
|
|
191
|
+
name: 'extra',
|
|
192
|
+
localized: true
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
};
|
|
200
|
+
if (depth < maxDepth) {
|
|
201
|
+
depth++;
|
|
202
|
+
menuItem.fields.push({
|
|
203
|
+
name: 'items',
|
|
204
|
+
label: 'Items',
|
|
205
|
+
type: 'blocks',
|
|
206
|
+
blocks: [
|
|
207
|
+
MenuItem(pages, customBlocks, depth, maxDepth),
|
|
208
|
+
...customBlocks
|
|
209
|
+
],
|
|
210
|
+
admin: {
|
|
211
|
+
condition: (_, siblingData)=>siblingData?.type !== 'category',
|
|
212
|
+
initCollapsed: true
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return menuItem;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/blocks/MenuItem.ts"],"sourcesContent":["import { CollectionSlug } from 'payload';\r\nimport { BowlBlock } from '../types';\r\n\r\nexport const MenuItem = (pages: CollectionSlug[], customBlocks: BowlBlock[] = [], depth = 0, maxDepth = 10): BowlBlock => {\r\n const menuItem: BowlBlock = {\r\n type: 'withBlock',\r\n slug: `Level ${depth}`,\r\n fields: [\r\n // type\r\n {\r\n name: 'type',\r\n type: 'select',\r\n defaultValue: 'category',\r\n /*\r\n admin: {\r\n layout: 'horizontal',\r\n },\r\n */\r\n options: [\r\n {\r\n label: 'Page',\r\n value: 'page',\r\n },\r\n {\r\n label: 'Category',\r\n value: 'category',\r\n },\r\n {\r\n label: 'Link',\r\n value: 'link',\r\n },\r\n {\r\n label: 'Group',\r\n value: 'group',\r\n },\r\n ],\r\n },\r\n // tabs\r\n {\r\n type: 'tabs',\r\n tabs: [\r\n // tab data\r\n {\r\n label: 'Data',\r\n fields: [\r\n // category fields\r\n {\r\n type: 'row',\r\n fields: [\r\n // category\r\n {\r\n type: 'withCategory',\r\n required: true,\r\n admin: {\r\n width: '50%',\r\n condition: (_: any, siblingData: any) => siblingData?.type === 'category',\r\n },\r\n },\r\n // maxDepth\r\n {\r\n name: 'maxDepth',\r\n type: 'number',\r\n admin: {\r\n width: '50%',\r\n condition: (_, siblingData) => siblingData?.type === 'category',\r\n },\r\n },\r\n // strategy\r\n {\r\n name: 'strategy',\r\n type: 'select',\r\n defaultValue: 'default',\r\n admin: {\r\n condition: (_, siblingData) => siblingData?.type === 'category',\r\n },\r\n options: [\r\n {\r\n label: 'Default',\r\n value: 'default',\r\n },\r\n {\r\n label: 'Exclude hidden categories',\r\n value: 'exclude-hidden',\r\n },\r\n ],\r\n },\r\n\r\n ],\r\n admin: {\r\n condition: (_, siblingData) => siblingData?.type === 'category',\r\n },\r\n },\r\n // page fields\r\n {\r\n type: 'row',\r\n fields: [\r\n // page\r\n {\r\n name: 'page',\r\n type: 'relationship',\r\n relationTo: pages,\r\n hasMany: false,\r\n required: true,\r\n maxDepth: 2,\r\n admin: {\r\n width: '50%',\r\n condition: (_, siblingData) => siblingData?.type === 'page',\r\n },\r\n },\r\n ],\r\n admin: {\r\n condition: (_, siblingData) => siblingData?.type === 'page',\r\n },\r\n },\r\n // title field\r\n {\r\n type: 'withTitle',\r\n required: true,\r\n admin: {\r\n condition: (_: any, siblingData: any) => siblingData?.type === 'group' || siblingData?.type === 'link',\r\n },\r\n },\r\n // link fields\r\n {\r\n type: 'row',\r\n fields: [\r\n // href\r\n {\r\n name: 'href',\r\n type: 'text',\r\n required: true,\r\n localized: true,\r\n admin: {\r\n width: '50%',\r\n condition: (_, siblingData) => siblingData?.type === 'link',\r\n },\r\n },\r\n // target\r\n {\r\n name: 'target',\r\n type: 'text',\r\n required: true,\r\n defaultValue: '_blank',\r\n admin: {\r\n width: '50%',\r\n condition: (_, siblingData) => siblingData?.type === 'link',\r\n },\r\n },\r\n ],\r\n admin: {\r\n condition: (_, siblingData) => siblingData?.type === 'link',\r\n },\r\n },\r\n ],\r\n },\r\n // markets\r\n {\r\n label: 'Markets',\r\n // description: 'Configure the list of available markets for this item. Leave empty for all markets.',\r\n fields: [\r\n // markets\r\n {\r\n type: 'withMarkets',\r\n },\r\n ],\r\n },\r\n // details\r\n {\r\n label: 'Details',\r\n fields: [\r\n // title\r\n {\r\n type: 'withText',\r\n name: 'customTitle',\r\n localized: true,\r\n admin: {\r\n condition: (_: any, siblingData: any) => siblingData?.type === 'category' || siblingData?.type === 'page',\r\n },\r\n },\r\n // abstract\r\n {\r\n type: 'withAbstract',\r\n },\r\n // media\r\n {\r\n type: 'withMedia',\r\n },\r\n // custom class\r\n {\r\n type: 'withText',\r\n name: 'customClass',\r\n },\r\n // extra\r\n {\r\n type: 'withText',\r\n name: 'extra',\r\n localized: true,\r\n },\r\n ],\r\n },\r\n ],\r\n },\r\n ],\r\n };\r\n if (depth < maxDepth) {\r\n depth++;\r\n menuItem.fields.push({\r\n name: 'items',\r\n label: 'Items',\r\n type: 'blocks',\r\n blocks: [MenuItem(pages, customBlocks, depth, maxDepth), ...customBlocks],\r\n admin: {\r\n condition: (_, siblingData) => siblingData?.type !== 'category',\r\n initCollapsed: true,\r\n },\r\n });\r\n }\r\n return menuItem;\r\n};\r\n"],"names":["MenuItem","pages","customBlocks","depth","maxDepth","menuItem","type","slug","fields","name","defaultValue","options","label","value","tabs","required","admin","width","condition","_","siblingData","relationTo","hasMany","localized","push","blocks","initCollapsed"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/blocks/index.ts"],"sourcesContent":["export * from './MenuItem';\r\nexport * from './withComponentBlock';\r\n\r\n"],"names":[],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,uBAAuB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function withComponentBlock({ slug, fields = [], optionsFields = [] }) {
|
|
2
|
+
return {
|
|
3
|
+
type: 'withBlock',
|
|
4
|
+
slug,
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
type: 'tabs',
|
|
8
|
+
tabs: [
|
|
9
|
+
{
|
|
10
|
+
label: 'Content',
|
|
11
|
+
fields: fields
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: 'Options',
|
|
15
|
+
fields: [
|
|
16
|
+
{
|
|
17
|
+
type: 'withAnchor'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'withSeoWeight'
|
|
21
|
+
},
|
|
22
|
+
...optionsFields
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=withComponentBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/blocks/withComponentBlock.ts"],"sourcesContent":["import { BowlBlock, BowlField } from '../types';\r\n\r\nexport function withComponentBlock({ slug, fields = [], optionsFields = [] }: { slug: string, fields?: BowlField[], optionsFields?: BowlField[] }): BowlBlock {\r\n return {\r\n type: 'withBlock',\r\n slug,\r\n fields: [\r\n {\r\n type: 'tabs',\r\n tabs: [\r\n {\r\n label: 'Content',\r\n fields: fields,\r\n },\r\n {\r\n label: 'Options',\r\n fields: [\r\n { type: 'withAnchor' },\r\n { type: 'withSeoWeight' },\r\n ...optionsFields,\r\n ],\r\n },\r\n ],\r\n },\r\n ],\r\n };\r\n}\r\n"],"names":["withComponentBlock","slug","fields","optionsFields","type","tabs","label"],"mappings":"AAEA,OAAO,SAASA,mBAAmB,EAAEC,IAAI,EAAEC,SAAS,EAAE,EAAEC,gBAAgB,EAAE,EAAuE;IAC/I,OAAO;QACLC,MAAM;QACNH;QACAC,QAAQ;YACN;gBACEE,MAAM;gBACNC,MAAM;oBACJ;wBACEC,OAAO;wBACPJ,QAAQA;oBACV;oBACA;wBACEI,OAAO;wBACPJ,QAAQ;4BACN;gCAAEE,MAAM;4BAAa;4BACrB;gCAAEA,MAAM;4BAAgB;+BACrBD;yBACJ;oBACH;iBACD;YACH;SACD;IACH;AACF"}
|
package/dist/bowl.js
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { isObject } from '@websolutespa/bom-core';
|
|
2
|
+
import { deepMerge, withCollectionHook } from '@websolutespa/payload-utils';
|
|
3
|
+
import { Address } from './collections/Address';
|
|
4
|
+
import { Category } from './collections/Category';
|
|
5
|
+
import { ConsentPreference } from './collections/ConsentPreference';
|
|
6
|
+
import { Continent } from './collections/Continent';
|
|
7
|
+
import { Country } from './collections/Country';
|
|
8
|
+
import { CountryZone } from './collections/CountryZone';
|
|
9
|
+
import { EmailConfig } from './collections/EmailConfig';
|
|
10
|
+
import { EndUsers } from './collections/EndUsers';
|
|
11
|
+
import { Label } from './collections/Label';
|
|
12
|
+
import { Language } from './collections/Language';
|
|
13
|
+
import { LegalNotice } from './collections/LegalNotice';
|
|
14
|
+
import { Market } from './collections/Market';
|
|
15
|
+
import { Media } from './collections/Media';
|
|
16
|
+
import { Menu } from './collections/Menu';
|
|
17
|
+
import { Municipality } from './collections/Municipality';
|
|
18
|
+
import { Province } from './collections/Province';
|
|
19
|
+
import { Redirect } from './collections/Redirect';
|
|
20
|
+
import { Region } from './collections/Region';
|
|
21
|
+
import { SubContinent } from './collections/SubContinent';
|
|
22
|
+
import { Template } from './collections/Template';
|
|
23
|
+
import { Users } from './collections/Users';
|
|
24
|
+
import { localeGet, optinGet, optoutGet, routeChangesPost, routeGet, routePost, storeGet } from './core/api';
|
|
25
|
+
import { healthGet } from './core/api/health.service';
|
|
26
|
+
import { configureStaticJobs } from './core/api/static.service';
|
|
27
|
+
import { logMissingTranslations } from './core/translations';
|
|
28
|
+
import { getLivePreviewURL, sortByGroup } from './core/utils';
|
|
29
|
+
import { debugJson } from './debug';
|
|
30
|
+
import { App } from './globals/App';
|
|
31
|
+
import { Locale } from './globals/Locale';
|
|
32
|
+
import { toCollection, toGlobal } from './mapper';
|
|
33
|
+
import { options } from './options';
|
|
34
|
+
const DEBUG = false;
|
|
35
|
+
const LOG_MISSING_TRANSLATIONS = false;
|
|
36
|
+
export const bowl = (sourceOptions = {})=>async (sourceConfig)=>{
|
|
37
|
+
const defaultSlug = {
|
|
38
|
+
...options.slug
|
|
39
|
+
};
|
|
40
|
+
if (sourceOptions.plugins) {
|
|
41
|
+
for (const plugin of sourceOptions.plugins){
|
|
42
|
+
sourceConfig = await plugin(sourceConfig, sourceOptions);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (sourceOptions.defaultMarket) {
|
|
46
|
+
options.defaultMarket = sourceOptions.defaultMarket;
|
|
47
|
+
}
|
|
48
|
+
if (sourceOptions.group) {
|
|
49
|
+
options.group = Object.assign(options.group, sourceOptions.group);
|
|
50
|
+
}
|
|
51
|
+
if (sourceOptions.menu) {
|
|
52
|
+
options.menu = Object.assign(options.menu, sourceOptions.menu);
|
|
53
|
+
}
|
|
54
|
+
if (sourceOptions.slug) {
|
|
55
|
+
options.slug = Object.assign(options.slug, sourceOptions.slug);
|
|
56
|
+
}
|
|
57
|
+
if (sourceOptions.roles) {
|
|
58
|
+
options.roles = Object.assign(options.roles, sourceOptions.roles);
|
|
59
|
+
const rolesList = Object.values(options.roles);
|
|
60
|
+
rolesList.sort();
|
|
61
|
+
options.rolesList = rolesList;
|
|
62
|
+
}
|
|
63
|
+
if (sourceOptions.rolesUser) {
|
|
64
|
+
options.rolesUser = Object.assign(options.rolesUser, sourceOptions.rolesUser);
|
|
65
|
+
}
|
|
66
|
+
if (sourceOptions.rolesEndUser) {
|
|
67
|
+
options.rolesEndUser = Object.assign(options.rolesEndUser, sourceOptions.rolesEndUser);
|
|
68
|
+
}
|
|
69
|
+
if (sourceConfig.localization && sourceConfig.localization.locales) {
|
|
70
|
+
options.locales = sourceConfig.localization.locales;
|
|
71
|
+
}
|
|
72
|
+
if (sourceConfig.localization && sourceConfig.localization.defaultLocale) {
|
|
73
|
+
options.defaultLocale = sourceConfig.localization.defaultLocale;
|
|
74
|
+
}
|
|
75
|
+
if (sourceConfig.i18n && sourceConfig.i18n.translations) {
|
|
76
|
+
options.translations = deepMerge(options.translations, sourceConfig.i18n.translations);
|
|
77
|
+
}
|
|
78
|
+
const sourceCollections = (sourceConfig.collections || []).map((x)=>typeof x === 'function' ? x(options) : x);
|
|
79
|
+
const sourceGlobals = (sourceConfig.globals || []).map((x)=>typeof x === 'function' ? x(options) : x);
|
|
80
|
+
// pages
|
|
81
|
+
const pages = [
|
|
82
|
+
...sourceCollections.filter((x)=>x.type === 'withPage').map((x)=>x.slug)
|
|
83
|
+
];
|
|
84
|
+
options.pages = pages;
|
|
85
|
+
// actions
|
|
86
|
+
const actions = [
|
|
87
|
+
...sourceCollections.filter((x)=>x.type === 'withAction').map((x)=>x.slug),
|
|
88
|
+
...sourceGlobals.filter((x)=>x.type === 'withAction').map((x)=>x.slug)
|
|
89
|
+
];
|
|
90
|
+
options.actions = actions;
|
|
91
|
+
// users
|
|
92
|
+
const users = [
|
|
93
|
+
...sourceCollections.filter((x)=>x.auth !== undefined).map((x)=>x.slug)
|
|
94
|
+
];
|
|
95
|
+
options.users = users;
|
|
96
|
+
/*
|
|
97
|
+
const filteredCollections = sourceCollections.filter(x => !internalSlugs.includes(x.slug)).map(x => deepMerge<BowlCollection, BowlCollection>({}, x));
|
|
98
|
+
const filteredGlobals = sourceGlobals.filter(x => !internalSlugs.includes(x.slug)).map(x => deepMerge<BowlGlobal, BowlGlobal>({}, x));
|
|
99
|
+
*/ // removing duplicated collections
|
|
100
|
+
// sourceOptions collections come first then plugin collections
|
|
101
|
+
// this way source collections may override plugin collections
|
|
102
|
+
const filteredCollections = sourceCollections.reduce((p, c)=>{
|
|
103
|
+
if (!p.find((x)=>x.slug === c.slug)) {
|
|
104
|
+
p.push(c);
|
|
105
|
+
}
|
|
106
|
+
return p;
|
|
107
|
+
}, []);
|
|
108
|
+
// removing duplicated globals
|
|
109
|
+
// sourceOptions globals come first then plugin globals
|
|
110
|
+
// this way source globals may override plugin globals
|
|
111
|
+
const filteredGlobals = sourceGlobals.reduce((p, c)=>{
|
|
112
|
+
if (!p.find((x)=>x.slug === c.slug)) {
|
|
113
|
+
p.push(c);
|
|
114
|
+
}
|
|
115
|
+
return p;
|
|
116
|
+
}, []);
|
|
117
|
+
/*
|
|
118
|
+
const filteredCollections = sourceCollections.filter(x => !internalSlugs.filter(y => y !== options.slug.endUsers && y !== options.slug.users).includes(x.slug));
|
|
119
|
+
const filteredGlobals = sourceGlobals.filter(x => !internalSlugs.includes(x.slug));
|
|
120
|
+
*/ const bowlCollections = [
|
|
121
|
+
// Content
|
|
122
|
+
Address,
|
|
123
|
+
Media,
|
|
124
|
+
// Navigation
|
|
125
|
+
Category,
|
|
126
|
+
EmailConfig,
|
|
127
|
+
Menu,
|
|
128
|
+
Redirect,
|
|
129
|
+
// GDPR
|
|
130
|
+
LegalNotice,
|
|
131
|
+
ConsentPreference,
|
|
132
|
+
// Users
|
|
133
|
+
EndUsers,
|
|
134
|
+
Users,
|
|
135
|
+
// Configuration
|
|
136
|
+
Template,
|
|
137
|
+
Label,
|
|
138
|
+
Market,
|
|
139
|
+
// I18N
|
|
140
|
+
Language,
|
|
141
|
+
Continent,
|
|
142
|
+
SubContinent,
|
|
143
|
+
Country,
|
|
144
|
+
CountryZone,
|
|
145
|
+
Region,
|
|
146
|
+
Province,
|
|
147
|
+
Municipality
|
|
148
|
+
].map((x)=>x(options));
|
|
149
|
+
const bowlGlobals = [
|
|
150
|
+
// Admin
|
|
151
|
+
App,
|
|
152
|
+
Locale
|
|
153
|
+
].map((x)=>x(options));
|
|
154
|
+
const missingCollections = [];
|
|
155
|
+
Object.entries(defaultSlug).forEach(([k, v])=>{
|
|
156
|
+
const defaultSlug = v;
|
|
157
|
+
const newSlug = options.slug[k];
|
|
158
|
+
if (!filteredCollections.find((x)=>x.slug === newSlug)) {
|
|
159
|
+
const collection = bowlCollections.find((x)=>x.slug === defaultSlug);
|
|
160
|
+
if (collection) {
|
|
161
|
+
// console.info(`[Bowl] added missing collection ${k}`);
|
|
162
|
+
missingCollections.push(collection);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const unmappedCollections = [
|
|
167
|
+
...filteredCollections,
|
|
168
|
+
...missingCollections
|
|
169
|
+
];
|
|
170
|
+
const missingGlobals = [];
|
|
171
|
+
Object.entries(defaultSlug).forEach(([k, v])=>{
|
|
172
|
+
const defaultSlug = v;
|
|
173
|
+
const newSlug = options.slug[k];
|
|
174
|
+
if (!filteredGlobals.find((x)=>x.slug === newSlug)) {
|
|
175
|
+
const global = bowlGlobals.find((x)=>x.slug === defaultSlug);
|
|
176
|
+
if (global) {
|
|
177
|
+
// console.info(`[Bowl] added missing global ${k}`);
|
|
178
|
+
missingGlobals.push(global);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const unmappedGlobals = [
|
|
183
|
+
...filteredGlobals,
|
|
184
|
+
...missingGlobals
|
|
185
|
+
];
|
|
186
|
+
options.bowlCollections = unmappedCollections;
|
|
187
|
+
options.bowlGlobals = unmappedGlobals;
|
|
188
|
+
const adminViews = {};
|
|
189
|
+
unmappedCollections.forEach((x)=>{
|
|
190
|
+
if (x.views) {
|
|
191
|
+
Object.assign(adminViews, x.views);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
unmappedGlobals.forEach((x)=>{
|
|
195
|
+
if (x.views) {
|
|
196
|
+
Object.assign(adminViews, x.views);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
const collections = unmappedCollections.map((x)=>toCollection(x));
|
|
200
|
+
const globals = unmappedGlobals.map((x)=>toGlobal(x));
|
|
201
|
+
sortByGroup(collections);
|
|
202
|
+
sortByGroup(globals);
|
|
203
|
+
options.collections = collections.map((x)=>x.slug);
|
|
204
|
+
// decorate fields
|
|
205
|
+
// !!! todo centralize decorators & mixer context
|
|
206
|
+
// !!! afterRead on relationship fields return id only as value
|
|
207
|
+
collections.forEach((collection)=>{
|
|
208
|
+
/*
|
|
209
|
+
withCollectionHook(collection, 'beforeOperation', async ({ context, req }) => {
|
|
210
|
+
if (context?.market || req.query?.market) {
|
|
211
|
+
console.log('beforeOperation', collection.slug, context?.market, req.query?.market);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
*/ if (collection.upload) {
|
|
215
|
+
withCollectionHook(collection, 'afterRead', async ({ doc, context, req })=>{
|
|
216
|
+
if (isObject(doc) && (context?.market || req.query?.market)) {
|
|
217
|
+
const { mimeType = '' } = doc;
|
|
218
|
+
const mimeTypes = mimeType.split('/');
|
|
219
|
+
const type = mimeTypes[0] === 'application' ? mimeTypes[1] : mimeTypes[0];
|
|
220
|
+
return {
|
|
221
|
+
...doc,
|
|
222
|
+
type
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
return doc;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/*
|
|
229
|
+
eachFieldSync({
|
|
230
|
+
fields: collection.fields,
|
|
231
|
+
callback: (props) => {
|
|
232
|
+
switch (props.field.type) {
|
|
233
|
+
case 'upload':
|
|
234
|
+
if (!(props.field.hooks?.afterRead?.includes(afterReadUpload))) {
|
|
235
|
+
withFieldHook(props.field, 'afterRead', afterReadUpload);
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
return props;
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
*/ });
|
|
243
|
+
const sourceEndpoints = sourceConfig.endpoints || [];
|
|
244
|
+
let targetConfig = {
|
|
245
|
+
...sourceConfig,
|
|
246
|
+
admin: {
|
|
247
|
+
livePreview: {
|
|
248
|
+
url: (args)=>{
|
|
249
|
+
return getLivePreviewURL(args);
|
|
250
|
+
},
|
|
251
|
+
collections: pages,
|
|
252
|
+
breakpoints: [
|
|
253
|
+
{
|
|
254
|
+
label: 'Mobile',
|
|
255
|
+
name: 'mobile',
|
|
256
|
+
width: 375,
|
|
257
|
+
height: 667
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
label: 'Tablet',
|
|
261
|
+
name: 'tablet',
|
|
262
|
+
width: 768,
|
|
263
|
+
height: 1024
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: 'Desktop',
|
|
267
|
+
name: 'desktop',
|
|
268
|
+
width: 1440,
|
|
269
|
+
height: 900
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
...sourceConfig.admin?.livePreview
|
|
273
|
+
},
|
|
274
|
+
...sourceConfig.admin,
|
|
275
|
+
components: {
|
|
276
|
+
graphics: {
|
|
277
|
+
Logo: '@websolutespa/payload-plugin-bowl/rsc#LogoServer',
|
|
278
|
+
Icon: '@websolutespa/payload-plugin-bowl/rsc#IconServer'
|
|
279
|
+
},
|
|
280
|
+
...sourceConfig.admin?.components,
|
|
281
|
+
views: {
|
|
282
|
+
...sourceConfig.admin?.components?.views,
|
|
283
|
+
...adminViews
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
i18n: {
|
|
288
|
+
...sourceConfig.i18n,
|
|
289
|
+
translations: options.translations
|
|
290
|
+
},
|
|
291
|
+
collections,
|
|
292
|
+
globals,
|
|
293
|
+
endpoints: [
|
|
294
|
+
healthGet,
|
|
295
|
+
localeGet,
|
|
296
|
+
optinGet,
|
|
297
|
+
optoutGet,
|
|
298
|
+
routeChangesPost,
|
|
299
|
+
routeGet,
|
|
300
|
+
routePost,
|
|
301
|
+
storeGet,
|
|
302
|
+
...sourceEndpoints
|
|
303
|
+
],
|
|
304
|
+
custom: {
|
|
305
|
+
bowl: options
|
|
306
|
+
},
|
|
307
|
+
onInit: async (payload)=>{
|
|
308
|
+
if (typeof sourceConfig.onInit === 'function') {
|
|
309
|
+
await sourceConfig.onInit(payload);
|
|
310
|
+
}
|
|
311
|
+
console.log('@websolutespa/payload-plugin-bowl.onInit');
|
|
312
|
+
/*
|
|
313
|
+
const views = payload.config.admin.components.views;
|
|
314
|
+
payload.config.collections.forEach(collection => {
|
|
315
|
+
console.log(collection.slug, (collection.endpoints || []).map(x => x.path));
|
|
316
|
+
});
|
|
317
|
+
*/ }
|
|
318
|
+
};
|
|
319
|
+
targetConfig = configureStaticJobs(targetConfig);
|
|
320
|
+
// console.log('added collections', targetConfig.collections.map(x => x.slug));
|
|
321
|
+
if (DEBUG) {
|
|
322
|
+
debugJson('source-config.json', sourceConfig);
|
|
323
|
+
debugJson('target-config.json', targetConfig);
|
|
324
|
+
}
|
|
325
|
+
if (LOG_MISSING_TRANSLATIONS) {
|
|
326
|
+
logMissingTranslations();
|
|
327
|
+
}
|
|
328
|
+
return targetConfig;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
//# sourceMappingURL=bowl.js.map
|