@tanstack/cta-ui 0.15.2 → 0.15.4
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/dist/assets/index-BLGJkAxX.css +1 -0
- package/dist/assets/index-DPjMQkKx.js +208 -0
- package/dist/assets/index-DPjMQkKx.js.map +1 -0
- package/dist/index.html +3 -2
- package/index.html +1 -0
- package/lib/engine-handling/create-app-wrapper.ts +3 -4
- package/lib/engine-handling/generate-initial-payload.ts +12 -20
- package/lib/engine-handling/server-environment.ts +2 -2
- package/lib/index.ts +33 -15
- package/lib-dist/engine-handling/create-app-wrapper.js +3 -2
- package/lib-dist/engine-handling/generate-initial-payload.d.ts +8 -6
- package/lib-dist/engine-handling/generate-initial-payload.js +9 -14
- package/lib-dist/engine-handling/server-environment.d.ts +3 -3
- package/lib-dist/index.d.ts +1 -0
- package/lib-dist/index.js +29 -11
- package/package.json +3 -32
- package/src/index.tsx +2 -42
- package/src/main.tsx +0 -1
- package/src/styles.css +2 -0
- package/src/types.d.ts +13 -8
- package/dist/assets/index-BktnQA5a.js +0 -213
- package/dist/assets/index-BktnQA5a.js.map +0 -1
- package/dist/assets/index-CpoUtYXp.css +0 -1
- package/dist/logo-color-100w.png +0 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/tailwind.svg +0 -1
- package/dist/tanstack.png +0 -0
- package/dist/typescript.svg +0 -1
- package/lib/engine-handling/framework-registration.ts +0 -11
- package/lib-dist/engine-handling/framework-registration.d.ts +0 -1
- package/lib-dist/engine-handling/framework-registration.js +0 -10
- package/public/logo-color-100w.png +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/tailwind.svg +0 -1
- package/public/tanstack.png +0 -0
- package/public/typescript.svg +0 -1
- package/src/components/StatusList.tsx +0 -22
- package/src/components/add-on-info-dialog.tsx +0 -39
- package/src/components/background-animation.tsx +0 -229
- package/src/components/cta-sidebar.tsx +0 -50
- package/src/components/custom-add-on-dialog.tsx +0 -79
- package/src/components/file-navigator.tsx +0 -203
- package/src/components/file-tree.tsx +0 -35
- package/src/components/file-viewer.tsx +0 -67
- package/src/components/header.tsx +0 -31
- package/src/components/sidebar-items/add-ons.tsx +0 -94
- package/src/components/sidebar-items/mode-selector.tsx +0 -57
- package/src/components/sidebar-items/project-name.tsx +0 -28
- package/src/components/sidebar-items/run-add-ons.tsx +0 -71
- package/src/components/sidebar-items/run-create-app.tsx +0 -82
- package/src/components/sidebar-items/starter.tsx +0 -123
- package/src/components/sidebar-items/typescript-switch.tsx +0 -52
- package/src/components/starters-carousel.tsx +0 -45
- package/src/components/startup-dialog.tsx +0 -71
- package/src/components/toaster.tsx +0 -29
- package/src/components/ui/button.tsx +0 -61
- package/src/components/ui/carousel.tsx +0 -239
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/dialog.tsx +0 -138
- package/src/components/ui/dropdown-menu.tsx +0 -255
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -22
- package/src/components/ui/popover.tsx +0 -46
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/sheet.tsx +0 -137
- package/src/components/ui/sidebar.tsx +0 -726
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/sonner.tsx +0 -23
- package/src/components/ui/switch.tsx +0 -29
- package/src/components/ui/table.tsx +0 -114
- package/src/components/ui/tabs.tsx +0 -64
- package/src/components/ui/toggle-group.tsx +0 -71
- package/src/components/ui/toggle.tsx +0 -49
- package/src/components/ui/tooltip.tsx +0 -61
- package/src/components/ui/tree-view.tsx +0 -497
- package/src/file-classes.ts +0 -54
- package/src/hooks/use-mobile.ts +0 -19
- package/src/hooks/use-mounted.ts +0 -9
- package/src/hooks/use-preferred-reduced-motion.ts +0 -27
- package/src/hooks/use-streaming-status.ts +0 -70
- package/src/lib/api.ts +0 -92
- package/src/lib/utils.ts +0 -6
- package/src/store/add-ons.ts +0 -81
- package/src/store/project.ts +0 -347
- package/tests/store/add-ons.test.ts +0 -222
- package/vitest.config.ts +0 -6
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import type { AddOnInfo } from '@/types'
|
|
4
|
-
|
|
5
|
-
import { getAddOnStatus } from '@/store/add-ons'
|
|
6
|
-
|
|
7
|
-
describe('getAddOnStatus', () => {
|
|
8
|
-
it('everything should be enabled if nothing is selected', () => {
|
|
9
|
-
const addOnStatus = getAddOnStatus(
|
|
10
|
-
[
|
|
11
|
-
{
|
|
12
|
-
id: 'add-on-1',
|
|
13
|
-
dependsOn: ['add-on-2'],
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'add-on-2',
|
|
17
|
-
},
|
|
18
|
-
] as unknown as Array<AddOnInfo>,
|
|
19
|
-
[],
|
|
20
|
-
[],
|
|
21
|
-
)
|
|
22
|
-
expect(addOnStatus).toEqual({
|
|
23
|
-
'add-on-1': {
|
|
24
|
-
selected: false,
|
|
25
|
-
enabled: true,
|
|
26
|
-
},
|
|
27
|
-
'add-on-2': {
|
|
28
|
-
selected: false,
|
|
29
|
-
enabled: true,
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should handle a single add-on', () => {
|
|
35
|
-
const addOnStatus = getAddOnStatus(
|
|
36
|
-
[
|
|
37
|
-
{
|
|
38
|
-
id: 'add-on-1',
|
|
39
|
-
dependsOn: [],
|
|
40
|
-
},
|
|
41
|
-
] as unknown as Array<AddOnInfo>,
|
|
42
|
-
['add-on-1'],
|
|
43
|
-
[],
|
|
44
|
-
)
|
|
45
|
-
expect(addOnStatus).toEqual({
|
|
46
|
-
'add-on-1': {
|
|
47
|
-
selected: true,
|
|
48
|
-
enabled: true,
|
|
49
|
-
},
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('should handle a depended-on add-on', () => {
|
|
54
|
-
const addOnStatus = getAddOnStatus(
|
|
55
|
-
[
|
|
56
|
-
{
|
|
57
|
-
id: 'add-on-1',
|
|
58
|
-
dependsOn: ['add-on-2'],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'add-on-2',
|
|
62
|
-
dependsOn: [],
|
|
63
|
-
},
|
|
64
|
-
] as unknown as Array<AddOnInfo>,
|
|
65
|
-
['add-on-1'],
|
|
66
|
-
[],
|
|
67
|
-
)
|
|
68
|
-
expect(addOnStatus).toEqual({
|
|
69
|
-
'add-on-1': {
|
|
70
|
-
selected: true,
|
|
71
|
-
enabled: true,
|
|
72
|
-
},
|
|
73
|
-
'add-on-2': {
|
|
74
|
-
selected: true,
|
|
75
|
-
enabled: false,
|
|
76
|
-
},
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('should handle a selected depended-on add-on', () => {
|
|
81
|
-
const addOnStatus = getAddOnStatus(
|
|
82
|
-
[
|
|
83
|
-
{
|
|
84
|
-
id: 'add-on-1',
|
|
85
|
-
dependsOn: ['add-on-2'],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 'add-on-2',
|
|
89
|
-
dependsOn: [],
|
|
90
|
-
},
|
|
91
|
-
] as unknown as Array<AddOnInfo>,
|
|
92
|
-
['add-on-1', 'add-on-2'],
|
|
93
|
-
[],
|
|
94
|
-
)
|
|
95
|
-
expect(addOnStatus).toEqual({
|
|
96
|
-
'add-on-1': {
|
|
97
|
-
selected: true,
|
|
98
|
-
enabled: true,
|
|
99
|
-
},
|
|
100
|
-
'add-on-2': {
|
|
101
|
-
selected: true,
|
|
102
|
-
enabled: false,
|
|
103
|
-
},
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('should handle a selected depended-on add-on', () => {
|
|
108
|
-
const addOnStatus = getAddOnStatus(
|
|
109
|
-
[
|
|
110
|
-
{
|
|
111
|
-
id: 'add-on-1',
|
|
112
|
-
dependsOn: ['add-on-2'],
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'add-on-2',
|
|
116
|
-
dependsOn: [],
|
|
117
|
-
},
|
|
118
|
-
] as unknown as Array<AddOnInfo>,
|
|
119
|
-
['add-on-2'],
|
|
120
|
-
[],
|
|
121
|
-
)
|
|
122
|
-
expect(addOnStatus).toEqual({
|
|
123
|
-
'add-on-1': {
|
|
124
|
-
selected: false,
|
|
125
|
-
enabled: true,
|
|
126
|
-
},
|
|
127
|
-
'add-on-2': {
|
|
128
|
-
selected: true,
|
|
129
|
-
enabled: true,
|
|
130
|
-
},
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
it('wont cycle', () => {
|
|
135
|
-
const addOnStatus = getAddOnStatus(
|
|
136
|
-
[
|
|
137
|
-
{
|
|
138
|
-
id: 'add-on-1',
|
|
139
|
-
dependsOn: ['add-on-2'],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: 'add-on-2',
|
|
143
|
-
dependsOn: ['add-on-1'],
|
|
144
|
-
},
|
|
145
|
-
] as unknown as Array<AddOnInfo>,
|
|
146
|
-
['add-on-1'],
|
|
147
|
-
[],
|
|
148
|
-
)
|
|
149
|
-
expect(addOnStatus).toEqual({
|
|
150
|
-
'add-on-1': {
|
|
151
|
-
selected: true,
|
|
152
|
-
enabled: false,
|
|
153
|
-
},
|
|
154
|
-
'add-on-2': {
|
|
155
|
-
selected: true,
|
|
156
|
-
enabled: false,
|
|
157
|
-
},
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
it('should handle original add-ons', () => {
|
|
162
|
-
const addOnStatus = getAddOnStatus(
|
|
163
|
-
[
|
|
164
|
-
{
|
|
165
|
-
id: 'add-on-1',
|
|
166
|
-
dependsOn: ['add-on-2'],
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
id: 'add-on-2',
|
|
170
|
-
dependsOn: [],
|
|
171
|
-
},
|
|
172
|
-
] as unknown as Array<AddOnInfo>,
|
|
173
|
-
['add-on-1'],
|
|
174
|
-
['add-on-2'],
|
|
175
|
-
)
|
|
176
|
-
expect(addOnStatus).toEqual({
|
|
177
|
-
'add-on-1': {
|
|
178
|
-
selected: true,
|
|
179
|
-
enabled: true,
|
|
180
|
-
},
|
|
181
|
-
'add-on-2': {
|
|
182
|
-
selected: true,
|
|
183
|
-
enabled: false,
|
|
184
|
-
},
|
|
185
|
-
})
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
it('should handle original add-ons with dependencies', () => {
|
|
189
|
-
const addOnStatus = getAddOnStatus(
|
|
190
|
-
[
|
|
191
|
-
{
|
|
192
|
-
id: 'add-on-1',
|
|
193
|
-
dependsOn: ['add-on-2'],
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
id: 'add-on-2',
|
|
197
|
-
dependsOn: ['add-on-3'],
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: 'add-on-3',
|
|
201
|
-
dependsOn: [],
|
|
202
|
-
},
|
|
203
|
-
] as unknown as Array<AddOnInfo>,
|
|
204
|
-
['add-on-1'],
|
|
205
|
-
['add-on-2'],
|
|
206
|
-
)
|
|
207
|
-
expect(addOnStatus).toEqual({
|
|
208
|
-
'add-on-1': {
|
|
209
|
-
selected: true,
|
|
210
|
-
enabled: true,
|
|
211
|
-
},
|
|
212
|
-
'add-on-2': {
|
|
213
|
-
selected: true,
|
|
214
|
-
enabled: false,
|
|
215
|
-
},
|
|
216
|
-
'add-on-3': {
|
|
217
|
-
selected: true,
|
|
218
|
-
enabled: false,
|
|
219
|
-
},
|
|
220
|
-
})
|
|
221
|
-
})
|
|
222
|
-
})
|