@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.
Files changed (423) hide show
  1. package/bin/cli.js +159 -0
  2. package/package.json +29 -0
  3. package/template/.env.example +35 -0
  4. package/template/.gitattributes +2 -0
  5. package/template/.prettierrc.json +6 -0
  6. package/template/.vscode/extensions.json +3 -0
  7. package/template/.vscode/launch.json +24 -0
  8. package/template/.vscode/settings.json +86 -0
  9. package/template/.yarnrc +1 -0
  10. package/template/LICENSE.md +22 -0
  11. package/template/README.md +128 -0
  12. package/template/eslint.config.mjs +32 -0
  13. package/template/next-env.d.ts +6 -0
  14. package/template/next.config.ts +36 -0
  15. package/template/package.json +75 -0
  16. package/template/public/adminFavicon.svg +1 -0
  17. package/template/public/ogImage.webp +0 -0
  18. package/template/src/access/anyone.ts +3 -0
  19. package/template/src/access/authenticated.ts +7 -0
  20. package/template/src/access/authenticatedOrPublished.ts +6 -0
  21. package/template/src/app/(frontend)/[...slug]/page.tsx +48 -0
  22. package/template/src/app/(frontend)/layout.tsx +49 -0
  23. package/template/src/app/(frontend)/next/exit-preview/route.ts +7 -0
  24. package/template/src/app/(frontend)/next/preview/route.ts +45 -0
  25. package/template/src/app/(frontend)/next/seed/route.ts +31 -0
  26. package/template/src/app/(frontend)/not-found.tsx +93 -0
  27. package/template/src/app/(frontend)/page.tsx +5 -0
  28. package/template/src/app/(frontend)/sitemap.ts +14 -0
  29. package/template/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
  30. package/template/src/app/(payload)/admin/[[...segments]]/page.tsx +24 -0
  31. package/template/src/app/(payload)/admin/importMap.js +85 -0
  32. package/template/src/app/(payload)/api/[...slug]/route.ts +19 -0
  33. package/template/src/app/(payload)/custom.scss +29 -0
  34. package/template/src/app/(payload)/layout.tsx +31 -0
  35. package/template/src/blocks/actions/blocks.ts +27 -0
  36. package/template/src/blocks/actions/cookieConsent/set/block.ts +17 -0
  37. package/template/src/blocks/actions/cookieConsent/set/filter.ts +3 -0
  38. package/template/src/blocks/actions/cookieConsent/set/options.ts +35 -0
  39. package/template/src/blocks/actions/cookieConsent/toDA/block.ts +14 -0
  40. package/template/src/blocks/actions/cookieConsent/toDA/filter.ts +3 -0
  41. package/template/src/blocks/actions/cookieConsent/toDA/options.ts +19 -0
  42. package/template/src/blocks/actions/dynamicStore/boolean/set/block.ts +15 -0
  43. package/template/src/blocks/actions/dynamicStore/boolean/set/filter.ts +4 -0
  44. package/template/src/blocks/actions/dynamicStore/boolean/set/options.ts +18 -0
  45. package/template/src/blocks/actions/dynamicStore/boolean/toDA/block.ts +10 -0
  46. package/template/src/blocks/actions/dynamicStore/boolean/toDA/filter.ts +3 -0
  47. package/template/src/blocks/actions/dynamicStore/boolean/toDA/options.ts +12 -0
  48. package/template/src/blocks/actions/dynamicStore/text/cycle/block.ts +41 -0
  49. package/template/src/blocks/actions/dynamicStore/text/cycle/filter.ts +4 -0
  50. package/template/src/blocks/actions/dynamicStore/text/cycle/options.ts +23 -0
  51. package/template/src/blocks/actions/dynamicStore/text/toDA/block.ts +10 -0
  52. package/template/src/blocks/actions/dynamicStore/text/toDA/filter.ts +3 -0
  53. package/template/src/blocks/actions/dynamicStore/text/toDA/options.ts +12 -0
  54. package/template/src/blocks/actions/filters.ts +27 -0
  55. package/template/src/blocks/actions/form/errorToDA/block.ts +18 -0
  56. package/template/src/blocks/actions/form/errorToDA/filter.ts +3 -0
  57. package/template/src/blocks/actions/form/errorToDA/options.ts +15 -0
  58. package/template/src/blocks/actions/form/reset/block.ts +18 -0
  59. package/template/src/blocks/actions/form/reset/filter.ts +3 -0
  60. package/template/src/blocks/actions/form/reset/options.ts +30 -0
  61. package/template/src/blocks/actions/form/statusToDA/block.ts +12 -0
  62. package/template/src/blocks/actions/form/statusToDA/filter.ts +3 -0
  63. package/template/src/blocks/actions/form/statusToDA/options.ts +15 -0
  64. package/template/src/blocks/actions/form/submit/block.ts +18 -0
  65. package/template/src/blocks/actions/form/submit/filter.ts +3 -0
  66. package/template/src/blocks/actions/form/submit/options.ts +35 -0
  67. package/template/src/blocks/actions/portal/set/block.ts +25 -0
  68. package/template/src/blocks/actions/portal/set/filter.ts +3 -0
  69. package/template/src/blocks/actions/portal/set/options.ts +43 -0
  70. package/template/src/blocks/actions/processor.ts +263 -0
  71. package/template/src/blocks/actions/theme/set/block.ts +10 -0
  72. package/template/src/blocks/actions/theme/set/filter.ts +3 -0
  73. package/template/src/blocks/actions/theme/set/options.ts +9 -0
  74. package/template/src/blocks/actions/zap.ts +4 -0
  75. package/template/src/blocks/children/atomic/block.ts +123 -0
  76. package/template/src/blocks/children/atomic/controlBar.ts +43 -0
  77. package/template/src/blocks/children/atomic/variants/button/typeField.ts +16 -0
  78. package/template/src/blocks/children/atomic/variants/button/variants/link/component.client.tsx +21 -0
  79. package/template/src/blocks/children/atomic/variants/button/variants/link/component.tsx +13 -0
  80. package/template/src/blocks/children/atomic/variants/button/variants/link/controlBar.ts +73 -0
  81. package/template/src/blocks/children/atomic/variants/button/variants/link/settings.ts +26 -0
  82. package/template/src/blocks/children/atomic/variants/button/variants/portal/controlBar.ts +35 -0
  83. package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/component.tsx +36 -0
  84. package/template/src/blocks/children/atomic/variants/button/variants/portal/dialog/settings.ts +24 -0
  85. package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/component.tsx +41 -0
  86. package/template/src/blocks/children/atomic/variants/button/variants/portal/popover/settings.ts +111 -0
  87. package/template/src/blocks/children/atomic/variants/button/variants/regular/component.client.tsx +19 -0
  88. package/template/src/blocks/children/atomic/variants/button/variants/regular/component.tsx +11 -0
  89. package/template/src/blocks/children/atomic/variants/form/component.tsx +18 -0
  90. package/template/src/blocks/children/atomic/variants/form/controlBar.ts +22 -0
  91. package/template/src/blocks/children/atomic/variants/form/settings.ts +20 -0
  92. package/template/src/blocks/children/atomic/variants/input/autoCompleteOptions.ts +51 -0
  93. package/template/src/blocks/children/atomic/variants/input/controlBar.ts +13 -0
  94. package/template/src/blocks/children/atomic/variants/input/settings.ts +35 -0
  95. package/template/src/blocks/children/atomic/variants/input/typeField.ts +23 -0
  96. package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.client.tsx +12 -0
  97. package/template/src/blocks/children/atomic/variants/input/variants/checkBox/component.tsx +6 -0
  98. package/template/src/blocks/children/atomic/variants/input/variants/checkBox/settings.ts +9 -0
  99. package/template/src/blocks/children/atomic/variants/input/variants/number/component.client.tsx +12 -0
  100. package/template/src/blocks/children/atomic/variants/input/variants/number/component.tsx +6 -0
  101. package/template/src/blocks/children/atomic/variants/input/variants/number/settings.ts +9 -0
  102. package/template/src/blocks/children/atomic/variants/input/variants/radio/component.client.tsx +12 -0
  103. package/template/src/blocks/children/atomic/variants/input/variants/radio/component.tsx +6 -0
  104. package/template/src/blocks/children/atomic/variants/input/variants/radio/settings.ts +9 -0
  105. package/template/src/blocks/children/atomic/variants/input/variants/text/component.client.tsx +12 -0
  106. package/template/src/blocks/children/atomic/variants/input/variants/text/component.tsx +7 -0
  107. package/template/src/blocks/children/atomic/variants/input/variants/text/settings.ts +12 -0
  108. package/template/src/blocks/children/atomic/variants/tag/component.client.tsx +17 -0
  109. package/template/src/blocks/children/atomic/variants/tag/component.tsx +13 -0
  110. package/template/src/blocks/children/atomic/variants/tag/controlBar.ts +6 -0
  111. package/template/src/blocks/children/atomic/variants/tag/settings.ts +9 -0
  112. package/template/src/blocks/children/blocks.ts +13 -0
  113. package/template/src/blocks/children/icon/block.ts +41 -0
  114. package/template/src/blocks/children/icon/component.tsx +17 -0
  115. package/template/src/blocks/children/image/block.ts +80 -0
  116. package/template/src/blocks/children/image/component.tsx +21 -0
  117. package/template/src/blocks/children/richText/block.ts +50 -0
  118. package/template/src/blocks/children/richText/component/converters/index.tsx +10 -0
  119. package/template/src/blocks/children/richText/component/converters/internalLink.tsx +8 -0
  120. package/template/src/blocks/children/richText/component/index.tsx +10 -0
  121. package/template/src/blocks/children/richText/component.tsx +7 -0
  122. package/template/src/blocks/children/richText/defaultLexical.ts +65 -0
  123. package/template/src/blocks/children/simpleText/block.ts +41 -0
  124. package/template/src/blocks/children/simpleText/component.client.tsx +18 -0
  125. package/template/src/blocks/children/simpleText/component.tsx +11 -0
  126. package/template/src/blocks/children/svg/block.ts +39 -0
  127. package/template/src/blocks/children/svg/component.tsx +6 -0
  128. package/template/src/blocks/children/video/block.ts +70 -0
  129. package/template/src/blocks/children/video/component.tsx +11 -0
  130. package/template/src/blocks/children/zap.ts +54 -0
  131. package/template/src/blocks/submitForm/form/rateLimiting/blocks.ts +5 -0
  132. package/template/src/blocks/submitForm/form/rateLimiting/functions.ts +1 -0
  133. package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/block.ts +23 -0
  134. package/template/src/blocks/submitForm/form/rateLimiting/simpleSlidingWindow/serverFunction.ts +46 -0
  135. package/template/src/blocks/submitForm/form/sanitation/blocks.ts +6 -0
  136. package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/block.ts +19 -0
  137. package/template/src/blocks/submitForm/form/sanitation/combineTwoFields/serverFunction.ts +22 -0
  138. package/template/src/blocks/submitForm/form/sanitation/functions.ts +1 -0
  139. package/template/src/blocks/submitForm/form/validation/blocks.ts +6 -0
  140. package/template/src/blocks/submitForm/form/validation/functions.ts +1 -0
  141. package/template/src/blocks/submitForm/form/validation/isUnique/block.ts +19 -0
  142. package/template/src/blocks/submitForm/form/validation/isUnique/serverFunction.ts +40 -0
  143. package/template/src/blocks/submitForm/form/zap.ts +8 -0
  144. package/template/src/blocks/submitForm/formProcessor.ts +222 -0
  145. package/template/src/blocks/submitForm/input/sanitation/blocks.ts +5 -0
  146. package/template/src/blocks/submitForm/input/sanitation/functions.ts +1 -0
  147. package/template/src/blocks/submitForm/input/sanitation/trimText/block.ts +24 -0
  148. package/template/src/blocks/submitForm/input/sanitation/trimText/serverFunction.ts +63 -0
  149. package/template/src/blocks/submitForm/input/useOn.ts +8 -0
  150. package/template/src/blocks/submitForm/input/validation/blocks.ts +6 -0
  151. package/template/src/blocks/submitForm/input/validation/contains/block.ts +12 -0
  152. package/template/src/blocks/submitForm/input/validation/contains/serverFunction.ts +23 -0
  153. package/template/src/blocks/submitForm/input/validation/doesNotContain/block.ts +12 -0
  154. package/template/src/blocks/submitForm/input/validation/doesNotContain/serverFunction.ts +23 -0
  155. package/template/src/blocks/submitForm/input/validation/functions.ts +2 -0
  156. package/template/src/blocks/submitForm/input/zap.ts +6 -0
  157. package/template/src/blocks/submitForm/serverFunction.ts +42 -0
  158. package/template/src/collections/designSets/collection.ts +44 -0
  159. package/template/src/collections/designSets/defaults.ts +20 -0
  160. package/template/src/collections/designSets/tabs/animation.ts +71 -0
  161. package/template/src/collections/designSets/tabs/colors.ts +31 -0
  162. package/template/src/collections/designSets/tabs/fonts.ts +53 -0
  163. package/template/src/collections/designSets/tabs/miscellaneous.ts +22 -0
  164. package/template/src/collections/designSets/tabs/prose.ts +151 -0
  165. package/template/src/collections/designSets/tabs/settings.ts +52 -0
  166. package/template/src/collections/designSets/tabs/sizes.ts +30 -0
  167. package/template/src/collections/designSets/tabs/storage.ts +51 -0
  168. package/template/src/collections/designSets/tabs/variables.ts +28 -0
  169. package/template/src/collections/favicons.ts +11 -0
  170. package/template/src/collections/fonts/collection.ts +20 -0
  171. package/template/src/collections/fonts/script.ts +199 -0
  172. package/template/src/collections/footers/collection.ts +48 -0
  173. package/template/src/collections/footers/component.tsx +13 -0
  174. package/template/src/collections/headers/collection.ts +47 -0
  175. package/template/src/collections/headers/component.tsx +13 -0
  176. package/template/src/collections/iconSets/collection.ts +80 -0
  177. package/template/src/collections/iconSets/defaults.ts +81 -0
  178. package/template/src/collections/icons.ts +20 -0
  179. package/template/src/collections/images.ts +29 -0
  180. package/template/src/collections/index.ts +17 -0
  181. package/template/src/collections/muxVideos.ts +13 -0
  182. package/template/src/collections/pages/collection.ts +88 -0
  183. package/template/src/collections/pages/tabs/SEO.ts +70 -0
  184. package/template/src/collections/pages/tabs/settings.ts +17 -0
  185. package/template/src/collections/posthogProperty.ts +48 -0
  186. package/template/src/collections/shortcutSets/collection.ts +30 -0
  187. package/template/src/collections/shortcutSets/defaults.ts +1 -0
  188. package/template/src/collections/shortcutSets/protectedNames.ts +135 -0
  189. package/template/src/collections/shortcutSets/tabs/settings.ts +13 -0
  190. package/template/src/collections/shortcutSets/tabs/shortcuts.ts +70 -0
  191. package/template/src/collections/users.ts +11 -0
  192. package/template/src/collections/zap.ts +59 -0
  193. package/template/src/components/child/SSRProps.ts +381 -0
  194. package/template/src/components/child/renderChildren.tsx +148 -0
  195. package/template/src/components/livePreviewListener.tsx +10 -0
  196. package/template/src/components/providers/formProvider.tsx +11 -0
  197. package/template/src/components/providers/tracking/gtm.tsx +11 -0
  198. package/template/src/components/providers/tracking/index.tsx +46 -0
  199. package/template/src/components/providers/tracking/postHog.tsx +41 -0
  200. package/template/src/components/providers/tracking/vercel.tsx +10 -0
  201. package/template/src/components/toast/index.module.css +142 -0
  202. package/template/src/components/toast/index.tsx +55 -0
  203. package/template/src/endpoints/seed/backendForm.ts +48 -0
  204. package/template/src/endpoints/seed/designSet.ts +476 -0
  205. package/template/src/endpoints/seed/footer.ts +389 -0
  206. package/template/src/endpoints/seed/header.ts +3511 -0
  207. package/template/src/endpoints/seed/iconSet.ts +19 -0
  208. package/template/src/endpoints/seed/icons/assets/check.svg +4 -0
  209. package/template/src/endpoints/seed/icons/assets/close.svg +4 -0
  210. package/template/src/endpoints/seed/icons/assets/cookie.svg +7 -0
  211. package/template/src/endpoints/seed/icons/assets/github.svg +1 -0
  212. package/template/src/endpoints/seed/icons/assets/logo.svg +11 -0
  213. package/template/src/endpoints/seed/icons/assets/menu.svg +4 -0
  214. package/template/src/endpoints/seed/icons/assets/theme.svg +4 -0
  215. package/template/src/endpoints/seed/icons/check.ts +14 -0
  216. package/template/src/endpoints/seed/icons/close.ts +14 -0
  217. package/template/src/endpoints/seed/icons/cookie.ts +14 -0
  218. package/template/src/endpoints/seed/icons/github.ts +14 -0
  219. package/template/src/endpoints/seed/icons/index.ts +7 -0
  220. package/template/src/endpoints/seed/icons/logo.ts +14 -0
  221. package/template/src/endpoints/seed/icons/menu.ts +14 -0
  222. package/template/src/endpoints/seed/icons/theme.ts +14 -0
  223. package/template/src/endpoints/seed/index.ts +100 -0
  224. package/template/src/endpoints/seed/pages/home.ts +858 -0
  225. package/template/src/endpoints/seed/pages/index.ts +4 -0
  226. package/template/src/endpoints/seed/pages/notFoundPage.ts +287 -0
  227. package/template/src/endpoints/seed/pages/prose.ts +1436 -0
  228. package/template/src/endpoints/seed/pages/testing.ts +2181 -0
  229. package/template/src/endpoints/seed/shortcutSet.ts +187 -0
  230. package/template/src/endpoints/seed/siteMetaData.ts +10 -0
  231. package/template/src/fields/actions/changeKey.ts +12 -0
  232. package/template/src/fields/actions/index.ts +6 -0
  233. package/template/src/fields/actions/initialValueCheckbox.ts +14 -0
  234. package/template/src/fields/actions/keyText.ts +10 -0
  235. package/template/src/fields/actions/persisted.ts +14 -0
  236. package/template/src/fields/actions/setData.ts +20 -0
  237. package/template/src/fields/actions/strict/index.ts +3 -0
  238. package/template/src/fields/actions/strict/keySelect.ts +28 -0
  239. package/template/src/fields/actions/strict/listenSelect.ts +28 -0
  240. package/template/src/fields/actions/strict/performSelect.ts +30 -0
  241. package/template/src/fields/actions/strict/registry/cookieConsent.ts +14 -0
  242. package/template/src/fields/actions/strict/registry/index.ts +6 -0
  243. package/template/src/fields/actions/strict/registry/theme.ts +9 -0
  244. package/template/src/fields/active.ts +16 -0
  245. package/template/src/fields/apf/index.ts +69 -0
  246. package/template/src/fields/apf/storage.ts +38 -0
  247. package/template/src/fields/blocks/actions.ts +30 -0
  248. package/template/src/fields/blocks/backdropChildren.ts +11 -0
  249. package/template/src/fields/blocks/children.ts +15 -0
  250. package/template/src/fields/blocks/submitForm/form.ts +24 -0
  251. package/template/src/fields/blocks/submitForm/input.ts +25 -0
  252. package/template/src/fields/className.ts +26 -0
  253. package/template/src/fields/coloredEnd.ts +5 -0
  254. package/template/src/fields/defaultOpen.ts +14 -0
  255. package/template/src/fields/designSets/value.ts +80 -0
  256. package/template/src/fields/devMode.ts +11 -0
  257. package/template/src/fields/favicon.ts +18 -0
  258. package/template/src/fields/for.ts +11 -0
  259. package/template/src/fields/keepMounted.ts +11 -0
  260. package/template/src/fields/modal.ts +16 -0
  261. package/template/src/fields/slug.ts +35 -0
  262. package/template/src/fields/staticDataAttributes.ts +29 -0
  263. package/template/src/fields/tabs/block/children/actions.ts +49 -0
  264. package/template/src/fields/tabs/block/children/backdrop.ts +17 -0
  265. package/template/src/fields/tabs/block/children/settings.ts +45 -0
  266. package/template/src/fields/tabs/block/children/submitForm/form.ts +23 -0
  267. package/template/src/fields/tabs/block/children/submitForm/input.ts +14 -0
  268. package/template/src/fields/tabs/block/children/tracking.ts +25 -0
  269. package/template/src/fields/tabs/collection/storage.ts +55 -0
  270. package/template/src/fields/tagType.ts +32 -0
  271. package/template/src/fields/testPath.ts +3 -0
  272. package/template/src/fields/uniqueTitle.ts +8 -0
  273. package/template/src/fields/validationMessage.ts +13 -0
  274. package/template/src/globals/index.ts +8 -0
  275. package/template/src/globals/settings.ts +36 -0
  276. package/template/src/globals/siteMetaData.ts +29 -0
  277. package/template/src/globals/storage.ts +15 -0
  278. package/template/src/globals/tracking/global.ts +25 -0
  279. package/template/src/globals/tracking/tabs/gtm.ts +18 -0
  280. package/template/src/globals/tracking/tabs/postHog.ts +35 -0
  281. package/template/src/hooks/collection/atomicHook/atomicHook.ts +223 -0
  282. package/template/src/hooks/collection/atomicHook/processors/cssProcessor.ts +60 -0
  283. package/template/src/hooks/collection/atomicHook/processors/processDesignSet/generatePreflights.ts +36 -0
  284. package/template/src/hooks/collection/atomicHook/processors/processDesignSet/index.ts +176 -0
  285. package/template/src/hooks/collection/atomicHook/processors/unsetActive.ts +24 -0
  286. package/template/src/hooks/collection/formatSVG.ts +157 -0
  287. package/template/src/hooks/collection/revalidate.ts +53 -0
  288. package/template/src/hooks/collection/sanitizeCollection.ts +5 -0
  289. package/template/src/hooks/field/apf.ts +59 -0
  290. package/template/src/hooks/field/formatSlug.ts +23 -0
  291. package/template/src/hooks/field/href.ts +6 -0
  292. package/template/src/hooks/field/publishedAt.ts +5 -0
  293. package/template/src/hooks/frontEnd/atomicStore/create.ts +69 -0
  294. package/template/src/hooks/frontEnd/atomicStore/index.tsx +20 -0
  295. package/template/src/hooks/frontEnd/atomicStore/slices/base.ts +7 -0
  296. package/template/src/hooks/frontEnd/atomicStore/slices/consent.ts +76 -0
  297. package/template/src/hooks/frontEnd/atomicStore/slices/dynamic.ts +51 -0
  298. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/function.ts +14 -0
  299. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/boolToDA/zap.ts +12 -0
  300. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/function.ts +34 -0
  301. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/cCToDA/zap.ts +17 -0
  302. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/function.ts +22 -0
  303. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/errorToDA/zap.ts +10 -0
  304. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/function.ts +20 -0
  305. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/function.ts +24 -0
  306. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/statusToDA/zap.ts +10 -0
  307. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/function.ts +21 -0
  308. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/textToDA/zap.ts +12 -0
  309. package/template/src/hooks/frontEnd/useActions/dispatch/attributer/zap.ts +15 -0
  310. package/template/src/hooks/frontEnd/useActions/dispatch/index.ts +2 -0
  311. package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/function.ts +30 -0
  312. package/template/src/hooks/frontEnd/useActions/dispatch/runner/cycleText/zap.ts +12 -0
  313. package/template/src/hooks/frontEnd/useActions/dispatch/runner/function.ts +21 -0
  314. package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/function.ts +7 -0
  315. package/template/src/hooks/frontEnd/useActions/dispatch/runner/resetForm/zap.ts +9 -0
  316. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/function.ts +10 -0
  317. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setBool/zap.ts +11 -0
  318. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/function.ts +33 -0
  319. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setCCs/zap.ts +14 -0
  320. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/function.ts +11 -0
  321. package/template/src/hooks/frontEnd/useActions/dispatch/runner/setThemes/zap.ts +10 -0
  322. package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/function.ts +32 -0
  323. package/template/src/hooks/frontEnd/useActions/dispatch/runner/submitForm/zap.ts +9 -0
  324. package/template/src/hooks/frontEnd/useActions/dispatch/runner/zap.ts +16 -0
  325. package/template/src/hooks/frontEnd/useActions/dispatch/zap.ts +2 -0
  326. package/template/src/hooks/frontEnd/useActions/index.ts +6 -0
  327. package/template/src/hooks/frontEnd/useActions/useActionContext.ts +21 -0
  328. package/template/src/hooks/frontEnd/useActions/useButtonActions.ts +17 -0
  329. package/template/src/hooks/frontEnd/useActions/useDaToText.ts +34 -0
  330. package/template/src/hooks/frontEnd/useActions/useForm.ts +114 -0
  331. package/template/src/hooks/frontEnd/useActions/usePortal.ts +33 -0
  332. package/template/src/hooks/frontEnd/useActions/useToDa.ts +12 -0
  333. package/template/src/hooks/global/revalidate.ts +26 -0
  334. package/template/src/payload.config.ts +78 -0
  335. package/template/src/plugins/blurDataUrls.ts +8 -0
  336. package/template/src/plugins/formBuilder.ts +40 -0
  337. package/template/src/plugins/index.ts +17 -0
  338. package/template/src/plugins/muxVideo.ts +13 -0
  339. package/template/src/plugins/nestedDocs.ts +9 -0
  340. package/template/src/plugins/vercelBlobStorage.ts +8 -0
  341. package/template/src/ts/JSONSchema.ts +93 -0
  342. package/template/src/ts/declarations.ts +24 -0
  343. package/template/src/ts/types/actions.ts +175 -0
  344. package/template/src/ts/types/apf.ts +108 -0
  345. package/template/src/ts/types/cache.ts +166 -0
  346. package/template/src/ts/types/css.ts +14 -0
  347. package/template/src/ts/types/forms.ts +214 -0
  348. package/template/src/ts/types/frontEnd.ts +115 -0
  349. package/template/src/ts/types/index.ts +49 -0
  350. package/template/src/ts/types/payload-types.ts +3684 -0
  351. package/template/src/ts/zap/ap.ts +82 -0
  352. package/template/src/ts/zap/index.ts +4 -0
  353. package/template/src/ui/apf/controls.tsx +88 -0
  354. package/template/src/ui/apf/field.tsx +81 -0
  355. package/template/src/ui/apf/index.scss +59 -0
  356. package/template/src/ui/apf/label.tsx +23 -0
  357. package/template/src/ui/assets/Icon.tsx +21 -0
  358. package/template/src/ui/assets/Logo.tsx +21 -0
  359. package/template/src/ui/assets/atomicIcon.tsx +27 -0
  360. package/template/src/ui/assets/warningIcon.ts +6 -0
  361. package/template/src/ui/blocks/actionBlock.tsx +44 -0
  362. package/template/src/ui/blocks/inputBlock.tsx +24 -0
  363. package/template/src/ui/decorative/coloredEnd.tsx +16 -0
  364. package/template/src/ui/decorative/index.scss +46 -0
  365. package/template/src/ui/fields/iconSelect/index.tsx +19 -0
  366. package/template/src/ui/fields/slug/index.scss +12 -0
  367. package/template/src/ui/fields/slug/index.tsx +72 -0
  368. package/template/src/ui/index.ts +32 -0
  369. package/template/src/ui/root/beforeDashboard/index.scss +22 -0
  370. package/template/src/ui/root/beforeDashboard/index.tsx +39 -0
  371. package/template/src/ui/root/beforeDashboard/seedButton/index.scss +12 -0
  372. package/template/src/ui/root/beforeDashboard/seedButton/index.tsx +84 -0
  373. package/template/src/ui/root/siteTriggers/index.scss +22 -0
  374. package/template/src/ui/root/siteTriggers/index.tsx +94 -0
  375. package/template/src/ui/root/siteTriggers/triggerVercelDeploy.ts +37 -0
  376. package/template/src/ui/rowLabels/animation.tsx +27 -0
  377. package/template/src/ui/rowLabels/atomic/index.scss +62 -0
  378. package/template/src/ui/rowLabels/atomic/index.tsx +96 -0
  379. package/template/src/ui/rowLabels/color.tsx +33 -0
  380. package/template/src/ui/rowLabels/designToken.tsx +30 -0
  381. package/template/src/ui/rowLabels/icon.tsx +32 -0
  382. package/template/src/ui/rowLabels/shortcut/index.scss +21 -0
  383. package/template/src/ui/rowLabels/shortcut/index.tsx +30 -0
  384. package/template/src/ui/rowLabels/simpleText.tsx +41 -0
  385. package/template/src/utilities/deepMerge.ts +30 -0
  386. package/template/src/utilities/extractSVG.ts +9 -0
  387. package/template/src/utilities/format/toKebabCase.ts +79 -0
  388. package/template/src/utilities/format/toTitleCase.ts +47 -0
  389. package/template/src/utilities/formatDurationWithTokens.ts +56 -0
  390. package/template/src/utilities/generateMetaData.ts +45 -0
  391. package/template/src/utilities/generatePreviewPath.ts +43 -0
  392. package/template/src/utilities/get/cache/getAtomicActions.ts +48 -0
  393. package/template/src/utilities/get/cache/getAtomicClasses.ts +20 -0
  394. package/template/src/utilities/get/cache/getDesignSet.ts +15 -0
  395. package/template/src/utilities/get/cache/getFooter.ts +17 -0
  396. package/template/src/utilities/get/cache/getFormSubmissions.ts +17 -0
  397. package/template/src/utilities/get/cache/getForms.ts +43 -0
  398. package/template/src/utilities/get/cache/getHeader.ts +17 -0
  399. package/template/src/utilities/get/cache/getIcon.ts +51 -0
  400. package/template/src/utilities/get/cache/getImage.ts +20 -0
  401. package/template/src/utilities/get/cache/getPage.ts +35 -0
  402. package/template/src/utilities/get/cache/getPages.ts +24 -0
  403. package/template/src/utilities/get/cache/getShortcutSet.ts +17 -0
  404. package/template/src/utilities/get/cache/getSiteCSS.ts +17 -0
  405. package/template/src/utilities/get/cache/getSiteMetadata.ts +14 -0
  406. package/template/src/utilities/get/cache/getSitemap.ts +50 -0
  407. package/template/src/utilities/get/cache/getTracking.ts +14 -0
  408. package/template/src/utilities/get/cache/index.ts +129 -0
  409. package/template/src/utilities/get/cache/react.ts +5 -0
  410. package/template/src/utilities/get/getImageURL.ts +20 -0
  411. package/template/src/utilities/get/getMeUser.ts +22 -0
  412. package/template/src/utilities/get/getURL.ts +20 -0
  413. package/template/src/utilities/log/cache.ts +8 -0
  414. package/template/src/utilities/log/manual.ts +11 -0
  415. package/template/src/utilities/log/revalidation.ts +6 -0
  416. package/template/src/utilities/mergeTags.ts +7 -0
  417. package/template/src/utilities/propertyApplicatorUtility.ts +20 -0
  418. package/template/src/utilities/revalidateTag.ts +55 -0
  419. package/template/src/utilities/runAPF.ts +10 -0
  420. package/template/src/utilities/sanitizeData.ts +24 -0
  421. package/template/src/utilities/seedNestedRelationship.ts +5 -0
  422. package/template/tailwind.config.js +9 -0
  423. package/template/tsconfig.json +49 -0
