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
package/LICENSE ADDED
@@ -0,0 +1,57 @@
1
+ # PolyForm Strict License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/strict/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose, other than distributing the software or making changes or new works based on the software.
12
+
13
+ ## Patent License
14
+
15
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
16
+
17
+ ## Noncommercial Purposes
18
+
19
+ Any noncommercial purpose is a permitted purpose.
20
+
21
+ ## Personal Uses
22
+
23
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
24
+
25
+ ## Noncommercial Organizations
26
+
27
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
28
+
29
+ ## Fair Use
30
+
31
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
32
+
33
+ ## No Other Rights
34
+
35
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
36
+
37
+ ## Patent Defense
38
+
39
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
40
+
41
+ ## Violations
42
+
43
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
44
+
45
+ ## No Liability
46
+
47
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
48
+
49
+ ## Definitions
50
+
51
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
52
+
53
+ **You** refers to the individual or entity agreeing to these terms.
54
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
55
+ **Your licenses** are all the licenses granted to you for the software under these terms.
56
+
57
+ **Use** means anything you do with the software requiring one of your licenses.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # SandCMS
2
+
3
+ **0.5.1** adds raster uploads up to 100 MB and images up to 100 MP using remote image transformations. Upgrade the website and protocol-3 media Worker together. Existing configured upload limits are preserved, and no database migration is required from 0.5.0. See the [0.5.1 release notes](docs/releases.md#051), [upgrade workflow](docs/upgrades.md) and [agent instructions](AGENTS.md).
4
+
5
+ SandCMS embeds a content workspace into a SvelteKit website. Developers own YAML blueprints and public routes; editors manage drafts, publication, images, and form submissions at `/admin`.
6
+
7
+ This repository contains the `@sandquist-group/sandcms` package and a working example website. The private npm package includes the CMS, the `sandcms` CLI, and a minimal SvelteKit starter. See [publishing from macOS](docs/package.md#publish-from-macos) for release commands.
8
+
9
+ ## Run locally
10
+
11
+ Requires Bun **1.4.0**. Node **26.8.1** is used by build tooling and Wrangler; the website runs on Bun.
12
+
13
+ ```sh
14
+ bun install --frozen-lockfile
15
+ bun run dev:init
16
+ bun run dev
17
+ ```
18
+
19
+ Open **http://localhost:5410/admin**. `dev:init` creates an ignored local environment file, applies migrations to `./data/sandcms.sqlite`, and, on an empty database, prints a one-time temporary password for `admin@example.test`. Change it at first sign-in. Rerunning with the same database baseline preserves accounts and content. For an existing local account whose password you no longer have:
20
+
21
+ ```sh
22
+ bun run cli user reset-password --email admin@example.test
23
+ ```
24
+
25
+ For local image processing, follow [Cloudflare local setup](docs/cloudflare.md#local-development). The same guide covers staging, production, and website proxy caching.
26
+
27
+ To open the preview from another device over ZeroTier, stop the ordinary dev/preview server and run:
28
+
29
+ ```sh
30
+ bun run build
31
+ bun run preview:network 10.123.59.34 # Use this machine's assigned ZeroTier IPv4 address.
32
+ ```
33
+
34
+ Open `https://10.123.59.34:5443/admin` and accept the local certificate prompt. HTTP port 5410 redirects to it. The helper keeps the configured origin, secure cookies, and media delivery on the same HTTPS address, with the website backend bound to loopback. Start the local Worker on port 8787 for images. Certificates are generated under ignored `data/preview-tls`; production uses the host's trusted HTTPS certificate. The ordinary localhost environment remains unchanged.
35
+
36
+ ## Included
37
+
38
+ - Supplied shadcn-svelte preset **bKGkRF44**: Lyra, stone, Geist, fuchsia, square corners. Admin CSS and fonts are compiled and scoped inside the package; consuming websites need no Tailwind.
39
+ - Validated YAML pages, site settings, collections, and form metadata. All planned field types, nested groups, ordered repeatable groups, stable relations, and focused Tiptap rich text.
40
+ - Independent draft/published snapshots, conflict detection, authenticated draft preview, required-field validation, and media readiness gates.
41
+ - Better Auth password sign-in, optional TOTP and recovery codes, temporary-password changes, two roles, and operator recovery. No public registration or email services.
42
+ - Durable SQLite upload spool and variant jobs, private originals, named versioned variants, sanitized SVG, global media selection, credits, usage warnings, and rebuilds.
43
+ - Developer-owned form actions, honeypot/rate limiting, schema snapshots, read/unread inbox, deletion, and safe CSV exports.
44
+ - Safe setup/upgrade manifests, a frozen SQL baseline and incremental migration runner, doctor, Worker deployment commands, verified live backups, and guarded offline restores.
45
+
46
+ ## Package use
47
+
48
+ ```sh
49
+ bun run package
50
+ bun pm pack --ignore-scripts --filename /tmp/sandcms.tgz
51
+ # In an empty directory or existing SvelteKit site:
52
+ bun dist/cli/index.js setup --cwd /path/to/site --package /tmp/sandcms.tgz
53
+ ```
54
+
55
+ For a reproducible local archive installation, use the explicit commands in the [package guide](docs/package.md). Setup previews changes, preserves existing hooks/configuration and customized generated files, and can optionally configure Cloudflare. Public project routes are written by the website developer.
56
+
57
+ ## Verification
58
+
59
+ ```sh
60
+ bun run check
61
+ bun test tests
62
+ bun run build
63
+ bun x playwright install chromium
64
+ bun run test:e2e
65
+ bun run test:package
66
+ ```
67
+
68
+ Stop the dev server before building. Browser tests use the production Bun server, isolated SQLite, and a local Wrangler Worker. Package tests install the archive into both a blank directory and an existing site. Tests do not use production resources. See [acceptance evidence and remaining external checks](docs/acceptance.md).
69
+
70
+ ## Guides
71
+
72
+ - [Installation and private packaging](docs/package.md)
73
+ - [Blueprints and runtime API](docs/content.md)
74
+ - [Media, publication, and images](docs/media.md)
75
+ - [Cloudflare Workers, R2, and proxy caching](docs/cloudflare.md)
76
+ - [Forms and submissions](docs/forms.md)
77
+ - [Deployment, backups, and recovery](docs/deployment.md)
78
+ - [Updates and file ownership](docs/upgrades.md)
79
+
80
+ ## License
81
+
82
+ SandCMS is licensed under the [PolyForm Strict License 1.0.0](LICENSE). See the license for permitted uses and terms.
83
+
84
+ Source is organized into `src/lib/blueprints`, `server`, `admin`, `worker`, and `cli`. `src/routes/(site)` demonstrates developer-owned pages; `(sandcms)` is the thin integration layer. Never commit content databases, secrets, or bootstrap passwords.
@@ -0,0 +1,53 @@
1
+ <script module lang="ts">
2
+ import type { HTMLImgAttributes } from 'svelte/elements';
3
+ import type { PublicMedia } from './media.js';
4
+
5
+ export type ImageProps = Omit<HTMLImgAttributes, 'src' | 'srcset' | 'children'> & {
6
+ asset: PublicMedia | null | undefined;
7
+ /** Named CMS preset. */
8
+ preset?: string;
9
+ };
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import { imageSources } from './media.js';
14
+
15
+ let {
16
+ asset,
17
+ preset = 'card',
18
+ alt,
19
+ width,
20
+ height,
21
+ sizes,
22
+ loading = 'lazy',
23
+ decoding = 'async',
24
+ ...attributes
25
+ }: ImageProps = $props();
26
+
27
+ const image = $derived(imageSources(asset, preset));
28
+ // Native auto sizing uses the rendered width for lazy images. Older browsers
29
+ // and eager images use the supplied width or viewport as a fallback.
30
+ const fallbackSizes = $derived(
31
+ sizes ??
32
+ (Number(width) > 0 ? `(max-width: ${Number(width)}px) 100vw, ${Number(width)}px` : '100vw')
33
+ );
34
+ const responsiveSizes = $derived(loading === 'lazy' ? `auto, ${fallbackSizes}` : fallbackSizes);
35
+ </script>
36
+
37
+ {#if image}
38
+ <picture>
39
+ {#each image.sources as source}
40
+ <source type={source.type} srcset={source.srcset} sizes={responsiveSizes} />
41
+ {/each}
42
+ <img
43
+ {...attributes}
44
+ src={image.src}
45
+ alt={alt ?? image.alt}
46
+ width={width ?? image.width}
47
+ height={height ?? image.height}
48
+ sizes={responsiveSizes}
49
+ {loading}
50
+ {decoding}
51
+ />
52
+ </picture>
53
+ {/if}
@@ -0,0 +1,10 @@
1
+ import type { HTMLImgAttributes } from 'svelte/elements';
2
+ import type { PublicMedia } from './media.js';
3
+ export type ImageProps = Omit<HTMLImgAttributes, 'src' | 'srcset' | 'children'> & {
4
+ asset: PublicMedia | null | undefined;
5
+ /** Named CMS preset. */
6
+ preset?: string;
7
+ };
8
+ declare const Image: import("svelte").Component<ImageProps, {}, "">;
9
+ type Image = ReturnType<typeof Image>;
10
+ export default Image;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import type { Json, Payload } from './blueprints/types.js';
3
+
4
+ export interface SeoProps {
5
+ seo?: Json;
6
+ title?: Json;
7
+ description?: Json;
8
+ site?: Payload | null;
9
+ }
10
+
11
+ let { seo, title, description, site }: SeoProps = $props();
12
+ const text = (value: Json | undefined): string => (typeof value === 'string' ? value.trim() : '');
13
+ const overrides = $derived(seo && typeof seo === 'object' && !Array.isArray(seo) ? seo : {});
14
+ const siteTitle = $derived(text(site?.title));
15
+ const pageTitle = $derived(text(overrides.title) || text(title));
16
+ const resolvedTitle = $derived(
17
+ pageTitle && siteTitle && pageTitle !== siteTitle
18
+ ? `${pageTitle} · ${siteTitle}`
19
+ : pageTitle || siteTitle
20
+ );
21
+ const resolvedDescription = $derived(
22
+ text(overrides.description) || text(description) || text(site?.description)
23
+ );
24
+ </script>
25
+
26
+ <svelte:head>
27
+ <title>{resolvedTitle}</title>
28
+ {#if resolvedDescription}<meta name="description" content={resolvedDescription} />{/if}
29
+ </svelte:head>
@@ -0,0 +1,10 @@
1
+ import type { Json, Payload } from './blueprints/types.js';
2
+ export interface SeoProps {
3
+ seo?: Json;
4
+ title?: Json;
5
+ description?: Json;
6
+ site?: Payload | null;
7
+ }
8
+ declare const Seo: import("svelte").Component<SeoProps, {}, "">;
9
+ type Seo = ReturnType<typeof Seo>;
10
+ export default Seo;
@@ -0,0 +1,129 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import type { AdminData } from './types.js';
4
+ import { api, message } from './client.js';
5
+ import * as Card from './components/ui/card/index.js';
6
+ import { Button } from './components/ui/button/index.js';
7
+ import { Input } from './components/ui/input/index.js';
8
+ import { Label } from './components/ui/label/index.js';
9
+ let { data }: { data: AdminData } = $props();
10
+ let token = $state(''),
11
+ name = $state(''),
12
+ email = $state(''),
13
+ password = $state(''),
14
+ confirmation = $state(''),
15
+ busy = $state(false),
16
+ error = $state(''),
17
+ done = $state(false),
18
+ ready = $state(false);
19
+ const request = $derived(data.screen === 'forgot-password');
20
+ const invite = $derived(data.screen === 'invite');
21
+ onMount(() => {
22
+ token = window.location.hash.slice(1);
23
+ history.replaceState(null, '', window.location.pathname);
24
+ ready = true;
25
+ });
26
+ async function submit() {
27
+ error = '';
28
+ if (!request && password !== confirmation) {
29
+ error = 'Passwords must match';
30
+ return;
31
+ }
32
+ busy = true;
33
+ try {
34
+ await api(
35
+ request ? 'access/request-reset' : 'access/redeem',
36
+ request ? { email } : { kind: invite ? 'invite' : 'reset', token, name, password }
37
+ );
38
+ done = true;
39
+ token = password = confirmation = '';
40
+ } catch (cause) {
41
+ error = message(cause);
42
+ } finally {
43
+ busy = false;
44
+ }
45
+ }
46
+ </script>
47
+
48
+ <svelte:head><meta name="referrer" content="no-referrer" /></svelte:head>
49
+ <div class="cms-login">
50
+ <Card.Root class="cms-login-card">
51
+ <h1>
52
+ {request
53
+ ? 'Reset your password'
54
+ : invite
55
+ ? 'Accept your invitation'
56
+ : 'Choose a new password'}
57
+ </h1>
58
+ {#if !data.emailEnabled}<p>Email access is unavailable. Contact your website administrator.</p>
59
+ {:else if done}<p role="status">
60
+ {request
61
+ ? 'If an account matches that address, a password reset link will be emailed. Please check your inbox.'
62
+ : 'Your password is set. You can now sign in.'}
63
+ </p>
64
+ {:else if ready && !request && !token}<p role="alert">
65
+ This link is missing its token. Open the full link from your email or request a new one.
66
+ </p>
67
+ {:else}<form
68
+ class="cms-stack"
69
+ onsubmit={(e) => {
70
+ e.preventDefault();
71
+ submit();
72
+ }}
73
+ >
74
+ {#if request}<div class="cms-field">
75
+ <Label for="reset-email">Email address</Label><Input
76
+ id="reset-email"
77
+ type="email"
78
+ autocomplete="email"
79
+ bind:value={email}
80
+ required
81
+ />
82
+ </div>
83
+ {:else}
84
+ {#if invite}<div class="cms-field">
85
+ <Label for="invite-name">Your name</Label><Input
86
+ id="invite-name"
87
+ autocomplete="name"
88
+ maxlength={200}
89
+ bind:value={name}
90
+ required
91
+ />
92
+ </div>{/if}
93
+ <div class="cms-field">
94
+ <Label for="new-password">New password</Label><Input
95
+ id="new-password"
96
+ type="password"
97
+ autocomplete="new-password"
98
+ minlength={12}
99
+ maxlength={128}
100
+ bind:value={password}
101
+ required
102
+ />
103
+ </div>
104
+ <div class="cms-field">
105
+ <Label for="confirm-password">Confirm password</Label><Input
106
+ id="confirm-password"
107
+ type="password"
108
+ autocomplete="new-password"
109
+ minlength={12}
110
+ maxlength={128}
111
+ bind:value={confirmation}
112
+ required
113
+ />
114
+ </div>
115
+ {/if}
116
+ {#if error}<p class="cms-error" role="alert">{error}</p>{/if}
117
+ <Button type="submit" disabled={busy || !ready}
118
+ >{busy
119
+ ? 'Please wait…'
120
+ : request
121
+ ? 'Send reset link'
122
+ : invite
123
+ ? 'Create account'
124
+ : 'Set password'}</Button
125
+ >
126
+ </form>{/if}
127
+ <Button href="/admin/login" variant="link">Back to sign in</Button>
128
+ </Card.Root>
129
+ </div>
@@ -0,0 +1,7 @@
1
+ import type { AdminData } from './types.js';
2
+ type $$ComponentProps = {
3
+ data: AdminData;
4
+ };
5
+ declare const Access: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Access = ReturnType<typeof Access>;
7
+ export default Access;
@@ -0,0 +1,190 @@
1
+ <script lang="ts">
2
+ import * as Card from './components/ui/card/index.js';
3
+ import Notice from './Notice.svelte';
4
+ import { untrack } from 'svelte';
5
+ import type { AdminData } from './types.js';
6
+ import { authClient, message } from './client.js';
7
+ import { Button } from './components/ui/button/index.js';
8
+ import { Input } from './components/ui/input/index.js';
9
+ import { Label } from './components/ui/label/index.js';
10
+ let { data }: { data: AdminData } = $props();
11
+ let current = $state(''),
12
+ password = $state(''),
13
+ confirmation = $state(''),
14
+ twoFactorPassword = $state(''),
15
+ code = $state(''),
16
+ uri = $state(''),
17
+ codes = $state<string[]>([]),
18
+ enabled = $state(untrack(() => !!data.user?.twoFactorEnabled)),
19
+ busy = $state(false),
20
+ error = $state(''),
21
+ notice = $state('');
22
+ async function change() {
23
+ busy = true;
24
+ error = '';
25
+ try {
26
+ if (password !== confirmation) throw new Error('Passwords do not match');
27
+ const result = await authClient.changePassword({
28
+ currentPassword: current,
29
+ newPassword: password,
30
+ revokeOtherSessions: true
31
+ });
32
+ if (result.error) throw new Error(result.error.message);
33
+ if (data.user?.mustChangePassword) window.location.assign('/admin');
34
+ else {
35
+ current = '';
36
+ password = '';
37
+ confirmation = '';
38
+ notice = 'Password changed. Other sessions were signed out.';
39
+ }
40
+ } catch (e) {
41
+ error = message(e);
42
+ } finally {
43
+ busy = false;
44
+ }
45
+ }
46
+ async function toggle() {
47
+ busy = true;
48
+ error = '';
49
+ try {
50
+ if (enabled) {
51
+ const r = await authClient.twoFactor.disable({ password: twoFactorPassword });
52
+ if (r.error) throw new Error(r.error.message);
53
+ enabled = false;
54
+ notice = 'Two-factor authentication disabled.';
55
+ } else {
56
+ const r = await authClient.twoFactor.enable({ password: twoFactorPassword });
57
+ if (r.error) throw new Error(r.error.message);
58
+ if (!r.data || !('totpURI' in r.data)) throw new Error('TOTP setup unavailable');
59
+ uri = r.data.totpURI;
60
+ codes = r.data.backupCodes;
61
+ }
62
+ twoFactorPassword = '';
63
+ } catch (e) {
64
+ error = message(e);
65
+ } finally {
66
+ busy = false;
67
+ }
68
+ }
69
+ async function verify() {
70
+ busy = true;
71
+ error = '';
72
+ try {
73
+ const r = await authClient.twoFactor.verifyTotp({ code });
74
+ if (r.error) throw new Error(r.error.message);
75
+ enabled = true;
76
+ uri = '';
77
+ notice = 'Two-factor authentication enabled. Keep your recovery codes safe.';
78
+ } catch (e) {
79
+ error = message(e);
80
+ } finally {
81
+ busy = false;
82
+ }
83
+ }
84
+ function download() {
85
+ const url = URL.createObjectURL(new Blob([codes.join('\n')], { type: 'text/plain' }));
86
+ const a = document.createElement('a');
87
+ a.href = url;
88
+ a.download = 'sandcms-recovery-codes.txt';
89
+ a.click();
90
+ URL.revokeObjectURL(url);
91
+ }
92
+ </script>
93
+
94
+ <div class="cms-page-heading">
95
+ <div>
96
+ <div class="cms-eyebrow">YOUR ACCOUNT</div>
97
+ <h1>{data.user?.mustChangePassword ? 'Set your own password' : 'Account & security'}</h1>
98
+ <p class="cms-muted">
99
+ {data.user?.mustChangePassword
100
+ ? 'Change your temporary password before opening the workspace.'
101
+ : data.user?.email}
102
+ </p>
103
+ </div>
104
+ </div>
105
+ {#if error}<Notice error>{error}</Notice>{/if}{#if notice}<Notice>{notice}</Notice>{/if}
106
+ <div class="cms-account-grid">
107
+ <Card.Root class="cms-detail-card">
108
+ <h2>Change password</h2>
109
+ <form
110
+ class="cms-stack"
111
+ onsubmit={(e) => {
112
+ e.preventDefault();
113
+ change();
114
+ }}
115
+ >
116
+ <div class="cms-field">
117
+ <Label for="current-password">Current password</Label><Input
118
+ id="current-password"
119
+ type="password"
120
+ autocomplete="current-password"
121
+ bind:value={current}
122
+ required
123
+ />
124
+ </div>
125
+ <div class="cms-field">
126
+ <Label for="new-password">New password</Label><Input
127
+ id="new-password"
128
+ type="password"
129
+ autocomplete="new-password"
130
+ bind:value={password}
131
+ minlength={12}
132
+ maxlength={128}
133
+ required
134
+ />
135
+ </div>
136
+ <div class="cms-field">
137
+ <Label for="confirm-password">Confirm new password</Label><Input
138
+ id="confirm-password"
139
+ type="password"
140
+ autocomplete="new-password"
141
+ bind:value={confirmation}
142
+ minlength={12}
143
+ required
144
+ />
145
+ </div>
146
+ <Button type="submit" disabled={busy}>Change password</Button>
147
+ </form>
148
+ </Card.Root>
149
+ {#if !data.user?.mustChangePassword}<Card.Root class="cms-detail-card">
150
+ <h2>Two-factor authentication</h2>
151
+ <p class="cms-muted">
152
+ {enabled
153
+ ? 'An authenticator protects your account.'
154
+ : 'Add an extra layer of security with your authenticator app.'}
155
+ </p>
156
+ {#if uri}<div class="cms-stack">
157
+ <p>In your authenticator, add an account using this setup key:</p>
158
+ <code class="cms-secret">{new URL(uri).searchParams.get('secret')}</code>
159
+ <p class="cms-muted">Time-based, 6 digits, 30 seconds.</p>
160
+ <Label for="totp">Authenticator code</Label><Input
161
+ id="totp"
162
+ inputmode="numeric"
163
+ autocomplete="one-time-code"
164
+ bind:value={code}
165
+ /><Button disabled={busy} onclick={verify}>Verify and enable</Button>
166
+ </div>{:else}<form
167
+ class="cms-stack"
168
+ onsubmit={(e) => {
169
+ e.preventDefault();
170
+ toggle();
171
+ }}
172
+ >
173
+ <Label for="2fa-password">Confirm with your password</Label><Input
174
+ id="2fa-password"
175
+ type="password"
176
+ autocomplete="current-password"
177
+ bind:value={twoFactorPassword}
178
+ required
179
+ /><Button variant="outline" type="submit" disabled={busy}
180
+ >{enabled ? 'Disable two-factor' : 'Set up two-factor'}</Button
181
+ >
182
+ </form>{/if}{#if codes.length}<div class="cms-recovery">
183
+ <h3>Recovery codes</h3>
184
+ <p class="cms-muted">Store these privately. Each code can be used once.</p>
185
+ <code>{codes.join('\n')}</code><Button variant="outline" onclick={download}
186
+ >Download codes</Button
187
+ >
188
+ </div>{/if}
189
+ </Card.Root>{/if}
190
+ </div>
@@ -0,0 +1,7 @@
1
+ import type { AdminData } from './types.js';
2
+ type $$ComponentProps = {
3
+ data: AdminData;
4
+ };
5
+ declare const Account: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Account = ReturnType<typeof Account>;
7
+ export default Account;
@@ -0,0 +1,42 @@
1
+ <script lang="ts">
2
+ import './generated/admin.css';
3
+ import type { AdminData } from './types.js';
4
+ import Access from './Access.svelte';
5
+ import Login from './Login.svelte';
6
+ import Shell from './Shell.svelte';
7
+ import Dashboard from './Dashboard.svelte';
8
+ import Collection from './Collection.svelte';
9
+ import Editor from './Editor.svelte';
10
+ import MediaLibrary from './MediaLibrary.svelte';
11
+ import Inbox from './Inbox.svelte';
12
+ import Users from './Users.svelte';
13
+ import Account from './Account.svelte';
14
+ let { data }: { data: AdminData } = $props();
15
+ </script>
16
+
17
+ <svelte:head
18
+ ><title>{data.blueprint?.label ?? 'Workspace'} · SandCMS</title><meta
19
+ name="robots"
20
+ content="noindex,nofollow"
21
+ /></svelte:head
22
+ >
23
+ <div class="sandcms-admin">
24
+ <a class="cms-skip" href="#cms-main">Skip to content</a>{#if data.screen === 'login'}<Login
25
+ emailEnabled={data.emailEnabled}
26
+ next={data.next}
27
+ />{:else if ['invite', 'reset-password', 'forgot-password'].includes(data.screen)}<Access
28
+ {data}
29
+ />{:else}<Shell {data}
30
+ >{#key data.screen + ':' + (data.blueprint?.id ?? '') + ':' + (data.entry?.id ?? '') + ':' + String(data.editing)}{#if data.screen === 'content'}{#if data.editing}<Editor
31
+ {data}
32
+ />{:else}<Collection {data} />{/if}{:else if data.screen === 'media'}<MediaLibrary
33
+ {data}
34
+ />{:else if data.screen === 'forms'}<Inbox
35
+ {data}
36
+ />{:else if data.screen === 'users'}<Users
37
+ {data}
38
+ />{:else if data.screen === 'account'}<Account {data} />{:else}<Dashboard
39
+ {data}
40
+ />{/if}{/key}</Shell
41
+ >{/if}
42
+ </div>
@@ -0,0 +1,8 @@
1
+ import './generated/admin.css';
2
+ import type { AdminData } from './types.js';
3
+ type $$ComponentProps = {
4
+ data: AdminData;
5
+ };
6
+ declare const Admin: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type Admin = ReturnType<typeof Admin>;
8
+ export default Admin;