@questpie/admin 0.0.1 → 1.0.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 (250) hide show
  1. package/README.md +439 -424
  2. package/dist/auth-layout-M8K8_q5R.mjs +181 -0
  3. package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
  4. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +273 -0
  5. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +1 -0
  6. package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
  7. package/dist/card-BKHjBQfw.mjs.map +1 -0
  8. package/dist/client/styles/index.css +434 -0
  9. package/dist/client-DbpZKSgH.d.mts +13585 -0
  10. package/dist/client-DbpZKSgH.d.mts.map +1 -0
  11. package/dist/client-njX1rZmi.mjs +22612 -0
  12. package/dist/client-njX1rZmi.mjs.map +1 -0
  13. package/dist/client.d.mts +3 -0
  14. package/dist/client.mjs +13 -0
  15. package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
  16. package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
  17. package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
  18. package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
  19. package/dist/dashboard-page-mCY0pgZv.mjs +3 -0
  20. package/dist/dropzone-Do3awXKd.mjs +634 -0
  21. package/dist/dropzone-Do3awXKd.mjs.map +1 -0
  22. package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
  23. package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
  24. package/dist/forgot-password-page-CEwsdLwn.mjs +3 -0
  25. package/dist/index-B9Xwk4hi.d.mts +2753 -0
  26. package/dist/index-B9Xwk4hi.d.mts.map +1 -0
  27. package/dist/index.d.mts +3 -0
  28. package/dist/index.mjs +13 -0
  29. package/dist/login-page-BUnpCbCa.mjs +3 -0
  30. package/dist/login-page-CP4gA-dl.mjs +298 -0
  31. package/dist/login-page-CP4gA-dl.mjs.map +1 -0
  32. package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
  33. package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
  34. package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
  35. package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
  36. package/dist/reset-password-page-CufHz3h3.mjs +3 -0
  37. package/dist/runtime-6VZM878K.mjs +69 -0
  38. package/dist/runtime-6VZM878K.mjs.map +1 -0
  39. package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
  40. package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
  41. package/dist/server.d.mts +250 -0
  42. package/dist/server.d.mts.map +1 -0
  43. package/dist/server.mjs +832 -0
  44. package/dist/server.mjs.map +1 -0
  45. package/dist/setup-page-BNNzt_Z6.mjs +3 -0
  46. package/dist/setup-page-YAP_fzqh.mjs +264 -0
  47. package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
  48. package/dist/shared.d.mts +57 -0
  49. package/dist/shared.d.mts.map +1 -0
  50. package/dist/shared.mjs +3 -0
  51. package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
  52. package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
  53. package/package.json +48 -198
  54. package/.turbo/turbo-build.log +0 -108
  55. package/CHANGELOG.md +0 -10
  56. package/STATUS.md +0 -917
  57. package/VALIDATION.md +0 -602
  58. package/components.json +0 -24
  59. package/dist/__tests__/setup.mjs +0 -38
  60. package/dist/__tests__/test-utils.mjs +0 -45
  61. package/dist/__tests__/vitest.d.mjs +0 -3
  62. package/dist/components/admin-app.mjs +0 -69
  63. package/dist/components/fields/array-field.mjs +0 -190
  64. package/dist/components/fields/checkbox-field.mjs +0 -34
  65. package/dist/components/fields/custom-field.mjs +0 -32
  66. package/dist/components/fields/date-field.mjs +0 -41
  67. package/dist/components/fields/datetime-field.mjs +0 -42
  68. package/dist/components/fields/email-field.mjs +0 -37
  69. package/dist/components/fields/embedded-collection.mjs +0 -253
  70. package/dist/components/fields/field-types.mjs +0 -1
  71. package/dist/components/fields/field-utils.mjs +0 -10
  72. package/dist/components/fields/field-wrapper.mjs +0 -34
  73. package/dist/components/fields/index.mjs +0 -23
  74. package/dist/components/fields/json-field.mjs +0 -243
  75. package/dist/components/fields/locale-badge.mjs +0 -16
  76. package/dist/components/fields/number-field.mjs +0 -39
  77. package/dist/components/fields/password-field.mjs +0 -37
  78. package/dist/components/fields/relation-field.mjs +0 -104
  79. package/dist/components/fields/relation-picker.mjs +0 -229
  80. package/dist/components/fields/relation-select.mjs +0 -188
  81. package/dist/components/fields/rich-text-editor/index.mjs +0 -897
  82. package/dist/components/fields/select-field.mjs +0 -41
  83. package/dist/components/fields/switch-field.mjs +0 -34
  84. package/dist/components/fields/text-field.mjs +0 -38
  85. package/dist/components/fields/textarea-field.mjs +0 -38
  86. package/dist/components/index.mjs +0 -59
  87. package/dist/components/primitives/checkbox-input.mjs +0 -127
  88. package/dist/components/primitives/date-input.mjs +0 -303
  89. package/dist/components/primitives/index.mjs +0 -12
  90. package/dist/components/primitives/number-input.mjs +0 -104
  91. package/dist/components/primitives/select-input.mjs +0 -177
  92. package/dist/components/primitives/tag-input.mjs +0 -135
  93. package/dist/components/primitives/text-input.mjs +0 -39
  94. package/dist/components/primitives/textarea-input.mjs +0 -37
  95. package/dist/components/primitives/toggle-input.mjs +0 -31
  96. package/dist/components/primitives/types.mjs +0 -12
  97. package/dist/components/ui/accordion.mjs +0 -55
  98. package/dist/components/ui/avatar.mjs +0 -54
  99. package/dist/components/ui/badge.mjs +0 -34
  100. package/dist/components/ui/button.mjs +0 -48
  101. package/dist/components/ui/checkbox.mjs +0 -21
  102. package/dist/components/ui/combobox.mjs +0 -163
  103. package/dist/components/ui/dialog.mjs +0 -95
  104. package/dist/components/ui/dropdown-menu.mjs +0 -138
  105. package/dist/components/ui/field.mjs +0 -113
  106. package/dist/components/ui/input-group.mjs +0 -82
  107. package/dist/components/ui/input.mjs +0 -17
  108. package/dist/components/ui/label.mjs +0 -15
  109. package/dist/components/ui/popover.mjs +0 -56
  110. package/dist/components/ui/scroll-area.mjs +0 -38
  111. package/dist/components/ui/select.mjs +0 -100
  112. package/dist/components/ui/separator.mjs +0 -16
  113. package/dist/components/ui/sheet.mjs +0 -90
  114. package/dist/components/ui/sidebar.mjs +0 -387
  115. package/dist/components/ui/skeleton.mjs +0 -14
  116. package/dist/components/ui/spinner.mjs +0 -16
  117. package/dist/components/ui/switch.mjs +0 -22
  118. package/dist/components/ui/table.mjs +0 -68
  119. package/dist/components/ui/tabs.mjs +0 -48
  120. package/dist/components/ui/textarea.mjs +0 -15
  121. package/dist/components/ui/tooltip.mjs +0 -44
  122. package/dist/config/component-registry.mjs +0 -38
  123. package/dist/config/index.mjs +0 -129
  124. package/dist/hooks/admin-provider.mjs +0 -70
  125. package/dist/hooks/index.mjs +0 -7
  126. package/dist/hooks/store.mjs +0 -178
  127. package/dist/hooks/use-collection-db.mjs +0 -146
  128. package/dist/hooks/use-collection.mjs +0 -112
  129. package/dist/hooks/use-global.mjs +0 -46
  130. package/dist/hooks/use-mobile.mjs +0 -20
  131. package/dist/lib/utils.mjs +0 -10
  132. package/dist/styles/index.css +0 -336
  133. package/dist/styles/index.mjs +0 -1
  134. package/dist/utils/index.mjs +0 -9
  135. package/dist/views/auth/auth-layout.mjs +0 -52
  136. package/dist/views/auth/index.mjs +0 -6
  137. package/dist/views/auth/login-form.mjs +0 -156
  138. package/dist/views/collection/auto-form-fields.mjs +0 -525
  139. package/dist/views/collection/collection-form.mjs +0 -91
  140. package/dist/views/collection/collection-list.mjs +0 -76
  141. package/dist/views/collection/form-field.mjs +0 -42
  142. package/dist/views/collection/index.mjs +0 -6
  143. package/dist/views/common/index.mjs +0 -4
  144. package/dist/views/common/locale-switcher.mjs +0 -39
  145. package/dist/views/common/version-history.mjs +0 -272
  146. package/dist/views/index.mjs +0 -9
  147. package/dist/views/layout/admin-layout.mjs +0 -40
  148. package/dist/views/layout/admin-router.mjs +0 -95
  149. package/dist/views/layout/admin-sidebar.mjs +0 -63
  150. package/dist/views/layout/index.mjs +0 -5
  151. package/src/__tests__/setup.ts +0 -44
  152. package/src/__tests__/test-utils.tsx +0 -49
  153. package/src/__tests__/vitest.d.ts +0 -9
  154. package/src/components/admin-app.tsx +0 -221
  155. package/src/components/fields/array-field.tsx +0 -237
  156. package/src/components/fields/checkbox-field.tsx +0 -47
  157. package/src/components/fields/custom-field.tsx +0 -50
  158. package/src/components/fields/date-field.tsx +0 -65
  159. package/src/components/fields/datetime-field.tsx +0 -67
  160. package/src/components/fields/email-field.tsx +0 -51
  161. package/src/components/fields/embedded-collection.tsx +0 -315
  162. package/src/components/fields/field-types.ts +0 -162
  163. package/src/components/fields/field-utils.ts +0 -6
  164. package/src/components/fields/field-wrapper.tsx +0 -52
  165. package/src/components/fields/index.ts +0 -66
  166. package/src/components/fields/json-field.tsx +0 -440
  167. package/src/components/fields/locale-badge.tsx +0 -15
  168. package/src/components/fields/number-field.tsx +0 -57
  169. package/src/components/fields/password-field.tsx +0 -51
  170. package/src/components/fields/relation-field.tsx +0 -243
  171. package/src/components/fields/relation-picker.tsx +0 -402
  172. package/src/components/fields/relation-select.tsx +0 -327
  173. package/src/components/fields/rich-text-editor/index.tsx +0 -1337
  174. package/src/components/fields/select-field.tsx +0 -61
  175. package/src/components/fields/switch-field.tsx +0 -47
  176. package/src/components/fields/text-field.tsx +0 -55
  177. package/src/components/fields/textarea-field.tsx +0 -55
  178. package/src/components/index.ts +0 -40
  179. package/src/components/primitives/checkbox-input.tsx +0 -193
  180. package/src/components/primitives/date-input.tsx +0 -401
  181. package/src/components/primitives/index.ts +0 -24
  182. package/src/components/primitives/number-input.tsx +0 -132
  183. package/src/components/primitives/select-input.tsx +0 -296
  184. package/src/components/primitives/tag-input.tsx +0 -200
  185. package/src/components/primitives/text-input.tsx +0 -49
  186. package/src/components/primitives/textarea-input.tsx +0 -46
  187. package/src/components/primitives/toggle-input.tsx +0 -36
  188. package/src/components/primitives/types.ts +0 -235
  189. package/src/components/ui/accordion.tsx +0 -72
  190. package/src/components/ui/avatar.tsx +0 -106
  191. package/src/components/ui/badge.tsx +0 -48
  192. package/src/components/ui/button.tsx +0 -53
  193. package/src/components/ui/card.tsx +0 -94
  194. package/src/components/ui/checkbox.tsx +0 -27
  195. package/src/components/ui/combobox.tsx +0 -290
  196. package/src/components/ui/dialog.tsx +0 -151
  197. package/src/components/ui/dropdown-menu.tsx +0 -254
  198. package/src/components/ui/field.tsx +0 -227
  199. package/src/components/ui/input-group.tsx +0 -149
  200. package/src/components/ui/input.tsx +0 -20
  201. package/src/components/ui/label.tsx +0 -18
  202. package/src/components/ui/popover.tsx +0 -88
  203. package/src/components/ui/scroll-area.tsx +0 -53
  204. package/src/components/ui/select.tsx +0 -192
  205. package/src/components/ui/separator.tsx +0 -23
  206. package/src/components/ui/sheet.tsx +0 -127
  207. package/src/components/ui/sidebar.tsx +0 -723
  208. package/src/components/ui/skeleton.tsx +0 -13
  209. package/src/components/ui/spinner.tsx +0 -10
  210. package/src/components/ui/switch.tsx +0 -32
  211. package/src/components/ui/table.tsx +0 -99
  212. package/src/components/ui/tabs.tsx +0 -82
  213. package/src/components/ui/textarea.tsx +0 -18
  214. package/src/components/ui/tooltip.tsx +0 -70
  215. package/src/config/component-registry.ts +0 -190
  216. package/src/config/index.ts +0 -1099
  217. package/src/hooks/README.md +0 -269
  218. package/src/hooks/admin-provider.tsx +0 -110
  219. package/src/hooks/index.ts +0 -41
  220. package/src/hooks/store.ts +0 -248
  221. package/src/hooks/use-auth.ts +0 -168
  222. package/src/hooks/use-collection-db.ts +0 -209
  223. package/src/hooks/use-collection.ts +0 -156
  224. package/src/hooks/use-global.ts +0 -69
  225. package/src/hooks/use-mobile.ts +0 -21
  226. package/src/lib/utils.ts +0 -6
  227. package/src/styles/index.css +0 -340
  228. package/src/utils/index.ts +0 -6
  229. package/src/views/auth/auth-layout.tsx +0 -77
  230. package/src/views/auth/forgot-password-form.tsx +0 -192
  231. package/src/views/auth/index.ts +0 -21
  232. package/src/views/auth/login-form.tsx +0 -229
  233. package/src/views/auth/reset-password-form.tsx +0 -232
  234. package/src/views/collection/auto-form-fields.tsx +0 -982
  235. package/src/views/collection/collection-form.tsx +0 -186
  236. package/src/views/collection/collection-list.tsx +0 -223
  237. package/src/views/collection/form-field.tsx +0 -52
  238. package/src/views/collection/index.ts +0 -15
  239. package/src/views/common/index.ts +0 -8
  240. package/src/views/common/locale-switcher.tsx +0 -45
  241. package/src/views/common/version-history.tsx +0 -406
  242. package/src/views/index.ts +0 -25
  243. package/src/views/layout/admin-layout.tsx +0 -117
  244. package/src/views/layout/admin-router.tsx +0 -206
  245. package/src/views/layout/admin-sidebar.tsx +0 -185
  246. package/src/views/layout/index.ts +0 -12
  247. package/tsconfig.json +0 -13
  248. package/tsconfig.tsbuildinfo +0 -1
  249. package/tsdown.config.ts +0 -13
  250. package/vitest.config.ts +0 -29
