screenreader-speech-capture 0.4.0 → 0.5.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 +35 -9
- package/dist/ui/adapter-node.js +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/2.BbalQTLT.css +1 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.BbalQTLT.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/2.BbalQTLT.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{w6UAqFO5.js → VoEQsW8I.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/VoEQsW8I.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{w6UAqFO5.js.gz → VoEQsW8I.js.gz} +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/{app.COo3YJBG.js → app.vg2Ojqcj.js} +2 -2
- package/dist/ui/client/ui/_app/immutable/entry/app.vg2Ojqcj.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.vg2Ojqcj.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{0.BKE0tKKK.js → 0.BTOtEgN4.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/nodes/0.BTOtEgN4.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.BTOtEgN4.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{2.BCy3UgNz.js → 2.COkKMNHv.js} +73 -73
- package/dist/ui/client/ui/_app/immutable/nodes/2.COkKMNHv.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.COkKMNHv.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 +11 -1
- package/dist/ui/server/_app/immutable/assets/_page.BbalQTLT.css +1 -0
- package/dist/ui/server/chunks/bridge-api.js +3 -0
- package/dist/ui/server/chunks/bridge-api.js.map +1 -1
- package/dist/ui/server/chunks/composition.js +13 -1
- package/dist/ui/server/chunks/composition.js.map +1 -1
- package/dist/ui/server/chunks/instance.js +3 -3
- 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/pages/_page.svelte.js +56 -5
- package/dist/ui/server/entries/pages/_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 +1 -1
- package/dist/ui/server/nodes/2.js +2 -2
- package/dist/ui/server/server.js +8 -1
- package/package.json +1 -1
- 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/w6UAqFO5.js.br +0 -0
- 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/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/2.BCy3UgNz.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.BCy3UgNz.js.gz +0 -0
- package/dist/ui/server/_app/immutable/assets/_page.CtITS5jU.css +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1795259058920"}
|
|
Binary file
|
|
Binary file
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"_src.js"
|
|
398
398
|
],
|
|
399
399
|
"css": [
|
|
400
|
-
"_app/immutable/assets/_page.
|
|
400
|
+
"_app/immutable/assets/_page.BbalQTLT.css"
|
|
401
401
|
]
|
|
402
402
|
},
|
|
403
403
|
"src/routes/api/markers/+server.ts": {
|
|
@@ -422,6 +422,16 @@
|
|
|
422
422
|
"_bridge-api.js"
|
|
423
423
|
]
|
|
424
424
|
},
|
|
425
|
+
"src/routes/api/sessions/[id]/+server.ts": {
|
|
426
|
+
"file": "entries/endpoints/api/sessions/_id_/_server.ts.js",
|
|
427
|
+
"name": "entries/endpoints/api/sessions/_id_/_server.ts",
|
|
428
|
+
"src": "src/routes/api/sessions/[id]/+server.ts",
|
|
429
|
+
"isEntry": true,
|
|
430
|
+
"imports": [
|
|
431
|
+
"_exports.js",
|
|
432
|
+
"_bridge-api.js"
|
|
433
|
+
]
|
|
434
|
+
},
|
|
425
435
|
"src/routes/api/sessions/end/+server.ts": {
|
|
426
436
|
"file": "entries/endpoints/api/sessions/end/_server.ts.js",
|
|
427
437
|
"name": "entries/endpoints/api/sessions/end/_server.ts",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
md-dialog.svelte-1sof82u{--md-dialog-container-color:var(--md-sys-color-surface-container-high);--md-dialog-headline-color:var(--md-sys-color-on-surface);--md-dialog-supporting-text-color:var(--md-sys-color-on-surface-variant);max-width:min(400px,100% - 48px)}p.svelte-1sof82u{margin:0}.failure.svelte-1sof82u{color:var(--md-sys-color-error);margin-top:12px}md-dialog.svelte-ttl1x5{--md-dialog-container-color:var(--md-sys-color-surface-container-high);--md-dialog-headline-color:var(--md-sys-color-on-surface);--md-dialog-supporting-text-color:var(--md-sys-color-on-surface-variant)}form.svelte-ttl1x5{flex-direction:column;gap:16px;min-width:min(360px,70vw);display:flex}.failure.svelte-ttl1x5{color:var(--md-sys-color-error);margin:0}table.svelte-5c13xh{border-collapse:separate;border-spacing:0;width:100%}thead.svelte-5c13xh th:where(.svelte-5c13xh){z-index:1;border-top:1px solid var(--md-sys-color-outline-variant);border-bottom:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);letter-spacing:.5px;text-align:left;text-transform:uppercase;padding:6px 12px;font-size:11px;font-weight:500;position:sticky;top:0}thead.svelte-5c13xh th:where(.svelte-5c13xh):first-child{padding-left:24px}th.seq.svelte-5c13xh,td.seq.svelte-5c13xh{text-align:left;padding-right:24px}tbody.svelte-5c13xh tr:where(.svelte-5c13xh):hover{background:var(--md-sys-color-surface-container)}td.svelte-5c13xh{vertical-align:baseline;padding:7px 12px}td.time.svelte-5c13xh,td.seq.svelte-5c13xh{white-space:nowrap;width:1%}td.time.svelte-5c13xh{color:var(--md-sys-color-on-surface-variant);font-size:var(--app-mono-size);line-height:var(--app-mono-line-height);padding-left:24px}td.text.svelte-5c13xh{color:var(--md-sys-color-on-surface);font-size:var(--app-log-text-size);line-height:var(--app-log-text-line-height);overflow-wrap:anywhere}td.seq.svelte-5c13xh{color:var(--md-sys-color-outline);font-size:11px}tr.fresh.svelte-5c13xh{animation:svelte-5c13xh-fade-new calc(var(--app-new-row-ms) * 1ms) ease-out}@keyframes svelte-5c13xh-fade-new{0%{background:var(--app-new-row)}}@container (width<=520px){th.seq.svelte-5c13xh,td.seq.svelte-5c13xh{display:none}}@media (prefers-reduced-motion:reduce){tr.fresh.svelte-5c13xh{animation:none}}.pill.svelte-5c13xh{background:var(--md-sys-color-tertiary-container);max-width:70%;height:24px;color:var(--md-sys-color-on-tertiary-container);vertical-align:middle;border-radius:6px;align-items:center;gap:4px;padding:0 8px 0 4px;font-size:12px;font-weight:500;line-height:16px;display:inline-flex}.pill.svelte-5c13xh md-icon:where(.svelte-5c13xh){--md-icon-size:16px;font-size:16px}.label.svelte-5c13xh{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.visually-hidden.svelte-5c13xh{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.log.svelte-1jnrixz{box-sizing:border-box;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-lowest);border-radius:16px;flex-direction:column;height:100%;min-height:0;display:flex;overflow:hidden}header.svelte-1jnrixz{box-sizing:border-box;flex:none;align-items:center;gap:8px;min-height:64px;padding:16px 12px 8px 24px;display:flex}h1.svelte-1jnrixz{min-width:0;color:var(--md-sys-color-on-surface);flex:1;margin:0;font-size:22px;font-weight:500;line-height:28px}.trunc.svelte-1jnrixz{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.scroll.svelte-1jnrixz{flex:1;min-height:0;overflow-y:auto;container-type:inline-size}.empty.svelte-1jnrixz{color:var(--md-sys-color-on-surface-variant);text-align:center;flex-direction:column;align-items:center;padding:96px 24px;animation:0s .25s backwards svelte-1jnrixz-reveal;display:flex}@keyframes svelte-1jnrixz-reveal{0%{visibility:hidden}}.empty.svelte-1jnrixz md-icon:where(.svelte-1jnrixz){--md-icon-size:40px;font-size:40px}.empty.svelte-1jnrixz p:where(.svelte-1jnrixz){margin:4px 0 0;font-size:14px}.empty.svelte-1jnrixz .title:where(.svelte-1jnrixz){color:var(--md-sys-color-on-surface);font-size:16px;font-weight:500}footer.svelte-1jnrixz{border-top:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);flex:none;justify-content:space-between;align-items:center;gap:12px;padding:8px 12px 8px 24px;display:flex}footer.svelte-1jnrixz p.failed:where(.svelte-1jnrixz){color:var(--md-sys-color-error)}footer.svelte-1jnrixz p:where(.svelte-1jnrixz){color:var(--md-sys-color-on-surface-variant);font-size:var(--app-mono-size);margin:0}li.svelte-3qlloz{border-radius:var(--list-item-shape,var(--md-sys-shape-corner-small,8px));min-height:60px;color:var(--md-sys-color-on-surface);--md-ripple-hover-color:currentColor;--md-ripple-pressed-color:currentColor;align-items:center;display:flex;position:relative}li.selected.svelte-3qlloz{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}.select.svelte-3qlloz{border-radius:inherit;min-width:0;min-height:60px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex-direction:column;flex:1;justify-content:center;align-items:flex-start;gap:4px;padding:8px 16px;display:flex}.title.svelte-3qlloz{max-width:100%;font-size:var(--md-sys-typescale-label-large-size,14px);text-overflow:ellipsis;white-space:nowrap;font-weight:500;overflow:hidden}.subtitle.svelte-3qlloz{max-width:100%;color:var(--md-sys-color-on-surface-variant);font-family:var(--app-font-mono);font-size:var(--app-mono-size);white-space:nowrap;overflow:hidden}li.selected.svelte-3qlloz .subtitle:where(.svelte-3qlloz){color:inherit}.trailing.svelte-3qlloz{flex:none;margin-right:8px;display:flex}.sr-only.svelte-3qlloz{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}md-dialog.svelte-17z3k9b{--md-dialog-container-color:var(--md-sys-color-surface-container-high);--md-dialog-headline-color:var(--md-sys-color-on-surface);--md-dialog-supporting-text-color:var(--md-sys-color-on-surface-variant);max-width:min(400px,100% - 48px)}p.svelte-17z3k9b{margin:0}.failure.svelte-17z3k9b{color:var(--md-sys-color-error);margin-top:12px}.meta.svelte-wvg2ho{align-items:center;min-width:0;display:flex}.meta.svelte-wvg2ho>span:where(.svelte-wvg2ho){white-space:nowrap;flex:none}.meta.svelte-wvg2ho>:where(.svelte-wvg2ho):not(:last-child):after{content:" · "}.meta.svelte-wvg2ho>.dot:where(.svelte-wvg2ho):after{content:none}.meta.svelte-wvg2ho>.run:where(.svelte-wvg2ho),.meta.svelte-wvg2ho>span:where(.svelte-wvg2ho):last-child{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.dot.svelte-wvg2ho{background:var(--app-success);border-radius:50%;flex:none;width:8px;height:8px;margin-right:6px;animation:1.6s ease-in-out infinite svelte-wvg2ho-pulse}@keyframes svelte-wvg2ho-pulse{50%{opacity:.35}}@media (prefers-reduced-motion:reduce){.dot.svelte-wvg2ho{animation:none}}md-dialog.svelte-2k1elc{--md-dialog-container-color:var(--md-sys-color-surface-container-high);--md-dialog-headline-color:var(--md-sys-color-on-surface);--md-dialog-supporting-text-color:var(--md-sys-color-on-surface-variant)}form.svelte-2k1elc{flex-direction:column;gap:16px;min-width:min(360px,70vw);display:flex}.failure.svelte-2k1elc{color:var(--md-sys-color-error);margin:0}section.svelte-1fz71rn{box-sizing:border-box;background:var(--md-sys-color-surface-container-low);border-radius:28px;flex-direction:column;height:100%;min-height:0;padding:16px 12px;display:flex}header.svelte-1fz71rn{flex:none;align-items:center;padding:0 4px 8px 0;display:flex}section.collapsed.svelte-1fz71rn{align-items:flex-start}.collapsed.svelte-1fz71rn header:where(.svelte-1fz71rn){flex-direction:column;padding:0}.visually-hidden.svelte-1fz71rn{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}h2.svelte-1fz71rn{font-size:var(--md-sys-typescale-title-medium-size,16px);flex:1;margin:0 0 0 8px;font-weight:500}.start.svelte-1fz71rn{--md-icon-button-icon-color:var(--md-sys-color-primary);--md-icon-button-hover-icon-color:var(--md-sys-color-primary);--md-icon-button-focus-icon-color:var(--md-sys-color-primary)}.stop.svelte-1fz71rn{--md-icon-button-icon-color:var(--md-sys-color-error);--md-icon-button-hover-icon-color:var(--md-sys-color-error);--md-icon-button-focus-icon-color:var(--md-sys-color-error)}ul.svelte-1fz71rn{flex-direction:column;flex:1;gap:4px;min-height:0;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}ul.outside.svelte-1fz71rn{border-top:1px solid var(--md-sys-color-outline-variant);flex:none;margin-top:auto;padding-top:8px;overflow:visible}.empty.svelte-1fz71rn{color:var(--md-sys-color-on-surface-variant);margin:0;padding:8px 16px}.monitor.svelte-1uha8ag{height:100%;padding:var(--app-gutter) 0;align-items:stretch;gap:16px;display:flex}aside.svelte-1uha8ag{width:var(--app-sessions-width);flex:none;min-height:0;transition:width .2s}aside.collapsed.svelte-1uha8ag{width:var(--app-sessions-collapsed-width)}@media (prefers-reduced-motion:reduce){aside.svelte-1uha8ag{transition:none}}.log.svelte-1uha8ag{flex:1;min-width:0;min-height:0}
|
|
@@ -47,6 +47,9 @@ function createBridgeApi(baseUrl, fetchFn) {
|
|
|
47
47
|
endSession: async () => {
|
|
48
48
|
await call("POST", "/sessions/end");
|
|
49
49
|
},
|
|
50
|
+
deleteSession: async (id) => {
|
|
51
|
+
await call("DELETE", `/sessions?session=${id}`);
|
|
52
|
+
},
|
|
50
53
|
addMarker: (label) => read("POST", "/markers", SpeechEntrySchema, { label }),
|
|
51
54
|
speech: (session, since, limit) => {
|
|
52
55
|
const query = new URLSearchParams({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-api.js","names":[],"sources":["../../../../shared/src/api-version.ts","../../../src/lib/server/bridge-api.ts"],"sourcesContent":["/**\n * `<major>.<minor>` of the HTTP API. Minor versions only add things\n * (docs/usage/http-api.md#versioning).\n */\nexport const API_VERSION = '1.
|
|
1
|
+
{"version":3,"file":"bridge-api.js","names":[],"sources":["../../../../shared/src/api-version.ts","../../../src/lib/server/bridge-api.ts"],"sourcesContent":["/**\n * `<major>.<minor>` of the HTTP API. Minor versions only add things\n * (docs/usage/http-api.md#versioning).\n */\nexport const API_VERSION = '1.17';\n\n/** Path prefix of every API route. */\nexport const API_PREFIX = '/api/v1';\n","import { error } from '@sveltejs/kit';\nimport {\n AnyErrorBodySchema,\n API_PREFIX,\n CLIENT_HEADER,\n checkDto,\n SessionListSchema,\n SpeechEntrySchema,\n SpeechListSchema,\n StartSessionResponseSchema,\n StatusSchema,\n type DtoOf,\n type DtoSchema,\n type SessionListDto,\n type SpeechEntryDto,\n type SpeechListDto,\n type StartSessionRequestDto,\n type StartSessionResponseDto,\n type StatusDto,\n} from '@screenreader-speech-capture/shared';\n\n/** Where the BFF finds the bridge when `SR_BRIDGE_API_URL` is not set (`pnpm dev:ui`). */\nexport const DEFAULT_BRIDGE_URL = 'http://127.0.0.1:5151';\n\ntype Fetch = typeof fetch;\n\n/** The bridge's HTTP API as the BFF uses it: the only place the UI server talks to the bridge. */\nexport interface BridgeApi {\n status(): Promise<StatusDto>;\n sessions(): Promise<SessionListDto>;\n startSession(request: StartSessionRequestDto): Promise<StartSessionResponseDto>;\n /** Ends the current session; does nothing if none is current. */\n endSession(): Promise<void>;\n /** Deletes an ended session and its speech (the bridge refuses the current one). */\n deleteSession(id: number): Promise<void>;\n /** Inserts a marker; the bridge files it under the current session (or outside any). */\n addMarker(label: string): Promise<SpeechEntryDto>;\n /** One page of a scope's entries with `seq > since`, oldest first (`session`: an id or `none`). */\n speech(session: string | null, since: number, limit: number): Promise<SpeechListDto>;\n /**\n * Opens the bridge's SSE stream (`session`: an id or `none`). The body is passed on as it is,\n * so `Last-Event-ID` replays and every event name reach the browser untouched.\n */\n openSpeechStream(\n session: string | null,\n lastEventId: string | null,\n signal: AbortSignal,\n ): Promise<Response>;\n}\n\n/** Named in the bridge's logs when this UI ends or replaces another client's session. */\nconst UI_CLIENT = 'web-ui';\n\n/**\n * `baseUrl` is the bridge's origin (no path). `fetchFn` is SvelteKit's `event.fetch` in\n * routes and a fake in tests.\n */\nexport function createBridgeApi(baseUrl: string, fetchFn: Fetch): BridgeApi {\n const root = baseUrl.replace(/\\/+$/, '') + API_PREFIX;\n // SvelteKit's `event.fetch` adds `Origin: <the UI's own origin>` to every call to another origin\n // (`pnpm dev:ui`: http://localhost:5173). The bridge refuses a POST from any origin but its own\n // (docs/usage/security.md#host-and-origin), so name the bridge itself: this is a server-side\n // call, not a page of another site.\n const origin = new URL(root).origin;\n\n async function call(\n method: 'GET' | 'POST' | 'DELETE',\n path: string,\n body?: unknown,\n ): Promise<unknown> {\n let response: Response;\n try {\n response = await fetchFn(`${root}${path}`, {\n method,\n headers: {\n accept: 'application/json',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(body === undefined ? {} : { 'content-type': 'application/json' }),\n },\n body: body === undefined ? undefined : JSON.stringify(body),\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n const answer: unknown = await response.json().catch(() => undefined);\n if (!response.ok) {\n const apiError = checkDto(AnyErrorBodySchema, answer);\n error(\n response.status,\n apiError.ok ? apiError.value.error.message : `The bridge answered ${response.status}`,\n );\n }\n return answer;\n }\n\n async function read<S extends DtoSchema>(\n method: 'GET' | 'POST',\n path: string,\n schema: S,\n body?: unknown,\n ): Promise<DtoOf<S>> {\n const checked = checkDto(schema, await call(method, path, body));\n if (!checked.ok) {\n error(502, `Unexpected answer from the bridge at ${checked.field}: ${checked.message}`);\n }\n return checked.value;\n }\n\n return {\n status: () => read('GET', '/status', StatusSchema),\n sessions: () => read('GET', '/sessions', SessionListSchema),\n startSession: (request) => read('POST', '/sessions', StartSessionResponseSchema, request),\n endSession: async () => {\n await call('POST', '/sessions/end');\n },\n deleteSession: async (id) => {\n await call('DELETE', `/sessions?session=${id}`);\n },\n addMarker: (label) => read('POST', '/markers', SpeechEntrySchema, { label }),\n speech: (session, since, limit) => {\n const query = new URLSearchParams({ since: String(since), limit: String(limit) });\n if (session !== null) query.set('session', session);\n return read('GET', `/speech?${query}`, SpeechListSchema);\n },\n openSpeechStream: async (session, lastEventId, signal) => {\n const query = session === null ? '' : `?session=${encodeURIComponent(session)}`;\n let response: Response;\n try {\n response = await fetchFn(`${root}/speech/stream${query}`, {\n headers: {\n accept: 'text/event-stream',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(lastEventId === null ? {} : { 'last-event-id': lastEventId }),\n },\n signal,\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n if (!response.ok || response.body === null) {\n error(\n response.status === 200 ? 502 : response.status,\n 'The speech stream is not available',\n );\n }\n return response;\n },\n };\n}\n\nfunction describe(cause: unknown): string {\n return cause instanceof Error ? cause.message : String(cause);\n}\n\n/** The bridge API of this deployment (read per request, so no SvelteKit env module is needed). */\nexport function bridgeApiFromEnv(fetchFn: Fetch): BridgeApi {\n // The bridge sets SR_BRIDGE_API_URL to its own address when it mounts the UI.\n return createBridgeApi(process.env.SR_BRIDGE_API_URL ?? DEFAULT_BRIDGE_URL, fetchFn);\n}\n"],"mappings":";;;;AAOA,IAAa,aAAa;;AC4C1B,IAAM,YAAY;;;;;AAMlB,SAAgB,gBAAgB,SAAiB,SAA2B;CAC1E,MAAM,OAAO,QAAQ,QAAQ,QAAQ,EAAE,IAAI;CAK3C,MAAM,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC;CAE7B,eAAe,KACb,QACA,MACA,MACkB;EAClB,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,QAAQ,GAAG,OAAO,QAAQ;IACzC;IACA,SAAS;KACP,QAAQ;KACR;MACC,gBAAgB;KACjB,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,gBAAgB,mBAAmB;IACrE;IACA,MAAM,SAAS,KAAA,IAAY,KAAA,IAAY,KAAK,UAAU,IAAI;GAC5D,CAAC;EACH,SAAS,OAAO;GACd,MAAM,KAAK,gCAAgC,SAAS,KAAK,GAAG;EAC9D;EACA,MAAM,SAAkB,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;EACnE,IAAI,CAAC,SAAS,IAAI;GAChB,MAAM,WAAW,SAAS,oBAAoB,MAAM;GACpD,MACE,SAAS,QACT,SAAS,KAAK,SAAS,MAAM,MAAM,UAAU,uBAAuB,SAAS,QAC/E;EACF;EACA,OAAO;CACT;CAEA,eAAe,KACb,QACA,MACA,QACA,MACmB;EACnB,MAAM,UAAU,SAAS,QAAQ,MAAM,KAAK,QAAQ,MAAM,IAAI,CAAC;EAC/D,IAAI,CAAC,QAAQ,IACX,MAAM,KAAK,wCAAwC,QAAQ,MAAM,IAAI,QAAQ,SAAS;EAExF,OAAO,QAAQ;CACjB;CAEA,OAAO;EACL,cAAc,KAAK,OAAO,WAAW,YAAY;EACjD,gBAAgB,KAAK,OAAO,aAAa,iBAAiB;EAC1D,eAAe,YAAY,KAAK,QAAQ,aAAa,4BAA4B,OAAO;EACxF,YAAY,YAAY;GACtB,MAAM,KAAK,QAAQ,eAAe;EACpC;EACA,eAAe,OAAO,OAAO;GAC3B,MAAM,KAAK,UAAU,qBAAqB,IAAI;EAChD;EACA,YAAY,UAAU,KAAK,QAAQ,YAAY,mBAAmB,EAAE,MAAM,CAAC;EAC3E,SAAS,SAAS,OAAO,UAAU;GACjC,MAAM,QAAQ,IAAI,gBAAgB;IAAE,OAAO,OAAO,KAAK;IAAG,OAAO,OAAO,KAAK;GAAE,CAAC;GAChF,IAAI,YAAY,MAAM,MAAM,IAAI,WAAW,OAAO;GAClD,OAAO,KAAK,OAAO,WAAW,SAAS,gBAAgB;EACzD;EACA,kBAAkB,OAAO,SAAS,aAAa,WAAW;GACxD,MAAM,QAAQ,YAAY,OAAO,KAAK,YAAY,mBAAmB,OAAO;GAC5E,IAAI;GACJ,IAAI;IACF,WAAW,MAAM,QAAQ,GAAG,KAAK,gBAAgB,SAAS;KACxD,SAAS;MACP,QAAQ;MACR;OACC,gBAAgB;MACjB,GAAI,gBAAgB,OAAO,CAAC,IAAI,EAAE,iBAAiB,YAAY;KACjE;KACA;IACF,CAAC;GACH,SAAS,OAAO;IACd,MAAM,KAAK,gCAAgC,SAAS,KAAK,GAAG;GAC9D;GACA,IAAI,CAAC,SAAS,MAAM,SAAS,SAAS,MACpC,MACE,SAAS,WAAW,MAAM,MAAM,SAAS,QACzC,oCACF;GAEF,OAAO;EACT;CACF;AACF;AAEA,SAAS,SAAS,OAAwB;CACxC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,SAAgB,iBAAiB,SAA2B;CAE1D,OAAO,gBAAgB,QAAQ,IAAI,qBAAA,yBAAyC,OAAO;AACrF"}
|
|
@@ -2707,6 +2707,9 @@ var HttpSessionsApi = class {
|
|
|
2707
2707
|
async end() {
|
|
2708
2708
|
await this.send("POST", `${this.url}/end`, void 0, void 0);
|
|
2709
2709
|
}
|
|
2710
|
+
async delete(id) {
|
|
2711
|
+
await this.send("DELETE", `${this.url}/${id}`, void 0, void 0);
|
|
2712
|
+
}
|
|
2710
2713
|
async send(method, url, body, schema) {
|
|
2711
2714
|
const response = await fetch(url, {
|
|
2712
2715
|
method,
|
|
@@ -2940,6 +2943,11 @@ function createSessionsStore(api) {
|
|
|
2940
2943
|
async end() {
|
|
2941
2944
|
await api.end();
|
|
2942
2945
|
await refreshAfterChange();
|
|
2946
|
+
},
|
|
2947
|
+
/** Deletes an ended session. Rejects with the bridge's message. */
|
|
2948
|
+
async delete(id) {
|
|
2949
|
+
await api.delete(id);
|
|
2950
|
+
await refreshAfterChange();
|
|
2943
2951
|
}
|
|
2944
2952
|
};
|
|
2945
2953
|
}
|
|
@@ -2953,6 +2961,10 @@ var MAX_ROWS = 5e3;
|
|
|
2953
2961
|
function canAddMarker(scope, currentId) {
|
|
2954
2962
|
return currentId === null ? scope === "none" : scope === currentId;
|
|
2955
2963
|
}
|
|
2964
|
+
/** Whether the log can delete `scope`: an ended session, never the current one or the outside log. */
|
|
2965
|
+
function canDeleteSession(scope, currentId) {
|
|
2966
|
+
return scope !== "none" && scope !== currentId;
|
|
2967
|
+
}
|
|
2956
2968
|
/** `14:03:07.042` in the browser's time zone. */
|
|
2957
2969
|
function formatReceivedTime(iso) {
|
|
2958
2970
|
const date = new Date(iso);
|
|
@@ -3088,6 +3100,6 @@ var statusStore = createStatusStore(new HttpStatusApi(resolve("/api/status")));
|
|
|
3088
3100
|
var sessionsStore = createSessionsStore(new HttpSessionsApi(resolve("/api/sessions")));
|
|
3089
3101
|
var speechStore = createSpeechStore(new SseSpeechFeed(resolve("/api/speech/stream"), resolve("/api/speech")), new HttpSpeechApi(resolve("/api/markers")));
|
|
3090
3102
|
var sessionsPaneStore = createSessionsPaneStore(new BrowserSessionsPaneStorage());
|
|
3091
|
-
export {
|
|
3103
|
+
export { e$4 as A, i$2 as C, T as D, E, __decorate as F, n$2 as M, i$4 as N, Z as O, t$3 as P, t as S, B as T, u as _, themeStore as a, e$1 as b, formatReceivedTime as c, getFormValue as d, mixinFormAssociated as f, i as g, mixinDelegatesAria as h, statusStore as i, r$1 as j, e$3 as k, logHeading as l, mixinElementInternals as m, sessionsStore as n, canAddMarker as o, internals as p, speechStore as r, canDeleteSession as s, sessionsPaneStore as t, mixinFormSubmitter as u, EASING as v, A as w, i$1 as x, e as y };
|
|
3092
3104
|
|
|
3093
3105
|
//# sourceMappingURL=composition.js.map
|