@@ -0,0 +1,19 @@
1
+ import { IconSet, Page, Icon } from '@/ts/types'
2
+
3
+ type IconSetArgs = { page: Page; icons: Icon[] }
4
+
5
+ export const iconSet: (args: IconSetArgs) => Omit<IconSet, 'createdAt' | 'updatedAt' | 'id'> = ({ page, icons }) => {
6
+ const iconsArray = icons.map((icon) => {
7
+ return { name: icon.filename?.split('.').shift(), icon }
8
+ }) as IconSet['iconsArray']
9
+
10
+ return {
11
+ active: true,
12
+ title: 'Base Icon Set',
13
+ _status: 'published',
14
+
15
+ iconsArray,
16
+
17
+ testPath: page,
18
+ }
19
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128pt" height="128pt" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m101.94 29.555-52.414 52.418-23.461-23.465c-3.0352-3.0352-7.9492-3.0352-10.98 0-3.0352 3.0352-3.0352 7.9492 0 10.98l28.949 28.957c1.5117 1.5117 3.5078 2.2773 5.4922 2.2773 1.9844 0 3.9688-0.75391 5.4922-2.2773l57.906-57.906c3.0352-3.0352 3.0352-7.9492 0-10.98-3.0352-3.0352-7.9492-3.0352-10.984-0.003906z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128pt" height="128pt" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m104.19 17.406-37.504 37.504c-1.5352 1.5352-3.9688 1.5352-5.375 0l-37.504-37.504c-1.5352-1.5352-3.9688-1.5352-5.375 0-1.5352 1.5352-1.5352 3.9688 0 5.375l37.504 37.504c1.5352 1.5352 1.5352 3.9688 0 5.375l-37.633 37.637c-1.5352 1.5352-1.5352 3.9688 0 5.375 1.5352 1.5352 3.9688 1.5352 5.375 0l37.504-37.504c1.5352-1.5352 3.9688-1.5352 5.375 0l37.633 37.633c1.5352 1.5352 3.9688 1.5352 5.375 0 1.5352-1.5352 1.5352-3.9688 0-5.375l-37.375-37.633c-1.5352-1.5352-1.5352-3.9688 0-5.375l37.504-37.504c1.5352-1.5352 1.5352-3.9688 0-5.375-1.5352-1.5391-3.9688-1.5391-5.5039-0.13281z"/>
4
+ </svg>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128pt" height="128pt" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m116.43 58.059c-0.17969-1.4844-1.5195-2.4336-2.9648-2.0391-3.7812 1.0352-7.9805 0.09375-10.949-2.875-0.93359-0.93359-1.6602-1.9961-2.1914-3.1211-0.55078-1.1719-1.9883-1.5312-3.1758-1.0156-5.0508 2.1992-11.141 1.2461-15.27-2.8867-4.1289-4.1289-5.0859-10.219-2.8867-15.27 0.51562-1.1836 0.15625-2.625-1.0156-3.1758-1.1289-0.53125-2.1914-1.2539-3.1211-2.1914-2.9688-2.9688-3.9102-7.1719-2.875-10.949 0.39453-1.4453-0.55469-2.7852-2.0391-2.9648-1.9492-0.23437-3.9297-0.37109-5.9414-0.37109-30.281-0.003907-54.605 25.473-52.699 56.164 1.6289 26.297 23.031 47.695 49.324 49.324 30.684 1.9062 56.172-22.422 56.172-52.695 0-2.0156-0.13672-3.9883-0.37109-5.9414zm-80.031 22.742c-3.3164 0-6-2.6836-6-6 0-3.3164 2.6836-6 6-6 3.3164 0 6 2.6836 6 6 0 3.3164-2.6836 6-6 6zm13.199-36c-3.9766 0-7.1992-3.2266-7.1992-7.1992 0-3.9766 3.2266-7.1992 7.1992-7.1992 3.9766 0 7.1992 3.2266 7.1992 7.1992 0 3.9766-3.2266 7.1992-7.1992 7.1992zm13.199 21.602c-3.3164 0-6-2.6836-6-6s2.6836-6 6-6 6 2.6836 6 6-2.6836 6-6 6zm8.3984 31.199c-3.9766 0-7.1992-3.2266-7.1992-7.1992 0-3.9766 3.2266-7.1992 7.1992-7.1992 3.9766 0 7.1992 3.2266 7.1992 7.1992 0 3.9766-3.2266 7.1992-7.1992 7.1992zm20.402-19.199c-3.3164 0-6-2.6836-6-6s2.6836-6 6-6 6 2.6836 6 6-2.6836 6-6 6z"/>
4
+ <path d="m97.602 32.801c0 6.3984-9.6016 6.3984-9.6016 0 0-6.3984 9.6016-6.3984 9.6016 0z"/>
5
+ <path d="m112 38.801c0 4.8008-7.1992 4.8008-7.1992 0s7.1992-4.8008 7.1992 0z"/>
6
+ <path d="m102.4 19.598c0 4.8008-7.1992 4.8008-7.1992 0 0-4.8008 7.1992-4.8008 7.1992 0z"/>
7
+ </svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="96px" height="96px"> <path d="M10.9,2.1c-4.6,0.5-8.3,4.2-8.8,8.7c-0.5,4.7,2.2,8.9,6.3,10.5C8.7,21.4,9,21.2,9,20.8v-1.6c0,0-0.4,0.1-0.9,0.1 c-1.4,0-2-1.2-2.1-1.9c-0.1-0.4-0.3-0.7-0.6-1C5.1,16.3,5,16.3,5,16.2C5,16,5.3,16,5.4,16c0.6,0,1.1,0.7,1.3,1c0.5,0.8,1.1,1,1.4,1 c0.4,0,0.7-0.1,0.9-0.2c0.1-0.7,0.4-1.4,1-1.8c-2.3-0.5-4-1.8-4-4c0-1.1,0.5-2.2,1.2-3C7.1,8.8,7,8.3,7,7.6C7,7.2,7,6.6,7.3,6 c0,0,1.4,0,2.8,1.3C10.6,7.1,11.3,7,12,7s1.4,0.1,2,0.3C15.3,6,16.8,6,16.8,6C17,6.6,17,7.2,17,7.6c0,0.8-0.1,1.2-0.2,1.4 c0.7,0.8,1.2,1.8,1.2,3c0,2.2-1.7,3.5-4,4c0.6,0.5,1,1.4,1,2.3v2.6c0,0.3,0.3,0.6,0.7,0.5c3.7-1.5,6.3-5.1,6.3-9.3 C22,6.1,16.9,1.4,10.9,2.1z"/></svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128pt" height="128pt" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m78.914 57.711-1.4531 6.2578v-0.003906c3.6055 0.34375 7.207-0.69141 10.082-2.8945l-4.5391-4.5391c-1.2383 0.73828-2.6445 1.1445-4.0898 1.1797z"/>
4
+ <path d="m40.215 122 38.484-9.1641v-20.297l-34.102 19.234z"/>
5
+ <path d="m15.164 49.301-9.1641 38.484 10.227-4.3828 19.234-34.102z"/>
6
+ <path d="m70.297 48.922c0.054687-1.3867 0.46094-2.7344 1.1719-3.9258l-4.5391-4.5391c-1.9258 2.5469-2.9609 5.6523-2.9531 8.8438 0 0.32812 0 0.66016 0.035157 1z"/>
7
+ <path d="m86.465 5.1328c-2.6328 0.003907-5.2617 0.29688-7.832 0.86719l43.367 43.367c2.4023-10.773-0.22656-22.051-7.1367-30.656-6.9102-8.6055-17.359-13.598-28.398-13.578z"/>
8
+ <path d="m54.762 23.648-34.438 61.047 10 10 21.648-21.645c0.82422-0.82031 2.1523-0.82031 2.9766 0 0.82031 0.82422 0.82031 2.1523 0 2.9766l-21.648 21.645 10 10 61.051-34.434c7.5547-4.2734 13.336-11.105 16.301-19.266l-46.625-46.625c-8.1602 2.9648-14.992 8.7461-19.266 16.301zm49.176 25.652c0 6.6914-2.6602 13.113-7.3906 17.844-4.7344 4.7344-11.152 7.3945-17.848 7.3945-6.6914 0-13.113-2.6602-17.844-7.3945-4.7344-4.7305-7.3945-11.152-7.3945-17.844 0-6.6953 2.6602-13.113 7.3945-17.848 4.7305-4.7305 11.152-7.3906 17.844-7.3906 6.6914 0.007812 13.105 2.668 17.84 7.3984 4.7305 4.7344 7.3906 11.148 7.3984 17.84z"/>
9
+ <path d="m78.699 70.332c5.5781 0 10.93-2.2148 14.871-6.1602 3.9453-3.9453 6.1602-9.293 6.1602-14.871s-2.2148-10.93-6.1602-14.871c-3.9414-3.9453-9.293-6.1602-14.871-6.1602s-10.926 2.2148-14.871 6.1602c-3.9453 3.9414-6.1602 9.293-6.1602 14.871 0.007812 5.5742 2.2227 10.922 6.168 14.863 3.9414 3.9453 9.2891 6.1602 14.863 6.168zm13.398-7.6758h0.003906c-3.543 3.5742-8.3711 5.582-13.402 5.5703-1.4375-0.003906-2.8672-0.17187-4.2656-0.49609-0.54688-0.125-1.0195-0.46094-1.3125-0.9375-0.29688-0.47266-0.39062-1.0469-0.26562-1.5898l2.3789-10.242c0.26562-1.1289 1.3945-1.832 2.5234-1.5742 1.418 0.34766 2.9141-0.082031 3.9297-1.1289 0.39453-0.39844 0.92969-0.625 1.4922-0.625 0.5625-0.027343 1.1094 0.19922 1.4922 0.61328l7.4375 7.4375c0.82031 0.82031 0.82031 2.1523 0 2.9727zm-14.023-19.961 2.3828-10.242 0.003907-0.003906c0.125-0.54297 0.46094-1.0156 0.9375-1.3086 0.47266-0.29688 1.043-0.39062 1.5859-0.26172 3.4727 0.81641 6.6406 2.5898 9.1523 5.125 2.5078 2.5312 4.2539 5.7188 5.0352 9.1953 0.25 1.1367-0.46484 2.2578-1.6016 2.5078l-10.277 2.2422 0.003906 0.003906c-0.14844 0.03125-0.30078 0.046875-0.45312 0.046875-0.98047 0-1.832-0.67969-2.0469-1.6367-0.36328-1.5586-1.5781-2.7773-3.1328-3.1445-0.54297-0.125-1.0156-0.46484-1.3125-0.9375-0.29297-0.47266-0.39062-1.043-0.26172-1.5859zm-1.4883 6.6016 0.003906-0.003906c-0.046875-1.0117 0.65234-1.9062 1.6445-2.1055 0.71875-0.15234 1.4609 0.066406 1.9766 0.58594 0.50781 0.51953 0.71875 1.2617 0.55078 1.9688-0.26562 0.94141-1.0977 1.6055-2.0703 1.6602-1.1406-0.054688-2.0469-0.96875-2.0898-2.1094zm-11.254-13.398 0.003907-0.003907c0.82031-0.82031 2.1484-0.82031 2.9688 0l7.4375 7.4375c0.39844 0.39453 0.62109 0.92969 0.62109 1.4922 0 0.55859-0.22266 1.0938-0.62109 1.4883-0.80078 0.78906-1.2539 1.8672-1.25 2.9883 0 0.28906 0.03125 0.57812 0.085937 0.85938 0.23828 1.1289-0.47656 2.2344-1.5977 2.4844l-10.27 2.2422c-0.14844 0.03125-0.30078 0.050781-0.44922 0.050781-0.99219 0-1.8516-0.69141-2.0586-1.6641-0.27734-1.3047-0.42188-2.6367-0.42188-3.9727-0.015625-5.0352 1.9883-9.8672 5.5625-13.41z"/>
10
+ <path d="m86.164 45.457 6.293-1.375c-1.4883-3.8789-4.5352-6.957-8.3984-8.4805l-1.457 6.2656c1.5234 0.80469 2.7695 2.0586 3.5625 3.5898z"/>
11
+ </svg>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m28.59 29.219c-1.3906 0-2.5195 1.1289-2.5195 2.5195s1.1289 2.5195 2.5195 2.5195h42.824c1.3906 0 2.5195-1.1289 2.5195-2.5195s-1.1289-2.5195-2.5195-2.5195zm0 18.262c-1.3906 0-2.5195 1.1289-2.5195 2.5195s1.1289 2.5195 2.5195 2.5195h42.824c1.3906 0 2.5195-1.1289 2.5195-2.5195s-1.1289-2.5195-2.5195-2.5195zm0 18.262c-1.3906 0-2.5195 1.1289-2.5195 2.5195s1.1289 2.5195 2.5195 2.5195h42.824c1.3906 0 2.5195-1.1289 2.5195-2.5195s-1.1289-2.5195-2.5195-2.5195z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128pt" height="128pt" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="m64.004 2.6523c-16.273-0.003906-31.879 6.457-43.387 17.965-11.508 11.504-17.973 27.109-17.977 43.383 0 16.27 6.4648 31.879 17.969 43.383 11.504 11.508 27.109 17.973 43.383 17.977 16.273 0 31.879-6.4648 43.387-17.973 11.508-11.504 17.969-27.109 17.969-43.383-0.015625-16.266-6.4844-31.859-17.984-43.359-11.5-11.504-27.094-17.973-43.359-17.992zm-57.172 61.352c0.019531-15.156 6.0469-29.688 16.766-40.406s25.25-16.746 40.406-16.766v114.34c-15.156-0.015625-29.688-6.043-40.406-16.758-10.719-10.719-16.746-25.25-16.766-40.406z"/>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const checkIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 470 to 246 bytes (47.7% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="12.9 12.9 102.2 102.2" fill="currentColor" stroke="currentColor">\n <path d="M102 29.6 49.4 82 26.1 58.5a8 8 0 00-11 0 8 8 0 000 11l29 29a8 8 0 0011 0l57.8-58a8 8 0 000-11 8 8 0 00-11 0z"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/check.svg',
8
+ thumbnailURL: null,
9
+ filename: 'check.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 246,
12
+ width: 171,
13
+ height: 171,
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const closeIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 739 to 442 bytes (40.2% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="17.2 16.2 93.7 93.7" fill="currentColor" stroke="currentColor">\n <path d="M104.2 17.4 66.7 55a3.7 3.7 0 01-5.4 0L23.8 17.4a3.7 3.7 0 00-5.4 0 3.7 3.7 0 000 5.4L56 60.3c1.6 1.5 1.6 4 0 5.4l-37.6 37.6a3.7 3.7 0 000 5.4c1.5 1.5 4 1.5 5.4 0l37.5-37.5c1.5-1.6 4-1.6 5.4 0l37.6 37.6c1.5 1.5 4 1.5 5.4 0s1.5-4 0-5.4L72.2 65.8a3.7 3.7 0 010-5.4L109.7 23c1.5-1.5 1.5-4 0-5.4a4 4 0 00-5.5 0z"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/close.svg',
8
+ thumbnailURL: null,
9
+ filename: 'close.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 442,
12
+ width: 171,
13
+ height: 171,
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const cookieIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 3577 to 1391 bytes (61.1% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="6.0 5.0 117.0 117.0" fill="currentColor" stroke="currentColor">\n <path d="M79 57.7 77.4 64a14 14 0 0010-3L83 56.6a8 8 0 01-4 1.2M40.1 122l38.5-9.2V92.5l-34.1 19.3zm-25-72.7L6 87.8l10.2-4.4 19.3-34.1zm55.1-.4a8 8 0 011.2-3.9l-4.6-4.5a15 15 0 00-3 8.8l.1 1zM86.5 5.1a36 36 0 00-7.9.9L122 49.4A36.3 36.3 0 0086.5 5z"/>\n <path d="m54.8 23.6-34.5 61 10 10L52 73.2a2.1 2.1 0 013 3L33.2 97.6l10 10 61-34.5A36 36 0 00120.8 54L74 7.3a36 36 0 00-19.2 16.3zm49.1 25.7a25 25 0 01-25.2 25.2 25 25 0 01-17.8-7.4 25 25 0 010-35.6A25 25 0 0178.7 24a25 25 0 0117.8 7.4 25 25 0 017.4 17.8z"/>\n <path d="M78.7 70.3a21 21 0 0014.9-6.1 21 21 0 000-29.8 21 21 0 00-29.8 0 21 21 0 00-6.1 14.9 21 21 0 006.1 14.9 21 21 0 0014.9 6.1zm13.4-7.6a19 19 0 01-13.4 5.5 19 19 0 01-4.3-.5 2 2 0 01-1.3-1 2 2 0 01-.2-1.5L75.2 55a2 2 0 012.6-1.6 4 4 0 003.9-1.1q.7-.6 1.5-.7a2 2 0 011.5.6l7.4 7.5c.8.8.8 2.1 0 3zm-14-20 2.4-10.2q0-.9.9-1.4A2 2 0 0183 31a19 19 0 0114.2 14.3 2 2 0 01-1.6 2.5L85.3 50h-.5q-1.6-.1-2-1.6a4 4 0 00-3.1-3.2 2 2 0 01-1.3-1 2 2 0 01-.3-1.5zm-1.5 6.6a2 2 0 011.6-2.1 2.1 2.1 0 012.5 2.6 2 2 0 01-2 1.6 2 2 0 01-2.1-2.1zM65.3 35.9c.9-.8 2.2-.8 3 0l7.4 7.4a2 2 0 010 3 4 4 0 00-1.2 3v.9a2 2 0 01-1.5 2.4L62.7 55a2 2 0 01-2.5-1.6 19 19 0 01-.4-4A19 19 0 0165.3 36z"/>\n <path d="m86.2 45.5 6.3-1.4a15 15 0 00-8.4-8.5l-1.5 6.3a9 9 0 013.6 3.6z"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/logo.svg',
8
+ thumbnailURL: null,
9
+ filename: 'logo.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 1391,
12
+ width: 171,
13
+ height: 171,
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const githubIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 744 to 487 bytes (34.5% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="2.1 1.6 20.1 20.1" fill="currentColor" stroke="currentColor">\n <path d="M10.9 2.1a10 10 0 00-2.5 19.2q.5.1.6-.5v-1.6l-.9.1c-1.4 0-2-1.2-2.1-1.9l-.6-1-.4-.2q.1-.2.4-.2c.6 0 1.1.7 1.3 1q.9 1.1 1.4 1l.9-.2q.1-1.1 1-1.8c-2.3-.5-4-1.8-4-4q0-1.7 1.2-3L7 7.6q0-.7.3-1.6s1.4 0 2.8 1.3Q10.9 7 12 7a5 5 0 012 .3C15.3 6 16.8 6 16.8 6q.3 1 .2 1.6 0 1.2-.2 1.4 1.1 1.2 1.2 3c0 2.2-1.7 3.5-4 4a3 3 0 011 2.3v2.6q0 .6.7.5a10 10 0 00-4.8-19.3"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/github.svg',
8
+ thumbnailURL: null,
9
+ filename: 'github.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 487,
12
+ width: 96,
13
+ height: 96,
14
+ }
@@ -0,0 +1,7 @@
1
+ export * from './logo'
2
+ export * from './menu'
3
+ export * from './theme'
4
+ export * from './check'
5
+ export * from './close'
6
+ export * from './cookie'
7
+ export * from './github'
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const logoIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 3577 to 1391 bytes (61.1% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="6.0 5.0 117.0 117.0" fill="currentColor" stroke="currentColor">\n <path d="M79 57.7 77.4 64a14 14 0 0010-3L83 56.6a8 8 0 01-4 1.2M40.1 122l38.5-9.2V92.5l-34.1 19.3zm-25-72.7L6 87.8l10.2-4.4 19.3-34.1zm55.1-.4a8 8 0 011.2-3.9l-4.6-4.5a15 15 0 00-3 8.8l.1 1zM86.5 5.1a36 36 0 00-7.9.9L122 49.4A36.3 36.3 0 0086.5 5z"/>\n <path d="m54.8 23.6-34.5 61 10 10L52 73.2a2.1 2.1 0 013 3L33.2 97.6l10 10 61-34.5A36 36 0 00120.8 54L74 7.3a36 36 0 00-19.2 16.3zm49.1 25.7a25 25 0 01-25.2 25.2 25 25 0 01-17.8-7.4 25 25 0 010-35.6A25 25 0 0178.7 24a25 25 0 0117.8 7.4 25 25 0 017.4 17.8z"/>\n <path d="M78.7 70.3a21 21 0 0014.9-6.1 21 21 0 000-29.8 21 21 0 00-29.8 0 21 21 0 00-6.1 14.9 21 21 0 006.1 14.9 21 21 0 0014.9 6.1zm13.4-7.6a19 19 0 01-13.4 5.5 19 19 0 01-4.3-.5 2 2 0 01-1.3-1 2 2 0 01-.2-1.5L75.2 55a2 2 0 012.6-1.6 4 4 0 003.9-1.1q.7-.6 1.5-.7a2 2 0 011.5.6l7.4 7.5c.8.8.8 2.1 0 3zm-14-20 2.4-10.2q0-.9.9-1.4A2 2 0 0183 31a19 19 0 0114.2 14.3 2 2 0 01-1.6 2.5L85.3 50h-.5q-1.6-.1-2-1.6a4 4 0 00-3.1-3.2 2 2 0 01-1.3-1 2 2 0 01-.3-1.5zm-1.5 6.6a2 2 0 011.6-2.1 2.1 2.1 0 012.5 2.6 2 2 0 01-2 1.6 2 2 0 01-2.1-2.1zM65.3 35.9c.9-.8 2.2-.8 3 0l7.4 7.4a2 2 0 010 3 4 4 0 00-1.2 3v.9a2 2 0 01-1.5 2.4L62.7 55a2 2 0 01-2.5-1.6 19 19 0 01-.4-4A19 19 0 0165.3 36z"/>\n <path d="m86.2 45.5 6.3-1.4a15 15 0 00-8.4-8.5l-1.5 6.3a9 9 0 013.6 3.6z"/>\n</svg>\n',
7
+ filename: 'logo.svg',
8
+ mimeType: 'image/svg+xml',
9
+ filesize: 1391,
10
+ width: 171,
11
+ height: 171,
12
+ url: 'http://localhost:3000/api/icon/file/logo.svg',
13
+ thumbnailURL: null,
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const menuIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 617 to 273 bytes (55.8% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="26.1 26.1 47.8 47.8" fill="currentColor" stroke="currentColor">\n <path d="M28.6 29.2a2.5 2.5 0 000 5h42.8a2.5 2.5 0 000-5zm0 18.3a2.5 2.5 0 000 5h42.8a2.5 2.5 0 000-5zm0 18.2a2.5 2.5 0 000 5h42.8a2.5 2.5 0 000-5z"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/menu.svg',
8
+ thumbnailURL: null,
9
+ filename: 'menu.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 273,
12
+ width: 133,
13
+ height: 133,
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Icon } from '@/ts/types'
2
+
3
+ export const themeIcon: Omit<Icon, 'createdAt' | 'updatedAt' | 'id'> = {
4
+ optimized: 'SVG optimized: 687 to 315 bytes (54.1% reduction)',
5
+ svgString:
6
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="2.6 2.6 122.8 122.8" fill="currentColor" stroke="currentColor">\n <path d="M64 2.7A61.4 61.4 0 002.6 64 61.4 61.4 0 0064 125.4 61.4 61.4 0 00125.3 64a61 61 0 00-18-43.4A61 61 0 0064 2.6zM6.8 64A57 57 0 0164 6.8v114.4a57 57 0 01-40.4-16.8A57 57 0 016.8 64z"/>\n</svg>\n',
7
+ url: 'http://localhost:3000/api/icon/file/theme.svg',
8
+ thumbnailURL: null,
9
+ filename: 'theme.svg',
10
+ mimeType: 'image/svg+xml',
11
+ filesize: 315,
12
+ width: 171,
13
+ height: 171,
14
+ }
@@ -0,0 +1,100 @@
1
+ import type { CollectionSlug, Payload, PayloadRequest, File } from 'payload'
2
+
3
+ //Collection Data
4
+ import { footer } from './footer'
5
+ import { header } from './header'
6
+ import { iconSet } from './iconSet'
7
+ import { designSet } from './designSet'
8
+ import { backendForm } from './backendForm'
9
+ import { shortcutSet } from './shortcutSet'
10
+ import { homePage, notFoundPage, testingPage, prosePage } from './pages'
11
+ import { checkIcon, closeIcon, cookieIcon, githubIcon, logoIcon, menuIcon, themeIcon } from './icons'
12
+
13
+ const collections: CollectionSlug[] = ['footer', 'header', 'iconSet', 'designSet', 'forms', 'shortcutSet', 'pages', 'icon']
14
+
15
+ //Global Data
16
+ import { siteMetaData } from './siteMetaData'
17
+
18
+ const args = { depth: 0, context: { isSeed: true } }
19
+
20
+ export const seed = async ({ payload, req }: { payload: Payload; req: PayloadRequest }): Promise<void> => {
21
+ payload.logger.info(`Updating Globals...`)
22
+ await payload.updateGlobal({ slug: 'siteMetaData', ...args, data: siteMetaData })
23
+
24
+ payload.logger.info(`Clearing collections...`)
25
+ await Promise.all(collections.map((collection) => payload.db.deleteMany({ collection, req, where: {} })))
26
+ await Promise.all(
27
+ collections
28
+ .filter((collection) => Boolean(payload.collections[collection].config.versions))
29
+ .map((collection) => payload.db.deleteVersions({ collection, req, where: {} })),
30
+ )
31
+
32
+ payload.logger.info('Seeding database...')
33
+
34
+ payload.logger.info(`Seeding forms...`)
35
+ await payload.create({ collection: 'forms', ...args, data: backendForm })
36
+
37
+ payload.logger.info(`Grabbing Icons...`)
38
+ const [checkBuffer, closeBuffer, cookieBuffer, githubBuffer, logoBuffer, menuBuffer, themeBuffer] = await Promise.all([
39
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/check.svg'),
40
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/close.svg'),
41
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/cookie.svg'),
42
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/github.svg'),
43
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/logo.svg'),
44
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/menu.svg'),
45
+ fetchFileByURL('https://raw.githubusercontent.com/pro-laico/atomic-payload/refs/heads/main/src/endpoints/seed/icons/assets/theme.svg'),
46
+ ])
47
+
48
+ payload.logger.info('Seeding Icons...')
49
+ const icons = await Promise.all([
50
+ payload.create({ collection: 'icon', ...args, data: logoIcon, file: logoBuffer }),
51
+ payload.create({ collection: 'icon', ...args, data: menuIcon, file: menuBuffer }),
52
+ payload.create({ collection: 'icon', ...args, data: checkIcon, file: checkBuffer }),
53
+ payload.create({ collection: 'icon', ...args, data: closeIcon, file: closeBuffer }),
54
+ payload.create({ collection: 'icon', ...args, data: themeIcon, file: themeBuffer }),
55
+ payload.create({ collection: 'icon', ...args, data: cookieIcon, file: cookieBuffer }),
56
+ payload.create({ collection: 'icon', ...args, data: githubIcon, file: githubBuffer }),
57
+ ])
58
+
59
+ payload.logger.info(`Seeding pages...`)
60
+ //Used as the default testing page for collections.
61
+ const page = await payload.create({ collection: 'pages', ...args, data: testingPage })
62
+ //Prose Showcase Page
63
+ const prose = await payload.create({ collection: 'pages', ...args, data: prosePage })
64
+ //Used In Header for links
65
+ const home = await payload.create({ collection: 'pages', ...args, data: homePage })
66
+ //Other Pages
67
+ await Promise.all([payload.create({ collection: 'pages', ...args, data: notFoundPage({ home }) })])
68
+
69
+ payload.logger.info(`Seeding Icon Sets...`)
70
+ await payload.create({ collection: 'iconSet', ...args, data: iconSet({ page, icons }) })
71
+
72
+ payload.logger.info(`Seeding Shortcut Set...`)
73
+ await payload.create({ collection: 'shortcutSet', ...args, data: shortcutSet({ page }) })
74
+
75
+ payload.logger.info(`Seeding Design Set...`)
76
+ await payload.create({ collection: 'designSet', ...args, data: designSet({ page }) })
77
+
78
+ payload.logger.info(`Seeding Footer...`)
79
+ await payload.create({ collection: 'footer', ...args, data: footer({ page }) })
80
+
81
+ payload.logger.info(`Seeding Header...`)
82
+ await payload.create({ collection: 'header', ...args, context: { isSeed: false }, data: header({ testing: page, home, prose }) })
83
+
84
+ payload.logger.info('Seeded database successfully!')
85
+ }
86
+
87
+ async function fetchFileByURL(url: string): Promise<File> {
88
+ const res = await fetch(url, { credentials: 'include', method: 'GET' })
89
+
90
+ if (!res.ok) throw new Error(`Failed to fetch file from ${url}, status: ${res.status}`)
91
+
92
+ const data = await res.arrayBuffer()
93
+
94
+ return {
95
+ name: url.split('/').pop() || `file-${Date.now()}`,
96
+ data: Buffer.from(data),
97
+ mimetype: `image/svg+xml`,
98
+ size: data.byteLength,
99
+ }
100
+ }