screenreader-speech-capture 0.4.0 → 0.6.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/dist/cli.mjs +122 -13
- package/dist/ui/adapter-node.js +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/0.CnPCLsGJ.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.CnPCLsGJ.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.CnPCLsGJ.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.IKhva0W0.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.IKhva0W0.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.IKhva0W0.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.BKNNVeb3.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.BKNNVeb3.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/3.BKNNVeb3.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C67ohLw_.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C67ohLw_.js.br +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C67ohLw_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CEzmqEHD.js +37 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CEzmqEHD.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CEzmqEHD.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CKeiBgOI.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CKeiBgOI.js.br +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CKeiBgOI.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVUOwNb5.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVUOwNb5.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVUOwNb5.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dksil5Gu.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dksil5Gu.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dksil5Gu.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DnL0kOQY.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DnL0kOQY.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DnL0kOQY.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/h7UQ89-l.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/h7UQ89-l.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/h7UQ89-l.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/vjU7Kh7P.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/vjU7Kh7P.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/vjU7Kh7P.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.DkG_UKpo.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.DkG_UKpo.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.DkG_UKpo.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.uodUAHNT.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.uodUAHNT.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.uodUAHNT.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CJdYHfX8.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CJdYHfX8.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CJdYHfX8.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.jZ-iBVjE.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.jZ-iBVjE.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.jZ-iBVjE.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{2.BCy3UgNz.js → 2.CKUmeq5l.js} +38 -37
- package/dist/ui/client/ui/_app/immutable/nodes/2.CKUmeq5l.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CKUmeq5l.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D74ClOwr.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D74ClOwr.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D74ClOwr.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DY8qq4Io.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DY8qq4Io.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DY8qq4Io.js.gz +0 -0
- package/dist/ui/client/ui/_app/version.json +1 -1
- package/dist/ui/client/ui/_app/version.json.br +0 -0
- package/dist/ui/client/ui/_app/version.json.gz +0 -0
- package/dist/ui/server/.vite/manifest.json +24 -4
- package/dist/ui/server/_app/immutable/assets/_layout.CnPCLsGJ.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.BKNNVeb3.css +1 -0
- package/dist/ui/server/_app/immutable/assets/_page.IKhva0W0.css +1 -0
- package/dist/ui/server/chunks/bridge-api.js +6 -0
- package/dist/ui/server/chunks/bridge-api.js.map +1 -1
- package/dist/ui/server/chunks/composition.js +75 -2647
- package/dist/ui/server/chunks/composition.js.map +1 -1
- package/dist/ui/server/chunks/icon-button.js +2636 -0
- package/dist/ui/server/chunks/icon-button.js.map +1 -0
- package/dist/ui/server/chunks/instance.js +4 -4
- package/dist/ui/server/chunks/instance.js.map +1 -1
- package/dist/ui/server/chunks/internal.js +1 -1
- package/dist/ui/server/entries/endpoints/api/sessions/_id_/_server.ts.js +13 -0
- package/dist/ui/server/entries/endpoints/api/sessions/_id_/_server.ts.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js +8 -1
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js +36 -63
- package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/_page.svelte.js +93 -5
- package/dist/ui/server/entries/pages/_page.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/settings/_page.svelte.js +29 -3
- package/dist/ui/server/entries/pages/settings/_page.svelte.js.map +1 -1
- package/dist/ui/server/manifest-full.js +8 -1
- package/dist/ui/server/manifest.js +8 -1
- package/dist/ui/server/nodes/0.js +2 -2
- package/dist/ui/server/nodes/1.js +1 -1
- package/dist/ui/server/nodes/2.js +2 -2
- package/dist/ui/server/nodes/3.js +2 -2
- package/dist/ui/server/nodes/4.js +1 -1
- package/dist/ui/server/server.js +8 -1
- package/package.json +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/0.B2ZWH0rX.css +0 -1
- package/dist/ui/client/ui/_app/immutable/assets/0.B2ZWH0rX.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/0.B2ZWH0rX.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.CtITS5jU.css +0 -1
- package/dist/ui/client/ui/_app/immutable/assets/2.CtITS5jU.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.CtITS5jU.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js.br +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js +0 -3
- package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js.br +0 -2
- package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js +0 -3
- package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/w6UAqFO5.js +0 -37
- package/dist/ui/client/ui/_app/immutable/chunks/w6UAqFO5.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/w6UAqFO5.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.COo3YJBG.js +0 -2
- package/dist/ui/client/ui/_app/immutable/entry/app.COo3YJBG.js.br +0 -2
- package/dist/ui/client/ui/_app/immutable/entry/app.COo3YJBG.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js +0 -2
- package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.BKE0tKKK.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/0.BKE0tKKK.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.BKE0tKKK.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.BCy3UgNz.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.BCy3UgNz.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js.gz +0 -0
- package/dist/ui/server/_app/immutable/assets/_layout.B2ZWH0rX.css +0 -1
- package/dist/ui/server/_app/immutable/assets/_page.CtITS5jU.css +0 -1
|
@@ -2122,7 +2122,7 @@ function is_prerendering(state) {
|
|
|
2122
2122
|
* @param {Response} response
|
|
2123
2123
|
*/
|
|
2124
2124
|
function with_version_header(response) {
|
|
2125
|
-
response.headers.set("x-sveltekit-version", "
|
|
2125
|
+
response.headers.set("x-sveltekit-version", "1795270127730");
|
|
2126
2126
|
return response;
|
|
2127
2127
|
}
|
|
2128
2128
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as error } from "../../../../../chunks/exports.js";
|
|
2
|
+
import { t as bridgeApiFromEnv } from "../../../../../chunks/bridge-api.js";
|
|
3
|
+
// src/routes/api/sessions/[id]/+server.ts
|
|
4
|
+
/** Deletes an ended session and its speech (the bridge refuses the current one). */
|
|
5
|
+
var DELETE = async ({ params, fetch }) => {
|
|
6
|
+
const id = Number(params.id);
|
|
7
|
+
if (!/^\d+$/.test(params.id) || !Number.isSafeInteger(id) || id < 1) error(400, "The session id must be a positive integer");
|
|
8
|
+
await bridgeApiFromEnv(fetch).deleteSession(id);
|
|
9
|
+
return new Response(null, { status: 204 });
|
|
10
|
+
};
|
|
11
|
+
export { DELETE };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=_server.ts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_server.ts.js","names":[],"sources":["../../../../../../../src/routes/api/sessions/[id]/+server.ts"],"sourcesContent":["import { error } from '@sveltejs/kit';\nimport { bridgeApiFromEnv } from '#lib/server/bridge-api.js';\nimport type { RequestHandler } from './$types';\n\n/** Deletes an ended session and its speech (the bridge refuses the current one). */\nexport const DELETE: RequestHandler = async ({ params, fetch }) => {\n const id = Number(params.id);\n if (!/^\\d+$/.test(params.id) || !Number.isSafeInteger(id) || id < 1) {\n error(400, 'The session id must be a positive integer');\n }\n await bridgeApiFromEnv(fetch).deleteSession(id);\n return new Response(null, { status: 204 });\n};\n"],"mappings":";;;;AAKA,IAAa,SAAyB,OAAO,EAAE,QAAQ,YAAY;CACjE,MAAM,KAAK,OAAO,OAAO,EAAE;CAC3B,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE,KAAK,CAAC,OAAO,cAAc,EAAE,KAAK,KAAK,GAChE,MAAM,KAAK,2CAA2C;CAExD,MAAM,iBAAiB,KAAK,CAAC,CAAC,cAAc,EAAE;CAC9C,OAAO,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC;AAC3C"}
|
|
@@ -16,6 +16,13 @@ var GET = async ({ url, fetch }) => {
|
|
|
16
16
|
const limit = intParam(url.searchParams.get("limit"), API_LIMITS.list.default, API_LIMITS.list.max);
|
|
17
17
|
return json(await bridgeApiFromEnv(fetch).speech(session, since, limit));
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
/** Clears the speech of the current session or of `none` (`?session=<id|none>`); it keeps running. */
|
|
20
|
+
var DELETE = async ({ url, fetch }) => {
|
|
21
|
+
const session = url.searchParams.get("session");
|
|
22
|
+
if (session === null || session !== "none" && !/^[1-9]\d*$/.test(session)) error(400, "session must be a session id or \"none\"");
|
|
23
|
+
await bridgeApiFromEnv(fetch).clearSpeech(session);
|
|
24
|
+
return new Response(null, { status: 204 });
|
|
25
|
+
};
|
|
26
|
+
export { DELETE, GET };
|
|
20
27
|
|
|
21
28
|
//# sourceMappingURL=_server.ts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts.js","names":[],"sources":["../../../../../../src/routes/api/speech/+server.ts"],"sourcesContent":["import { error, json } from '@sveltejs/kit';\nimport { API_LIMITS } from '@screenreader-speech-capture/shared';\nimport { bridgeApiFromEnv } from '#lib/server/bridge-api.js';\nimport type { RequestHandler } from './$types';\n\nfunction intParam(value: string | null, fallback: number, max: number): number {\n if (value === null) return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed) || parsed < 0 || parsed > max) {\n error(400, `Expected a whole number from 0 to ${max}, got \"${value}\"`);\n }\n return parsed;\n}\n\n/** One page of a scope's speech (`?session=<id|none>&since=<seq>&limit=<n>`), oldest first. */\nexport const GET: RequestHandler = async ({ url, fetch }) => {\n const session = url.searchParams.get('session');\n if (session !== null && session !== 'none' && !/^\\d+$/.test(session)) {\n error(400, 'session must be an id or \"none\"');\n }\n const since = intParam(url.searchParams.get('since'), 0, Number.MAX_SAFE_INTEGER);\n const limit = intParam(\n url.searchParams.get('limit'),\n API_LIMITS.list.default,\n API_LIMITS.list.max,\n );\n return json(await bridgeApiFromEnv(fetch).speech(session, since, limit));\n};\n"],"mappings":";;;;AAKA,SAAS,SAAS,OAAsB,UAAkB,KAAqB;CAC7E,IAAI,UAAU,MAAM,OAAO;CAC3B,MAAM,SAAS,OAAO,KAAK;CAC3B,IAAI,CAAC,OAAO,UAAU,MAAM,KAAK,SAAS,KAAK,SAAS,KACtD,MAAM,KAAK,qCAAqC,IAAI,SAAS,MAAM,EAAE;CAEvE,OAAO;AACT;;AAGA,IAAa,MAAsB,OAAO,EAAE,KAAK,YAAY;CAC3D,MAAM,UAAU,IAAI,aAAa,IAAI,SAAS;CAC9C,IAAI,YAAY,QAAQ,YAAY,UAAU,CAAC,QAAQ,KAAK,OAAO,GACjE,MAAM,KAAK,mCAAiC;CAE9C,MAAM,QAAQ,SAAS,IAAI,aAAa,IAAI,OAAO,GAAG,GAAG,OAAO,gBAAgB;CAChF,MAAM,QAAQ,SACZ,IAAI,aAAa,IAAI,OAAO,GAC5B,WAAW,KAAK,SAChB,WAAW,KAAK,GAClB;CACA,OAAO,KAAK,MAAM,iBAAiB,KAAK,CAAC,CAAC,OAAO,SAAS,OAAO,KAAK,CAAC;AACzE"}
|
|
1
|
+
{"version":3,"file":"_server.ts.js","names":[],"sources":["../../../../../../src/routes/api/speech/+server.ts"],"sourcesContent":["import { error, json } from '@sveltejs/kit';\nimport { API_LIMITS } from '@screenreader-speech-capture/shared';\nimport { bridgeApiFromEnv } from '#lib/server/bridge-api.js';\nimport type { RequestHandler } from './$types';\n\nfunction intParam(value: string | null, fallback: number, max: number): number {\n if (value === null) return fallback;\n const parsed = Number(value);\n if (!Number.isInteger(parsed) || parsed < 0 || parsed > max) {\n error(400, `Expected a whole number from 0 to ${max}, got \"${value}\"`);\n }\n return parsed;\n}\n\n/** One page of a scope's speech (`?session=<id|none>&since=<seq>&limit=<n>`), oldest first. */\nexport const GET: RequestHandler = async ({ url, fetch }) => {\n const session = url.searchParams.get('session');\n if (session !== null && session !== 'none' && !/^\\d+$/.test(session)) {\n error(400, 'session must be an id or \"none\"');\n }\n const since = intParam(url.searchParams.get('since'), 0, Number.MAX_SAFE_INTEGER);\n const limit = intParam(\n url.searchParams.get('limit'),\n API_LIMITS.list.default,\n API_LIMITS.list.max,\n );\n return json(await bridgeApiFromEnv(fetch).speech(session, since, limit));\n};\n\n/** Clears the speech of the current session or of `none` (`?session=<id|none>`); it keeps running. */\nexport const DELETE: RequestHandler = async ({ url, fetch }) => {\n const session = url.searchParams.get('session');\n if (session === null || (session !== 'none' && !/^[1-9]\\d*$/.test(session))) {\n error(400, 'session must be a session id or \"none\"');\n }\n await bridgeApiFromEnv(fetch).clearSpeech(session);\n return new Response(null, { status: 204 });\n};\n"],"mappings":";;;;AAKA,SAAS,SAAS,OAAsB,UAAkB,KAAqB;CAC7E,IAAI,UAAU,MAAM,OAAO;CAC3B,MAAM,SAAS,OAAO,KAAK;CAC3B,IAAI,CAAC,OAAO,UAAU,MAAM,KAAK,SAAS,KAAK,SAAS,KACtD,MAAM,KAAK,qCAAqC,IAAI,SAAS,MAAM,EAAE;CAEvE,OAAO;AACT;;AAGA,IAAa,MAAsB,OAAO,EAAE,KAAK,YAAY;CAC3D,MAAM,UAAU,IAAI,aAAa,IAAI,SAAS;CAC9C,IAAI,YAAY,QAAQ,YAAY,UAAU,CAAC,QAAQ,KAAK,OAAO,GACjE,MAAM,KAAK,mCAAiC;CAE9C,MAAM,QAAQ,SAAS,IAAI,aAAa,IAAI,OAAO,GAAG,GAAG,OAAO,gBAAgB;CAChF,MAAM,QAAQ,SACZ,IAAI,aAAa,IAAI,OAAO,GAC5B,WAAW,KAAK,SAChB,WAAW,KAAK,GAClB;CACA,OAAO,KAAK,MAAM,iBAAiB,KAAK,CAAC,CAAC,OAAO,SAAS,OAAO,KAAK,CAAC;AACzE;;AAGA,IAAa,SAAyB,OAAO,EAAE,KAAK,YAAY;CAC9D,MAAM,UAAU,IAAI,aAAa,IAAI,SAAS;CAC9C,IAAI,YAAY,QAAS,YAAY,UAAU,CAAC,aAAa,KAAK,OAAO,GACvE,MAAM,KAAK,0CAAwC;CAErD,MAAM,iBAAiB,KAAK,CAAC,CAAC,YAAY,OAAO;CACjD,OAAO,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC;AAC3C"}
|
|
@@ -2,20 +2,26 @@ import { mt as resolve } from "../../chunks/internal.js";
|
|
|
2
2
|
import { a as head, f as escape_html, i as ensure_array_like, l as attr, r as derived, s as stringify, t as attr_class, u as clsx } from "../../chunks/server2.js";
|
|
3
3
|
import { t as page } from "../../chunks/state.js";
|
|
4
4
|
import { i as statusStore } from "../../chunks/composition.js";
|
|
5
|
+
import "../../chunks/icon-button.js";
|
|
5
6
|
// src/lib/assets/favicon.svg
|
|
6
7
|
var favicon_default = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
7
8
|
// ../../node_modules/.pnpm/@fontsource+material-symbols-outlined@5.3.9/node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url
|
|
8
9
|
var material_symbols_outlined_latin_400_normal_default = "/ui/_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2";
|
|
9
10
|
// src/lib/components/StatusChips/StatusChips.svelte
|
|
10
11
|
function StatusChips($$renderer, $$props) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
$$renderer.component(($$renderer) => {
|
|
13
|
+
let { chips, announcement } = $$props;
|
|
14
|
+
if (chips.length > 0) {
|
|
15
|
+
$$renderer.push(`<!--[0--><ul aria-label="Bridge status" class="svelte-19wvxlf"><!--[-->`);
|
|
16
|
+
const each_array = ensure_array_like(chips);
|
|
17
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
18
|
+
let chip = each_array[$$index];
|
|
19
|
+
$$renderer.push(`<li${attr_class(clsx(chip.tone), "svelte-19wvxlf", { "down": chip.down })}${attr("aria-label", chip.description)}${attr("title", chip.text)}><span${attr_class(`dot ${stringify(chip.dot)}`, "svelte-19wvxlf")} aria-hidden="true"></span> <span aria-hidden="true" class="chip-label svelte-19wvxlf">${escape_html(chip.text)}</span></li>`);
|
|
20
|
+
}
|
|
21
|
+
$$renderer.push(`<!--]--></ul>`);
|
|
22
|
+
} else $$renderer.push("<!--[-1-->");
|
|
23
|
+
$$renderer.push(`<!--]--> <span class="sr-only svelte-19wvxlf" role="status">${escape_html(announcement)}</span>`);
|
|
24
|
+
});
|
|
19
25
|
}
|
|
20
26
|
// src/lib/components/StatusRefresh/StatusRefresh.svelte
|
|
21
27
|
function StatusRefresh($$renderer, $$props) {
|
|
@@ -23,32 +29,20 @@ function StatusRefresh($$renderer, $$props) {
|
|
|
23
29
|
$$renderer.push(`<md-icon-button title="Refresh status" class="svelte-5q7qd7"><md-icon${attr_class("svelte-5q7qd7", void 0, { "spin": loading })}>refresh</md-icon></md-icon-button>`);
|
|
24
30
|
}
|
|
25
31
|
// src/lib/core/status.ts
|
|
32
|
+
/**
|
|
33
|
+
* Only what needs a look: a service that is not running (not enabled) has no chip, and the session
|
|
34
|
+
* is the sessions pane's business. An unreachable bridge is a chip of its own.
|
|
35
|
+
*/
|
|
26
36
|
function deriveChips(status, reachable) {
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
];
|
|
37
|
-
return reachable ? chips : chips.map((chip) => ({
|
|
38
|
-
...chip,
|
|
39
|
-
tone: "neutral",
|
|
40
|
-
down: true
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
function neutral(id, text) {
|
|
44
|
-
return {
|
|
45
|
-
id,
|
|
46
|
-
text,
|
|
47
|
-
tone: "neutral",
|
|
48
|
-
dot: "hollow",
|
|
49
|
-
description: `${text}, state unknown`,
|
|
50
|
-
down: true
|
|
51
|
-
};
|
|
37
|
+
if (!reachable) return [{
|
|
38
|
+
id: "bridge",
|
|
39
|
+
text: "Bridge unreachable",
|
|
40
|
+
tone: "error",
|
|
41
|
+
dot: "filled",
|
|
42
|
+
description: "Bridge unreachable"
|
|
43
|
+
}];
|
|
44
|
+
if (status === null) return [];
|
|
45
|
+
return [serviceChip("playwright", "Playwright", status.playwright), serviceChip("mcp", "MCP", status.mcp)].filter((chip) => chip !== null);
|
|
52
46
|
}
|
|
53
47
|
function serviceChip(id, name, service) {
|
|
54
48
|
const base = `${name} ${service.version}`;
|
|
@@ -76,33 +70,9 @@ function serviceChip(id, name, service) {
|
|
|
76
70
|
description: `${base}, starting`,
|
|
77
71
|
down: true
|
|
78
72
|
};
|
|
79
|
-
case "stopped": return
|
|
80
|
-
id,
|
|
81
|
-
text: base,
|
|
82
|
-
tone: "neutral",
|
|
83
|
-
dot: "hollow",
|
|
84
|
-
description: `${base}, stopped`,
|
|
85
|
-
down: true
|
|
86
|
-
};
|
|
73
|
+
case "stopped": return null;
|
|
87
74
|
}
|
|
88
75
|
}
|
|
89
|
-
function sessionChip({ session }) {
|
|
90
|
-
if (session.current === null) return {
|
|
91
|
-
id: "session",
|
|
92
|
-
text: "No session",
|
|
93
|
-
tone: "neutral",
|
|
94
|
-
dot: "hollow",
|
|
95
|
-
description: "No session is running"
|
|
96
|
-
};
|
|
97
|
-
const text = `Session #${session.current.id}`;
|
|
98
|
-
return {
|
|
99
|
-
id: "session",
|
|
100
|
-
text,
|
|
101
|
-
tone: "ok",
|
|
102
|
-
dot: "filled",
|
|
103
|
-
description: `${text}, live`
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
76
|
/**
|
|
107
77
|
* The words a screen reader gets when the state changes. Empty while everything is fine, so the
|
|
108
78
|
* regular refresh never speaks.
|
|
@@ -122,11 +92,14 @@ function BridgeStatus($$renderer, $$props) {
|
|
|
122
92
|
announcement: announcement(chips(), statusStore.reachable)
|
|
123
93
|
});
|
|
124
94
|
$$renderer.push(`<!----> `);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
95
|
+
if (!statusStore.reachable) {
|
|
96
|
+
$$renderer.push("<!--[0-->");
|
|
97
|
+
StatusRefresh($$renderer, {
|
|
98
|
+
loading: statusStore.loading,
|
|
99
|
+
onRetry: () => void statusStore.retry()
|
|
100
|
+
});
|
|
101
|
+
} else $$renderer.push("<!--[-1-->");
|
|
102
|
+
$$renderer.push(`<!--]-->`);
|
|
130
103
|
});
|
|
131
104
|
}
|
|
132
105
|
// src/lib/components/AppHeader/AppHeader.svelte
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_layout.svelte.js","names":["$.ensure_array_like","$.attr_class","$.clsx","$.attr","$.stringify","$.escape","$.attr_class","$.derived","$.escape","$.ensure_array_like","$.attr","$.attr_class","$.escape","$.attr","favicon","iconFont"],"sources":["../../../../src/lib/assets/favicon.svg","../../../../../../node_modules/.pnpm/@fontsource+material-symbols-outlined@5.3.9/node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url","../../../../src/lib/components/StatusChips/StatusChips.svelte","../../../../src/lib/components/StatusRefresh/StatusRefresh.svelte","../../../../src/lib/adapters/icon-font.ts","../../../../src/lib/core/status.ts","../../../../src/lib/components/BridgeStatus/BridgeStatus.svelte","../../../../src/lib/components/AppHeader/AppHeader.svelte","../../../../src/lib/core/navigation.ts","../../../../src/lib/components/NavRail/NavRail.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_VRAku6fjghkApIISiBWPzg","<script lang=\"ts\">\n import type { Chip } from '#lib/core/status.js';\n\n type Props = { chips: Chip[]; announcement: string };\n\n let { chips, announcement }: Props = $props();\n</script>\n\n<ul aria-label=\"Bridge status\">\n {#each chips as chip (chip.id)}\n <li class={chip.tone} class:down={chip.down} aria-label={chip.description} title={chip.text}>\n <span class=\"dot {chip.dot}\" aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\" class=\"chip-label\">{chip.text}</span>\n </li>\n {/each}\n</ul>\n<!-- Only changes of a problem state speak; a refresh leaves this text as it is. -->\n<span class=\"sr-only\" role=\"status\">{announcement}</span>\n\n<style>\n ul {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n height: 32px;\n padding: 0 12px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 8px;\n background: var(--md-sys-color-surface-container-lowest, transparent);\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n white-space: nowrap;\n }\n\n li.ok {\n --dot: var(--app-success);\n }\n li.warning {\n --dot: var(--app-warning);\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n border-color: var(--app-warning);\n }\n li.error {\n --dot: var(--md-sys-color-error);\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n border-color: var(--md-sys-color-error);\n }\n li.neutral {\n --dot: var(--md-sys-color-outline);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n li.down {\n --dot: var(--md-sys-color-error);\n }\n\n .dot {\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--dot);\n border: 2px solid var(--dot);\n }\n .dot.hollow {\n background: transparent;\n }\n\n /* On a narrow screen only the dot stays; the chip's aria-label still says what it is. */\n @media (width < 800px) {\n .chip-label {\n display: none;\n }\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n\n type Props = { loading: boolean; onRetry: () => void };\n\n let { loading, onRetry }: Props = $props();\n</script>\n\n<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n<!-- md-icon-button wraps a real <button> in its shadow DOM, which handles keys and role. -->\n<md-icon-button title=\"Refresh status\" onclick={onRetry}>\n <md-icon class:spin={loading}>refresh</md-icon>\n</md-icon-button>\n\n<style>\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n }\n\n .spin {\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n</style>\n","const ICON_FONT = '24px \"Material Symbols Outlined\"';\n\n/**\n * Loads the icon font and then sets `data-icons-ready` on `<html>`, which ends the placeholder\n * shimmer in `global.css`. If loading fails the icons show anyway rather than shimmer forever.\n */\nexport async function markIconFontReady(): Promise<void> {\n try {\n await document.fonts.load(ICON_FONT);\n } catch {\n // fall through: show the icons\n }\n document.documentElement.setAttribute('data-icons-ready', '');\n}\n","import type { ServiceStatusDto, StatusDto } from '@screenreader-speech-capture/shared';\n\n/** Where the status comes from (the HTTP adapter asks the BFF, which asks the bridge). */\nexport interface StatusApi {\n fetch(): Promise<StatusDto>;\n}\n\nexport type ChipId = 'playwright' | 'mcp' | 'session';\nexport type ChipTone = 'ok' | 'error' | 'warning' | 'neutral';\n\nexport type Chip = {\n id: ChipId;\n /** What the chip shows. */\n text: string;\n tone: ChipTone;\n /** A hollow dot means \"nothing there yet\"; a filled one means \"there is state\". */\n dot: 'filled' | 'hollow';\n /** Spoken name of the state, so it is never colour alone. */\n description: string;\n /** Not connected or not ready: the dot is red while the chip itself stays neutral. */\n down?: boolean;\n};\n\nexport function deriveChips(status: StatusDto | null, reachable: boolean): Chip[] {\n if (status === null) {\n return [\n neutral('playwright', 'Playwright'),\n neutral('mcp', 'MCP'),\n neutral('session', 'Session'),\n ];\n }\n const chips = [\n serviceChip('playwright', 'Playwright', status.playwright),\n serviceChip('mcp', 'MCP', status.mcp),\n sessionChip(status),\n ];\n // The last known values stay visible, but they are no longer a statement about now.\n return reachable\n ? chips\n : chips.map((chip) => ({ ...chip, tone: 'neutral' as const, down: true }));\n}\n\nfunction neutral(id: ChipId, text: string): Chip {\n return {\n id,\n text,\n tone: 'neutral',\n dot: 'hollow',\n description: `${text}, state unknown`,\n down: true,\n };\n}\n\nfunction serviceChip(id: ChipId, name: string, service: ServiceStatusDto): Chip {\n const base = `${name} ${service.version}`;\n switch (service.state) {\n case 'running':\n return { id, text: base, tone: 'ok', dot: 'filled', description: `${base}, running` };\n case 'crashed':\n case 'failed':\n return {\n id,\n text: `${base} · ${service.state}`,\n tone: 'warning',\n dot: 'filled',\n description: `${base}, ${service.state}`,\n };\n case 'starting':\n return {\n id,\n text: base,\n tone: 'neutral',\n dot: 'hollow',\n description: `${base}, starting`,\n down: true,\n };\n case 'stopped':\n return {\n id,\n text: base,\n tone: 'neutral',\n dot: 'hollow',\n description: `${base}, stopped`,\n down: true,\n };\n }\n}\n\nfunction sessionChip({ session }: StatusDto): Chip {\n if (session.current === null) {\n return {\n id: 'session',\n text: 'No session',\n tone: 'neutral',\n dot: 'hollow',\n description: 'No session is running',\n };\n }\n const text = `Session #${session.current.id}`;\n return { id: 'session', text, tone: 'ok', dot: 'filled', description: `${text}, live` };\n}\n\n/**\n * The words a screen reader gets when the state changes. Empty while everything is fine, so the\n * regular refresh never speaks.\n */\nexport function announcement(chips: Chip[], reachable: boolean): string {\n if (!reachable) return 'Bridge unreachable.';\n return chips\n .filter((chip) => chip.tone === 'error' || chip.tone === 'warning')\n .map((chip) => `${chip.description}.`)\n .join(' ');\n}\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import StatusChips from '#lib/components/StatusChips/StatusChips.svelte';\n import StatusRefresh from '#lib/components/StatusRefresh/StatusRefresh.svelte';\n import { statusStore } from '#lib/composition.js';\n import { announcement, deriveChips } from '#lib/core/status.js';\n import type { StatusDto } from '@screenreader-speech-capture/shared';\n\n // The status the server rendered (`+layout.server.ts`); it fills in until the store has its own.\n const seed = $derived(page.data.status as StatusDto | null);\n const status = $derived(statusStore.status ?? seed);\n const chips = $derived(deriveChips(status, statusStore.reachable));\n\n onMount(() => statusStore.init(seed));\n</script>\n\n<StatusChips {chips} announcement={announcement(chips, statusStore.reachable)} />\n<StatusRefresh loading={statusStore.loading} onRetry={() => void statusStore.retry()} />\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n import BridgeStatus from '#lib/components/BridgeStatus/BridgeStatus.svelte';\n\n type Props = {\n host: string;\n };\n\n let { host }: Props = $props();\n</script>\n\n<header>\n <div class=\"logo-slot\">\n <div class=\"logo\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"><path d=\"M4 10v4M8 6v12M12 3v18M16 8v8M20 11v2\" /></svg\n >\n </div>\n </div>\n <div class=\"title\">\n <span class=\"name\">Speech Capture</span>\n <span class=\"meta\">{host}</span>\n </div>\n <BridgeStatus />\n</header>\n\n<style>\n header {\n display: flex;\n align-items: center;\n gap: 12px 16px;\n min-height: 68px;\n padding: 10px 16px 10px 0;\n background: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n }\n\n /* As wide as the navigation rail, so the logo sits centered over it. */\n .logo-slot {\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--app-rail-width);\n }\n\n .logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 14px;\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .title {\n display: flex;\n flex-direction: column;\n min-width: 0;\n margin-right: auto;\n }\n\n header {\n flex-wrap: wrap;\n }\n\n .name {\n font-family: var(--md-sys-typescale-title-large-font);\n font-size: var(--md-sys-typescale-title-large-size);\n line-height: var(--md-sys-typescale-title-large-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n\n .meta {\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-pressed-icon-color: var(--md-sys-color-on-surface);\n }\n</style>\n","export type NavItem = {\n href: string;\n label: string;\n icon: string;\n /** Only the exact path is current (the start page); otherwise its sub-paths count too. */\n exact?: boolean;\n};\n\nconst trimSlash = (path: string): string => (path.length > 1 ? path.replace(/\\/+$/, '') : path);\n\n/** Whether `href` is the page shown at `currentPath` (a trailing slash doesn't matter). */\nexport function isCurrent(item: Pick<NavItem, 'href' | 'exact'>, currentPath: string): boolean {\n const href = trimSlash(item.href);\n const path = trimSlash(currentPath);\n return item.exact ? path === href : path === href || path.startsWith(`${href}/`);\n}\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import { isCurrent, type NavItem } from '#lib/core/navigation.js';\n\n type Props = { items: NavItem[]; currentPath: string };\n\n let { items, currentPath }: Props = $props();\n</script>\n\n<nav aria-label=\"Pages\">\n <ul>\n {#each items as item (item.href)}\n {@const current = isCurrent(item, currentPath)}\n <li>\n <!-- The layout passes hrefs it built with resolve(). -->\n <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->\n <a href={item.href} aria-current={current ? 'page' : undefined}>\n <span class=\"indicator\" class:current><md-icon>{item.icon}</md-icon></span>\n <span class=\"label\">{item.label}</span>\n </a>\n </li>\n {/each}\n </ul>\n</nav>\n\n<style>\n nav {\n flex: none;\n width: var(--app-rail-width);\n padding: var(--app-gutter) 0;\n background: var(--md-sys-color-surface);\n }\n\n ul {\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n a {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n min-height: 48px;\n color: var(--md-sys-color-on-surface-variant);\n text-decoration: none;\n }\n\n .indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 32px;\n border-radius: 16px;\n }\n\n .indicator.current {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n a:hover .indicator:not(.current) {\n background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);\n }\n\n a[aria-current='page'] {\n color: var(--md-sys-color-on-surface);\n }\n\n .label {\n font-family: var(--md-sys-typescale-label-medium-font);\n font-size: var(--md-sys-typescale-label-medium-size);\n line-height: var(--md-sys-typescale-label-medium-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { resolve } from '$app/paths';\n import { page } from '$app/state';\n import favicon from '#lib/assets/favicon.svg';\n import iconFont from '@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url';\n import AppHeader from '#lib/components/AppHeader/AppHeader.svelte';\n import NavRail from '#lib/components/NavRail/NavRail.svelte';\n import { markIconFontReady, themeStore } from '#lib/composition.js';\n import type { NavItem } from '#lib/core/navigation.js';\n import '#lib/styles/fonts.css';\n import '#lib/styles/tokens.css';\n import '#lib/styles/global.css';\n import type { LayoutProps } from './$types';\n\n let { children }: LayoutProps = $props();\n\n const navItems: NavItem[] = [\n { href: resolve('/'), label: 'Monitor', icon: 'monitor', exact: true },\n { href: resolve('/settings'), label: 'Settings', icon: 'settings' },\n { href: resolve('/setup'), label: 'Setup', icon: 'build' },\n ];\n\n onMount(() => {\n themeStore.init();\n void markIconFontReady();\n });\n</script>\n\n<svelte:head>\n <link rel=\"icon\" href={favicon} />\n <link rel=\"preload\" as=\"font\" type=\"font/woff2\" href={iconFont} crossorigin=\"anonymous\" />\n <meta name=\"color-scheme\" content=\"light dark\" />\n</svelte:head>\n\n<div class=\"app\">\n <AppHeader host={page.url.host} />\n\n <div class=\"body\">\n <NavRail items={navItems} currentPath={page.url.pathname} />\n <main>\n {@render children()}\n </main>\n </div>\n</div>\n\n<style>\n /* The window height is fixed, so a page can fill what is left below the header (which grows\n when its chips wrap). */\n .app {\n display: flex;\n flex-direction: column;\n height: 100dvh;\n }\n\n .body {\n display: flex;\n flex: 1;\n align-items: stretch;\n min-height: 0;\n }\n\n main {\n flex: 1;\n min-width: 0;\n min-height: 0;\n padding: 0 16px;\n overflow: auto;\n }\n</style>\n"],"ignoreList":[1],"mappings":";;;;;AAAA,IAAA,kBAAe;;ACAf,IAAA,qDAAe;;ACAf,SAAA,YAAA,YAAA,SAAA;CAKE,IAAI,EAAE,OAAO,iBAAqB;;CAI3B,MAAA,aAAAA,kBAAA,KAAK;;EAAI,IAAA,OAAI,WAAA;EACP,WAAA,KAAA,MAAAC,WAAAC,KAAA,KAAK,IAAI,GAAA,kBAAA,EAAA,QAAc,KAAK,KAAI,CAAA,IAAAC,KAAA,cAAc,KAAK,WAAW,IAAAA,KAAA,SAAS,KAAK,IAAI,EAAA,QAAAF,WAAA,OAAAG,UACvE,KAAK,GAAG,KAAA,gBAAA,EAAA,yFAAAC,YACmB,KAAK,IAAI,EAAA,aAAA;;CAKvB,WAAA,KAAA,oEAAAA,YAAA,YAAY,EAAA,QAAA;AAXzC;;ACNR,SAAA,cAAA,YAAA,SAAA;CAME,IAAI,EAAE,SAAS,YAAgB;CAMV,WAAA,KAAA,wEAAAC,WAAA,iBAAA,KAAA,GAAA,EAAA,QAAA,QAAO,CAAA,EAAA,oCAAA;AALtB;;AEgBR,SAAgB,YAAY,QAA0B,WAA4B;CAChF,IAAI,WAAW,MACb,OAAO;EACL,QAAQ,cAAc,YAA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DAAAA,YACpC,KAAK,KAAK,EAAA,iBAAA;;;CAXjC,CAAA;;;;CCPR,WAAA,WAAA,eAAA;EAeE,IAAI,EAAE,aAAuB;EAE7B,MAAM,WAAsB;GAC1B;IAAE,MAAM,QAAQ,GAAG;IAAG,OAAO;IAAW,MAAM;IAAW,OAAO;GAAM;GACtE;IAAE,MAAM,QAAQ,WAAW;IAAG,OAAO;IAAY,MAAM;GAAY;GACnE;IAAE,MAAM,QAAQ,QAAQ;IAAG,OAAO;IAAS,MAAM;GAAO;EACzD;;GASsB,WAAA,KAAA,mBAAAC,KAAA,QAAAC,eAAO,EAAA,oDAAAD,KAAA,QACwBE,kDAAQ,EAAA,4EAAA;;;EAK7C,UAAA,YAAA,EAAA,MAAA,KAAK,IAAI,KAAI,CAAA;;EAGZ,QAAA,YAAA;GAAA,OAAA;GAAQ,aAAe,KAAK,IAAI;EAAQ,CAAA;;EAE7C,SAAQ,UAAA;;CAdf,CAAA"}
|
|
1
|
+
{"version":3,"file":"_layout.svelte.js","names":["$.ensure_array_like","$.attr_class","$.clsx","$.attr","$.stringify","$.escape","$.attr_class","$.derived","$.escape","$.ensure_array_like","$.attr","$.attr_class","$.escape","$.attr","favicon","iconFont"],"sources":["../../../../src/lib/assets/favicon.svg","../../../../../../node_modules/.pnpm/@fontsource+material-symbols-outlined@5.3.9/node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url","../../../../src/lib/components/StatusChips/StatusChips.svelte","../../../../src/lib/components/StatusRefresh/StatusRefresh.svelte","../../../../src/lib/adapters/icon-font.ts","../../../../src/lib/core/status.ts","../../../../src/lib/components/BridgeStatus/BridgeStatus.svelte","../../../../src/lib/components/AppHeader/AppHeader.svelte","../../../../src/lib/core/navigation.ts","../../../../src/lib/components/NavRail/NavRail.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_VRAku6fjghkApIISiBWPzg","<script lang=\"ts\">\n import type { Chip } from '#lib/core/status.js';\n\n type Props = { chips: Chip[]; announcement: string };\n\n let { chips, announcement }: Props = $props();\n</script>\n\n{#if chips.length > 0}\n <ul aria-label=\"Bridge status\">\n {#each chips as chip (chip.id)}\n <li class={chip.tone} class:down={chip.down} aria-label={chip.description} title={chip.text}>\n <span class=\"dot {chip.dot}\" aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\" class=\"chip-label\">{chip.text}</span>\n </li>\n {/each}\n </ul>\n{/if}\n<!-- Only changes of a problem state speak; a refresh leaves this text as it is. -->\n<span class=\"sr-only\" role=\"status\">{announcement}</span>\n\n<style>\n ul {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n height: 32px;\n padding: 0 12px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-width: max(1px, var(--app-border-width));\n border-radius: 8px;\n background: var(--md-sys-color-surface-container-lowest, transparent);\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n white-space: nowrap;\n }\n\n li.ok {\n --dot: var(--app-success);\n }\n li.warning {\n --dot: var(--app-warning);\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n border-color: var(--app-warning);\n }\n li.error {\n --dot: var(--md-sys-color-error);\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n border-color: var(--md-sys-color-error);\n }\n li.neutral {\n --dot: var(--md-sys-color-outline);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n li.down {\n --dot: var(--md-sys-color-error);\n }\n\n .dot {\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--dot);\n border: 2px solid var(--dot);\n }\n .dot.hollow {\n background: transparent;\n }\n\n /* On a narrow screen only the dot stays; the chip's aria-label still says what it is. */\n @media (width < 800px) {\n .chip-label {\n display: none;\n }\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n\n type Props = { loading: boolean; onRetry: () => void };\n\n let { loading, onRetry }: Props = $props();\n</script>\n\n<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n<!-- md-icon-button wraps a real <button> in its shadow DOM, which handles keys and role. -->\n<md-icon-button title=\"Refresh status\" onclick={onRetry}>\n <md-icon class:spin={loading}>refresh</md-icon>\n</md-icon-button>\n\n<style>\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n }\n\n .spin {\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n</style>\n","const ICON_FONT = '24px \"Material Symbols Outlined\"';\n\n/**\n * Loads the icon font and then sets `data-icons-ready` on `<html>`, which ends the placeholder\n * shimmer in `global.css`. If loading fails the icons show anyway rather than shimmer forever.\n */\nexport async function markIconFontReady(): Promise<void> {\n try {\n await document.fonts.load(ICON_FONT);\n } catch {\n // fall through: show the icons\n }\n document.documentElement.setAttribute('data-icons-ready', '');\n}\n","import type { ServiceStatusDto, StatusDto } from '@screenreader-speech-capture/shared';\n\n/** Where the status comes from (the HTTP adapter asks the BFF, which asks the bridge). */\nexport interface StatusApi {\n fetch(): Promise<StatusDto>;\n}\n\nexport type ChipId = 'playwright' | 'mcp' | 'bridge';\nexport type ChipTone = 'ok' | 'error' | 'warning' | 'neutral';\n\nexport type Chip = {\n id: ChipId;\n /** What the chip shows. */\n text: string;\n tone: ChipTone;\n /** A hollow dot means \"nothing there yet\"; a filled one means \"there is state\". */\n dot: 'filled' | 'hollow';\n /** Spoken name of the state, so it is never colour alone. */\n description: string;\n /** Not connected or not ready: the dot is red while the chip itself stays neutral. */\n down?: boolean;\n};\n\n/**\n * Only what needs a look: a service that is not running (not enabled) has no chip, and the session\n * is the sessions pane's business. An unreachable bridge is a chip of its own.\n */\nexport function deriveChips(status: StatusDto | null, reachable: boolean): Chip[] {\n if (!reachable) {\n return [\n {\n id: 'bridge',\n text: 'Bridge unreachable',\n tone: 'error',\n dot: 'filled',\n description: 'Bridge unreachable',\n },\n ];\n }\n if (status === null) return [];\n return [\n serviceChip('playwright', 'Playwright', status.playwright),\n serviceChip('mcp', 'MCP', status.mcp),\n ].filter((chip): chip is Chip => chip !== null);\n}\n\nfunction serviceChip(id: ChipId, name: string, service: ServiceStatusDto): Chip | null {\n const base = `${name} ${service.version}`;\n switch (service.state) {\n case 'running':\n return { id, text: base, tone: 'ok', dot: 'filled', description: `${base}, running` };\n case 'crashed':\n case 'failed':\n return {\n id,\n text: `${base} · ${service.state}`,\n tone: 'warning',\n dot: 'filled',\n description: `${base}, ${service.state}`,\n };\n case 'starting':\n return {\n id,\n text: base,\n tone: 'neutral',\n dot: 'hollow',\n description: `${base}, starting`,\n down: true,\n };\n case 'stopped':\n return null;\n }\n}\n\n/**\n * The words a screen reader gets when the state changes. Empty while everything is fine, so the\n * regular refresh never speaks.\n */\nexport function announcement(chips: Chip[], reachable: boolean): string {\n if (!reachable) return 'Bridge unreachable.';\n return chips\n .filter((chip) => chip.tone === 'error' || chip.tone === 'warning')\n .map((chip) => `${chip.description}.`)\n .join(' ');\n}\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import StatusChips from '#lib/components/StatusChips/StatusChips.svelte';\n import StatusRefresh from '#lib/components/StatusRefresh/StatusRefresh.svelte';\n import { statusStore } from '#lib/composition.js';\n import { announcement, deriveChips } from '#lib/core/status.js';\n import type { StatusDto } from '@screenreader-speech-capture/shared';\n\n // The status the server rendered (`+layout.server.ts`); it fills in until the store has its own.\n const seed = $derived(page.data.status as StatusDto | null);\n const status = $derived(statusStore.status ?? seed);\n const chips = $derived(deriveChips(status, statusStore.reachable));\n\n onMount(() => statusStore.init(seed));\n</script>\n\n<StatusChips {chips} announcement={announcement(chips, statusStore.reachable)} />\n<!-- Status is read once, so the retry only shows when there is something to recover from. -->\n{#if !statusStore.reachable}\n <StatusRefresh loading={statusStore.loading} onRetry={() => void statusStore.retry()} />\n{/if}\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n import BridgeStatus from '#lib/components/BridgeStatus/BridgeStatus.svelte';\n\n type Props = {\n host: string;\n };\n\n let { host }: Props = $props();\n</script>\n\n<header>\n <div class=\"logo-slot\">\n <div class=\"logo\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"><path d=\"M4 10v4M8 6v12M12 3v18M16 8v8M20 11v2\" /></svg\n >\n </div>\n </div>\n <div class=\"title\">\n <span class=\"name\">Speech Capture</span>\n <span class=\"meta\">{host}</span>\n </div>\n <BridgeStatus />\n</header>\n\n<style>\n header {\n display: flex;\n align-items: center;\n gap: 12px 16px;\n min-height: 68px;\n padding: 10px 16px 10px 0;\n background: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n }\n\n /* As wide as the navigation rail, so the logo sits centered over it. */\n .logo-slot {\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--app-rail-width);\n }\n\n .logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 14px;\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .title {\n display: flex;\n flex-direction: column;\n min-width: 0;\n margin-right: auto;\n }\n\n header {\n flex-wrap: wrap;\n }\n\n .name {\n font-family: var(--md-sys-typescale-title-large-font);\n font-size: var(--md-sys-typescale-title-large-size);\n line-height: var(--md-sys-typescale-title-large-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n\n .meta {\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-pressed-icon-color: var(--md-sys-color-on-surface);\n }\n</style>\n","export type NavItem = {\n href: string;\n label: string;\n icon: string;\n /** Only the exact path is current (the start page); otherwise its sub-paths count too. */\n exact?: boolean;\n};\n\nconst trimSlash = (path: string): string => (path.length > 1 ? path.replace(/\\/+$/, '') : path);\n\n/** Whether `href` is the page shown at `currentPath` (a trailing slash doesn't matter). */\nexport function isCurrent(item: Pick<NavItem, 'href' | 'exact'>, currentPath: string): boolean {\n const href = trimSlash(item.href);\n const path = trimSlash(currentPath);\n return item.exact ? path === href : path === href || path.startsWith(`${href}/`);\n}\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import { isCurrent, type NavItem } from '#lib/core/navigation.js';\n\n type Props = { items: NavItem[]; currentPath: string };\n\n let { items, currentPath }: Props = $props();\n</script>\n\n<nav aria-label=\"Pages\">\n <ul>\n {#each items as item (item.href)}\n {@const current = isCurrent(item, currentPath)}\n <li>\n <!-- The layout passes hrefs it built with resolve(). -->\n <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->\n <a href={item.href} aria-current={current ? 'page' : undefined}>\n <span class=\"indicator\" class:current><md-icon>{item.icon}</md-icon></span>\n <span class=\"label\">{item.label}</span>\n </a>\n </li>\n {/each}\n </ul>\n</nav>\n\n<style>\n nav {\n flex: none;\n width: var(--app-rail-width);\n padding: var(--app-gutter) 0;\n background: var(--md-sys-color-surface);\n }\n\n ul {\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n a {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n min-height: 48px;\n color: var(--md-sys-color-on-surface-variant);\n text-decoration: none;\n }\n\n .indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 32px;\n border: var(--app-border-width) solid transparent;\n box-sizing: border-box;\n border-radius: 16px;\n }\n\n .indicator.current {\n border-color: var(--md-sys-color-outline);\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n a:hover .indicator:not(.current) {\n background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);\n }\n\n a[aria-current='page'] {\n color: var(--md-sys-color-on-surface);\n }\n\n .label {\n font-family: var(--md-sys-typescale-label-medium-font);\n font-size: var(--md-sys-typescale-label-medium-size);\n line-height: var(--md-sys-typescale-label-medium-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { resolve } from '$app/paths';\n import { page } from '$app/state';\n import favicon from '#lib/assets/favicon.svg';\n import iconFont from '@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url';\n import AppHeader from '#lib/components/AppHeader/AppHeader.svelte';\n import NavRail from '#lib/components/NavRail/NavRail.svelte';\n import { markIconFontReady, themeStore } from '#lib/composition.js';\n import type { NavItem } from '#lib/core/navigation.js';\n import '#lib/styles/fonts.css';\n import '#lib/styles/tokens.css';\n import '#lib/styles/global.css';\n import type { LayoutProps } from './$types';\n\n let { children }: LayoutProps = $props();\n\n const navItems: NavItem[] = [\n { href: resolve('/'), label: 'Monitor', icon: 'monitor', exact: true },\n { href: resolve('/settings'), label: 'Settings', icon: 'settings' },\n { href: resolve('/setup'), label: 'Setup', icon: 'build' },\n ];\n\n onMount(() => {\n themeStore.init();\n void markIconFontReady();\n });\n</script>\n\n<svelte:head>\n <link rel=\"icon\" href={favicon} />\n <link rel=\"preload\" as=\"font\" type=\"font/woff2\" href={iconFont} crossorigin=\"anonymous\" />\n <meta name=\"color-scheme\" content=\"light dark\" />\n</svelte:head>\n\n<div class=\"app\">\n <AppHeader host={page.url.host} />\n\n <div class=\"body\">\n <NavRail items={navItems} currentPath={page.url.pathname} />\n <main>\n {@render children()}\n </main>\n </div>\n</div>\n\n<style>\n /* The window height is fixed, so a page can fill what is left below the header (which grows\n when its chips wrap). */\n .app {\n display: flex;\n flex-direction: column;\n height: 100dvh;\n }\n\n .body {\n display: flex;\n flex: 1;\n align-items: stretch;\n min-height: 0;\n }\n\n main {\n flex: 1;\n min-width: 0;\n min-height: 0;\n padding: 0 16px;\n overflow: auto;\n }\n</style>\n"],"ignoreList":[1],"mappings":";;;;;;AAAA,IAAA,kBAAe;;ACAf,IAAA,qDAAe;;;CCAf,WAAA,WAAA,eAAA;EAKE,IAAI,EAAE,OAAO,iBAAqB;EAG/B,IAAA,MAAM,SAAS,GAAC;;GAEV,MAAA,aAAAA,kBAAA,KAAK;;IAAI,IAAA,OAAI,WAAA;IACP,WAAA,KAAA,MAAAC,WAAAC,KAAA,KAAK,IAAI,GAAA,kBAAA,EAAA,QAAc,KAAK,KAAI,CAAA,IAAAC,KAAA,cAAc,KAAK,WAAW,IAAAA,KAAA,SAAS,KAAK,IAAI,EAAA,QAAAF,WAAA,OAAAG,UACvE,KAAK,GAAG,KAAA,gBAAA,EAAA,yFAAAC,YACmB,KAAK,IAAI,EAAA,aAAA;;;;EAMzB,WAAA,KAAA,+DAAA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OAAO;GAAM;GACtE;IAAE,MAAM,QAAQ,WAAW;IAAG,OAAO;IAAY,MAAM;GAAY;GACnE;IAAE,MAAM,QAAQ,QAAQ;IAAG,OAAO;IAAS,MAAM;GAAO;EACzD;;GASsB,WAAA,KAAA,mBAAAC,KAAA,QAAAC,eAAO,EAAA,oDAAAD,KAAA,QACwBE,kDAAQ,EAAA,4EAAA;;;EAK7C,UAAA,YAAA,EAAA,MAAA,KAAK,IAAI,KAAI,CAAA;;EAGZ,QAAA,YAAA;GAAA,OAAA;GAAQ,aAAe,KAAK,IAAI;EAAQ,CAAA;;EAE7C,SAAQ,UAAA;;CAdf,CAAA"}
|
|
@@ -2,7 +2,8 @@ import { mt as resolve } from "../../chunks/internal.js";
|
|
|
2
2
|
import { f as escape_html, i as ensure_array_like, l as attr, n as attr_style, r as derived, t as attr_class, u as clsx } from "../../chunks/server2.js";
|
|
3
3
|
import { t as page } from "../../chunks/state.js";
|
|
4
4
|
import { n as goto } from "../../chunks/navigation.js";
|
|
5
|
-
import {
|
|
5
|
+
import { c as canDeleteSession, l as formatReceivedTime, n as sessionsStore, o as canAddMarker, r as speechStore, s as canClearSpeech, t as sessionsPaneStore, u as logHeading } from "../../chunks/composition.js";
|
|
6
|
+
import { C as n$2, E as __decorate, S as r$1, T as t$1, _ as E, a as mixinElementInternals, b as e$2, c as u$1, d as e$4, f as i$4, g as B, h as A, i as internals, l as EASING, m as i$2, n as getFormValue, o as mixinDelegatesAria, p as t$2, r as mixinFormAssociated, s as i$5, t as mixinFormSubmitter, u as e$3, v as T, w as i$3, x as e$1, y as Z } from "../../chunks/icon-button.js";
|
|
6
7
|
import { d as API_LIMITS } from "../../chunks/src.js";
|
|
7
8
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js
|
|
8
9
|
/**
|
|
@@ -1038,6 +1039,31 @@ styles$4.styleSheet;
|
|
|
1038
1039
|
var MdDialog = class MdDialog extends Dialog {};
|
|
1039
1040
|
MdDialog.styles = [styles$4];
|
|
1040
1041
|
MdDialog = __decorate([t$1("md-dialog")], MdDialog);
|
|
1042
|
+
// src/lib/components/SpeechLog/ClearSpeechDialog.svelte
|
|
1043
|
+
function ClearSpeechDialog($$renderer, $$props) {
|
|
1044
|
+
$$renderer.component(($$renderer) => {
|
|
1045
|
+
/** `#3 Checkout flow` */
|
|
1046
|
+
/** Rejects with a message to show; resolves when the speech is cleared. */
|
|
1047
|
+
let { open, heading, onClear, onClose } = $$props;
|
|
1048
|
+
let busy = false;
|
|
1049
|
+
$$renderer.push(`<md-dialog${attr("open", open, true)} class="svelte-qieqgw"><div slot="headline">Clear speech?</div> <div slot="content"><p class="svelte-qieqgw">The speech of <strong>${escape_html(heading)}</strong> is removed from the bridge. The session keeps running.
|
|
1050
|
+
This cannot be undone.</p> `);
|
|
1051
|
+
$$renderer.push("<!--[-1-->");
|
|
1052
|
+
$$renderer.push(`<!--]--></div> <div slot="actions"><md-text-button type="button">Cancel</md-text-button> <md-text-button type="button"${attr("disabled", busy, true)}>Clear</md-text-button></div></md-dialog>`);
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
// src/lib/components/SpeechLog/DeleteSessionDialog.svelte
|
|
1056
|
+
function DeleteSessionDialog($$renderer, $$props) {
|
|
1057
|
+
$$renderer.component(($$renderer) => {
|
|
1058
|
+
/** `#3 Checkout flow` */
|
|
1059
|
+
/** Rejects with a message to show; resolves when the session is deleted. */
|
|
1060
|
+
let { open, heading, onDelete, onClose } = $$props;
|
|
1061
|
+
let busy = false;
|
|
1062
|
+
$$renderer.push(`<md-dialog${attr("open", open, true)} class="svelte-1sof82u"><div slot="headline">Delete session?</div> <div slot="content"><p class="svelte-1sof82u"><strong>${escape_html(heading)}</strong> and its speech are removed from the bridge. This cannot be undone.</p> `);
|
|
1063
|
+
$$renderer.push("<!--[-1-->");
|
|
1064
|
+
$$renderer.push(`<!--]--></div> <div slot="actions"><md-text-button type="button">Cancel</md-text-button> <md-text-button type="button"${attr("disabled", busy, true)}>Delete</md-text-button></div></md-dialog>`);
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1041
1067
|
// ../../node_modules/.pnpm/@material+web@2.5.0/node_modules/@material/web/field/internal/field.js
|
|
1042
1068
|
/**
|
|
1043
1069
|
* @license
|
|
@@ -2551,11 +2577,27 @@ function SpeechLog($$renderer, $$props) {
|
|
|
2551
2577
|
/** Oldest first. */
|
|
2552
2578
|
/** Whether a marker added now shows up in this log (see `canAddMarker`). */
|
|
2553
2579
|
/** Rejects with a message to show; resolves when the marker is in. */
|
|
2554
|
-
|
|
2580
|
+
/** Whether the shown scope is an ended session that can be deleted (see `canDeleteSession`). */
|
|
2581
|
+
/** Whether the shown scope can be cleared: the current session, or the speech outside sessions. */
|
|
2582
|
+
/** Rejects with a message to show; resolves when the speech is cleared. */
|
|
2583
|
+
/** Rejects with a message to show; resolves when the session is deleted. */
|
|
2584
|
+
let { heading, entries, connection, canMark, onAddMarker, canDelete, onDelete, canClear, onClear } = $$props;
|
|
2555
2585
|
let markerOpen = false;
|
|
2586
|
+
let deleteOpen = false;
|
|
2587
|
+
let clearOpen = false;
|
|
2556
2588
|
$$renderer.push(`<section class="log svelte-1jnrixz" aria-labelledby="log-heading"><header class="svelte-1jnrixz"><h1 id="log-heading" class="trunc svelte-1jnrixz">${escape_html(heading)}</h1> `);
|
|
2557
|
-
if (canMark
|
|
2558
|
-
|
|
2589
|
+
if (canMark || canClear || canDelete) {
|
|
2590
|
+
$$renderer.push(`<!--[0--><div role="toolbar" aria-label="Log actions">`);
|
|
2591
|
+
if (canMark) $$renderer.push(`<!--[0--><md-icon-button title="Add marker" aria-label="Add marker"><md-icon aria-hidden="true">bookmark_add</md-icon></md-icon-button>`);
|
|
2592
|
+
else $$renderer.push("<!--[-1-->");
|
|
2593
|
+
$$renderer.push(`<!--]--> `);
|
|
2594
|
+
if (canClear) $$renderer.push(`<!--[0--><md-icon-button title="Clear speech" aria-label="Clear speech"${attr("disabled", entries.length === 0, true)}><md-icon aria-hidden="true">delete_sweep</md-icon></md-icon-button>`);
|
|
2595
|
+
else $$renderer.push("<!--[-1-->");
|
|
2596
|
+
$$renderer.push(`<!--]--> `);
|
|
2597
|
+
if (canDelete) $$renderer.push(`<!--[0--><md-icon-button title="Delete session" aria-label="Delete session"><md-icon aria-hidden="true">delete</md-icon></md-icon-button>`);
|
|
2598
|
+
else $$renderer.push("<!--[-1-->");
|
|
2599
|
+
$$renderer.push(`<!--]--></div>`);
|
|
2600
|
+
} else $$renderer.push("<!--[-1-->");
|
|
2559
2601
|
$$renderer.push(`<!--]--></header> <div class="scroll svelte-1jnrixz" role="region" aria-label="Speech log" aria-live="off" tabindex="0">`);
|
|
2560
2602
|
SpeechTable($$renderer, { entries });
|
|
2561
2603
|
$$renderer.push(`<!----> `);
|
|
@@ -2584,6 +2626,26 @@ function SpeechLog($$renderer, $$props) {
|
|
|
2584
2626
|
onClose: () => markerOpen = false
|
|
2585
2627
|
});
|
|
2586
2628
|
} else $$renderer.push("<!--[-1-->");
|
|
2629
|
+
$$renderer.push(`<!--]--> `);
|
|
2630
|
+
if (canClear) {
|
|
2631
|
+
$$renderer.push("<!--[0-->");
|
|
2632
|
+
ClearSpeechDialog($$renderer, {
|
|
2633
|
+
open: clearOpen,
|
|
2634
|
+
heading,
|
|
2635
|
+
onClear,
|
|
2636
|
+
onClose: () => clearOpen = false
|
|
2637
|
+
});
|
|
2638
|
+
} else $$renderer.push("<!--[-1-->");
|
|
2639
|
+
$$renderer.push(`<!--]--> `);
|
|
2640
|
+
if (canDelete) {
|
|
2641
|
+
$$renderer.push("<!--[0-->");
|
|
2642
|
+
DeleteSessionDialog($$renderer, {
|
|
2643
|
+
open: deleteOpen,
|
|
2644
|
+
heading,
|
|
2645
|
+
onDelete,
|
|
2646
|
+
onClose: () => deleteOpen = false
|
|
2647
|
+
});
|
|
2648
|
+
} else $$renderer.push("<!--[-1-->");
|
|
2587
2649
|
$$renderer.push(`<!--]-->`);
|
|
2588
2650
|
});
|
|
2589
2651
|
}
|
|
@@ -2662,6 +2724,16 @@ function selectedScope(requested, sessions, currentId) {
|
|
|
2662
2724
|
if (id !== null && sessions.some((session) => session.id === id)) return id;
|
|
2663
2725
|
return currentId ?? "none";
|
|
2664
2726
|
}
|
|
2727
|
+
/**
|
|
2728
|
+
* The session to show once `deletedId` is gone: the next older one, else the next newer one
|
|
2729
|
+
* (`sessions` is newest first), else `null`, which the page resolves to the current session or the
|
|
2730
|
+
* speech outside any session (`selectedScope`).
|
|
2731
|
+
*/
|
|
2732
|
+
function scopeAfterDelete(deletedId, sessions) {
|
|
2733
|
+
const at = sessions.findIndex((session) => session.id === deletedId);
|
|
2734
|
+
if (at === -1) return null;
|
|
2735
|
+
return (sessions[at + 1] ?? sessions[at - 1])?.id ?? null;
|
|
2736
|
+
}
|
|
2665
2737
|
// src/lib/components/SessionsPane/EndSessionDialog.svelte
|
|
2666
2738
|
function EndSessionDialog($$renderer, $$props) {
|
|
2667
2739
|
$$renderer.component(($$renderer) => {
|
|
@@ -2802,6 +2874,8 @@ function _page($$renderer, $$props) {
|
|
|
2802
2874
|
const selectedId = derived(() => selectedScope(page.url.searchParams.get("session"), list().sessions, list().currentId));
|
|
2803
2875
|
const heading = derived(() => logHeading(selectedId(), list().sessions));
|
|
2804
2876
|
const canMark = derived(() => canAddMarker(selectedId(), list().currentId));
|
|
2877
|
+
const canClear = derived(() => canClearSpeech(selectedId(), list().currentId));
|
|
2878
|
+
const canDelete = derived(() => canDeleteSession(selectedId(), list().currentId));
|
|
2805
2879
|
function select(id) {
|
|
2806
2880
|
return goto(id === null ? resolve("/") : `${resolve("/")}?session=${id}`, { reset: false });
|
|
2807
2881
|
}
|
|
@@ -2810,6 +2884,16 @@ function _page($$renderer, $$props) {
|
|
|
2810
2884
|
await sessionsStore.end();
|
|
2811
2885
|
if (ended !== null && !list().sessions.some((session) => session.id === ended)) await select(null);
|
|
2812
2886
|
}
|
|
2887
|
+
async function clear() {
|
|
2888
|
+
await speechStore.clear(selectedId());
|
|
2889
|
+
await sessionsStore.refresh();
|
|
2890
|
+
}
|
|
2891
|
+
async function remove() {
|
|
2892
|
+
if (typeof selectedId() !== "number") return;
|
|
2893
|
+
const next = scopeAfterDelete(selectedId(), list().sessions);
|
|
2894
|
+
await sessionsStore.delete(selectedId());
|
|
2895
|
+
await select(next);
|
|
2896
|
+
}
|
|
2813
2897
|
async function start(name, run) {
|
|
2814
2898
|
await select((await sessionsStore.start(name, run)).id);
|
|
2815
2899
|
}
|
|
@@ -2832,7 +2916,11 @@ function _page($$renderer, $$props) {
|
|
|
2832
2916
|
entries: speechStore.entries,
|
|
2833
2917
|
connection: speechStore.connection,
|
|
2834
2918
|
canMark: canMark(),
|
|
2835
|
-
onAddMarker: (label) => speechStore.addMarker(label)
|
|
2919
|
+
onAddMarker: (label) => speechStore.addMarker(label),
|
|
2920
|
+
canClear: canClear(),
|
|
2921
|
+
onClear: clear,
|
|
2922
|
+
canDelete: canDelete(),
|
|
2923
|
+
onDelete: remove
|
|
2836
2924
|
});
|
|
2837
2925
|
$$renderer.push(`<!----></div></div>`);
|
|
2838
2926
|
});
|