tinyzoo 0.0.0-stage → 0.2.1

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 (392) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +46 -2
  3. package/app/app.config.ts +35 -0
  4. package/app/assets/brand/characters/bright/bird.svg +1 -0
  5. package/app/assets/brand/characters/bright/bunny.svg +1 -0
  6. package/app/assets/brand/characters/bright/elephant.svg +1 -0
  7. package/app/assets/brand/characters/bright/fox.svg +1 -0
  8. package/app/assets/brand/characters/bright/frog.svg +1 -0
  9. package/app/assets/brand/characters/bright/octopus.svg +1 -0
  10. package/app/assets/brand/characters/muted/bee.svg +1 -0
  11. package/app/assets/brand/characters/muted/bird.svg +1 -0
  12. package/app/assets/brand/characters/muted/butterfly.svg +1 -0
  13. package/app/assets/brand/characters/muted/chick.svg +1 -0
  14. package/app/assets/brand/characters/muted/cow.svg +1 -0
  15. package/app/assets/brand/characters/muted/deer.svg +1 -0
  16. package/app/assets/brand/characters/muted/duck.svg +1 -0
  17. package/app/assets/brand/characters/muted/elephant.svg +1 -0
  18. package/app/assets/brand/characters/muted/fox.svg +1 -0
  19. package/app/assets/brand/characters/muted/hedgehog.svg +1 -0
  20. package/app/assets/brand/characters/muted/koala.svg +1 -0
  21. package/app/assets/brand/characters/muted/ladybug.svg +1 -0
  22. package/app/assets/brand/characters/muted/lion.svg +1 -0
  23. package/app/assets/brand/characters/muted/mouse.svg +1 -0
  24. package/app/assets/brand/characters/muted/octopus.svg +1 -0
  25. package/app/assets/brand/characters/muted/owl.svg +1 -0
  26. package/app/assets/brand/characters/muted/panda.svg +1 -0
  27. package/app/assets/brand/characters/muted/penguin.svg +1 -0
  28. package/app/assets/brand/characters/muted/pig.svg +1 -0
  29. package/app/assets/brand/characters/muted/poodle.svg +1 -0
  30. package/app/assets/brand/characters/muted/raccoon.svg +1 -0
  31. package/app/assets/brand/characters/muted/seal.svg +1 -0
  32. package/app/assets/brand/characters/muted/sheep.svg +1 -0
  33. package/app/assets/brand/characters/muted/snail.svg +1 -0
  34. package/app/assets/brand/characters/muted/turtle.svg +1 -0
  35. package/app/assets/brand/characters/muted/whale.svg +1 -0
  36. package/app/assets/brand/logo/favicon.svg +1 -0
  37. package/app/assets/brand/logo/logo-primary-reversed.svg +1 -0
  38. package/app/assets/brand/logo/logo-primary.svg +1 -0
  39. package/app/assets/brand/logo/mascot-reversed.svg +1 -0
  40. package/app/assets/brand/logo/mascot.svg +1 -0
  41. package/app/assets/brand/logo/wordmark-reversed.svg +1 -0
  42. package/app/assets/brand/logo/wordmark.svg +1 -0
  43. package/app/assets/css/cms-admin.css +607 -0
  44. package/app/components/CmsBlocks.vue +30 -0
  45. package/app/components/CmsCell.vue +16 -0
  46. package/app/components/CmsCellBadge.vue +18 -0
  47. package/app/components/CmsCellBlocks.vue +9 -0
  48. package/app/components/CmsCellBoolean.vue +12 -0
  49. package/app/components/CmsCellCode.vue +7 -0
  50. package/app/components/CmsCellColor.vue +13 -0
  51. package/app/components/CmsCellDate.vue +10 -0
  52. package/app/components/CmsCellExcerpt.vue +21 -0
  53. package/app/components/CmsCellGallery.vue +10 -0
  54. package/app/components/CmsCellGroup.vue +23 -0
  55. package/app/components/CmsCellNumber.vue +7 -0
  56. package/app/components/CmsCellRelation.vue +8 -0
  57. package/app/components/CmsCellText.vue +12 -0
  58. package/app/components/CmsCellThumb.vue +18 -0
  59. package/app/components/CmsConfirmDialog.vue +55 -0
  60. package/app/components/CmsContent.vue +103 -0
  61. package/app/components/CmsDayPicker.vue +44 -0
  62. package/app/components/CmsEmptyState.vue +35 -0
  63. package/app/components/CmsField.vue +111 -0
  64. package/app/components/CmsFieldBlocks.vue +353 -0
  65. package/app/components/CmsFieldBoolean.vue +8 -0
  66. package/app/components/CmsFieldColor.vue +42 -0
  67. package/app/components/CmsFieldDate.vue +131 -0
  68. package/app/components/CmsFieldGallery.vue +114 -0
  69. package/app/components/CmsFieldGroup.vue +53 -0
  70. package/app/components/CmsFieldMedia.vue +219 -0
  71. package/app/components/CmsFieldNumber.vue +11 -0
  72. package/app/components/CmsFieldRelationMany.vue +54 -0
  73. package/app/components/CmsFieldRelationOne.vue +47 -0
  74. package/app/components/CmsFieldRichText.vue +45 -0
  75. package/app/components/CmsFieldSelect.vue +41 -0
  76. package/app/components/CmsFieldSlug.vue +46 -0
  77. package/app/components/CmsFieldText.vue +75 -0
  78. package/app/components/CmsFormSections.vue +150 -0
  79. package/app/components/CmsHighlight.vue +22 -0
  80. package/app/components/CmsImage.vue +39 -0
  81. package/app/components/CmsLinkPicker.vue +122 -0
  82. package/app/components/CmsLinkTarget.vue +35 -0
  83. package/app/components/CmsListFilters.vue +107 -0
  84. package/app/components/CmsLiveNotice.vue +64 -0
  85. package/app/components/CmsLoadError.vue +24 -0
  86. package/app/components/CmsMascot.vue +10 -0
  87. package/app/components/CmsMediaLibrary.vue +114 -0
  88. package/app/components/CmsMediaPreview.vue +34 -0
  89. package/app/components/CmsMediaThumb.vue +22 -0
  90. package/app/components/CmsMoment.vue +42 -0
  91. package/app/components/CmsNav.vue +39 -0
  92. package/app/components/CmsPage.vue +86 -0
  93. package/app/components/CmsPasswordInput.vue +22 -0
  94. package/app/components/CmsPresence.vue +29 -0
  95. package/app/components/CmsPreviewPanel.vue +131 -0
  96. package/app/components/CmsPublishReview.vue +102 -0
  97. package/app/components/CmsRevisions.vue +195 -0
  98. package/app/components/CmsRichTextEditor.vue +290 -0
  99. package/app/components/CmsSearch.vue +99 -0
  100. package/app/components/CmsSection.vue +20 -0
  101. package/app/components/CmsSingletonForm.vue +283 -0
  102. package/app/components/CmsStatusBadge.vue +21 -0
  103. package/app/components/CmsTime.vue +16 -0
  104. package/app/components/CmsTranslationRef.vue +27 -0
  105. package/app/components/CmsTreeList.vue +453 -0
  106. package/app/components/CmsUnsavedText.vue +34 -0
  107. package/app/components/CmsWordmark.vue +10 -0
  108. package/app/composables/useCmsAdminHead.ts +18 -0
  109. package/app/composables/useCmsCollab.ts +165 -0
  110. package/app/composables/useCmsConfirm.ts +39 -0
  111. package/app/composables/useCmsEntryActions.ts +75 -0
  112. package/app/composables/useCmsFocus.ts +13 -0
  113. package/app/composables/useCmsForm.ts +273 -0
  114. package/app/composables/useCmsI18n.ts +185 -0
  115. package/app/composables/useCmsLinkTargets.ts +84 -0
  116. package/app/composables/useCmsLive.ts +199 -0
  117. package/app/composables/useCmsSearch.ts +62 -0
  118. package/app/composables/useCmsSeo.ts +99 -0
  119. package/app/composables/useCmsSignedIn.ts +24 -0
  120. package/app/composables/useCmsUiLocale.ts +24 -0
  121. package/app/i18n/cs.ts +781 -0
  122. package/app/i18n/de.ts +781 -0
  123. package/app/i18n/en.ts +782 -0
  124. package/app/i18n/types.ts +22 -0
  125. package/app/layouts/admin.vue +224 -0
  126. package/app/layouts/cms-auth.vue +37 -0
  127. package/app/middleware/cms-api-not-a-page.global.ts +10 -0
  128. package/app/middleware/cms-auth.global.ts +16 -0
  129. package/app/pages/admin/[entity]/[id].vue +1109 -0
  130. package/app/pages/admin/[entity]/index.vue +733 -0
  131. package/app/pages/admin/account.vue +117 -0
  132. package/app/pages/admin/forgot.vue +50 -0
  133. package/app/pages/admin/index.vue +184 -0
  134. package/app/pages/admin/invite/[token].vue +73 -0
  135. package/app/pages/admin/login.vue +84 -0
  136. package/app/pages/admin/media.vue +494 -0
  137. package/app/pages/admin/privacy.vue +193 -0
  138. package/app/pages/admin/reset/[token].vue +52 -0
  139. package/app/pages/admin/setup.vue +87 -0
  140. package/app/pages/admin/styleguide.vue +261 -0
  141. package/app/pages/admin/team.vue +258 -0
  142. package/app/plugins/cmsLivePreview.client.ts +20 -0
  143. package/app/plugins/cmsSignedOut.client.ts +31 -0
  144. package/app/utils/cmsBlockType.ts +11 -0
  145. package/app/utils/cmsBrand.ts +38 -0
  146. package/app/utils/cmsDiff.ts +83 -0
  147. package/app/utils/cmsFetch.ts +7 -0
  148. package/app/utils/cmsFocusInvalid.ts +22 -0
  149. package/app/utils/cmsIssues.ts +128 -0
  150. package/app/utils/cmsJson.ts +28 -0
  151. package/app/utils/cmsMedia.ts +63 -0
  152. package/app/utils/cmsSections.ts +154 -0
  153. package/app/utils/cmsTime.ts +41 -0
  154. package/cli/backup.ts +713 -0
  155. package/cli/breaking.ts +174 -0
  156. package/cli/content-migrate.ts +239 -0
  157. package/cli/db.ts +86 -0
  158. package/cli/export.ts +336 -0
  159. package/cli/generate.ts +146 -0
  160. package/cli/import.ts +643 -0
  161. package/cli/index.ts +140 -0
  162. package/cli/links-convert.ts +291 -0
  163. package/cli/seed-engine.ts +705 -0
  164. package/cli/seed.ts +339 -0
  165. package/cli/status.ts +49 -0
  166. package/cli/tar.ts +304 -0
  167. package/cli/transfer.ts +677 -0
  168. package/cli/up.ts +27 -0
  169. package/cli/upgrade.ts +60 -0
  170. package/cli/versions.ts +60 -0
  171. package/forms/components/CmsForm.vue +186 -0
  172. package/forms/index.ts +203 -0
  173. package/forms/messages.ts +104 -0
  174. package/forms/retention.ts +48 -0
  175. package/forms/server/form.get.ts +12 -0
  176. package/forms/server/form.post.ts +109 -0
  177. package/forms/server/formSettings.ts +12 -0
  178. package/forms/server/forms.ts +127 -0
  179. package/module.ts +373 -0
  180. package/nuxt.config.ts +43 -0
  181. package/package.json +98 -3
  182. package/server/api/cms/[entity]/[id]/revisions/[rev].get.ts +19 -0
  183. package/server/api/cms/[entity]/[id]/revisions/index.get.ts +14 -0
  184. package/server/api/cms/[entity]/[id].delete.ts +52 -0
  185. package/server/api/cms/[entity]/[id].get.ts +21 -0
  186. package/server/api/cms/[entity]/[id].patch.ts +116 -0
  187. package/server/api/cms/[entity]/_export.get.ts +69 -0
  188. package/server/api/cms/[entity]/_move.post.ts +81 -0
  189. package/server/api/cms/[entity]/_order.post.ts +49 -0
  190. package/server/api/cms/[entity]/_tree.get.ts +41 -0
  191. package/server/api/cms/[entity]/index.get.ts +62 -0
  192. package/server/api/cms/[entity]/index.post.ts +38 -0
  193. package/server/api/cms/[entity]/options.get.ts +55 -0
  194. package/server/api/cms/_auth/accept.post.ts +33 -0
  195. package/server/api/cms/_auth/forgot.post.ts +39 -0
  196. package/server/api/cms/_auth/invite/[token].get.ts +18 -0
  197. package/server/api/cms/_auth/login.post.ts +42 -0
  198. package/server/api/cms/_auth/logout.post.ts +7 -0
  199. package/server/api/cms/_auth/me.get.ts +5 -0
  200. package/server/api/cms/_auth/me.patch.ts +32 -0
  201. package/server/api/cms/_auth/password.post.ts +29 -0
  202. package/server/api/cms/_auth/reset.post.ts +34 -0
  203. package/server/api/cms/_auth/setup.post.ts +46 -0
  204. package/server/api/cms/_auth/status.get.ts +18 -0
  205. package/server/api/cms/_collab/session.get.ts +30 -0
  206. package/server/api/cms/_collab/socket.ts +51 -0
  207. package/server/api/cms/_collab/unsaved.delete.ts +16 -0
  208. package/server/api/cms/_graph.get.ts +20 -0
  209. package/server/api/cms/_links/resolve.post.ts +17 -0
  210. package/server/api/cms/_links.get.ts +81 -0
  211. package/server/api/cms/_live.ts +30 -0
  212. package/server/api/cms/_media/[id]/usage.get.ts +14 -0
  213. package/server/api/cms/_media/[id].delete.ts +29 -0
  214. package/server/api/cms/_media/[id].get.ts +13 -0
  215. package/server/api/cms/_media/[id].patch.ts +64 -0
  216. package/server/api/cms/_media/exists.post.ts +15 -0
  217. package/server/api/cms/_media/img/[id]/[file].get.ts +42 -0
  218. package/server/api/cms/_media/index.get.ts +44 -0
  219. package/server/api/cms/_media/index.post.ts +147 -0
  220. package/server/api/cms/_media/raw/[...key].get.ts +85 -0
  221. package/server/api/cms/_media/raw/[...key].head.ts +2 -0
  222. package/server/api/cms/_overview.get.ts +87 -0
  223. package/server/api/cms/_preview.post.ts +17 -0
  224. package/server/api/cms/_privacy/delete.post.ts +14 -0
  225. package/server/api/cms/_privacy/export.post.ts +25 -0
  226. package/server/api/cms/_privacy/lookup.post.ts +27 -0
  227. package/server/api/cms/_search.get.ts +17 -0
  228. package/server/api/cms/_singleton/[name].get.ts +19 -0
  229. package/server/api/cms/_singleton/[name].put.ts +76 -0
  230. package/server/api/cms/_users/[id]/resend.post.ts +25 -0
  231. package/server/api/cms/_users/[id].delete.ts +21 -0
  232. package/server/api/cms/_users/[id].patch.ts +45 -0
  233. package/server/api/cms/_users/index.get.ts +28 -0
  234. package/server/api/cms/_users/index.post.ts +39 -0
  235. package/server/api/content/[entity]/[slug].get.ts +74 -0
  236. package/server/api/content/[entity]/index.get.ts +100 -0
  237. package/server/api/content/_global/[name].get.ts +23 -0
  238. package/server/api/content/_search.get.ts +28 -0
  239. package/server/api/content/_sitemap.get.ts +8 -0
  240. package/server/api/content/_tree/[entity].get.ts +31 -0
  241. package/server/api/content-types.ts.get.ts +17 -0
  242. package/server/api/health/live.get.ts +10 -0
  243. package/server/api/health/ready.get.ts +21 -0
  244. package/server/api/openapi.get.ts +48 -0
  245. package/server/api/openapi.json.get.ts +32 -0
  246. package/server/db/driver.ts +8 -0
  247. package/server/mail/mailer.ts +43 -0
  248. package/server/middleware/cms-0-headers.ts +37 -0
  249. package/server/middleware/cms-0-migrate-gate.ts +14 -0
  250. package/server/middleware/cms-csrf.ts +28 -0
  251. package/server/middleware/cms-limits.ts +20 -0
  252. package/server/middleware/cms-redirects.ts +21 -0
  253. package/server/middleware/cms-session.ts +41 -0
  254. package/server/middleware/cms-z-plugin-access.ts +15 -0
  255. package/server/plugins/cms-0-config-check.ts +35 -0
  256. package/server/plugins/cms-changes.ts +53 -0
  257. package/server/plugins/cms-content-etag.ts +21 -0
  258. package/server/plugins/cms-errors.ts +45 -0
  259. package/server/plugins/cms-migrate.ts +5 -0
  260. package/server/plugins/cms-plugins.ts +17 -0
  261. package/server/plugins/cms-search.ts +12 -0
  262. package/server/plugins/cms-setup-code.ts +15 -0
  263. package/server/routes/sitemap.xml.get.ts +25 -0
  264. package/server/store/redis.ts +95 -0
  265. package/server/store/types.ts +21 -0
  266. package/server/tasks/cms/retention.ts +10 -0
  267. package/server/tasks/cms/scheduled.ts +10 -0
  268. package/server/tasks/cms/search-reindex.ts +12 -0
  269. package/server/utils/cmsAudit.ts +29 -0
  270. package/server/utils/cmsAuth.ts +143 -0
  271. package/server/utils/cmsBlocks.ts +47 -0
  272. package/server/utils/cmsChanges.ts +222 -0
  273. package/server/utils/cmsCollab.ts +286 -0
  274. package/server/utils/cmsCollabServer.ts +451 -0
  275. package/server/utils/cmsCollate.ts +27 -0
  276. package/server/utils/cmsContent.ts +376 -0
  277. package/server/utils/cmsCrud.ts +361 -0
  278. package/server/utils/cmsCsv.ts +24 -0
  279. package/server/utils/cmsDb.ts +23 -0
  280. package/server/utils/cmsDemo.ts +36 -0
  281. package/server/utils/cmsEmails.ts +125 -0
  282. package/server/utils/cmsErrors.ts +40 -0
  283. package/server/utils/cmsFold.ts +17 -0
  284. package/server/utils/cmsImageSizes.ts +51 -0
  285. package/server/utils/cmsJson.ts +6 -0
  286. package/server/utils/cmsLinkAddress.ts +50 -0
  287. package/server/utils/cmsLinks.ts +248 -0
  288. package/server/utils/cmsListQuery.ts +93 -0
  289. package/server/utils/cmsLive.ts +393 -0
  290. package/server/utils/cmsLocales.ts +96 -0
  291. package/server/utils/cmsMail.ts +28 -0
  292. package/server/utils/cmsMediaGc.ts +188 -0
  293. package/server/utils/cmsMediaKeys.ts +62 -0
  294. package/server/utils/cmsMigrate.ts +86 -0
  295. package/server/utils/cmsPreviewDraft.ts +72 -0
  296. package/server/utils/cmsPrivacy.ts +176 -0
  297. package/server/utils/cmsPublished.ts +57 -0
  298. package/server/utils/cmsRange.ts +38 -0
  299. package/server/utils/cmsRateLimit.ts +82 -0
  300. package/server/utils/cmsRedirects.ts +160 -0
  301. package/server/utils/cmsRetention.ts +61 -0
  302. package/server/utils/cmsRevisions.ts +103 -0
  303. package/server/utils/cmsScheduler.ts +45 -0
  304. package/server/utils/cmsScrub.ts +107 -0
  305. package/server/utils/cmsSearch.ts +354 -0
  306. package/server/utils/cmsSession.ts +102 -0
  307. package/server/utils/cmsSetupCode.ts +97 -0
  308. package/server/utils/cmsSitemap.ts +176 -0
  309. package/server/utils/cmsStorage.ts +580 -0
  310. package/server/utils/cmsStore.ts +109 -0
  311. package/server/utils/cmsTiming.ts +14 -0
  312. package/server/utils/cmsTooMany.ts +9 -0
  313. package/server/utils/cmsTranslationWrite.ts +186 -0
  314. package/server/utils/cmsTree.ts +251 -0
  315. package/server/utils/cmsTreeAddress.ts +65 -0
  316. package/server/utils/cmsUpload.ts +228 -0
  317. package/server/utils/cmsWebhooks.ts +104 -0
  318. package/shared/json.ts +11 -0
  319. package/shared/richtext-editor.ts +56 -0
  320. package/shared/richtext-normalize.ts +33 -0
  321. package/shared/richtext-paste.ts +151 -0
  322. package/shared/storage-delivery.ts +53 -0
  323. package/src/blocks.ts +624 -0
  324. package/src/changes.ts +54 -0
  325. package/src/content-shape.ts +340 -0
  326. package/src/deprecate.ts +64 -0
  327. package/src/descriptor.ts +149 -0
  328. package/src/docs.ts +27 -0
  329. package/src/emitter.ts +94 -0
  330. package/src/entity.ts +624 -0
  331. package/src/errorReport.ts +41 -0
  332. package/src/fields.ts +465 -0
  333. package/src/i18n.ts +26 -0
  334. package/src/index.ts +54 -0
  335. package/src/linkref.ts +31 -0
  336. package/src/links.ts +179 -0
  337. package/src/locales.ts +39 -0
  338. package/src/media.ts +48 -0
  339. package/src/migrate.ts +236 -0
  340. package/src/openapi.ts +377 -0
  341. package/src/paths.ts +88 -0
  342. package/src/plugin.ts +505 -0
  343. package/src/presets.ts +230 -0
  344. package/src/richtext.ts +88 -0
  345. package/src/sdk.ts +181 -0
  346. package/src/search.ts +312 -0
  347. package/src/seed.ts +225 -0
  348. package/src/setupCode.ts +30 -0
  349. package/src/system.ts +219 -0
  350. package/src/tree.ts +421 -0
  351. package/src/upgrades.ts +137 -0
  352. package/starter/.env.example +10 -0
  353. package/starter/README.md +65 -0
  354. package/starter/app/app.config.ts +10 -0
  355. package/starter/app/app.vue +12 -0
  356. package/starter/app/assets/css/main.css +15 -0
  357. package/starter/app/components/global/BlockContact.vue +15 -0
  358. package/starter/app/components/global/BlockCta.vue +15 -0
  359. package/starter/app/components/global/BlockHero.vue +23 -0
  360. package/starter/app/components/global/BlockImage.vue +13 -0
  361. package/starter/app/components/global/BlockText.vue +12 -0
  362. package/starter/app/composables/useSite.ts +77 -0
  363. package/starter/app/error.vue +28 -0
  364. package/starter/app/layouts/default.vue +106 -0
  365. package/starter/app/lib/cms-content.ts +152 -0
  366. package/starter/app/pages/[...slug].vue +66 -0
  367. package/starter/app/pages/hledat.vue +59 -0
  368. package/starter/app/pages/index.vue +20 -0
  369. package/starter/cms.config.ts +137 -0
  370. package/starter/compose.yaml +15 -0
  371. package/starter/drizzle.config.ts +8 -0
  372. package/starter/gitignore.txt +8 -0
  373. package/starter/nuxt.config.ts +13 -0
  374. package/starter/package.json +38 -0
  375. package/starter/scripts/typecheck.mjs +38 -0
  376. package/starter/seed/index.ts +297 -0
  377. package/starter/seed/media/about.jpg +0 -0
  378. package/starter/seed/media/hero.jpg +0 -0
  379. package/starter/seed/media/logo.png +0 -0
  380. package/starter/seed/media/news-bread.jpg +0 -0
  381. package/starter/seed/media/news-morning.jpg +0 -0
  382. package/starter/server/db/migrations/0000_init.sql +269 -0
  383. package/starter/server/db/migrations/0001_page_tree.sql +5 -0
  384. package/starter/server/db/migrations/0002_opening_hours_per_language.sql +1 -0
  385. package/starter/server/db/migrations/meta/0000_snapshot.json +1890 -0
  386. package/starter/server/db/migrations/meta/0001_snapshot.json +1887 -0
  387. package/starter/server/db/migrations/meta/0002_snapshot.json +1893 -0
  388. package/starter/server/db/migrations/meta/_journal.json +27 -0
  389. package/starter/server/db/schema.ts +253 -0
  390. package/starter/server/plugins/sitemap.ts +11 -0
  391. package/starter/server/routes/robots.txt.get.ts +12 -0
  392. package/starter/tsconfig.json +9 -0
