@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,32 @@
|
|
|
1
|
+
//Atomic Payload Fields (apf)
|
|
2
|
+
export const APFieldPath = '@/ui/apf/field'
|
|
3
|
+
export const APFieldLabelPath = '@/ui/apf/label'
|
|
4
|
+
export const APFControlsPath = '@/ui/apf/controls'
|
|
5
|
+
|
|
6
|
+
//Assets
|
|
7
|
+
export const LogoPath = '@/ui/assets/Logo'
|
|
8
|
+
export const IconPath = '@/ui/assets/Icon'
|
|
9
|
+
|
|
10
|
+
//Blocks
|
|
11
|
+
export const InputBlocksPath = '@/ui/blocks/inputBlock'
|
|
12
|
+
export const ActionBlocksPath = '@/ui/blocks/actionBlock'
|
|
13
|
+
|
|
14
|
+
//Decorative
|
|
15
|
+
export const ColoredEndPath = '@/ui/decorative/coloredEnd'
|
|
16
|
+
|
|
17
|
+
//Fields
|
|
18
|
+
export const SlugPath = '@/ui/fields/slug'
|
|
19
|
+
export const IconSelectPath = '@/ui/fields/iconSelect'
|
|
20
|
+
|
|
21
|
+
//Root
|
|
22
|
+
export const BeforeDashboard = '@/ui/root/beforeDashboard'
|
|
23
|
+
export const SiteTriggersPath = '@/ui/root/siteTriggers'
|
|
24
|
+
|
|
25
|
+
//Row Labels
|
|
26
|
+
export const AtomicPath = '@/ui/rowLabels/atomic'
|
|
27
|
+
export const IconLabelPath = '@/ui/rowLabels/icon'
|
|
28
|
+
export const ColorLabelPath = '@/ui/rowLabels/color'
|
|
29
|
+
export const ShortcutLabelPath = '@/ui/rowLabels/shortcut'
|
|
30
|
+
export const AnimationLabelPath = '@/ui/rowLabels/animation'
|
|
31
|
+
export const SimpleTextLabelPath = '@/ui/rowLabels/simpleText'
|
|
32
|
+
export const DesignTokenLabelPath = '@/ui/rowLabels/designToken'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.dashboard .before-dashboard {
|
|
2
|
+
margin-bottom: base(1.5);
|
|
3
|
+
|
|
4
|
+
&__banner {
|
|
5
|
+
& h4 {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__instructions {
|
|
11
|
+
list-style: decimal;
|
|
12
|
+
margin-bottom: base(0.5);
|
|
13
|
+
|
|
14
|
+
& li {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
& a:hover {
|
|
20
|
+
opacity: 0.85;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Banner } from '@payloadcms/ui/elements/Banner'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { SeedButton } from './seedButton'
|
|
5
|
+
import './index.scss'
|
|
6
|
+
|
|
7
|
+
const baseClass = 'before-dashboard'
|
|
8
|
+
|
|
9
|
+
const BeforeDashboard: React.FC = () => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={baseClass}>
|
|
12
|
+
<Banner className={`${baseClass}__banner`} type="success">
|
|
13
|
+
<h4>Welcome to your dashboard!</h4>
|
|
14
|
+
</Banner>
|
|
15
|
+
Steps For Set Up:
|
|
16
|
+
<ul className={`${baseClass}__instructions`}>
|
|
17
|
+
<li>
|
|
18
|
+
{'If you want to add some initial data click: '}
|
|
19
|
+
<SeedButton />
|
|
20
|
+
{'. (Note this will delete existing collection data)'}
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
{'Check out the home page: '}
|
|
24
|
+
<a href="/" target="_blank">
|
|
25
|
+
Link
|
|
26
|
+
</a>
|
|
27
|
+
</li>
|
|
28
|
+
<li>
|
|
29
|
+
{'Return To ReadMe Setup Steps: '}
|
|
30
|
+
<a href="https://github.com/pro-laico/atomic-payload" target="_blank">
|
|
31
|
+
Link
|
|
32
|
+
</a>
|
|
33
|
+
</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default BeforeDashboard
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { Fragment, useCallback, useState } from 'react'
|
|
4
|
+
import { toast } from '@payloadcms/ui'
|
|
5
|
+
|
|
6
|
+
import './index.scss'
|
|
7
|
+
|
|
8
|
+
const SuccessMessage: React.FC = () => (
|
|
9
|
+
<div>
|
|
10
|
+
Database seeded! You can now{' '}
|
|
11
|
+
<a target="_blank" href="/">
|
|
12
|
+
visit your website
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
export const SeedButton: React.FC = () => {
|
|
18
|
+
const [loading, setLoading] = useState(false)
|
|
19
|
+
const [seeded, setSeeded] = useState(false)
|
|
20
|
+
const [error, setError] = useState<null | string>(null)
|
|
21
|
+
|
|
22
|
+
const handleClick = useCallback(
|
|
23
|
+
async (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
24
|
+
e.preventDefault()
|
|
25
|
+
|
|
26
|
+
if (seeded) {
|
|
27
|
+
toast.info('Database already seeded.')
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
if (loading) {
|
|
31
|
+
toast.info('Seeding already in progress.')
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
if (error) {
|
|
35
|
+
toast.error(`An error occurred, please refresh and try again.`)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setLoading(true)
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
toast.promise(
|
|
43
|
+
new Promise((resolve, reject) => {
|
|
44
|
+
try {
|
|
45
|
+
fetch('/next/seed', { method: 'POST', credentials: 'include' })
|
|
46
|
+
.then((res) => {
|
|
47
|
+
if (res.ok) {
|
|
48
|
+
resolve(true)
|
|
49
|
+
setSeeded(true)
|
|
50
|
+
} else reject('An error occurred while seeding.')
|
|
51
|
+
})
|
|
52
|
+
.catch((error) => reject(error))
|
|
53
|
+
} catch (error) {
|
|
54
|
+
reject(error)
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
{
|
|
58
|
+
loading: 'Seeding with data....',
|
|
59
|
+
success: <SuccessMessage />,
|
|
60
|
+
error: 'An error occurred while seeding.',
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
} catch (err) {
|
|
64
|
+
const error = err instanceof Error ? err.message : String(err)
|
|
65
|
+
setError(error)
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[loading, seeded, error],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
let message = ''
|
|
72
|
+
if (loading) message = ' (seeding...)'
|
|
73
|
+
if (seeded) message = ' (done!)'
|
|
74
|
+
if (error) message = ` (error: ${error})`
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Fragment>
|
|
78
|
+
<button className="seedButton" onClick={handleClick}>
|
|
79
|
+
SEED DATABASE
|
|
80
|
+
</button>
|
|
81
|
+
{message}
|
|
82
|
+
</Fragment>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.full-width-button {
|
|
2
|
+
width: 100% !important;
|
|
3
|
+
justify-content: space-between !important;
|
|
4
|
+
text-align: left !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.full-width-button .btn__content {
|
|
8
|
+
width: 100% !important;
|
|
9
|
+
display: flex !important;
|
|
10
|
+
justify-content: space-between !important;
|
|
11
|
+
align-items: center !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.full-width-button .btn__label {
|
|
15
|
+
flex: 1 !important;
|
|
16
|
+
text-align: left !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.full-width-button .btn__icon {
|
|
20
|
+
margin-left: auto !important;
|
|
21
|
+
flex-shrink: 0 !important;
|
|
22
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import './index.scss'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { UIFieldClientComponent } from 'payload'
|
|
5
|
+
import { revalidateTag } from '@/utilities/revalidateTag'
|
|
6
|
+
import { Button, toast, PopupList } from '@payloadcms/ui'
|
|
7
|
+
import { triggerVercelDeployServerFunction } from './triggerVercelDeploy'
|
|
8
|
+
|
|
9
|
+
const SiteTriggers: UIFieldClientComponent = () => {
|
|
10
|
+
const [isDeploying, setIsDeploying] = useState(false)
|
|
11
|
+
const [isRevalidating, setIsRevalidating] = useState(false)
|
|
12
|
+
|
|
13
|
+
const handleRevalidate = async (tag: 'draft' | 'published') => {
|
|
14
|
+
setIsRevalidating(true)
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const result = await revalidateTag(tag)
|
|
18
|
+
if (result?.success) toast.success(result.message)
|
|
19
|
+
else if (result) toast.error(result.message)
|
|
20
|
+
} catch (error) {
|
|
21
|
+
toast.error(error instanceof Error ? error.message : 'An unexpected error occurred')
|
|
22
|
+
} finally {
|
|
23
|
+
setIsRevalidating(false)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const handleDeploy = async () => {
|
|
28
|
+
setIsDeploying(true)
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const result = await triggerVercelDeployServerFunction()
|
|
32
|
+
if (result.success) toast.success(result.message)
|
|
33
|
+
else toast.error(result.message)
|
|
34
|
+
} catch (error) {
|
|
35
|
+
toast.error(error instanceof Error ? error.message : 'An unexpected error occurred')
|
|
36
|
+
} finally {
|
|
37
|
+
setIsDeploying(false)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<div style={{ marginLeft: '-10px', marginBottom: '10px' }}>
|
|
44
|
+
<Button
|
|
45
|
+
buttonStyle="none"
|
|
46
|
+
disabled={isRevalidating || isDeploying}
|
|
47
|
+
SubMenuPopupContent={({ close }) => (
|
|
48
|
+
<PopupList.ButtonGroup>
|
|
49
|
+
<PopupList.Button
|
|
50
|
+
onClick={() => {
|
|
51
|
+
handleRevalidate('draft')
|
|
52
|
+
close()
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
Revalidate Drafts
|
|
56
|
+
</PopupList.Button>
|
|
57
|
+
<PopupList.Button
|
|
58
|
+
onClick={() => {
|
|
59
|
+
handleRevalidate('published')
|
|
60
|
+
close()
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
Revalidate Published
|
|
64
|
+
</PopupList.Button>
|
|
65
|
+
<PopupList.Button
|
|
66
|
+
onClick={() => {
|
|
67
|
+
handleDeploy()
|
|
68
|
+
close()
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
Trigger Deploy
|
|
72
|
+
</PopupList.Button>
|
|
73
|
+
</PopupList.ButtonGroup>
|
|
74
|
+
)}
|
|
75
|
+
>
|
|
76
|
+
{isRevalidating ? 'Revalidating...' : isDeploying ? 'Deploying...' : 'Site Actions'}
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
<div
|
|
80
|
+
style={{
|
|
81
|
+
height: '1px',
|
|
82
|
+
marginLeft: '-20px',
|
|
83
|
+
width: 'calc(100% + 40px)',
|
|
84
|
+
backgroundColor: 'var(--theme-elevation-200)',
|
|
85
|
+
marginBottom: '15px',
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
</>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
SiteTriggers.displayName = 'SiteTriggers'
|
|
93
|
+
|
|
94
|
+
export default SiteTriggers
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use server'
|
|
2
|
+
|
|
3
|
+
export async function triggerVercelDeployServerFunction(): Promise<{
|
|
4
|
+
success: boolean
|
|
5
|
+
message: string
|
|
6
|
+
timestamp: string
|
|
7
|
+
}> {
|
|
8
|
+
try {
|
|
9
|
+
const webhookUrl = process.env.VERCEL_DEPLOY_WEBHOOK_URL
|
|
10
|
+
|
|
11
|
+
if (!webhookUrl) {
|
|
12
|
+
throw new Error('VERCEL_DEPLOY_WEBHOOK_URL environment variable is not configured')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const response = await fetch(webhookUrl, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: { 'Content-Type': 'application/json' },
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error(`Webhook request failed with status: ${response.status}`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
success: true,
|
|
26
|
+
message: 'Vercel deploy webhook triggered successfully',
|
|
27
|
+
timestamp: new Date().toISOString(),
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('Failed to trigger Vercel deploy:', error)
|
|
31
|
+
return {
|
|
32
|
+
success: false,
|
|
33
|
+
message: error instanceof Error ? error.message : 'Failed to trigger Vercel deploy',
|
|
34
|
+
timestamp: new Date().toISOString(),
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useRowLabel, RowLabel, Pill, SectionTitle } from '@payloadcms/ui'
|
|
3
|
+
|
|
4
|
+
const AnimationRowLabel = () => {
|
|
5
|
+
const { data, path, rowNumber } = useRowLabel<{ [key: string]: string }>()
|
|
6
|
+
const formattedRowNumber = String(rowNumber ?? 0).padStart(2, '0')
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<RowLabel
|
|
10
|
+
path={path}
|
|
11
|
+
rowNumber={rowNumber}
|
|
12
|
+
label={
|
|
13
|
+
<>
|
|
14
|
+
<span>{formattedRowNumber}</span>
|
|
15
|
+
<Pill pillStyle="white" size="small">
|
|
16
|
+
{data?.name}
|
|
17
|
+
</Pill>
|
|
18
|
+
<SectionTitle path={`${path}.name`} readOnly={true} />
|
|
19
|
+
</>
|
|
20
|
+
}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
AnimationRowLabel.displayName = 'AnimationRowLabel'
|
|
26
|
+
|
|
27
|
+
export default AnimationRowLabel
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.atomic-row-pill {
|
|
2
|
+
border-radius: 3px;
|
|
3
|
+
display:inline-flex;
|
|
4
|
+
font-weight:500;
|
|
5
|
+
align-items: center;
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
padding: 0 10px 0 10px;
|
|
8
|
+
text-transform: capitalize;
|
|
9
|
+
color: var(--theme-elevation-900);
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
text-overflow: ellipsis;
|
|
13
|
+
max-width: 150px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.nocap {
|
|
17
|
+
text-transform: none !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.pill-default {
|
|
21
|
+
background: var(--theme-elevation-0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pill-name {
|
|
25
|
+
background: var(--theme-base-0);
|
|
26
|
+
text-decoration: underline;
|
|
27
|
+
text-underline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
.pill-tag {
|
|
32
|
+
background: color-mix(
|
|
33
|
+
in oklch,
|
|
34
|
+
var(--atomic-distinct-1),
|
|
35
|
+
black 25%
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pill-form {
|
|
40
|
+
background: color-mix(
|
|
41
|
+
in oklch,
|
|
42
|
+
var(--atomic-distinct-2),
|
|
43
|
+
black 8%
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pill-input {
|
|
48
|
+
background: color-mix(
|
|
49
|
+
in oklch,
|
|
50
|
+
var(--atomic-distinct-3),
|
|
51
|
+
black 8%
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pill-button {
|
|
56
|
+
background: color-mix(
|
|
57
|
+
in oklch,
|
|
58
|
+
var(--atomic-distinct-4),
|
|
59
|
+
black 16%
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import './index.scss'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { AtomicChild } from '@/ts/types'
|
|
5
|
+
import { AtomicIcon } from '@/ui/assets/atomicIcon'
|
|
6
|
+
import { RowLabel, useRowLabel, SectionTitle } from '@payloadcms/ui'
|
|
7
|
+
|
|
8
|
+
const AtomicRowLabel = () => {
|
|
9
|
+
const { data, path, rowNumber } = useRowLabel<AtomicChild>()
|
|
10
|
+
const { type, tagType, inputType, inputName, buttonType, backendForm, portalType, formName, linkType, portalName, externalLink, email, phone } =
|
|
11
|
+
data || {}
|
|
12
|
+
|
|
13
|
+
let typePill = type
|
|
14
|
+
const typePillStyle = 'atomic-row-pill pill-default'
|
|
15
|
+
let elaborationPill
|
|
16
|
+
let elaborationPillStyle = 'atomic-row-pill pill-default'
|
|
17
|
+
let namePill
|
|
18
|
+
const namePillStyle = 'atomic-row-pill pill-name nocap'
|
|
19
|
+
switch (type) {
|
|
20
|
+
case 'tag': {
|
|
21
|
+
typePill = type
|
|
22
|
+
elaborationPill = tagType
|
|
23
|
+
elaborationPillStyle = 'atomic-row-pill pill-tag'
|
|
24
|
+
break
|
|
25
|
+
}
|
|
26
|
+
case 'form': {
|
|
27
|
+
elaborationPill = backendForm
|
|
28
|
+
elaborationPillStyle = 'atomic-row-pill pill-form'
|
|
29
|
+
namePill = formName
|
|
30
|
+
break
|
|
31
|
+
}
|
|
32
|
+
case 'input': {
|
|
33
|
+
elaborationPill = inputType
|
|
34
|
+
elaborationPillStyle = 'atomic-row-pill pill-input'
|
|
35
|
+
namePill = inputName
|
|
36
|
+
break
|
|
37
|
+
}
|
|
38
|
+
case 'button': {
|
|
39
|
+
elaborationPillStyle = 'atomic-row-pill pill-button'
|
|
40
|
+
switch (buttonType) {
|
|
41
|
+
case 'regular': {
|
|
42
|
+
elaborationPill = 'Regular'
|
|
43
|
+
break
|
|
44
|
+
}
|
|
45
|
+
case 'link': {
|
|
46
|
+
elaborationPill = linkType
|
|
47
|
+
switch (linkType) {
|
|
48
|
+
case 'email': {
|
|
49
|
+
namePill = email
|
|
50
|
+
break
|
|
51
|
+
}
|
|
52
|
+
case 'externalLink': {
|
|
53
|
+
namePill = externalLink
|
|
54
|
+
break
|
|
55
|
+
}
|
|
56
|
+
case 'phone': {
|
|
57
|
+
namePill = phone
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
}
|
|
63
|
+
case 'portal': {
|
|
64
|
+
elaborationPill = portalType
|
|
65
|
+
namePill = portalName
|
|
66
|
+
break
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
break
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const formattedRowNumber = String(rowNumber ?? 0).padStart(2, '0')
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<RowLabel
|
|
77
|
+
path={path}
|
|
78
|
+
rowNumber={rowNumber}
|
|
79
|
+
label={
|
|
80
|
+
<div style={{ display: 'flex', gap: '6px' }}>
|
|
81
|
+
<span>{formattedRowNumber}</span>
|
|
82
|
+
<AtomicIcon type={type || 'fragment'} />
|
|
83
|
+
<div style={{ display: 'flex', gap: '6px' }}>
|
|
84
|
+
{typePill && <div className={typePillStyle}>{typePill}</div>}
|
|
85
|
+
{elaborationPill && <div className={elaborationPillStyle}>{elaborationPill}</div>}
|
|
86
|
+
{namePill && <div className={namePillStyle}>{namePill}</div>}
|
|
87
|
+
</div>
|
|
88
|
+
<SectionTitle path={`${path}.blockName`} readOnly={false} />
|
|
89
|
+
</div>
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
AtomicRowLabel.displayName = 'AtomicRowLabel'
|
|
96
|
+
export default AtomicRowLabel
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useRowLabel, RowLabel, Pill } from '@payloadcms/ui'
|
|
3
|
+
import { toTitleCase } from '@/utilities/format/toTitleCase'
|
|
4
|
+
|
|
5
|
+
const ColorRowLabel = () => {
|
|
6
|
+
const { data, path, rowNumber } = useRowLabel<{ [key: string]: string }>()
|
|
7
|
+
const { name, light, dark } = data
|
|
8
|
+
|
|
9
|
+
const formattedRowNumber = String(rowNumber ?? 0).padStart(2, '0')
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<RowLabel
|
|
13
|
+
path={path}
|
|
14
|
+
rowNumber={rowNumber}
|
|
15
|
+
label={
|
|
16
|
+
<>
|
|
17
|
+
<span>{formattedRowNumber}</span>
|
|
18
|
+
{light && <div style={{ width: '40px', height: '20px', backgroundColor: light, display: 'inline-block', flexShrink: 0 }} />}
|
|
19
|
+
{dark && <div style={{ width: '40px', height: '20px', backgroundColor: dark, display: 'inline-block', flexShrink: 0 }} />}
|
|
20
|
+
{name && (
|
|
21
|
+
<Pill pillStyle="white" size="small">
|
|
22
|
+
{toTitleCase(name)}
|
|
23
|
+
</Pill>
|
|
24
|
+
)}
|
|
25
|
+
</>
|
|
26
|
+
}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ColorRowLabel.displayName = 'ColorRowLabel'
|
|
32
|
+
|
|
33
|
+
export default ColorRowLabel
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useRowLabel, Pill, SectionTitle } from '@payloadcms/ui'
|
|
3
|
+
|
|
4
|
+
interface DesignTokenData {
|
|
5
|
+
name: string
|
|
6
|
+
value: string | string[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const DesignTokenRowLabel = () => {
|
|
10
|
+
const { data, path } = useRowLabel<DesignTokenData>()
|
|
11
|
+
const { name, value } = data || {}
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Pill pillStyle="white" size="small">
|
|
16
|
+
{name || 'Add Name'}
|
|
17
|
+
</Pill>
|
|
18
|
+
{typeof value === 'string' && <SectionTitle path={`${path}.value`} readOnly={false} />}
|
|
19
|
+
{Array.isArray(value) && (
|
|
20
|
+
<Pill pillStyle="white" size="small">
|
|
21
|
+
Values: {value?.length}
|
|
22
|
+
</Pill>
|
|
23
|
+
)}
|
|
24
|
+
</>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
DesignTokenRowLabel.displayName = 'DesignTokenRowLabel'
|
|
29
|
+
|
|
30
|
+
export default DesignTokenRowLabel
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Icon } from '@/ts/types'
|
|
3
|
+
import { Pill, RowLabel, useRowLabel } from '@payloadcms/ui'
|
|
4
|
+
import { toTitleCase } from '@/utilities/format/toTitleCase'
|
|
5
|
+
|
|
6
|
+
interface IconData {
|
|
7
|
+
name: string
|
|
8
|
+
icon: string | Icon
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const IconRowLabel = () => {
|
|
12
|
+
const { data, path, rowNumber } = useRowLabel<IconData>()
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<RowLabel
|
|
16
|
+
path={path}
|
|
17
|
+
rowNumber={rowNumber}
|
|
18
|
+
label={
|
|
19
|
+
<>
|
|
20
|
+
<span>{rowNumber}</span>
|
|
21
|
+
<Pill pillStyle="white" size="small">
|
|
22
|
+
{toTitleCase(data?.name) || 'Add Name'}
|
|
23
|
+
</Pill>
|
|
24
|
+
</>
|
|
25
|
+
}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
IconRowLabel.displayName = 'IconRowLabel'
|
|
31
|
+
|
|
32
|
+
export default IconRowLabel
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.shortcut-pill {
|
|
2
|
+
text-transform: capitalize;
|
|
3
|
+
font-weight: 500;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* cycle through five rich dark colors for white text contrast */
|
|
7
|
+
.color-cycle:nth-child(5n) {
|
|
8
|
+
background: rgb(22, 101, 52); /* Deep green */
|
|
9
|
+
}
|
|
10
|
+
.color-cycle:nth-child(5n + 1) {
|
|
11
|
+
background: rgb(30, 64, 175); /* Deep blue */
|
|
12
|
+
}
|
|
13
|
+
.color-cycle:nth-child(5n + 2) {
|
|
14
|
+
background: rgb(22, 101, 52); /* Deep green */
|
|
15
|
+
}
|
|
16
|
+
.color-cycle:nth-child(5n + 3) {
|
|
17
|
+
background: rgb(88, 28, 135); /* Deep purple */
|
|
18
|
+
}
|
|
19
|
+
.color-cycle:nth-child(5n + 4) {
|
|
20
|
+
background: rgb(153, 27, 27); /* Deep red */
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import './index.scss'
|
|
3
|
+
import { useMemo } from 'react'
|
|
4
|
+
import { ShortcutSet } from '@/ts/types'
|
|
5
|
+
import { Pill, RowLabel, useRowLabel } from '@payloadcms/ui'
|
|
6
|
+
|
|
7
|
+
const ShortcutRowLabel = () => {
|
|
8
|
+
const { data, path, rowNumber } = useRowLabel<ShortcutSet['shortcuts'][number]>()
|
|
9
|
+
const { name } = data
|
|
10
|
+
|
|
11
|
+
const namePills = useMemo(() => {
|
|
12
|
+
if (!name) return null
|
|
13
|
+
const namePieces = name.split('-')
|
|
14
|
+
|
|
15
|
+
return namePieces.map((piece, index) => {
|
|
16
|
+
return (
|
|
17
|
+
<Pill className="shortcut-pill color-cycle" key={index} pillStyle="white" size="small">
|
|
18
|
+
{piece}
|
|
19
|
+
</Pill>
|
|
20
|
+
)
|
|
21
|
+
})
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
}, [name, rowNumber])
|
|
24
|
+
|
|
25
|
+
return <RowLabel path={path} rowNumber={rowNumber} label={namePills} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ShortcutRowLabel.displayName = 'ShortcutRowLabel'
|
|
29
|
+
|
|
30
|
+
export default ShortcutRowLabel
|