@questpie/admin 0.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.
- package/.turbo/turbo-build.log +108 -0
- package/CHANGELOG.md +10 -0
- package/README.md +556 -0
- package/STATUS.md +917 -0
- package/VALIDATION.md +602 -0
- package/components.json +24 -0
- package/dist/__tests__/setup.mjs +38 -0
- package/dist/__tests__/test-utils.mjs +45 -0
- package/dist/__tests__/vitest.d.mjs +3 -0
- package/dist/components/admin-app.mjs +69 -0
- package/dist/components/fields/array-field.mjs +190 -0
- package/dist/components/fields/checkbox-field.mjs +34 -0
- package/dist/components/fields/custom-field.mjs +32 -0
- package/dist/components/fields/date-field.mjs +41 -0
- package/dist/components/fields/datetime-field.mjs +42 -0
- package/dist/components/fields/email-field.mjs +37 -0
- package/dist/components/fields/embedded-collection.mjs +253 -0
- package/dist/components/fields/field-types.mjs +1 -0
- package/dist/components/fields/field-utils.mjs +10 -0
- package/dist/components/fields/field-wrapper.mjs +34 -0
- package/dist/components/fields/index.mjs +23 -0
- package/dist/components/fields/json-field.mjs +243 -0
- package/dist/components/fields/locale-badge.mjs +16 -0
- package/dist/components/fields/number-field.mjs +39 -0
- package/dist/components/fields/password-field.mjs +37 -0
- package/dist/components/fields/relation-field.mjs +104 -0
- package/dist/components/fields/relation-picker.mjs +229 -0
- package/dist/components/fields/relation-select.mjs +188 -0
- package/dist/components/fields/rich-text-editor/index.mjs +897 -0
- package/dist/components/fields/select-field.mjs +41 -0
- package/dist/components/fields/switch-field.mjs +34 -0
- package/dist/components/fields/text-field.mjs +38 -0
- package/dist/components/fields/textarea-field.mjs +38 -0
- package/dist/components/index.mjs +59 -0
- package/dist/components/primitives/checkbox-input.mjs +127 -0
- package/dist/components/primitives/date-input.mjs +303 -0
- package/dist/components/primitives/index.mjs +12 -0
- package/dist/components/primitives/number-input.mjs +104 -0
- package/dist/components/primitives/select-input.mjs +177 -0
- package/dist/components/primitives/tag-input.mjs +135 -0
- package/dist/components/primitives/text-input.mjs +39 -0
- package/dist/components/primitives/textarea-input.mjs +37 -0
- package/dist/components/primitives/toggle-input.mjs +31 -0
- package/dist/components/primitives/types.mjs +12 -0
- package/dist/components/ui/accordion.mjs +55 -0
- package/dist/components/ui/avatar.mjs +54 -0
- package/dist/components/ui/badge.mjs +34 -0
- package/dist/components/ui/button.mjs +48 -0
- package/dist/components/ui/card.mjs +58 -0
- package/dist/components/ui/checkbox.mjs +21 -0
- package/dist/components/ui/combobox.mjs +163 -0
- package/dist/components/ui/dialog.mjs +95 -0
- package/dist/components/ui/dropdown-menu.mjs +138 -0
- package/dist/components/ui/field.mjs +113 -0
- package/dist/components/ui/input-group.mjs +82 -0
- package/dist/components/ui/input.mjs +17 -0
- package/dist/components/ui/label.mjs +15 -0
- package/dist/components/ui/popover.mjs +56 -0
- package/dist/components/ui/scroll-area.mjs +38 -0
- package/dist/components/ui/select.mjs +100 -0
- package/dist/components/ui/separator.mjs +16 -0
- package/dist/components/ui/sheet.mjs +90 -0
- package/dist/components/ui/sidebar.mjs +387 -0
- package/dist/components/ui/skeleton.mjs +14 -0
- package/dist/components/ui/spinner.mjs +16 -0
- package/dist/components/ui/switch.mjs +22 -0
- package/dist/components/ui/table.mjs +68 -0
- package/dist/components/ui/tabs.mjs +48 -0
- package/dist/components/ui/textarea.mjs +15 -0
- package/dist/components/ui/tooltip.mjs +44 -0
- package/dist/config/component-registry.mjs +38 -0
- package/dist/config/index.mjs +129 -0
- package/dist/hooks/admin-provider.mjs +70 -0
- package/dist/hooks/index.mjs +7 -0
- package/dist/hooks/store.mjs +178 -0
- package/dist/hooks/use-auth.mjs +76 -0
- package/dist/hooks/use-collection-db.mjs +146 -0
- package/dist/hooks/use-collection.mjs +112 -0
- package/dist/hooks/use-global.mjs +46 -0
- package/dist/hooks/use-mobile.mjs +20 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/styles/index.css +336 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/utils/index.mjs +9 -0
- package/dist/views/auth/auth-layout.mjs +52 -0
- package/dist/views/auth/forgot-password-form.mjs +148 -0
- package/dist/views/auth/index.mjs +6 -0
- package/dist/views/auth/login-form.mjs +156 -0
- package/dist/views/auth/reset-password-form.mjs +184 -0
- package/dist/views/collection/auto-form-fields.mjs +525 -0
- package/dist/views/collection/collection-form.mjs +91 -0
- package/dist/views/collection/collection-list.mjs +76 -0
- package/dist/views/collection/form-field.mjs +42 -0
- package/dist/views/collection/index.mjs +6 -0
- package/dist/views/common/index.mjs +4 -0
- package/dist/views/common/locale-switcher.mjs +39 -0
- package/dist/views/common/version-history.mjs +272 -0
- package/dist/views/index.mjs +9 -0
- package/dist/views/layout/admin-layout.mjs +40 -0
- package/dist/views/layout/admin-router.mjs +95 -0
- package/dist/views/layout/admin-sidebar.mjs +63 -0
- package/dist/views/layout/index.mjs +5 -0
- package/package.json +276 -0
- package/src/__tests__/setup.ts +44 -0
- package/src/__tests__/test-utils.tsx +49 -0
- package/src/__tests__/vitest.d.ts +9 -0
- package/src/components/admin-app.tsx +221 -0
- package/src/components/fields/array-field.tsx +237 -0
- package/src/components/fields/checkbox-field.tsx +47 -0
- package/src/components/fields/custom-field.tsx +50 -0
- package/src/components/fields/date-field.tsx +65 -0
- package/src/components/fields/datetime-field.tsx +67 -0
- package/src/components/fields/email-field.tsx +51 -0
- package/src/components/fields/embedded-collection.tsx +315 -0
- package/src/components/fields/field-types.ts +162 -0
- package/src/components/fields/field-utils.ts +6 -0
- package/src/components/fields/field-wrapper.tsx +52 -0
- package/src/components/fields/index.ts +66 -0
- package/src/components/fields/json-field.tsx +440 -0
- package/src/components/fields/locale-badge.tsx +15 -0
- package/src/components/fields/number-field.tsx +57 -0
- package/src/components/fields/password-field.tsx +51 -0
- package/src/components/fields/relation-field.tsx +243 -0
- package/src/components/fields/relation-picker.tsx +402 -0
- package/src/components/fields/relation-select.tsx +327 -0
- package/src/components/fields/rich-text-editor/index.tsx +1337 -0
- package/src/components/fields/select-field.tsx +61 -0
- package/src/components/fields/switch-field.tsx +47 -0
- package/src/components/fields/text-field.tsx +55 -0
- package/src/components/fields/textarea-field.tsx +55 -0
- package/src/components/index.ts +40 -0
- package/src/components/primitives/checkbox-input.tsx +193 -0
- package/src/components/primitives/date-input.tsx +401 -0
- package/src/components/primitives/index.ts +24 -0
- package/src/components/primitives/number-input.tsx +132 -0
- package/src/components/primitives/select-input.tsx +296 -0
- package/src/components/primitives/tag-input.tsx +200 -0
- package/src/components/primitives/text-input.tsx +49 -0
- package/src/components/primitives/textarea-input.tsx +46 -0
- package/src/components/primitives/toggle-input.tsx +36 -0
- package/src/components/primitives/types.ts +235 -0
- package/src/components/ui/accordion.tsx +72 -0
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +48 -0
- package/src/components/ui/button.tsx +53 -0
- package/src/components/ui/card.tsx +94 -0
- package/src/components/ui/checkbox.tsx +27 -0
- package/src/components/ui/combobox.tsx +290 -0
- package/src/components/ui/dialog.tsx +151 -0
- package/src/components/ui/dropdown-menu.tsx +254 -0
- package/src/components/ui/field.tsx +227 -0
- package/src/components/ui/input-group.tsx +149 -0
- package/src/components/ui/input.tsx +20 -0
- package/src/components/ui/label.tsx +18 -0
- package/src/components/ui/popover.tsx +88 -0
- package/src/components/ui/scroll-area.tsx +53 -0
- package/src/components/ui/select.tsx +192 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +127 -0
- package/src/components/ui/sidebar.tsx +723 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/spinner.tsx +10 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +99 -0
- package/src/components/ui/tabs.tsx +82 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +70 -0
- package/src/config/component-registry.ts +190 -0
- package/src/config/index.ts +1099 -0
- package/src/hooks/README.md +269 -0
- package/src/hooks/admin-provider.tsx +110 -0
- package/src/hooks/index.ts +41 -0
- package/src/hooks/store.ts +248 -0
- package/src/hooks/use-auth.ts +168 -0
- package/src/hooks/use-collection-db.ts +209 -0
- package/src/hooks/use-collection.ts +156 -0
- package/src/hooks/use-global.ts +69 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/index.css +340 -0
- package/src/utils/index.ts +6 -0
- package/src/views/auth/auth-layout.tsx +77 -0
- package/src/views/auth/forgot-password-form.tsx +192 -0
- package/src/views/auth/index.ts +21 -0
- package/src/views/auth/login-form.tsx +229 -0
- package/src/views/auth/reset-password-form.tsx +232 -0
- package/src/views/collection/auto-form-fields.tsx +982 -0
- package/src/views/collection/collection-form.tsx +186 -0
- package/src/views/collection/collection-list.tsx +223 -0
- package/src/views/collection/form-field.tsx +52 -0
- package/src/views/collection/index.ts +15 -0
- package/src/views/common/index.ts +8 -0
- package/src/views/common/locale-switcher.tsx +45 -0
- package/src/views/common/version-history.tsx +406 -0
- package/src/views/index.ts +25 -0
- package/src/views/layout/admin-layout.tsx +117 -0
- package/src/views/layout/admin-router.tsx +206 -0
- package/src/views/layout/admin-sidebar.tsx +185 -0
- package/src/views/layout/index.ts +12 -0
- package/tsconfig.json +13 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.ts +13 -0
- package/vitest.config.ts +29 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsdown[0m
|
|
3
|
+
[34mℹ[39m tsdown [2mv0.18.4[22m powered by rolldown [2mv1.0.0-beta.57[22m
|
|
4
|
+
[34mℹ[39m config file: [4m/Users/drepkovsky/questpie/repos/questpie-cms/packages/admin/tsdown.config.ts[24m
|
|
5
|
+
(node:61237) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
|
|
6
|
+
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
7
|
+
[34mℹ[39m entry: [34msrc/__tests__/setup.ts, src/__tests__/test-utils.tsx, src/__tests__/vitest.d.ts, src/components/admin-app.tsx, src/components/index.ts, src/config/component-registry.ts, src/config/index.ts, src/hooks/admin-provider.tsx, src/hooks/index.ts, src/hooks/store.ts, src/hooks/use-auth.ts, src/hooks/use-collection-db.ts, src/hooks/use-collection.ts, src/hooks/use-global.ts, src/hooks/use-mobile.ts, src/lib/utils.ts, src/styles/index.css, src/utils/index.ts, src/views/index.ts, src/components/primitives/checkbox-input.tsx, src/components/primitives/date-input.tsx, src/components/primitives/index.ts, src/components/primitives/number-input.tsx, src/components/primitives/select-input.tsx, src/components/primitives/tag-input.tsx, src/components/primitives/text-input.tsx, src/components/primitives/textarea-input.tsx, src/components/primitives/toggle-input.tsx, src/components/primitives/types.ts, src/components/fields/array-field.tsx, src/components/fields/checkbox-field.tsx, src/components/fields/custom-field.tsx, src/components/fields/date-field.tsx, src/components/fields/datetime-field.tsx, src/components/fields/email-field.tsx, src/components/fields/embedded-collection.tsx, src/components/fields/field-types.ts, src/components/fields/field-utils.ts, src/components/fields/field-wrapper.tsx, src/components/fields/index.ts, src/components/fields/json-field.tsx, src/components/fields/locale-badge.tsx, src/components/fields/number-field.tsx, src/components/fields/password-field.tsx, src/components/fields/relation-field.tsx, src/components/fields/relation-picker.tsx, src/components/fields/relation-select.tsx, src/components/fields/select-field.tsx, src/components/fields/switch-field.tsx, src/components/fields/text-field.tsx, src/components/fields/textarea-field.tsx, src/views/collection/auto-form-fields.tsx, src/views/collection/collection-form.tsx, src/views/collection/collection-list.tsx, src/views/collection/form-field.tsx, src/views/collection/index.ts, src/views/auth/auth-layout.tsx, src/views/auth/forgot-password-form.tsx, src/views/auth/index.ts, src/views/auth/login-form.tsx, src/views/auth/reset-password-form.tsx, src/views/common/index.ts, src/views/common/locale-switcher.tsx, src/views/common/version-history.tsx, src/components/ui/accordion.tsx, src/components/ui/avatar.tsx, src/components/ui/badge.tsx, src/components/ui/button.tsx, src/components/ui/card.tsx, src/components/ui/checkbox.tsx, src/components/ui/combobox.tsx, src/components/ui/dialog.tsx, src/components/ui/dropdown-menu.tsx, src/components/ui/field.tsx, src/components/ui/input-group.tsx, src/components/ui/input.tsx, src/components/ui/label.tsx, src/components/ui/popover.tsx, src/components/ui/scroll-area.tsx, src/components/ui/select.tsx, src/components/ui/separator.tsx, src/components/ui/sheet.tsx, src/components/ui/sidebar.tsx, src/components/ui/skeleton.tsx, src/components/ui/spinner.tsx, src/components/ui/switch.tsx, src/components/ui/table.tsx, src/components/ui/tabs.tsx, src/components/ui/textarea.tsx, src/components/ui/tooltip.tsx, src/views/layout/admin-layout.tsx, src/views/layout/admin-router.tsx, src/views/layout/admin-sidebar.tsx, src/views/layout/index.ts, src/components/fields/rich-text-editor/index.tsx[39m
|
|
8
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
+
[34mℹ[39m Build start
|
|
10
|
+
[34mℹ[39m Cleaning 112 files
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/rich-text-editor/index.mjs[22m [2m32.38 kB[22m [2m│ gzip: 6.23 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mviews/collection/auto-form-fields.mjs[22m [2m18.78 kB[22m [2m│ gzip: 4.56 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/sidebar.mjs[22m [2m17.89 kB[22m [2m│ gzip: 4.09 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/date-input.mjs[22m [2m11.73 kB[22m [2m│ gzip: 2.15 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mviews/common/version-history.mjs[22m [2m10.21 kB[22m [2m│ gzip: 2.58 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/embedded-collection.mjs[22m [2m 9.04 kB[22m [2m│ gzip: 2.29 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/relation-picker.mjs[22m [2m 8.36 kB[22m [2m│ gzip: 2.41 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/combobox.mjs[22m [2m 7.92 kB[22m [2m│ gzip: 2.10 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/dropdown-menu.mjs[22m [2m 7.41 kB[22m [2m│ gzip: 1.52 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/json-field.mjs[22m [2m 7.19 kB[22m [2m│ gzip: 2.27 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/relation-select.mjs[22m [2m 6.70 kB[22m [2m│ gzip: 1.98 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/array-field.mjs[22m [2m 6.24 kB[22m [2m│ gzip: 1.86 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/select-input.mjs[22m [2m 6.22 kB[22m [2m│ gzip: 1.99 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[1mviews/auth/reset-password-form.mjs[22m [2m 6.08 kB[22m [2m│ gzip: 1.85 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/select.mjs[22m [2m 5.58 kB[22m [2m│ gzip: 1.61 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[1mviews/auth/login-form.mjs[22m [2m 5.19 kB[22m [2m│ gzip: 1.65 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/field.mjs[22m [2m 5.17 kB[22m [2m│ gzip: 1.49 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22m[1mviews/auth/forgot-password-form.mjs[22m [2m 4.78 kB[22m [2m│ gzip: 1.66 kB[22m
|
|
29
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/tag-input.mjs[22m [2m 4.71 kB[22m [2m│ gzip: 1.76 kB[22m
|
|
30
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/input-group.mjs[22m [2m 4.59 kB[22m [2m│ gzip: 1.40 kB[22m
|
|
31
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/store.mjs[22m [2m 4.45 kB[22m [2m│ gzip: 1.40 kB[22m
|
|
32
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/sheet.mjs[22m [2m 3.98 kB[22m [2m│ gzip: 1.08 kB[22m
|
|
33
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/checkbox-input.mjs[22m [2m 3.80 kB[22m [2m│ gzip: 1.10 kB[22m
|
|
34
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/use-collection-db.mjs[22m [2m 3.80 kB[22m [2m│ gzip: 1.15 kB[22m
|
|
35
|
+
[34mℹ[39m [2mdist/[22m[1mviews/collection/collection-list.mjs[22m [2m 3.60 kB[22m [2m│ gzip: 1.33 kB[22m
|
|
36
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/dialog.mjs[22m [2m 3.50 kB[22m [2m│ gzip: 1.02 kB[22m
|
|
37
|
+
[34mℹ[39m [2mdist/[22m[1mviews/layout/admin-router.mjs[22m [2m 3.42 kB[22m [2m│ gzip: 1.16 kB[22m
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/tabs.mjs[22m [2m 3.22 kB[22m [2m│ gzip: 1.05 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/use-collection.mjs[22m [2m 2.98 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[1mviews/collection/collection-form.mjs[22m [2m 2.94 kB[22m [2m│ gzip: 1.19 kB[22m
|
|
41
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/button.mjs[22m [2m 2.90 kB[22m [2m│ gzip: 0.98 kB[22m
|
|
42
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/relation-field.mjs[22m [2m 2.75 kB[22m [2m│ gzip: 0.98 kB[22m
|
|
43
|
+
[34mℹ[39m [2mdist/[22m[1mconfig/index.mjs[22m [2m 2.75 kB[22m [2m│ gzip: 0.89 kB[22m
|
|
44
|
+
[34mℹ[39m [2mdist/[22m[1mviews/layout/admin-sidebar.mjs[22m [2m 2.73 kB[22m [2m│ gzip: 1.00 kB[22m
|
|
45
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/avatar.mjs[22m [2m 2.68 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
46
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/number-input.mjs[22m [2m 2.64 kB[22m [2m│ gzip: 0.98 kB[22m
|
|
47
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/accordion.mjs[22m [2m 2.44 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
48
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/use-auth.mjs[22m [2m 2.34 kB[22m [2m│ gzip: 0.94 kB[22m
|
|
49
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/card.mjs[22m [2m 2.26 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
50
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/admin-provider.mjs[22m [2m 2.16 kB[22m [2m│ gzip: 0.84 kB[22m
|
|
51
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/tooltip.mjs[22m [2m 2.16 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
52
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/admin-app.mjs[22m [2m 2.15 kB[22m [2m│ gzip: 0.93 kB[22m
|
|
53
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/popover.mjs[22m [2m 2.10 kB[22m [2m│ gzip: 0.71 kB[22m
|
|
54
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/table.mjs[22m [2m 2.09 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
55
|
+
[34mℹ[39m [2mdist/[22m[1mviews/collection/form-field.mjs[22m [2m 1.93 kB[22m [2m│ gzip: 0.52 kB[22m
|
|
56
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/badge.mjs[22m [2m 1.77 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
57
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/switch.mjs[22m [2m 1.70 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
58
|
+
[34mℹ[39m [2mdist/[22m[1mviews/auth/auth-layout.mjs[22m [2m 1.60 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
59
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/scroll-area.mjs[22m [2m 1.52 kB[22m [2m│ gzip: 0.60 kB[22m
|
|
60
|
+
[34mℹ[39m [2mdist/[22m[1mviews/layout/admin-layout.mjs[22m [2m 1.38 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
61
|
+
[34mℹ[39m [2mdist/[22m[1mviews/common/locale-switcher.mjs[22m [2m 1.37 kB[22m [2m│ gzip: 0.62 kB[22m
|
|
62
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/checkbox.mjs[22m [2m 1.36 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
63
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/index.mjs[22m [2m 1.33 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
64
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/field-wrapper.mjs[22m [2m 1.24 kB[22m [2m│ gzip: 0.53 kB[22m
|
|
65
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/datetime-field.mjs[22m [2m 1.21 kB[22m [2m│ gzip: 0.55 kB[22m
|
|
66
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/use-global.mjs[22m [2m 1.18 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
67
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/date-field.mjs[22m [2m 1.16 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
68
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/select-field.mjs[22m [2m 1.16 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
69
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/textarea-field.mjs[22m [2m 1.05 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
70
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/number-field.mjs[22m [2m 1.04 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
71
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/text-field.mjs[22m [2m 1.04 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
72
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/password-field.mjs[22m [2m 1.03 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
73
|
+
[34mℹ[39m [2mdist/[22m[1m__tests__/test-utils.mjs[22m [2m 1.02 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
74
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/input.mjs[22m [2m 1.01 kB[22m [2m│ gzip: 0.52 kB[22m
|
|
75
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/email-field.mjs[22m [2m 1.00 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
76
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/checkbox-field.mjs[22m [2m 0.95 kB[22m [2m│ gzip: 0.45 kB[22m
|
|
77
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/switch-field.mjs[22m [2m 0.93 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
78
|
+
[34mℹ[39m [2mdist/[22m[1m__tests__/setup.mjs[22m [2m 0.90 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
79
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/index.mjs[22m [2m 0.89 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
80
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/text-input.mjs[22m [2m 0.89 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
81
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/textarea.mjs[22m [2m 0.84 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
82
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/custom-field.mjs[22m [2m 0.83 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
83
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/index.mjs[22m [2m 0.83 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
84
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/textarea-input.mjs[22m [2m 0.81 kB[22m [2m│ gzip: 0.45 kB[22m
|
|
85
|
+
[34mℹ[39m [2mdist/[22m[1mconfig/component-registry.mjs[22m [2m 0.78 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
86
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/toggle-input.mjs[22m [2m 0.64 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
87
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/index.mjs[22m [2m 0.61 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
88
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/separator.mjs[22m [2m 0.60 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
89
|
+
[34mℹ[39m [2mdist/[22m[1mhooks/use-mobile.mjs[22m [2m 0.60 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
90
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/label.mjs[22m [2m 0.54 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
91
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/spinner.mjs[22m [2m 0.41 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
92
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/locale-badge.mjs[22m [2m 0.38 kB[22m [2m│ gzip: 0.27 kB[22m
|
|
93
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/ui/skeleton.mjs[22m [2m 0.35 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
94
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/primitives/types.mjs[22m [2m 0.34 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
95
|
+
[34mℹ[39m [2mdist/[22m[1mviews/auth/index.mjs[22m [2m 0.28 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
96
|
+
[34mℹ[39m [2mdist/[22m[1mviews/collection/index.mjs[22m [2m 0.27 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
97
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/field-utils.mjs[22m [2m 0.25 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
98
|
+
[34mℹ[39m [2mdist/[22m[1mviews/layout/index.mjs[22m [2m 0.19 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
99
|
+
[34mℹ[39m [2mdist/[22m[1mlib/utils.mjs[22m [2m 0.18 kB[22m [2m│ gzip: 0.15 kB[22m
|
|
100
|
+
[34mℹ[39m [2mdist/[22m[1mviews/common/index.mjs[22m [2m 0.15 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
101
|
+
[34mℹ[39m [2mdist/[22m[1mutils/index.mjs[22m [2m 0.14 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
102
|
+
[34mℹ[39m [2mdist/[22m[1mviews/index.mjs[22m [2m 0.12 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
103
|
+
[34mℹ[39m [2mdist/[22m[1m__tests__/vitest.d.mjs[22m [2m 0.03 kB[22m [2m│ gzip: 0.05 kB[22m
|
|
104
|
+
[34mℹ[39m [2mdist/[22m[1mcomponents/fields/field-types.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
105
|
+
[34mℹ[39m [2mdist/[22m[1mstyles/index.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
106
|
+
[34mℹ[39m [2mdist/[22mstyles/index.css [2m 8.31 kB[22m [2m│ gzip: 1.92 kB[22m
|
|
107
|
+
[34mℹ[39m 96 files, total: 306.19 kB
|
|
108
|
+
[32m✔[39m Build complete in [32m128ms[39m
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
# @questpie/admin
|
|
2
|
+
|
|
3
|
+
**Config-driven, batteries-included admin UI for QUESTPIE CMS**
|
|
4
|
+
|
|
5
|
+
A fully-featured admin interface that auto-generates from your CMS schema with extensive customization options.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Zero Config** - Works out of the box with just a CMS client
|
|
10
|
+
- **Config-Driven** - Customize everything via `defineAdminConfig`
|
|
11
|
+
- **Type-Safe** - Full TypeScript inference from your CMS schema
|
|
12
|
+
- **Tailwind v4** - Built with Tailwind CSS v4 + shadcn/ui components
|
|
13
|
+
- **Rich Text** - Tiptap editor with slash commands, tables, images
|
|
14
|
+
- **Relations** - Inline, picker, and create modes for related content
|
|
15
|
+
- **Layouts** - Sections, tabs, columns, grids, sidebars
|
|
16
|
+
- **Realtime** - SSE-powered live updates
|
|
17
|
+
- **Versioning** - Built-in version history and audit logging
|
|
18
|
+
- **i18n Ready** - Localization support for content
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bun add @questpie/admin @questpie/cms @questpie/tanstack-query
|
|
24
|
+
bun add @tanstack/react-query @tanstack/react-table
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### Minimal Setup (One Component!)
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { AdminApp } from "@questpie/admin";
|
|
33
|
+
import { cmsClient } from "./lib/cms-client";
|
|
34
|
+
import {
|
|
35
|
+
Link,
|
|
36
|
+
useLocation,
|
|
37
|
+
useNavigate,
|
|
38
|
+
useParams,
|
|
39
|
+
} from "@tanstack/react-router";
|
|
40
|
+
|
|
41
|
+
function App() {
|
|
42
|
+
const location = useLocation();
|
|
43
|
+
const navigate = useNavigate();
|
|
44
|
+
const params = useParams();
|
|
45
|
+
const segments = params._.split("/").filter(Boolean);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<AdminApp
|
|
49
|
+
client={cmsClient} // That's it! Everything else is auto-generated
|
|
50
|
+
router={{
|
|
51
|
+
LinkComponent: Link,
|
|
52
|
+
currentPath: location.pathname,
|
|
53
|
+
segments,
|
|
54
|
+
navigate,
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### With Custom Config
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import { AdminApp } from '@questpie/admin'
|
|
65
|
+
import { cmsClient } from './lib/cms-client'
|
|
66
|
+
import { adminConfig } from './configs/admin'
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
return (
|
|
70
|
+
<AdminApp
|
|
71
|
+
client={cmsClient}
|
|
72
|
+
config={adminConfig} // Optional customization
|
|
73
|
+
router={{ ... }}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🎨 Configuration
|
|
80
|
+
|
|
81
|
+
Most UI is auto-generated from CMS collections. Field types and relation targets must be explicit in admin config.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { defineAdminConfig } from "@questpie/admin/config";
|
|
85
|
+
import type { AppCMS } from "./server/cms";
|
|
86
|
+
|
|
87
|
+
export const adminConfig = defineAdminConfig<AppCMS>()({
|
|
88
|
+
app: {
|
|
89
|
+
brand: { name: "My Admin" },
|
|
90
|
+
},
|
|
91
|
+
collections: {
|
|
92
|
+
posts: {
|
|
93
|
+
label: "Blog Posts", // Override label
|
|
94
|
+
|
|
95
|
+
// List view
|
|
96
|
+
list: {
|
|
97
|
+
defaultColumns: ["title", "author", "publishedAt"],
|
|
98
|
+
defaultSort: { field: "publishedAt", direction: "desc" },
|
|
99
|
+
with: ["author"], // Auto-load relations
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
// Edit form
|
|
103
|
+
edit: {
|
|
104
|
+
// Optional: explicit order (recommended)
|
|
105
|
+
fields: ["title", "content", "status", "publishedAt"],
|
|
106
|
+
|
|
107
|
+
// Organize into sections
|
|
108
|
+
sections: [
|
|
109
|
+
{
|
|
110
|
+
title: "Content",
|
|
111
|
+
fields: ["title", "content"],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: "Publishing",
|
|
115
|
+
fields: ["status", "publishedAt"],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// Field-level overrides
|
|
121
|
+
fields: {
|
|
122
|
+
title: {
|
|
123
|
+
label: "Post Title",
|
|
124
|
+
required: true,
|
|
125
|
+
},
|
|
126
|
+
content: {
|
|
127
|
+
type: "richText", // Custom field type
|
|
128
|
+
placeholder: "Write your post...",
|
|
129
|
+
},
|
|
130
|
+
status: {
|
|
131
|
+
type: "select",
|
|
132
|
+
options: [
|
|
133
|
+
{ label: "Draft", value: "draft" },
|
|
134
|
+
{ label: "Published", value: "published" },
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
publishedAt: {
|
|
138
|
+
label: "Publish Date",
|
|
139
|
+
type: "datetime",
|
|
140
|
+
// Conditional: readonly unless draft
|
|
141
|
+
readOnly: (values) => values.status !== "draft",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## ✨ What's Automatic
|
|
150
|
+
|
|
151
|
+
### From CMS Schema
|
|
152
|
+
|
|
153
|
+
- 🚫 Schema introspection (field types, required, defaults, relations) - not planned (explicit config)
|
|
154
|
+
|
|
155
|
+
### From Admin Config
|
|
156
|
+
|
|
157
|
+
- ✅ **Sidebar navigation** - auto-generated from collections
|
|
158
|
+
- ✅ **Routing** - `/admin/:collection/:id` patterns
|
|
159
|
+
- ✅ **List views** - columns, sorting, filtering
|
|
160
|
+
- ✅ **Form views** - create/edit with validation
|
|
161
|
+
- ✅ **Realtime sync** - SSE enabled by default
|
|
162
|
+
- ✅ **Relations loading** - auto-load with `with` config
|
|
163
|
+
|
|
164
|
+
## 🎯 Features
|
|
165
|
+
|
|
166
|
+
### Conditional Fields
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
fields: {
|
|
170
|
+
status: {
|
|
171
|
+
type: "select",
|
|
172
|
+
options: [...]
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
// Show only when status is "cancelled"
|
|
176
|
+
cancellationReason: {
|
|
177
|
+
type: "textarea",
|
|
178
|
+
visible: (values) => values.status === "cancelled",
|
|
179
|
+
required: (values) => values.status === "cancelled"
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
// Readonly unless draft
|
|
183
|
+
publishedAt: {
|
|
184
|
+
readOnly: (values) => values.status !== "draft"
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
// Dynamic options based on other fields
|
|
188
|
+
category: {
|
|
189
|
+
type: "select",
|
|
190
|
+
options: (values) => {
|
|
191
|
+
if (values.type === "tech") {
|
|
192
|
+
return [{ label: "Frontend", value: "frontend" }, ...]
|
|
193
|
+
}
|
|
194
|
+
return [{ label: "Design", value: "design" }, ...]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Sections & Organization
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
edit: {
|
|
204
|
+
sections: [
|
|
205
|
+
{
|
|
206
|
+
title: "Basic Info",
|
|
207
|
+
description: "Main appointment details",
|
|
208
|
+
fields: ["customer", "barber", "service", "scheduledAt"],
|
|
209
|
+
collapsible: true,
|
|
210
|
+
defaultOpen: true,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
title: "Status",
|
|
214
|
+
fields: ["status", "notes"],
|
|
215
|
+
},
|
|
216
|
+
];
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Advanced Layouts
|
|
221
|
+
|
|
222
|
+
Columns, grids, and inline layouts are supported:
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
edit: {
|
|
226
|
+
sections: [
|
|
227
|
+
{
|
|
228
|
+
title: "Basic",
|
|
229
|
+
layout: "columns",
|
|
230
|
+
columns: 2,
|
|
231
|
+
fields: ["title", "slug", "author", "category"],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
title: "Pricing",
|
|
235
|
+
layout: "grid",
|
|
236
|
+
grid: { columns: 4, gap: 4 },
|
|
237
|
+
fields: [
|
|
238
|
+
{ field: "price", span: 1 },
|
|
239
|
+
{ field: "currency", span: 1 },
|
|
240
|
+
{ field: "stock", span: 2 },
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
title: "Dates",
|
|
245
|
+
layout: "inline",
|
|
246
|
+
fields: ["startDate", "endDate"],
|
|
247
|
+
},
|
|
248
|
+
];
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Sidebar layouts:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
edit: {
|
|
256
|
+
layout: "with-sidebar",
|
|
257
|
+
sections: [
|
|
258
|
+
{ title: "Content", fields: ["title", "content"] }
|
|
259
|
+
],
|
|
260
|
+
sidebar: {
|
|
261
|
+
position: "right",
|
|
262
|
+
width: "320px",
|
|
263
|
+
fields: ["status", "publishedAt"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Tabs
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
edit: {
|
|
272
|
+
tabs: [
|
|
273
|
+
{
|
|
274
|
+
id: "content",
|
|
275
|
+
label: "Content",
|
|
276
|
+
fields: ["title", "content"],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: "meta",
|
|
280
|
+
label: "Metadata",
|
|
281
|
+
fields: ["seo", "tags", "category"],
|
|
282
|
+
},
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Localization (i18n)
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
app: {
|
|
291
|
+
locales: {
|
|
292
|
+
default: "en",
|
|
293
|
+
available: ["en", "sk", "de"]
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
collections: {
|
|
297
|
+
posts: {
|
|
298
|
+
fields: {
|
|
299
|
+
title: { type: "text", localized: true },
|
|
300
|
+
content: { type: "richText", localized: true }
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Relation Fields
|
|
307
|
+
|
|
308
|
+
Automatic relation field support with create/edit capabilities:
|
|
309
|
+
|
|
310
|
+
Display label uses the target record’s `_title`.
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
fields: {
|
|
314
|
+
// Single relation (one-to-one) - explicit config
|
|
315
|
+
barberId: {
|
|
316
|
+
label: "Barber",
|
|
317
|
+
relation: {
|
|
318
|
+
targetCollection: "barbers", // Required target collection
|
|
319
|
+
mode: "inline" // or "picker" or "create"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
// Multiple relations (one-to-many, many-to-many)
|
|
324
|
+
tags: {
|
|
325
|
+
relation: {
|
|
326
|
+
targetCollection: "tags",
|
|
327
|
+
mode: "picker", // Enables multi-select
|
|
328
|
+
orderable: true, // Enable drag-and-drop reordering
|
|
329
|
+
|
|
330
|
+
// Filter options based on current form values
|
|
331
|
+
filter: (values) => ({
|
|
332
|
+
where: { type: { eq: values.postType } }
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Features:**
|
|
340
|
+
|
|
341
|
+
- ✅ **Plus button** - Create new related item (opens side sheet)
|
|
342
|
+
- ✅ **Edit button** - Modify selected item (opens side sheet)
|
|
343
|
+
- ✅ **Auto-complete** - Search and filter options
|
|
344
|
+
- ✅ **Drag-and-drop** - Reorder multiple relations (when `orderable: true`)
|
|
345
|
+
- ✅ **Conditional filtering** - Filter options based on form state
|
|
346
|
+
|
|
347
|
+
### Rich Text Editor (Tiptap)
|
|
348
|
+
|
|
349
|
+
Built-in rich text editing with toolbar controls:
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
fields: {
|
|
353
|
+
content: {
|
|
354
|
+
type: "richText",
|
|
355
|
+
placeholder: "Start writing...",
|
|
356
|
+
richText: {
|
|
357
|
+
outputFormat: "html", // "json" (default) or "markdown"
|
|
358
|
+
enableImages: true,
|
|
359
|
+
showCharacterCount: true,
|
|
360
|
+
maxCharacters: 10000,
|
|
361
|
+
features: {
|
|
362
|
+
slashCommands: true,
|
|
363
|
+
tableControls: true,
|
|
364
|
+
bubbleMenu: true
|
|
365
|
+
},
|
|
366
|
+
onImageUpload: async (file) => {
|
|
367
|
+
// Return a public URL after upload
|
|
368
|
+
return await uploadImage(file)
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Note: Markdown output requires a Markdown extension in the `extensions` array.
|
|
376
|
+
Slash commands, table tools, and the bubble menu can be toggled via `features`.
|
|
377
|
+
|
|
378
|
+
### Embedded Collections
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
fields: {
|
|
382
|
+
gallery: {
|
|
383
|
+
embedded: {
|
|
384
|
+
collection: "post_images",
|
|
385
|
+
orderable: true, // Drag-and-drop reordering
|
|
386
|
+
mode: "inline", // or "modal" or "drawer"
|
|
387
|
+
rowLabel: (item) => item.caption || item.id
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Array Fields
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
fields: {
|
|
397
|
+
tags: {
|
|
398
|
+
type: "array",
|
|
399
|
+
label: "Tags",
|
|
400
|
+
array: {
|
|
401
|
+
itemType: "text",
|
|
402
|
+
orderable: true,
|
|
403
|
+
maxItems: 10
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
ratings: {
|
|
408
|
+
type: "array",
|
|
409
|
+
label: "Ratings",
|
|
410
|
+
array: {
|
|
411
|
+
itemType: "number",
|
|
412
|
+
minItems: 1
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Version History & Audit Logging
|
|
419
|
+
|
|
420
|
+
Track all changes to collection items with built-in versioning:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
collections: {
|
|
424
|
+
posts: {
|
|
425
|
+
// Enable versioning for this collection
|
|
426
|
+
versioned: true,
|
|
427
|
+
|
|
428
|
+
// Configure audit logging
|
|
429
|
+
auditLog: {
|
|
430
|
+
fields: ["title", "content", "status"], // Fields to track
|
|
431
|
+
trackUser: true, // Track who made changes
|
|
432
|
+
retentionDays: 365 // Keep logs for 1 year
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
edit: {
|
|
436
|
+
// Show version history in edit form
|
|
437
|
+
showVersionHistory: true
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Features:**
|
|
444
|
+
|
|
445
|
+
- ✅ **Version tracking** - Every change creates a new version
|
|
446
|
+
- ✅ **Change history** - See what changed, when, and by whom
|
|
447
|
+
- ✅ **Diff view** - Compare old vs new values
|
|
448
|
+
- ✅ **Restore versions** - Roll back to previous versions
|
|
449
|
+
- ✅ **User tracking** - Know who made each change
|
|
450
|
+
- ✅ **Configurable retention** - Control how long to keep history
|
|
451
|
+
|
|
452
|
+
### Tree Views (Coming Soon)
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
list: {
|
|
456
|
+
view: "tree", // Enable tree view
|
|
457
|
+
tree: {
|
|
458
|
+
parentField: "parentId",
|
|
459
|
+
labelField: "name",
|
|
460
|
+
collapsible: true
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## 🧩 Component Registry
|
|
466
|
+
|
|
467
|
+
Override default field components:
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
import { RichTextEditor } from './components/RichTextEditor'
|
|
471
|
+
import { ImagePicker } from './components/ImagePicker'
|
|
472
|
+
|
|
473
|
+
<AdminApp
|
|
474
|
+
client={cmsClient}
|
|
475
|
+
config={adminConfig}
|
|
476
|
+
registry={{
|
|
477
|
+
fields: {
|
|
478
|
+
richText: RichTextEditor,
|
|
479
|
+
image: ImagePicker
|
|
480
|
+
}
|
|
481
|
+
}}
|
|
482
|
+
router={{ ... }}
|
|
483
|
+
/>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
## 📦 Package Exports
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
// Main component
|
|
490
|
+
import { AdminApp } from "@questpie/admin";
|
|
491
|
+
|
|
492
|
+
// Config helper
|
|
493
|
+
import { defineAdminConfig } from "@questpie/admin/config";
|
|
494
|
+
|
|
495
|
+
// Hooks
|
|
496
|
+
import { AdminProvider, useCollection } from "@questpie/admin/hooks";
|
|
497
|
+
|
|
498
|
+
// Components
|
|
499
|
+
import {
|
|
500
|
+
CollectionList,
|
|
501
|
+
CollectionForm,
|
|
502
|
+
RelationSelect,
|
|
503
|
+
RelationPicker,
|
|
504
|
+
VersionHistory,
|
|
505
|
+
} from "@questpie/admin/components";
|
|
506
|
+
|
|
507
|
+
// Utilities
|
|
508
|
+
import { cn } from "@questpie/admin/utils";
|
|
509
|
+
|
|
510
|
+
// Styles
|
|
511
|
+
import "@questpie/admin/styles";
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
## 🎨 Styling
|
|
515
|
+
|
|
516
|
+
Complete shadcn/ui setup with Tailwind CSS v4:
|
|
517
|
+
|
|
518
|
+
- 53+ pre-built components (base-lyra style)
|
|
519
|
+
- Light/dark theme support
|
|
520
|
+
- oklch color space
|
|
521
|
+
- Customizable via Tailwind tokens
|
|
522
|
+
|
|
523
|
+
## 📚 Examples
|
|
524
|
+
|
|
525
|
+
See [tanstack-barbershop](../../examples/tanstack-barbershop) for complete example.
|
|
526
|
+
|
|
527
|
+
## 🚀 Roadmap
|
|
528
|
+
|
|
529
|
+
- [ ] Schema introspection (auto field type inference) - not planned
|
|
530
|
+
- [x] Conditional visibility/readonly/disabled
|
|
531
|
+
- [x] Sections organization
|
|
532
|
+
- [x] Advanced layouts (columns, grid, inline, sidebar)
|
|
533
|
+
- [x] Component registry
|
|
534
|
+
- [x] Relation fields (RelationSelect, RelationPicker)
|
|
535
|
+
- [x] Version history & audit logging
|
|
536
|
+
- [x] Embedded collections (inline, modal, drawer)
|
|
537
|
+
- [x] Array fields
|
|
538
|
+
- [x] Tabs layout
|
|
539
|
+
- [ ] Tree views (hierarchical data)
|
|
540
|
+
- [ ] Bulk actions
|
|
541
|
+
- [ ] Saved views/filters
|
|
542
|
+
- [ ] Custom dashboard
|
|
543
|
+
- [ ] Permissions UI
|
|
544
|
+
|
|
545
|
+
## Related Packages
|
|
546
|
+
|
|
547
|
+
- [`@questpie/cms`](../cms) - Core CMS engine
|
|
548
|
+
- [`@questpie/tanstack-query`](../tanstack-query) - TanStack Query integration
|
|
549
|
+
- [`@questpie/hono`](../hono) - Hono adapter
|
|
550
|
+
- [`@questpie/elysia`](../elysia) - Elysia adapter
|
|
551
|
+
- [`@questpie/next`](../next) - Next.js adapter
|
|
552
|
+
- [`@questpie/tanstack-start`](../tanstack-start) - TanStack Start adapter
|
|
553
|
+
|
|
554
|
+
## License
|
|
555
|
+
|
|
556
|
+
MIT
|