@@ -0,0 +1,193 @@
1
+ <script setup lang="ts">
2
+ // Privacy: everything stored about one email address — form messages, a CMS account,
3
+ // activity-log entries — to hand over (JSON) or erase. Administrators only; the
4
+ // server checks it, rate limits it and audits both actions.
5
+ definePageMeta({ layout: 'admin' })
6
+ const { t, tl, formatDate } = useCmsI18n()
7
+ const toast = useToast()
8
+ const confirm = useCmsConfirm()
9
+ const { user: me } = useUserSession()
10
+ useHead({ title: () => t('privacy.title') })
11
+ const isAdmin = computed(() => me.value?.role === 'admin')
12
+ // The forms' field labels, to show a choice by its name ("A race") and not by its key ("race").
13
+ // Read from the layout's own fetch (same key), not fetched again: a second `useFetch` here made the
14
+ // form's generated ids (label `for`, input `id`) differ after hydration, leaving the field unlabelled.
15
+ const { data: graph } = useNuxtData<any[]>('cms-graph')
16
+
17
+ interface Found {
18
+ email: string
19
+ submissions: { form: string; formLabel: any; id: string; createdAt: string; status: string | null; data: Record<string, unknown> }[]
20
+ account: { id: string; email: string; name: string; role: string; status: string; lastLoginAt: string | null; createdAt: string } | null
21
+ audit: { total: number; latest: { id: string; action: string; createdAt: string }[] }
22
+ }
23
+
24
+ const email = ref('')
25
+ const error = ref('')
26
+ const found = ref<Found | null>(null)
27
+ const searching = ref(false)
28
+ const busy = ref<'export' | 'delete' | null>(null)
29
+ // Right after an erase the lookup is empty because we emptied it: say so, not "nothing was ever stored".
30
+ const justErased = ref(false)
31
+
32
+ const empty = computed(() => !!found.value && !found.value.submissions.length && !found.value.account && !found.value.audit.total)
33
+
34
+ async function search(keepErased = false) {
35
+ if (!keepErased) justErased.value = false
36
+ error.value = ''
37
+ found.value = null
38
+ searching.value = true
39
+ try {
40
+ found.value = await cmsFetch<Found>('/api/cms/_privacy/lookup', { method: 'POST', body: { email: email.value } })
41
+ }
42
+ catch (err: any) {
43
+ error.value = err?.statusCode === 422 ? t('privacy.invalidEmail') : cmsErrorMessage(err, t('team.actionFailed'))
44
+ }
45
+ finally {
46
+ searching.value = false
47
+ }
48
+ }
49
+
50
+ async function exportJson() {
51
+ if (!found.value) return
52
+ busy.value = 'export'
53
+ try {
54
+ const text = await cmsFetch<string>('/api/cms/_privacy/export', { method: 'POST', body: { email: found.value.email }, responseType: 'text' })
55
+ const url = URL.createObjectURL(new Blob([text], { type: 'application/json' }))
56
+ const a = document.createElement('a')
57
+ a.href = url
58
+ a.download = 'personal-data.json'
59
+ a.click()
60
+ URL.revokeObjectURL(url)
61
+ toast.add({ title: t('privacy.exported'), icon: 'i-lucide-check', color: 'success' })
62
+ }
63
+ catch (err: any) {
64
+ toast.add({ title: t('team.actionFailed'), description: cmsErrorMessage(err, ''), color: 'error', icon: 'i-lucide-x' })
65
+ }
66
+ finally {
67
+ busy.value = null
68
+ }
69
+ }
70
+
71
+ async function erase() {
72
+ if (!found.value) return
73
+ const target = found.value.email
74
+ // The question names what this lookup found, so "delete" says what goes.
75
+ const { submissions, account, audit } = found.value
76
+ const lines = [
77
+ submissions.length ? t('privacy.eraseSubmissions', { count: submissions.length }) : '',
78
+ account ? t('privacy.eraseAccount') : '',
79
+ audit.total ? t('privacy.eraseActivity', { count: audit.total }) : '',
80
+ t('privacy.eraseUndone'),
81
+ ].filter(Boolean)
82
+ const ok = await confirm({
83
+ title: t('privacy.eraseTitle', { email: target }),
84
+ description: lines.join('\n'),
85
+ icon: 'i-lucide-user-x', color: 'error',
86
+ confirmLabel: t('privacy.erase'), cancelLabel: t('common.cancel'),
87
+ })
88
+ if (!ok) return
89
+ busy.value = 'delete'
90
+ try {
91
+ await cmsFetch('/api/cms/_privacy/delete', { method: 'POST', body: { email: target } })
92
+ toast.add({ title: t('privacy.erased'), icon: 'i-lucide-check', color: 'success' })
93
+ justErased.value = true
94
+ await search(true)
95
+ }
96
+ catch (err: any) {
97
+ toast.add({ title: t('team.actionFailed'), description: cmsErrorMessage(err, ''), color: 'error', icon: 'i-lucide-x' })
98
+ }
99
+ finally {
100
+ busy.value = null
101
+ }
102
+ }
103
+
104
+ /**
105
+ * A few values of a submission, for the list: its texts in the form's order, a choice by
106
+ * its label, without the email (it is the address searched for, said in the heading).
107
+ */
108
+ function preview(s: Found['submissions'][number]): string {
109
+ const fields: any[] = (graph.value ?? []).find((e: any) => e.name === s.form)?.fields ?? []
110
+ const keys = fields.length ? fields.map((f) => f.key) : Object.keys(s.data)
111
+ const parts: string[] = []
112
+ for (const key of keys) {
113
+ const v = s.data[key]
114
+ const f = fields.find((x) => x.key === key)
115
+ if (typeof v !== 'string' || !v.trim() || f?.meta?.format === 'email') continue
116
+ parts.push(f?.type === 'select' ? tl(f.meta?.labels?.[v], v) : v.trim())
117
+ }
118
+ return parts.slice(0, 3).join(' · ')
119
+ }
120
+ const roleName = (r: string) => (['admin', 'editor', 'author'] as const).includes(r as any) ? t(`roles.${r as 'admin' | 'editor' | 'author'}.name`) : r
121
+ </script>
122
+
123
+ <template>
124
+ <CmsPage narrow :title="t('privacy.title')" :description="t('privacy.description')" :breadcrumbs="[{ label: t('nav.home'), to: '/admin' }, { label: t('privacy.title') }]">
125
+ <div v-if="!isAdmin" class="cms-card overflow-hidden">
126
+ <CmsEmptyState plain icon="i-lucide-lock" :title="t('privacy.adminsOnly')" />
127
+ </div>
128
+
129
+ <template v-else>
130
+ <!-- an empty string would still mark the field invalid (red, aria-invalid): no error is `undefined` -->
131
+ <form class="cms-card cms-touch flex flex-wrap items-end gap-3 p-4" novalidate @submit.prevent="search()">
132
+ <UFormField :label="t('privacy.emailLabel')" name="email" :error="error || undefined" class="min-w-0 flex-1 basis-64 max-sm:basis-full">
133
+ <UInput v-model="email" type="email" autocomplete="off" autofocus icon="i-lucide-at-sign" :placeholder="t('privacy.emailPlaceholder')" class="w-full" />
134
+ <template #error="{ error: message }"><span v-if="message" role="alert">{{ message }}</span></template>
135
+ </UFormField>
136
+ <UButton type="submit" icon="i-lucide-search" class="max-sm:w-full max-sm:justify-center" :loading="searching" :disabled="!email.trim()">{{ t('privacy.search') }}</UButton>
137
+ </form>
138
+
139
+ <div v-if="found" class="mt-6 space-y-4" aria-live="polite">
140
+ <div v-if="!empty" class="flex flex-wrap items-center justify-between gap-3">
141
+ <h2 class="min-w-0 truncate text-sm font-medium text-highlighted">{{ t('privacy.storedAbout', { email: found.email }) }}</h2>
142
+ <div class="cms-touch flex flex-wrap gap-2 max-sm:w-full max-sm:flex-col">
143
+ <UButton color="neutral" variant="outline" icon="i-lucide-download" class="max-sm:justify-center" :loading="busy === 'export'" :disabled="!!busy" @click="exportJson">{{ t('privacy.export') }}</UButton>
144
+ <UButton color="error" variant="soft" icon="i-lucide-trash-2" class="max-sm:justify-center" :loading="busy === 'delete'" :disabled="!!busy" @click="erase">{{ t('privacy.erase') }}</UButton>
145
+ </div>
146
+ </div>
147
+
148
+ <template v-if="empty">
149
+ <CmsEmptyState
150
+ plain icon="i-lucide-shield-check"
151
+ :title="justErased ? t('privacy.nothingAfter', { email: found.email }) : t('privacy.nothing')" :description="justErased ? undefined : t('privacy.nothingBody')"
152
+ />
153
+ <p v-if="justErased" class="text-center text-xs text-muted">{{ t('privacy.note') }}</p>
154
+ </template>
155
+
156
+ <template v-else>
157
+ <section class="cms-card overflow-hidden" :aria-label="t('privacy.submissions')">
158
+ <h3 class="cms-label px-4 pt-3 pb-1.5">{{ t('privacy.submissions') }} <span class="tabular-nums text-muted">{{ found.submissions.length }}</span></h3>
159
+ <p v-if="!found.submissions.length" class="px-4 pb-3 text-sm text-muted">{{ t('privacy.noSubmissions') }}</p>
160
+ <ul v-else>
161
+ <li v-for="s in found.submissions" :key="s.id" class="border-t border-(--ui-border-muted) px-4 py-3">
162
+ <div class="flex items-center justify-between gap-3 text-xs text-muted">
163
+ <NuxtLink :to="`/admin/${s.form}/${s.id}`" class="font-medium text-highlighted hover:underline pointer-coarse:-my-2 pointer-coarse:py-2">{{ tl(s.formLabel, s.form) }}</NuxtLink>
164
+ <time :datetime="s.createdAt">{{ formatDate(s.createdAt) }}</time>
165
+ </div>
166
+ <p class="mt-1 line-clamp-2 text-sm text-default">{{ preview(s) }}</p>
167
+ </li>
168
+ </ul>
169
+ </section>
170
+
171
+ <section class="cms-card overflow-hidden" :aria-label="t('privacy.account')">
172
+ <h3 class="cms-label px-4 pt-3 pb-1.5">{{ t('privacy.account') }}</h3>
173
+ <p v-if="!found.account" class="px-4 pb-3 text-sm text-muted">{{ t('privacy.noAccount') }}</p>
174
+ <dl v-else class="grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1 px-4 pb-3 text-sm">
175
+ <dt class="text-muted">{{ t('team.person') }}</dt><dd class="truncate text-highlighted">{{ found.account.name || found.account.email }}</dd>
176
+ <dt class="text-muted">{{ t('team.role') }}</dt><dd>{{ roleName(found.account.role) }}</dd>
177
+ <dt class="text-muted">{{ t('team.status') }}</dt><dd>{{ t(`team.status${found.account.status === 'active' ? 'Active' : found.account.status === 'invited' ? 'Invited' : 'Disabled'}`) }}</dd>
178
+ <dt class="text-muted">{{ t('team.lastActive') }}</dt><dd>{{ found.account.lastLoginAt ? formatDate(found.account.lastLoginAt) : t('team.never') }}</dd>
179
+ </dl>
180
+ </section>
181
+
182
+ <section class="cms-card overflow-hidden" :aria-label="t('privacy.activity')">
183
+ <h3 class="cms-label px-4 pt-3 pb-1.5">{{ t('privacy.activity') }} <span class="tabular-nums text-muted">{{ found.audit.total }}</span></h3>
184
+ <p v-if="!found.audit.total" class="px-4 pb-3 text-sm text-muted">{{ t('privacy.noActivity') }}</p>
185
+ <p v-else class="px-4 pb-3 text-sm text-muted">{{ t('privacy.activityBody') }}</p>
186
+ </section>
187
+
188
+ <p class="text-xs text-muted">{{ t('privacy.note') }}</p>
189
+ </template>
190
+ </div>
191
+ </template>
192
+ </CmsPage>
193
+ </template>
@@ -0,0 +1,52 @@
1
+ <script setup lang="ts">
2
+ definePageMeta({ layout: 'cms-auth' })
3
+ const { t } = useCmsI18n()
4
+ useHead({ title: () => t('auth.resetTitle') })
5
+ const route = useRoute()
6
+ const signedIn = useCmsSignedIn()
7
+
8
+ const password = ref('')
9
+ const error = ref('')
10
+ const expired = ref(false)
11
+ const pending = ref(false)
12
+ const formEl = ref<HTMLElement | null>(null)
13
+
14
+ async function submit() {
15
+ error.value = ''
16
+ pending.value = true
17
+ try {
18
+ const res = await $fetch<{ user: any }>('/api/cms/_auth/reset', { method: 'POST', body: { token: route.params.token, password: password.value } })
19
+ await signedIn(res.user)
20
+ }
21
+ catch (err: any) {
22
+ if (err?.statusCode === 410) expired.value = true
23
+ else {
24
+ // In the page's language, not the validator's English.
25
+ const issue = err?.data?.data?.[0]
26
+ error.value = issue?.code ? cmsIssueMessage(issue, null, t as any) : cmsErrorMessage(err, t('team.actionFailed'))
27
+ await cmsFocusInvalid(formEl.value)
28
+ }
29
+ }
30
+ finally {
31
+ pending.value = false
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <div v-if="expired" class="space-y-5">
38
+ <div class="text-center">
39
+ <h1 class="cms-display text-[1.625rem] leading-tight text-highlighted">{{ t('auth.linkExpiredTitle') }}</h1>
40
+ <p class="mt-1 text-sm text-muted">{{ t('auth.linkExpired') }}</p>
41
+ </div>
42
+ <UButton to="/admin/forgot" block>{{ t('auth.requestNewLink') }}</UButton>
43
+ </div>
44
+ <form v-else method="post" ref="formEl" class="space-y-5" novalidate @submit.prevent="submit">
45
+ <h1 class="text-center cms-display text-[1.625rem] leading-tight text-highlighted">{{ t('auth.resetTitle') }}</h1>
46
+ <UFormField :label="t('auth.newPassword')" name="password" :description="t('auth.passwordHint')" :error="error || undefined">
47
+ <CmsPasswordInput v-model="password" autocomplete="new-password" autofocus />
48
+ <template #error="{ error: message }"><span v-if="message" role="alert">{{ message }}</span></template>
49
+ </UFormField>
50
+ <UButton type="submit" block :loading="pending">{{ t('auth.savePassword') }}</UButton>
51
+ </form>
52
+ </template>
@@ -0,0 +1,87 @@
1
+ <script setup lang="ts">
2
+ definePageMeta({ layout: 'cms-auth' })
3
+ const { t } = useCmsI18n()
4
+ const { productName } = useCmsAdminHead()
5
+ useHead({ title: () => t('auth.setupTitle') })
6
+
7
+ const { data: status } = await useFetch<{ needsSetup: boolean; needsToken?: boolean; codeIn?: 'config' | 'log' | null }>('/api/cms/_auth/status')
8
+ if (status.value && !status.value.needsSetup) await navigateTo('/admin/login', { replace: true })
9
+
10
+ const signedIn = useCmsSignedIn()
11
+ // The deploy's setup code, when it has one: from the link (?token=) or typed in.
12
+ const route = useRoute()
13
+ const linkToken = typeof route.query.token === 'string' ? route.query.token : ''
14
+ const form = reactive({ name: '', email: '', password: '', token: linkToken })
15
+ // Shown whenever one is needed (prefilled from the link), so a wrong code can be corrected.
16
+ const askToken = computed(() => !!status.value?.needsToken)
17
+ // The code comes first, so it gets the cursor when it is asked for and not yet filled in.
18
+ const focusToken = askToken.value && !linkToken
19
+ const tokenHint = computed(() => t(status.value?.codeIn === 'log' ? 'auth.setupTokenHintLog' : 'auth.setupTokenHint'))
20
+ const errors = reactive<Record<string, string>>({})
21
+ const error = ref('')
22
+ const pending = ref(false)
23
+ const formEl = ref<HTMLElement | null>(null)
24
+
25
+ async function submit() {
26
+ error.value = ''
27
+ Object.keys(errors).forEach((k) => delete errors[k])
28
+ pending.value = true
29
+ try {
30
+ const res = await $fetch<{ user: any }>('/api/cms/_auth/setup', { method: 'POST', body: { ...form, token: form.token || undefined } })
31
+ await signedIn(res.user)
32
+ }
33
+ catch (err: any) {
34
+ const issues = err?.data?.data
35
+ if (Array.isArray(issues)) {
36
+ // In the page's language ("At least 10 characters"), not the validator's English.
37
+ for (const i of issues) if (i.path?.[0]) errors[i.path[0]] = cmsIssueMessage(i, null, t as any)
38
+ }
39
+ else if (err?.data?.data?.code === 'setup_token') {
40
+ errors.token = t('auth.setupTokenWrong')
41
+ }
42
+ else {
43
+ error.value = cmsErrorMessage(err, t('team.actionFailed'))
44
+ }
45
+ // The cursor goes to the first field that is wrong (or to the message).
46
+ await cmsFocusInvalid(formEl.value)
47
+ }
48
+ finally {
49
+ pending.value = false
50
+ }
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <form method="post" ref="formEl" class="space-y-5" novalidate @submit.prevent="submit">
56
+ <div class="text-center">
57
+ <!-- First run: the whole family says hello. -->
58
+ <div class="-mt-1 mb-5 flex items-end justify-center gap-2" aria-hidden="true">
59
+ <img v-for="c in cmsCharacters.bright" :key="c.name" :src="c.url" alt="" class="h-9 w-auto" draggable="false">
60
+ </div>
61
+ <p class="text-xs font-medium text-muted">{{ t('auth.setupWelcome') }}</p>
62
+ <h1 class="mt-1 cms-display text-[1.625rem] leading-tight text-highlighted">{{ t('auth.setupTitle') }}</h1>
63
+ <p class="mt-1 text-sm text-muted">{{ t('auth.setupSubtitle', { site: productName }) }}</p>
64
+ </div>
65
+ <UFormField v-if="askToken" :label="t('auth.setupToken')" name="token" :description="tokenHint" :error="errors.token">
66
+ <UInput
67
+ v-model="form.token" autocomplete="off" autocapitalize="characters" spellcheck="false" class="w-full font-mono"
68
+ :autofocus="focusToken" :placeholder="status?.codeIn === 'log' ? 'XXXX-XXXX-XXXX-XXXX' : undefined"
69
+ />
70
+ <template #error="{ error }"><span v-if="error" role="alert">{{ error }}</span></template>
71
+ </UFormField>
72
+ <UFormField :label="t('auth.name')" name="name" :error="errors.name">
73
+ <UInput v-model="form.name" autocomplete="name" :autofocus="!focusToken" class="w-full" />
74
+ <template #error="{ error }"><span v-if="error" role="alert">{{ error }}</span></template>
75
+ </UFormField>
76
+ <UFormField :label="t('auth.email')" name="email" :error="errors.email">
77
+ <UInput v-model="form.email" type="email" autocomplete="email" class="w-full" />
78
+ <template #error="{ error }"><span v-if="error" role="alert">{{ error }}</span></template>
79
+ </UFormField>
80
+ <UFormField :label="t('auth.password')" name="password" :description="t('auth.passwordHint')" :error="errors.password">
81
+ <CmsPasswordInput v-model="form.password" autocomplete="new-password" />
82
+ <template #error="{ error }"><span v-if="error" role="alert">{{ error }}</span></template>
83
+ </UFormField>
84
+ <UAlert v-if="error" color="error" variant="subtle" icon="i-lucide-circle-alert" :title="error" role="alert" />
85
+ <UButton type="submit" block :loading="pending">{{ t('auth.createAccount') }}</UButton>
86
+ </form>
87
+ </template>
@@ -0,0 +1,261 @@
1
+ <script setup lang="ts">
2
+ // A tour of the admin's foundation: tokens, type, surfaces and the building blocks
3
+ // pages are made of. Doubles as the visual regression page for the design system.
4
+ // For whoever builds the site, not for every editor: the menu entry is the administrators', and
5
+ // anyone else who types the address is sent home.
6
+ definePageMeta({
7
+ layout: 'admin',
8
+ middleware: () => {
9
+ const { user } = useUserSession()
10
+ if (user.value && user.value.role !== 'admin') return navigateTo('/admin')
11
+ },
12
+ })
13
+ const { t } = useCmsI18n()
14
+ useHead({ title: () => t('styleguide.title') })
15
+
16
+ const steps = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]
17
+ const ramps = ['primary', 'neutral', 'success'] as const
18
+ const states = [
19
+ { color: 'success', label: 'Success', use: 'Published, saved' },
20
+ { color: 'info', label: 'Info', use: 'Scheduled, hints' },
21
+ { color: 'warning', label: 'Warning', use: 'Unsaved or changed since publishing' },
22
+ { color: 'error', label: 'Error', use: 'Validation, destructive actions' },
23
+ ] as const
24
+ const accents = ['mono', 'indigo', 'blue', 'violet', 'emerald'] as const
25
+ const config = useCmsAdminConfig()
26
+ const accent = ref<string>(config.value.accent)
27
+ // Preview another accent on this page only (the layout restores the configured one on leave).
28
+ watch(accent, (a) => { if (import.meta.client) document.documentElement.dataset.cmsAccent = a })
29
+ onBeforeUnmount(() => { document.documentElement.dataset.cmsAccent = config.value.accent })
30
+
31
+ const colors = ['primary', 'neutral', 'success', 'warning', 'error'] as const
32
+ const variants = ['solid', 'outline', 'soft', 'subtle', 'ghost', 'link'] as const
33
+ // A live sectioned form, as every form and preview editor uses (see CmsFormSections).
34
+ const demoFields = [
35
+ { key: 'kind', type: 'select', ui: { edit: 'CmsFieldSelect' }, meta: {
36
+ label: { en: 'Kind', cs: 'Druh', de: 'Art' }, options: ['race', 'club', 'camp'],
37
+ labels: { race: { en: 'Race', cs: 'Závod', de: 'Wettkampf' }, club: { en: 'Club', cs: 'Klub', de: 'Verein' }, camp: { en: 'Camp', cs: 'Soustředění', de: 'Trainingslager' } },
38
+ icons: { race: 'i-lucide-trophy', club: 'i-lucide-users', camp: 'i-lucide-tent' },
39
+ } },
40
+ { key: 'organised', type: 'boolean', ui: { edit: 'CmsFieldBoolean' }, meta: { label: { en: 'We organise it', cs: 'Pořádáme ji my', de: 'Wir veranstalten es' }, help: { en: 'It gets an “Organised by us” label in the calendar.', cs: 'V kalendáři dostane štítek „Pořádáme“.', de: 'Erhält im Kalender die Kennzeichnung „Von uns veranstaltet“.' } } },
41
+ { key: 'startsAt', type: 'datetime', ui: { edit: 'CmsFieldDate' }, meta: { label: { en: 'Starts', cs: 'Začátek', de: 'Beginn' }, allDay: true } },
42
+ { key: 'endsAt', type: 'datetime', optional: true, ui: { edit: 'CmsFieldDate' }, meta: { label: { en: 'Ends', cs: 'Konec', de: 'Ende' }, allDay: true } },
43
+ { key: 'place', type: 'text', optional: true, ui: { edit: 'CmsFieldText' }, meta: { label: { en: 'Place', cs: 'Místo', de: 'Ort' }, icon: 'i-lucide-map-pin' } },
44
+ { key: 'url', type: 'text', optional: true, ui: { edit: 'CmsFieldText' }, meta: { label: { en: 'Link to entries', cs: 'Odkaz na přihlášky', de: 'Link zur Anmeldung' }, format: 'link' } },
45
+ ]
46
+ const demoSections = [
47
+ { label: { en: 'What is it?', cs: 'Co je to za akci?', de: 'Was für eine Veranstaltung?' }, icon: 'i-lucide-tag', fields: ['kind', 'organised'] },
48
+ { label: { en: 'When?', cs: 'Kdy?', de: 'Wann?' }, icon: 'i-lucide-calendar', fields: ['startsAt', 'endsAt'] },
49
+ { label: { en: 'Where?', cs: 'Kde?', de: 'Wo?' }, icon: 'i-lucide-map-pin', description: { en: 'Empty optional fields wait behind “+ Add”.', cs: 'Prázdná nepovinná pole čekají za „+ Přidat“.', de: 'Leere optionale Felder erscheinen unter „+ Hinzufügen“.' }, fields: ['place', 'url'] },
50
+ ]
51
+ const demo = reactive<Record<string, any>>({ kind: 'race', organised: true, startsAt: '2026-06-13T07:00:00.000Z', endsAt: null, place: 'Koupaliště Ostrov, Tábor', url: null })
52
+ const soon = '2030-06-01T07:00:00.000Z' // fixed: the same on the server and in the browser
53
+ const brandColors = [
54
+ { name: 'Charcoal', value: '#2E3035', use: 'The mascot · primary actions · dark-mode surfaces' },
55
+ { name: 'Ink', value: '#131313', use: 'Text · the wordmark' },
56
+ { name: 'Cream', value: '#F9F5EF', use: 'Moments · dark-mode text and primary' },
57
+ ] as const
58
+ const toc = ['brand', 'color', 'type', 'surfaces', 'moments', 'editors', 'actions', 'status', 'forms', 'states'] as const
59
+ </script>
60
+
61
+ <template>
62
+ <CmsPage
63
+ :title="t('styleguide.title')" :description="t('styleguide.description')"
64
+ :breadcrumbs="[{ label: t('nav.home'), to: '/admin' }, { label: t('styleguide.title') }]"
65
+ >
66
+ <template #meta>
67
+ <UFieldGroup>
68
+ <UButton
69
+ v-for="a in accents" :key="a" color="neutral" :variant="accent === a ? 'solid' : 'outline'"
70
+ size="sm" class="capitalize" @click="accent = a"
71
+ >{{ a }}</UButton>
72
+ </UFieldGroup>
73
+ </template>
74
+
75
+ <p class="mb-4 text-sm text-muted">{{ t('styleguide.note') }}</p>
76
+ <nav :aria-label="t('styleguide.sections')" class="mb-8 flex flex-wrap gap-2">
77
+ <UButton v-for="id in toc" :key="id" :to="`#${id}`" color="neutral" variant="soft" size="sm">{{ t(`styleguide.toc.${id}`) }}</UButton>
78
+ </nav>
79
+
80
+ <div class="space-y-10">
81
+ <section id="brand" class="space-y-4 scroll-mt-20">
82
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.brand') }}</h2>
83
+ <p class="text-muted max-w-2xl">Playful, calm, simple. The client's name leads; tinyzoo signs the sidebar and the sign-in, gives the tab its icon, and sends one animal to each moment. Brand guide: docs/brand/brand-guide.md.</p>
84
+ <div class="grid gap-3 md:grid-cols-2">
85
+ <div class="cms-card p-8 grid place-items-center" style="background: var(--tz-cream)">
86
+ <img :src="cmsBrand.logoUrl" alt="tinyzoo" class="h-10 w-auto">
87
+ </div>
88
+ <div class="cms-card p-8 grid place-items-center" style="background: var(--tz-charcoal)">
89
+ <img :src="cmsBrand.logoReversedUrl" alt="tinyzoo" class="h-10 w-auto">
90
+ </div>
91
+ </div>
92
+ <div class="grid gap-3 sm:grid-cols-3">
93
+ <div v-for="c in brandColors" :key="c.name" class="cms-card p-4 flex items-center gap-3">
94
+ <span class="size-9 rounded-md border border-default shrink-0" :style="{ backgroundColor: c.value }" />
95
+ <span>
96
+ <span class="block text-sm font-medium text-highlighted">{{ c.name }} <span class="font-mono text-xs text-muted">{{ c.value }}</span></span>
97
+ <span class="block text-xs text-muted">{{ c.use }}</span>
98
+ </span>
99
+ </div>
100
+ </div>
101
+ <CmsSection title="The animals">
102
+ <p class="text-sm text-muted mb-4">One flat colour, the same eyes, everyone looking up and to the right. One animal per moment, never in the chrome: the hedgehog at sign-in, the owl on the welcome, the bird before publishing, the whale when it's live (the turtle when it's scheduled), a muted animal per empty place. The bright six greet a fresh install.</p>
103
+ <ul class="flex flex-wrap items-end gap-x-5 gap-y-4">
104
+ <li v-for="c in cmsCharacters.muted" :key="c.name" class="flex flex-col items-center gap-1.5">
105
+ <img :src="c.url" :alt="c.name" class="h-10 w-auto">
106
+ <span class="text-[0.6875rem] text-muted">{{ c.name }}</span>
107
+ </li>
108
+ </ul>
109
+ <ul class="mt-6 flex flex-wrap items-end gap-x-5 gap-y-4">
110
+ <li v-for="c in cmsCharacters.bright" :key="c.name" class="flex flex-col items-center gap-1.5">
111
+ <img :src="c.url" :alt="c.name" class="h-10 w-auto">
112
+ <span class="text-[0.6875rem] text-muted">{{ c.name }}</span>
113
+ </li>
114
+ </ul>
115
+ </CmsSection>
116
+ </section>
117
+
118
+ <section id="color" class="space-y-4 scroll-mt-20">
119
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.color') }}</h2>
120
+ <p class="text-muted max-w-2xl">Light: a white workspace with true greys and ink text, charcoal for the one primary action, cream only for moments. Dark ("charcoal night"): greys tinted toward the charcoal, cream text, and a cream primary. Colour otherwise appears only where it means something: status. A client's accent can replace charcoal.</p>
121
+ <CmsSection v-for="ramp in ramps" :key="ramp" :title="ramp">
122
+ <div class="cms-ramp gap-1.5">
123
+ <div v-for="s in steps" :key="s" class="space-y-1.5">
124
+ <div class="h-12 rounded-md border border-default/50" :style="{ backgroundColor: `var(--ui-color-${ramp}-${s})` }" />
125
+ <div class="text-[0.6875rem] text-muted tabular-nums text-center">{{ s }}</div>
126
+ </div>
127
+ </div>
128
+ </CmsSection>
129
+ <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
130
+ <div v-for="s in states" :key="s.color" class="cms-card p-4 flex items-start gap-3">
131
+ <span class="mt-1 size-3 rounded-full shrink-0" :style="{ backgroundColor: `var(--ui-${s.color})` }" />
132
+ <span>
133
+ <span class="block text-sm font-medium text-highlighted">{{ s.label }}</span>
134
+ <span class="block text-xs text-muted">{{ s.use }}</span>
135
+ </span>
136
+ </div>
137
+ </div>
138
+ </section>
139
+
140
+ <section id="type" class="space-y-4 scroll-mt-20">
141
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.type') }}</h2>
142
+ <div class="grid gap-4 lg:grid-cols-3">
143
+ <CmsSection title="Titles & moments — Manrope bold">
144
+ <p class="cms-display text-[1.75rem] leading-tight text-highlighted">Dobré ráno, Jano</p>
145
+ <p class="mt-2 text-xs text-muted">The wordmark's face. Page titles 28 px, entry titles 30–36 px, greetings and moments. Tight tracking.</p>
146
+ </CmsSection>
147
+ <CmsSection title="Interface — Inter">
148
+ <p class="text-sm text-highlighted font-medium">Uložit a zveřejnit</p>
149
+ <p class="text-sm text-default">Body text in the interface is 14–15 px.</p>
150
+ <p class="text-xs text-muted">Secondary text and metadata, 12–13 px.</p>
151
+ <p class="mt-2 text-xs text-muted tabular-nums">Numbers: 1 234 · 12. 11. 2026 9:00</p>
152
+ </CmsSection>
153
+ <CmsSection title="Writing — Inter">
154
+ <p class="cms-prose text-default">Rich text in the editor reads like the published page, so writers see their words as readers will.</p>
155
+ </CmsSection>
156
+ </div>
157
+ </section>
158
+
159
+ <section id="surfaces" class="space-y-4 scroll-mt-20">
160
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.surfaces') }}</h2>
161
+ <p class="text-muted max-w-2xl">Flat surfaces separated by hairline borders, no shadows (only a moment that arrives floats). One frame per group — never nested. Radius 8 px for controls, 12 px for cards, 16 px for moments.</p>
162
+ <div class="grid gap-4 sm:grid-cols-3">
163
+ <div class="cms-card p-5 text-sm">.cms-card</div>
164
+ <div class="rounded-(--ui-radius) bg-elevated p-5 text-sm">bg-elevated (hover, selected)</div>
165
+ <div class="rounded-(--ui-radius) border border-dashed border-accented p-5 text-sm text-muted">Drop zone / placeholder</div>
166
+ </div>
167
+ </section>
168
+
169
+ <section id="moments" class="space-y-4 scroll-mt-20">
170
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.moments') }}</h2>
171
+ <p class="text-muted max-w-2xl">Where the brand speaks: a cream panel (charcoal in dark mode), one animal, a Manrope line, one sentence, at most two actions. At most one playful sentence per screen; labels, errors and confirmations stay plain.</p>
172
+ <div class="cms-moment flex items-center justify-between gap-6 p-6">
173
+ <div>
174
+ <p class="cms-display text-2xl text-highlighted">Dobré ráno, Jano</p>
175
+ <p class="cms-moment__muted text-sm mt-1">Jeden koncept čeká na zveřejnění.</p>
176
+ <div class="mt-4 flex gap-2"><UButton icon="i-lucide-pen">Napsat aktualitu</UButton><UButton color="neutral" variant="outline" class="bg-(--cms-surface)">Přidat akci</UButton></div>
177
+ </div>
178
+ <img :src="cmsCharacter('owl').url" alt="" class="h-20 w-auto max-sm:hidden">
179
+ </div>
180
+ <div class="cms-card flex items-start gap-4 p-4 max-w-md shadow-[0_18px_40px_-14px_rgba(0,0,0,.35)]">
181
+ <img :src="cmsCharacter('whale').url" alt="" class="h-12 w-auto">
182
+ <div><p class="cms-display text-base text-highlighted">A je to na webu.</p><p class="text-sm text-muted">Návštěvníci to už vidí.</p></div>
183
+ </div>
184
+ </section>
185
+
186
+ <section id="editors" class="space-y-4 scroll-mt-20">
187
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.editors') }}</h2>
188
+ <p class="text-muted max-w-2xl">One top bar (‹ back · status · saved | Preview · Publish) and one set of fields, in three arrangements picked from the content model. Developers override with <code class="font-mono text-xs">admin.editor</code> and <code class="font-mono text-xs">admin.list.layout</code>.</p>
189
+ <div class="grid gap-3 md:grid-cols-3">
190
+ <CmsSection title="Write">
191
+ <p class="text-sm text-muted">A rich-text body with a page on the website (news). The sidebar folds to icons; one centred column as the reader meets it — cover photo, title, summary, text without boxes; details beside it as quiet rows and folded groups.</p>
192
+ </CmsSection>
193
+ <CmsSection title="Form">
194
+ <p class="text-sm text-muted">Facts to fill in (events, partners, settings). Every field in titled sections in one column; a full-height details column on the right; long settings get a section menu.</p>
195
+ </CmsSection>
196
+ <CmsSection title="Preview">
197
+ <p class="text-sm text-muted">The layout is the point (pages from blocks, the home page). The form beside the live page; a full-screen sheet on phones.</p>
198
+ </CmsSection>
199
+ </div>
200
+ <p class="text-sm text-muted max-w-2xl">Lists: a <b class="text-highlighted font-medium">table</b> with an "In progress" strip above it when there are drafts; <b class="text-highlighted font-medium">grid</b> when the picture is the content (albums, logos); <b class="text-highlighted font-medium">Upcoming / Past</b> by month for dated content without drafts. Publishing goes through a review step (warnings never block); settings save straight to the website. An item can open <b class="text-highlighted font-medium">beside its list</b> (the media library): docked, resizable, the list stays usable.</p>
201
+ </section>
202
+
203
+ <section id="actions" class="space-y-4 scroll-mt-20">
204
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.actions') }}</h2>
205
+ <p class="text-muted max-w-2xl">At most one solid primary button per view. Verbs on buttons ("Publish post", not "OK"). Destructive actions are red and always confirmed.</p>
206
+ <CmsSection>
207
+ <div class="space-y-3 overflow-x-auto">
208
+ <div v-for="c in colors" :key="c" class="flex items-center gap-2">
209
+ <span class="w-20 text-xs text-muted shrink-0">{{ c }}</span>
210
+ <UButton v-for="v in variants" :key="v" :color="c" :variant="v" size="sm">{{ v }}</UButton>
211
+ </div>
212
+ </div>
213
+ </CmsSection>
214
+ </section>
215
+
216
+ <section id="status" class="space-y-4 scroll-mt-20">
217
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.status') }}</h2>
218
+ <CmsSection>
219
+ <div class="flex flex-wrap items-center gap-3">
220
+ <CmsStatusBadge :published="false" />
221
+ <CmsStatusBadge :published="true" />
222
+ <CmsStatusBadge :published="true" :scheduled-for="soon" />
223
+ </div>
224
+ </CmsSection>
225
+ </section>
226
+
227
+ <section id="forms" class="space-y-4 scroll-mt-20">
228
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.forms') }}</h2>
229
+ <p class="text-muted max-w-2xl">Sections named as plain questions (<code class="font-mono text-xs">admin.sections</code>), an icon in each control, a few choices as buttons, a switch with its sentence, dates from a calendar with "All day", empty optional fields behind "+ Add". Try it — this is the real component.</p>
230
+ <div class="max-w-[40rem]">
231
+ <CmsFormSections :fields="demoFields" :sections="demoSections" :state="demo" disclose id-prefix="sg-">
232
+ <template #field="{ field: f }">
233
+ <CmsField v-model="demo[f.key]" :field="f" entity="styleguide" placement="main" id-prefix="sg-" hide-optional />
234
+ </template>
235
+ </CmsFormSections>
236
+ </div>
237
+ </section>
238
+
239
+ <section id="states" class="space-y-4 scroll-mt-20">
240
+ <h2 class="cms-display text-lg font-semibold text-highlighted">{{ t('styleguide.toc.states') }}</h2>
241
+ <div class="grid gap-4 lg:grid-cols-3">
242
+ <div class="cms-card">
243
+ <CmsEmptyState icon="i-lucide-newspaper" title="No posts yet" description="Articles on the blog. Drafts stay private until you publish them.">
244
+ <template #actions><UButton icon="i-lucide-plus" size="sm">Create the first one</UButton></template>
245
+ </CmsEmptyState>
246
+ </div>
247
+ <div class="cms-card">
248
+ <CmsEmptyState variant="no-results" title="Nothing matches “chleba”" description="Try a different word, or clear the search.">
249
+ <template #actions><UButton color="neutral" variant="outline" size="sm">Clear search</UButton></template>
250
+ </CmsEmptyState>
251
+ </div>
252
+ <div class="cms-card">
253
+ <CmsEmptyState variant="error" title="Could not load this list" description="The server did not answer.">
254
+ <template #actions><UButton color="neutral" variant="outline" size="sm" icon="i-lucide-rotate-ccw">Try again</UButton></template>
255
+ </CmsEmptyState>
256
+ </div>
257
+ </div>
258
+ </section>
259
+ </div>
260
+ </CmsPage>
261
+ </template>