@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,187 @@
|
|
|
1
|
+
import { Page, ShortcutSet } from '@/ts/types'
|
|
2
|
+
|
|
3
|
+
type ShortcutSetArgs = { page: Page }
|
|
4
|
+
|
|
5
|
+
export const shortcutSet: (args: ShortcutSetArgs) => Omit<ShortcutSet, 'createdAt' | 'updatedAt' | 'id'> = ({ page }) => {
|
|
6
|
+
return {
|
|
7
|
+
active: true,
|
|
8
|
+
title: 'Base Shortcut Set',
|
|
9
|
+
|
|
10
|
+
testPath: page,
|
|
11
|
+
|
|
12
|
+
shortcuts: [
|
|
13
|
+
{
|
|
14
|
+
name: 'page-main',
|
|
15
|
+
ClassName: 'flex\nflex-1\nflex-col\npx-2',
|
|
16
|
+
id: '6927555aeb8aaaca85b3a425',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
name: 'no-scrollbar',
|
|
21
|
+
ClassName: '[scrollbar-width:none]\n[-ms-overflow-style:none]',
|
|
22
|
+
id: '6930657ac59442e39df9579d',
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
name: 'nice-scrollbar',
|
|
27
|
+
ClassName:
|
|
28
|
+
'overflow-y-auto\n[&::-webkit-scrollbar]:w-1\n[&::-webkit-scrollbar]:p-[2px]\n[&::-webkit-scrollbar-thumb]:rounded-full\n[&::-webkit-scrollbar-thumb]:bg-foreground/30\n[&::-webkit-scrollbar-track]:bg-background\nhover:[&::-webkit-scrollbar-thumb]:bg-foreground/60',
|
|
29
|
+
id: '69334bb9f7cd753c11ea0d73',
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
name: 'ui-seperator',
|
|
34
|
+
ClassName:
|
|
35
|
+
'bg-border\nshrink-0\ndata-[orientation=vertical]:h-4\ndata-[orientation=vertical]:w-[1px]\ndata-[orientation=horizontal]:w-full\ndata-[orientation=horizontal]:h-[1px]',
|
|
36
|
+
id: '69288288df37686e6978aec5',
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
name: 'icon-outline',
|
|
41
|
+
ClassName: 'rounded-full\nborder-1',
|
|
42
|
+
id: '69275568eb8aaaca85b3a426',
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
{
|
|
46
|
+
name: 'icon-inline',
|
|
47
|
+
ClassName: 'self-center\nsize-[1em]\nrounded-full\nborder-1\nfill-foreground\nstroke-foreground',
|
|
48
|
+
id: '6927556eeb8aaaca85b3a427',
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
name: 'form-label',
|
|
53
|
+
ClassName:
|
|
54
|
+
'flex\nitems-center\ngap-2\ntext-sm\nleading-none\nfont-medium\nselect-none\ngroup-data-[disabled=true]:pointer-events-none\ngroup-data-[disabled=true]:opacity-50\npeer-disabled:cursor-not-allowed\npeer-disabled:opacity-50',
|
|
55
|
+
id: '6930868816ba198a13e06c5f',
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
{
|
|
59
|
+
name: 'form-input',
|
|
60
|
+
ClassName:
|
|
61
|
+
'w-full\nmin-w-0\nh-9\npx-3\npy-1\nrounded-md\nborder\nborder-input\nbg-transparent\ndark:bg-input/30\ntext-base\nmd:text-sm\nfile:inline-flex\nfile:h-7\nfile:border-0\nfile:bg-transparent\nfile:text-sm\nfile:font-medium\nfile:text-foreground\nplaceholder:text-muted-foreground\nselection:bg-primary\nselection:text-primary-foreground\nshadow-xs\ntransition-[color,box-shadow]\noutline-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\ndata-[error]:border-destructive\ndisabled:pointer-events-none\ndisabled:cursor-not-allowed\ndisabled:opacity-50',
|
|
62
|
+
id: '693086f716ba198a13e06c60',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
name: 'form-textarea',
|
|
67
|
+
ClassName:
|
|
68
|
+
'flex\nfield-sizing-content\nw-full\nmin-h-16\npx-3\npy-2\nrounded-md\nborder\nborder-input\nbg-transparent\ndark:bg-input/30\ntext-base\nmd:text-sm\nshadow-xs\ntransition-[color,box-shadow]\noutline-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\nplaceholder:text-muted-foreground\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\ndisabled:cursor-not-allowed\ndisabled:opacity-50',
|
|
69
|
+
id: '6931c91837a7f512e091f8d7',
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
name: 'menu-trigger-text',
|
|
74
|
+
ClassName:
|
|
75
|
+
"inline-flex\nitems-center\njustify-center\nshrink-0\nwhitespace-nowrap\nh-8\nrounded-md\ngap-1.5\npx-3\nhas-[>svg]:px-2.5\ntext-sm\nfont-medium\ntransition-all\noutline-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\nhover:bg-accent\nhover:text-accent-foreground\ndark:hover:bg-accent/50\ndisabled:pointer-events-none\ndisabled:opacity-50\n[&_svg]:pointer-events-none\n[&_svg]:shrink-0\n[&_svg:not([class*='size-'])]:size-4",
|
|
76
|
+
id: '69287f44df37686e6978aeb3',
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
name: 'menu-trigger-icon',
|
|
81
|
+
ClassName:
|
|
82
|
+
"items-center\njustify-center\nshrink-0\ngap-2\nwhitespace-nowrap\nsize-8\nrounded-md\ntext-sm\nfont-medium\ntransition-all\noutline-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\nhover:bg-accent\nhover:text-accent-foreground\ndark:hover:bg-accent/50\ndisabled:pointer-events-none\ndisabled:opacity-50\n[&_svg]:pointer-events-none\n[&_svg]:shrink-0\n[&_svg:not([class*='size-'])]:size-4",
|
|
83
|
+
id: '692880dedf37686e6978aec0',
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
{
|
|
87
|
+
name: 'menu-trigger-both',
|
|
88
|
+
ClassName:
|
|
89
|
+
"inline-flex\nitems-center\njustify-center\nshrink-0\nh-8\nrounded-md\ngap-1.5\npx-3\nhas-[>svg]:px-2.5\nwhitespace-nowrap\ntext-sm\nfont-medium\ntransition-all\noutline-none\nshadow-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\nhover:bg-accent\nhover:text-accent-foreground\ndark:hover:bg-accent/50\ndisabled:pointer-events-none\ndisabled:opacity-50\n[&_svg]:pointer-events-none\n[&_svg]:shrink-0\n[&_svg:not([class*='size-'])]:size-4",
|
|
90
|
+
id: '69288c655a0c1e888eb3e6f2',
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
name: 'trigger',
|
|
95
|
+
ClassName:
|
|
96
|
+
"inline-flex\nitems-center\njustify-center\nshrink-0\ngap-2\nwhitespace-nowrap\nrounded-md\ncursor-pointer\ntext-sm\nfont-medium\ntransition-all\noutline-none\nfocus-visible:border-ring\nfocus-visible:ring-ring/50\nfocus-visible:ring-[3px]\naria-invalid:border-destructive\naria-invalid:ring-destructive/20\ndark:aria-invalid:ring-destructive/40\ndisabled:pointer-events-none\ndisabled:opacity-50\n[&_svg]:pointer-events-none\n[&_svg]:shrink-0\n[&_svg:not([class*='size-'])]:size-4",
|
|
97
|
+
id: '69307477e303ad21a77bdd55',
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
name: 'trigger-style-base',
|
|
102
|
+
ClassName: 'bg-primary\ntext-primary-foreground\nhover:bg-primary/90',
|
|
103
|
+
id: '69332a133dc3aa372c7fa544',
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
{
|
|
107
|
+
name: 'trigger-style-destructive',
|
|
108
|
+
ClassName:
|
|
109
|
+
'bg-destructive\ndark:bg-destructive/60\ntext-white\nhover:bg-destructive/90\nfocus-visible:ring-destructive/20\ndark:focus-visible:ring-destructive/40',
|
|
110
|
+
id: '69332a323dc3aa372c7fa545',
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
{
|
|
114
|
+
name: 'trigger-style-outline',
|
|
115
|
+
ClassName:
|
|
116
|
+
'border\ndark:border-input\nbg-background\ndark:bg-input/30\nshadow-xs\nhover:bg-accent\ndark:hover:bg-input/50\nhover:text-accent-foreground',
|
|
117
|
+
id: '69332a433dc3aa372c7fa546',
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
{
|
|
121
|
+
name: 'trigger-style-secondary',
|
|
122
|
+
ClassName: 'bg-secondary\ntext-secondary-foreground\nhover:bg-secondary/80',
|
|
123
|
+
id: '69332a463dc3aa372c7fa547',
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
{
|
|
127
|
+
name: 'trigger-style-ghost',
|
|
128
|
+
ClassName: 'hover:bg-accent\nhover:text-accent-foreground\ndark:hover:bg-accent/50',
|
|
129
|
+
id: '69332a4a3dc3aa372c7fa548',
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
{
|
|
133
|
+
name: 'trigger-style-link',
|
|
134
|
+
ClassName: 'text-primary\nunderline-offset-4\nhover:underline',
|
|
135
|
+
id: '69332a5d3dc3aa372c7fa549',
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
{
|
|
139
|
+
name: 'trigger-size-sm',
|
|
140
|
+
ClassName: 'h-8\nrounded-md\ngap-1.5\npx-3\nhas-[>svg]:px-2.5',
|
|
141
|
+
id: '69332b1f3dc3aa372c7fa54b',
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
{
|
|
145
|
+
name: 'trigger-size-base',
|
|
146
|
+
ClassName: 'h-9\npx-4\npy-2\nhas-[>svg]:px-3',
|
|
147
|
+
id: '69332b153dc3aa372c7fa54a',
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
{
|
|
151
|
+
name: 'trigger-size-lg',
|
|
152
|
+
ClassName: 'h-10\nrounded-md\npx-6\nhas-[>svg]:px-4',
|
|
153
|
+
id: '69332b243dc3aa372c7fa54c',
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
{
|
|
157
|
+
name: 'trigger-size-icon',
|
|
158
|
+
ClassName: 'size-9',
|
|
159
|
+
id: '69332b2a3dc3aa372c7fa54d',
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
{
|
|
163
|
+
name: 'trigger-size-icon-sm',
|
|
164
|
+
ClassName: 'size-8',
|
|
165
|
+
id: '69332b313dc3aa372c7fa54e',
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
{
|
|
169
|
+
name: 'trigger-size-icon-lg',
|
|
170
|
+
ClassName: 'size-10',
|
|
171
|
+
id: '69332b393dc3aa372c7fa54f',
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
{
|
|
175
|
+
name: 'consent-trigger',
|
|
176
|
+
ClassName:
|
|
177
|
+
'h-8\nw-20\nrounded-md\ngap-1.5\ntext-white\nbg-destructive/60\nhover:bg-destructive/90\ndata-[enabled]:bg-success/60\ndata-[enabled]:hover:bg-success/80',
|
|
178
|
+
id: '69332da5245a1e195635a6b1',
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
|
|
182
|
+
defaultShortcuts: [],
|
|
183
|
+
_status: 'published',
|
|
184
|
+
'apf-classes': false,
|
|
185
|
+
'apf-active': false,
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SiteMetaDatum } from '@/ts/types'
|
|
2
|
+
|
|
3
|
+
export const siteMetaData: Omit<SiteMetaDatum, 'createdAt' | 'updatedAt' | 'id'> = {
|
|
4
|
+
siteName: 'Atomic Payload',
|
|
5
|
+
fallbackSiteDescription: 'The Website Builder Where All You Need To Know Is Tailwind.',
|
|
6
|
+
fallbackOGImage: null,
|
|
7
|
+
fallbackLightFavicon: null,
|
|
8
|
+
fallbackDarkFavicon: null,
|
|
9
|
+
_status: 'published',
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
/** Used in attributer actions to change the output data attributes key. Without impacting the key within the atomic store
|
|
6
|
+
*
|
|
7
|
+
* @defaults { name: 'changeKey', apf: ['actions'], type: 'text', kebab: true }
|
|
8
|
+
*/
|
|
9
|
+
export const ChangeKeyField: APFieldWrapper<'text', 'name' | 'apf' | 'type' | 'kebab'> = (args) => {
|
|
10
|
+
const baseField: APArgs<'text'> = { type: 'text', apf: ['actions'], name: 'changeKey', kebab: true }
|
|
11
|
+
return APField(deepMerge(baseField, args))
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
const description = 'The initial value to set the key to. Checked = true, Unchecked = false. First click set the opposite of this value.'
|
|
6
|
+
|
|
7
|
+
/** Typically utilized to set what the initial value of an action will be.
|
|
8
|
+
*
|
|
9
|
+
* @defaults { name: 'initialValue', apf: ['actions'], type: 'checkbox' }
|
|
10
|
+
*/
|
|
11
|
+
export const InitialValueCheckboxField: APFieldWrapper<'checkbox', 'name' | 'apf' | 'type'> = (args) => {
|
|
12
|
+
const baseField: APArgs<'checkbox'> = { name: 'initialValue', type: 'checkbox', apf: ['actions'], admin: { description } }
|
|
13
|
+
return APField(deepMerge(baseField, args))
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
const description = 'The name of the key to set. Use Kebab Case. (e.g. status-accepted)'
|
|
6
|
+
|
|
7
|
+
export const KeyTextField: APFieldWrapper<'text', 'name' | 'apf' | 'type'> = (args) => {
|
|
8
|
+
const baseField: APArgs<'text'> = { name: 'key', type: 'text', apf: ['actions'], kebab: true, required: true, admin: { description } }
|
|
9
|
+
return APField(deepMerge(baseField, args))
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
const description =
|
|
6
|
+
'If true, the value will be persisted in the browser storage, and replace the initial value. Beware of FOUC is using these for initial visual state.'
|
|
7
|
+
|
|
8
|
+
/** Used in actions to persist the value in the browser storage.
|
|
9
|
+
* @defaults { name: 'persisted', apf: ['actions'], type: 'checkbox' }
|
|
10
|
+
*/
|
|
11
|
+
export const PersistedField: APFieldWrapper<'checkbox', 'name' | 'apf' | 'type'> = (args) => {
|
|
12
|
+
const baseField: APArgs<'checkbox'> = { name: 'persisted', type: 'checkbox', apf: ['actions'], admin: { description } }
|
|
13
|
+
return APField(deepMerge(baseField, args))
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
const description = 'If true, the value will be set as a data attribute on the element. Which can be used by atomic classes.'
|
|
6
|
+
|
|
7
|
+
/** Used in actions to set the value as a data attribute on the element. Which can be used by atomic classes.
|
|
8
|
+
*
|
|
9
|
+
* @defaults { name: 'setDA', apf: ['actions'], type: 'checkbox' }
|
|
10
|
+
*/
|
|
11
|
+
export const SetDataField: APFieldWrapper<'checkbox', 'name' | 'apf' | 'type'> = (args) => {
|
|
12
|
+
const baseField: APArgs<'checkbox'> = {
|
|
13
|
+
name: 'setDA',
|
|
14
|
+
type: 'checkbox',
|
|
15
|
+
apf: ['actions'],
|
|
16
|
+
admin: { description },
|
|
17
|
+
label: 'Set As Data Attribute (Atomic Class)',
|
|
18
|
+
}
|
|
19
|
+
return APField(deepMerge(baseField, args))
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
import { StrictSet, strictSelectRegistry } from './registry'
|
|
5
|
+
|
|
6
|
+
type PresetFields = 'type' | 'typescriptSchema' | 'apf' | 'name' | 'options' | 'required'
|
|
7
|
+
|
|
8
|
+
export const KeySelectField: APFieldWrapper<'select', PresetFields, { set: StrictSet }> = (args) => {
|
|
9
|
+
let set: StrictSet = 'cookieConsent'
|
|
10
|
+
let rest: Omit<APArgs<'select'>, PresetFields> = {}
|
|
11
|
+
|
|
12
|
+
if (args) {
|
|
13
|
+
const { set: setArg, ...restArg } = args
|
|
14
|
+
set = setArg || 'cookieConsent'
|
|
15
|
+
rest = restArg
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const baseField: APArgs<'select'> = {
|
|
19
|
+
name: 'key',
|
|
20
|
+
type: 'select',
|
|
21
|
+
apf: ['actions'],
|
|
22
|
+
required: true,
|
|
23
|
+
options: strictSelectRegistry[set].key.options,
|
|
24
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/${strictSelectRegistry[set].key.meta()?.id}` })],
|
|
25
|
+
}
|
|
26
|
+
return APField(deepMerge(baseField, rest))
|
|
27
|
+
}
|
|
28
|
+
export default KeySelectField
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import { APArgs, APFieldWrapper } from '@/ts/types'
|
|
4
|
+
import { strictSelectRegistry, StrictSet } from './registry'
|
|
5
|
+
|
|
6
|
+
type PresetFields = 'type' | 'typescriptSchema' | 'apf' | 'name' | 'options' | 'required'
|
|
7
|
+
|
|
8
|
+
export const ListenSelectField: APFieldWrapper<'select', PresetFields, { set: StrictSet }> = (args) => {
|
|
9
|
+
let set: StrictSet = 'cookieConsent'
|
|
10
|
+
let rest: Omit<APArgs<'select'>, PresetFields> = {}
|
|
11
|
+
|
|
12
|
+
if (args) {
|
|
13
|
+
const { set: setArg, ...restArg } = args
|
|
14
|
+
set = setArg || 'cookieConsent'
|
|
15
|
+
rest = restArg
|
|
16
|
+
}
|
|
17
|
+
const baseField: APArgs<'select'> = {
|
|
18
|
+
name: 'listen',
|
|
19
|
+
type: 'select',
|
|
20
|
+
apf: ['actions'],
|
|
21
|
+
required: true,
|
|
22
|
+
options: strictSelectRegistry[set].listen.options,
|
|
23
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/${strictSelectRegistry[set]?.listen?.meta()?.id}` })],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return APField(deepMerge(baseField, rest))
|
|
27
|
+
}
|
|
28
|
+
export default ListenSelectField
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import { APArgs, APFieldWrapper } from '@/ts/types'
|
|
3
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
4
|
+
import { strictSelectRegistry, StrictSet } from './registry'
|
|
5
|
+
|
|
6
|
+
type PresetFields = 'type' | 'typescriptSchema' | 'apf' | 'name' | 'options' | 'required'
|
|
7
|
+
|
|
8
|
+
export const PerformSelectField: APFieldWrapper<'select', PresetFields, { set: StrictSet }> = (args) => {
|
|
9
|
+
let set: StrictSet = 'cookieConsent'
|
|
10
|
+
let rest: Omit<APArgs<'select'>, PresetFields> = {}
|
|
11
|
+
|
|
12
|
+
if (args) {
|
|
13
|
+
const { set: setArg, ...restArg } = args
|
|
14
|
+
set = setArg || 'cookieConsent'
|
|
15
|
+
rest = restArg
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const baseField: APArgs<'select'> = {
|
|
19
|
+
name: 'perform',
|
|
20
|
+
type: 'select',
|
|
21
|
+
apf: ['actions'],
|
|
22
|
+
required: true,
|
|
23
|
+
options: strictSelectRegistry[set].perform.options,
|
|
24
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/${strictSelectRegistry[set]?.perform?.meta()?.id}` })],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return APField(deepMerge(baseField, rest))
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default PerformSelectField
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from '@/ts/zap'
|
|
2
|
+
|
|
3
|
+
export const cookieConsentKeys = z.ap.add(
|
|
4
|
+
z.enum(['functional', 'security', 'analytics', 'marketing', 'userData', 'adPersonalization', 'contentPersonalization']),
|
|
5
|
+
{ id: 'CookieConsentPreferenceKeys' },
|
|
6
|
+
)
|
|
7
|
+
export const cookieConsentListen = z.ap.add(z.enum(['preference', 'accept', 'decline', 'hasConsented', 'previouslyConsented']), {
|
|
8
|
+
id: 'CookieConsentListen',
|
|
9
|
+
})
|
|
10
|
+
export const cookieConsentPerform = z.ap.add(z.enum(['preference', 'accept', 'decline']), { id: 'CookieConsentPerform' })
|
|
11
|
+
|
|
12
|
+
const cookieConsent = { key: cookieConsentKeys, listen: cookieConsentListen, perform: cookieConsentPerform }
|
|
13
|
+
|
|
14
|
+
export default cookieConsent
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from '@/ts/zap'
|
|
2
|
+
|
|
3
|
+
export const themeKeys = z.ap.add(z.enum(['mode']), { id: 'ThemeKeys' })
|
|
4
|
+
export const themeListen = z.ap.add(z.enum(['mode']), { id: 'ThemeListen' })
|
|
5
|
+
export const themePerform = z.ap.add(z.enum(['light', 'dark', 'system', 'cycle']), { id: 'ThemePerform' })
|
|
6
|
+
|
|
7
|
+
const theme = { key: themeKeys, listen: themeListen, perform: themePerform }
|
|
8
|
+
|
|
9
|
+
export default theme
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { APField } from './apf'
|
|
2
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
3
|
+
import type { APFieldWrapper, APArgs } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
export const ActiveField: APFieldWrapper<'checkbox', 'name' | 'apf' | 'type' | 'defaultValue'> = (args) => {
|
|
6
|
+
const baseField: APArgs<'checkbox'> = {
|
|
7
|
+
type: 'checkbox',
|
|
8
|
+
apf: ['active'],
|
|
9
|
+
name: 'active',
|
|
10
|
+
required: true,
|
|
11
|
+
index: true,
|
|
12
|
+
admin: { style: { maxWidth: '100px', alignSelf: 'center' } },
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return APField(deepMerge(baseField, args))
|
|
16
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import deepMerge from '@/utilities/deepMerge'
|
|
2
|
+
import { APFieldPath, APFieldLabelPath } from '@/ui'
|
|
3
|
+
import type { APFieldType, APArgs, APReturn } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
/** Filters out undefined values from an object */
|
|
6
|
+
function definedProps<T extends Record<string, unknown>>(obj: T): Partial<T> {
|
|
7
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined)) as Partial<T>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Utility Field For Adding Atomic Payload Functionality to Fields */
|
|
11
|
+
export function APField(args: APArgs<'text'>): APReturn<'text'>
|
|
12
|
+
export function APField(args: APArgs<'select'>): APReturn<'select'>
|
|
13
|
+
export function APField(args: APArgs<'number'>): APReturn<'number'>
|
|
14
|
+
export function APField(args: APArgs<'textarea'>): APReturn<'textarea'>
|
|
15
|
+
export function APField(args: APArgs<'checkbox'>): APReturn<'checkbox'>
|
|
16
|
+
export function APField(args: APFieldType['args']): APFieldType['return'] {
|
|
17
|
+
const { type, name, apf, docLink, ...baseArgs } = args
|
|
18
|
+
|
|
19
|
+
const possiblyUndefinedProps = definedProps({ docLink })
|
|
20
|
+
|
|
21
|
+
const baseField = {
|
|
22
|
+
name,
|
|
23
|
+
admin: {
|
|
24
|
+
components: {
|
|
25
|
+
Field: {
|
|
26
|
+
path: APFieldPath,
|
|
27
|
+
clientProps: { type, apf, ...possiblyUndefinedProps },
|
|
28
|
+
},
|
|
29
|
+
// Fields Select & Number Use This Since We Use The Payload Field Component
|
|
30
|
+
Label: {
|
|
31
|
+
path: APFieldLabelPath,
|
|
32
|
+
clientProps: { type, apf, ...possiblyUndefinedProps },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
switch (type) {
|
|
39
|
+
case 'text': {
|
|
40
|
+
const { kebab, ...rest } = baseArgs as APArgs<'text'>
|
|
41
|
+
|
|
42
|
+
if (kebab) Object.assign(baseField.admin.components.Field.clientProps!, { kebab: args.kebab })
|
|
43
|
+
|
|
44
|
+
return deepMerge({ type: 'text', ...baseField }, rest)
|
|
45
|
+
}
|
|
46
|
+
case 'textarea': {
|
|
47
|
+
const { kebab, ...rest } = baseArgs as APArgs<'textarea'>
|
|
48
|
+
|
|
49
|
+
if (kebab) Object.assign(baseField.admin.components.Field.clientProps!, { kebab: args.kebab })
|
|
50
|
+
|
|
51
|
+
return deepMerge({ type: 'textarea', ...baseField }, rest)
|
|
52
|
+
}
|
|
53
|
+
case 'checkbox': {
|
|
54
|
+
const { ...rest } = baseArgs as APArgs<'checkbox'>
|
|
55
|
+
|
|
56
|
+
return deepMerge({ type: 'checkbox', ...baseField }, rest)
|
|
57
|
+
}
|
|
58
|
+
case 'select': {
|
|
59
|
+
const { options, ...rest } = baseArgs as APArgs<'select'>
|
|
60
|
+
|
|
61
|
+
return deepMerge({ type: 'select', options, ...baseField }, rest)
|
|
62
|
+
}
|
|
63
|
+
case 'number': {
|
|
64
|
+
const { ...rest } = baseArgs as APArgs<'number'>
|
|
65
|
+
|
|
66
|
+
return deepMerge({ type: 'number', ...baseField }, rest)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CheckboxField } from 'payload'
|
|
2
|
+
import { APFunction } from '@/ts/types/apf'
|
|
3
|
+
import { virtualAPFAfterReadFieldHook, virtualAPFBeforeChangeFieldHook } from '@/hooks/field/apf'
|
|
4
|
+
|
|
5
|
+
/** Atomic Payload Functions Registry */
|
|
6
|
+
export const apfRegistry: Record<APFunction, string> = {
|
|
7
|
+
seo: 'apf-seo',
|
|
8
|
+
form: 'apf-form',
|
|
9
|
+
page: 'apf-page',
|
|
10
|
+
pages: 'apf-pages',
|
|
11
|
+
active: 'apf-active',
|
|
12
|
+
actions: 'apf-actions',
|
|
13
|
+
classes: 'apf-classes',
|
|
14
|
+
sitemap: 'apf-sitemap',
|
|
15
|
+
siteMetadata: 'apf-siteMetadata',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Template field for APF checkboxes */
|
|
19
|
+
const apfFieldTemplate: Omit<CheckboxField, 'name'> = {
|
|
20
|
+
type: 'checkbox',
|
|
21
|
+
virtual: true,
|
|
22
|
+
admin: { readOnly: true, hidden: true },
|
|
23
|
+
hooks: { beforeValidate: [virtualAPFBeforeChangeFieldHook], afterRead: [virtualAPFAfterReadFieldHook] },
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Generate APF fields for specific APFunctions
|
|
28
|
+
* @param apFunctions - Array of APFunctions to include
|
|
29
|
+
* @returns Array of checkbox fields for the specified APFunctions
|
|
30
|
+
*/
|
|
31
|
+
export const generateAPFFields = (apFunctions: APFunction[]): CheckboxField[] => {
|
|
32
|
+
return apFunctions.map((apFunction) => ({ ...apfFieldTemplate, name: apfRegistry[apFunction] }))
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**Sets all APF fields*/
|
|
36
|
+
export const apfStorage = generateAPFFields(Object.keys(apfRegistry) as APFunction[])
|
|
37
|
+
|
|
38
|
+
export default apfStorage
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BlocksField } from 'payload'
|
|
2
|
+
import { ActionBlocksPath } from '@/ui'
|
|
3
|
+
import { ActionBlockType } from '@/ts/types'
|
|
4
|
+
|
|
5
|
+
const AllActionBlocks: ActionBlockType[] = [
|
|
6
|
+
'ActSetCC',
|
|
7
|
+
'ActCCToDA',
|
|
8
|
+
'ActSetTheme',
|
|
9
|
+
'ActResetForm',
|
|
10
|
+
'ActDSSetBool',
|
|
11
|
+
'ActSubmitForm',
|
|
12
|
+
'ActDSBoolToDA',
|
|
13
|
+
'ActDSTextToDA',
|
|
14
|
+
'ActDSCycleText',
|
|
15
|
+
'ActFormErrorToDA',
|
|
16
|
+
'ActSetPortalOpen',
|
|
17
|
+
'ActFormStatusToDA',
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
export const ActionBlocks = (prefix: 'trigger' | 'content'): BlocksField => {
|
|
21
|
+
return {
|
|
22
|
+
type: 'blocks',
|
|
23
|
+
name: 'actionBlocks',
|
|
24
|
+
blocks: [],
|
|
25
|
+
label: `${prefix.charAt(0).toUpperCase() + prefix.slice(1)} Actions`,
|
|
26
|
+
blockReferences: AllActionBlocks,
|
|
27
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/ActionBlocks` })],
|
|
28
|
+
admin: { initCollapsed: true, components: { Field: { path: ActionBlocksPath, clientProps: { placement: prefix } } } },
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlocksField } from 'payload'
|
|
2
|
+
|
|
3
|
+
export const BackdropChildren: BlocksField = {
|
|
4
|
+
name: 'backdropChildren',
|
|
5
|
+
label: 'Blocks',
|
|
6
|
+
type: 'blocks',
|
|
7
|
+
blocks: [],
|
|
8
|
+
blockReferences: ['SVGChild'],
|
|
9
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/BackdropChildren` })],
|
|
10
|
+
admin: { description: 'You can add backdrop blocks that will be displayed in the portal backdrop div.' },
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BlocksField } from 'payload'
|
|
2
|
+
import { ChildBlockType } from '@/ts/types'
|
|
3
|
+
|
|
4
|
+
const AllChildBlocks: ChildBlockType[] = ['AtomicChild', 'SimpleTextChild', 'RichTextChild', 'ImageChild', 'VideoChild', 'IconChild', 'SVGChild']
|
|
5
|
+
|
|
6
|
+
/** Adds all children blocks to a collection or global. Do not use in anything other than a collection or global.*/
|
|
7
|
+
export const ChildrenBlocks: BlocksField = {
|
|
8
|
+
name: 'children',
|
|
9
|
+
type: 'blocks',
|
|
10
|
+
blocks: [],
|
|
11
|
+
admin: { initCollapsed: true },
|
|
12
|
+
blockReferences: AllChildBlocks,
|
|
13
|
+
labels: { singular: 'Child', plural: 'Children' },
|
|
14
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/ChildBlocks` })],
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BlocksField } from 'payload'
|
|
2
|
+
import { FormRateLimitBlockType, FormSanitationBlockType, FormValidationBlockType } from '@/ts/types'
|
|
3
|
+
|
|
4
|
+
type formFunctionRegistry = {
|
|
5
|
+
RateLimit: FormRateLimitBlockType[]
|
|
6
|
+
Sanitation: FormSanitationBlockType[]
|
|
7
|
+
Validation: FormValidationBlockType[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const formFunctionRegistry: formFunctionRegistry = {
|
|
11
|
+
RateLimit: ['FrlSimpleSlidingWindow'],
|
|
12
|
+
Sanitation: ['FsCombineTwoFields'],
|
|
13
|
+
Validation: ['FvIsUnique'],
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const formFunctionsBlockTemplate = (variant: keyof typeof formFunctionRegistry): BlocksField => {
|
|
17
|
+
return {
|
|
18
|
+
name: `form${variant}Blocks`,
|
|
19
|
+
type: 'blocks',
|
|
20
|
+
blocks: [],
|
|
21
|
+
blockReferences: formFunctionRegistry[variant],
|
|
22
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/Form${variant}Blocks` })],
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BlocksField } from 'payload'
|
|
2
|
+
import { InputBlocksPath } from '@/ui'
|
|
3
|
+
import { useOn } from '@/blocks/submitForm/input/useOn'
|
|
4
|
+
import { InputSanitationBlockType, InputValidationBlockType } from '@/ts/types'
|
|
5
|
+
|
|
6
|
+
type InputFunctionRegistry = {
|
|
7
|
+
Sanitation: InputSanitationBlockType[]
|
|
8
|
+
Validation: InputValidationBlockType[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const inputFunctionRegistry: InputFunctionRegistry = {
|
|
12
|
+
Sanitation: ['IsTrimText'],
|
|
13
|
+
Validation: ['IvContains', 'IvDoesNotContain'],
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const inputFunctionsBlockTemplate = (variant: keyof typeof inputFunctionRegistry): BlocksField => {
|
|
17
|
+
return {
|
|
18
|
+
name: `input${variant}Blocks`,
|
|
19
|
+
type: 'blocks',
|
|
20
|
+
blocks: [],
|
|
21
|
+
blockReferences: inputFunctionRegistry[variant],
|
|
22
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/Input${variant}Blocks` })],
|
|
23
|
+
admin: { initCollapsed: true, components: { Field: { path: InputBlocksPath, clientProps: { usedOn: useOn } } } },
|
|
24
|
+
}
|
|
25
|
+
}
|