@questpie/admin 0.0.1 → 1.0.0
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/README.md +439 -424
- package/dist/auth-layout-M8K8_q5R.mjs +181 -0
- package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
- package/dist/bulk-upload-dialog-h7zXD78Y.mjs +274 -0
- package/dist/bulk-upload-dialog-h7zXD78Y.mjs.map +1 -0
- package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
- package/dist/card-BKHjBQfw.mjs.map +1 -0
- package/dist/client/styles/index.css +434 -0
- package/dist/client-BCGpkAz6.mjs +22635 -0
- package/dist/client-BCGpkAz6.mjs.map +1 -0
- package/dist/client-CcWZbkBP.d.mts +13585 -0
- package/dist/client-CcWZbkBP.d.mts.map +1 -0
- package/dist/client.d.mts +3 -0
- package/dist/client.mjs +14 -0
- package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
- package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
- package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
- package/dist/dashboard-page-CVlyR40m.mjs +6 -0
- package/dist/dropzone-Do3awXKd.mjs +634 -0
- package/dist/dropzone-Do3awXKd.mjs.map +1 -0
- package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
- package/dist/forgot-password-page-CIILVhfo.mjs +7 -0
- package/dist/index-B9Xwk4hi.d.mts +2753 -0
- package/dist/index-B9Xwk4hi.d.mts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +14 -0
- package/dist/login-page-8K7fo0qK.mjs +7 -0
- package/dist/login-page-CP4gA-dl.mjs +298 -0
- package/dist/login-page-CP4gA-dl.mjs.map +1 -0
- package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
- package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
- package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
- package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
- package/dist/reset-password-page-DLATv0xQ.mjs +7 -0
- package/dist/runtime-6VZM878K.mjs +69 -0
- package/dist/runtime-6VZM878K.mjs.map +1 -0
- package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
- package/dist/server.d.mts +250 -0
- package/dist/server.d.mts.map +1 -0
- package/dist/server.mjs +832 -0
- package/dist/server.mjs.map +1 -0
- package/dist/setup-page-CMZ5P_OE.mjs +6 -0
- package/dist/setup-page-YAP_fzqh.mjs +264 -0
- package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
- package/dist/shared.d.mts +57 -0
- package/dist/shared.d.mts.map +1 -0
- package/dist/shared.mjs +3 -0
- package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
- package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
- package/package.json +48 -197
- package/.turbo/turbo-build.log +0 -108
- package/CHANGELOG.md +0 -10
- package/STATUS.md +0 -917
- package/VALIDATION.md +0 -602
- package/components.json +0 -24
- package/dist/__tests__/setup.mjs +0 -38
- package/dist/__tests__/test-utils.mjs +0 -45
- package/dist/__tests__/vitest.d.mjs +0 -3
- package/dist/components/admin-app.mjs +0 -69
- package/dist/components/fields/array-field.mjs +0 -190
- package/dist/components/fields/checkbox-field.mjs +0 -34
- package/dist/components/fields/custom-field.mjs +0 -32
- package/dist/components/fields/date-field.mjs +0 -41
- package/dist/components/fields/datetime-field.mjs +0 -42
- package/dist/components/fields/email-field.mjs +0 -37
- package/dist/components/fields/embedded-collection.mjs +0 -253
- package/dist/components/fields/field-types.mjs +0 -1
- package/dist/components/fields/field-utils.mjs +0 -10
- package/dist/components/fields/field-wrapper.mjs +0 -34
- package/dist/components/fields/index.mjs +0 -23
- package/dist/components/fields/json-field.mjs +0 -243
- package/dist/components/fields/locale-badge.mjs +0 -16
- package/dist/components/fields/number-field.mjs +0 -39
- package/dist/components/fields/password-field.mjs +0 -37
- package/dist/components/fields/relation-field.mjs +0 -104
- package/dist/components/fields/relation-picker.mjs +0 -229
- package/dist/components/fields/relation-select.mjs +0 -188
- package/dist/components/fields/rich-text-editor/index.mjs +0 -897
- package/dist/components/fields/select-field.mjs +0 -41
- package/dist/components/fields/switch-field.mjs +0 -34
- package/dist/components/fields/text-field.mjs +0 -38
- package/dist/components/fields/textarea-field.mjs +0 -38
- package/dist/components/index.mjs +0 -59
- package/dist/components/primitives/checkbox-input.mjs +0 -127
- package/dist/components/primitives/date-input.mjs +0 -303
- package/dist/components/primitives/index.mjs +0 -12
- package/dist/components/primitives/number-input.mjs +0 -104
- package/dist/components/primitives/select-input.mjs +0 -177
- package/dist/components/primitives/tag-input.mjs +0 -135
- package/dist/components/primitives/text-input.mjs +0 -39
- package/dist/components/primitives/textarea-input.mjs +0 -37
- package/dist/components/primitives/toggle-input.mjs +0 -31
- package/dist/components/primitives/types.mjs +0 -12
- package/dist/components/ui/accordion.mjs +0 -55
- package/dist/components/ui/avatar.mjs +0 -54
- package/dist/components/ui/badge.mjs +0 -34
- package/dist/components/ui/button.mjs +0 -48
- package/dist/components/ui/checkbox.mjs +0 -21
- package/dist/components/ui/combobox.mjs +0 -163
- package/dist/components/ui/dialog.mjs +0 -95
- package/dist/components/ui/dropdown-menu.mjs +0 -138
- package/dist/components/ui/field.mjs +0 -113
- package/dist/components/ui/input-group.mjs +0 -82
- package/dist/components/ui/input.mjs +0 -17
- package/dist/components/ui/label.mjs +0 -15
- package/dist/components/ui/popover.mjs +0 -56
- package/dist/components/ui/scroll-area.mjs +0 -38
- package/dist/components/ui/select.mjs +0 -100
- package/dist/components/ui/separator.mjs +0 -16
- package/dist/components/ui/sheet.mjs +0 -90
- package/dist/components/ui/sidebar.mjs +0 -387
- package/dist/components/ui/skeleton.mjs +0 -14
- package/dist/components/ui/spinner.mjs +0 -16
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/table.mjs +0 -68
- package/dist/components/ui/tabs.mjs +0 -48
- package/dist/components/ui/textarea.mjs +0 -15
- package/dist/components/ui/tooltip.mjs +0 -44
- package/dist/config/component-registry.mjs +0 -38
- package/dist/config/index.mjs +0 -129
- package/dist/hooks/admin-provider.mjs +0 -70
- package/dist/hooks/index.mjs +0 -7
- package/dist/hooks/store.mjs +0 -178
- package/dist/hooks/use-collection-db.mjs +0 -146
- package/dist/hooks/use-collection.mjs +0 -112
- package/dist/hooks/use-global.mjs +0 -46
- package/dist/hooks/use-mobile.mjs +0 -20
- package/dist/lib/utils.mjs +0 -10
- package/dist/styles/index.css +0 -336
- package/dist/styles/index.mjs +0 -1
- package/dist/utils/index.mjs +0 -9
- package/dist/views/auth/auth-layout.mjs +0 -52
- package/dist/views/auth/index.mjs +0 -6
- package/dist/views/auth/login-form.mjs +0 -156
- package/dist/views/collection/auto-form-fields.mjs +0 -525
- package/dist/views/collection/collection-form.mjs +0 -91
- package/dist/views/collection/collection-list.mjs +0 -76
- package/dist/views/collection/form-field.mjs +0 -42
- package/dist/views/collection/index.mjs +0 -6
- package/dist/views/common/index.mjs +0 -4
- package/dist/views/common/locale-switcher.mjs +0 -39
- package/dist/views/common/version-history.mjs +0 -272
- package/dist/views/index.mjs +0 -9
- package/dist/views/layout/admin-layout.mjs +0 -40
- package/dist/views/layout/admin-router.mjs +0 -95
- package/dist/views/layout/admin-sidebar.mjs +0 -63
- package/dist/views/layout/index.mjs +0 -5
- package/src/__tests__/setup.ts +0 -44
- package/src/__tests__/test-utils.tsx +0 -49
- package/src/__tests__/vitest.d.ts +0 -9
- package/src/components/admin-app.tsx +0 -221
- package/src/components/fields/array-field.tsx +0 -237
- package/src/components/fields/checkbox-field.tsx +0 -47
- package/src/components/fields/custom-field.tsx +0 -50
- package/src/components/fields/date-field.tsx +0 -65
- package/src/components/fields/datetime-field.tsx +0 -67
- package/src/components/fields/email-field.tsx +0 -51
- package/src/components/fields/embedded-collection.tsx +0 -315
- package/src/components/fields/field-types.ts +0 -162
- package/src/components/fields/field-utils.ts +0 -6
- package/src/components/fields/field-wrapper.tsx +0 -52
- package/src/components/fields/index.ts +0 -66
- package/src/components/fields/json-field.tsx +0 -440
- package/src/components/fields/locale-badge.tsx +0 -15
- package/src/components/fields/number-field.tsx +0 -57
- package/src/components/fields/password-field.tsx +0 -51
- package/src/components/fields/relation-field.tsx +0 -243
- package/src/components/fields/relation-picker.tsx +0 -402
- package/src/components/fields/relation-select.tsx +0 -327
- package/src/components/fields/rich-text-editor/index.tsx +0 -1337
- package/src/components/fields/select-field.tsx +0 -61
- package/src/components/fields/switch-field.tsx +0 -47
- package/src/components/fields/text-field.tsx +0 -55
- package/src/components/fields/textarea-field.tsx +0 -55
- package/src/components/index.ts +0 -40
- package/src/components/primitives/checkbox-input.tsx +0 -193
- package/src/components/primitives/date-input.tsx +0 -401
- package/src/components/primitives/index.ts +0 -24
- package/src/components/primitives/number-input.tsx +0 -132
- package/src/components/primitives/select-input.tsx +0 -296
- package/src/components/primitives/tag-input.tsx +0 -200
- package/src/components/primitives/text-input.tsx +0 -49
- package/src/components/primitives/textarea-input.tsx +0 -46
- package/src/components/primitives/toggle-input.tsx +0 -36
- package/src/components/primitives/types.ts +0 -235
- package/src/components/ui/accordion.tsx +0 -72
- package/src/components/ui/avatar.tsx +0 -106
- package/src/components/ui/badge.tsx +0 -48
- package/src/components/ui/button.tsx +0 -53
- package/src/components/ui/card.tsx +0 -94
- package/src/components/ui/checkbox.tsx +0 -27
- package/src/components/ui/combobox.tsx +0 -290
- package/src/components/ui/dialog.tsx +0 -151
- package/src/components/ui/dropdown-menu.tsx +0 -254
- package/src/components/ui/field.tsx +0 -227
- package/src/components/ui/input-group.tsx +0 -149
- package/src/components/ui/input.tsx +0 -20
- package/src/components/ui/label.tsx +0 -18
- package/src/components/ui/popover.tsx +0 -88
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/select.tsx +0 -192
- package/src/components/ui/separator.tsx +0 -23
- package/src/components/ui/sheet.tsx +0 -127
- package/src/components/ui/sidebar.tsx +0 -723
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/spinner.tsx +0 -10
- package/src/components/ui/switch.tsx +0 -32
- package/src/components/ui/table.tsx +0 -99
- package/src/components/ui/tabs.tsx +0 -82
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/tooltip.tsx +0 -70
- package/src/config/component-registry.ts +0 -190
- package/src/config/index.ts +0 -1099
- package/src/hooks/README.md +0 -269
- package/src/hooks/admin-provider.tsx +0 -110
- package/src/hooks/index.ts +0 -41
- package/src/hooks/store.ts +0 -248
- package/src/hooks/use-auth.ts +0 -168
- package/src/hooks/use-collection-db.ts +0 -209
- package/src/hooks/use-collection.ts +0 -156
- package/src/hooks/use-global.ts +0 -69
- package/src/hooks/use-mobile.ts +0 -21
- package/src/lib/utils.ts +0 -6
- package/src/styles/index.css +0 -340
- package/src/utils/index.ts +0 -6
- package/src/views/auth/auth-layout.tsx +0 -77
- package/src/views/auth/forgot-password-form.tsx +0 -192
- package/src/views/auth/index.ts +0 -21
- package/src/views/auth/login-form.tsx +0 -229
- package/src/views/auth/reset-password-form.tsx +0 -232
- package/src/views/collection/auto-form-fields.tsx +0 -982
- package/src/views/collection/collection-form.tsx +0 -186
- package/src/views/collection/collection-list.tsx +0 -223
- package/src/views/collection/form-field.tsx +0 -52
- package/src/views/collection/index.ts +0 -15
- package/src/views/common/index.ts +0 -8
- package/src/views/common/locale-switcher.tsx +0 -45
- package/src/views/common/version-history.tsx +0 -406
- package/src/views/index.ts +0 -25
- package/src/views/layout/admin-layout.tsx +0 -117
- package/src/views/layout/admin-router.tsx +0 -206
- package/src/views/layout/admin-sidebar.tsx +0 -185
- package/src/views/layout/index.ts +0 -12
- package/tsconfig.json +0 -13
- package/tsconfig.tsbuildinfo +0 -1
- package/tsdown.config.ts +0 -13
- package/vitest.config.ts +0 -29
package/VALIDATION.md
DELETED
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
# @questpie/admin - Requirements Validation
|
|
2
|
-
|
|
3
|
-
This document validates the implementation against all stated requirements.
|
|
4
|
-
|
|
5
|
-
## ✅ Core Requirements
|
|
6
|
-
|
|
7
|
-
### 1. Config-Driven Architecture
|
|
8
|
-
**Status: ✅ IMPLEMENTED**
|
|
9
|
-
|
|
10
|
-
- [x] Everything auto-generated from `defineAdminConfig()`
|
|
11
|
-
- [x] Single source of truth for all UI
|
|
12
|
-
- [x] No manual route files needed
|
|
13
|
-
- [x] Sidebar auto-generated from config.collections
|
|
14
|
-
- [x] Forms auto-generated from CMS schema + config overrides
|
|
15
|
-
- [x] List views auto-generated from config
|
|
16
|
-
|
|
17
|
-
**Evidence:**
|
|
18
|
-
- `packages/admin/src/config/index.ts` - Complete type system
|
|
19
|
-
- `packages/admin/src/components/views/admin-router.tsx` - Auto routing
|
|
20
|
-
- `packages/admin/src/components/views/admin-sidebar.tsx` - Auto sidebar
|
|
21
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` - Auto fields
|
|
22
|
-
|
|
23
|
-
### 2. Seamless DX - One Component Mount
|
|
24
|
-
**Status: ✅ IMPLEMENTED**
|
|
25
|
-
|
|
26
|
-
Minimal usage:
|
|
27
|
-
```tsx
|
|
28
|
-
<AdminApp client={cmsClient} router={{...}} />
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
With optional config:
|
|
32
|
-
```tsx
|
|
33
|
-
<AdminApp client={cmsClient} config={adminConfig} router={{...}} />
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Evidence:**
|
|
37
|
-
- `packages/admin/src/components/admin-app.tsx` - Main entry point
|
|
38
|
-
- `packages/admin/README.md` lines 14-31 - Quick start examples
|
|
39
|
-
|
|
40
|
-
### 3. Automatic Routing
|
|
41
|
-
**Status: ✅ IMPLEMENTED**
|
|
42
|
-
|
|
43
|
-
- [x] Single catch-all route at `/admin/$`
|
|
44
|
-
- [x] Auto-generates all collection routes
|
|
45
|
-
- [x] Patterns: `/admin`, `/admin/:collection`, `/admin/:collection/new`, `/admin/:collection/:id`
|
|
46
|
-
- [x] No manual route files per collection
|
|
47
|
-
|
|
48
|
-
**Evidence:**
|
|
49
|
-
- `examples/tanstack-barbershop/src/routes/admin/$.tsx` - Catch-all route
|
|
50
|
-
- `packages/admin/src/components/views/admin-router.tsx` - Routing logic
|
|
51
|
-
|
|
52
|
-
### 4. Conditional Field Logic
|
|
53
|
-
**Status: ✅ IMPLEMENTED**
|
|
54
|
-
|
|
55
|
-
Fields support conditional:
|
|
56
|
-
- [x] `visible: (values) => boolean` - Show/hide
|
|
57
|
-
- [x] `readOnly: (values) => boolean` - Make readonly
|
|
58
|
-
- [x] `disabled: (values) => boolean` - Disable
|
|
59
|
-
- [x] `required: (values) => boolean` - Dynamic required
|
|
60
|
-
- [x] `options: (values) => array` - Dynamic options
|
|
61
|
-
|
|
62
|
-
**Evidence:**
|
|
63
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` lines 237-263 - Conditional evaluation
|
|
64
|
-
- `examples/tanstack-barbershop/src/configs/admin.ts` lines 196-209 - Conditional fields example
|
|
65
|
-
|
|
66
|
-
**Example:**
|
|
67
|
-
```typescript
|
|
68
|
-
cancelledAt: {
|
|
69
|
-
visible: (values) => values.status === "cancelled",
|
|
70
|
-
readOnly: true
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 5. Relation Fields
|
|
75
|
-
**Status: ✅ IMPLEMENTED**
|
|
76
|
-
|
|
77
|
-
- [x] Single relations (one-to-one) - `RelationSelect`
|
|
78
|
-
- [x] Multiple relations (one-to-many, many-to-many) - `RelationPicker`
|
|
79
|
-
- [x] Plus button to create new related item
|
|
80
|
-
- [x] Edit button to modify selected/assigned item
|
|
81
|
-
- [x] Opens side sheet for create/edit
|
|
82
|
-
- [x] Auto-infers target collection from field name
|
|
83
|
-
- [x] Conditional filtering based on form values
|
|
84
|
-
- [x] Drag-and-drop reordering (for multiple relations)
|
|
85
|
-
|
|
86
|
-
**Evidence:**
|
|
87
|
-
- `packages/admin/src/components/fields/relation-select.tsx` - Single relation component
|
|
88
|
-
- `packages/admin/src/components/fields/relation-picker.tsx` - Multiple relation component
|
|
89
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` lines 284-368 - Auto-detection logic
|
|
90
|
-
- `packages/admin/README.md` lines 214-252 - Documentation
|
|
91
|
-
|
|
92
|
-
**Example:**
|
|
93
|
-
```typescript
|
|
94
|
-
barberId: {
|
|
95
|
-
label: "Barber",
|
|
96
|
-
relation: {
|
|
97
|
-
targetCollection: "barbers",
|
|
98
|
-
mode: "inline"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 6. Version History & Audit Logging
|
|
104
|
-
**Status: ✅ IMPLEMENTED**
|
|
105
|
-
|
|
106
|
-
- [x] Version tracking for collections
|
|
107
|
-
- [x] Audit log configuration
|
|
108
|
-
- [x] Show version history in edit form
|
|
109
|
-
- [x] Track who made changes
|
|
110
|
-
- [x] Show what changed (field diffs)
|
|
111
|
-
- [x] Restore previous versions
|
|
112
|
-
- [x] Configurable retention period
|
|
113
|
-
|
|
114
|
-
**Evidence:**
|
|
115
|
-
- `packages/admin/src/components/views/version-history.tsx` - Version history component
|
|
116
|
-
- `packages/admin/src/config/index.ts` lines 310-332 - Config types
|
|
117
|
-
- `examples/tanstack-barbershop/src/configs/admin.ts` lines 111-117 - Example usage
|
|
118
|
-
- `packages/admin/README.md` lines 268-299 - Documentation
|
|
119
|
-
|
|
120
|
-
**Example:**
|
|
121
|
-
```typescript
|
|
122
|
-
appointments: {
|
|
123
|
-
versioned: true,
|
|
124
|
-
auditLog: {
|
|
125
|
-
fields: ["status", "scheduledAt"],
|
|
126
|
-
trackUser: true,
|
|
127
|
-
retentionDays: 365
|
|
128
|
-
},
|
|
129
|
-
edit: {
|
|
130
|
-
showVersionHistory: true
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### 7. Sections & Organization
|
|
136
|
-
**Status: ✅ IMPLEMENTED**
|
|
137
|
-
|
|
138
|
-
- [x] Group fields into sections
|
|
139
|
-
- [x] Section titles and descriptions
|
|
140
|
-
- [x] Collapsible sections support
|
|
141
|
-
- [x] Default open/closed state
|
|
142
|
-
|
|
143
|
-
**Evidence:**
|
|
144
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` lines 420-454 - Section rendering
|
|
145
|
-
- `examples/tanstack-barbershop/src/configs/admin.ts` lines 134-148 - Sections example
|
|
146
|
-
- `packages/admin/README.md` lines 175-193 - Documentation
|
|
147
|
-
|
|
148
|
-
### 8. Schema Introspection
|
|
149
|
-
**Status: ✅ IMPLEMENTED**
|
|
150
|
-
|
|
151
|
-
- [x] Auto-detect field types from field names (heuristics)
|
|
152
|
-
- [x] Infer text, textarea, number, boolean, date, datetime, relation types
|
|
153
|
-
- [x] Auto-generate default field lists
|
|
154
|
-
|
|
155
|
-
**Evidence:**
|
|
156
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` lines 134-195 - Type inference
|
|
157
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` lines 201-219 - Default fields
|
|
158
|
-
|
|
159
|
-
**Note:** Full Drizzle schema introspection at runtime is marked as TODO (line 132).
|
|
160
|
-
|
|
161
|
-
### 9. Component Registry
|
|
162
|
-
**Status: ✅ IMPLEMENTED**
|
|
163
|
-
|
|
164
|
-
- [x] Type definitions for custom components
|
|
165
|
-
- [x] Field component registry
|
|
166
|
-
- [x] Layout component registry
|
|
167
|
-
- [x] Custom component support
|
|
168
|
-
|
|
169
|
-
**Evidence:**
|
|
170
|
-
- `packages/admin/src/config/component-registry.ts` - Full registry types
|
|
171
|
-
- `packages/admin/README.md` lines 314-333 - Usage documentation
|
|
172
|
-
|
|
173
|
-
### 10. TanStack Start Integration
|
|
174
|
-
**Status: ✅ IMPLEMENTED**
|
|
175
|
-
|
|
176
|
-
- [x] TanStack Router integration
|
|
177
|
-
- [x] TanStack Query integration
|
|
178
|
-
- [x] Router-agnostic design (accepts LinkComponent prop)
|
|
179
|
-
- [x] Full example application
|
|
180
|
-
|
|
181
|
-
**Evidence:**
|
|
182
|
-
- `examples/tanstack-barbershop/` - Complete working example
|
|
183
|
-
- `examples/tanstack-barbershop/src/routes/admin.tsx` - Layout integration
|
|
184
|
-
- `examples/tanstack-barbershop/src/routes/admin/$.tsx` - Router integration
|
|
185
|
-
|
|
186
|
-
### 11. Docker Setup
|
|
187
|
-
**Status: ✅ IMPLEMENTED**
|
|
188
|
-
|
|
189
|
-
- [x] Dockerfile with multi-stage build
|
|
190
|
-
- [x] docker-compose.yml with Postgres only
|
|
191
|
-
- [x] No Redis, no external queue services
|
|
192
|
-
- [x] Batteries-included philosophy
|
|
193
|
-
|
|
194
|
-
**Evidence:**
|
|
195
|
-
- `examples/tanstack-barbershop/Dockerfile` - Container setup
|
|
196
|
-
- `examples/tanstack-barbershop/docker-compose.yml` - Postgres only
|
|
197
|
-
- `examples/tanstack-barbershop/.env.example` - Environment template
|
|
198
|
-
|
|
199
|
-
### 12. Correct Dependency Versions
|
|
200
|
-
**Status: ✅ IMPLEMENTED**
|
|
201
|
-
|
|
202
|
-
- [x] zod: ^4.2.1 (NOT v3!)
|
|
203
|
-
- [x] drizzle-orm: ^1.0.0-beta.6-4414a19 (specific beta)
|
|
204
|
-
- [x] Documentation of critical versions
|
|
205
|
-
- [x] Validation commands in docs
|
|
206
|
-
|
|
207
|
-
**Evidence:**
|
|
208
|
-
- `DEPENDENCIES.md` - Complete version documentation
|
|
209
|
-
- `CLAUDE.md` - Prominent warning about checking versions
|
|
210
|
-
- `examples/tanstack-barbershop/package.json` - Correct versions used
|
|
211
|
-
|
|
212
|
-
## ⚠️ Partially Implemented
|
|
213
|
-
|
|
214
|
-
### 13. Embedded Collections
|
|
215
|
-
**Status: ✅ IMPLEMENTED**
|
|
216
|
-
|
|
217
|
-
- [x] EmbeddedCollectionField component
|
|
218
|
-
- [x] Inline editing mode
|
|
219
|
-
- [x] Modal/Drawer modes
|
|
220
|
-
- [x] Row labels + ordering
|
|
221
|
-
- [x] AutoFormFields integration
|
|
222
|
-
|
|
223
|
-
**Evidence:**
|
|
224
|
-
- `packages/admin/src/components/fields/embedded-collection.tsx` - EmbeddedCollectionField component
|
|
225
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` - Embedded integration + rendering
|
|
226
|
-
- `packages/admin/src/config/index.ts` - Config types + rowLabel
|
|
227
|
-
- `packages/admin/README.md` - Embedded docs updated
|
|
228
|
-
|
|
229
|
-
### 14. Array Fields
|
|
230
|
-
**Status: ✅ IMPLEMENTED**
|
|
231
|
-
|
|
232
|
-
- [x] ArrayField component for primitive arrays
|
|
233
|
-
- [x] Ordering, min/max item controls
|
|
234
|
-
- [x] Select/textarea/number item types
|
|
235
|
-
|
|
236
|
-
**Evidence:**
|
|
237
|
-
- `packages/admin/src/components/fields/array-field.tsx` - ArrayField component
|
|
238
|
-
- `packages/admin/src/components/views/auto-form-fields.tsx` - Array field integration
|
|
239
|
-
- `packages/admin/src/config/index.ts` - Array field config types
|
|
240
|
-
|
|
241
|
-
### 15. Advanced Form Layouts
|
|
242
|
-
**Status: ✅ IMPLEMENTED**
|
|
243
|
-
|
|
244
|
-
Comprehensive layout system with multiple modes:
|
|
245
|
-
- [x] Config types for multi-column layouts
|
|
246
|
-
- [x] Config types for grid layouts with spans
|
|
247
|
-
- [x] Config types for inline layouts
|
|
248
|
-
- [x] Config types for conditional sections
|
|
249
|
-
- [x] Config types for tabs with sections
|
|
250
|
-
- [x] Config types for sidebar layouts
|
|
251
|
-
- [x] Support for custom CSS classes
|
|
252
|
-
- [x] Responsive breakpoints
|
|
253
|
-
- [x] Rendering implementation in AutoFormFields
|
|
254
|
-
|
|
255
|
-
**Evidence:**
|
|
256
|
-
- `packages/admin/src/config/index.ts` lines 93-294 - Complete layout types
|
|
257
|
-
- `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md` - Full specification
|
|
258
|
-
|
|
259
|
-
**Features:**
|
|
260
|
-
```typescript
|
|
261
|
-
sections: [
|
|
262
|
-
{
|
|
263
|
-
layout: "columns",
|
|
264
|
-
columns: 2,
|
|
265
|
-
fields: ["firstName", "lastName"]
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
layout: "grid",
|
|
269
|
-
grid: { columns: 4, gap: 4 },
|
|
270
|
-
fields: [
|
|
271
|
-
{ field: "title", span: 4 },
|
|
272
|
-
{ field: "price", span: 1 }
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
visible: (values) => values.status === "cancelled",
|
|
277
|
-
fields: ["cancellationReason"]
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
**Next Steps:**
|
|
283
|
-
1. Add UI tests for complex layout scenarios (optional)
|
|
284
|
-
|
|
285
|
-
## ❌ Not Implemented Yet
|
|
286
|
-
|
|
287
|
-
### 15. Tree Views
|
|
288
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
289
|
-
|
|
290
|
-
Hierarchical data display for nested structures.
|
|
291
|
-
|
|
292
|
-
**Evidence:**
|
|
293
|
-
- `packages/admin/README.md` lines 301-312 - Marked "Coming Soon"
|
|
294
|
-
|
|
295
|
-
**Requirements:**
|
|
296
|
-
- [ ] Tree view mode for list
|
|
297
|
-
- [ ] Parent-child relationships
|
|
298
|
-
- [ ] Collapsible nodes
|
|
299
|
-
- [ ] Drag-and-drop reordering
|
|
300
|
-
|
|
301
|
-
### 16. Bulk Actions
|
|
302
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
303
|
-
|
|
304
|
-
Batch operations on multiple items.
|
|
305
|
-
|
|
306
|
-
**Requirements:**
|
|
307
|
-
- [ ] Select multiple items
|
|
308
|
-
- [ ] Bulk delete
|
|
309
|
-
- [ ] Bulk update
|
|
310
|
-
- [ ] Custom bulk actions
|
|
311
|
-
|
|
312
|
-
### 17. Saved Views/Filters
|
|
313
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
314
|
-
|
|
315
|
-
Persist user preferences for list views.
|
|
316
|
-
|
|
317
|
-
**Requirements:**
|
|
318
|
-
- [ ] Save filter combinations
|
|
319
|
-
- [ ] Save column configurations
|
|
320
|
-
- [ ] Share views with team
|
|
321
|
-
- [ ] Default views
|
|
322
|
-
|
|
323
|
-
### 18. Dashboard System
|
|
324
|
-
**Status: ✅ CONFIG TYPES IMPLEMENTED, WIDGETS TODO**
|
|
325
|
-
|
|
326
|
-
Comprehensive dashboard system with widget support:
|
|
327
|
-
- [x] Config types for dashboard
|
|
328
|
-
- [x] Widget system types (stats, chart, recent-items, quick-actions, custom)
|
|
329
|
-
- [x] Grid layout configuration
|
|
330
|
-
- [x] Custom dashboard component support (already works)
|
|
331
|
-
- [ ] Built-in widget components
|
|
332
|
-
- [ ] Widget renderer
|
|
333
|
-
- [ ] Default dashboard implementation
|
|
334
|
-
|
|
335
|
-
**Evidence:**
|
|
336
|
-
- `packages/admin/src/config/index.ts` lines 32-197 - Dashboard config types
|
|
337
|
-
- `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md` - Full specification
|
|
338
|
-
|
|
339
|
-
**Features:**
|
|
340
|
-
```typescript
|
|
341
|
-
app: {
|
|
342
|
-
dashboard: {
|
|
343
|
-
title: "Dashboard",
|
|
344
|
-
widgets: [
|
|
345
|
-
{
|
|
346
|
-
id: "total-posts",
|
|
347
|
-
type: "stats",
|
|
348
|
-
title: "Total Posts",
|
|
349
|
-
position: { x: 0, y: 0, w: 3, h: 2 },
|
|
350
|
-
config: { collection: "posts", stat: "count" }
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
id: "recent-posts",
|
|
354
|
-
type: "recent-items",
|
|
355
|
-
title: "Recent Posts",
|
|
356
|
-
position: { x: 0, y: 2, w: 6, h: 4 },
|
|
357
|
-
config: { collection: "posts", limit: 5 }
|
|
358
|
-
}
|
|
359
|
-
]
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
**Widget Types:**
|
|
365
|
-
- Stats - Single statistic with trend
|
|
366
|
-
- Chart - Line, bar, pie, area charts
|
|
367
|
-
- Recent Items - Latest collection items
|
|
368
|
-
- Quick Actions - Action buttons
|
|
369
|
-
- Custom - User-defined components
|
|
370
|
-
|
|
371
|
-
**Custom Dashboard (Already Works):**
|
|
372
|
-
```typescript
|
|
373
|
-
app: {
|
|
374
|
-
dashboard: {
|
|
375
|
-
component: CustomDashboard // Full control
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
**Next Steps:**
|
|
381
|
-
1. Create Dashboard component
|
|
382
|
-
2. Implement StatsWidget
|
|
383
|
-
3. Implement ChartWidget (using recharts)
|
|
384
|
-
4. Implement RecentItemsWidget
|
|
385
|
-
5. Implement QuickActionsWidget
|
|
386
|
-
6. Add widget grid layout renderer
|
|
387
|
-
|
|
388
|
-
### 19. Custom Pages
|
|
389
|
-
**Status: ✅ CONFIG TYPES IMPLEMENTED, ROUTING TODO**
|
|
390
|
-
|
|
391
|
-
System for adding custom pages to admin:
|
|
392
|
-
- [x] Config types for custom pages
|
|
393
|
-
- [x] Page registration in config
|
|
394
|
-
- [x] Navigation integration types
|
|
395
|
-
- [x] Permission support types
|
|
396
|
-
- [ ] Custom page routing implementation
|
|
397
|
-
- [ ] Sidebar navigation for custom pages
|
|
398
|
-
- [ ] Permission checking
|
|
399
|
-
|
|
400
|
-
**Evidence:**
|
|
401
|
-
- `packages/admin/src/config/index.ts` lines 117-165 - CustomPageConfig types
|
|
402
|
-
- `specifications/ADVANCED_LAYOUTS_AND_DASHBOARD.md` - Full specification
|
|
403
|
-
|
|
404
|
-
**Features:**
|
|
405
|
-
```typescript
|
|
406
|
-
app: {
|
|
407
|
-
pages: [
|
|
408
|
-
{
|
|
409
|
-
id: "settings",
|
|
410
|
-
label: "Settings",
|
|
411
|
-
icon: "settings",
|
|
412
|
-
path: "/admin/settings",
|
|
413
|
-
component: SettingsPage,
|
|
414
|
-
showInNav: true,
|
|
415
|
-
group: "system",
|
|
416
|
-
order: 100,
|
|
417
|
-
permissions: ["admin.settings.view"]
|
|
418
|
-
}
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
**Use Cases:**
|
|
424
|
-
- Settings pages
|
|
425
|
-
- Analytics/reporting pages
|
|
426
|
-
- User management
|
|
427
|
-
- Custom tools
|
|
428
|
-
- Import/export utilities
|
|
429
|
-
- System administration
|
|
430
|
-
|
|
431
|
-
**Next Steps:**
|
|
432
|
-
1. Update AdminRouter to handle custom pages
|
|
433
|
-
2. Add custom pages to sidebar navigation
|
|
434
|
-
3. Implement routing for custom page paths
|
|
435
|
-
4. Add permission checking
|
|
436
|
-
5. Support navigation groups and ordering
|
|
437
|
-
|
|
438
|
-
### 20. Permissions UI
|
|
439
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
440
|
-
|
|
441
|
-
Visual permission management.
|
|
442
|
-
|
|
443
|
-
**Requirements:**
|
|
444
|
-
- [ ] Role-based access control UI
|
|
445
|
-
- [ ] Permission matrix
|
|
446
|
-
- [ ] User assignment
|
|
447
|
-
- [ ] Collection-level permissions
|
|
448
|
-
|
|
449
|
-
### 20. Full Drizzle Schema Introspection
|
|
450
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
451
|
-
|
|
452
|
-
Currently using heuristics; need runtime schema parsing.
|
|
453
|
-
|
|
454
|
-
**Requirements:**
|
|
455
|
-
- [ ] Extract actual schema from Drizzle at runtime
|
|
456
|
-
- [ ] Parse column types, constraints, defaults
|
|
457
|
-
- [ ] Parse relations from Drizzle schema
|
|
458
|
-
- [ ] Eliminate hardcoded field lists
|
|
459
|
-
|
|
460
|
-
### 21. Rich Text Editor (Tiptap)
|
|
461
|
-
**Status: ✅ IMPLEMENTED**
|
|
462
|
-
|
|
463
|
-
**PRIORITY: HIGH** (marked as important by user)
|
|
464
|
-
|
|
465
|
-
Rich text editing capabilities using Tiptap.
|
|
466
|
-
|
|
467
|
-
**Requirements:**
|
|
468
|
-
- [x] Tiptap integration
|
|
469
|
-
- [x] Basic formatting (bold, italic, underline, headings)
|
|
470
|
-
- [x] Lists (ordered, unordered)
|
|
471
|
-
- [x] Links and images
|
|
472
|
-
- [x] Code blocks
|
|
473
|
-
- [x] Tables
|
|
474
|
-
- [x] Custom extensions support
|
|
475
|
-
- [x] Markdown shortcuts
|
|
476
|
-
- [ ] Collaborative editing (optional)
|
|
477
|
-
- [x] Field type: `richText`
|
|
478
|
-
|
|
479
|
-
**Implementation:**
|
|
480
|
-
- Create `RichTextEditor` component using Tiptap
|
|
481
|
-
- Register in component registry
|
|
482
|
-
- Support JSON/HTML output formats (Markdown when extension provided)
|
|
483
|
-
- Add to field type inference
|
|
484
|
-
|
|
485
|
-
**Dependencies:**
|
|
486
|
-
- `@tiptap/react`
|
|
487
|
-
- `@tiptap/starter-kit`
|
|
488
|
-
- `@tiptap/extension-*` (various extensions)
|
|
489
|
-
|
|
490
|
-
### 22. Block Editor (Puck)
|
|
491
|
-
**Status: ❌ NOT IMPLEMENTED**
|
|
492
|
-
|
|
493
|
-
**PRIORITY: HIGH** (marked as important by user)
|
|
494
|
-
|
|
495
|
-
Visual page builder using Puck Editor (https://puckeditor.com/)
|
|
496
|
-
|
|
497
|
-
**Requirements:**
|
|
498
|
-
- [ ] Puck Editor integration
|
|
499
|
-
- [ ] Block registry system
|
|
500
|
-
- [ ] Drag-and-drop block composition
|
|
501
|
-
- [ ] Custom block components
|
|
502
|
-
- [ ] Block configuration UI
|
|
503
|
-
- [ ] Preview mode
|
|
504
|
-
- [ ] Responsive design controls
|
|
505
|
-
- [ ] Save/load block compositions
|
|
506
|
-
- [ ] Field type: `blocks` or `pageBuilder`
|
|
507
|
-
|
|
508
|
-
**Use Cases:**
|
|
509
|
-
- Landing pages
|
|
510
|
-
- Marketing pages
|
|
511
|
-
- Content-rich pages
|
|
512
|
-
- Email templates
|
|
513
|
-
- Dynamic layouts
|
|
514
|
-
|
|
515
|
-
**Implementation:**
|
|
516
|
-
- Create `BlockEditor` component using Puck
|
|
517
|
-
- Define block component interface
|
|
518
|
-
- Register default blocks (text, image, button, hero, etc.)
|
|
519
|
-
- Allow custom block registration
|
|
520
|
-
- Store block data as JSON in database
|
|
521
|
-
|
|
522
|
-
**Dependencies:**
|
|
523
|
-
- `@measured/puck`
|
|
524
|
-
- React 19 compatible version
|
|
525
|
-
|
|
526
|
-
**Integration:**
|
|
527
|
-
```typescript
|
|
528
|
-
fields: {
|
|
529
|
-
content: {
|
|
530
|
-
type: "blocks",
|
|
531
|
-
blocks: {
|
|
532
|
-
// Register available blocks
|
|
533
|
-
text: TextBlock,
|
|
534
|
-
image: ImageBlock,
|
|
535
|
-
hero: HeroBlock,
|
|
536
|
-
// ... custom blocks
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
## 📊 Implementation Summary
|
|
543
|
-
|
|
544
|
-
**Total Requirements:** 23
|
|
545
|
-
|
|
546
|
-
**Status Breakdown:**
|
|
547
|
-
- ✅ **Fully Implemented:** 13 (57%)
|
|
548
|
-
- ⚠️ **Config Types Done, Rendering TODO:** 3 (13%)
|
|
549
|
-
- ❌ **Not Implemented:** 7 (30%)
|
|
550
|
-
|
|
551
|
-
**Core Functionality Score:** 13/14 (93%) - All critical features implemented
|
|
552
|
-
|
|
553
|
-
**Config Types Ready for Implementation:**
|
|
554
|
-
- Advanced Form Layouts (columns, grid, inline, conditional sections, tabs)
|
|
555
|
-
- Dashboard System (widgets, grid layout, custom components)
|
|
556
|
-
- Custom Pages (registration, navigation, permissions)
|
|
557
|
-
|
|
558
|
-
**Note:** The config type system is now very comprehensive! Many advanced features have their types defined and are ready for rendering implementation.
|
|
559
|
-
|
|
560
|
-
## 🎯 Priority Next Steps
|
|
561
|
-
|
|
562
|
-
### 🔴 High Priority (User Marked as Important)
|
|
563
|
-
1. **Rich Text Editor (Tiptap)** - Essential for content editing
|
|
564
|
-
2. **Block Editor (Puck)** - Visual page builder for marketing/content pages
|
|
565
|
-
3. **Embedded Collections** - Critical for many-to-many relations
|
|
566
|
-
|
|
567
|
-
### 🟡 Medium Priority
|
|
568
|
-
4. **Tabs Layout** - Important for complex forms
|
|
569
|
-
5. **Full Drizzle Schema Introspection** - Remove heuristics
|
|
570
|
-
6. **Tree Views** - For hierarchical data
|
|
571
|
-
7. **Bulk Actions** - Common admin need
|
|
572
|
-
|
|
573
|
-
### 🟢 Low Priority
|
|
574
|
-
8. **Saved Views** - UX improvement
|
|
575
|
-
9. **Custom Dashboard** - Nice to have
|
|
576
|
-
10. **Permissions UI** - Can use CMS access control directly
|
|
577
|
-
|
|
578
|
-
## ✅ Core Requirements Validation
|
|
579
|
-
|
|
580
|
-
All **critical** requirements for MVP are implemented:
|
|
581
|
-
|
|
582
|
-
1. ✅ Config-driven architecture
|
|
583
|
-
2. ✅ Seamless DX (one component mount)
|
|
584
|
-
3. ✅ Automatic routing
|
|
585
|
-
4. ✅ Auto-generated sidebar
|
|
586
|
-
5. ✅ Auto-generated forms
|
|
587
|
-
6. ✅ Conditional field logic
|
|
588
|
-
7. ✅ Relation fields with create/edit
|
|
589
|
-
8. ✅ Version history & audit logging
|
|
590
|
-
9. ✅ Sections organization
|
|
591
|
-
10. ✅ TanStack Start integration
|
|
592
|
-
11. ✅ Docker setup (Postgres only)
|
|
593
|
-
12. ✅ Correct dependency versions
|
|
594
|
-
|
|
595
|
-
**The package is production-ready for basic to intermediate admin use cases!** 🎉
|
|
596
|
-
|
|
597
|
-
## 📝 Notes
|
|
598
|
-
|
|
599
|
-
- Schema introspection currently uses heuristics (field name patterns)
|
|
600
|
-
- Embedded collections need integration with the relation system
|
|
601
|
-
- Form state management (useFormContext) needs proper integration
|
|
602
|
-
- Some features marked "Coming Soon" in README are partially implemented
|
package/components.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "base-mira",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "src/styles/index.css",
|
|
9
|
-
"baseColor": "neutral",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"iconLibrary": "phosphor",
|
|
14
|
-
"aliases": {
|
|
15
|
-
"components": "#questpie/admin/components",
|
|
16
|
-
"utils": "#questpie/admin/lib/utils",
|
|
17
|
-
"ui": "#questpie/admin/components/ui",
|
|
18
|
-
"lib": "#questpie/admin/lib",
|
|
19
|
-
"hooks": "#questpie/admin/hooks"
|
|
20
|
-
},
|
|
21
|
-
"menuColor": "default",
|
|
22
|
-
"menuAccent": "subtle",
|
|
23
|
-
"registries": {}
|
|
24
|
-
}
|
package/dist/__tests__/setup.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as matchers from "@testing-library/jest-dom/matchers";
|
|
2
|
-
import { cleanup } from "@testing-library/react";
|
|
3
|
-
import { afterEach, expect, vi } from "vitest";
|
|
4
|
-
|
|
5
|
-
//#region src/__tests__/setup.ts
|
|
6
|
-
/**
|
|
7
|
-
* Vitest setup file for @questpie/admin
|
|
8
|
-
*/
|
|
9
|
-
expect.extend(matchers);
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
cleanup();
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(window, "matchMedia", {
|
|
14
|
-
writable: true,
|
|
15
|
-
value: vi.fn().mockImplementation((query) => ({
|
|
16
|
-
matches: false,
|
|
17
|
-
media: query,
|
|
18
|
-
onchange: null,
|
|
19
|
-
addListener: vi.fn(),
|
|
20
|
-
removeListener: vi.fn(),
|
|
21
|
-
addEventListener: vi.fn(),
|
|
22
|
-
removeEventListener: vi.fn(),
|
|
23
|
-
dispatchEvent: vi.fn()
|
|
24
|
-
}))
|
|
25
|
-
});
|
|
26
|
-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
27
|
-
observe: vi.fn(),
|
|
28
|
-
unobserve: vi.fn(),
|
|
29
|
-
disconnect: vi.fn()
|
|
30
|
-
}));
|
|
31
|
-
global.IntersectionObserver = vi.fn().mockImplementation(() => ({
|
|
32
|
-
observe: vi.fn(),
|
|
33
|
-
unobserve: vi.fn(),
|
|
34
|
-
disconnect: vi.fn()
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
export { };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { render } from "@testing-library/react";
|
|
2
|
-
import * as React$1 from "react";
|
|
3
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
export * from "@testing-library/react"
|
|
7
|
-
|
|
8
|
-
//#region src/__tests__/test-utils.tsx
|
|
9
|
-
/**
|
|
10
|
-
* Test utilities for @questpie/admin components
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Create a fresh QueryClient for each test
|
|
14
|
-
*/
|
|
15
|
-
function createTestQueryClient() {
|
|
16
|
-
return new QueryClient({ defaultOptions: {
|
|
17
|
-
queries: {
|
|
18
|
-
retry: false,
|
|
19
|
-
gcTime: 0
|
|
20
|
-
},
|
|
21
|
-
mutations: { retry: false }
|
|
22
|
-
} });
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Test wrapper with all required providers
|
|
26
|
-
*/
|
|
27
|
-
function TestWrapper({ children }) {
|
|
28
|
-
const [queryClient] = React$1.useState(() => createTestQueryClient());
|
|
29
|
-
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
30
|
-
client: queryClient,
|
|
31
|
-
children
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Custom render function that wraps components with test providers
|
|
36
|
-
*/
|
|
37
|
-
function customRender(ui, options) {
|
|
38
|
-
return render(ui, {
|
|
39
|
-
wrapper: TestWrapper,
|
|
40
|
-
...options
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
export { customRender as render };
|