@crvouga/mockingbird-runtime 0.2.1 → 0.3.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/README.md +15 -1
- package/dist/adapter-node.d.ts +38 -11
- package/dist/adapter-node.js +82 -174
- package/dist/adapter-node.js.map +4 -4
- package/dist/{chunk-4BRVNPWR.js → chunk-KD6FHYQP.js} +6 -6
- package/dist/{chunk-4BRVNPWR.js.map → chunk-KD6FHYQP.js.map} +2 -2
- package/dist/{chunk-LL6NKAJO.js → chunk-M4HUKBLC.js} +3 -2
- package/dist/chunk-M4HUKBLC.js.map +7 -0
- package/dist/chunk-RI2UQCHP.js +21 -0
- package/dist/chunk-RI2UQCHP.js.map +7 -0
- package/dist/{chunk-2Y25NPCV.js → chunk-U36J5GCB.js} +290 -1
- package/dist/{chunk-2Y25NPCV.js.map → chunk-U36J5GCB.js.map} +3 -3
- package/dist/{chunk-RO7FHXO3.js → chunk-ZQBZSSSP.js} +3 -3
- package/dist/core.d.ts +86 -2
- package/dist/core.js +23 -1
- package/dist/http-provider.js +7 -7
- package/dist/http-provider.js.map +1 -1
- package/dist/mqtt-broker/node.js +4 -4
- package/dist/mqtt-broker.js +4 -4
- package/dist/preview/artifacts.d.ts +4 -9
- package/dist/preview/artifacts.js +4 -16
- package/dist/preview/artifacts.js.map +2 -2
- package/dist/preview/bridge.d.ts +8 -8
- package/dist/preview/bridge.js +1 -1
- package/dist/preview/harness.d.ts +1 -1
- package/dist/preview/harness.js +10 -56
- package/dist/preview/harness.js.map +2 -2
- package/dist/preview/host.d.ts +4 -9
- package/dist/preview/host.js +30 -37
- package/dist/preview/host.js.map +2 -2
- package/dist/service/admin.js +2 -2
- package/dist/service.d.ts +3 -1
- package/dist/service.js +6 -4
- package/dist/ui.d.ts +1 -37
- package/dist/ui.js +2 -701
- package/dist/ui.js.map +3 -3
- package/package.json +7 -6
- package/dist/chunk-EBGYPQPA.js +0 -198
- package/dist/chunk-EBGYPQPA.js.map +0 -7
- package/dist/chunk-LL6NKAJO.js.map +0 -7
- /package/dist/{chunk-RO7FHXO3.js.map → chunk-ZQBZSSSP.js.map} +0 -0
package/dist/mqtt-broker/node.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAX_VARIABLE_BYTE_INTEGER,
|
|
3
3
|
MQTT_WEBSOCKET_PATH
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ZQBZSSSP.js";
|
|
5
|
+
import "../chunk-KD6FHYQP.js";
|
|
6
6
|
import "../chunk-2KDYLZXC.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-M4HUKBLC.js";
|
|
8
|
+
import "../chunk-U36J5GCB.js";
|
|
9
9
|
import "../chunk-EQLY2YOA.js";
|
|
10
10
|
import "../chunk-HU6IOAFC.js";
|
|
11
11
|
import "../chunk-4SAK6MQT.js";
|
package/dist/mqtt-broker.js
CHANGED
|
@@ -14,17 +14,17 @@ import {
|
|
|
14
14
|
observeClock,
|
|
15
15
|
takeConnackFault,
|
|
16
16
|
webSocketNamespace
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZQBZSSSP.js";
|
|
18
18
|
import {
|
|
19
19
|
Collection,
|
|
20
20
|
IdSequence
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KD6FHYQP.js";
|
|
22
22
|
import "./chunk-2KDYLZXC.js";
|
|
23
23
|
import {
|
|
24
24
|
fromBase64,
|
|
25
25
|
toBase64
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-M4HUKBLC.js";
|
|
27
|
+
import "./chunk-U36J5GCB.js";
|
|
28
28
|
import "./chunk-EQLY2YOA.js";
|
|
29
29
|
import "./chunk-HU6IOAFC.js";
|
|
30
30
|
import "./chunk-4SAK6MQT.js";
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import { LegacyPreviewArtifact } from '@crvouga/mockingbird-preview';
|
|
2
|
+
|
|
1
3
|
type WebFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
2
4
|
|
|
3
|
-
type PreviewArtifact =
|
|
4
|
-
|
|
5
|
-
/** SHA-256 of the decoded JavaScript bytes, as lowercase hex. */
|
|
6
|
-
sha256: string;
|
|
7
|
-
url: string;
|
|
8
|
-
compression?: "gzip";
|
|
9
|
-
};
|
|
10
|
-
/** Verify before execution. URLs inside a compressed bundle must be absolute or bundled. */
|
|
11
|
-
declare function loadPreviewArtifact(artifact: PreviewArtifact, fetcher?: WebFetch): Promise<Uint8Array<ArrayBuffer>>;
|
|
5
|
+
type PreviewArtifact = LegacyPreviewArtifact;
|
|
6
|
+
declare const loadPreviewArtifact: (artifact: PreviewArtifact, fetcher?: WebFetch) => Promise<Uint8Array<ArrayBuffer>>;
|
|
12
7
|
declare function createPreviewWorker(artifact: PreviewArtifact, options?: WorkerOptions): Promise<{
|
|
13
8
|
worker: Worker;
|
|
14
9
|
identity: string;
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
// src/preview/artifacts.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
throw new Error("Unsupported preview artifact compression");
|
|
7
|
-
const response = await fetcher(artifact.url, { cache: "no-store", credentials: "omit" });
|
|
8
|
-
if (!response.ok || !response.body)
|
|
9
|
-
throw new Error(`Preview artifact ${artifact.url}: HTTP ${response.status}`);
|
|
10
|
-
const stream = artifact.compression === "gzip" ? response.body.pipeThrough(new DecompressionStream("gzip")) : response.body;
|
|
11
|
-
const bytes = new Uint8Array(await new Response(stream).arrayBuffer());
|
|
12
|
-
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));
|
|
13
|
-
const identity = [...digest].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
14
|
-
if (identity !== artifact.sha256)
|
|
15
|
-
throw new Error(`Preview artifact identity mismatch: ${artifact.url}`);
|
|
16
|
-
return bytes;
|
|
17
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
loadPreviewArtifact as loadArtifact
|
|
4
|
+
} from "@crvouga/mockingbird-preview";
|
|
5
|
+
var loadPreviewArtifact = (artifact, fetcher = fetch) => loadArtifact(artifact, { fetch: fetcher });
|
|
18
6
|
async function createPreviewWorker(artifact, options = {}) {
|
|
19
7
|
const bytes = await loadPreviewArtifact(artifact);
|
|
20
8
|
const url = URL.createObjectURL(new Blob([bytes], { type: "text/javascript" }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/preview/artifacts.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import {\n type LegacyPreviewArtifact,\n loadPreviewArtifact as loadArtifact,\n} from \"@crvouga/mockingbird-preview\"\nimport type { WebFetch } from \"./types.js\"\nexport type PreviewArtifact = LegacyPreviewArtifact\nexport const loadPreviewArtifact = (artifact: PreviewArtifact, fetcher: WebFetch = fetch) =>\n loadArtifact(artifact, { fetch: fetcher })\n\nexport async function createPreviewWorker(artifact: PreviewArtifact, options: WorkerOptions = {}) {\n const bytes = await loadPreviewArtifact(artifact)\n const url = URL.createObjectURL(new Blob([bytes], { type: \"text/javascript\" }))\n try {\n const worker = new Worker(url, { ...options, type: \"module\" })\n return {\n worker,\n identity: artifact.sha256,\n dispose() {\n worker.terminate()\n URL.revokeObjectURL(url)\n },\n }\n } catch (error) {\n URL.revokeObjectURL(url)\n throw error\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EAEE,uBAAuB;AAAA,OAClB;AAGA,IAAM,sBAAsB,CAAC,UAA2B,UAAoB,UACjF,aAAa,UAAU,EAAE,OAAO,QAAQ,CAAC;AAE3C,eAAsB,oBAAoB,UAA2B,UAAyB,CAAC,GAAG;AAChG,QAAM,QAAQ,MAAM,oBAAoB,QAAQ;AAChD,QAAM,MAAM,IAAI,gBAAgB,IAAI,KAAK,CAAC,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC,CAAC;AAC9E,MAAI;AACF,UAAM,SAAS,IAAI,OAAO,KAAK,EAAE,GAAG,SAAS,MAAM,SAAS,CAAC;AAC7D,WAAO;AAAA,MACL;AAAA,MACA,UAAU,SAAS;AAAA,MACnB,UAAU;AACR,eAAO,UAAU;AACjB,YAAI,gBAAgB,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AACd,QAAI,gBAAgB,GAAG;AACvB,UAAM;AAAA,EACR;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/preview/bridge.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { PreviewPort } from '@crvouga/mockingbird-preview';
|
|
2
|
+
export { PreviewPort } from '@crvouga/mockingbird-preview';
|
|
3
|
+
|
|
2
4
|
type FetchHandler = (request: Request) => Response | Promise<Response>;
|
|
3
5
|
|
|
4
|
-
/**
|
|
5
|
-
type PreviewPort = Pick<MessagePort, "postMessage" | "addEventListener" | "removeEventListener" | "start" | "close">;
|
|
6
|
-
/** One channel per request; response chunks are pulled, never buffered without bound. */
|
|
6
|
+
/** Compatibility entry: explicit virtual cookie headers and error messages retain the original API. */
|
|
7
7
|
declare function createPreviewClient(port: PreviewPort, options?: {
|
|
8
8
|
timeoutMs?: number;
|
|
9
9
|
}): {
|
|
10
|
-
fetch:
|
|
11
|
-
dispose(reason?: Error)
|
|
10
|
+
fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
11
|
+
dispose: (reason?: Error) => void;
|
|
12
|
+
readonly pending: number;
|
|
12
13
|
};
|
|
13
|
-
/** Attach each dedicated-worker or SharedWorker client port to the same handler. */
|
|
14
14
|
declare function attachPreviewHost(port: PreviewPort, fetch: FetchHandler, options?: {
|
|
15
15
|
onDisconnect?: () => void;
|
|
16
16
|
}): {
|
|
17
17
|
dispose: () => void;
|
|
18
|
+
readonly active: number;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export { attachPreviewHost, createPreviewClient };
|
|
21
|
-
export type { PreviewPort };
|
package/dist/preview/bridge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type WebFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** Keep the original logical-origin routing while using the shared HTTP adapter. */
|
|
4
4
|
declare function startPreviewHarness(fetch: WebFetch, options: {
|
|
5
5
|
origin: string;
|
|
6
6
|
port?: number;
|
package/dist/preview/harness.js
CHANGED
|
@@ -1,63 +1,17 @@
|
|
|
1
1
|
// src/preview/harness.ts
|
|
2
|
-
import {
|
|
3
|
-
import { Readable } from "node:stream";
|
|
4
|
-
import { pipeline } from "node:stream/promises";
|
|
2
|
+
import { listenPreview } from "@crvouga/mockingbird-preview/node";
|
|
5
3
|
async function startPreviewHarness(fetch, options) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const url = new URL(
|
|
11
|
-
const path = new URL(incoming.url ?? "/", "http://harness.invalid");
|
|
4
|
+
const origin = new URL(options.origin);
|
|
5
|
+
return listenPreview(
|
|
6
|
+
(request) => {
|
|
7
|
+
const path = new URL(request.url);
|
|
8
|
+
const url = new URL(origin);
|
|
12
9
|
url.pathname = path.pathname;
|
|
13
10
|
url.search = path.search;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for await (const chunk of incoming) chunks.push(Buffer.from(chunk));
|
|
19
|
-
const response = await fetch(url, {
|
|
20
|
-
method: incoming.method ?? "GET",
|
|
21
|
-
headers,
|
|
22
|
-
...chunks.length ? { body: Buffer.concat(chunks) } : {},
|
|
23
|
-
signal: controller.signal,
|
|
24
|
-
redirect: "manual"
|
|
25
|
-
});
|
|
26
|
-
outgoing.statusCode = response.status;
|
|
27
|
-
for (const [key, value] of response.headers)
|
|
28
|
-
if (key !== "set-cookie") outgoing.setHeader(key, value);
|
|
29
|
-
const cookies = response.headers.getSetCookie();
|
|
30
|
-
if (cookies.length) outgoing.setHeader("set-cookie", cookies);
|
|
31
|
-
outgoing.setHeader("cache-control", "no-store");
|
|
32
|
-
outgoing.flushHeaders();
|
|
33
|
-
if (response.body)
|
|
34
|
-
await pipeline(
|
|
35
|
-
Readable.fromWeb(response.body),
|
|
36
|
-
outgoing
|
|
37
|
-
);
|
|
38
|
-
else outgoing.end();
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (outgoing.headersSent)
|
|
41
|
-
outgoing.destroy(error instanceof Error ? error : new Error(String(error)));
|
|
42
|
-
else {
|
|
43
|
-
outgoing.statusCode = 502;
|
|
44
|
-
outgoing.end("Preview request failed");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
await new Promise((resolve, reject) => {
|
|
49
|
-
server.once("error", reject);
|
|
50
|
-
server.listen(options.port ?? 0, "127.0.0.1", resolve);
|
|
51
|
-
});
|
|
52
|
-
const address = server.address();
|
|
53
|
-
if (!address || typeof address === "string") throw new Error("Preview harness has no address");
|
|
54
|
-
return {
|
|
55
|
-
url: `http://127.0.0.1:${address.port}`,
|
|
56
|
-
close: () => new Promise((resolve, reject) => {
|
|
57
|
-
server.close((error) => error ? reject(error) : resolve());
|
|
58
|
-
server.closeAllConnections();
|
|
59
|
-
})
|
|
60
|
-
};
|
|
11
|
+
return fetch(new Request(url, request));
|
|
12
|
+
},
|
|
13
|
+
{ ...options.port !== void 0 ? { port: options.port } : {} }
|
|
14
|
+
);
|
|
61
15
|
}
|
|
62
16
|
export {
|
|
63
17
|
startPreviewHarness
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/preview/harness.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";AAAA,SAAS,
|
|
4
|
+
"sourcesContent": ["import { listenPreview } from \"@crvouga/mockingbird-preview/node\"\nimport type { WebFetch } from \"./types.js\"\n\n/** Keep the original logical-origin routing while using the shared HTTP adapter. */\nexport async function startPreviewHarness(\n fetch: WebFetch,\n options: { origin: string; port?: number },\n) {\n const origin = new URL(options.origin)\n return listenPreview(\n (request) => {\n const path = new URL(request.url)\n const url = new URL(origin)\n url.pathname = path.pathname\n url.search = path.search\n return fetch(new Request(url, request))\n },\n { ...(options.port !== undefined ? { port: options.port } : {}) },\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,qBAAqB;AAI9B,eAAsB,oBACpB,OACA,SACA;AACA,QAAM,SAAS,IAAI,IAAI,QAAQ,MAAM;AACrC,SAAO;AAAA,IACL,CAAC,YAAY;AACX,YAAM,OAAO,IAAI,IAAI,QAAQ,GAAG;AAChC,YAAM,MAAM,IAAI,IAAI,MAAM;AAC1B,UAAI,WAAW,KAAK;AACpB,UAAI,SAAS,KAAK;AAClB,aAAO,MAAM,IAAI,QAAQ,KAAK,OAAO,CAAC;AAAA,IACxC;AAAA,IACA,EAAE,GAAI,QAAQ,SAAS,SAAY,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC,EAAG;AAAA,EAClE;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/preview/host.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { PreviewPort } from '@crvouga/mockingbird-preview';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
type PreviewPort = Pick<MessagePort, "postMessage" | "addEventListener" | "removeEventListener" | "start" | "close">;
|
|
3
|
+
type FetchHandler = (request: Request) => Response | Promise<Response>;
|
|
5
4
|
|
|
6
5
|
type PreviewApplication = {
|
|
7
6
|
fetch: FetchHandler;
|
|
@@ -12,16 +11,12 @@ type PreviewState = {
|
|
|
12
11
|
status: "starting" | "ready" | "error" | "disposed";
|
|
13
12
|
error?: string;
|
|
14
13
|
};
|
|
15
|
-
/**
|
|
14
|
+
/** Preserve the original generation numbering and promise-shaped readiness on the shared host. */
|
|
16
15
|
declare function createPreviewHost(create: (generation: number) => Promise<PreviewApplication> | PreviewApplication): {
|
|
17
16
|
ready: Promise<void>;
|
|
18
17
|
fetch: FetchHandler;
|
|
19
18
|
reset: () => Promise<void>;
|
|
20
|
-
state
|
|
21
|
-
generation: number;
|
|
22
|
-
status: "starting" | "ready" | "error" | "disposed";
|
|
23
|
-
error?: string;
|
|
24
|
-
};
|
|
19
|
+
state(): PreviewState;
|
|
25
20
|
connect(port: PreviewPort): () => void;
|
|
26
21
|
dispose(): Promise<void>;
|
|
27
22
|
};
|
package/dist/preview/host.js
CHANGED
|
@@ -1,50 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachPreviewHost
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RI2UQCHP.js";
|
|
4
4
|
|
|
5
5
|
// src/preview/host.ts
|
|
6
|
+
import { createPreviewHost as createHost } from "@crvouga/mockingbird-preview";
|
|
6
7
|
function createPreviewHost(create) {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const reset = () => {
|
|
13
|
-
if (closed) return Promise.reject(new Error("Preview host disposed"));
|
|
14
|
-
work = work.catch(() => void 0).then(async () => {
|
|
15
|
-
if (closed) return;
|
|
16
|
-
state = { generation: state.generation + 1, status: "starting" };
|
|
8
|
+
let failure;
|
|
9
|
+
const host = createHost({
|
|
10
|
+
artifact: "runtime-preview-compatibility",
|
|
11
|
+
boot: async ({ generation }) => {
|
|
12
|
+
failure = void 0;
|
|
17
13
|
try {
|
|
18
|
-
|
|
19
|
-
application = void 0;
|
|
20
|
-
await previous?.dispose();
|
|
21
|
-
const next = await create(state.generation);
|
|
22
|
-
if (closed) {
|
|
23
|
-
await next.dispose();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
application = next;
|
|
27
|
-
state = { generation: state.generation, status: "ready" };
|
|
14
|
+
return await create(generation + 1);
|
|
28
15
|
} catch (error) {
|
|
29
|
-
|
|
16
|
+
failure = error;
|
|
30
17
|
throw error;
|
|
31
18
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const checked = async (work) => {
|
|
22
|
+
await work;
|
|
23
|
+
if (host.status().state === "failed") throw failure ?? new Error("Preview host unavailable");
|
|
34
24
|
};
|
|
35
|
-
const ready =
|
|
25
|
+
const ready = checked(host.ready());
|
|
26
|
+
const clients = /* @__PURE__ */ new Set();
|
|
36
27
|
const fetch = async (request) => {
|
|
37
|
-
await
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
28
|
+
await checked(host.ready());
|
|
29
|
+
if (host.status().state === "disposed") throw new Error("Preview host unavailable");
|
|
30
|
+
return host.fetch(request);
|
|
40
31
|
};
|
|
41
32
|
return {
|
|
42
33
|
ready,
|
|
43
34
|
fetch,
|
|
44
|
-
reset,
|
|
45
|
-
state
|
|
35
|
+
reset: () => checked(host.reset()),
|
|
36
|
+
state() {
|
|
37
|
+
const current = host.status();
|
|
38
|
+
return {
|
|
39
|
+
generation: current.generation + 1,
|
|
40
|
+
status: current.state === "failed" ? "error" : current.state,
|
|
41
|
+
...current.state === "failed" ? { error: String(failure ?? "Preview host unavailable") } : {}
|
|
42
|
+
};
|
|
43
|
+
},
|
|
46
44
|
connect(port) {
|
|
47
|
-
if (
|
|
45
|
+
if (host.status().state === "disposed") throw new Error("Preview host disposed");
|
|
48
46
|
const client = attachPreviewHost(port, fetch, { onDisconnect: () => clients.delete(client) });
|
|
49
47
|
clients.add(client);
|
|
50
48
|
return () => {
|
|
@@ -53,14 +51,9 @@ function createPreviewHost(create) {
|
|
|
53
51
|
};
|
|
54
52
|
},
|
|
55
53
|
async dispose() {
|
|
56
|
-
if (closed) return;
|
|
57
|
-
closed = true;
|
|
58
54
|
for (const client of clients) client.dispose();
|
|
59
55
|
clients.clear();
|
|
60
|
-
await
|
|
61
|
-
await application?.dispose();
|
|
62
|
-
application = void 0;
|
|
63
|
-
state = { generation: state.generation, status: "disposed" };
|
|
56
|
+
await host.dispose();
|
|
64
57
|
}
|
|
65
58
|
};
|
|
66
59
|
}
|
package/dist/preview/host.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/preview/host.ts"],
|
|
4
|
-
"sourcesContent": ["import { attachPreviewHost, type PreviewPort } from \"./bridge.js\"\nimport type { FetchHandler } from \"./types.js\"\n\nexport type PreviewApplication = { fetch: FetchHandler; dispose(): void | Promise<void> }\nexport type PreviewState = {\n generation: number\n status: \"starting\" | \"ready\" | \"error\" | \"disposed\"\n error?: string\n}\n\n/**
|
|
5
|
-
"mappings": ";;;;;
|
|
4
|
+
"sourcesContent": ["import { createPreviewHost as createHost } from \"@crvouga/mockingbird-preview\"\nimport { attachPreviewHost, type PreviewPort } from \"./bridge.js\"\nimport type { FetchHandler } from \"./types.js\"\n\nexport type PreviewApplication = { fetch: FetchHandler; dispose(): void | Promise<void> }\nexport type PreviewState = {\n generation: number\n status: \"starting\" | \"ready\" | \"error\" | \"disposed\"\n error?: string\n}\n\n/** Preserve the original generation numbering and promise-shaped readiness on the shared host. */\nexport function createPreviewHost(\n create: (generation: number) => Promise<PreviewApplication> | PreviewApplication,\n) {\n let failure: unknown\n const host = createHost({\n artifact: \"runtime-preview-compatibility\",\n boot: async ({ generation }) => {\n failure = undefined\n try {\n return await create(generation + 1)\n } catch (error) {\n failure = error\n throw error\n }\n },\n })\n const checked = async (work: Promise<void>) => {\n await work\n if (host.status().state === \"failed\") throw failure ?? new Error(\"Preview host unavailable\")\n }\n const ready = checked(host.ready())\n const clients = new Set<ReturnType<typeof attachPreviewHost>>()\n const fetch: FetchHandler = async (request) => {\n await checked(host.ready())\n if (host.status().state === \"disposed\") throw new Error(\"Preview host unavailable\")\n return host.fetch(request)\n }\n return {\n ready,\n fetch,\n reset: () => checked(host.reset()),\n state(): PreviewState {\n const current = host.status()\n return {\n generation: current.generation + 1,\n status: current.state === \"failed\" ? \"error\" : current.state,\n ...(current.state === \"failed\"\n ? { error: String(failure ?? \"Preview host unavailable\") }\n : {}),\n }\n },\n connect(port: PreviewPort) {\n if (host.status().state === \"disposed\") throw new Error(\"Preview host disposed\")\n const client = attachPreviewHost(port, fetch, { onDisconnect: () => clients.delete(client) })\n clients.add(client)\n return () => {\n client.dispose()\n clients.delete(client)\n }\n },\n async dispose() {\n for (const client of clients) client.dispose()\n clients.clear()\n await host.dispose()\n },\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA,SAAS,qBAAqB,kBAAkB;AAYzC,SAAS,kBACd,QACA;AACA,MAAI;AACJ,QAAM,OAAO,WAAW;AAAA,IACtB,UAAU;AAAA,IACV,MAAM,OAAO,EAAE,WAAW,MAAM;AAC9B,gBAAU;AACV,UAAI;AACF,eAAO,MAAM,OAAO,aAAa,CAAC;AAAA,MACpC,SAAS,OAAO;AACd,kBAAU;AACV,cAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF,CAAC;AACD,QAAM,UAAU,OAAO,SAAwB;AAC7C,UAAM;AACN,QAAI,KAAK,OAAO,EAAE,UAAU,SAAU,OAAM,WAAW,IAAI,MAAM,0BAA0B;AAAA,EAC7F;AACA,QAAM,QAAQ,QAAQ,KAAK,MAAM,CAAC;AAClC,QAAM,UAAU,oBAAI,IAA0C;AAC9D,QAAM,QAAsB,OAAO,YAAY;AAC7C,UAAM,QAAQ,KAAK,MAAM,CAAC;AAC1B,QAAI,KAAK,OAAO,EAAE,UAAU,WAAY,OAAM,IAAI,MAAM,0BAA0B;AAClF,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO,MAAM,QAAQ,KAAK,MAAM,CAAC;AAAA,IACjC,QAAsB;AACpB,YAAM,UAAU,KAAK,OAAO;AAC5B,aAAO;AAAA,QACL,YAAY,QAAQ,aAAa;AAAA,QACjC,QAAQ,QAAQ,UAAU,WAAW,UAAU,QAAQ;AAAA,QACvD,GAAI,QAAQ,UAAU,WAClB,EAAE,OAAO,OAAO,WAAW,0BAA0B,EAAE,IACvD,CAAC;AAAA,MACP;AAAA,IACF;AAAA,IACA,QAAQ,MAAmB;AACzB,UAAI,KAAK,OAAO,EAAE,UAAU,WAAY,OAAM,IAAI,MAAM,uBAAuB;AAC/E,YAAM,SAAS,kBAAkB,MAAM,OAAO,EAAE,cAAc,MAAM,QAAQ,OAAO,MAAM,EAAE,CAAC;AAC5F,cAAQ,IAAI,MAAM;AAClB,aAAO,MAAM;AACX,eAAO,QAAQ;AACf,gBAAQ,OAAO,MAAM;AAAA,MACvB;AAAA,IACF;AAAA,IACA,MAAM,UAAU;AACd,iBAAW,UAAU,QAAS,QAAO,QAAQ;AAC7C,cAAQ,MAAM;AACd,YAAM,KAAK,QAAQ;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/service/admin.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
createMetrics,
|
|
8
8
|
maskCredential,
|
|
9
9
|
resolveAdminPrefix
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-M4HUKBLC.js";
|
|
11
|
+
import "../chunk-U36J5GCB.js";
|
|
12
12
|
|
|
13
13
|
// ../service/core/dist/engine-admin.js
|
|
14
14
|
var SQL_ADMIN_EXTENSION = {
|
package/dist/service.d.ts
CHANGED
|
@@ -172,6 +172,7 @@ type UpstreamOptions = {
|
|
|
172
172
|
mode?: "emulated" | "forward";
|
|
173
173
|
rewriteAuth?: (request: Request) => Request | Promise<Request>;
|
|
174
174
|
};
|
|
175
|
+
declare const upstreamRequest: (request: Request, baseUrl: string) => Request;
|
|
175
176
|
|
|
176
177
|
/**
|
|
177
178
|
* Seeded pseudo-random numbers, so anything a mock invents — ids, jitter, which
|
|
@@ -2337,6 +2338,7 @@ type RuntimeOptions<T extends ServiceInstance> = {
|
|
|
2337
2338
|
onForwardResponse?: (instance: T, request: Request, response: Response) => Promise<void>;
|
|
2338
2339
|
/** Reject unsupported forwarding surfaces before any network request. */
|
|
2339
2340
|
canForward?: (request: Request) => boolean;
|
|
2341
|
+
upstreamRequest?: (request: Request, baseUrl: string) => Request;
|
|
2340
2342
|
/** Service name, e.g. `"junction"`. Also the default namespace's storage key. */
|
|
2341
2343
|
name: string;
|
|
2342
2344
|
/** Build the instance backing one namespace. Called once per namespace, on first use. */
|
|
@@ -2680,5 +2682,5 @@ declare const UNRELEASED_VERSION = "0.0.0-development";
|
|
|
2680
2682
|
/** The published version of the service package this code is bundled into. */
|
|
2681
2683
|
declare const PACKAGE_VERSION: string;
|
|
2682
2684
|
|
|
2683
|
-
export { ADMIN_CONTROL_PAGES, ADMIN_DOCS_URL, ADMIN_KEY_HEADER, ADMIN_PREFIX, ADMIN_ROUTE_REFERENCE, AT_HEADER, AwsError, AwsProtocolAPI, BRANCH_HEADER, CHECKPOINT_HEADER, CONTROL_HEADERS, CONTROL_HEADER_REFERENCE, Collection, ControlError, DEFAULT_JOURNAL_SIZE, DEFAULT_NAMESPACE, DroppedConnectionError, FAULT_HEADER, HEALTH_PATH, HttpError, IdSequence, IdempotencyStore, MOCKINGBIRD_HEADER, NAMESPACE_HEADER, OperationRegistryError, OutboxStore, PACKAGE_VERSION, SNAPSHOT_FORMAT, SNAPSHOT_HEADER, STANDARD_ADMIN_ROUTES, STANDARD_FAULT_PRESETS, STATE_FIELD_KINDS, UNRELEASED_VERSION, annotateResponse, anyCredential, assertAdminPrefixAvailable, assertAdminUi, assertSnapshotDocument, awsList, awsMd5, awsPage, awsParseXml, awsRecord, awsRequired, awsXml, awsXmlEscape, basicAuth, bearerToken, bodyIssues, bootSqlite, codePointLength, coerce, controlHeaders, createClock, createControlPlane, createCredentialRegistry, createFaultRegistry, createJournal, createLatencyRegistry, createMetrics, createNamespaceControls, createRng, createRuntime, createService, createWebhookHub, decodeAwsQuery, defineMock, defineOperations, deriveClock, extractCodes, extractLinks, faultEffect, faultEffects, forwardRequestContext, fromBase64, hmac, idBaseOf, inspectState, isAdminPath, issuesByField, jsonRes, jsonRes as jsonResponse, markMutationAccepted, maskCredential, matchNamespacePath, normalizeBootControls, normalizeControls, normalizeFault, normalizeIdBase, opaqueToken, outboxAdminRoutes, ownedTransport, parseControlHeaders, parseDuration, parseFaultHeader, parseForm, parseInstant, parseSince, putObject, recordedIssues, requestBaseUrl, requestFingerprint, resolveAdminPrefix, responseNotes, restoreClock, restoreNamespace, seedFrom, setIdBase, sha, sigV4AccessKeyId, signSvix, signTimestamped, signTwilio, signV4, signers, snapshotNamespace, sortIssues, stableStringify, svixSecretBytes, timingSafeEqual, toBase64, toHex, unsupportedMediaType, verifyOperations, webhookAdminRoutes, withNamespaceRollback };
|
|
2685
|
+
export { ADMIN_CONTROL_PAGES, ADMIN_DOCS_URL, ADMIN_KEY_HEADER, ADMIN_PREFIX, ADMIN_ROUTE_REFERENCE, AT_HEADER, AwsError, AwsProtocolAPI, BRANCH_HEADER, CHECKPOINT_HEADER, CONTROL_HEADERS, CONTROL_HEADER_REFERENCE, Collection, ControlError, DEFAULT_JOURNAL_SIZE, DEFAULT_NAMESPACE, DroppedConnectionError, FAULT_HEADER, HEALTH_PATH, HttpError, IdSequence, IdempotencyStore, MOCKINGBIRD_HEADER, NAMESPACE_HEADER, OperationRegistryError, OutboxStore, PACKAGE_VERSION, SNAPSHOT_FORMAT, SNAPSHOT_HEADER, STANDARD_ADMIN_ROUTES, STANDARD_FAULT_PRESETS, STATE_FIELD_KINDS, UNRELEASED_VERSION, annotateResponse, anyCredential, assertAdminPrefixAvailable, assertAdminUi, assertSnapshotDocument, awsList, awsMd5, awsPage, awsParseXml, awsRecord, awsRequired, awsXml, awsXmlEscape, basicAuth, bearerToken, bodyIssues, bootSqlite, codePointLength, coerce, controlHeaders, createClock, createControlPlane, createCredentialRegistry, createFaultRegistry, createJournal, createLatencyRegistry, createMetrics, createNamespaceControls, createRng, createRuntime, createService, createWebhookHub, decodeAwsQuery, defineMock, defineOperations, deriveClock, extractCodes, extractLinks, faultEffect, faultEffects, forwardRequestContext, fromBase64, hmac, idBaseOf, inspectState, isAdminPath, issuesByField, jsonRes, jsonRes as jsonResponse, markMutationAccepted, maskCredential, matchNamespacePath, normalizeBootControls, normalizeControls, normalizeFault, normalizeIdBase, opaqueToken, outboxAdminRoutes, ownedTransport, parseControlHeaders, parseDuration, parseFaultHeader, parseForm, parseInstant, parseSince, putObject, recordedIssues, requestBaseUrl, requestFingerprint, resolveAdminPrefix, responseNotes, restoreClock, restoreNamespace, seedFrom, setIdBase, sha, sigV4AccessKeyId, signSvix, signTimestamped, signTwilio, signV4, signers, snapshotNamespace, sortIssues, stableStringify, svixSecretBytes, timingSafeEqual, toBase64, toHex, unsupportedMediaType, upstreamRequest, verifyOperations, webhookAdminRoutes, withNamespaceRollback };
|
|
2684
2686
|
export type { APIOptions, AdminBrand, AdminExtension, AdminPanel, AdminRequest, AdminRoute, AdminRoutes, AdminUi, AwsInput, AwsOperation, AwsProtocolOptions, BasicCredentials, BodyIssue, ByteEncoding, Clock, ClockControls, ClockState, ControlClock, ControlContext, ControlHeaderInput, ControlHeaderName, ControlPlane, ControlSettings, ControlState, CredentialRegistry, DerivedClock, Duration, FaultCandidate, FaultHit, FaultInput, FaultListing, FaultPreset, FaultPresetList, FaultRegistry, FaultRule, FaultSnapshot, FieldResult, FormIssue, HmacAlgorithm, IdBase, IdempotencyErrors, IdempotencyStoreOptions, InstanceContext, Instant, Journal, JournalEntry, JournalQuery, LatencyControls, LatencyRegistry, LatencyRule, LatencyRuleInput, LatencyState, ListRecordsOptions, Metrics, MetricsReport, MockCheckpoint, MockControlState, MockControls, MockCreateOptions, MockInstanceSurface, MockSnapshotInfo, MockSurface, MountedAPI, NamespaceControls, NamespaceControls$1 as NamespaceControlsInput, NamespaceSnapshot, OperationContext, OperationHandler, OperationHandlers, OutboundPolicy, OutboxItem, OutboxQuery, OwnedTransport, ParsedForm, PublishInput, RejectedRequest, RequestBodyValue, RequestControls, RequestLog, ResponseNotes, Rng, RuntimeIO, RuntimeOptions, S3Target, Service, ServiceCheckpoint, ServiceInstance, ServiceOptions, ServiceRuntime, ServiceTimelineState, SignInput, SnapshotDocument, SnapshotInfo, SnapshotStore, StandardAdminRoute, StateCollectionView, StateDeclaration, StateField, StateFieldKind, StateMeta, StatePage, StateRecord, StateView, Stored, UnsupportedMediaType, UpstreamOptions, UpstreamState, WebhookAttempt, WebhookDelivery, WebhookEndpoint, WebhookFault, WebhookHub, WebhookHubOptions, WebhookMessage, WebhookSigner };
|
package/dist/service.js
CHANGED
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
verifyOperations,
|
|
66
66
|
webhookAdminRoutes,
|
|
67
67
|
withNamespaceRollback
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-KD6FHYQP.js";
|
|
69
69
|
import "./chunk-2KDYLZXC.js";
|
|
70
70
|
import {
|
|
71
71
|
ADMIN_CONTROL_PAGES,
|
|
@@ -125,11 +125,12 @@ import {
|
|
|
125
125
|
svixSecretBytes,
|
|
126
126
|
timingSafeEqual,
|
|
127
127
|
toBase64,
|
|
128
|
-
toHex
|
|
129
|
-
|
|
128
|
+
toHex,
|
|
129
|
+
upstreamRequest
|
|
130
|
+
} from "./chunk-M4HUKBLC.js";
|
|
130
131
|
import {
|
|
131
132
|
requestBaseUrl
|
|
132
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-U36J5GCB.js";
|
|
133
134
|
import "./chunk-EQLY2YOA.js";
|
|
134
135
|
import "./chunk-HU6IOAFC.js";
|
|
135
136
|
import "./chunk-4SAK6MQT.js";
|
|
@@ -257,6 +258,7 @@ export {
|
|
|
257
258
|
toBase64,
|
|
258
259
|
toHex,
|
|
259
260
|
unsupportedMediaType,
|
|
261
|
+
upstreamRequest,
|
|
260
262
|
verifyOperations,
|
|
261
263
|
webhookAdminRoutes,
|
|
262
264
|
withNamespaceRollback
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Cross-browser baseline for every HTML surface this repo serves.
|
|
3
|
-
*
|
|
4
|
-
* `CSS_RESET` is the document sheet. `scopeReset(root)` is the same sheet
|
|
5
|
-
* limited to a widget (`:where` so later component rules still win) and with
|
|
6
|
-
* viewport heights rewritten to the widget's own box.
|
|
7
|
-
*
|
|
8
|
-
* `reset.css` is this string as a stylesheet. The package test fails when the
|
|
9
|
-
* two drift.
|
|
10
|
-
*/
|
|
11
|
-
declare const CSS_RESET = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n* {\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, CanvasText 35%, Canvas) Canvas;\n}\n\n*::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n}\n\n*::-webkit-scrollbar-track,\n*::-webkit-scrollbar-corner {\n background: Canvas;\n}\n\n*::-webkit-scrollbar-thumb {\n background: color-mix(in srgb, CanvasText 35%, Canvas);\n border: 3px solid Canvas;\n border-radius: 999px;\n}\n\nhtml {\n hanging-punctuation: first allow-end last;\n -webkit-text-size-adjust: none;\n text-size-adjust: none;\n tab-size: 4;\n font-family:\n ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable\", \"Segoe UI\",\n \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";\n font-size: 16px;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n -webkit-tap-highlight-color: transparent;\n scroll-behavior: smooth;\n background: Canvas;\n color: CanvasText;\n}\n\nbody {\n min-height: 100svh;\n line-height: 1.5;\n background: Canvas;\n color: CanvasText;\n}\n\nh1 {\n font-size: 2em;\n}\n\nh2 {\n font-size: 1.5em;\n}\n\nh3 {\n font-size: 1.17em;\n}\n\nh4 {\n font-size: 1em;\n}\n\nh5 {\n font-size: 0.83em;\n}\n\nh6 {\n font-size: 0.67em;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-weight: 700;\n line-height: 1.2;\n text-wrap: balance;\n overflow-wrap: break-word;\n}\n\np,\nli,\nfigcaption,\ndd,\ndt,\nblockquote {\n overflow-wrap: break-word;\n}\n\np,\nli,\nfigcaption,\nblockquote {\n text-wrap: pretty;\n}\n\nul,\nol,\nmenu {\n list-style: none;\n}\n\na {\n color: inherit;\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 0.15em;\n text-decoration-skip-ink: auto;\n}\n\nb,\nstrong {\n font-weight: 700;\n}\n\nsmall {\n font-size: 0.875em;\n}\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\nabbr[title] {\n text-decoration: underline dotted;\n text-underline-offset: 0.15em;\n}\n\nmark {\n background: Mark;\n color: MarkText;\n}\n\nhr {\n height: 0;\n border: 0;\n border-top: 1px solid color-mix(in srgb, CanvasText 20%, transparent);\n color: inherit;\n}\n\nimg,\npicture,\nvideo,\ncanvas {\n display: block;\n max-width: 100%;\n}\n\nimg,\nvideo {\n height: auto;\n}\n\nsvg {\n overflow: hidden;\n}\n\niframe {\n border: 0;\n max-width: 100%;\n}\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\nfieldset {\n border: 0;\n min-inline-size: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nbutton,\ninput,\nselect,\ntextarea,\noptgroup {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n vertical-align: middle;\n}\n\nbutton,\ninput[type=\"button\"],\ninput[type=\"submit\"],\ninput[type=\"reset\"] {\n appearance: none;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n text-align: center;\n}\n\ninput,\ntextarea,\nselect {\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n border-radius: 0;\n padding: 0.5em 0.65em;\n}\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"],\ninput[type=\"range\"],\ninput[type=\"file\"],\ninput[type=\"color\"],\ninput[type=\"button\"],\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"image\"],\ninput[type=\"hidden\"] {\n background: none;\n border: 0;\n padding: 0;\n border-radius: 0;\n}\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n accent-color: CanvasText;\n}\n\ninput[type=\"search\"] {\n appearance: none;\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n}\n\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n display: none;\n}\n\ninput[type=\"number\"] {\n appearance: textfield;\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n}\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ntextarea {\n resize: vertical;\n}\n\n::placeholder {\n opacity: 1;\n color: color-mix(in srgb, CanvasText 45%, transparent);\n}\n\n:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n}\n\n:focus:not(:focus-visible) {\n outline: none;\n}\n\n:disabled,\n[disabled] {\n cursor: default;\n opacity: 0.6;\n}\n\nlabel,\nsummary,\nselect,\n[role=\"button\"] {\n cursor: pointer;\n}\n\nsummary {\n display: list-item;\n}\n\ndetails {\n display: block;\n}\n\ndialog {\n margin: auto;\n padding: 1rem;\n border: 1px solid color-mix(in srgb, CanvasText 20%, transparent);\n background: Canvas;\n color: CanvasText;\n max-width: calc(100vw - 2rem);\n max-height: calc(100svh - 2rem);\n}\n\ndialog:not([open]) {\n display: none;\n}\n\n::backdrop {\n background: color-mix(in srgb, CanvasText 40%, transparent);\n}\n\n[hidden] {\n display: none !important;\n}\n\n::selection {\n background: Highlight;\n color: HighlightText;\n}\n\n@media (prefers-reduced-motion: reduce) {\n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n@media (pointer: coarse) {\n input,\n select,\n textarea {\n font-size: max(16px, 1em);\n }\n}";
|
|
12
|
-
/** Scope the reset to `root` without raising specificity above a single element. */
|
|
13
|
-
declare function scopeReset(root: string): string;
|
|
14
|
-
|
|
15
|
-
/** Product code supplies lazy surfaces; the shell knows nothing about their services. */
|
|
16
|
-
type SystemSurface = {
|
|
17
|
-
id: string;
|
|
18
|
-
label: string;
|
|
19
|
-
mount(host: HTMLElement, signal: AbortSignal): Promise<() => void> | (() => void);
|
|
20
|
-
};
|
|
21
|
-
type SystemHarness = {
|
|
22
|
-
show(id: string): Promise<void>;
|
|
23
|
-
active(): string;
|
|
24
|
-
destroy(): void;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* One visible surface, with mounted surfaces retained while hidden. Resolving mount means ready;
|
|
28
|
-
* rejecting means failed. Abort and late disposal make teardown safe during asynchronous loading.
|
|
29
|
-
* The reserved System surface is always reachable. URL state is opt-in for embedded hosts.
|
|
30
|
-
*/
|
|
31
|
-
declare function mountSystemHarness(host: HTMLElement, surfaces: readonly SystemSurface[], options?: {
|
|
32
|
-
initial?: string;
|
|
33
|
-
syncUrl?: boolean;
|
|
34
|
-
}): SystemHarness;
|
|
35
|
-
|
|
36
|
-
export { CSS_RESET, mountSystemHarness, scopeReset };
|
|
37
|
-
export type { SystemHarness, SystemSurface };
|
|
1
|
+
export * from '@crvouga/mockingbird-ui';
|