@pro-laico/create-atomic-payload 0.1.4
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/bin/cli.js +159 -0
- package/package.json +29 -0
- package/template/.env.example +35 -0
- package/template/.gitattributes +2 -0
- package/template/.prettierrc.json +6 -0
- package/template/.vscode/extensions.json +3 -0
- package/template/.vscode/launch.json +24 -0
- package/template/.vscode/settings.json +86 -0
- package/template/.yarnrc +1 -0
- package/template/LICENSE.md +22 -0
- package/template/README.md +128 -0
- package/template/eslint.config.mjs +32 -0
- package/template/next-env.d.ts +6 -0
- package/template/next.config.ts +36 -0
- package/template/package.json +75 -0
- package/template/public/adminFavicon.svg +1 -0
- package/template/public/ogImage.webp +0 -0
- package/template/src/access/anyone.ts +3 -0
- package/template/src/access/authenticated.ts +7 -0
- package/template/src/access/authenticatedOrPublished.ts +6 -0
- package/template/src/app/(frontend)/[...slug]/page.tsx +48 -0
- package/template/src/app/(frontend)/layout.tsx +49 -0
- package/template/src/app/(frontend)/next/exit-preview/route.ts +7 -0
- package/template/src/app/(frontend)/next/preview/route.ts +45 -0
- package/template/src/app/(frontend)/next/seed/route.ts +31 -0
- package/template/src/app/(frontend)/not-found.tsx +93 -0
- package/template/src/app/(frontend)/page.tsx +5 -0
- package/template/src/app/(frontend)/sitemap.ts +14 -0
- package/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
- package/template/src/app/(payload)/admin/[[...segments]]/page.tsx +24 -0
- package/template/src/app/(payload)/admin/importMap.js +85 -0
- package/template/src/app/(payload)/api/[...slug]/route.ts +19 -0
- package/template/src/app/(payload)/custom.scss +29 -0
- package/template/src/app/(payload)/layout.tsx +31 -0
- package/template/src/blocks/actions/blocks.ts +27 -0
- package/template/src/blocks/actions/cookieConsent/set/block.ts +17 -0
- package/template/src/blocks/actions/cookieConsent/set/filter.ts +3 -0
- package/template/src/blocks/actions/cookieConsent/set/options.ts +35 -0
- package/template/src/blocks/actions/cookieConsent/toDA/block.ts +14 -0
- package/template/src/blocks/actions/cookieConsent/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/cookieConsent/toDA/options.ts +19 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/block.ts +15 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/filter.ts +4 -0
- package/template/src/blocks/actions/dynamicStore/boolean/set/options.ts +18 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/block.ts +10 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/dynamicStore/boolean/toDA/options.ts +12 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/block.ts +41 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/filter.ts +4 -0
- package/template/src/blocks/actions/dynamicStore/text/cycle/options.ts +23 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/block.ts +10 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/filter.ts +3 -0
- package/template/src/blocks/actions/dynamicStore/text/toDA/options.ts +12 -0
- package/template/src/blocks/actions/filters.ts +27 -0
- package/template/src/blocks/actions/form/errorToDA/block.ts +18 -0
- package/template/src/blocks/actions/form/errorToDA/filter.ts +3 -0
- package/template/src/blocks/actions/form/errorToDA/options.ts +15 -0
- package/template/src/blocks/actions/form/reset/block.ts +18 -0
- package/template/src/blocks/actions/form/reset/filter.ts +3 -0
- package/template/src/blocks/actions/form/reset/options.ts +30 -0
- package/template/src/blocks/actions/form/statusToDA/block.ts +12 -0
- package/template/src/blocks/actions/form/statusToDA/filter.ts +3 -0
- package/template/src/blocks/actions/form/statusToDA/options.ts +15 -0
- package/template/src/blocks/actions/form/submit/block.ts +18 -0
- package/template/src/blocks/actions/form/submit/filter.ts +3 -0
- package/template/src/blocks/actions/form/submit/options.ts +35 -0
- package/template/src/blocks/actions/portal/set/block.ts +25 -0
- package/template/src/blocks/actions/portal/set/filter.ts +3 -0
- package/template/src/blocks/actions/portal/set/options.ts +43 -0
- package/template/src/blocks/actions/processor.ts +263 -0
- package/template/src/blocks/actions/theme/set/block.ts +10 -0
- package/template/src/blocks/actions/theme/set/filter.ts +3 -0
- package/template/src/blocks/actions/theme/set/options.ts +9 -0
- package/template/src/blocks/actions/zap.ts +4 -0
- package/template/src/blocks/children/atomic/block.ts +123 -0
- package/template/src/blocks/children/atomic/controlBar.ts +43 -0
- package/template/src/blocks/children/atomic/variants/button/typeField.ts +16 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/component.client.tsx +21 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/component.tsx +13 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/controlBar.ts +73 -0
- package/template/src/blocks/children/atomic/variants/button/variants/link/settings.ts +26 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/controlBar.ts +35 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/component.tsx +36 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/settings.ts +24 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/component.tsx +41 -0
- package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/settings.ts +111 -0
- package/template/src/blocks/children/atomic/variants/button/variants/regular/component.client.tsx +19 -0
- package/template/src/blocks/children/atomic/variants/button/variants/regular/component.tsx +11 -0
- package/template/src/blocks/children/atomic/variants/form/component.tsx +18 -0
- package/template/src/blocks/children/atomic/variants/form/controlBar.ts +22 -0
- package/template/src/blocks/children/atomic/variants/form/settings.ts +20 -0
- package/template/src/blocks/children/atomic/variants/input/autoCompleteOptions.ts +51 -0
- package/template/src/blocks/children/atomic/variants/input/controlBar.ts +13 -0
- package/template/src/blocks/children/atomic/variants/input/settings.ts +35 -0
- package/template/src/blocks/children/atomic/variants/input/typeField.ts +23 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/checkBox/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/number/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/component.tsx +6 -0
- package/template/src/blocks/children/atomic/variants/input/variants/radio/settings.ts +9 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/component.client.tsx +12 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/component.tsx +7 -0
- package/template/src/blocks/children/atomic/variants/input/variants/text/settings.ts +12 -0
- package/template/src/blocks/children/atomic/variants/tag/component.client.tsx +17 -0
- package/template/src/blocks/children/atomic/variants/tag/component.tsx +13 -0
- package/template/src/blocks/children/atomic/variants/tag/controlBar.ts +6 -0
- package/template/src/blocks/children/atomic/variants/tag/settings.ts +9 -0
- package/template/src/blocks/children/blocks.ts +13 -0
- package/template/src/blocks/children/icon/block.ts +41 -0
- package/template/src/blocks/children/icon/component.tsx +17 -0
- package/template/src/blocks/children/image/block.ts +80 -0
- package/template/src/blocks/children/image/component.tsx +21 -0
- package/template/src/blocks/children/richText/block.ts +50 -0
- package/template/src/blocks/children/richText/component/converters/index.tsx +10 -0
- package/template/src/blocks/children/richText/component/converters/internalLink.tsx +8 -0
- package/template/src/blocks/children/richText/component/index.tsx +10 -0
- package/template/src/blocks/children/richText/component.tsx +7 -0
- package/template/src/blocks/children/richText/defaultLexical.ts +65 -0
- package/template/src/blocks/children/simpleText/block.ts +41 -0
- package/template/src/blocks/children/simpleText/component.client.tsx +18 -0
- package/template/src/blocks/children/simpleText/component.tsx +11 -0
- package/template/src/blocks/children/svg/block.ts +39 -0
- package/template/src/blocks/children/svg/component.tsx +6 -0
- package/template/src/blocks/children/video/block.ts +70 -0
- package/template/src/blocks/children/video/component.tsx +11 -0
- package/template/src/blocks/children/zap.ts +54 -0
- package/template/src/blocks/submitForm/form/rateLimiting/blocks.ts +5 -0
- package/template/src/blocks/submitForm/form/rateLimiting/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/block.ts +23 -0
- package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/serverFunction.ts +46 -0
- package/template/src/blocks/submitForm/form/sanitation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/block.ts +19 -0
- package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/serverFunction.ts +22 -0
- package/template/src/blocks/submitForm/form/sanitation/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/validation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/form/validation/functions.ts +1 -0
- package/template/src/blocks/submitForm/form/validation/isUnique/block.ts +19 -0
- package/template/src/blocks/submitForm/form/validation/isUnique/serverFunction.ts +40 -0
- package/template/src/blocks/submitForm/form/zap.ts +8 -0
- package/template/src/blocks/submitForm/formProcessor.ts +222 -0
- package/template/src/blocks/submitForm/input/sanitation/blocks.ts +5 -0
- package/template/src/blocks/submitForm/input/sanitation/functions.ts +1 -0
- package/template/src/blocks/submitForm/input/sanitation/trimText/block.ts +24 -0
- package/template/src/blocks/submitForm/input/sanitation/trimText/serverFunction.ts +63 -0
- package/template/src/blocks/submitForm/input/useOn.ts +8 -0
- package/template/src/blocks/submitForm/input/validation/blocks.ts +6 -0
- package/template/src/blocks/submitForm/input/validation/contains/block.ts +12 -0
- package/template/src/blocks/submitForm/input/validation/contains/serverFunction.ts +23 -0
- package/template/src/blocks/submitForm/input/validation/doesNotContain/block.ts +12 -0
- package/template/src/blocks/submitForm/input/validation/doesNotContain/serverFunction.ts +23 -0
- package/template/src/blocks/submitForm/input/validation/functions.ts +2 -0
- package/template/src/blocks/submitForm/input/zap.ts +6 -0
- package/template/src/blocks/submitForm/serverFunction.ts +42 -0
- package/template/src/collections/designSets/collection.ts +44 -0
- package/template/src/collections/designSets/defaults.ts +20 -0
- package/template/src/collections/designSets/tabs/animation.ts +71 -0
- package/template/src/collections/designSets/tabs/colors.ts +31 -0
- package/template/src/collections/designSets/tabs/fonts.ts +53 -0
- package/template/src/collections/designSets/tabs/miscellaneous.ts +22 -0
- package/template/src/collections/designSets/tabs/prose.ts +151 -0
- package/template/src/collections/designSets/tabs/settings.ts +52 -0
- package/template/src/collections/designSets/tabs/sizes.ts +30 -0
- package/template/src/collections/designSets/tabs/storage.ts +51 -0
- package/template/src/collections/designSets/tabs/variables.ts +28 -0
- package/template/src/collections/favicons.ts +11 -0
- package/template/src/collections/fonts/collection.ts +20 -0
- package/template/src/collections/fonts/script.ts +199 -0
- package/template/src/collections/footers/collection.ts +48 -0
- package/template/src/collections/footers/component.tsx +13 -0
- package/template/src/collections/headers/collection.ts +47 -0
- package/template/src/collections/headers/component.tsx +13 -0
- package/template/src/collections/iconSets/collection.ts +80 -0
- package/template/src/collections/iconSets/defaults.ts +81 -0
- package/template/src/collections/icons.ts +20 -0
- package/template/src/collections/images.ts +29 -0
- package/template/src/collections/index.ts +17 -0
- package/template/src/collections/muxVideos.ts +13 -0
- package/template/src/collections/pages/collection.ts +88 -0
- package/template/src/collections/pages/tabs/SEO.ts +70 -0
- package/template/src/collections/pages/tabs/settings.ts +17 -0
- package/template/src/collections/posthogProperty.ts +48 -0
- package/template/src/collections/shortcutSets/collection.ts +30 -0
- package/template/src/collections/shortcutSets/defaults.ts +1 -0
- package/template/src/collections/shortcutSets/protectedNames.ts +135 -0
- package/template/src/collections/shortcutSets/tabs/settings.ts +13 -0
- package/template/src/collections/shortcutSets/tabs/shortcuts.ts +70 -0
- package/template/src/collections/users.ts +11 -0
- package/template/src/collections/zap.ts +59 -0
- package/template/src/components/child/SSRProps.ts +381 -0
- package/template/src/components/child/renderChildren.tsx +148 -0
- package/template/src/components/livePreviewListener.tsx +10 -0
- package/template/src/components/providers/formProvider.tsx +11 -0
- package/template/src/components/providers/tracking/gtm.tsx +11 -0
- package/template/src/components/providers/tracking/index.tsx +46 -0
- package/template/src/components/providers/tracking/postHog.tsx +41 -0
- package/template/src/components/providers/tracking/vercel.tsx +10 -0
- package/template/src/components/toast/index.module.css +142 -0
- package/template/src/components/toast/index.tsx +55 -0
- package/template/src/endpoints/seed/backendForm.ts +48 -0
- package/template/src/endpoints/seed/designSet.ts +476 -0
- package/template/src/endpoints/seed/footer.ts +389 -0
- package/template/src/endpoints/seed/header.ts +3511 -0
- package/template/src/endpoints/seed/iconSet.ts +19 -0
- package/template/src/endpoints/seed/icons/assets/check.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/close.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/cookie.svg +7 -0
- package/template/src/endpoints/seed/icons/assets/github.svg +1 -0
- package/template/src/endpoints/seed/icons/assets/logo.svg +11 -0
- package/template/src/endpoints/seed/icons/assets/menu.svg +4 -0
- package/template/src/endpoints/seed/icons/assets/theme.svg +4 -0
- package/template/src/endpoints/seed/icons/check.ts +14 -0
- package/template/src/endpoints/seed/icons/close.ts +14 -0
- package/template/src/endpoints/seed/icons/cookie.ts +14 -0
- package/template/src/endpoints/seed/icons/github.ts +14 -0
- package/template/src/endpoints/seed/icons/index.ts +7 -0
- package/template/src/endpoints/seed/icons/logo.ts +14 -0
- package/template/src/endpoints/seed/icons/menu.ts +14 -0
- package/template/src/endpoints/seed/icons/theme.ts +14 -0
- package/template/src/endpoints/seed/index.ts +100 -0
- package/template/src/endpoints/seed/pages/home.ts +858 -0
- package/template/src/endpoints/seed/pages/index.ts +4 -0
- package/template/src/endpoints/seed/pages/notFoundPage.ts +287 -0
- package/template/src/endpoints/seed/pages/prose.ts +1436 -0
- package/template/src/endpoints/seed/pages/testing.ts +2181 -0
- package/template/src/endpoints/seed/shortcutSet.ts +187 -0
- package/template/src/endpoints/seed/siteMetaData.ts +10 -0
- package/template/src/fields/actions/changeKey.ts +12 -0
- package/template/src/fields/actions/index.ts +6 -0
- package/template/src/fields/actions/initialValueCheckbox.ts +14 -0
- package/template/src/fields/actions/keyText.ts +10 -0
- package/template/src/fields/actions/persisted.ts +14 -0
- package/template/src/fields/actions/setData.ts +20 -0
- package/template/src/fields/actions/strict/index.ts +3 -0
- package/template/src/fields/actions/strict/keySelect.ts +28 -0
- package/template/src/fields/actions/strict/listenSelect.ts +28 -0
- package/template/src/fields/actions/strict/performSelect.ts +30 -0
- package/template/src/fields/actions/strict/registry/cookieConsent.ts +14 -0
- package/template/src/fields/actions/strict/registry/index.ts +6 -0
- package/template/src/fields/actions/strict/registry/theme.ts +9 -0
- package/template/src/fields/active.ts +16 -0
- package/template/src/fields/apf/index.ts +69 -0
- package/template/src/fields/apf/storage.ts +38 -0
- package/template/src/fields/blocks/actions.ts +30 -0
- package/template/src/fields/blocks/backdropChildren.ts +11 -0
- package/template/src/fields/blocks/children.ts +15 -0
- package/template/src/fields/blocks/submitForm/form.ts +24 -0
- package/template/src/fields/blocks/submitForm/input.ts +25 -0
- package/template/src/fields/className.ts +26 -0
- package/template/src/fields/coloredEnd.ts +5 -0
- package/template/src/fields/defaultOpen.ts +14 -0
- package/template/src/fields/designSets/value.ts +80 -0
- package/template/src/fields/devMode.ts +11 -0
- package/template/src/fields/favicon.ts +18 -0
- package/template/src/fields/for.ts +11 -0
- package/template/src/fields/keepMounted.ts +11 -0
- package/template/src/fields/modal.ts +16 -0
- package/template/src/fields/slug.ts +35 -0
- package/template/src/fields/staticDataAttributes.ts +29 -0
- package/template/src/fields/tabs/block/children/actions.ts +49 -0
- package/template/src/fields/tabs/block/children/backdrop.ts +17 -0
- package/template/src/fields/tabs/block/children/settings.ts +45 -0
- package/template/src/fields/tabs/block/children/submitForm/form.ts +23 -0
- package/template/src/fields/tabs/block/children/submitForm/input.ts +14 -0
- package/template/src/fields/tabs/block/children/tracking.ts +25 -0
- package/template/src/fields/tabs/collection/storage.ts +55 -0
- package/template/src/fields/tagType.ts +32 -0
- package/template/src/fields/testPath.ts +3 -0
- package/template/src/fields/uniqueTitle.ts +8 -0
- package/template/src/fields/validationMessage.ts +13 -0
- package/template/src/globals/index.ts +8 -0
- package/template/src/globals/settings.ts +36 -0
- package/template/src/globals/siteMetaData.ts +29 -0
- package/template/src/globals/storage.ts +15 -0
- package/template/src/globals/tracking/global.ts +25 -0
- package/template/src/globals/tracking/tabs/gtm.ts +18 -0
- package/template/src/globals/tracking/tabs/postHog.ts +35 -0
- package/template/src/hooks/collection/atomicHook/atomicHook.ts +223 -0
- package/template/src/hooks/collection/atomicHook/processors/cssProcessor.ts +60 -0
- package/template/src/hooks/collection/atomicHook/processors/processDesignSet/generatePreflights.ts +36 -0
- package/template/src/hooks/collection/atomicHook/processors/processDesignSet/index.ts +176 -0
- package/template/src/hooks/collection/atomicHook/processors/unsetActive.ts +24 -0
- package/template/src/hooks/collection/formatSVG.ts +157 -0
- package/template/src/hooks/collection/revalidate.ts +53 -0
- package/template/src/hooks/collection/sanitizeCollection.ts +5 -0
- package/template/src/hooks/field/apf.ts +59 -0
- package/template/src/hooks/field/formatSlug.ts +23 -0
- package/template/src/hooks/field/href.ts +6 -0
- package/template/src/hooks/field/publishedAt.ts +5 -0
- package/template/src/hooks/frontEnd/atomicStore/create.ts +69 -0
- package/template/src/hooks/frontEnd/atomicStore/index.tsx +20 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/base.ts +7 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/consent.ts +76 -0
- package/template/src/hooks/frontEnd/atomicStore/slices/dynamic.ts +51 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/function.ts +14 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/function.ts +34 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/zap.ts +17 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/function.ts +22 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/function.ts +20 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/function.ts +24 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/function.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/attributer/zap.ts +15 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/index.ts +2 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/function.ts +30 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/zap.ts +12 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/function.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/function.ts +7 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/zap.ts +9 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/function.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/zap.ts +11 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/function.ts +33 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/zap.ts +14 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/function.ts +11 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/zap.ts +10 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/function.ts +32 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/zap.ts +9 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/runner/zap.ts +16 -0
- package/template/src/hooks/frontEnd/useActions/dispatch/zap.ts +2 -0
- package/template/src/hooks/frontEnd/useActions/index.ts +6 -0
- package/template/src/hooks/frontEnd/useActions/useActionContext.ts +21 -0
- package/template/src/hooks/frontEnd/useActions/useButtonActions.ts +17 -0
- package/template/src/hooks/frontEnd/useActions/useDaToText.ts +34 -0
- package/template/src/hooks/frontEnd/useActions/useForm.ts +114 -0
- package/template/src/hooks/frontEnd/useActions/usePortal.ts +33 -0
- package/template/src/hooks/frontEnd/useActions/useToDa.ts +12 -0
- package/template/src/hooks/global/revalidate.ts +26 -0
- package/template/src/payload.config.ts +78 -0
- package/template/src/plugins/blurDataUrls.ts +8 -0
- package/template/src/plugins/formBuilder.ts +40 -0
- package/template/src/plugins/index.ts +17 -0
- package/template/src/plugins/muxVideo.ts +13 -0
- package/template/src/plugins/nestedDocs.ts +9 -0
- package/template/src/plugins/vercelBlobStorage.ts +8 -0
- package/template/src/ts/JSONSchema.ts +93 -0
- package/template/src/ts/declarations.ts +24 -0
- package/template/src/ts/types/actions.ts +175 -0
- package/template/src/ts/types/apf.ts +108 -0
- package/template/src/ts/types/cache.ts +166 -0
- package/template/src/ts/types/css.ts +14 -0
- package/template/src/ts/types/forms.ts +214 -0
- package/template/src/ts/types/frontEnd.ts +115 -0
- package/template/src/ts/types/index.ts +49 -0
- package/template/src/ts/types/payload-types.ts +3684 -0
- package/template/src/ts/zap/ap.ts +82 -0
- package/template/src/ts/zap/index.ts +4 -0
- package/template/src/ui/apf/controls.tsx +88 -0
- package/template/src/ui/apf/field.tsx +81 -0
- package/template/src/ui/apf/index.scss +59 -0
- package/template/src/ui/apf/label.tsx +23 -0
- package/template/src/ui/assets/Icon.tsx +21 -0
- package/template/src/ui/assets/Logo.tsx +21 -0
- package/template/src/ui/assets/atomicIcon.tsx +27 -0
- package/template/src/ui/assets/warningIcon.ts +6 -0
- package/template/src/ui/blocks/actionBlock.tsx +44 -0
- package/template/src/ui/blocks/inputBlock.tsx +24 -0
- package/template/src/ui/decorative/coloredEnd.tsx +16 -0
- package/template/src/ui/decorative/index.scss +46 -0
- package/template/src/ui/fields/iconSelect/index.tsx +19 -0
- package/template/src/ui/fields/slug/index.scss +12 -0
- package/template/src/ui/fields/slug/index.tsx +72 -0
- package/template/src/ui/index.ts +32 -0
- package/template/src/ui/root/beforeDashboard/index.scss +22 -0
- package/template/src/ui/root/beforeDashboard/index.tsx +39 -0
- package/template/src/ui/root/beforeDashboard/seedButton/index.scss +12 -0
- package/template/src/ui/root/beforeDashboard/seedButton/index.tsx +84 -0
- package/template/src/ui/root/siteTriggers/index.scss +22 -0
- package/template/src/ui/root/siteTriggers/index.tsx +94 -0
- package/template/src/ui/root/siteTriggers/triggerVercelDeploy.ts +37 -0
- package/template/src/ui/rowLabels/animation.tsx +27 -0
- package/template/src/ui/rowLabels/atomic/index.scss +62 -0
- package/template/src/ui/rowLabels/atomic/index.tsx +96 -0
- package/template/src/ui/rowLabels/color.tsx +33 -0
- package/template/src/ui/rowLabels/designToken.tsx +30 -0
- package/template/src/ui/rowLabels/icon.tsx +32 -0
- package/template/src/ui/rowLabels/shortcut/index.scss +21 -0
- package/template/src/ui/rowLabels/shortcut/index.tsx +30 -0
- package/template/src/ui/rowLabels/simpleText.tsx +41 -0
- package/template/src/utilities/deepMerge.ts +30 -0
- package/template/src/utilities/extractSVG.ts +9 -0
- package/template/src/utilities/format/toKebabCase.ts +79 -0
- package/template/src/utilities/format/toTitleCase.ts +47 -0
- package/template/src/utilities/formatDurationWithTokens.ts +56 -0
- package/template/src/utilities/generateMetaData.ts +45 -0
- package/template/src/utilities/generatePreviewPath.ts +43 -0
- package/template/src/utilities/get/cache/getAtomicActions.ts +48 -0
- package/template/src/utilities/get/cache/getAtomicClasses.ts +20 -0
- package/template/src/utilities/get/cache/getDesignSet.ts +15 -0
- package/template/src/utilities/get/cache/getFooter.ts +17 -0
- package/template/src/utilities/get/cache/getFormSubmissions.ts +17 -0
- package/template/src/utilities/get/cache/getForms.ts +43 -0
- package/template/src/utilities/get/cache/getHeader.ts +17 -0
- package/template/src/utilities/get/cache/getIcon.ts +51 -0
- package/template/src/utilities/get/cache/getImage.ts +20 -0
- package/template/src/utilities/get/cache/getPage.ts +35 -0
- package/template/src/utilities/get/cache/getPages.ts +24 -0
- package/template/src/utilities/get/cache/getShortcutSet.ts +17 -0
- package/template/src/utilities/get/cache/getSiteCSS.ts +17 -0
- package/template/src/utilities/get/cache/getSiteMetadata.ts +14 -0
- package/template/src/utilities/get/cache/getSitemap.ts +50 -0
- package/template/src/utilities/get/cache/getTracking.ts +14 -0
- package/template/src/utilities/get/cache/index.ts +129 -0
- package/template/src/utilities/get/cache/react.ts +5 -0
- package/template/src/utilities/get/getImageURL.ts +20 -0
- package/template/src/utilities/get/getMeUser.ts +22 -0
- package/template/src/utilities/get/getURL.ts +20 -0
- package/template/src/utilities/log/cache.ts +8 -0
- package/template/src/utilities/log/manual.ts +11 -0
- package/template/src/utilities/log/revalidation.ts +6 -0
- package/template/src/utilities/mergeTags.ts +7 -0
- package/template/src/utilities/propertyApplicatorUtility.ts +20 -0
- package/template/src/utilities/revalidateTag.ts +55 -0
- package/template/src/utilities/runAPF.ts +10 -0
- package/template/src/utilities/sanitizeData.ts +24 -0
- package/template/src/utilities/seedNestedRelationship.ts +5 -0
- package/template/tailwind.config.js +9 -0
- package/template/tsconfig.json +49 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { APField } from './apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
type PresetFields = 'apf' | 'type' | 'name'
|
|
6
|
+
|
|
7
|
+
export const ClassNameField: APFieldWrapper<'textarea', PresetFields, { namePrefix?: string }> = (args) => {
|
|
8
|
+
let namePrefix = ''
|
|
9
|
+
let rest: Omit<APArgs<'textarea'>, PresetFields> | undefined
|
|
10
|
+
|
|
11
|
+
if (args) {
|
|
12
|
+
const { namePrefix: namePrefixArg, ...restArg } = args
|
|
13
|
+
namePrefix = namePrefixArg || ''
|
|
14
|
+
rest = restArg
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const baseField: APArgs<'textarea'> = {
|
|
18
|
+
type: 'textarea',
|
|
19
|
+
apf: ['classes'],
|
|
20
|
+
name: `${namePrefix}ClassName`,
|
|
21
|
+
docLink: 'https://atomicpayload.com/fields/classname',
|
|
22
|
+
admin: { description: 'Add atomic style classes or shortcuts here.' },
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return APField(deepMerge(baseField, rest))
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ColoredEndPath } from '@/ui'
|
|
2
|
+
import type { UIField } from 'payload'
|
|
3
|
+
|
|
4
|
+
/**Place at the end of a block to add a colored strip that adjusts color based on the block type and values.*/
|
|
5
|
+
export const ColoredEnd: UIField = { name: 'coloredEnd', type: 'ui', admin: { components: { Field: { path: ColoredEndPath } } } }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APField } from './apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
export const DefaultOpenField: APFieldWrapper<'checkbox', 'name' | 'apf' | 'type'> = (args) => {
|
|
6
|
+
const baseField: APArgs<'checkbox'> = {
|
|
7
|
+
name: 'defaultOpen',
|
|
8
|
+
type: 'checkbox',
|
|
9
|
+
apf: ['actions'],
|
|
10
|
+
admin: { description: 'If checked, the portal will be open by default.' },
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return APField(deepMerge(baseField, args))
|
|
14
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from '@/ts/zap'
|
|
2
|
+
import { APField } from '@/fields/apf'
|
|
3
|
+
import type { TextField } from 'payload'
|
|
4
|
+
import type { ArrayField } from 'payload'
|
|
5
|
+
import { DesignTokenLabelPath } from '@/ui'
|
|
6
|
+
import { onArraySetAPFShallow } from '@/hooks/field/apf'
|
|
7
|
+
|
|
8
|
+
/** Creates a value field for use in the design sets collection. */
|
|
9
|
+
export const ValueField: TextField = APField({ name: 'value', type: 'text', apf: ['classes'], required: true })
|
|
10
|
+
|
|
11
|
+
type ValuesFieldProps = (args?: { name?: string; defaultValue?: { value: string }[] }) => ArrayField
|
|
12
|
+
|
|
13
|
+
/** Creates an array of value fields for use in the design sets collection. */
|
|
14
|
+
export const ValuesField: ValuesFieldProps = (args) => {
|
|
15
|
+
const valueField: ArrayField = {
|
|
16
|
+
name: args?.name || 'values',
|
|
17
|
+
type: 'array',
|
|
18
|
+
required: true,
|
|
19
|
+
fields: [ValueField],
|
|
20
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (args?.defaultValue) valueField.defaultValue = args.defaultValue
|
|
24
|
+
|
|
25
|
+
return valueField
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const TokenString = z.ap.add(
|
|
29
|
+
z
|
|
30
|
+
.array(z.object({ name: z.string(), value: z.string() }))
|
|
31
|
+
.nullable()
|
|
32
|
+
.optional(),
|
|
33
|
+
{ id: 'TokenString' },
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
type TokenValueArrayFieldExtras = { description?: string; defaultValue?: { name: string; value: string }[] }
|
|
37
|
+
|
|
38
|
+
/** Creates an array field with a row label component and a value field for use in the design sets collection */
|
|
39
|
+
export const TokenValueArrayField = (name: string, extras?: TokenValueArrayFieldExtras) => {
|
|
40
|
+
const valueField: ArrayField = {
|
|
41
|
+
name: name,
|
|
42
|
+
type: 'array',
|
|
43
|
+
admin: { components: { RowLabel: { path: DesignTokenLabelPath } } },
|
|
44
|
+
fields: [APField({ type: 'text', name: 'name', apf: ['classes'], required: true, kebab: true }), ValueField],
|
|
45
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
46
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/TokenString` })],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (extras?.description) valueField.admin!.description = extras.description
|
|
50
|
+
if (extras?.defaultValue) valueField.defaultValue = extras.defaultValue
|
|
51
|
+
|
|
52
|
+
return valueField
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const TokenStringArray = z.ap.add(
|
|
56
|
+
z
|
|
57
|
+
.array(z.object({ name: z.string(), values: z.array(z.object({ value: z.string() })) }))
|
|
58
|
+
.nullable()
|
|
59
|
+
.optional(),
|
|
60
|
+
{ id: 'TokenStringArray' },
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
type TokenValuesArrayFieldExtras = { description?: string; defaultValue?: TokenValueArrayFieldExtras['defaultValue'][] }
|
|
64
|
+
|
|
65
|
+
/** Creates an array field with a row label component and a name field for use in the design sets collection.*/
|
|
66
|
+
export const TokenValuesArrayField = (name: string, extras?: TokenValuesArrayFieldExtras) => {
|
|
67
|
+
const valueField: ArrayField = {
|
|
68
|
+
name: name,
|
|
69
|
+
type: 'array',
|
|
70
|
+
admin: { components: { RowLabel: { path: DesignTokenLabelPath } } },
|
|
71
|
+
fields: [APField({ type: 'text', name: 'name', apf: ['classes'], required: true, kebab: true }), ValuesField()],
|
|
72
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
73
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/TokenStringArray` })],
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (extras?.description) valueField.admin!.description = extras.description
|
|
77
|
+
if (extras?.defaultValue) valueField.defaultValue = extras.defaultValue
|
|
78
|
+
|
|
79
|
+
return valueField
|
|
80
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckboxField } from 'payload'
|
|
2
|
+
|
|
3
|
+
export const DevModeField = (): CheckboxField => {
|
|
4
|
+
const devModeField: CheckboxField = {
|
|
5
|
+
name: 'devMode',
|
|
6
|
+
type: 'checkbox',
|
|
7
|
+
required: true,
|
|
8
|
+
admin: { style: { maxWidth: '100px', alignSelf: 'center' } },
|
|
9
|
+
}
|
|
10
|
+
return devModeField
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UploadField } from 'payload'
|
|
2
|
+
import type { APFunction } from '@/ts/types'
|
|
3
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
4
|
+
import { onUploadSetAPF } from '@/hooks/field/apf'
|
|
5
|
+
|
|
6
|
+
type FaviconFieldType = (args?: Partial<UploadField> & { apf?: APFunction[] }) => UploadField
|
|
7
|
+
|
|
8
|
+
const description = 'Sets the favicon for the site.'
|
|
9
|
+
|
|
10
|
+
export const FaviconField: FaviconFieldType = (args) => {
|
|
11
|
+
const { apf, ...rest } = args || {}
|
|
12
|
+
|
|
13
|
+
const faviconField: UploadField = { name: 'favicon', type: 'upload', relationTo: 'favicons', admin: { description } }
|
|
14
|
+
|
|
15
|
+
if (args?.apf) faviconField.hooks = { beforeValidate: [onUploadSetAPF(args.apf)] }
|
|
16
|
+
|
|
17
|
+
return deepMerge(faviconField, rest)
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextField } from 'payload'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
|
|
4
|
+
const description = 'The name of the input this label is associated with.'
|
|
5
|
+
|
|
6
|
+
type ForFieldType = (args?: Partial<TextField>) => TextField
|
|
7
|
+
|
|
8
|
+
export const ForField: ForFieldType = (args) => {
|
|
9
|
+
const forField: TextField = { name: 'htmlFor', type: 'text', label: 'HTML For', admin: { description } }
|
|
10
|
+
return deepMerge(forField, args)
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckboxField } from 'payload'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
|
|
4
|
+
type KeepMountedFieldType = (args?: Partial<CheckboxField>) => CheckboxField
|
|
5
|
+
|
|
6
|
+
const description = 'If checked, the portal will remain in the DOM when hidden.'
|
|
7
|
+
|
|
8
|
+
export const KeepMountedField: KeepMountedFieldType = (args) => {
|
|
9
|
+
const keepMountedField: CheckboxField = { name: 'keepMounted', type: 'checkbox', admin: { description } }
|
|
10
|
+
return deepMerge(keepMountedField, args)
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SelectField } from 'payload'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
|
|
4
|
+
type ModalFieldType = (args?: Partial<SelectField>) => SelectField
|
|
5
|
+
|
|
6
|
+
const description = 'Determines if you can interact outside the opened portal. Defaults to window, which allows interaction outside the portal.'
|
|
7
|
+
const options = [
|
|
8
|
+
{ label: 'Trap Focus', value: 'trap-focus' },
|
|
9
|
+
{ label: 'Block', value: 'Block' },
|
|
10
|
+
{ label: 'Window', value: 'Window' },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
export const ModalField: ModalFieldType = (args) => {
|
|
14
|
+
const modalField: SelectField = { name: 'modal', type: 'select', label: 'Trap Focus', interfaceName: 'trapFocus', options, admin: { description } }
|
|
15
|
+
return deepMerge(modalField, args)
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SlugPath } from '@/ui'
|
|
2
|
+
import type { CheckboxField, TextField } from 'payload'
|
|
3
|
+
import { formatSlugHook } from '@/hooks/field/formatSlug'
|
|
4
|
+
|
|
5
|
+
type Overrides = { slugOverrides?: Partial<TextField>; checkboxOverrides?: Partial<CheckboxField> }
|
|
6
|
+
|
|
7
|
+
type Slug = (fieldToUse?: string, overrides?: Overrides) => [TextField, CheckboxField]
|
|
8
|
+
|
|
9
|
+
export const slugField: Slug = (fieldToUse = 'title', overrides = {}) => {
|
|
10
|
+
const { slugOverrides, checkboxOverrides } = overrides
|
|
11
|
+
|
|
12
|
+
const checkBoxField: CheckboxField = {
|
|
13
|
+
name: 'slugLock',
|
|
14
|
+
type: 'checkbox',
|
|
15
|
+
defaultValue: true,
|
|
16
|
+
admin: { hidden: true, position: 'sidebar' },
|
|
17
|
+
...checkboxOverrides,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error - ts mismatch Partial<TextField> with TextField
|
|
21
|
+
const slugField: TextField = {
|
|
22
|
+
name: 'slug',
|
|
23
|
+
type: 'text',
|
|
24
|
+
index: true,
|
|
25
|
+
label: 'Slug',
|
|
26
|
+
...(slugOverrides || {}),
|
|
27
|
+
hooks: { beforeValidate: [formatSlugHook(fieldToUse)] },
|
|
28
|
+
admin: {
|
|
29
|
+
...(slugOverrides?.admin || {}),
|
|
30
|
+
components: { Field: { path: SlugPath, clientProps: { fieldToUse, checkboxFieldPath: checkBoxField.name } } },
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return [slugField, checkBoxField]
|
|
35
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ArrayField } from 'payload'
|
|
2
|
+
import { KeyTextField } from '@/fields/actions'
|
|
3
|
+
|
|
4
|
+
const d = {
|
|
5
|
+
array: 'Add static data attributes to the element.',
|
|
6
|
+
key: 'The name of the key to set.',
|
|
7
|
+
value: 'The string value of the data-key. Set to "true" to have a data attribute applied with no string value.',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**Used to add a field to the admin panel that allows the user to add static data attributes to the element.*/
|
|
11
|
+
export const StaticDataAttributesField = (location: 'trigger' | 'content') => {
|
|
12
|
+
const sda: ArrayField = {
|
|
13
|
+
type: 'array',
|
|
14
|
+
name: 'staticDataAttributes',
|
|
15
|
+
interfaceName: 'StaticDataAttributes',
|
|
16
|
+
admin: { description: d.array, condition: (_, sd) => Boolean(sd.type !== 'button') || Boolean(sd.buttonType === 'portal') },
|
|
17
|
+
fields: [
|
|
18
|
+
KeyTextField({ required: true, admin: { width: '25%', description: d.key } }),
|
|
19
|
+
{ name: 'value', type: 'text', required: true, admin: { description: d.value } },
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (location === 'trigger') {
|
|
24
|
+
sda.name = 'triggerStaticDataAttributes'
|
|
25
|
+
sda.admin!.condition = (_, sd) => Boolean(sd?.type === 'button')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return sda
|
|
29
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { GroupField } from 'payload'
|
|
2
|
+
import { ActionBlocks } from '@/fields/blocks/actions'
|
|
3
|
+
|
|
4
|
+
type ActionsTab = (prefix: 'trigger' | 'content') => GroupField
|
|
5
|
+
|
|
6
|
+
export const ActionsTab: ActionsTab = (prefix) => {
|
|
7
|
+
const actionTab: GroupField = {
|
|
8
|
+
type: 'group',
|
|
9
|
+
name: `${prefix}Actions`,
|
|
10
|
+
interfaceName: 'allActions',
|
|
11
|
+
label: false,
|
|
12
|
+
admin: {
|
|
13
|
+
hideGutter: true,
|
|
14
|
+
condition: (_, sd) => {
|
|
15
|
+
if (Boolean(sd.blockType === 'AtomicChild')) {
|
|
16
|
+
if (prefix === 'trigger') return Boolean(sd.type === 'button')
|
|
17
|
+
else if (prefix === 'content') return Boolean(sd.type !== 'button') || Boolean(sd.buttonType === 'portal')
|
|
18
|
+
}
|
|
19
|
+
return true
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
fields: [
|
|
23
|
+
ActionBlocks(prefix),
|
|
24
|
+
{
|
|
25
|
+
name: 'actions',
|
|
26
|
+
type: 'json',
|
|
27
|
+
admin: { readOnly: true, condition: (data) => data.devMode },
|
|
28
|
+
typescriptSchema: [(jsonSchema) => ({ ...jsonSchema, type: 'array', items: { $ref: `#/definitions/ActionBlockType` } })],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'runners',
|
|
32
|
+
type: 'json',
|
|
33
|
+
admin: { readOnly: true, condition: (data) => data.devMode },
|
|
34
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/Runners` })],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'attributers',
|
|
38
|
+
type: 'json',
|
|
39
|
+
admin: { readOnly: true, condition: (data) => data.devMode },
|
|
40
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/Attributers` })],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return actionTab
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const TriggerActionsTab: GroupField = ActionsTab('trigger')
|
|
49
|
+
export const ContentActionsTab: GroupField = ActionsTab('content')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GroupField } from 'payload'
|
|
2
|
+
import { ClassNameField } from '@/fields/className'
|
|
3
|
+
import { BackdropChildren } from '@/fields/blocks/backdropChildren'
|
|
4
|
+
|
|
5
|
+
const d = {
|
|
6
|
+
className: 'Add atomic classes or shortcuts to the portal backdrop div here.',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const PortalBackdropTab: GroupField = {
|
|
10
|
+
type: 'group',
|
|
11
|
+
label: 'Portal Backdrop',
|
|
12
|
+
admin: { hideGutter: true, condition: (_, sd) => Boolean(sd?.type === 'button' && sd?.buttonType === 'portal') },
|
|
13
|
+
fields: [
|
|
14
|
+
ClassNameField({ namePrefix: 'backdrop', label: 'Portal Backdrop Atomic Classes', admin: { description: d.className } }),
|
|
15
|
+
BackdropChildren,
|
|
16
|
+
],
|
|
17
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TabAsField } from 'payload'
|
|
2
|
+
import { ChildBlockType } from '@/ts/types'
|
|
3
|
+
import type { Field, TextField } from 'payload'
|
|
4
|
+
import { StaticDataAttributesField } from '@/fields/staticDataAttributes'
|
|
5
|
+
import { PortalBackdropTab } from '@/fields/tabs/block/children/backdrop'
|
|
6
|
+
import { TagSettingsTab } from '@/blocks/children/atomic/variants/tag/settings'
|
|
7
|
+
import { FormSettingsTab } from '@/blocks/children/atomic/variants/form/settings'
|
|
8
|
+
import { InputSettingsTab } from '@/blocks/children/atomic/variants/input/settings'
|
|
9
|
+
import { LinkSettingsTab } from '@/blocks/children/atomic/variants/button/variants/link/settings'
|
|
10
|
+
import { DialogSettingsTab } from '@/blocks/children/atomic/variants/button/variants/portal/dialog/settings'
|
|
11
|
+
import { PopoverSettingsTab } from '@/blocks/children/atomic/variants/button/variants/portal/popover/settings'
|
|
12
|
+
|
|
13
|
+
const d = {
|
|
14
|
+
tab: 'Whichever block type is selected, this tab will contain the non control bar settings for that block type.',
|
|
15
|
+
cid: 'Sets the components anchor ID, which can be used in anchor links.',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const cidField: TextField = { name: 'cid', type: 'text', label: 'Anchor ID', admin: { description: d.cid } }
|
|
19
|
+
|
|
20
|
+
export const ChildsSettingsTab = (childBlock: ChildBlockType) => {
|
|
21
|
+
let fields: Field[] | undefined = undefined
|
|
22
|
+
|
|
23
|
+
switch (childBlock) {
|
|
24
|
+
case 'AtomicChild':
|
|
25
|
+
fields = [
|
|
26
|
+
cidField,
|
|
27
|
+
TagSettingsTab,
|
|
28
|
+
FormSettingsTab,
|
|
29
|
+
LinkSettingsTab,
|
|
30
|
+
InputSettingsTab,
|
|
31
|
+
PortalBackdropTab,
|
|
32
|
+
DialogSettingsTab,
|
|
33
|
+
PopoverSettingsTab,
|
|
34
|
+
StaticDataAttributesField('trigger'),
|
|
35
|
+
StaticDataAttributesField('content'),
|
|
36
|
+
]
|
|
37
|
+
break
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (fields === undefined) fields = [cidField, StaticDataAttributesField('content')]
|
|
41
|
+
const childSettingsTabField: TabAsField = { type: 'tab', label: 'Settings', admin: { description: d.tab }, fields }
|
|
42
|
+
return childSettingsTabField
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const AtomicChildSettingsTab: TabAsField = ChildsSettingsTab('AtomicChild')
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GroupField } from 'payload'
|
|
2
|
+
import { formFunctionsBlockTemplate } from '@/fields/blocks/submitForm/form'
|
|
3
|
+
|
|
4
|
+
export const formRateLimitTab: GroupField = {
|
|
5
|
+
type: 'group',
|
|
6
|
+
label: false,
|
|
7
|
+
admin: { hideGutter: true, condition: (_, sd) => Boolean(sd?.type === 'form') },
|
|
8
|
+
fields: [formFunctionsBlockTemplate('RateLimit')],
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const formSanitationTab: GroupField = {
|
|
12
|
+
type: 'group',
|
|
13
|
+
label: false,
|
|
14
|
+
admin: { hideGutter: true, condition: (_, sd) => Boolean(sd?.type === 'form') },
|
|
15
|
+
fields: [formFunctionsBlockTemplate('Sanitation')],
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const formValidationTab: GroupField = {
|
|
19
|
+
type: 'group',
|
|
20
|
+
label: false,
|
|
21
|
+
admin: { hideGutter: true, condition: (_, sd) => Boolean(sd?.type === 'form') },
|
|
22
|
+
fields: [formFunctionsBlockTemplate('Validation')],
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GroupField } from 'payload'
|
|
2
|
+
import { APField } from '@/fields/apf'
|
|
3
|
+
import { inputFunctionsBlockTemplate } from '@/fields/blocks/submitForm/input'
|
|
4
|
+
|
|
5
|
+
export const inputTab: GroupField = {
|
|
6
|
+
type: 'group',
|
|
7
|
+
label: false,
|
|
8
|
+
admin: { hideGutter: true, condition: (_, sd) => Boolean(sd?.type === 'input') },
|
|
9
|
+
fields: [
|
|
10
|
+
APField({ type: 'checkbox', apf: ['form'], name: 'required', admin: { description: 'If checked, this input field is required.' } }),
|
|
11
|
+
inputFunctionsBlockTemplate('Sanitation'),
|
|
12
|
+
inputFunctionsBlockTemplate('Validation'),
|
|
13
|
+
],
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Tab } from 'payload'
|
|
2
|
+
|
|
3
|
+
export const TrackingTab: Tab = {
|
|
4
|
+
label: 'Tracking',
|
|
5
|
+
admin: { description: 'Used to add tracking properties to the block.' },
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'contentPostHogProperty',
|
|
9
|
+
type: 'relationship',
|
|
10
|
+
relationTo: 'posthogProperty',
|
|
11
|
+
hasMany: true,
|
|
12
|
+
admin: {
|
|
13
|
+
condition: (_, sd) =>
|
|
14
|
+
Boolean(sd?.blockType === 'AtomicChild') ? Boolean(sd.type !== 'button') || Boolean(sd.buttonType === 'portal') : true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'triggerPostHogProperty',
|
|
19
|
+
type: 'relationship',
|
|
20
|
+
relationTo: 'posthogProperty',
|
|
21
|
+
hasMany: true,
|
|
22
|
+
admin: { condition: (_, sd) => (Boolean(sd?.blockType === 'AtomicChild') ? Boolean(sd.type === 'button') : false) },
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CollapsibleField, TabAsField } from 'payload'
|
|
2
|
+
|
|
3
|
+
type StorageTabType = (args?: { filter?: ('classes' | 'forms' | 'actions')[] }) => TabAsField
|
|
4
|
+
|
|
5
|
+
/**Used to add a tab to the admin panel that displays the stored atomic classes and forms.*/
|
|
6
|
+
export const StorageTab: StorageTabType = ({ filter = ['classes', 'forms', 'actions'] } = {}) => {
|
|
7
|
+
const allFields: Record<'classes' | 'forms' | 'actions', CollapsibleField> = {
|
|
8
|
+
classes: {
|
|
9
|
+
type: 'collapsible',
|
|
10
|
+
label: 'Class Names',
|
|
11
|
+
admin: { initCollapsed: true },
|
|
12
|
+
fields: [
|
|
13
|
+
{
|
|
14
|
+
name: 'storedAtomicClasses',
|
|
15
|
+
type: 'json',
|
|
16
|
+
admin: { readOnly: true },
|
|
17
|
+
typescriptSchema: [() => ({ type: 'array', items: { type: 'string' } })],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
forms: {
|
|
22
|
+
type: 'collapsible',
|
|
23
|
+
label: 'Forms',
|
|
24
|
+
admin: { initCollapsed: true },
|
|
25
|
+
fields: [
|
|
26
|
+
{
|
|
27
|
+
name: 'storedAtomicForms',
|
|
28
|
+
type: 'json',
|
|
29
|
+
admin: { readOnly: true },
|
|
30
|
+
typescriptSchema: [() => ({ type: 'array', items: { $ref: '#/definitions/StoredAtomicForm' } })],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
actions: {
|
|
35
|
+
type: 'collapsible',
|
|
36
|
+
label: 'Actions',
|
|
37
|
+
admin: { initCollapsed: true },
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: 'storedAtomicActions',
|
|
41
|
+
type: 'json',
|
|
42
|
+
admin: { readOnly: true },
|
|
43
|
+
typescriptSchema: [() => ({ $ref: '#/definitions/StoredAtomicActions' })],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const filteredFields =
|
|
50
|
+
filter.length > 0
|
|
51
|
+
? Object.values(Object.fromEntries(Object.entries(allFields).filter(([key]) => filter.includes(key))))
|
|
52
|
+
: Object.values(allFields)
|
|
53
|
+
|
|
54
|
+
return { type: 'tab', label: 'Storage', fields: filteredFields }
|
|
55
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SelectField, Condition } from 'payload'
|
|
2
|
+
|
|
3
|
+
type ChildBlocksWithTagType = 'SimpleTextChild' | 'VideoChild' | 'AtomicChild'
|
|
4
|
+
type TagTypeFieldType = (args: { childBlock: ChildBlocksWithTagType; width?: string; condition?: Condition }) => SelectField
|
|
5
|
+
|
|
6
|
+
const locations: Record<ChildBlocksWithTagType, { interfaceName: string; defaultValue: string; options: string[] }> = {
|
|
7
|
+
VideoChild: { interfaceName: 'VideoTagType', defaultValue: 'div', options: ['div', 'section'] },
|
|
8
|
+
AtomicChild: {
|
|
9
|
+
interfaceName: 'AtomicTagType',
|
|
10
|
+
defaultValue: 'div',
|
|
11
|
+
options: ['div', 'section', 'fragment', 'article', 'nav', 'label', 'ul', 'ol', 'li', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'code'],
|
|
12
|
+
},
|
|
13
|
+
SimpleTextChild: {
|
|
14
|
+
interfaceName: 'SimpleTextTagType',
|
|
15
|
+
defaultValue: 'p',
|
|
16
|
+
options: ['p', 'span', 'fragment', 'div', 'label', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'code'],
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//Where this field is used, is where options are set.
|
|
21
|
+
export const TagTypeField: TagTypeFieldType = ({ childBlock, width, condition }) => {
|
|
22
|
+
const tagTypeField: SelectField = {
|
|
23
|
+
name: 'tagType',
|
|
24
|
+
type: 'select',
|
|
25
|
+
required: true,
|
|
26
|
+
admin: { width, condition },
|
|
27
|
+
interfaceName: locations[childBlock].interfaceName,
|
|
28
|
+
options: locations[childBlock].options,
|
|
29
|
+
defaultValue: locations[childBlock].defaultValue,
|
|
30
|
+
}
|
|
31
|
+
return tagTypeField
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextField } from 'payload'
|
|
2
|
+
|
|
3
|
+
type UniqueTitleFieldType = (defaultValue?: string) => TextField
|
|
4
|
+
|
|
5
|
+
export const UniqueTitleField: UniqueTitleFieldType = (defaultValue = 'New Title') => {
|
|
6
|
+
const uniqueTitleField: TextField = { name: 'title', type: 'text', required: true, unique: true, defaultValue }
|
|
7
|
+
return uniqueTitleField
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import type { TextField } from 'payload'
|
|
3
|
+
|
|
4
|
+
const description = "The message to display when the validation fails. Use {{inputName}} to display the input's value."
|
|
5
|
+
|
|
6
|
+
/** Used in form SVR block fields to set the validation message. */
|
|
7
|
+
export const ValidationMessageField: TextField = APField({
|
|
8
|
+
type: 'text',
|
|
9
|
+
apf: ['form'],
|
|
10
|
+
required: true,
|
|
11
|
+
admin: { description },
|
|
12
|
+
name: 'validationMessage',
|
|
13
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Settings } from './settings'
|
|
2
|
+
import { baseStorage } from './storage'
|
|
3
|
+
import { Tracking } from './tracking/global'
|
|
4
|
+
import { SiteMetaData } from './siteMetaData'
|
|
5
|
+
|
|
6
|
+
const globals = [Settings, Tracking, SiteMetaData, baseStorage('draft'), baseStorage('published')]
|
|
7
|
+
|
|
8
|
+
export default globals
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { GlobalConfig } from 'payload'
|
|
2
|
+
import { authd } from '@/access/authenticated'
|
|
3
|
+
import { revalidateCache } from '@/hooks/global/revalidate'
|
|
4
|
+
|
|
5
|
+
const d = {
|
|
6
|
+
draft: 'Settings for the draft version of the website.',
|
|
7
|
+
published: 'Settings for the published version of the website.',
|
|
8
|
+
storeVersion:
|
|
9
|
+
"The version of the websites persistent data. Changing this will reset the store, except for the cookie consent preferences. Use this when you change actions and things aren't working as expected.",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Settings: GlobalConfig = {
|
|
13
|
+
slug: 'settings',
|
|
14
|
+
label: 'Settings',
|
|
15
|
+
admin: { group: 'Website' },
|
|
16
|
+
access: { read: authd, update: authd },
|
|
17
|
+
fields: [
|
|
18
|
+
{
|
|
19
|
+
type: 'tabs',
|
|
20
|
+
tabs: [
|
|
21
|
+
{
|
|
22
|
+
name: 'draft',
|
|
23
|
+
admin: { description: d.draft },
|
|
24
|
+
fields: [{ name: 'storeVersion', type: 'number', required: true, defaultValue: 0, admin: { description: d.storeVersion } }],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'published',
|
|
28
|
+
admin: { description: d.published },
|
|
29
|
+
fields: [{ name: 'storeVersion', type: 'number', required: true, defaultValue: 0, admin: { description: d.storeVersion } }],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
hooks: { beforeChange: [revalidateCache] },
|
|
35
|
+
versions: { drafts: { schedulePublish: true, validate: true }, max: 10 },
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import type { GlobalConfig } from 'payload'
|
|
3
|
+
import { authd } from '@/access/authenticated'
|
|
4
|
+
import { FaviconField } from '@/fields/favicon'
|
|
5
|
+
import { onUploadSetAPF } from '@/hooks/field/apf'
|
|
6
|
+
import { generateAPFFields } from '@/fields/apf/storage'
|
|
7
|
+
import { revalidateCache } from '@/hooks/global/revalidate'
|
|
8
|
+
|
|
9
|
+
export const SiteMetaData: GlobalConfig = {
|
|
10
|
+
slug: 'siteMetaData',
|
|
11
|
+
label: 'Site MetaData',
|
|
12
|
+
admin: { group: 'Website' },
|
|
13
|
+
access: { read: authd, update: authd },
|
|
14
|
+
fields: [
|
|
15
|
+
APField({ type: 'text', apf: ['siteMetadata'], name: 'siteName' }),
|
|
16
|
+
APField({ type: 'textarea', apf: ['siteMetadata'], name: 'fallbackSiteDescription' }),
|
|
17
|
+
{ type: 'upload', name: 'fallbackOGImage', relationTo: 'images', hooks: { afterChange: [onUploadSetAPF(['siteMetadata'])] } },
|
|
18
|
+
{
|
|
19
|
+
type: 'row',
|
|
20
|
+
fields: [
|
|
21
|
+
FaviconField({ apf: ['siteMetadata'], name: 'fallbackLightFavicon' }),
|
|
22
|
+
FaviconField({ apf: ['siteMetadata'], name: 'fallbackDarkFavicon' }),
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
...generateAPFFields(['siteMetadata']),
|
|
26
|
+
],
|
|
27
|
+
hooks: { beforeChange: [revalidateCache] },
|
|
28
|
+
versions: { drafts: { schedulePublish: true, validate: true }, max: 10 },
|
|
29
|
+
}
|