@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,44 @@
|
|
|
1
|
+
import { APFControlsPath } from '@/ui'
|
|
2
|
+
import { FontsTab } from './tabs/fonts'
|
|
3
|
+
import { SizesTab } from './tabs/sizes'
|
|
4
|
+
import { ProseTab } from './tabs/prose'
|
|
5
|
+
import { ColorsTab } from './tabs/colors'
|
|
6
|
+
import { StorageTab } from './tabs/storage'
|
|
7
|
+
import { SettingsTab } from './tabs/settings'
|
|
8
|
+
import { authd } from '@/access/authenticated'
|
|
9
|
+
import type { CollectionConfig } from 'payload'
|
|
10
|
+
import { VariablesTab } from './tabs/variables'
|
|
11
|
+
import { type APFunction } from '@/ts/types/apf'
|
|
12
|
+
import { AnimationsTab } from './tabs/animation'
|
|
13
|
+
import { MiscellaneousTab } from './tabs/miscellaneous'
|
|
14
|
+
import { generateAPFFields } from '@/fields/apf/storage'
|
|
15
|
+
import { atomicHook } from '@/hooks/collection/atomicHook/atomicHook'
|
|
16
|
+
import { revalidateCacheOnDelete } from '@/hooks/collection/revalidate'
|
|
17
|
+
import { generateLivePreviewPath } from '@/utilities/generatePreviewPath'
|
|
18
|
+
|
|
19
|
+
const APFunctions: APFunction[] = ['classes', 'active']
|
|
20
|
+
|
|
21
|
+
const DesignSet: CollectionConfig = {
|
|
22
|
+
slug: 'designSet',
|
|
23
|
+
access: { create: authd, delete: authd, read: authd, update: authd },
|
|
24
|
+
admin: {
|
|
25
|
+
group: 'Sets',
|
|
26
|
+
useAsTitle: 'title',
|
|
27
|
+
enableListViewSelectAPI: true,
|
|
28
|
+
defaultColumns: ['title', 'active', '_status'],
|
|
29
|
+
preview: (data, { req }) => generateLivePreviewPath({ data, req }),
|
|
30
|
+
livePreview: { url: ({ data, req }) => generateLivePreviewPath({ data, req }) },
|
|
31
|
+
components: { edit: { beforeDocumentControls: [{ path: APFControlsPath, clientProps: { APFunctions } }] } },
|
|
32
|
+
},
|
|
33
|
+
fields: [
|
|
34
|
+
{
|
|
35
|
+
type: 'tabs',
|
|
36
|
+
tabs: [SettingsTab(), VariablesTab(), ColorsTab(), SizesTab(), FontsTab(), AnimationsTab(), MiscellaneousTab(), ProseTab, StorageTab()],
|
|
37
|
+
},
|
|
38
|
+
...generateAPFFields(APFunctions),
|
|
39
|
+
],
|
|
40
|
+
hooks: { beforeChange: [atomicHook], afterDelete: [revalidateCacheOnDelete] },
|
|
41
|
+
versions: { drafts: { schedulePublish: true, validate: true }, maxPerDoc: 50 },
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default DesignSet
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//Any classes manually added in the project files should be added here.
|
|
2
|
+
export const defaultAtomicClasses = [
|
|
3
|
+
'sr-only',
|
|
4
|
+
'object-cover',
|
|
5
|
+
'group',
|
|
6
|
+
'isolate',
|
|
7
|
+
'w-full',
|
|
8
|
+
'h-full',
|
|
9
|
+
'container',
|
|
10
|
+
'py-28',
|
|
11
|
+
'max-w-none',
|
|
12
|
+
'mb-4',
|
|
13
|
+
'inline-block',
|
|
14
|
+
'px-4',
|
|
15
|
+
'py-2',
|
|
16
|
+
'rounded',
|
|
17
|
+
'bg-gray-200',
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
export const defaultAria = [{ value: 'invalid' }]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from '@/ts/zap'
|
|
2
|
+
import { type Tab } from 'payload'
|
|
3
|
+
import { APField } from '@/fields/apf'
|
|
4
|
+
import { AnimationLabelPath } from '@/ui'
|
|
5
|
+
import { onArraySetAPFShallow } from '@/hooks/field/apf'
|
|
6
|
+
import { TokenValueArrayField, TokenValuesArrayField } from '@/fields/designSets/value'
|
|
7
|
+
|
|
8
|
+
export const unoThemeAnimation = z.ap.add(
|
|
9
|
+
z.object({
|
|
10
|
+
category: z.ap.get('RSS').optional(),
|
|
11
|
+
keyframes: z.ap.get('RSS').optional(),
|
|
12
|
+
durations: z.ap.get('RSS').optional(),
|
|
13
|
+
timingFns: z.ap.get('RSS').optional(),
|
|
14
|
+
properties: z.ap.get('RSRSS').optional(),
|
|
15
|
+
counts: z.record(z.string(), z.union([z.string(), z.number()])).optional(),
|
|
16
|
+
}),
|
|
17
|
+
{ id: 'UnoThemeAnimation' },
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const ds = {
|
|
21
|
+
ease: 'The ease of the animation.',
|
|
22
|
+
duration: 'The length of the animation in seconds.',
|
|
23
|
+
keyframes: 'The @keyframes information for the animation.',
|
|
24
|
+
timingFns: 'Interpolation functions like linear/ease-in-out.',
|
|
25
|
+
counts: 'The times the animation should play, either infinite or a number.',
|
|
26
|
+
properties: 'Special properties like transform-origin and backface-visibility.',
|
|
27
|
+
name: 'The name of the animation used in class names fields. Capitals will be lowercased. Spaces will be replaced with hyphens (-). So type freely.',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const AnimationsTab = () => {
|
|
31
|
+
const storageField: Tab = {
|
|
32
|
+
label: 'Animations',
|
|
33
|
+
admin: { description: 'Add custom animations here. They can be called in other atomic classes.' },
|
|
34
|
+
fields: [
|
|
35
|
+
{
|
|
36
|
+
type: 'collapsible',
|
|
37
|
+
label: 'Animations',
|
|
38
|
+
admin: { initCollapsed: true },
|
|
39
|
+
fields: [
|
|
40
|
+
{
|
|
41
|
+
name: 'animation',
|
|
42
|
+
type: 'array',
|
|
43
|
+
admin: { components: { RowLabel: { path: AnimationLabelPath } } },
|
|
44
|
+
fields: [
|
|
45
|
+
APField({
|
|
46
|
+
type: 'textarea',
|
|
47
|
+
apf: ['classes'],
|
|
48
|
+
name: 'name',
|
|
49
|
+
label: 'Animations Atomic Class Name',
|
|
50
|
+
required: true,
|
|
51
|
+
kebab: true,
|
|
52
|
+
admin: { description: ds.name },
|
|
53
|
+
}),
|
|
54
|
+
APField({ type: 'text', apf: ['classes'], name: 'keyframes', required: true, admin: { description: ds.keyframes } }),
|
|
55
|
+
APField({ type: 'text', apf: ['classes'], name: 'duration', admin: { description: ds.duration } }),
|
|
56
|
+
APField({ type: 'text', apf: ['classes'], name: 'timingFns', admin: { description: ds.timingFns } }),
|
|
57
|
+
APField({ type: 'text', apf: ['classes'], name: 'properties', admin: { description: ds.properties } }),
|
|
58
|
+
APField({ type: 'text', apf: ['classes'], name: 'counts', admin: { description: ds.counts } }),
|
|
59
|
+
APField({ type: 'text', apf: ['classes'], name: 'ease', admin: { description: ds.ease } }),
|
|
60
|
+
],
|
|
61
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
TokenValueArrayField('ease'),
|
|
66
|
+
TokenValuesArrayField('property'),
|
|
67
|
+
],
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return storageField
|
|
71
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// TODO: Make Color Picker Component
|
|
2
|
+
import { z } from '@/ts/zap'
|
|
3
|
+
import { type Tab } from 'payload'
|
|
4
|
+
import { ColorLabelPath } from '@/ui'
|
|
5
|
+
import { APField } from '@/fields/apf'
|
|
6
|
+
import { onArraySetAPFShallow } from '@/hooks/field/apf'
|
|
7
|
+
|
|
8
|
+
export const UnoColors = z.ap.add(z.record(z.string(), z.string().or(z.record(z.string(), z.string()))), { id: 'UnoColors' })
|
|
9
|
+
export const designSetColors = z.ap.add(z.array(z.object({ name: z.string(), light: z.string(), dark: z.string() })), { id: 'DesignSetColors' })
|
|
10
|
+
|
|
11
|
+
export const ColorsTab = () => {
|
|
12
|
+
const colorsField: Tab = {
|
|
13
|
+
label: 'Colors',
|
|
14
|
+
fields: [
|
|
15
|
+
{
|
|
16
|
+
type: 'array',
|
|
17
|
+
name: 'colors',
|
|
18
|
+
typescriptSchema: [() => ({ $ref: `#/definitions/DesignSetColors` })],
|
|
19
|
+
admin: { initCollapsed: true, components: { RowLabel: { path: ColorLabelPath } } },
|
|
20
|
+
fields: [
|
|
21
|
+
APField({ type: 'text', apf: ['classes'], name: 'name', required: true, kebab: true }),
|
|
22
|
+
APField({ type: 'text', apf: ['classes'], name: 'light', required: true }),
|
|
23
|
+
APField({ type: 'text', apf: ['classes'], name: 'dark', required: true }),
|
|
24
|
+
],
|
|
25
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return colorsField
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Tab } from 'payload'
|
|
2
|
+
import { APField } from '@/fields/apf'
|
|
3
|
+
import { DesignTokenLabelPath } from '@/ui'
|
|
4
|
+
import { onArraySetAPFShallow } from '@/hooks/field/apf'
|
|
5
|
+
import { TokenValueArrayField } from '@/fields/designSets/value'
|
|
6
|
+
|
|
7
|
+
export const FontsTab = () => {
|
|
8
|
+
const fontsField: Tab = {
|
|
9
|
+
label: 'Fonts',
|
|
10
|
+
admin: { description: 'These are the fonts that are applied to the entire website.' },
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
name: 'font',
|
|
14
|
+
type: 'group',
|
|
15
|
+
admin: { hideGutter: true },
|
|
16
|
+
fields: [
|
|
17
|
+
{
|
|
18
|
+
type: 'row',
|
|
19
|
+
fields: [
|
|
20
|
+
{ name: 'sans', type: 'upload', relationTo: 'font' },
|
|
21
|
+
{ name: 'serif', type: 'upload', relationTo: 'font' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'row',
|
|
26
|
+
fields: [
|
|
27
|
+
{ name: 'mono', type: 'upload', relationTo: 'font' },
|
|
28
|
+
{ name: 'display', type: 'upload', relationTo: 'font' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'array',
|
|
35
|
+
name: 'text',
|
|
36
|
+
label: 'Text',
|
|
37
|
+
admin: { components: { RowLabel: { path: DesignTokenLabelPath } } },
|
|
38
|
+
fields: [
|
|
39
|
+
APField({ type: 'text', apf: ['classes'], name: 'name', required: true, kebab: true }),
|
|
40
|
+
APField({ type: 'text', apf: ['classes'], name: 'fontSize', required: true }),
|
|
41
|
+
APField({ type: 'text', apf: ['classes'], name: 'lineHeight', required: true }),
|
|
42
|
+
],
|
|
43
|
+
hooks: { beforeValidate: [onArraySetAPFShallow(['classes'])] },
|
|
44
|
+
},
|
|
45
|
+
TokenValueArrayField('fontWeight'),
|
|
46
|
+
TokenValueArrayField('tracking'),
|
|
47
|
+
TokenValueArrayField('leading'),
|
|
48
|
+
TokenValueArrayField('textStrokeWidth'),
|
|
49
|
+
],
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return fontsField
|
|
53
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Tab } from 'payload'
|
|
2
|
+
import { defaultAria } from '@/collections/designSets/defaults'
|
|
3
|
+
import { TokenValueArrayField, TokenValuesArrayField, ValuesField } from '@/fields/designSets/value'
|
|
4
|
+
|
|
5
|
+
export const MiscellaneousTab = () => {
|
|
6
|
+
const colorsField: Tab = {
|
|
7
|
+
label: 'Misc',
|
|
8
|
+
fields: [
|
|
9
|
+
ValuesField({ name: 'aria', defaultValue: defaultAria }),
|
|
10
|
+
TokenValueArrayField('blur'),
|
|
11
|
+
TokenValueArrayField('media'),
|
|
12
|
+
TokenValueArrayField('supports'),
|
|
13
|
+
TokenValueArrayField('perspective'),
|
|
14
|
+
TokenValuesArrayField('shadow'),
|
|
15
|
+
TokenValuesArrayField('insetShadow'),
|
|
16
|
+
TokenValuesArrayField('dropShadow'),
|
|
17
|
+
TokenValuesArrayField('textShadow'),
|
|
18
|
+
],
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return colorsField
|
|
22
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { APField } from '@/fields/apf'
|
|
2
|
+
import { ArrayField, TextField, SelectField, TabAsField, GroupField } from 'payload'
|
|
3
|
+
|
|
4
|
+
export const typographySupportedTags = [
|
|
5
|
+
'headings',
|
|
6
|
+
'h1',
|
|
7
|
+
'h2',
|
|
8
|
+
'h3',
|
|
9
|
+
'h4',
|
|
10
|
+
'h5',
|
|
11
|
+
'h6',
|
|
12
|
+
'th',
|
|
13
|
+
'p',
|
|
14
|
+
'a',
|
|
15
|
+
'blockquote',
|
|
16
|
+
'figure',
|
|
17
|
+
'figcaption',
|
|
18
|
+
'strong',
|
|
19
|
+
'em',
|
|
20
|
+
'kbd',
|
|
21
|
+
'code',
|
|
22
|
+
'pre',
|
|
23
|
+
'ol',
|
|
24
|
+
'ul',
|
|
25
|
+
'li',
|
|
26
|
+
'table',
|
|
27
|
+
'thead',
|
|
28
|
+
'tr',
|
|
29
|
+
'td',
|
|
30
|
+
'img',
|
|
31
|
+
'video',
|
|
32
|
+
'hr',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
const tagField: SelectField = APField({
|
|
36
|
+
type: 'select',
|
|
37
|
+
name: 'tag',
|
|
38
|
+
required: true,
|
|
39
|
+
apf: ['classes'],
|
|
40
|
+
admin: { width: '50%', style: { maxWidth: '500px' }, description: 'Select the tag the nested styles will apply to.' },
|
|
41
|
+
options: typographySupportedTags,
|
|
42
|
+
interfaceName: 'TypographySupportedTags',
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const psuedoClassField: TextField = APField({
|
|
46
|
+
name: 'psuedoClass',
|
|
47
|
+
type: 'text',
|
|
48
|
+
required: false,
|
|
49
|
+
admin: {
|
|
50
|
+
width: '50%',
|
|
51
|
+
style: { maxWidth: '500px' },
|
|
52
|
+
description: 'Optionally add a psuedo-class (e.g., :hover, :focus, etc.) to target specific states.',
|
|
53
|
+
},
|
|
54
|
+
apf: ['classes'],
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const typeographyField = (name: string, description: string): ArrayField => {
|
|
58
|
+
return {
|
|
59
|
+
name,
|
|
60
|
+
type: 'array',
|
|
61
|
+
admin: { description },
|
|
62
|
+
interfaceName: 'TypographyStyles',
|
|
63
|
+
fields: [
|
|
64
|
+
tagField,
|
|
65
|
+
psuedoClassField,
|
|
66
|
+
{
|
|
67
|
+
type: 'row',
|
|
68
|
+
fields: [
|
|
69
|
+
{
|
|
70
|
+
type: 'array',
|
|
71
|
+
name: 'values',
|
|
72
|
+
fields: [
|
|
73
|
+
APField({ type: 'text', name: 'cssSelector', required: true, apf: ['classes'] }),
|
|
74
|
+
APField({ type: 'text', name: 'value', required: true, apf: ['classes'] }),
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const colorField = (name: string, light: string, dark: string): GroupField => {
|
|
84
|
+
return {
|
|
85
|
+
name,
|
|
86
|
+
type: 'group',
|
|
87
|
+
interfaceName: 'ProseColorField',
|
|
88
|
+
fields: [
|
|
89
|
+
{
|
|
90
|
+
type: 'row',
|
|
91
|
+
fields: [
|
|
92
|
+
APField({ name: 'light', required: true, type: 'text', defaultValue: light, admin: { width: '50%' }, apf: ['classes'] }),
|
|
93
|
+
APField({ name: 'dark', required: true, type: 'text', defaultValue: dark, admin: { width: '50%' }, apf: ['classes'] }),
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const ProseTab: TabAsField = {
|
|
101
|
+
type: 'tab',
|
|
102
|
+
label: 'Prose',
|
|
103
|
+
admin: {
|
|
104
|
+
description: 'Configure typography styles and colors for prose content. Utilizes UnoCSS Typography Preset: https://unocss.dev/presets/typography',
|
|
105
|
+
},
|
|
106
|
+
fields: [
|
|
107
|
+
{
|
|
108
|
+
label: 'Colors',
|
|
109
|
+
type: 'collapsible',
|
|
110
|
+
fields: [
|
|
111
|
+
{
|
|
112
|
+
type: 'group',
|
|
113
|
+
label: false,
|
|
114
|
+
name: 'proseColors',
|
|
115
|
+
required: true,
|
|
116
|
+
interfaceName: 'ProseColors',
|
|
117
|
+
fields: [
|
|
118
|
+
colorField('body', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
119
|
+
colorField('headings', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
120
|
+
colorField('lead', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
121
|
+
colorField('links', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
122
|
+
colorField('bold', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
123
|
+
colorField('counters', 'oklch(0.145 0 0)', 'oklch(87.62% 0.240 148.61)'),
|
|
124
|
+
colorField('bullets', 'oklch(0.145 0 0)', 'oklch(87.62% 0.240 148.61)'),
|
|
125
|
+
colorField('hr', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
126
|
+
colorField('quotes', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
127
|
+
colorField('quote-borders', 'oklch(0.145 0 0)', 'oklch(87.62% 0.240 148.61)'),
|
|
128
|
+
colorField('captions', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
129
|
+
colorField('kbd', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
130
|
+
colorField('kbd-shadows', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
131
|
+
colorField('code', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
132
|
+
colorField('pre-code', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
133
|
+
colorField('pre-bg', 'oklch(0.145 0 0)', 'oklch(1 0 0 / 10%)'),
|
|
134
|
+
colorField('th-borders', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
135
|
+
colorField('td-borders', 'oklch(0.145 0 0)', 'oklch(0.985 0 0)'),
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: 'group',
|
|
142
|
+
name: 'proseStyles',
|
|
143
|
+
fields: [
|
|
144
|
+
typeographyField('default', 'The default typography styles applied with "prose".'),
|
|
145
|
+
typeographyField('sm', 'This size applies to small screens and above with "prose prose-sm".'),
|
|
146
|
+
typeographyField('base', 'This size applies to base screens and above with "prose prose-base".'),
|
|
147
|
+
typeographyField('lg', 'This size applies to large screens and above with "prose prose-lg".'),
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Tab } from 'payload'
|
|
2
|
+
import { APField } from '@/fields/apf'
|
|
3
|
+
import { ActiveField } from '@/fields/active'
|
|
4
|
+
import { TestPathField } from '@/fields/testPath'
|
|
5
|
+
import { ClassNameField } from '@/fields/className'
|
|
6
|
+
import { UniqueTitleField } from '@/fields/uniqueTitle'
|
|
7
|
+
|
|
8
|
+
const d = {
|
|
9
|
+
htmlClassName:
|
|
10
|
+
'These are the atomic classes and shortcuts that are applied to the html element. Note that changing will unset the live previews selected theme(dark/light), ctrl + r will fix that.',
|
|
11
|
+
bodyClassName: 'These are the atomic classes and shortcuts that are applied to the body element. Typically used for a background color.',
|
|
12
|
+
wrapperClassName:
|
|
13
|
+
'The wrapper goes around header, main, and footer. It supplies styles to the entire site. But is required for dialogs and popovers to work. Isolate will automatically be added to the beginning of the class name if not included.',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const SettingsTab = () => {
|
|
17
|
+
const settingsField: Tab = {
|
|
18
|
+
label: 'Settings',
|
|
19
|
+
fields: [
|
|
20
|
+
{ type: 'row', fields: [ActiveField(), UniqueTitleField('New Design Set'), TestPathField] },
|
|
21
|
+
{
|
|
22
|
+
type: 'row',
|
|
23
|
+
fields: [
|
|
24
|
+
APField({
|
|
25
|
+
type: 'checkbox',
|
|
26
|
+
apf: ['classes'],
|
|
27
|
+
name: 'minify',
|
|
28
|
+
label: 'Minify CSS',
|
|
29
|
+
required: true,
|
|
30
|
+
defaultValue: true,
|
|
31
|
+
admin: { style: { maxWidth: '100px', alignSelf: 'center' } },
|
|
32
|
+
}),
|
|
33
|
+
//TODO: Add enableSystem checkbox for next themes
|
|
34
|
+
APField({
|
|
35
|
+
name: 'defaultTheme',
|
|
36
|
+
type: 'select',
|
|
37
|
+
apf: ['classes'],
|
|
38
|
+
required: true,
|
|
39
|
+
defaultValue: 'light',
|
|
40
|
+
options: ['light', 'dark'],
|
|
41
|
+
admin: { style: { maxWidth: '300px' } },
|
|
42
|
+
}),
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
ClassNameField({ namePrefix: 'html', label: 'HTML Class Name', admin: { description: d.htmlClassName } }),
|
|
46
|
+
ClassNameField({ namePrefix: 'body', label: 'Body Class Name', admin: { description: d.bodyClassName } }),
|
|
47
|
+
ClassNameField({ namePrefix: 'wrapper', label: 'Wrapper Class Name', admin: { description: d.wrapperClassName } }),
|
|
48
|
+
],
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return settingsField
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Tab } from 'payload'
|
|
2
|
+
import { TokenValueArrayField } from '../../../fields/designSets/value'
|
|
3
|
+
|
|
4
|
+
export const SizesTab = () => {
|
|
5
|
+
const sizesField: Tab = {
|
|
6
|
+
label: 'Sizes',
|
|
7
|
+
fields: [
|
|
8
|
+
TokenValueArrayField('container'),
|
|
9
|
+
TokenValueArrayField('breakpoint', {
|
|
10
|
+
description: 'The breakpoint values to apply to the breakpoint css variable.',
|
|
11
|
+
defaultValue: [
|
|
12
|
+
{ name: '3xl', value: '100rem' },
|
|
13
|
+
{ name: '4xl', value: '125rem' },
|
|
14
|
+
],
|
|
15
|
+
}),
|
|
16
|
+
TokenValueArrayField('spacing'),
|
|
17
|
+
TokenValueArrayField('radius', {
|
|
18
|
+
description: 'The radius values to apply to the radius css variable.',
|
|
19
|
+
defaultValue: [
|
|
20
|
+
{ name: 'sm', value: 'calc(var(--radius) - 4px)' },
|
|
21
|
+
{ name: 'md', value: 'calc(var(--radius) - 2px)' },
|
|
22
|
+
{ name: 'lg', value: 'var(--radius)' },
|
|
23
|
+
{ name: 'xl', value: 'calc(var(--radius) + 4px)' },
|
|
24
|
+
],
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return sizesField
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from '@/ts/zap'
|
|
2
|
+
import { type Tab } from 'payload'
|
|
3
|
+
import { unoThemeAnimation } from './animation'
|
|
4
|
+
|
|
5
|
+
export const tokenStorage = z.ap.add(
|
|
6
|
+
z.object({
|
|
7
|
+
font: z.ap.get('RSS'),
|
|
8
|
+
aria: z.ap.get('RSS'),
|
|
9
|
+
perspective: z.ap.get('RSS'),
|
|
10
|
+
blur: z.ap.get('RSS'),
|
|
11
|
+
media: z.ap.get('RSS'),
|
|
12
|
+
supports: z.ap.get('RSS'),
|
|
13
|
+
ease: z.ap.get('RSS'),
|
|
14
|
+
property: z.ap.get('RSS'),
|
|
15
|
+
container: z.ap.get('RSS'),
|
|
16
|
+
breakpoint: z.ap.get('RSS'),
|
|
17
|
+
spacing: z.ap.get('RSS'),
|
|
18
|
+
radius: z.ap.get('RSS'),
|
|
19
|
+
fontWeight: z.ap.get('RSS'),
|
|
20
|
+
tracking: z.ap.get('RSS'),
|
|
21
|
+
leading: z.ap.get('RSS'),
|
|
22
|
+
textStrokeWidth: z.ap.get('RSS'),
|
|
23
|
+
variables: z.ap.get('RSS'),
|
|
24
|
+
shadow: z.ap.get('RSSOSA'),
|
|
25
|
+
insetShadow: z.ap.get('RSSOSA'),
|
|
26
|
+
dropShadow: z.ap.get('RSSOSA'),
|
|
27
|
+
textShadow: z.ap.get('RSSOSA'),
|
|
28
|
+
colors: z.ap.get('UnoColors'),
|
|
29
|
+
animation: z.ap.get('UnoThemeAnimation', unoThemeAnimation),
|
|
30
|
+
}),
|
|
31
|
+
{ id: 'TokenStorage' },
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
export const ColorRecordSchema = z.ap.add(z.record(z.string(), z.tuple([z.string(), z.string()])), { id: 'ProseColorStorage' })
|
|
35
|
+
|
|
36
|
+
export const StorageTab = () => {
|
|
37
|
+
const storageField: Tab = {
|
|
38
|
+
label: 'Storage',
|
|
39
|
+
fields: [
|
|
40
|
+
{ name: 'preflightStorage', type: 'code', admin: { language: 'css', readOnly: true } },
|
|
41
|
+
{ name: 'tokenStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/TokenStorage` })] },
|
|
42
|
+
{ name: 'proseDefaultStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/RSRSS` })] },
|
|
43
|
+
{ name: 'prosesmStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/RSRSS` })] },
|
|
44
|
+
{ name: 'proseBaseStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/RSRSS` })] },
|
|
45
|
+
{ name: 'proselgStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/RSRSS` })] },
|
|
46
|
+
{ name: 'proseColorStorage', type: 'json', admin: { readOnly: true }, typescriptSchema: [() => ({ $ref: `#/definitions/ProseColorStorage` })] },
|
|
47
|
+
],
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return storageField
|
|
51
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Tab } from 'payload'
|
|
2
|
+
import { APField } from '@/fields/apf'
|
|
3
|
+
import { TokenValueArrayField } from '@/fields/designSets/value'
|
|
4
|
+
|
|
5
|
+
export const VariablesTab = () => {
|
|
6
|
+
const variablesField: Tab = {
|
|
7
|
+
label: 'Variables',
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
type: 'group',
|
|
11
|
+
name: 'defaults',
|
|
12
|
+
admin: { hideGutter: true, description: 'Sets the value for the corresponding css variable.' },
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
type: 'row',
|
|
16
|
+
fields: [
|
|
17
|
+
APField({ type: 'text', apf: ['classes'], name: 'spacing', defaultValue: '0.25rem', admin: { width: '25%' } }),
|
|
18
|
+
APField({ type: 'text', apf: ['classes'], name: 'radius', defaultValue: '0.625rem', admin: { width: '25%' } }),
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
TokenValueArrayField('variables', { description: 'CSS Variables that can be used anywhere. Creates an inline class as well.' }),
|
|
24
|
+
],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return variablesField
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { anyone } from '@/access/anyone'
|
|
2
|
+
import { authd } from '@/access/authenticated'
|
|
3
|
+
import type { CollectionConfig } from 'payload'
|
|
4
|
+
|
|
5
|
+
export const Favicons: CollectionConfig = {
|
|
6
|
+
slug: 'favicons',
|
|
7
|
+
access: { create: authd, delete: authd, read: anyone, update: authd },
|
|
8
|
+
admin: { group: 'Assets', enableListViewSelectAPI: true },
|
|
9
|
+
fields: [],
|
|
10
|
+
upload: { adminThumbnail: 'thumbnail', mimeTypes: ['image/x-icon'] },
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { authd } from '@/access/authenticated'
|
|
2
|
+
import type { CollectionConfig } from 'payload'
|
|
3
|
+
|
|
4
|
+
export const Font: CollectionConfig = {
|
|
5
|
+
slug: 'font',
|
|
6
|
+
access: { create: authd, delete: authd, read: authd, update: authd },
|
|
7
|
+
admin: { group: 'Assets', useAsTitle: 'title', enableListViewSelectAPI: true, defaultColumns: ['title', 'family'] },
|
|
8
|
+
fields: [
|
|
9
|
+
{ name: 'title', type: 'text', required: true },
|
|
10
|
+
{
|
|
11
|
+
name: 'family',
|
|
12
|
+
type: 'radio',
|
|
13
|
+
required: true,
|
|
14
|
+
label: 'Preferred Family',
|
|
15
|
+
interfaceName: 'GenericFontFamily',
|
|
16
|
+
options: ['sans', 'serif', 'mono', 'display'],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
upload: { mimeTypes: ['font/ttf', 'font/woff', 'font/woff2', 'font/otf'] },
|
|
20
|
+
}
|