sandcms 0.5.2

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 (391) hide show
  1. package/LICENSE +57 -0
  2. package/README.md +84 -0
  3. package/dist/Image.svelte +53 -0
  4. package/dist/Image.svelte.d.ts +10 -0
  5. package/dist/Seo.svelte +29 -0
  6. package/dist/Seo.svelte.d.ts +10 -0
  7. package/dist/admin/Access.svelte +129 -0
  8. package/dist/admin/Access.svelte.d.ts +7 -0
  9. package/dist/admin/Account.svelte +190 -0
  10. package/dist/admin/Account.svelte.d.ts +7 -0
  11. package/dist/admin/Admin.svelte +42 -0
  12. package/dist/admin/Admin.svelte.d.ts +8 -0
  13. package/dist/admin/AssetAttachment.svelte +77 -0
  14. package/dist/admin/AssetAttachment.svelte.d.ts +15 -0
  15. package/dist/admin/Collection.svelte +52 -0
  16. package/dist/admin/Collection.svelte.d.ts +7 -0
  17. package/dist/admin/Dashboard.svelte +105 -0
  18. package/dist/admin/Dashboard.svelte.d.ts +7 -0
  19. package/dist/admin/Editor.svelte +192 -0
  20. package/dist/admin/Editor.svelte.d.ts +7 -0
  21. package/dist/admin/Fields.svelte +221 -0
  22. package/dist/admin/Fields.svelte.d.ts +17 -0
  23. package/dist/admin/Gallery.svelte +130 -0
  24. package/dist/admin/Gallery.svelte.d.ts +16 -0
  25. package/dist/admin/Inbox.svelte +154 -0
  26. package/dist/admin/Inbox.svelte.d.ts +8 -0
  27. package/dist/admin/Login.svelte +104 -0
  28. package/dist/admin/Login.svelte.d.ts +7 -0
  29. package/dist/admin/MediaLibrary.svelte +231 -0
  30. package/dist/admin/MediaLibrary.svelte.d.ts +7 -0
  31. package/dist/admin/MediaPicker.svelte +273 -0
  32. package/dist/admin/MediaPicker.svelte.d.ts +16 -0
  33. package/dist/admin/Notice.svelte +13 -0
  34. package/dist/admin/Notice.svelte.d.ts +8 -0
  35. package/dist/admin/NotificationSettings.svelte +153 -0
  36. package/dist/admin/NotificationSettings.svelte.d.ts +7 -0
  37. package/dist/admin/RichText.svelte +103 -0
  38. package/dist/admin/RichText.svelte.d.ts +9 -0
  39. package/dist/admin/RichTextLink.svelte +71 -0
  40. package/dist/admin/RichTextLink.svelte.d.ts +7 -0
  41. package/dist/admin/SelectField.svelte +39 -0
  42. package/dist/admin/SelectField.svelte.d.ts +15 -0
  43. package/dist/admin/Shell.svelte +106 -0
  44. package/dist/admin/Shell.svelte.d.ts +9 -0
  45. package/dist/admin/SortableList.svelte +104 -0
  46. package/dist/admin/SortableList.svelte.d.ts +30 -0
  47. package/dist/admin/UnsavedChanges.svelte +54 -0
  48. package/dist/admin/UnsavedChanges.svelte.d.ts +6 -0
  49. package/dist/admin/UploadButton.svelte +42 -0
  50. package/dist/admin/UploadButton.svelte.d.ts +10 -0
  51. package/dist/admin/UploadQueue.svelte +40 -0
  52. package/dist/admin/UploadQueue.svelte.d.ts +7 -0
  53. package/dist/admin/Users.svelte +185 -0
  54. package/dist/admin/Users.svelte.d.ts +7 -0
  55. package/dist/admin/client.d.ts +720 -0
  56. package/dist/admin/client.js +29 -0
  57. package/dist/admin/components/ui/alert/alert-action.svelte +20 -0
  58. package/dist/admin/components/ui/alert/alert-action.svelte.d.ts +5 -0
  59. package/dist/admin/components/ui/alert/alert-description.svelte +23 -0
  60. package/dist/admin/components/ui/alert/alert-description.svelte.d.ts +5 -0
  61. package/dist/admin/components/ui/alert/alert-title.svelte +23 -0
  62. package/dist/admin/components/ui/alert/alert-title.svelte.d.ts +5 -0
  63. package/dist/admin/components/ui/alert/alert.svelte +44 -0
  64. package/dist/admin/components/ui/alert/alert.svelte.d.ts +26 -0
  65. package/dist/admin/components/ui/alert/index.d.ts +6 -0
  66. package/dist/admin/components/ui/alert/index.js +8 -0
  67. package/dist/admin/components/ui/alert-dialog/alert-dialog-action.svelte +27 -0
  68. package/dist/admin/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +9 -0
  69. package/dist/admin/components/ui/alert-dialog/alert-dialog-cancel.svelte +27 -0
  70. package/dist/admin/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +9 -0
  71. package/dist/admin/components/ui/alert-dialog/alert-dialog-content.svelte +32 -0
  72. package/dist/admin/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +11 -0
  73. package/dist/admin/components/ui/alert-dialog/alert-dialog-description.svelte +20 -0
  74. package/dist/admin/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +4 -0
  75. package/dist/admin/components/ui/alert-dialog/alert-dialog-footer.svelte +23 -0
  76. package/dist/admin/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +5 -0
  77. package/dist/admin/components/ui/alert-dialog/alert-dialog-header.svelte +23 -0
  78. package/dist/admin/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +5 -0
  79. package/dist/admin/components/ui/alert-dialog/alert-dialog-media.svelte +23 -0
  80. package/dist/admin/components/ui/alert-dialog/alert-dialog-media.svelte.d.ts +5 -0
  81. package/dist/admin/components/ui/alert-dialog/alert-dialog-overlay.svelte +20 -0
  82. package/dist/admin/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +4 -0
  83. package/dist/admin/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
  84. package/dist/admin/components/ui/alert-dialog/alert-dialog-portal.svelte.d.ts +3 -0
  85. package/dist/admin/components/ui/alert-dialog/alert-dialog-title.svelte +20 -0
  86. package/dist/admin/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +4 -0
  87. package/dist/admin/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
  88. package/dist/admin/components/ui/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
  89. package/dist/admin/components/ui/alert-dialog/alert-dialog.svelte +7 -0
  90. package/dist/admin/components/ui/alert-dialog/alert-dialog.svelte.d.ts +3 -0
  91. package/dist/admin/components/ui/alert-dialog/index.d.ts +13 -0
  92. package/dist/admin/components/ui/alert-dialog/index.js +15 -0
  93. package/dist/admin/components/ui/attachment/attachment-action.svelte +21 -0
  94. package/dist/admin/components/ui/attachment/attachment-action.svelte.d.ts +4 -0
  95. package/dist/admin/components/ui/attachment/attachment-actions.svelte +23 -0
  96. package/dist/admin/components/ui/attachment/attachment-actions.svelte.d.ts +5 -0
  97. package/dist/admin/components/ui/attachment/attachment-content.svelte +23 -0
  98. package/dist/admin/components/ui/attachment/attachment-content.svelte.d.ts +5 -0
  99. package/dist/admin/components/ui/attachment/attachment-description.svelte +24 -0
  100. package/dist/admin/components/ui/attachment/attachment-description.svelte.d.ts +5 -0
  101. package/dist/admin/components/ui/attachment/attachment-group.svelte +23 -0
  102. package/dist/admin/components/ui/attachment/attachment-group.svelte.d.ts +5 -0
  103. package/dist/admin/components/ui/attachment/attachment-media.svelte +44 -0
  104. package/dist/admin/components/ui/attachment/attachment-media.svelte.d.ts +26 -0
  105. package/dist/admin/components/ui/attachment/attachment-title.svelte +23 -0
  106. package/dist/admin/components/ui/attachment/attachment-title.svelte.d.ts +5 -0
  107. package/dist/admin/components/ui/attachment/attachment-trigger.svelte +29 -0
  108. package/dist/admin/components/ui/attachment/attachment-trigger.svelte.d.ts +11 -0
  109. package/dist/admin/components/ui/attachment/attachment.svelte +54 -0
  110. package/dist/admin/components/ui/attachment/attachment.svelte.d.ts +45 -0
  111. package/dist/admin/components/ui/attachment/index.d.ts +10 -0
  112. package/dist/admin/components/ui/attachment/index.js +12 -0
  113. package/dist/admin/components/ui/avatar/avatar-badge.svelte +26 -0
  114. package/dist/admin/components/ui/avatar/avatar-badge.svelte.d.ts +5 -0
  115. package/dist/admin/components/ui/avatar/avatar-fallback.svelte +20 -0
  116. package/dist/admin/components/ui/avatar/avatar-fallback.svelte.d.ts +4 -0
  117. package/dist/admin/components/ui/avatar/avatar-group-count.svelte +23 -0
  118. package/dist/admin/components/ui/avatar/avatar-group-count.svelte.d.ts +5 -0
  119. package/dist/admin/components/ui/avatar/avatar-group.svelte +23 -0
  120. package/dist/admin/components/ui/avatar/avatar-group.svelte.d.ts +5 -0
  121. package/dist/admin/components/ui/avatar/avatar-image.svelte +17 -0
  122. package/dist/admin/components/ui/avatar/avatar-image.svelte.d.ts +4 -0
  123. package/dist/admin/components/ui/avatar/avatar.svelte +26 -0
  124. package/dist/admin/components/ui/avatar/avatar.svelte.d.ts +7 -0
  125. package/dist/admin/components/ui/avatar/index.d.ts +7 -0
  126. package/dist/admin/components/ui/avatar/index.js +9 -0
  127. package/dist/admin/components/ui/badge/badge.svelte +50 -0
  128. package/dist/admin/components/ui/badge/badge.svelte.d.ts +38 -0
  129. package/dist/admin/components/ui/badge/index.d.ts +2 -0
  130. package/dist/admin/components/ui/badge/index.js +2 -0
  131. package/dist/admin/components/ui/button/button.svelte +87 -0
  132. package/dist/admin/components/ui/button/button.svelte.d.ts +70 -0
  133. package/dist/admin/components/ui/button/index.d.ts +2 -0
  134. package/dist/admin/components/ui/button/index.js +4 -0
  135. package/dist/admin/components/ui/card/card-action.svelte +20 -0
  136. package/dist/admin/components/ui/card/card-action.svelte.d.ts +5 -0
  137. package/dist/admin/components/ui/card/card-content.svelte +20 -0
  138. package/dist/admin/components/ui/card/card-content.svelte.d.ts +5 -0
  139. package/dist/admin/components/ui/card/card-description.svelte +20 -0
  140. package/dist/admin/components/ui/card/card-description.svelte.d.ts +5 -0
  141. package/dist/admin/components/ui/card/card-footer.svelte +20 -0
  142. package/dist/admin/components/ui/card/card-footer.svelte.d.ts +5 -0
  143. package/dist/admin/components/ui/card/card-header.svelte +23 -0
  144. package/dist/admin/components/ui/card/card-header.svelte.d.ts +5 -0
  145. package/dist/admin/components/ui/card/card-title.svelte +20 -0
  146. package/dist/admin/components/ui/card/card-title.svelte.d.ts +5 -0
  147. package/dist/admin/components/ui/card/card.svelte +25 -0
  148. package/dist/admin/components/ui/card/card.svelte.d.ts +8 -0
  149. package/dist/admin/components/ui/card/index.d.ts +8 -0
  150. package/dist/admin/components/ui/card/index.js +10 -0
  151. package/dist/admin/components/ui/checkbox/checkbox.svelte +39 -0
  152. package/dist/admin/components/ui/checkbox/checkbox.svelte.d.ts +4 -0
  153. package/dist/admin/components/ui/checkbox/index.d.ts +2 -0
  154. package/dist/admin/components/ui/checkbox/index.js +4 -0
  155. package/dist/admin/components/ui/dialog/dialog-close.svelte +11 -0
  156. package/dist/admin/components/ui/dialog/dialog-close.svelte.d.ts +4 -0
  157. package/dist/admin/components/ui/dialog/dialog-content.svelte +48 -0
  158. package/dist/admin/components/ui/dialog/dialog-content.svelte.d.ts +13 -0
  159. package/dist/admin/components/ui/dialog/dialog-description.svelte +20 -0
  160. package/dist/admin/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
  161. package/dist/admin/components/ui/dialog/dialog-footer.svelte +32 -0
  162. package/dist/admin/components/ui/dialog/dialog-footer.svelte.d.ts +8 -0
  163. package/dist/admin/components/ui/dialog/dialog-header.svelte +20 -0
  164. package/dist/admin/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
  165. package/dist/admin/components/ui/dialog/dialog-overlay.svelte +20 -0
  166. package/dist/admin/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
  167. package/dist/admin/components/ui/dialog/dialog-portal.svelte +7 -0
  168. package/dist/admin/components/ui/dialog/dialog-portal.svelte.d.ts +3 -0
  169. package/dist/admin/components/ui/dialog/dialog-title.svelte +17 -0
  170. package/dist/admin/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
  171. package/dist/admin/components/ui/dialog/dialog-trigger.svelte +11 -0
  172. package/dist/admin/components/ui/dialog/dialog-trigger.svelte.d.ts +4 -0
  173. package/dist/admin/components/ui/dialog/dialog.svelte +7 -0
  174. package/dist/admin/components/ui/dialog/dialog.svelte.d.ts +3 -0
  175. package/dist/admin/components/ui/dialog/index.d.ts +11 -0
  176. package/dist/admin/components/ui/dialog/index.js +13 -0
  177. package/dist/admin/components/ui/input/index.d.ts +2 -0
  178. package/dist/admin/components/ui/input/index.js +4 -0
  179. package/dist/admin/components/ui/input/input.svelte +48 -0
  180. package/dist/admin/components/ui/input/input.svelte.d.ts +13 -0
  181. package/dist/admin/components/ui/label/index.d.ts +2 -0
  182. package/dist/admin/components/ui/label/index.js +4 -0
  183. package/dist/admin/components/ui/label/label.svelte +20 -0
  184. package/dist/admin/components/ui/label/label.svelte.d.ts +4 -0
  185. package/dist/admin/components/ui/select/index.d.ts +13 -0
  186. package/dist/admin/components/ui/select/index.js +15 -0
  187. package/dist/admin/components/ui/select/select-content.svelte +45 -0
  188. package/dist/admin/components/ui/select/select-content.svelte.d.ts +11 -0
  189. package/dist/admin/components/ui/select/select-group-heading.svelte +21 -0
  190. package/dist/admin/components/ui/select/select-group-heading.svelte.d.ts +10 -0
  191. package/dist/admin/components/ui/select/select-group.svelte +17 -0
  192. package/dist/admin/components/ui/select/select-group.svelte.d.ts +4 -0
  193. package/dist/admin/components/ui/select/select-item.svelte +42 -0
  194. package/dist/admin/components/ui/select/select-item.svelte.d.ts +4 -0
  195. package/dist/admin/components/ui/select/select-label.svelte +20 -0
  196. package/dist/admin/components/ui/select/select-label.svelte.d.ts +6 -0
  197. package/dist/admin/components/ui/select/select-portal.svelte +7 -0
  198. package/dist/admin/components/ui/select/select-portal.svelte.d.ts +3 -0
  199. package/dist/admin/components/ui/select/select-scroll-down-button.svelte +23 -0
  200. package/dist/admin/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
  201. package/dist/admin/components/ui/select/select-scroll-up-button.svelte +23 -0
  202. package/dist/admin/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
  203. package/dist/admin/components/ui/select/select-separator.svelte +18 -0
  204. package/dist/admin/components/ui/select/select-separator.svelte.d.ts +4 -0
  205. package/dist/admin/components/ui/select/select-trigger.svelte +29 -0
  206. package/dist/admin/components/ui/select/select-trigger.svelte.d.ts +8 -0
  207. package/dist/admin/components/ui/select/select-value.svelte +7 -0
  208. package/dist/admin/components/ui/select/select-value.svelte.d.ts +4 -0
  209. package/dist/admin/components/ui/select/select.svelte +11 -0
  210. package/dist/admin/components/ui/select/select.svelte.d.ts +3 -0
  211. package/dist/admin/components/ui/separator/index.d.ts +2 -0
  212. package/dist/admin/components/ui/separator/index.js +4 -0
  213. package/dist/admin/components/ui/separator/separator.svelte +21 -0
  214. package/dist/admin/components/ui/separator/separator.svelte.d.ts +4 -0
  215. package/dist/admin/components/ui/switch/index.d.ts +2 -0
  216. package/dist/admin/components/ui/switch/index.js +4 -0
  217. package/dist/admin/components/ui/switch/switch.svelte +34 -0
  218. package/dist/admin/components/ui/switch/switch.svelte.d.ts +8 -0
  219. package/dist/admin/components/ui/table/index.d.ts +9 -0
  220. package/dist/admin/components/ui/table/index.js +11 -0
  221. package/dist/admin/components/ui/table/table-body.svelte +20 -0
  222. package/dist/admin/components/ui/table/table-body.svelte.d.ts +5 -0
  223. package/dist/admin/components/ui/table/table-caption.svelte +20 -0
  224. package/dist/admin/components/ui/table/table-caption.svelte.d.ts +5 -0
  225. package/dist/admin/components/ui/table/table-cell.svelte +20 -0
  226. package/dist/admin/components/ui/table/table-cell.svelte.d.ts +5 -0
  227. package/dist/admin/components/ui/table/table-footer.svelte +20 -0
  228. package/dist/admin/components/ui/table/table-footer.svelte.d.ts +5 -0
  229. package/dist/admin/components/ui/table/table-head.svelte +23 -0
  230. package/dist/admin/components/ui/table/table-head.svelte.d.ts +5 -0
  231. package/dist/admin/components/ui/table/table-header.svelte +20 -0
  232. package/dist/admin/components/ui/table/table-header.svelte.d.ts +5 -0
  233. package/dist/admin/components/ui/table/table-row.svelte +23 -0
  234. package/dist/admin/components/ui/table/table-row.svelte.d.ts +5 -0
  235. package/dist/admin/components/ui/table/table.svelte +22 -0
  236. package/dist/admin/components/ui/table/table.svelte.d.ts +5 -0
  237. package/dist/admin/components/ui/textarea/index.d.ts +2 -0
  238. package/dist/admin/components/ui/textarea/index.js +4 -0
  239. package/dist/admin/components/ui/textarea/textarea.svelte +22 -0
  240. package/dist/admin/components/ui/textarea/textarea.svelte.d.ts +5 -0
  241. package/dist/admin/components/ui/toggle/index.d.ts +3 -0
  242. package/dist/admin/components/ui/toggle/index.js +5 -0
  243. package/dist/admin/components/ui/toggle/toggle.svelte +52 -0
  244. package/dist/admin/components/ui/toggle/toggle.svelte.d.ts +43 -0
  245. package/dist/admin/generated/FONT-LICENSE +93 -0
  246. package/dist/admin/generated/Geist-LICENSE.txt +93 -0
  247. package/dist/admin/generated/admin.css +3276 -0
  248. package/dist/admin/generated/fonts/geist-cyrillic-ext-wght-italic.woff2 +0 -0
  249. package/dist/admin/generated/fonts/geist-cyrillic-ext-wght-normal.woff2 +0 -0
  250. package/dist/admin/generated/fonts/geist-cyrillic-wght-italic.woff2 +0 -0
  251. package/dist/admin/generated/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
  252. package/dist/admin/generated/fonts/geist-latin-ext-wght-italic.woff2 +0 -0
  253. package/dist/admin/generated/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
  254. package/dist/admin/generated/fonts/geist-latin-wght-italic.woff2 +0 -0
  255. package/dist/admin/generated/fonts/geist-latin-wght-normal.woff2 +0 -0
  256. package/dist/admin/generated/fonts/geist-vietnamese-wght-italic.woff2 +0 -0
  257. package/dist/admin/generated/fonts/geist-vietnamese-wght-normal.woff2 +0 -0
  258. package/dist/admin/generated/geist-cyrillic-ext-wght-normal.woff2 +0 -0
  259. package/dist/admin/generated/geist-cyrillic-wght-normal.woff2 +0 -0
  260. package/dist/admin/generated/geist-latin-ext-wght-normal.woff2 +0 -0
  261. package/dist/admin/generated/geist-latin-wght-normal.woff2 +0 -0
  262. package/dist/admin/generated/geist-vietnamese-wght-normal.woff2 +0 -0
  263. package/dist/admin/generated/styles.css +2772 -0
  264. package/dist/admin/index.d.ts +2 -0
  265. package/dist/admin/index.js +1 -0
  266. package/dist/admin/types.d.ts +63 -0
  267. package/dist/admin/types.js +1 -0
  268. package/dist/admin/uploads.d.ts +12 -0
  269. package/dist/admin/uploads.js +23 -0
  270. package/dist/admin/utils.d.ts +11 -0
  271. package/dist/admin/utils.js +1 -0
  272. package/dist/blueprints/files.d.ts +7 -0
  273. package/dist/blueprints/files.js +112 -0
  274. package/dist/blueprints/gallery.d.ts +3 -0
  275. package/dist/blueprints/gallery.js +14 -0
  276. package/dist/blueprints/load.d.ts +6 -0
  277. package/dist/blueprints/load.js +186 -0
  278. package/dist/blueprints/merge.d.ts +2 -0
  279. package/dist/blueprints/merge.js +18 -0
  280. package/dist/blueprints/types.d.ts +58 -0
  281. package/dist/blueprints/types.js +1 -0
  282. package/dist/blueprints/validate.d.ts +8 -0
  283. package/dist/blueprints/validate.js +133 -0
  284. package/dist/cli/backup.d.ts +6 -0
  285. package/dist/cli/backup.js +85 -0
  286. package/dist/cli/cloudflare.d.ts +8 -0
  287. package/dist/cli/cloudflare.js +123 -0
  288. package/dist/cli/doctor.d.ts +1 -0
  289. package/dist/cli/doctor.js +56 -0
  290. package/dist/cli/files.d.ts +30 -0
  291. package/dist/cli/files.js +114 -0
  292. package/dist/cli/index.d.ts +2 -0
  293. package/dist/cli/index.js +182 -0
  294. package/dist/cli/prompts.d.ts +5 -0
  295. package/dist/cli/prompts.js +41 -0
  296. package/dist/cli/scaffold.d.ts +2 -0
  297. package/dist/cli/scaffold.js +58 -0
  298. package/dist/cli/setup.d.ts +11 -0
  299. package/dist/cli/setup.js +116 -0
  300. package/dist/cli/upgrade.d.ts +1 -0
  301. package/dist/cli/upgrade.js +47 -0
  302. package/dist/index.d.ts +5 -0
  303. package/dist/index.js +4 -0
  304. package/dist/media.d.ts +26 -0
  305. package/dist/media.js +27 -0
  306. package/dist/notification-fields.d.ts +8 -0
  307. package/dist/notification-fields.js +26 -0
  308. package/dist/richtext.d.ts +14 -0
  309. package/dist/richtext.js +73 -0
  310. package/dist/server/access.d.ts +16 -0
  311. package/dist/server/access.js +216 -0
  312. package/dist/server/admin-load.d.ts +342 -0
  313. package/dist/server/admin-load.js +135 -0
  314. package/dist/server/api.d.ts +3 -0
  315. package/dist/server/api.js +144 -0
  316. package/dist/server/auth.d.ts +744 -0
  317. package/dist/server/auth.js +142 -0
  318. package/dist/server/blueprint-icons.d.ts +4 -0
  319. package/dist/server/blueprint-icons.js +14 -0
  320. package/dist/server/cms.d.ts +1054 -0
  321. package/dist/server/cms.js +58 -0
  322. package/dist/server/content.d.ts +101 -0
  323. package/dist/server/content.js +285 -0
  324. package/dist/server/db/migration-data.d.ts +4 -0
  325. package/dist/server/db/migration-data.js +7 -0
  326. package/dist/server/db/migrations/0000_foundation.sql +180 -0
  327. package/dist/server/db/migrations/meta/0000_snapshot.json +1188 -0
  328. package/dist/server/db/migrations/meta/_journal.json +13 -0
  329. package/dist/server/db/schema.d.ts +2212 -0
  330. package/dist/server/db/schema.js +171 -0
  331. package/dist/server/db/store.d.ts +33 -0
  332. package/dist/server/db/store.js +131 -0
  333. package/dist/server/email/index.d.ts +50 -0
  334. package/dist/server/email/index.js +175 -0
  335. package/dist/server/email/template.d.ts +8 -0
  336. package/dist/server/email/template.js +53 -0
  337. package/dist/server/forms.d.ts +40 -0
  338. package/dist/server/forms.js +84 -0
  339. package/dist/server/hooks.d.ts +3 -0
  340. package/dist/server/hooks.js +85 -0
  341. package/dist/server/http.d.ts +3 -0
  342. package/dist/server/http.js +3 -0
  343. package/dist/server/index.d.ts +8 -0
  344. package/dist/server/index.js +7 -0
  345. package/dist/server/media/delivery.d.ts +3 -0
  346. package/dist/server/media/delivery.js +42 -0
  347. package/dist/server/media/presets.d.ts +2 -0
  348. package/dist/server/media/presets.js +8 -0
  349. package/dist/server/media/runner.d.ts +2 -0
  350. package/dist/server/media/runner.js +128 -0
  351. package/dist/server/media/service.d.ts +144 -0
  352. package/dist/server/media/service.js +280 -0
  353. package/dist/server/notifications.d.ts +9 -0
  354. package/dist/server/notifications.js +161 -0
  355. package/dist/server/request.d.ts +2 -0
  356. package/dist/server/request.js +39 -0
  357. package/dist/server/seo.d.ts +12 -0
  358. package/dist/server/seo.js +62 -0
  359. package/dist/worker/index.d.ts +10 -0
  360. package/dist/worker/index.js +266 -0
  361. package/dist/worker/source.d.ts +2 -0
  362. package/dist/worker/source.js +31 -0
  363. package/dist/worker/svg.d.ts +5 -0
  364. package/dist/worker/svg.js +142 -0
  365. package/docs/acceptance.md +58 -0
  366. package/docs/cloudflare.md +146 -0
  367. package/docs/content.md +188 -0
  368. package/docs/deployment.md +89 -0
  369. package/docs/email.md +124 -0
  370. package/docs/forms.md +18 -0
  371. package/docs/media.md +105 -0
  372. package/docs/package.md +84 -0
  373. package/docs/releases.md +29 -0
  374. package/docs/upgrades.md +62 -0
  375. package/package.json +124 -0
  376. package/templates/dockerignore +15 -0
  377. package/templates/hooks.server.ts +4 -0
  378. package/templates/integration.ts +20 -0
  379. package/templates/railpack.json +7 -0
  380. package/templates/routes/admin/+page.server.ts +3 -0
  381. package/templates/routes/admin/+page.svelte +6 -0
  382. package/templates/routes/api/+server.ts +4 -0
  383. package/templates/sandcms/blueprints/collections/photographers.yaml +6 -0
  384. package/templates/sandcms/blueprints/collections/projects.yaml +26 -0
  385. package/templates/sandcms/blueprints/files/image.yaml +6 -0
  386. package/templates/sandcms/blueprints/forms/registration.yaml +15 -0
  387. package/templates/sandcms/blueprints/pages/home.yaml +9 -0
  388. package/templates/sandcms/blueprints/site.yaml +13 -0
  389. package/templates/sandcms/config.yaml +12 -0
  390. package/templates/sandcms/worker/index.ts +1 -0
  391. package/templates/sandcms/worker/wrangler.jsonc +7 -0
