@tanstack/cta-ui 0.15.3 → 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.
Files changed (88) hide show
  1. package/dist/assets/index-BLGJkAxX.css +1 -0
  2. package/dist/assets/index-DPjMQkKx.js +208 -0
  3. package/dist/assets/index-DPjMQkKx.js.map +1 -0
  4. package/dist/index.html +3 -2
  5. package/index.html +1 -0
  6. package/lib/engine-handling/create-app-wrapper.ts +3 -4
  7. package/lib/engine-handling/generate-initial-payload.ts +12 -20
  8. package/lib/engine-handling/server-environment.ts +2 -2
  9. package/lib/index.ts +33 -15
  10. package/lib-dist/engine-handling/create-app-wrapper.js +3 -2
  11. package/lib-dist/engine-handling/generate-initial-payload.d.ts +8 -6
  12. package/lib-dist/engine-handling/generate-initial-payload.js +9 -14
  13. package/lib-dist/engine-handling/server-environment.d.ts +3 -3
  14. package/lib-dist/index.d.ts +1 -0
  15. package/lib-dist/index.js +29 -11
  16. package/package.json +3 -32
  17. package/src/index.tsx +2 -42
  18. package/src/main.tsx +0 -1
  19. package/src/styles.css +2 -0
  20. package/src/types.d.ts +13 -8
  21. package/dist/assets/index-BktnQA5a.js +0 -213
  22. package/dist/assets/index-BktnQA5a.js.map +0 -1
  23. package/dist/assets/index-CpoUtYXp.css +0 -1
  24. package/dist/logo-color-100w.png +0 -0
  25. package/dist/logo192.png +0 -0
  26. package/dist/logo512.png +0 -0
  27. package/dist/tailwind.svg +0 -1
  28. package/dist/tanstack.png +0 -0
  29. package/dist/typescript.svg +0 -1
  30. package/lib/engine-handling/framework-registration.ts +0 -11
  31. package/lib-dist/engine-handling/framework-registration.d.ts +0 -1
  32. package/lib-dist/engine-handling/framework-registration.js +0 -10
  33. package/public/logo-color-100w.png +0 -0
  34. package/public/logo192.png +0 -0
  35. package/public/logo512.png +0 -0
  36. package/public/tailwind.svg +0 -1
  37. package/public/tanstack.png +0 -0
  38. package/public/typescript.svg +0 -1
  39. package/src/components/StatusList.tsx +0 -22
  40. package/src/components/add-on-info-dialog.tsx +0 -39
  41. package/src/components/background-animation.tsx +0 -229
  42. package/src/components/cta-sidebar.tsx +0 -50
  43. package/src/components/custom-add-on-dialog.tsx +0 -79
  44. package/src/components/file-navigator.tsx +0 -203
  45. package/src/components/file-tree.tsx +0 -35
  46. package/src/components/file-viewer.tsx +0 -67
  47. package/src/components/header.tsx +0 -31
  48. package/src/components/sidebar-items/add-ons.tsx +0 -94
  49. package/src/components/sidebar-items/mode-selector.tsx +0 -57
  50. package/src/components/sidebar-items/project-name.tsx +0 -28
  51. package/src/components/sidebar-items/run-add-ons.tsx +0 -71
  52. package/src/components/sidebar-items/run-create-app.tsx +0 -82
  53. package/src/components/sidebar-items/starter.tsx +0 -123
  54. package/src/components/sidebar-items/typescript-switch.tsx +0 -52
  55. package/src/components/starters-carousel.tsx +0 -45
  56. package/src/components/startup-dialog.tsx +0 -71
  57. package/src/components/toaster.tsx +0 -29
  58. package/src/components/ui/button.tsx +0 -61
  59. package/src/components/ui/carousel.tsx +0 -239
  60. package/src/components/ui/checkbox.tsx +0 -30
  61. package/src/components/ui/dialog.tsx +0 -138
  62. package/src/components/ui/dropdown-menu.tsx +0 -255
  63. package/src/components/ui/input.tsx +0 -21
  64. package/src/components/ui/label.tsx +0 -22
  65. package/src/components/ui/popover.tsx +0 -46
  66. package/src/components/ui/separator.tsx +0 -28
  67. package/src/components/ui/sheet.tsx +0 -137
  68. package/src/components/ui/sidebar.tsx +0 -726
  69. package/src/components/ui/skeleton.tsx +0 -13
  70. package/src/components/ui/sonner.tsx +0 -23
  71. package/src/components/ui/switch.tsx +0 -29
  72. package/src/components/ui/table.tsx +0 -114
  73. package/src/components/ui/tabs.tsx +0 -64
  74. package/src/components/ui/toggle-group.tsx +0 -71
  75. package/src/components/ui/toggle.tsx +0 -49
  76. package/src/components/ui/tooltip.tsx +0 -61
  77. package/src/components/ui/tree-view.tsx +0 -497
  78. package/src/file-classes.ts +0 -54
  79. package/src/hooks/use-mobile.ts +0 -19
  80. package/src/hooks/use-mounted.ts +0 -9
  81. package/src/hooks/use-preferred-reduced-motion.ts +0 -27
  82. package/src/hooks/use-streaming-status.ts +0 -70
  83. package/src/lib/api.ts +0 -92
  84. package/src/lib/utils.ts +0 -6
  85. package/src/store/add-ons.ts +0 -81
  86. package/src/store/project.ts +0 -347
  87. package/tests/store/add-ons.test.ts +0 -222
  88. 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
- })
package/vitest.config.ts DELETED
@@ -1,6 +0,0 @@
1
- import { defineConfig } from 'vitest/config'
2
- import tsconfigPaths from 'vite-tsconfig-paths'
3
-
4
- export default defineConfig({
5
- plugins: [tsconfigPaths()],
6
- })