@engenty/wizards-runtime 0.9.1 → 0.9.2
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 +24 -13
- package/apps/runtime/dist/docs/dev/plugins/runners.md +1 -1
- package/apps/runtime/dist/docs/dev/wizard-format/index.md +4 -53
- package/apps/runtime/dist/docs/dev/wizard-format/meta.json +1 -0
- package/apps/runtime/dist/docs/dev/wizard-format/pages-and-fields.md +17 -0
- package/apps/runtime/dist/docs/dev/wizard-format/themes.md +220 -0
- package/apps/runtime/dist/docs/dev/wizard-format/wizard-file.md +2 -0
- package/apps/runtime/dist/docs/user/run.md +15 -1
- package/apps/runtime/dist/docs/user/space.md +4 -0
- package/apps/runtime/dist/files/upload-check.js +622 -0
- package/apps/runtime/dist/harness/terminal.js +14 -7
- package/apps/runtime/dist/index.js +2 -0
- package/apps/runtime/dist/no-webstorage.js +6 -0
- package/apps/runtime/dist/plugins/runs.js +8 -5
- package/apps/runtime/dist/routes/runs.js +22 -6
- package/apps/runtime/dist/routes/studio.js +2 -2
- package/apps/runtime/dist/services/project-files.js +14 -6
- package/apps/web/dist/assets/{AboutDialog-DKfHXQUv.js → AboutDialog-BUdEn9X_.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-BsM9zGdh.js → ChangelogDialog-ClkjHGE_.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-CRcgupmQ.js → EditorPage-j5HjqTMV.js} +2 -2
- package/apps/web/dist/assets/{FlowPreview-szPmsT2-.js → FlowPreview-DZRkWedM.js} +1 -1
- package/apps/web/dist/assets/{Harness-CXx-Js4U.js → Harness-FiDeF3LX.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-C6R1HV0I.js → NewWizardChannels-DeJP5h5I.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-D6Z6DYeT.js → NewWizardPage-CIS3qNUz.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-DrN26Afr.js → OnboardingPage-CoTYSubc.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-CNyhwfgz.js → ProjectPage-XVhe87S4.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-CREvMYW_.js → PublicRunner-Bc-3e7UU.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-BUyOPou5.js → ReadOnly-I-Lm7a8y.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-8iWXyXjL.js → RunDrawer-DXqyxTsm.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-CufG6xDP.js → RunnerView-DeDApA-9.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-B4M4DrMS.js → SettingsPage-ChpDzJVn.js} +2 -2
- package/apps/web/dist/assets/{SetupPage-D-Op38jE.js → SetupPage-E5JoQMBM.js} +1 -1
- package/apps/web/dist/assets/{SharePage-BXYVZ3Fa.js → SharePage-DW1b2g9t.js} +1 -1
- package/apps/web/dist/assets/changelog-DuSV2HiU.js +1 -0
- package/apps/web/dist/assets/{esm-CetquljB.js → esm-yMT-rSPa.js} +1 -1
- package/apps/web/dist/assets/{index-C5Qmfm_0.css → index-D9oqYYa8.css} +1 -1
- package/apps/web/dist/assets/{index-TJhB4-x8.js → index-DfHH4icT.js} +4 -4
- package/apps/web/dist/assets/oss-credits-6A3pxilr.js +1 -0
- package/apps/web/dist/assets/{phone-CJVAobUx.js → phone-BprN_SDS.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-DjgZMuyV.js → settings-menu-CVl54phq.js} +1 -1
- package/apps/web/dist/assets/{theme-BucH2rUv.js → theme-DZZXa238.js} +1 -1
- package/apps/web/dist/assets/{ui-LJgQlXbd.js → ui-kIzOrA_W.js} +1 -1
- package/apps/web/dist/assets/{upload-Dz86uI5u.js → upload-Cvztyjuj.js} +1 -1
- package/apps/web/dist/assets/{wrench-Dr5LakQv.js → wrench-CWT9IGKq.js} +1 -1
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/install.sh +43 -3
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +4 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +8 -0
- package/package.json +2 -4
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/changelog-KvwOYLcI.js +0 -1
- package/apps/web/dist/assets/oss-credits-BvQGQEzd.js +0 -1
|
@@ -8,6 +8,7 @@ import { watchRun } from "../engine/events.js";
|
|
|
8
8
|
import { fieldErrorsIn } from "../engine/input.js";
|
|
9
9
|
import { cancel, createRun, goBack, NoCreditsError, RunInputError, retry, reviewStep, submitPage, } from "../engine/runner.js";
|
|
10
10
|
import { saveAsset } from "../files/storage.js";
|
|
11
|
+
import { checkUpload } from "../files/upload-check.js";
|
|
11
12
|
import { wizardUnavailable } from "../limits.js";
|
|
12
13
|
import { transcribeAudio } from "../media/transcribe.js";
|
|
13
14
|
import { errorText, ModelUnavailableError } from "../model-errors.js";
|
|
@@ -175,14 +176,16 @@ export function runsApiFor(pluginId) {
|
|
|
175
176
|
async upload(runId, file) {
|
|
176
177
|
await pluginRun(runId);
|
|
177
178
|
// The type comes from the channel's sender: kept only when it is one a wizard takes.
|
|
178
|
-
const
|
|
179
|
-
const asset = await saveAsset({
|
|
180
|
-
runId,
|
|
181
|
-
kind: mime.startsWith("image/") ? "image" : "file",
|
|
182
|
-
mime,
|
|
179
|
+
const checked = await checkUpload({
|
|
183
180
|
name: file.name,
|
|
181
|
+
mime: uploadMime(file.mime),
|
|
184
182
|
data: file.data instanceof Uint8Array ? file.data : new Uint8Array(file.data),
|
|
185
183
|
});
|
|
184
|
+
const asset = await saveAsset({
|
|
185
|
+
runId,
|
|
186
|
+
kind: checked.mime.startsWith("image/") ? "image" : "file",
|
|
187
|
+
...checked,
|
|
188
|
+
});
|
|
186
189
|
return { assetId: asset.id };
|
|
187
190
|
},
|
|
188
191
|
async transcribe(runId, file) {
|
|
@@ -25,6 +25,7 @@ import { liveResources } from "../engine/resources.js";
|
|
|
25
25
|
import { cancel, createRun, editOutput, goBack, NoCreditsError, projectIdOf, RunConflict, RunInputError, retry, reviewStep, runView, submitPage, talkAllowed, } from "../engine/runner.js";
|
|
26
26
|
import { basePath, env } from "../env.js";
|
|
27
27
|
import { loadAsset, saveAsset } from "../files/storage.js";
|
|
28
|
+
import { checkUpload } from "../files/upload-check.js";
|
|
28
29
|
import { reverseGeocode } from "../geocode.js";
|
|
29
30
|
import { allowed, hashIp, verifyTurnstile, wizardUnavailable } from "../limits.js";
|
|
30
31
|
import { mintConversation } from "../media/conversation.js";
|
|
@@ -482,8 +483,9 @@ export const publicRoutes = new Hono()
|
|
|
482
483
|
return c.notFound();
|
|
483
484
|
}
|
|
484
485
|
return c.body(new Uint8Array(found.data), 200, {
|
|
485
|
-
"content-type": found.row.mime,
|
|
486
|
+
"content-type": bareMime(found.row.mime) ?? "application/octet-stream",
|
|
486
487
|
"cache-control": "public, max-age=86400",
|
|
488
|
+
"x-content-type-options": "nosniff",
|
|
487
489
|
// An SVG logo is shown, never run.
|
|
488
490
|
"content-security-policy": "sandbox",
|
|
489
491
|
});
|
|
@@ -502,8 +504,9 @@ export const publicRoutes = new Hono()
|
|
|
502
504
|
return c.notFound();
|
|
503
505
|
}
|
|
504
506
|
return c.body(new Uint8Array(found.data), 200, {
|
|
505
|
-
"content-type": found.row.mime,
|
|
507
|
+
"content-type": bareMime(found.row.mime) ?? "application/octet-stream",
|
|
506
508
|
"cache-control": "public, max-age=86400",
|
|
509
|
+
"x-content-type-options": "nosniff",
|
|
507
510
|
"access-control-allow-origin": "*",
|
|
508
511
|
"cross-origin-resource-policy": "cross-origin",
|
|
509
512
|
});
|
|
@@ -872,12 +875,25 @@ export const runRoutes = new Hono()
|
|
|
872
875
|
if (!(file instanceof File) || file.size > limit) {
|
|
873
876
|
return refuse(c, { code: "fileTooLarge", params: { mb: Math.round(limit / 1_000_000) } }, 400);
|
|
874
877
|
}
|
|
878
|
+
let checked;
|
|
879
|
+
try {
|
|
880
|
+
checked = await checkUpload({
|
|
881
|
+
name: file.name,
|
|
882
|
+
mime,
|
|
883
|
+
data: new Uint8Array(await file.arrayBuffer()),
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
catch (err) {
|
|
887
|
+
const said = noteOf(err);
|
|
888
|
+
if (said) {
|
|
889
|
+
return refuse(c, said, 400);
|
|
890
|
+
}
|
|
891
|
+
throw err;
|
|
892
|
+
}
|
|
875
893
|
const ref = await saveAsset({
|
|
876
894
|
runId: run.id,
|
|
877
|
-
kind: mime.startsWith("image/") ? "upload-image" : "upload",
|
|
878
|
-
|
|
879
|
-
name: file.name.slice(0, 120),
|
|
880
|
-
data: new Uint8Array(await file.arrayBuffer()),
|
|
895
|
+
kind: checked.mime.startsWith("image/") ? "upload-image" : "upload",
|
|
896
|
+
...checked,
|
|
881
897
|
});
|
|
882
898
|
return c.json(ref);
|
|
883
899
|
})
|
|
@@ -69,7 +69,7 @@ import { codeOf } from "../tenants/control.js";
|
|
|
69
69
|
import { currentTenant } from "../tenants/tenant.js";
|
|
70
70
|
import { serverText } from "../texts.js";
|
|
71
71
|
import { applyUpdate, updateStatus } from "../update.js";
|
|
72
|
-
import { byteRange } from "./delivery.js";
|
|
72
|
+
import { bareMime, byteRange } from "./delivery.js";
|
|
73
73
|
import { notFoundAnswer, requestLang, say } from "./lang.js";
|
|
74
74
|
/** The model sources a test call has worked on: the setup is done for those, not for the others. */
|
|
75
75
|
async function testedSources() {
|
|
@@ -645,7 +645,7 @@ export const studio = new Hono()
|
|
|
645
645
|
const project = await ownedProject(c.get("user").id, c.req.param("id"));
|
|
646
646
|
const { row, data } = await projectFileContent(project.id, c.req.param("fileId"));
|
|
647
647
|
const headers = {
|
|
648
|
-
"content-type": row.mime,
|
|
648
|
+
"content-type": bareMime(row.mime) ?? "application/octet-stream",
|
|
649
649
|
"cache-control": "private, max-age=3600",
|
|
650
650
|
"x-content-type-options": "nosniff",
|
|
651
651
|
// An uploaded SVG or HTML file is shown, never run. A PDF is left to the browser's own
|
|
@@ -5,6 +5,7 @@ import { and, asc, count, eq, max } from "drizzle-orm";
|
|
|
5
5
|
import { db, schema } from "../db/client.js";
|
|
6
6
|
import { documentMime, UnreadableDocument } from "../documents/parse.js";
|
|
7
7
|
import { loadAsset, removeAsset, replaceAsset, saveAsset } from "../files/storage.js";
|
|
8
|
+
import { checkUpload } from "../files/upload-check.js";
|
|
8
9
|
import { embeddingModel, textModel } from "../models.js";
|
|
9
10
|
import { spaceFileChanged } from "../plugins/events.js";
|
|
10
11
|
import { dropLinks, putLink } from "../tenants/control.js";
|
|
@@ -76,18 +77,26 @@ function accepts(kind, mime) {
|
|
|
76
77
|
}
|
|
77
78
|
export async function addProjectFile(projectId, input) {
|
|
78
79
|
await requireWritableProject(projectId);
|
|
79
|
-
const
|
|
80
|
-
if (!accepts(input.kind,
|
|
80
|
+
const declared = documentMime(input.name, input.mime) || "application/octet-stream";
|
|
81
|
+
if (!accepts(input.kind, declared)) {
|
|
81
82
|
throw new ServiceError("invalid", input.kind === "logo"
|
|
82
83
|
? note("logoImagePngSvg")
|
|
83
84
|
: input.kind === "pattern"
|
|
84
85
|
? note("patternImageSvgPng")
|
|
85
86
|
: note("filesGoHere"));
|
|
86
87
|
}
|
|
87
|
-
const limit = projectFileLimit(input.kind,
|
|
88
|
+
const limit = projectFileLimit(input.kind, declared);
|
|
88
89
|
if (!input.data.byteLength || input.data.byteLength > limit) {
|
|
89
90
|
throw new ServiceError("invalid", note("chooseFileUpTo", { mb: Math.round(limit / 1_000_000) }));
|
|
90
91
|
}
|
|
92
|
+
// The bytes say what the file is; a picture is drawn again without its metadata.
|
|
93
|
+
const checked = await checkUpload({
|
|
94
|
+
name: input.name,
|
|
95
|
+
mime: declared,
|
|
96
|
+
data: input.data,
|
|
97
|
+
fallbackName: "datei",
|
|
98
|
+
});
|
|
99
|
+
const { mime, data, name } = checked;
|
|
91
100
|
const scope = and(eq(schema.projectFile.projectId, projectId), eq(schema.projectFile.kind, input.kind));
|
|
92
101
|
const [{ n, last }] = await db
|
|
93
102
|
.select({ n: count(), last: max(schema.projectFile.position) })
|
|
@@ -96,12 +105,11 @@ export async function addProjectFile(projectId, input) {
|
|
|
96
105
|
if (n >= PROJECT_LIMITS.files[input.kind]) {
|
|
97
106
|
throw new ServiceError("refused", note("roomMostFiles", { count: PROJECT_LIMITS.files[input.kind] }));
|
|
98
107
|
}
|
|
99
|
-
const name = input.name.slice(0, 120) || "datei";
|
|
100
108
|
const ref = await saveAsset({
|
|
101
109
|
kind: input.kind === "logo" ? "logo" : "project",
|
|
102
110
|
mime,
|
|
103
111
|
name,
|
|
104
|
-
data
|
|
112
|
+
data,
|
|
105
113
|
});
|
|
106
114
|
const description = input.description?.trim().slice(0, 600) ?? "";
|
|
107
115
|
const work = input.kind === "document" || (!description && SEEN_BY_MODEL.includes(mime));
|
|
@@ -113,7 +121,7 @@ export async function addProjectFile(projectId, input) {
|
|
|
113
121
|
kind: input.kind,
|
|
114
122
|
name,
|
|
115
123
|
mime,
|
|
116
|
-
size:
|
|
124
|
+
size: data.byteLength,
|
|
117
125
|
description,
|
|
118
126
|
source: input.source ?? null,
|
|
119
127
|
position: (last ?? -1) + 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bt as r,Gt as i,Jt as a,Lt as o,Rt as s,Tr as c,Xt as l,er as u,jr as d,rn as f,zt as p}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bt as r,Gt as i,Jt as a,Lt as o,Rt as s,Tr as c,Xt as l,er as u,jr as d,rn as f,zt as p}from"./ui-kIzOrA_W.js";import{t as m}from"./preload-helper-CNEI7N0N.js";import{Rt as h,dt as g,ft as _,tt as v}from"./index-DfHH4icT.js";import{c as y,f as b}from"./settings-menu-CVl54phq.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-ClkjHGE_.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:r,description:i}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(c,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:f(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[a,o]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return m(()=>import(`./oss-credits-6A3pxilr.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||o(``)},[e]);let c=a.trim().toLowerCase(),l=e=>c?e.filter(e=>k(c,e.name,e.license,f(e.description))):e,u=e=>c?e.filter(e=>k(c,e.name,e.license,e.version)):e,d=l(E),p=l(D),h=t?[{id:`shared`,label:f(`about.creditsShared`),packages:u(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:u(e.packages)}))].filter(e=>e.packages.length>0):[],g=d.length===0&&p.length===0&&h.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:f(`about.creditsHint`)}),(0,O.jsx)(r,{type:`search`,value:a,placeholder:f(`about.search`),onChange:e=>o(e.target.value)}),d.length>0?(0,O.jsx)(j,{title:f(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:d})}):null,p.length>0?(0,O.jsx)(j,{title:f(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:p})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(i,{})}):h.length>0?(0,O.jsx)(j,{title:f(`about.creditsDeps`),hint:c?void 0:f(`about.creditsDepsHint`),children:h.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(s,{children:f(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>f(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?f(`about.change`):f(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let r=e?.mode===`local`,{data:o,latest:s}=g(r&&t),[c,u]=(0,T.useState)(null),[p,m]=(0,T.useState)(n);(0,T.useEffect)(()=>m(n),[n]);let E=b(F.indexOf(p)),D=o?.newer&&s?s:_;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return u(null),S(D===`0.9.2`?void 0:D).then(t=>{e||u(t)}),()=>{e=!0}},[t,D]);let k=c?.find(e=>e.version===`v${D}`)??c?.[0]??null,A=c?.filter(e=>e!==k)??[],j=r?o?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(h,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[f(`about.version`,{v:_}),j?` · ${f(`about.kind.${j}`)}`:``]})]}),r?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(v,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(a,{value:p,onChange:m,options:F.map(e=>({id:e,label:I(e)})),label:f(`about.title`)})}),(0,O.jsxs)(`div`,{className:l(`mt-5`,y(E)),children:[p===`new`?c===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(i,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:f(`about.changelogEmpty`)}):null,p===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(d,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,p===`credits`?(0,O.jsx)(P,{active:!0}):null]},p)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(o,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(p,{label:f(`common.close`),onClick:t,children:(0,O.jsx)(u,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bt as r,Gt as i,Lt as a,Rt as o,Xt as s,rn as c}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bt as r,Gt as i,Lt as a,Rt as o,Xt as s,rn as c}from"./ui-kIzOrA_W.js";import{t as l}from"./preload-helper-CNEI7N0N.js";var u=e(t(),1),d=e(n(),1);function f(e){switch(e.group){case`Added`:return{label:`NEW`,dot:`bg-moss`};case`Fixed`:return{label:`FIXED`,dot:`bg-amber`};case`Changed`:return{label:`CHANGED`,dot:`bg-cobalt`};case`Performance`:return{label:`PERFORMANCE`,dot:`bg-ember`};case`Deploy`:return{label:`DEPLOY`,dot:`bg-ink-4`};case`Docs`:return{label:`DOCS`,dot:`bg-ink-4`};default:return{label:`OTHER`,dot:`bg-ink-4`}}}var p=e=>e.version?e.version.replace(/^v/,``):c(`about.unreleased`),m=e=>e.timestamp?new Date(e.timestamp*1e3).toISOString().slice(0,10):``,h=e=>e.charAt(0).toUpperCase()+e.slice(1);function g(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){if(`${p(t)} ${m(t)}`.toLowerCase().includes(n)){r.push(t);continue}let e=t.commits.filter(e=>`${f(e).label} ${e.scope??``} ${e.message}`.toLowerCase().includes(n));e.length>0&&r.push({...t,commits:e})}return r}async function _(e){if(e)try{let t=await fetch(`https://raw.githubusercontent.com/engenty/wizards/v${e}/apps/web/src/about/changelog.json`,{signal:AbortSignal.timeout(5e3)});if(t.ok)return await t.json()}catch{}return(await l(async()=>{let{default:e}=await import(`./changelog-DuSV2HiU.js`);return{default:e}},[])).default}function v({release:e}){return(0,d.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.commits.map(e=>{let t=f(e);return(0,d.jsxs)(`li`,{className:`flex items-start gap-2.5 text-[0.875rem]`,children:[(0,d.jsx)(`span`,{className:s(`mt-[7px] size-1.5 shrink-0 rounded-full`,t.dot)}),(0,d.jsxs)(`span`,{className:`min-w-0 text-ink-2`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-[0.75rem] text-ink tracking-wide`,children:[t.label,e.scope?` [${e.scope}]`:``]}),` `,h(e.message),e.breaking?(0,d.jsx)(`span`,{className:`ml-1.5 rounded-full bg-rose-tint px-1.5 py-0.5 font-medium text-[0.75rem] text-rose`,children:c(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[s,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||s)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,s,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=s?g(s,f):[];return(0,d.jsxs)(a,{open:e,onClose:t,title:c(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:c(`about.changelogHint`)}),s===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(i,{})}):s.length===0?(0,d.jsx)(o,{children:c(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r,{type:`search`,value:f,placeholder:c(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(o,{children:c(`about.noMatches`)}):null,y.map(e=>(0,d.jsxs)(`section`,{className:`mt-6`,children:[(0,d.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[p(e),(0,d.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:m(e)})]}),(0,d.jsx)(`div`,{className:`mt-3`,children:(0,d.jsx)(v,{release:e})})]},e.version??`unreleased`))]})]})}export{y as ChangelogDialog,v as ReleaseNotes,_ as loadReleases,m as releaseDate,p as releaseLabel};
|