@@ -0,0 +1,146 @@
1
+ # Cloudflare setup and operations
2
+
3
+ SandCMS uses one Worker and one **private** R2 bucket per environment. The Worker accepts authenticated uploads and named variant requests, encodes images with remote transformations and inspects dimensions with its Images binding, and streams completed variants to authenticated CMS requests. It serves originals only to the processor using short-lived, signed source URLs. Keep staging and production resources separate.
4
+
5
+ Website proxy caching is optional and separate from Worker deployment. Public image URLs remain on the website at `/_sandcms/media/{key}`. Enabling the website's Cloudflare proxy lets the CDN cache authorized image responses. No second bucket, object copying, public R2 access, or publication marker is needed.
6
+
7
+ ## Local development
8
+
9
+ 1. Generate a random secret of at least 32 characters.
10
+ 2. Put the same value in ignored `.env.local` as `SANDCMS_WORKER_TOKEN` and ignored `sandcms/worker/.dev.vars` as `CMS_TOKEN`.
11
+ 3. Use `http://localhost:8787` as `media.workerUrl` (the starter default).
12
+ 4. Run the local Worker, then restart the website:
13
+
14
+ ```sh
15
+ bun x wrangler dev --config sandcms/worker/wrangler.jsonc --local --port 8787
16
+ ```
17
+
18
+ The local Worker uses simulated R2, Images metadata inspection, and `cf.image` transformations. Local processing checks format, dimensions, signed-source routing, and storage; production quality and limits require staging verification. The [offline Images implementation supports only a subset of transformations](https://developers.cloudflare.com/images/optimization/binding/). Automated tests need no production resources and do not exercise the Cloudflare CDN.
19
+
20
+ For quality checks, use a deployed staging Worker or remote development with a dedicated staging Worker configuration bound to a staging R2 bucket. Before running `wrangler dev --remote`, verify that the configuration's `MEDIA` binding targets staging, including any `preview_bucket_name` override, and select that configuration explicitly with `--config`. Remote development connects to the configured real remote resources; it does not automatically isolate storage and could otherwise write test uploads and variants to production. See [Cloudflare's development modes](https://developers.cloudflare.com/workers/local-development/).
21
+
22
+ ## Provisioning and deployment
23
+
24
+ Setup optionally uses the existing Wrangler login, asks for an account, displays project-derived Worker/R2 names, checks collisions, creates the resources, sets the Worker secret, and deploys. It writes non-secret names/URLs to tracked config and secrets to ignored environment files. The CLI does not store Wrangler credentials. Setup does not configure the website's DNS proxy or Cache Rules; complete those steps separately below.
25
+
26
+ - Keep R2 public access disabled, including `r2.dev`. Do not attach a public custom domain to the bucket.
27
+ - Set `media.workerUrl` to the deployed Worker URL, or use the server-only `SANDCMS_WORKER_URL` environment override.
28
+ - Supply the same secret as website `SANDCMS_WORKER_TOKEN` and Worker `CMS_TOKEN`.
29
+ - Use project-owned resources. The repository's `sandcms-local-media` name is a local example, not a production bucket to reuse.
30
+
31
+ Keep the Images binding: only encoding moved to remote transformations; dimension inspection still calls `.info()`. Ensure image transformations are enabled for the Worker’s account and that its own hostname is an allowed source. Cloudflare supports `cf.image` on Worker zones, including `workers.dev`. The Worker constructs source URLs from its request origin; use the deployed hostname for `media.workerUrl` and avoid redirects or rewrites on `/internal/source/*`.
32
+
33
+ Signed source URLs are processor credentials, scoped to one asset and valid at the source for five minutes. Do not log or expose them, and bypass CDN cache rules on `/internal/*`. Source responses use `private, no-store`; Cloudflare maintains its own transformation cache keyed by the signed URL, which is not purged by token expiry. No `origin-auth: share-publicly` setting or public R2 bucket is needed. See [media privacy](media.md#privacy-and-publication). Never forward the CMS bearer token to a source URL.
34
+
35
+ Set website `BODY_SIZE_LIMIT=101M` and configure upstream request limits to allow 100,000,000-byte files plus multipart overhead. The internal CMS-to-Worker upload is a raw body with an explicit Content-Length. A lower host or proxy limit can still reject uploads before they reach the CMS.
36
+
37
+ Later deploys are explicit:
38
+
39
+ ```sh
40
+ bun x --no-install sandcms worker update
41
+ bun x --no-install sandcms doctor
42
+ ```
43
+
44
+ Worker updates verify recorded resource ownership. The current CMS/Worker protocol is **3**; incompatible internal requests fail. Deploy the updated Worker and website together for 100 MB remote processing. This processing change does not alter the database schema or require a database reset. For database schema changes, follow the [upgrade workflow](upgrades.md).
45
+
46
+ For deployments still using legacy public Worker `/media/*` URLs, deploy a protocol-3 Worker to close that route, update manually constructed URLs to the CMS routes, and purge old Worker URL caches. Legacy browser copies may have a one-year immutable lifetime and cannot be recalled. Confirm bucket public access is disabled before relying on draft privacy.
47
+
48
+ ## Website proxy and public image caching
49
+
50
+ The origin authorizes an image using current published references and active variants, then marks its successful response cacheable:
51
+
52
+ ```http
53
+ Cache-Control: public, max-age=86400, s-maxage=2592000
54
+ ETag: "object-validator"
55
+ ```
56
+
57
+ This gives browsers one day of freshness and shared caches 30 days. A browser hit needs no network request; a CDN hit avoids the CMS, SQLite, Worker, and R2 entirely. A cache miss still uses the CMS → Worker → R2 path. The Worker and R2 remain private. TTL specifies freshness, not guaranteed cache retention.
58
+
59
+ Draft-only images return an uncached 404. Authenticated previews at `/api/cms/media/` and delivery errors retain `private, no-store`. Public responses do not vary by cookie. Conditional requests reaching the origin still check publication before returning `304`.
60
+
61
+ ### Enable the website proxy
62
+
63
+ 1. Deploy the updated website and Worker. The former `no-store` public policy cannot be fixed by simply enabling the proxy.
64
+ 2. In the website's Cloudflare zone, change the website hostname's DNS record to **Proxied** (orange cloud).
65
+ 3. Use **Full (strict)** SSL/TLS with a valid origin certificate. Keep website `SANDCMS_ORIGIN` and adapter `ORIGIN` set to the public HTTPS origin; see [host configuration](deployment.md#host-configuration).
66
+ 4. In **Rules → Cache Rules**, add the two rules below, replacing `www.example.com` with the actual website hostname. Repeat for any other hostname that serves the website.
67
+
68
+ Do not change trusted-client-IP settings just to enable caching. Trust a proxy header only after configuring the origin so clients cannot spoof it; see [deployment guidance](deployment.md#host-configuration).
69
+
70
+ ### Rule 1: SandCMS public images
71
+
72
+ Paste this into the expression editor:
73
+
74
+ ```text
75
+ (http.host eq "www.example.com" and starts_with(http.request.uri.path, "/_sandcms/media/") and http.request.uri.query eq "")
76
+ ```
77
+
78
+ Set:
79
+
80
+ | Setting | Value |
81
+ | ------------------------- | -------------------------------------------------------- |
82
+ | Cache eligibility | Eligible for cache |
83
+ | Edge TTL | Use cache-control header if present, bypass cache if not |
84
+ | Browser TTL | Respect origin |
85
+ | Status code TTL overrides | None |
86
+ | Cache key | Default; retain query strings, do not add cookies |
87
+
88
+ Do not select **Ignore cache-control header and use this TTL**: errors must remain uncached. Do not apply the public-image policy to the whole website. GET/HEAD handling is left to Cloudflare and the origin; the expression intentionally has no method restriction so URL purging can match it.
89
+
90
+ ### Rule 2: SandCMS private routes and query requests
91
+
92
+ Place this bypass rule after any broader cache rules that might otherwise match it:
93
+
94
+ ```text
95
+ (http.host eq "www.example.com" and (http.request.uri.path eq "/admin" or starts_with(http.request.uri.path, "/admin/") or http.request.uri.path eq "/api/cms" or starts_with(http.request.uri.path, "/api/cms/") or http.request.uri.query ne ""))
96
+ ```
97
+
98
+ Set **Cache eligibility → Bypass cache**. This deliberately bypasses all query-bearing URLs, including content previews and rejected image transformation queries. It avoids sharing a cached ordinary page with a preview request. Other application caching needs can be configured separately with equally explicit rules.
99
+
100
+ Audit existing rules for conflicts: a later whole-site override can defeat these settings; a blanket bypass-on-cookie rule can prevent public image cache hits for signed-in visitors. Never bypass origin privacy directives to work around a cache miss. These rules govern image delivery; they do not enable public HTML caching.
101
+
102
+ Cloudflare documents the [proxied DNS requirement](https://developers.cloudflare.com/cache/how-to/cache-rules/), [Cache Rule settings and TTL overrides](https://developers.cloudflare.com/cache/how-to/cache-rules/settings/), [rule ordering](https://developers.cloudflare.com/cache/how-to/cache-rules/order/), and [origin cache-control behavior](https://developers.cloudflare.com/cache/concepts/cache-control/).
103
+
104
+ ### Verify delivery
105
+
106
+ Use a real published image URL, with no query string. Run the GET twice (rather than relying only on HEAD):
107
+
108
+ ```sh
109
+ MEDIA_URL='https://www.example.com/_sandcms/media/REPLACE_WITH_ACTUAL_VARIANT_KEY'
110
+ curl -sS -D - -o /dev/null "$MEDIA_URL"
111
+ curl -sS -D - -o /dev/null "$MEDIA_URL"
112
+ ```
113
+
114
+ Expect HTTP 200, the public cache policy, an ETag, no `Set-Cookie` or `Vary: Cookie`, and eventually `CF-Cache-Status: HIT` (often `MISS` on the first request). `Age` indicates time in the shared cache. Requests may reach different cache locations, so an immediate HIT is not guaranteed. For conditional delivery, copy the actual ETag:
115
+
116
+ ```sh
117
+ curl -sS -D - -o /dev/null -H 'If-None-Match: "REPLACE_WITH_ACTUAL_ETAG"' "$MEDIA_URL"
118
+ ```
119
+
120
+ Expect 304 when the representation is unchanged. The CDN may answer this itself. To verify origin revocation after unpublishing, purge the exact image URL first or use a controlled direct-origin request; a CDN hit is allowed to keep serving the previously public image.
121
+
122
+ Also check:
123
+
124
+ - A never-published image returns 404 and `private, no-store` on repeated public requests, including with `If-None-Match: *`.
125
+ - A signed-out preview request returns 401 and `private, no-store`.
126
+ - A signed-in preview succeeds but remains `private, no-store`, without an ETag or CDN HIT. Inspect it in browser developer tools without sharing session cookies.
127
+ - An image URL with `?width=100` returns an uncached 404, even after warming the ordinary URL.
128
+ - Publishing that previously private image immediately makes the origin return 200; a cached negative response must not delay publication.
129
+
130
+ If a public image remains `BYPASS` or `DYNAMIC`, inspect response headers, proxy status, Development Mode, and matching Cache Rules using Cloudflare Trace. Check for upstream `Set-Cookie`, old `no-store` responses, and conflicting cookie bypass rules. See [uncached-response troubleshooting](https://developers.cloudflare.com/cache/troubleshooting/investigating-uncached-responses/).
131
+
132
+ ### Unpublishing, deletion, and purging
133
+
134
+ Unpublishing or removing the last published reference immediately denies new origin requests. It does not recall cached images. Cloudflare may keep serving a fresh copy for the remaining shared-cache lifetime; browsers may keep using their cached copy. A cold cache can return 404 while another location still serves 200. This is the intended tradeoff for fast public delivery.
135
+
136
+ SandCMS does **not** automatically purge Cloudflare. For deliberate removal, unpublish/remove the reference (or delete the asset) first, then use **Caching → Configuration → Purge Cache → Custom Purge** to purge every affected full public variant URL. Purging before revoking origin access allows the cache to refill. There can be several formats and sizes per image. See [purge by URL](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/).
137
+
138
+ A CDN purge cannot clear visitor browser caches or downloaded files. Changed image bytes must get a new URL; never overwrite an existing variant to try to force an update. Ordinary text edits and publication require no purge or file movement.
139
+
140
+ For rollback, bypass the public-media path and purge its cached URLs. Disabling the proxy also bypasses CDN delivery but does not clear existing browser copies. The application still serves images with the public browser-cache policy unless that policy is changed in code.
141
+
142
+ ## Staging verification
143
+
144
+ Before production, run setup with a staging project name and authorized Wrangler login. Confirm account selection, collision handling, Worker/bucket ownership, secrets, deployed URL, and `worker update`. Exercise remote transformations with the chosen format/quality/size matrix, large and transparent images, SVG sanitization, retries, restart recovery, and rebuilds while published images stay live. Verify a real image larger than 20 MB and a 100 MB upload produce ready variants; check the 100 MP boundary and rejection above it. Confirm unsigned, expired, tampered, and wrong-asset source URLs fail, source responses are uncached, and failed transformations never expose originals as variants. Verify the remote path works on the actual deployed hostname; local tests cannot establish that Cloudflare’s production fetch and caching configuration is correct.
145
+
146
+ Then enable proxy caching on a staging website hostname and complete the checks above. Local automated tests cover access checks, conditional requests, and headers; actual edge HIT behavior, rule precedence, purging, image quality, and production limits require this deployed verification. Record that evidence separately from local test results.
@@ -0,0 +1,188 @@
1
+ # Blueprints and content
2
+
3
+ Configuration lives in `sandcms/config.yaml`; blueprints live recursively under `sandcms/blueprints`. `id` and field keys are stable identifiers; labels can change freely. Before 0.5.0, renaming a key is a breaking change; update configuration and recreate affected content. Removed fields stay in stored payloads. YAML duplicate keys, unknown fields/types, relation targets, preview route collisions, and image presets fail with file/line diagnostics.
4
+
5
+ ```yaml
6
+ id: projects
7
+ label: Projects
8
+ icon: image
9
+ kind: collection
10
+ preview: /projects/{slug}
11
+ fields:
12
+ title: { type: text, required: true }
13
+ slug: { type: slug, from: title, required: true }
14
+ photographer: { type: relation, collection: photographers }
15
+ gallery:
16
+ type: gallery
17
+ fileBlueprint: image
18
+ overrides: [alt]
19
+ ```
20
+
21
+ Content kinds: `page`, `site`, `collection`, `form`. File metadata uses `kind: file` (see below). Field types: `text`, `slug`, `textarea`, `number`, `date`, `boolean`, `select`, `multiselect`, `richtext`, `media`, `media-list`, `gallery`, `relation`, `group`, `repeatable`. Select fields require `options`; relation fields require `collection`; `group` and `repeatable` fields require `fields`. Fields accept `label`, `description`, `required`, and numeric `min`/`max`. Payloads are limited to 1 MB and 30 nesting levels. Galleries have no fixed item count.
22
+
23
+ Draft saves allow incomplete required fields. Publish validates the full document, existing relations, and current media preset readiness. Slugs are unique within a blueprint, separately for draft and published snapshots. Save uses a version number to reject stale writes. Publishing atomically replaces the published snapshot. Unpublish removes public visibility.
24
+
25
+ When an editor has unsaved changes, SvelteKit's `beforeNavigate` check opens a shadcn alert dialog before navigating within the app, including browser back/forward. **Keep editing** cancels navigation; **Discard changes** continues to the requested destination. Refreshing, closing the tab or browser, and leaving the app with a full page load are intentionally unguarded. The editor does not register a browser-native unload prompt.
26
+
27
+ When using the save API directly, supply complete repeatable rows, including hidden keys from the previous draft. The admin does this automatically when editing or reordering. Rows are replaced as ordered objects; merging by array index would attach retired data to the wrong row after a reorder.
28
+
29
+ ## Sidebar icons
30
+
31
+ Every content blueprint kind accepts an optional `icon` using a lowercase, hyphenated name from the [Lucide catalogue](https://lucide.dev/icons/), such as `image`, `camera`, or `calendar-days`. Projects uses `icon: image` in the example above. The CMS validates names against its pinned Lucide version; unknown names report the YAML file and line when running `bun x sandcms validate` or starting the application.
32
+
33
+ Omitting `icon` keeps the defaults: `file-text` for pages, `folder` for collections, `inbox` for forms, and `settings` for site settings. Restart the application after changing a blueprint. Icons are resolved on the server, and only the selected icon data is included in admin pages.
34
+
35
+ ## Public routes
36
+
37
+ Routes and components remain developer-owned. Use the installed site's `getCMS` wrapper:
38
+
39
+ ```ts
40
+ import { error } from '@sveltejs/kit';
41
+ import { getCMS } from '$lib/server/sandcms';
42
+
43
+ export const load = async (event) => {
44
+ const cms = getCMS();
45
+ const project = await cms.read('projects', event, event.params.slug);
46
+ if (!project) error(404, 'Not found');
47
+ return { project };
48
+ };
49
+ ```
50
+
51
+ `cms.read` returns `{ id, data }` or null. Without an authenticated `cmsPreview` request it reads only published data. Preview uses an entry ID and the existing session; it is not an anonymous token. The loader and hook set `private, no-store` and noindex. A draft can preview at a developer-defined path before publication. Do not prerender preview-aware routes or independently cache their draft data. Each route must opt in by calling the preview-aware loader.
52
+
53
+ Other server APIs:
54
+
55
+ - `cms.content.published(blueprint, slug?)`: list public snapshots.
56
+ - `cms.content.resolveRelation(id)`: resolve an entry's current published snapshot.
57
+ - `cms.content.get/list/save/publish`: private authoring methods; use them only in authenticated server code.
58
+ - `cms.media.publicAsset(id, overrides?)`: asset metadata and active variants with delivery URLs only when referenced by published content, otherwise null. Optional row overrides apply to this result only.
59
+ - `cms.media.publicGallery(rows, field?)`: ordered `{ image, caption, asset }` items; applies only the overrides enabled by the supplied gallery field. Omitting the field uses asset defaults. Missing/unavailable assets are omitted.
60
+ - `cms.media.updateMetadata(id, metadata)`: validates and saves file metadata; private authoring API.
61
+ - `Image`: consumer Svelte component with automatic responsive sizing and a `preset` override. See [consumer images](media.md#consumer-image-component).
62
+ - `imageSources(asset, preset)`: URL, dimensions, alt, and format-specific srcsets for custom markup.
63
+ - `cms.media.previewAsset(id, overrides?)` and `cms.media.previewGallery(rows, field?)`: metadata for authenticated draft previews; image delivery still requires a CMS session.
64
+ - `renderRichText(json)`: validated, escaped HTML for the supported nodes and marks.
65
+
66
+ Use `{@html renderRichText(value)}` only with that validated renderer. Tiptap JSON accepts paragraphs, headings 2–4, bold, italic, links, lists, and block quotes. It rejects images, code blocks, tables, unsafe links, and unsupported nodes. Arbitrary stored HTML is not supported.
67
+
68
+ Relations store IDs. Published renames resolve without republishing each referring item. Deleting an entry clears its relations in both snapshots and asset credits. Deleting media clears its known content references; public helpers return null for missing media. The editor preserves removed blueprint fields instead of deleting their content implicitly.
69
+
70
+ ## Search metadata
71
+
72
+ SEO fields are ordinary blueprint fields; public routes must render them. The package exports a `Seo` component that renders an escaped, server-rendered `<title>` and optional `<meta name="description">`:
73
+
74
+ ```svelte
75
+ <script lang="ts">
76
+ import { Seo } from '@sandquist-group/sandcms';
77
+ let { data } = $props();
78
+ </script>
79
+
80
+ <Seo
81
+ seo={data.project.data.seo}
82
+ title={data.project.data.title}
83
+ description={data.project.data.summary}
84
+ site={data.site}
85
+ />
86
+ ```
87
+
88
+ Title precedence is `seo.title`, then `title`, then `site.title`. A nonempty site title is appended with `·` unless it matches the page title. Supply the title without a site suffix. Description precedence is `seo.description`, then `description`, then `site.description`. Values are trimmed; blank and non-string values fall through. When no description is available, the meta tag is omitted. The component does not change the visible page heading.
89
+
90
+ Load published site settings in your public `+layout.server.ts`, for example:
91
+
92
+ ```ts
93
+ import { getCMS } from '$lib/server/sandcms';
94
+
95
+ export const load = () => ({
96
+ site: getCMS().content.published('site')[0]?.data ?? { title: 'My website' }
97
+ });
98
+ ```
99
+
100
+ Use one `Seo` component per page and remove any other title/description tags for that page. Public routes remain developer-owned; installing or upgrading SandCMS does not automatically wire these tags into your website. The starter includes project SEO fields and site defaults, but its placeholder homepage needs your own content loader and metadata component.
101
+
102
+ The demo uses project SEO overrides, the home title/introduction, and a fixed registration title/description, with published site defaults and `SandCMS Studio` as the fallback site name. Load site defaults from published content even during page previews: passing a project's `cmsPreview` event to `cms.read('site', event)` looks up the project ID and returns null. Page previews still use draft metadata through `cms.read` and retain the hook's `noindex, nofollow` and `private, no-store` headers. Unpublished site settings never become public defaults.
103
+
104
+ This component covers titles and descriptions. Canonical links, social sharing tags/images, and structured data remain application concerns. For optional CMS-owned `/robots.txt` and `/sitemap.xml` endpoints, see [Robots and sitemap](#robots-and-sitemap).
105
+
106
+ ## File blueprints
107
+
108
+ File blueprints live alongside content blueprints, conventionally in `sandcms/blueprints/files`. They define editable metadata and accepted upload types. They do not appear as content collections in the sidebar.
109
+
110
+ ```yaml
111
+ # sandcms/blueprints/files/image.yaml
112
+ id: image
113
+ kind: file
114
+ label: Image
115
+ accept: [image/jpeg, image/png, image/webp, image/avif, image/gif, image/svg+xml]
116
+ fields:
117
+ alt: { type: text, label: Alternative text }
118
+ ```
119
+
120
+ In `sandcms/config.yaml`, set `media.defaultFileBlueprint: image`. Uploads store the selected file blueprint ID. `media`, `media-list`, and `gallery` fields accept `fileBlueprint: image`; when omitted, the site's default applies. Pickers show matching assets, uploads use that blueprint, and content saves reject mismatched assets. The library has an **Upload as** selector when multiple file blueprints are available. Before 0.5.0, renaming/removing a blueprint used by existing files is a breaking change; recreate affected assets.
121
+
122
+ Without a configured default, SandCMS supplies `default`, with alt text only. A file blueprint with `id: default` replaces this fallback. Legacy `media.photographerCollection` adds a photographer relation to the fallback only; new sites should declare that field in a file blueprint instead. The starter uses an alt-only `image` blueprint. The demo site explicitly adds caption and photographer to its image blueprint to demonstrate those optional fields.
123
+
124
+ Use the existing field types for metadata, including text, selects, booleans, relations, groups and repeatables. File metadata cannot contain media or gallery fields. The top-level key `image` is reserved for gallery references. `accept` contains exact supported image MIME types; it defaults to all supported image types when omitted. Non-image file uploads are not implemented yet, even though the blueprint and metadata model is designed to accommodate them.
125
+
126
+ Metadata is stored separately from technical file information. Saving file details validates configured fields, required values and relation targets. Uploads may initially have incomplete metadata; publishing content checks required metadata on each selected file. Removed metadata keys remain stored, but are omitted from the public metadata result. Relations are IDs; use `cms.content.resolveRelation` for custom relations. Deleting an entry clears known relations in file metadata too.
127
+
128
+ `cms.media.publicAsset(id)` returns `blueprint` and `metadata` alongside image variants. `alt` and `photographer` remain convenience properties when those conventional fields are configured. `photographer` is resolved only when it is a relation to a published entry. Shared metadata edits apply immediately wherever defaults are inherited.
129
+
130
+ ## Galleries and project-specific metadata
131
+
132
+ A `gallery` field provides multiple uploads and library selections, drag-and-drop ordering, and keyboard/touch arrow controls. It has **no metadata controls by default**.
133
+
134
+ ```yaml
135
+ gallery:
136
+ type: gallery
137
+ fileBlueprint: image
138
+ overrides: [alt] # Optional; only fields declared by this file blueprint are valid.
139
+ ```
140
+
141
+ To offer captions or credits, first add them to the file blueprint, then opt in to their gallery overrides:
142
+
143
+ ```yaml
144
+ # Additional file blueprint fields
145
+ caption: { type: text }
146
+ photographer: { type: relation, collection: photographers }
147
+ # Gallery setting: overrides: [alt, caption, photographer]
148
+ ```
149
+
150
+ Rows remain ordered objects: `{ image, ...overrides }`. Missing or null overrides inherit file defaults. An empty string, false, or empty list is an explicit override. For example, empty alt text marks an image as decorative, and an empty relation removes a credit. **Use asset …** removes that row's override. Overrides never change the shared file. Only configured overrides affect the public result; removed/disabled override values remain stored so a blueprint edit does not destroy content.
151
+
152
+ Public routes must pass the gallery field configuration:
153
+
154
+ ```ts
155
+ const field = cms.content.blueprint('projects').fields.gallery;
156
+ const gallery = cms.media.publicGallery(project.data.gallery, field);
157
+ // Pass item.asset to imageSources; read custom values from item.asset.metadata.
158
+ // item.caption, item.asset.alt and item.asset.photographer are convenience values.
159
+ ```
160
+
161
+ Required file fields can be satisfied by gallery overrides. Relation overrides are indexed and validated; deleting a referenced entry clears an explicit override without silently restoring the file's default relation.
162
+
163
+ ## Moving from pre-0.5.0 configuration
164
+
165
+ Use file blueprints for metadata, `fileBlueprint` for media selection, and `overrides` for gallery overrides. Authoring code reads `asset.metadata.alt` and `asset.metadata.photographer`; updates use `cms.media.updateMetadata(id, metadata)` or a `{ id, metadata }` body to `/api/cms/media/update`. Public asset helpers still expose the convenience `alt` and `photographer` values. No conversion from earlier media columns or gallery configurations is provided. Update project configuration to this format and recreate affected content/assets; incompatible pre-0.5.0 database baselines require a fresh database. From 0.5.0, package schema changes use retained incremental migrations. See [development and reset policy](upgrades.md).
166
+
167
+ An explicit empty alt override stays empty. Remove the key (or choose **Use asset alternative text**) to inherit the asset default.
168
+
169
+ ## Robots and sitemap
170
+
171
+ Enable CMS-owned `/robots.txt` and `/sitemap.xml` responses in your server's `createCMS` options:
172
+
173
+ ```ts
174
+ seo: {
175
+ routes: { home: '/', projects: '/projects/{slug}' },
176
+ pages: ['/contact']
177
+ }
178
+ ```
179
+
180
+ The existing `cmsHandle` serves both endpoints at request time; no route files, generated disk files, build step, or database migration are needed. Robots and sitemap endpoints are disabled when `seo` is omitted; the `Seo` metadata component works independently. When enabled, these two paths belong to the CMS: remove conflicting static files or application endpoints. The install template leaves this option commented out until your public routes exist.
181
+
182
+ `routes` maps page and collection blueprint IDs to their canonical public paths. Pages appear only after publication; collections require one `{slug}` placeholder and a top-level `slug` field. URLs use published slugs, so draft edits cannot change the sitemap. Unpublishing removes an entry on the next request. Only explicitly mapped blueprints are included; `preview` is not used as an indexing instruction. `pages` adds routes that exist independently of CMS publication. Paths must start with `/`, with no query string or fragment. Match your application's trailing-slash policy.
183
+
184
+ Absolute URLs use the configured `origin` (`SANDCMS_ORIGIN` in the standard integration), never the incoming Host header. Robots allows crawling by default, disallows `/admin` and `/api/cms/`, and advertises the sitemap. Existing authentication and preview noindex protections still apply; robots rules are not access controls.
185
+
186
+ Both endpoints support GET and HEAD and send `Cache-Control: no-store` so publishing changes are visible immediately. XML is escaped and URLs are deduplicated. No estimated modification dates, priorities, or change frequencies are emitted. This helper supports one sitemap up to 50,000 URLs and 50 MB; larger sites should omit `seo` and implement a sitemap index. These limits and XML requirements follow the [Sitemap protocol](https://www.sitemaps.org/protocol.html).
187
+
188
+ For custom application-owned endpoints, `cms.seo.robots()` and `cms.seo.sitemap()` return the generated strings when SEO is enabled. To override the standard responses, handle those paths before calling `cmsHandle` in your hook.
@@ -0,0 +1,89 @@
1
+ # Deployment and operations
2
+
3
+ Run one long-lived Bun website container with a persistent writable volume. The public website, admin, auth, SQLite, and job runner stay in that process. The project media Worker/R2 bucket are deployed separately; follow [Cloudflare setup and proxy caching](cloudflare.md) for those resources and the website CDN.
4
+
5
+ The repository pins Bun 1.4.0, SvelteKit 2.70.3, Svelte 5.57.1, and community `svelte-adapter-bun` 1.0.1. The production adapter output is tested under Bun. Build tooling also uses pinned Node 26.8.1. [Railpack detects Bun from packageManager or its lockfile](https://railpack.com/languages/bun/); `railpack.json` makes the build/start commands explicit.
6
+
7
+ ## Server build configuration
8
+
9
+ The starter includes this server configuration in `vite.config.ts`. For existing sites, merge it into the developer-owned configuration, preserving other plugins and SSR options:
10
+
11
+ ```ts
12
+ ssr: {
13
+ external: ['bun:sqlite'],
14
+ noExternal: ['@better-auth/core']
15
+ }
16
+ ```
17
+
18
+ Vite must bundle `@better-auth/core` using its server export conditions before `svelte-adapter-bun` 1.0.1 performs its second bundle pass. Otherwise the adapter can select Better Auth's browser async-storage fallback, which loses request state during concurrent requests and produces HTTP 500 responses for image previews. Do not also list `@better-auth/core` in `ssr.external`: explicit external entries take precedence over `noExternal`. See [Vite SSR options](https://vite.dev/config/ssr-options).
19
+
20
+ Rebuild and restart the website after this configuration change. It requires no database reset or Worker update. Setup and upgrade preserve existing Vite files and report the required change.
21
+
22
+ ## Host configuration
23
+
24
+ - Build: `bun run build`; start: `bun build/index.js`.
25
+ - Mount a local persistent volume at `/data`, and set `SANDCMS_DATABASE=/data/sandcms.sqlite`.
26
+ - Set `BODY_SIZE_LIMIT=101M` for the Bun adapter and allow 100 MB files plus multipart overhead through upstream proxies.
27
+ - Set `SANDCMS_ORIGIN=https://your-site.example` and adapter `ORIGIN` to the same public origin.
28
+ - Supply a stable random `SANDCMS_SECRET` with at least 32 characters and the project's `SANDCMS_WORKER_TOKEN`.
29
+ - Set `SANDCMS_WORKER_URL` only if overriding the tracked media URL for this environment.
30
+ - Set `PORT` to the host's assigned port. Route both the public website and `/admin` to this container.
31
+ - Keep one application instance per database volume; the SQLite volume must support local filesystem locking. Do not use an object-store mount or an unproven network filesystem.
32
+
33
+ `.dockerignore` excludes local credentials, databases, local R2 state, and build/test artifacts from the build context. Do not create accounts during image builds. The adapter may report `bun:sqlite` as an external module during bundling; it is intentionally provided by Bun at runtime.
34
+
35
+ ## Migrate and bootstrap the actual production volume
36
+
37
+ After building and mounting the volume, use the host's operator command facility or a temporary container with the **same** volume:
38
+
39
+ ```sh
40
+ bun x --no-install sandcms migrate --check --database /data/sandcms.sqlite
41
+ bun x --no-install sandcms migrate --database /data/sandcms.sqlite
42
+ bun x --no-install sandcms user bootstrap --database /data/sandcms.sqlite --email admin@example.com
43
+ ```
44
+
45
+ In this source repository's demo image, use `bun dist/cli/index.js` in place of `bun x --no-install sandcms`. From 0.5.0, apply retained incremental migrations to upgrade supported databases. Changed pre-0.5.0 baselines still require a fresh database. If retaining the old state, take a verified backup with the matching old package before updating. See [upgrade workflow](upgrades.md). The app refuses to start with pending or incompatible migrations. Each numbered migration runs transactionally. Bootstrap only works when the selected database has no users, generates a password, and prints it once. A local account does not create a production account.
46
+
47
+ For a one-off Docker command, override Railpack's shell entrypoint with `--entrypoint bun`, then pass `dist/cli/index.js migrate` after the image name. Mount the same `/data` volume and supply runtime variables. See the [local container drill](acceptance.md) for the tested setup.
48
+
49
+ A new user added later must have an operator/admin-supplied password. The CLI prompts without echo; automation may use `--password-stdin`. Both paths require a change at first login. Password and 2FA recovery invalidate sessions and write audit metadata:
50
+
51
+ ```sh
52
+ bun x --no-install sandcms user add --email editor@example.com --role editor
53
+ bun x --no-install sandcms user reset-password --email editor@example.com
54
+ bun x --no-install sandcms user reset-2fa --email editor@example.com
55
+ ```
56
+
57
+ HTTPS origins use secure cookies. CMS writes validate origin, authentication is enforced server-side, and logins have per-email and per-client limits. By default the application does not read proxy IP headers. Only set `SANDCMS_TRUSTED_PROXY_HEADER` after the reverse proxy strips/replaces the chosen header and the application cannot be reached around that proxy. Configure the adapter's client-address handling consistently. A wrongly trusted forwarded header defeats client rate limiting.
58
+
59
+ ## Consistent backups
60
+
61
+ ```sh
62
+ bun x --no-install sandcms backup --database /data/sandcms.sqlite --output /backups/site-2026-09-25.sqlite
63
+ ```
64
+
65
+ This uses SQLite `VACUUM INTO`, validates integrity, foreign keys and migration history, then installs the snapshot at the requested path. The output is a local artifact with restrictive permissions. Never copy a live WAL-mode `.sqlite` file by itself. Scheduling, destination, encryption, retention, and deletion policy belong to the operator.
66
+
67
+ ## Offline restore drill
68
+
69
+ 1. Stop every website process using the volume; disable automatic restarts during the restore.
70
+ 2. Run a one-off command/container mounting the same volume and backup.
71
+ 3. Restore, explicitly confirming the displayed target:
72
+
73
+ ```sh
74
+ bun x --no-install sandcms restore --database /data/sandcms.sqlite --from /backups/site-2026-09-25.sqlite
75
+ ```
76
+
77
+ The CLI verifies the backup and schema, obtains an exclusive lock on `sandcms.sqlite.guard.sqlite`, creates a verified `before-restore` safety snapshot, checkpoints WAL, and replaces the target. Every CMS database connection holds a shared guard lock for its lifetime, so an in-use restore is refused. Keep the guard file with the database; do not delete it to bypass the check. Raw external SQLite tools that do not honor this guard must also be stopped. `--yes` is an explicit noninteractive restore confirmation; it does not bypass locking.
78
+
79
+ Restart the application and verify content, sign-in, media links, and inbox. Restoring SQLite does not restore deleted R2 objects; an operator requiring media disaster recovery must back up the R2 bucket separately. The CMS does not select that storage or policy.
80
+
81
+ ## Dokploy example and pending host proof
82
+
83
+ In Dokploy, select Railpack, mount the persistent volume, configure runtime secrets, and run the production bootstrap command against that volume. Deploy a second image to prove content survives replacement, then perform the offline restore drill. Actual Dokploy access was intentionally deferred, so this host proof remains a release gate.
84
+
85
+ The team's discussed nightly 03:00 backup to Hetzner Object Storage with 30-day expiry is an operator choice, not a package default. A host-managed named-volume backup may stop the container for consistency; the portable CLI snapshot remains available on other hosts.
86
+
87
+ ## Transactional email
88
+
89
+ Optional SMTP sending is configured with private `SANDCMS_EMAIL_*` and `SANDCMS_SMTP_*` environment variables. See [transactional email](email.md) for setup, local mail capture and the server API. Sending is direct with no automatic retries; SMTP availability does not block startup. Existing customized integrations must wire `emailOptionsFromEnv(env)` into `createCMS()` to enable these settings.
package/docs/email.md ADDED
@@ -0,0 +1,124 @@
1
+ # Transactional email
2
+
3
+ SandCMS provides optional SMTP sending through `cms.email.send()`. This is a server-only TypeScript API for trusted application code. It has no general-purpose HTTP sending endpoint. Built-in invitations, password resets and optional form notifications use this same service.
4
+
5
+ ## Configuration
6
+
7
+ Set private environment variables in `.env.local` for development or your deployment environment:
8
+
9
+ ```dotenv
10
+ SANDCMS_EMAIL_FROM="Example <notifications@example.com>"
11
+ SANDCMS_EMAIL_REPLY_TO=help@example.com
12
+ SANDCMS_SMTP_HOST=smtp.example.com
13
+ SANDCMS_SMTP_PORT=587
14
+ SANDCMS_SMTP_SECURE=false
15
+ SANDCMS_SMTP_USER=your-smtp-user
16
+ SANDCMS_SMTP_PASSWORD=your-smtp-password
17
+ ```
18
+
19
+ The sender must be allowed by your SMTP provider. Reply-to is optional. Credentials must be supplied together or both omitted for a relay that does not require authentication. Keep credentials out of YAML, source control and browser code.
20
+
21
+ Port 587 requires STARTTLS. Port 465 requires immediate TLS (`SANDCMS_SMTP_SECURE=true`, or omit the flag when specifying port 465). With no port, the default is 465 when secure is true and 587 otherwise. Certificate validation is always enabled. Boolean values must be exactly `true` or `false`.
22
+
23
+ Email is disabled when all email variables are absent or empty. `cms.email.enabled` reports configuration availability, not server connectivity. Partial or invalid configuration fails when the CMS is created; an unreachable provider fails only when sending. Startup does not contact the SMTP server.
24
+
25
+ The generated integration and repository demo read these variables. For an existing customized integration, add the option yourself:
26
+
27
+ ```ts
28
+ import { env } from '$env/dynamic/private';
29
+ import { createCMS, emailOptionsFromEnv } from '@sandquist-group/sandcms/server';
30
+
31
+ const cms = createCMS({
32
+ database: env.SANDCMS_DATABASE!,
33
+ origin: env.SANDCMS_ORIGIN!,
34
+ secret: env.SANDCMS_SECRET!,
35
+ email: emailOptionsFromEnv(env)
36
+ });
37
+ ```
38
+
39
+ ## Sending
40
+
41
+ Call from server code and await the result:
42
+
43
+ ```ts
44
+ import { EmailError } from '@sandquist-group/sandcms/server';
45
+ import { getCMS } from '$lib/server/sandcms';
46
+
47
+ try {
48
+ const result = await getCMS().email.send({
49
+ to: 'customer@example.com',
50
+ subject: 'Your request was received',
51
+ text: 'Thank you. We will respond shortly.',
52
+ html: '<p>Thank you. We will respond shortly.</p>',
53
+ replyTo: 'support@example.com'
54
+ });
55
+ // result: { accepted: true, messageId: string }
56
+ } catch (error) {
57
+ if (!(error instanceof EmailError)) throw error;
58
+ // Decide whether this application's operation should continue.
59
+ console.error('Email failed:', error.code);
60
+ }
61
+ ```
62
+
63
+ Each message accepts one bare recipient address. A nonempty subject and plain-text body are required; HTML is optional. Escape untrusted values when composing HTML. The configured sender may include a simple display name (`Example <sender@example.com>`). Reply-to accepts one bare address and can override the configured default. Attachments, recipient lists, arbitrary headers and per-message sender overrides are not supported.
64
+
65
+ `EmailError.code` is `NOT_CONFIGURED`, `CONFIGURATION`, `INVALID_MESSAGE` or `SEND_FAILED`. Send errors exclude raw provider responses, credentials and message content. The service does not log or store messages.
66
+
67
+ Success means the SMTP server accepted the message, not that it reached an inbox. Delivery is direct, with no queue, automatic retries or bounce tracking. The sending service itself does not persist messages; the built-in workflows store link hashes and send outcomes as described below. DNS, connection and greeting timeouts are 10 seconds; socket inactivity times out after 30 seconds. These are stage/inactivity limits, not a total send deadline. A failed connection can leave delivery uncertain. Applications decide whether to ignore failures or retry; retries can duplicate a message.
68
+
69
+ ## Local mail capture
70
+
71
+ Run a local SMTP mail catcher, then configure:
72
+
73
+ ```dotenv
74
+ SANDCMS_EMAIL_FROM=local@example.com
75
+ SANDCMS_SMTP_HOST=127.0.0.1
76
+ SANDCMS_SMTP_PORT=1025
77
+ SANDCMS_SMTP_SECURE=false
78
+ SANDCMS_SMTP_ALLOW_INSECURE_LOCAL=true
79
+ ```
80
+
81
+ Omit credentials unless your local server requires them. The explicit insecure option disables TLS only for `localhost`, `127.0.0.1` or `::1`; it cannot be combined with immediate TLS. Remote SMTP always requires TLS.
82
+
83
+ ## Custom adapters
84
+
85
+ Supply an adapter instead of SMTP settings through `createCMS({ ..., email })`:
86
+
87
+ ```ts
88
+ import type { EmailOptions } from '@sandquist-group/sandcms/server';
89
+
90
+ const email: EmailOptions = {
91
+ from: 'notifications@example.com',
92
+ adapter: {
93
+ async send(message) {
94
+ // Send via your provider using message.from, to, subject, text,
95
+ // optional html and replyTo. Return only after acceptance.
96
+ return { accepted: true, messageId: 'provider-message-id' };
97
+ }
98
+ }
99
+ };
100
+ ```
101
+
102
+ Adapters receive validated messages and implement their own connection handling. Adapter failures become redacted `SEND_FAILED` errors. `createEmail()` is also exported for standalone use without a CMS database.
103
+
104
+ The SMTP adapter uses [Nodemailer's SMTP transport](https://nodemailer.com/smtp).
105
+
106
+ ## Member invitations and password resets
107
+
108
+ With email configured, admins can use **Users → Invite user** to invite an admin or editor. The recipient chooses their own name and password. Invitations expire after seven days, are single-use, and store only a token hash. Pending invitations show email acceptance/failure and support resend and revoke. Resending invalidates the earlier link. Manual account creation with a temporary password remains available.
109
+
110
+ The login screen offers **Forgot password?** when email is configured. Reset requests return the same message for unknown accounts and failed sends. Reset links expire after one hour, work once, and are invalidated by another request or a password change. Completing a reset revokes all sessions and preserves two-factor authentication; the user must sign in again. Public requests are rate-limited by client address and reset requests by email address. Links use the configured CMS origin and keep their token in the URL fragment, which is removed when the page loads. Keep the full link when opening it.
111
+
112
+ A provider accepting an email does not confirm inbox delivery. An interrupted send can leave an uncertain outcome; resending can duplicate an email. Nothing retries automatically. SMTP failures appear on invitations; reset requests deliberately do not disclose account existence or delivery status.
113
+
114
+ ## Form notifications
115
+
116
+ Admins configure each form through **Forms → Notifications**. Settings are stored in the database, are disabled by default, and require configured email to enable. Select CMS users and/or additional addresses such as a shared inbox (up to 20 recipients total). Selected users resolve to their current email address when sending; duplicate addresses receive one message. If selected users have been removed, update the recipients.
117
+
118
+ The default email contains a notification and a link to the submission in the admin. Alternatively, choose individual fields to include. Nested groups are expanded into individual fields; repeated groups, files, galleries and rich text are excluded. New or unselected fields are never automatically included. A text field can supply reply-to when its submitted value is a valid bare email address; otherwise the configured default is used. Emails include a simple HTML layout using the CMS purple and stone palette, plus a plain-text alternative. Invitations and password resets use the same layout with a prominent action button and a fallback link. Submitted values are escaped before inclusion in HTML.
119
+
120
+ Always **await `cms.forms.submit(...)`**. Accepted submissions are saved before email is attempted, and SMTP failure does not reject the submission. Honeypots and rejected submissions do not send notifications. Sending is direct and adds the provider's response time to the request.
121
+
122
+ The submission view shows the latest attempt and each recipient's acceptance/failure. Staff can resend using current notification settings; this sends to all currently configured recipients, including those whose previous email was accepted. A process interruption may leave “sending or outcome unknown”; wait two minutes before attempting another send. The feature does not automatically recover interrupted sends. Deleted submissions cannot be resent; deleting a submission cannot recall email already sent.
123
+
124
+ These features change the pre-0.5.0 schema. Use a fresh database and bootstrap accounts explicitly when adopting the changed baseline; see [upgrades](upgrades.md). No database is automatically reset.
package/docs/forms.md ADDED
@@ -0,0 +1,18 @@
1
+ # Forms and submissions
2
+
3
+ Public form markup and validation belong to the website. SandCMS provides storage and an inbox, not a form builder or generic public endpoint.
4
+
5
+ ```ts
6
+ const result = await cms.forms.submit('registration', validatedData, {
7
+ clientKey: event.getClientAddress(),
8
+ honeypot: String(formData.get('website_url') ?? '')
9
+ });
10
+ ```
11
+
12
+ The helper accepts plain JSON objects up to 64 KB, rejects cycles, non-finite numbers, reserved keys, and excessive nesting, silently ignores filled honeypots, and applies a durable per-form/per-client limit of five accepted attempts per minute. Supply a server-derived client identity. Never pass a browser-provided identity or trust proxy headers without configuring your host's trusted proxy chain.
13
+
14
+ Form YAML supplies stable IDs, labels, optional nested field groups, list `columns`, and `export` ordering. Each accepted submission stores its own blueprint snapshot so prior labels and export columns remain readable after changes. Both CMS roles can read, mark read/unread, export CSV, and delete. Export preserves historical field labels and guards formula-like spreadsheet cells.
15
+
16
+ `src/routes/(site)/registration` demonstrates native `use:enhance`, participant name, birth date, contact/address, program selection, gender, prior experience, and conditional guardian contact. The server independently checks the participant's age and requires guardian contact under 18; changing client-side markup cannot bypass that validation.
17
+
18
+ Submissions stay until a staff member deletes them. Company review policy and deletion from backups are operator responsibilities. Admins can enable email notifications per form, choose recipients and selected fields, and inspect send outcomes in the inbox. See [transactional email](email.md#form-notifications). There are no replies, assignments, attachment uploads, or CMS retention schedules.