@tanstack/cta-ui 0.15.1 → 0.15.3
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-BOlcot4d.js → index-BktnQA5a.js} +3 -3
- package/dist/assets/{index-BOlcot4d.js.map → index-BktnQA5a.js.map} +1 -1
- package/dist/index.html +1 -1
- package/lib/index.ts +8 -5
- package/lib-dist/index.js +8 -6
- package/package.json +4 -4
- package/src/components/custom-add-on-dialog.tsx +1 -1
- package/src/components/sidebar-items/starter.tsx +2 -2
package/dist/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
rel="stylesheet"
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-BktnQA5a.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-CpoUtYXp.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body class="dark">
|
package/lib/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import chalk from 'chalk'
|
|
|
7
7
|
import {
|
|
8
8
|
AddOnCompiledSchema,
|
|
9
9
|
StarterCompiledSchema,
|
|
10
|
+
handleSpecialURL,
|
|
10
11
|
} from '@tanstack/cta-engine'
|
|
11
12
|
|
|
12
13
|
import { addToAppWrapper } from './engine-handling/add-to-app-wrapper.js'
|
|
@@ -81,14 +82,15 @@ export function launchUI(
|
|
|
81
82
|
return
|
|
82
83
|
}
|
|
83
84
|
try {
|
|
84
|
-
const
|
|
85
|
+
const fixedUrl = handleSpecialURL(url as string)
|
|
86
|
+
const response = await fetch(fixedUrl)
|
|
85
87
|
const data = await response.json()
|
|
86
88
|
const parsed = AddOnCompiledSchema.safeParse(data)
|
|
87
89
|
if (!parsed.success) {
|
|
88
90
|
res.status(400).json({ error: 'Invalid add-on data' })
|
|
89
91
|
} else {
|
|
90
92
|
res.json({
|
|
91
|
-
id:
|
|
93
|
+
id: fixedUrl,
|
|
92
94
|
name: parsed.data.name,
|
|
93
95
|
description: parsed.data.description,
|
|
94
96
|
version: parsed.data.version,
|
|
@@ -113,14 +115,15 @@ export function launchUI(
|
|
|
113
115
|
return
|
|
114
116
|
}
|
|
115
117
|
try {
|
|
116
|
-
const
|
|
118
|
+
const fixedUrl = handleSpecialURL(url as string)
|
|
119
|
+
const response = await fetch(fixedUrl)
|
|
117
120
|
const data = await response.json()
|
|
118
121
|
const parsed = StarterCompiledSchema.safeParse(data)
|
|
119
122
|
if (!parsed.success) {
|
|
120
123
|
res.status(400).json({ error: 'Invalid starter data' })
|
|
121
124
|
} else {
|
|
122
125
|
res.json({
|
|
123
|
-
url,
|
|
126
|
+
url: fixedUrl,
|
|
124
127
|
id: parsed.data.id,
|
|
125
128
|
name: parsed.data.name,
|
|
126
129
|
description: parsed.data.description,
|
|
@@ -132,7 +135,7 @@ export function launchUI(
|
|
|
132
135
|
typescript: parsed.data.typescript,
|
|
133
136
|
tailwind: parsed.data.tailwind,
|
|
134
137
|
banner: parsed.data.banner
|
|
135
|
-
?
|
|
138
|
+
? fixedUrl.replace('starter.json', parsed.data.banner)
|
|
136
139
|
: undefined,
|
|
137
140
|
})
|
|
138
141
|
}
|
package/lib-dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
3
3
|
import express from 'express';
|
|
4
4
|
import cors from 'cors';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
|
-
import { AddOnCompiledSchema, StarterCompiledSchema, } from '@tanstack/cta-engine';
|
|
6
|
+
import { AddOnCompiledSchema, StarterCompiledSchema, handleSpecialURL, } from '@tanstack/cta-engine';
|
|
7
7
|
import { addToAppWrapper } from './engine-handling/add-to-app-wrapper.js';
|
|
8
8
|
import { createAppWrapper } from './engine-handling/create-app-wrapper.js';
|
|
9
9
|
import { generateInitialPayload } from './engine-handling/generate-initial-payload.js';
|
|
@@ -54,7 +54,8 @@ export function launchUI(options) {
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
try {
|
|
57
|
-
const
|
|
57
|
+
const fixedUrl = handleSpecialURL(url);
|
|
58
|
+
const response = await fetch(fixedUrl);
|
|
58
59
|
const data = await response.json();
|
|
59
60
|
const parsed = AddOnCompiledSchema.safeParse(data);
|
|
60
61
|
if (!parsed.success) {
|
|
@@ -62,7 +63,7 @@ export function launchUI(options) {
|
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
65
|
res.json({
|
|
65
|
-
id:
|
|
66
|
+
id: fixedUrl,
|
|
66
67
|
name: parsed.data.name,
|
|
67
68
|
description: parsed.data.description,
|
|
68
69
|
version: parsed.data.version,
|
|
@@ -87,7 +88,8 @@ export function launchUI(options) {
|
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
90
|
try {
|
|
90
|
-
const
|
|
91
|
+
const fixedUrl = handleSpecialURL(url);
|
|
92
|
+
const response = await fetch(fixedUrl);
|
|
91
93
|
const data = await response.json();
|
|
92
94
|
const parsed = StarterCompiledSchema.safeParse(data);
|
|
93
95
|
if (!parsed.success) {
|
|
@@ -95,7 +97,7 @@ export function launchUI(options) {
|
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
99
|
res.json({
|
|
98
|
-
url,
|
|
100
|
+
url: fixedUrl,
|
|
99
101
|
id: parsed.data.id,
|
|
100
102
|
name: parsed.data.name,
|
|
101
103
|
description: parsed.data.description,
|
|
@@ -107,7 +109,7 @@ export function launchUI(options) {
|
|
|
107
109
|
typescript: parsed.data.typescript,
|
|
108
110
|
tailwind: parsed.data.tailwind,
|
|
109
111
|
banner: parsed.data.banner
|
|
110
|
-
?
|
|
112
|
+
? fixedUrl.replace('starter.json', parsed.data.banner)
|
|
111
113
|
: undefined,
|
|
112
114
|
});
|
|
113
115
|
}
|
package/package.json
CHANGED
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"tailwindcss-animate": "^1.0.7",
|
|
46
46
|
"vite-tsconfig-paths": "^5.1.4",
|
|
47
47
|
"zustand": "^5.0.3",
|
|
48
|
-
"@tanstack/cta-
|
|
49
|
-
"@tanstack/cta-framework-solid": "0.15.
|
|
50
|
-
"@tanstack/cta-
|
|
48
|
+
"@tanstack/cta-framework-react-cra": "0.15.3",
|
|
49
|
+
"@tanstack/cta-framework-solid": "0.15.3",
|
|
50
|
+
"@tanstack/cta-engine": "0.15.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@tailwindcss/typography": "^0.5.16",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"vitest": "^3.0.5",
|
|
67
67
|
"web-vitals": "^4.2.4"
|
|
68
68
|
},
|
|
69
|
-
"version": "0.15.
|
|
69
|
+
"version": "0.15.3",
|
|
70
70
|
"scripts": {}
|
|
71
71
|
}
|
|
@@ -51,7 +51,7 @@ export default function CustomAddOnDialog() {
|
|
|
51
51
|
<TicketPlusIcon className="w-4 h-4" />
|
|
52
52
|
Import Custom Add-On
|
|
53
53
|
</Button>
|
|
54
|
-
<Dialog modal open={open}>
|
|
54
|
+
<Dialog modal open={open} onOpenChange={setOpen}>
|
|
55
55
|
<DialogContent className="sm:min-w-[425px] sm:max-w-fit">
|
|
56
56
|
<DialogHeader>
|
|
57
57
|
<DialogTitle>Import Custom Add-On</DialogTitle>
|
|
@@ -96,7 +96,7 @@ export default function Starter() {
|
|
|
96
96
|
</DialogHeader>
|
|
97
97
|
{registry?.starters && (
|
|
98
98
|
<div>
|
|
99
|
-
<StartersCarousel onImport={onImport} />
|
|
99
|
+
<StartersCarousel onImport={(url) => onImport(url)} />
|
|
100
100
|
</div>
|
|
101
101
|
)}
|
|
102
102
|
<div>
|
|
@@ -113,7 +113,7 @@ export default function Starter() {
|
|
|
113
113
|
/>
|
|
114
114
|
</div>
|
|
115
115
|
<DialogFooter>
|
|
116
|
-
<Button onClick={onImport}>Load</Button>
|
|
116
|
+
<Button onClick={() => onImport()}>Load</Button>
|
|
117
117
|
</DialogFooter>
|
|
118
118
|
</DialogContent>
|
|
119
119
|
</Dialog>
|