package/STATUS.md DELETED
@@ -1,917 +0,0 @@
1
- # @questpie/admin - Aktuálny Stav a Roadmap
2
-
3
- **Dátum:** 2025-12-31
4
- **Verzia:** 0.0.1 (pre-alpha)
5
- **Core Funkcionalita:** 93% hotová
6
-
7
- ---
8
-
9
- ## 📋 Executive Summary
10
-
11
- **@questpie/admin** je config-driven admin UI package pre Questpie CMS. Hlavná myšlienka:
12
-
13
- > **Mount jednu komponentu + voliteľný config = kompletné admin UI**
14
-
15
- ```tsx
16
- // Minimálne použitie - UI auto-generované z configu
17
- <AdminApp client={cmsClient} router={{...}} />
18
-
19
- // S custom config - override čohokoľvek
20
- <AdminApp client={cmsClient} config={adminConfig} router={{...}} />
21
- ```
22
-
23
- **Filozofia:**
24
- - ✅ **Config-driven** - všetko z configu, nie z kódu
25
- - ✅ **Auto-generation** - UI generované z admin configu (bez schema introspection)
26
- - ✅ **Seamless DX** - minimum kódu, maximum funkcií
27
- - ✅ **Override anywhere** - každý detail je customizovateľný
28
- - ✅ **Type-safe** - plná TypeScript podpora end-to-end
29
-
30
- ---
31
-
32
- ## ✅ Aktuálny stav (skrátene)
33
-
34
- - ✅ Explicitné field typy + relation targety (žiadne inferovanie)
35
- - ✅ AutoFormFields: sections, tabs, grid/columns/inline/sidebar layouty
36
- - ✅ Relation fields: single select + multi picker + DnD ordering
37
- - ✅ Embedded collections + array field
38
- - ✅ Rich text editor: toolbar toggles, slash commands, table controls, image UI
39
- - ✅ Lokalizácia: locale switcher + badge pri localized poliach
40
- - ✅ Version history + audit log UI
41
- - ✅ Realtime listy, optimistic create/update/delete
42
-
43
- ## ✅ ČO FUNGUJE TERAZ (Production-Ready)
44
-
45
- ### 1. Core Architektúra
46
-
47
- **Jedna komponenta pre všetko:**
48
- ```tsx
49
- import { AdminApp } from "@questpie/admin";
50
- import "@questpie/admin/styles";
51
-
52
- <AdminApp
53
- client={cmsClient} // JEDINÝ required prop
54
- config={adminConfig} // Voliteľné
55
- router={{...}} // Router integrácia
56
- />
57
- ```
58
-
59
- **Automaticky dostaneš:**
60
- - ✅ Sidebar navigáciu (auto-generovaná z collections)
61
- - ✅ Routing (`/admin`, `/admin/:collection`, `/admin/:collection/:id`)
62
- - ✅ List views (tabuľky s dátami)
63
- - ✅ Create/Edit formuláre (AutoFormFields z admin configu)
64
- - ✅ Delete funkciu
65
- - ✅ Search a filtrovanie
66
- - ✅ Pagination
67
- - ✅ Realtime updates (SSE)
68
-
69
- ### 2. Conditional Field Logic
70
-
71
- **Fieldy môžu byť dynamické:**
72
- ```typescript
73
- fields: {
74
- status: {
75
- type: "select",
76
- options: [
77
- { label: "Pending", value: "pending" },
78
- { label: "Cancelled", value: "cancelled" }
79
- ]
80
- },
81
-
82
- // Zobrazí sa len keď status === "cancelled"
83
- cancellationReason: {
84
- type: "textarea",
85
- visible: (values) => values.status === "cancelled",
86
- required: (values) => values.status === "cancelled",
87
- readOnly: false
88
- },
89
-
90
- // Disabled keď nie je draft
91
- publishedAt: {
92
- type: "datetime",
93
- disabled: (values) => values.status !== "draft"
94
- },
95
-
96
- // Dynamické options
97
- category: {
98
- type: "select",
99
- options: (values) => {
100
- if (values.type === "tech") {
101
- return [{ label: "Frontend", value: "frontend" }];
102
- }
103
- return [{ label: "Design", value: "design" }];
104
- }
105
- }
106
- }
107
- ```
108
-
109
- ### Lokalizácia (i18n)
110
-
111
- - ✅ Locale switcher (list + form view)
112
- - ✅ Badge pri localized fielde (label)
113
- - ✅ `localized: true` v admin configu
114
-
115
- ### 3. Relation Fields
116
-
117
- **Single Relation (one-to-one):**
118
- ```typescript
119
- fields: {
120
- barberId: {
121
- label: "Barber",
122
- relation: {
123
- targetCollection: "barbers", // Povinné nastaviť explicitne
124
- mode: "inline" // Alebo "picker", "create"
125
- }
126
- }
127
- }
128
- ```
129
-
130
- **Features:**
131
- - ➕ Plus button - vytvorí nový záznam (otvára side sheet)
132
- - ✏️ Edit button - edituje vybraný záznam (side sheet)
133
- - 🔍 Auto-complete search
134
- - ❌ Clear button (keď nie je required)
135
- - 🏷️ Display label = `_title`
136
-
137
- **Multiple Relations (one-to-many, many-to-many):**
138
- ```typescript
139
- fields: {
140
- tags: {
141
- relation: {
142
- targetCollection: "tags",
143
- mode: "picker", // Multiple select
144
- orderable: true, // Drag-and-drop reordering
145
- filter: (values) => ({ // Conditional filtering
146
- where: { type: values.postType }
147
- })
148
- }
149
- }
150
- }
151
- ```
152
-
153
- **Features:**
154
- - ➕ Create new items inline
155
- - ✏️ Edit each selected item
156
- - ❌ Remove items
157
- - 🎯 Drag-and-drop reordering
158
- - 🔍 Search a filter
159
-
160
- ### 4. Version History & Audit Logging
161
-
162
- **Config:**
163
- ```typescript
164
- collections: {
165
- appointments: {
166
- versioned: true, // Povoliť versioning
167
-
168
- auditLog: {
169
- fields: ["status", "scheduledAt"], // Čo trackovať
170
- trackUser: true, // Kto urobil zmenu
171
- retentionDays: 365 // Ako dlho držať historiu
172
- },
173
-
174
- edit: {
175
- showVersionHistory: true // Zobrazovať v edit forme
176
- }
177
- }
178
- }
179
- ```
180
-
181
- **Features:**
182
- - 📊 Kompletná história verzií
183
- - 👤 Tracking kto urobil zmenu
184
- - ⏰ Timestamp každej zmeny
185
- - 📝 Diff view (old vs new value)
186
- - 🔄 Restore previous version
187
- - 🏷️ Action badges (Created, Updated, Deleted)
188
-
189
- ### 5. Sections Organization
190
-
191
- **Základné sekcie:**
192
- ```typescript
193
- edit: {
194
- sections: [
195
- {
196
- title: "Basic Information",
197
- description: "Main details",
198
- fields: ["name", "email", "phone"],
199
- collapsible: true,
200
- defaultOpen: true
201
- },
202
- {
203
- title: "Settings",
204
- fields: ["isActive", "role"]
205
- }
206
- ]
207
- }
208
- ```
209
-
210
- ### 6. Schema Introspection
211
-
212
- Nie je implementované ani plánované. Typy polí a relation targety musia byť explicitne v admin configu.
213
-
214
- ### 7. Component Registry
215
-
216
- **Custom field komponenty:**
217
- ```tsx
218
- <AdminApp
219
- registry={{
220
- fields: {
221
- richText: RichTextEditor, // Custom editor
222
- image: ImagePicker, // Custom image picker
223
- customField: MyFieldComponent
224
- }
225
- }}
226
- />
227
- ```
228
-
229
- ### 8. TanStack Integration
230
-
231
- **Plná integrácia:**
232
- - ✅ TanStack Router (router-agnostic design)
233
- - ✅ TanStack Query (pre data fetching)
234
- - ✅ TanStack Table (pre list views)
235
- - ✅ Optimistic updates
236
- - ✅ Realtime SSE
237
-
238
- ### 9. Batteries Included
239
-
240
- **53+ shadcn/ui komponenty:**
241
- - Button, Card, Dialog, Sheet, Tabs, Accordion
242
- - Input, Select, Checkbox, Switch, Textarea
243
- - Table, Pagination, Combobox
244
- - Badge, Alert, Toast (Sonner)
245
- - Calendar, DatePicker
246
- - Charts (recharts)
247
- - ... a ďalšie
248
-
249
- **Všetko exportované:**
250
- ```tsx
251
- import {
252
- Button,
253
- Card,
254
- Dialog,
255
- RelationSelect,
256
- VersionHistory
257
- } from "@questpie/admin/components";
258
- ```
259
-
260
- ### 10. Docker Setup
261
-
262
- **Jediná závislosť: Postgres**
263
- ```yaml
264
- services:
265
- postgres:
266
- image: postgres:17-alpine
267
-
268
- app:
269
- build: .
270
- # NO Redis, NO external queue, NO SMTP required!
271
- ```
272
-
273
- **Batteries included v CMS:**
274
- - Auth: Better Auth
275
- - Storage: Flydrive (S3/R2/Local)
276
- - Queue: pg-boss (používa Postgres)
277
- - Email: Console/SMTP
278
- - Logging: Pino
279
-
280
- ---
281
-
282
- ## ✅ ADVANCED FORM LAYOUTS IMPLEMENTED
283
-
284
- ### Advanced Form Layouts
285
-
286
- **Config + rendering hotové (AutoFormFields):**
287
-
288
- **Multi-column:**
289
- ```typescript
290
- sections: [
291
- {
292
- layout: "columns",
293
- columns: 2,
294
- grid: {
295
- responsive: {
296
- sm: 1, // mobile: 1 stĺpec
297
- md: 2, // tablet: 2 stĺpce
298
- lg: 3 // desktop: 3 stĺpce
299
- }
300
- },
301
- fields: ["firstName", "lastName", "email", "phone"]
302
- }
303
- ]
304
- ```
305
-
306
- **Grid s spanmi:**
307
- ```typescript
308
- sections: [
309
- {
310
- layout: "grid",
311
- grid: { columns: 4, gap: 4 },
312
- fields: [
313
- { field: "title", span: 4 }, // full width
314
- { field: "price", span: 1 }, // 1/4
315
- { field: "firstName", span: "1/2" }, // half
316
- { field: "lastName", span: "1/2" } // half
317
- ]
318
- }
319
- ]
320
- ```
321
-
322
- **Inline:**
323
- ```typescript
324
- sections: [
325
- {
326
- layout: "inline",
327
- fields: ["startDate", "endDate"] // Na jednom riadku
328
- }
329
- ]
330
- ```
331
-
332
- **Conditional sections:**
333
- ```typescript
334
- sections: [
335
- {
336
- title: "Payment Details",
337
- visible: (values) => values.status === "paid",
338
- fields: ["paymentMethod", "transactionId"]
339
- }
340
- ]
341
- ```
342
-
343
- **Tabs so sekciami:**
344
- ```typescript
345
- tabs: [
346
- {
347
- id: "content",
348
- label: "Content",
349
- icon: "file-text",
350
- visible: (values) => values.type === "advanced",
351
- sections: [
352
- {
353
- title: "Basic",
354
- layout: "columns",
355
- columns: 2,
356
- fields: ["title", "slug"]
357
- }
358
- ]
359
- }
360
- ]
361
- ```
362
-
363
- **Sidebar layout:**
364
- ```typescript
365
- edit: {
366
- layout: "with-sidebar",
367
-
368
- sections: [
369
- { title: "Content", fields: ["title", "content"] }
370
- ],
371
-
372
- sidebar: {
373
- position: "right",
374
- width: "300px",
375
- fields: ["status", "publishedAt", "author"]
376
- }
377
- }
378
- ```
379
-
380
- **Status:**
381
- - [x] Column layout renderer
382
- - [x] Grid layout s span support
383
- - [x] Conditional section visibility
384
- - [x] Tabs renderer
385
- - [x] Sidebar layout renderer
386
-
387
- ---
388
-
389
- ## ⚠️ CONFIG TYPES HOTOVÉ, RENDERING TODO
390
-
391
- ### 1. Dashboard System
392
-
393
- **Widget types definované:**
394
-
395
- ```typescript
396
- app: {
397
- dashboard: {
398
- title: "Dashboard",
399
- columns: 12,
400
- rowHeight: 80,
401
- customizable: true,
402
-
403
- widgets: [
404
- {
405
- id: "stats-posts",
406
- type: "stats",
407
- title: "Total Posts",
408
- position: { x: 0, y: 0, w: 3, h: 2 },
409
- config: {
410
- collection: "posts",
411
- stat: "count",
412
- trend: { enabled: true, period: "week" }
413
- }
414
- },
415
- {
416
- id: "chart",
417
- type: "chart",
418
- title: "Posts Over Time",
419
- position: { x: 3, y: 0, w: 6, h: 4 },
420
- config: {
421
- collection: "posts",
422
- chartType: "line",
423
- dateField: "createdAt",
424
- groupBy: "day"
425
- }
426
- },
427
- {
428
- id: "recent",
429
- type: "recent-items",
430
- title: "Recent Posts",
431
- position: { x: 0, y: 2, w: 6, h: 4 },
432
- config: {
433
- collection: "posts",
434
- limit: 5,
435
- columns: ["title", "author", "createdAt"]
436
- }
437
- },
438
- {
439
- id: "actions",
440
- type: "quick-actions",
441
- position: { x: 9, y: 0, w: 3, h: 2 },
442
- config: {
443
- actions: [
444
- { label: "New Post", icon: "plus", href: "/admin/posts/new" }
445
- ]
446
- }
447
- }
448
- ]
449
- }
450
- }
451
- ```
452
-
453
- **Widget types:**
454
- - Stats - Štatistiky s trendom
455
- - Chart - Grafy (line, bar, pie, area)
456
- - Recent Items - Posledné záznamy
457
- - Quick Actions - Action buttons
458
- - Custom - Vlastné komponenty
459
-
460
- **TODO:**
461
- - [ ] Dashboard component
462
- - [ ] StatsWidget component
463
- - [ ] ChartWidget component (recharts)
464
- - [ ] RecentItemsWidget component
465
- - [ ] QuickActionsWidget component
466
- - [ ] Widget grid layout renderer
467
-
468
- **Dočasne funguje:**
469
- ```typescript
470
- app: {
471
- dashboard: {
472
- component: CustomDashboard // Full custom override
473
- }
474
- }
475
- ```
476
-
477
- ### 2. Custom Pages
478
-
479
- **Config types ready:**
480
-
481
- ```typescript
482
- app: {
483
- pages: [
484
- {
485
- id: "settings",
486
- label: "Settings",
487
- icon: "settings",
488
- path: "/admin/settings",
489
- component: SettingsPage,
490
- showInNav: true,
491
- group: "system",
492
- order: 100,
493
- permissions: ["admin.settings.view"]
494
- }
495
- ]
496
- }
497
- ```
498
-
499
- **TODO:**
500
- - [ ] AdminRouter support pre custom pages
501
- - [ ] Sidebar navigation pre custom pages
502
- - [ ] Routing implementation
503
- - [ ] Permission checking
504
- - [ ] Navigation groups a ordering
505
-
506
- ---
507
-
508
- ## ❌ NEIMPLEMENTOVANÉ
509
-
510
- ### 1. Block Editor (HIGH PRIORITY)
511
-
512
- **Puck integrácia:**
513
- ```typescript
514
- fields: {
515
- pageContent: {
516
- type: "blocks",
517
- blocks: {
518
- text: TextBlock,
519
- image: ImageBlock,
520
- hero: HeroBlock
521
- },
522
- localized: true // Podpora pre lokalizáciu!
523
- }
524
- }
525
- ```
526
-
527
- **Špecifikácia:** `specifications/RICH_TEXT_AND_BLOCKS.md`
528
-
529
- **Dependencies:**
530
- - @measured/puck (check React 19 compatibility)
531
-
532
- **Lokalizácia v Puck:**
533
- - Option 1: Locale-specific fields (`contentEn`, `contentSk`)
534
- - Option 2: Embedded locale data (v block props)
535
- - Option 3: Locale switcher in editor (recommended)
536
-
537
- ### 3. Embedded Collections
538
-
539
- **Config:**
540
- ```typescript
541
- fields: {
542
- gallery: {
543
- embedded: {
544
- collection: "post_images",
545
- orderable: true, // Drag-and-drop
546
- mode: "inline", // alebo "modal", "drawer"
547
- rowLabel: (item) => item.caption
548
- }
549
- }
550
- }
551
- ```
552
-
553
- **Implemented:**
554
- - [x] EmbeddedCollectionField component
555
- - [x] Inline editing mode
556
- - [x] Modal/drawer modes
557
- - [x] Row labels + ordering
558
- - [x] AutoFormFields integration
559
-
560
- ### 4. Tree Views
561
-
562
- Hierarchické zobrazenie dát (categories, pages).
563
-
564
- **TODO:**
565
- - [ ] Tree view mode pre list
566
- - [ ] Parent-child relationships
567
- - [ ] Collapsible nodes
568
- - [ ] Drag-and-drop reordering
569
-
570
- ### 5. Bulk Actions
571
-
572
- Hromadné operácie na multiple items.
573
-
574
- **TODO:**
575
- - [ ] Select multiple items checkbox
576
- - [ ] Bulk delete
577
- - [ ] Bulk update
578
- - [ ] Custom bulk actions
579
-
580
- ### 6. Saved Views/Filters
581
-
582
- Uloženie user preferences pre list views.
583
-
584
- **TODO:**
585
- - [ ] Save filter combinations
586
- - [ ] Save column configs
587
- - [ ] Share views
588
- - [ ] Default views
589
-
590
- ### 7. Full Drizzle Schema Introspection
591
-
592
- Momentálne používame heuristics (field name patterns).
593
-
594
- **TODO:**
595
- - [ ] Runtime schema parsing z Drizzle
596
- - [ ] Extract column types, constraints, defaults
597
- - [ ] Parse relations z Drizzle schema
598
- - [ ] Eliminácia hardcoded field lists
599
-
600
- ---
601
-
602
- ## 📊 Štatistiky
603
-
604
- **Celkovo:** 23 requirements
605
- **Hotové:** 16 (70%)
606
- **Config types ready:** 3 (13%)
607
- **TODO:** 4 (17%)
608
-
609
- **Core funkcionalita:** 93% ✅
610
-
611
- ---
612
-
613
- ## 🎯 PRIORITY ROADMAP
614
-
615
- ### 🔴 Vysoká Priorita (User Marked)
616
-
617
- 1. ✅ **Rich Text Editor (Tiptap)** - Implementované
618
- - Špec: `specifications/RICH_TEXT_AND_BLOCKS.md`
619
-
620
- 2. **Block Editor (Puck)** - 3-4 dni
621
- - Visual page builder
622
- - Podpora lokalizácie!
623
- - Špec: `specifications/RICH_TEXT_AND_BLOCKS.md`
624
-
625
- 3. ✅ **Embedded Collections** - Implementované
626
- - Inline, modal, drawer
627
- - Ordering + row labels
628
-
629
- ### 🟡 Stredná Priorita
630
-
631
- 4. ✅ **Advanced Layout Rendering** - Implementované
632
- - Columns, grid, inline, tabs, sidebar
633
- - Špec: `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md`
634
-
635
- 5. **Dashboard Widgets** - 3-4 dni
636
- - Config types hotové, treba komponenty
637
- - Stats, Chart, RecentItems, QuickActions
638
- - Špec: `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md`
639
-
640
- 6. **Custom Pages Routing** - 1-2 dni
641
- - Config types hotové, treba routing
642
- - Sidebar integration
643
-
644
- 7. **Full Drizzle Introspection** - 2-3 dni
645
- - Nahradiť heuristics
646
- - Runtime schema parsing
647
-
648
- ### 🟢 Nízka Priorita
649
-
650
- 8. **Tree Views** - 3-4 dni
651
- 9. **Bulk Actions** - 2-3 dni
652
- 10. **Saved Views** - 2-3 dni
653
-
654
- ---
655
-
656
- ## 🗂️ KĽÚČOVÉ SÚBORY
657
-
658
- ### Config System
659
- - `packages/admin/src/config/index.ts` - Všetky config types
660
- - `packages/admin/src/config/component-registry.ts` - Component registry types
661
-
662
- ### Core Components
663
- - `packages/admin/src/components/admin-app.tsx` - Main entry point
664
- - `packages/admin/src/components/views/admin-layout.tsx` - Layout wrapper
665
- - `packages/admin/src/components/views/admin-sidebar.tsx` - Auto sidebar
666
- - `packages/admin/src/components/views/admin-router.tsx` - Auto routing
667
- - `packages/admin/src/components/views/auto-form-fields.tsx` - Auto field generation
668
- - `packages/admin/src/components/views/collection-list.tsx` - List view
669
- - `packages/admin/src/components/views/collection-form.tsx` - Form view
670
-
671
- ### Field Components
672
- - `packages/admin/src/components/fields/relation-select.tsx` - Single relation
673
- - `packages/admin/src/components/fields/relation-picker.tsx` - Multiple relations
674
- - `packages/admin/src/components/views/form-field.tsx` - Base field component
675
- - `packages/admin/src/components/views/version-history.tsx` - Version tracking
676
-
677
- ### Hooks
678
- - `packages/admin/src/hooks/use-admin-context.ts` - Admin context
679
- - `packages/admin/src/hooks/use-collection.ts` - Collection operations
680
-
681
- ### Documentation
682
- - `packages/admin/README.md` - User documentation
683
- - `packages/admin/VALIDATION.md` - Implementation status
684
- - `packages/admin/STATUS.md` - Tento súbor
685
- - `specifications/RICH_TEXT_AND_BLOCKS.md` - Editor specs
686
- - `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md` - Layout specs
687
- - `specifications/ADMIN_PACKAGE_DESIGN.md` - Original design doc
688
- - `examples/tanstack-barbershop/ARCHITECTURE.md` - Example guide
689
-
690
- ### Example
691
- - `examples/tanstack-barbershop/` - Kompletný working example
692
- - `examples/tanstack-barbershop/src/server/cms.ts` - CMS definition
693
- - `examples/tanstack-barbershop/src/configs/admin.ts` - Admin config
694
- - `examples/tanstack-barbershop/src/routes/admin.tsx` - Layout route
695
- - `examples/tanstack-barbershop/src/routes/admin/$.tsx` - Catch-all route
696
-
697
- ---
698
-
699
- ## 🚀 AKO POKRAČOVAŤ (Pre AI/Developers)
700
-
701
- ### Pred začatím:
702
-
703
- 1. **Prečítaj dokumentáciu:**
704
- - `packages/admin/README.md` - User-facing features
705
- - `packages/admin/STATUS.md` - Aktuálny stav (tento súbor)
706
- - `packages/admin/VALIDATION.md` - Detailný status
707
-
708
- 2. **Pozri example:**
709
- - `examples/tanstack-barbershop/` - Working example
710
- - Spusti: `cd examples/tanstack-barbershop && bun run dev`
711
-
712
- 3. **Check dependencies:**
713
- - `DEPENDENCIES.md` - CRITICAL! Correct versions
714
- - zod: ^4.2.1 (NOT v3!)
715
- - drizzle-orm: ^1.0.0-beta.6-4414a19 (specific beta)
716
-
717
- ### Pri implementácii nových features:
718
-
719
- 1. **Config types najprv:**
720
- - Rozšír types v `packages/admin/src/config/index.ts`
721
- - Type-safety je priorita
722
-
723
- 2. **Component implementation:**
724
- - Vytvor komponent v `packages/admin/src/components/`
725
- - Export v `packages/admin/src/components/index.ts`
726
-
727
- 3. **Integration:**
728
- - Integruj do AutoFormFields/AdminRouter
729
- - Nepoužívaj auto-detection; typy sú explicitné v configu
730
-
731
- 4. **Documentation:**
732
- - Update `README.md` s examples
733
- - Update `VALIDATION.md` status
734
- - Vytvor spec v `specifications/` ak je complex
735
-
736
- 5. **Example:**
737
- - Pridaj example do `examples/tanstack-barbershop/src/configs/admin.ts`
738
-
739
- ### Coding Guidelines:
740
-
741
- **DO:**
742
- - ✅ Import všetko z admin package: `import { Button } from "@questpie/admin/components"`
743
- - ✅ Config-driven approach - všetko z configu
744
- - ✅ Type-safe - plné TypeScript types
745
- - ✅ Auto-generation z configu - čo najviac automatic
746
- - ✅ Override support - všetko customizovateľné
747
- - ✅ Use tabs (NOT spaces)
748
- - ✅ Use double quotes
749
- - ✅ Check `DEPENDENCIES.md` before adding deps
750
-
751
- **DON'T:**
752
- - ❌ Neduplikuj UI komponenty v examples
753
- - ❌ Nevytváraj manual route files
754
- - ❌ Nepíš switch statements pre collections
755
- - ❌ Nepoužívaj zod v3 (len v4!)
756
- - ❌ Nepoužívaj stable drizzle (len beta!)
757
-
758
- ### Testing:
759
-
760
- 1. **Manual testing:**
761
- ```bash
762
- cd examples/tanstack-barbershop
763
- bun install
764
- bun run dev
765
- ```
766
-
767
- 2. **Type checking:**
768
- ```bash
769
- cd packages/admin
770
- bun run check-types
771
- ```
772
-
773
- 3. **Build:**
774
- ```bash
775
- cd packages/admin
776
- bun run build
777
- ```
778
-
779
- ### Pri problémoch:
780
-
781
- 1. Check `packages/admin/VALIDATION.md` - možno už je to known issue
782
- 2. Check `DEPENDENCIES.md` - správne verzie?
783
- 3. Check `examples/tanstack-barbershop/` - funguje example?
784
- 4. Check `CLAUDE.md` - project-specific instructions
785
-
786
- ---
787
-
788
- ## 💡 EXAMPLE USAGE
789
-
790
- ### Minimálne Setup
791
-
792
- ```tsx
793
- // 1. Define CMS
794
- import { defineCMS, defineCollection } from "@questpie/cms/server";
795
-
796
- const posts = defineCollection("posts")
797
- .fields({
798
- title: varchar("title", { length: 255 }),
799
- content: text("content")
800
- });
801
-
802
- export const cms = defineCMS({ collections: [posts] });
803
-
804
- // 2. Create client
805
- import { createClient } from "@questpie/cms/client";
806
- export const cmsClient = createClient<typeof cms>({ baseURL: "/api/cms" });
807
-
808
- // 3. Mount admin
809
- import { AdminApp } from "@questpie/admin";
810
-
811
- <AdminApp client={cmsClient} router={{...}} />
812
- // Done! Auto-generated sidebar, routes, forms, everything!
813
- ```
814
-
815
- ### Custom Config
816
-
817
- ```tsx
818
- import { defineAdminConfig } from "@questpie/admin/config";
819
-
820
- export const adminConfig = defineAdminConfig<typeof cms>()({
821
- app: {
822
- brand: { name: "My Admin" }
823
- },
824
- collections: {
825
- posts: {
826
- label: "Blog Posts",
827
- icon: "file-text",
828
-
829
- list: {
830
- defaultColumns: ["title", "author", "createdAt"],
831
- defaultSort: { field: "createdAt", direction: "desc" }
832
- },
833
-
834
- edit: {
835
- sections: [
836
- {
837
- title: "Content",
838
- layout: "columns",
839
- columns: 2,
840
- fields: ["title", "slug", "content"]
841
- }
842
- ]
843
- },
844
-
845
- fields: {
846
- authorId: {
847
- label: "Author",
848
- relation: {
849
- targetCollection: "users",
850
- }
851
- },
852
- status: {
853
- type: "select",
854
- options: [
855
- { label: "Draft", value: "draft" },
856
- { label: "Published", value: "published" }
857
- ]
858
- },
859
- publishedAt: {
860
- visible: (values) => values.status === "published",
861
- required: (values) => values.status === "published"
862
- }
863
- }
864
- }
865
- }
866
- });
867
-
868
- <AdminApp client={cmsClient} config={adminConfig} router={{...}} />
869
- ```
870
-
871
- ---
872
-
873
- ## 🎓 LEARNING PATH
874
-
875
- Pre nových AI/developers:
876
-
877
- 1. **Začni s README** (`packages/admin/README.md`)
878
- - Quick start
879
- - Feature overview
880
- - Basic examples
881
-
882
- 2. **Pozri example** (`examples/tanstack-barbershop/`)
883
- - Spusti: `bun run dev`
884
- - Preskúmaj: `src/configs/admin.ts`
885
- - Pochop: Ako to funguje
886
-
887
- 3. **Študuj architektúru** (`examples/tanstack-barbershop/ARCHITECTURE.md`)
888
- - Čo NETREBA robiť
889
- - Čo TREBA robiť
890
- - Best practices
891
-
892
- 4. **Pozri status** (tento súbor)
893
- - Čo funguje
894
- - Čo treba implementovať
895
- - Priorities
896
-
897
- 5. **Prečítaj specs**
898
- - `specifications/RICH_TEXT_AND_BLOCKS.md`
899
- - `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md`
900
- - `specifications/ADMIN_PACKAGE_DESIGN.md`
901
-
902
- 6. **Check validation** (`packages/admin/VALIDATION.md`)
903
- - Detailed status každého feature
904
- - Evidence pre implementáciu
905
- - Next steps
906
-
907
- ---
908
-
909
- ## 📞 KONTAKT & FEEDBACK
910
-
911
- GitHub: https://github.com/anthropics/claude-code/issues (pre Claude Code feedback)
912
-
913
- ---
914
-
915
- **Posledná update:** 2025-12-31
916
- **Next milestone:** Block Editor (Puck)
917
- **Status:** Production-ready pre basic/intermediate use cases ✅