@ewe-studios/foundation-wasm-ui 0.0.0-stage → 0.1.13
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/LICENSE +201 -0
- package/README.md +11 -2
- package/bundle.js +15565 -0
- package/bundle.min.js +2 -0
- package/foundation_wasm/runtime/foundation-wasm.js +2449 -0
- package/index.js +3 -0
- package/package.json +12 -4
- package/ui/runtimes/foundation-ui-actions.js +698 -0
- package/ui/runtimes/foundation-ui-behaviours.js +792 -0
- package/ui/runtimes/foundation-ui-bootstrap.js +13 -0
- package/ui/runtimes/foundation-ui-connections.js +99 -0
- package/ui/runtimes/foundation-ui-frames.js +1023 -0
- package/ui/runtimes/foundation-ui-live.js +186 -0
- package/ui/runtimes/foundation-ui-recovery.js +66 -0
- package/ui/runtimes/foundation-ui-vocab.js +262 -0
- package/ui/runtimes/foundation-ui-wire.js +1 -0
- package/ui/runtimes/foundation-wasm-ui.js +2164 -0
- package/ui/runtimes/platform-scheme-interceptor.js +124 -0
- package/ui/runtimes/runtime-entry.js +4 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as wire from "./foundation-ui-wire.js";
|
|
2
|
+
import { VOCABULARY_VERSION } from "./foundation-ui-vocab.js";
|
|
3
|
+
import { base64urlEncode } from "./foundation-ui-frames.js";
|
|
4
|
+
|
|
5
|
+
function requestBytes(session, request) {
|
|
6
|
+
const builder = new wire.Builder();
|
|
7
|
+
const frame = new wire.FrameT(1, session, 0n, wire.FrameKind.FrameRequest, request);
|
|
8
|
+
wire.Frame.finishFrameBuffer(builder, frame.pack(builder));
|
|
9
|
+
return builder.asUint8Array();
|
|
10
|
+
}
|
|
11
|
+
function pushed(bytes) {
|
|
12
|
+
const frame = wire.Frame.getRootAsFrame(new wire.ByteBuffer(bytes));
|
|
13
|
+
const body = frame.kindType() === wire.FrameKind.FrameMessage && frame.kind(new wire.FrameMessage());
|
|
14
|
+
const control = body && body.messagesLength() ? body.messages(0)?.control() : null;
|
|
15
|
+
return {frame, body, control};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
import { frameMountTarget, frameConnections } from "./foundation-wasm-ui.js";
|
|
19
|
+
|
|
20
|
+
// Associate an ordered stream with the element that owns its connection.
|
|
21
|
+
function integer(element, attribute) {
|
|
22
|
+
const raw = element.getAttribute(attribute);
|
|
23
|
+
if (raw === null) return undefined;
|
|
24
|
+
if (!/^\d+$/.test(raw)) throw new TypeError("Expected an unsigned integer for " + attribute);
|
|
25
|
+
const n = BigInt(raw);
|
|
26
|
+
if (n > 0xffffffffffffffffn) throw new RangeError(attribute + " exceeds u64");
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function bindLiveMounts(runtime, frames) {
|
|
31
|
+
const streams = new Map();
|
|
32
|
+
const connections = frames.deps.connections ?? frameConnections();
|
|
33
|
+
runtime.connections = connections;
|
|
34
|
+
const previousGap = frames.deps.onGap;
|
|
35
|
+
frames.deps.onGap = gap => {
|
|
36
|
+
for (const binding of streams.get(gap.streamId) ?? []) {
|
|
37
|
+
if (!gap.view || gap.view === binding.owner) binding.resume(gap.resumeFrom);
|
|
38
|
+
}
|
|
39
|
+
previousGap?.(gap);
|
|
40
|
+
};
|
|
41
|
+
runtime.onMountConnect = (element, streaming) => {
|
|
42
|
+
if (element.getAttribute("protocol") !== "frame") return null;
|
|
43
|
+
let stream = integer(element, "data-channel-id");
|
|
44
|
+
const owner = frames.viewOwner(element);
|
|
45
|
+
const recovery = frames.loaders.get(owner);
|
|
46
|
+
const generation = recovery?.generation;
|
|
47
|
+
const current = () => active && (!recovery || recovery.accepts(generation));
|
|
48
|
+
const expired = () => {
|
|
49
|
+
if (!current()) return;
|
|
50
|
+
if (recovery) {
|
|
51
|
+
// The loader reports a failed recovery to its owner.
|
|
52
|
+
Promise.resolve(recovery.expire(stream)).catch(() => {});
|
|
53
|
+
}
|
|
54
|
+
else if (frames.deps.requestSnapshot) Promise.resolve(frames.deps.requestSnapshot({element, stream})).catch(error => frames.deps.onError?.(error));
|
|
55
|
+
else frames.deps.onError?.({code:"ReplayExpired", stream});
|
|
56
|
+
};
|
|
57
|
+
const start = integer(element, "data-resume-from") ?? 0n;
|
|
58
|
+
const local = element.getAttribute("transport") === "local";
|
|
59
|
+
let active = true;
|
|
60
|
+
let resumeOnConnection;
|
|
61
|
+
function attach(id) {
|
|
62
|
+
stream = id;
|
|
63
|
+
if (start && frames.cursor(id, owner) === undefined) frames.setCursor(id, start, owner);
|
|
64
|
+
if (streaming && !local) {
|
|
65
|
+
let mounts = streams.get(id);
|
|
66
|
+
if (!mounts) streams.set(id, mounts = new Set());
|
|
67
|
+
mounts.add(binding);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const binding = {
|
|
71
|
+
local,
|
|
72
|
+
owner,
|
|
73
|
+
expired,
|
|
74
|
+
managed({ api, data, transport }) {
|
|
75
|
+
const kind = element.getAttribute("transport") ?? "sse";
|
|
76
|
+
const sharing = element.getAttribute("data-connection-shared");
|
|
77
|
+
const shared = sharing === null ? kind === "websocket" || kind === "ws" : sharing === "true";
|
|
78
|
+
const keepAlive = element.getAttribute("data-connection-keep-alive") === "true";
|
|
79
|
+
const socket = kind === "websocket" || kind === "ws";
|
|
80
|
+
const adapter = socket ? "websocket" : kind === "http" ? "chunked" : kind;
|
|
81
|
+
if (!connections.supports(adapter)) return null;
|
|
82
|
+
const negotiate = Boolean(frames.deps.deliverySession) && (socket || ["sse", "chunked"].includes(adapter));
|
|
83
|
+
if (!shared && !keepAlive && !negotiate) return null;
|
|
84
|
+
if (sharing === null && !keepAlive && !negotiate && !frames.deps.connections) return null;
|
|
85
|
+
const endpoint = (shared || negotiate) ? api : binding.url(api);
|
|
86
|
+
const subscription = connections.nextTag();
|
|
87
|
+
const hello = new wire.ClientHelloT(VOCABULARY_VERSION, wire.Platform.Web, wire.MountSurface.Web, 0n, true, subscription);
|
|
88
|
+
const greeting = requestBytes(0n, new wire.FrameRequestT(null, hello));
|
|
89
|
+
const report = error => frames.deps.onError?.({code: "Transport", detail: String(error)});
|
|
90
|
+
let handle, session, wasConnected = false, pendingCursor = recovery && !(shared && adapter === "sse") ? start : start || null;
|
|
91
|
+
const resume = async cursor => {
|
|
92
|
+
if (stream === undefined || !session) { pendingCursor = cursor; return; }
|
|
93
|
+
const request = new wire.FrameRequestT(null, null, new wire.ResumeSubscriptionT(session, subscription, stream, cursor));
|
|
94
|
+
const bytes = requestBytes(session, request);
|
|
95
|
+
if (socket) await handle.send(bytes);
|
|
96
|
+
else {
|
|
97
|
+
const response = await (frames.deps.fetchFn ?? fetch)(endpoint, {method: "POST", body: bytes,
|
|
98
|
+
headers: {...frames.deps.connectionHeaders, "content-type": "application/primal-frame"}});
|
|
99
|
+
if (response.status === 410) { expired(); return; }
|
|
100
|
+
if (!response.ok) throw new Error("Resume request failed with HTTP " + response.status);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const context = bytes => {
|
|
104
|
+
const caps = pushed(bytes).control?.caps();
|
|
105
|
+
if (!caps?.subscriptionResume() || (socket && caps.requestTag() !== subscription)) return;
|
|
106
|
+
session = caps.streamId();
|
|
107
|
+
if (wasConnected && !shared && stream !== undefined) pendingCursor ??= frames.cursor(stream, owner) ?? start;
|
|
108
|
+
wasConnected = true;
|
|
109
|
+
if (pendingCursor !== null) { const cursor = pendingCursor; pendingCursor = null; resume(cursor).catch(report); }
|
|
110
|
+
};
|
|
111
|
+
if (negotiate) resumeOnConnection = cursor => resume(cursor).catch(report);
|
|
112
|
+
handle = connections.acquire({
|
|
113
|
+
transport: adapter, endpoint, shared, keepAlive,
|
|
114
|
+
base: element.ownerDocument?.baseURI ?? globalThis.location?.href,
|
|
115
|
+
headers: negotiate && !socket ? {...frames.deps.connectionHeaders, Accept: adapter === "chunked" ? "application/primal-frame" : "text/event-stream", "X-Ewe-Hello": base64urlEncode(greeting)} : frames.deps.connectionHeaders,
|
|
116
|
+
isContext: !socket && negotiate ? bytes => Boolean(pushed(bytes).control?.caps()) : undefined,
|
|
117
|
+
channel: element._transportOverride, settings: element._transportOverride ?? (element.hasAttribute?.("data") ? data : frames.deps.connectionSettings),
|
|
118
|
+
authority: frames.deps.authority,
|
|
119
|
+
data: element.getAttribute("data") === null ? undefined : data,
|
|
120
|
+
}, {
|
|
121
|
+
owner,
|
|
122
|
+
onOpen() {
|
|
123
|
+
if (socket && negotiate) queueMicrotask(() => { if (active) handle.send(greeting).catch(report); });
|
|
124
|
+
},
|
|
125
|
+
onContext: context,
|
|
126
|
+
accept(bytes) {
|
|
127
|
+
const {frame, body, control} = pushed(bytes);
|
|
128
|
+
if (!body) return false;
|
|
129
|
+
if (control?.caps()) return socket && control.caps().requestTag() === subscription;
|
|
130
|
+
return (stream === undefined || stream === frame.streamId()) &&
|
|
131
|
+
!body.ack() && (!body.subscriptionId() || body.subscriptionId() === subscription);
|
|
132
|
+
},
|
|
133
|
+
receive(bytes) {
|
|
134
|
+
const {control} = pushed(bytes);
|
|
135
|
+
if (control?.caps()) { context(bytes); return; }
|
|
136
|
+
if (control?.replayExpired()) {
|
|
137
|
+
expired();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
binding.receive({ type: "frame", frames: [bytes] });
|
|
141
|
+
},
|
|
142
|
+
onError(cause) {
|
|
143
|
+
session = null;
|
|
144
|
+
if ((socket || !shared) && stream !== undefined) pendingCursor = frames.cursor(stream, owner) ?? start;
|
|
145
|
+
report(cause);
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
return handle;
|
|
149
|
+
},
|
|
150
|
+
url(api) {
|
|
151
|
+
const cursor = stream === undefined ? undefined : frames.cursor(stream, owner) ?? start;
|
|
152
|
+
if (stream === undefined || !cursor) return api;
|
|
153
|
+
const url = new URL(api, element.ownerDocument?.baseURI ?? globalThis.location.href);
|
|
154
|
+
url.searchParams.set("stream_id", stream.toString());
|
|
155
|
+
url.searchParams.set("resume_from", cursor.toString());
|
|
156
|
+
return url.href;
|
|
157
|
+
},
|
|
158
|
+
receive(result) {
|
|
159
|
+
if (!current()) return;
|
|
160
|
+
if (result.type !== "frame") throw new Error("Frame mount received another protocol");
|
|
161
|
+
for (const bytes of result.frames) {
|
|
162
|
+
frames.receive(bytes, { active:current, get viewMount() {
|
|
163
|
+
return active && frameMountTarget(element, element.getAttribute("target"), element.ownerDocument);
|
|
164
|
+
}, observeStream(id) {
|
|
165
|
+
if (stream === undefined) attach(id);
|
|
166
|
+
else if (stream !== id) throw new Error("Unexpected stream identifier");
|
|
167
|
+
} });
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
resume(cursor) {
|
|
171
|
+
if (!current()) return;
|
|
172
|
+
element.setAttribute("data-resume-from", String(cursor));
|
|
173
|
+
if (resumeOnConnection) resumeOnConnection(cursor);
|
|
174
|
+
else element._restartFrameStream?.();
|
|
175
|
+
},
|
|
176
|
+
close() {
|
|
177
|
+
active = false;
|
|
178
|
+
const mounts = streams.get(stream);
|
|
179
|
+
mounts?.delete(binding);
|
|
180
|
+
if (mounts?.size === 0) streams.delete(stream);
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
if (stream !== undefined) attach(stream);
|
|
184
|
+
return binding;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// A mounted view owns its loader and recovery attempts.
|
|
2
|
+
export class ViewRecovery {
|
|
3
|
+
constructor(load, install, {maxAttempts = 3, onError = () => {}} = {}) {
|
|
4
|
+
if (!Number.isSafeInteger(maxAttempts) || maxAttempts < 1) throw new RangeError("Invalid recovery attempt limit");
|
|
5
|
+
this.load = load;
|
|
6
|
+
this.install = install;
|
|
7
|
+
this.maxAttempts = maxAttempts;
|
|
8
|
+
this.onError = onError;
|
|
9
|
+
this.attempts = 0;
|
|
10
|
+
this.generation = 0;
|
|
11
|
+
this.active = true;
|
|
12
|
+
this.ready = false;
|
|
13
|
+
this.expiredStreams = new Set();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
open() { return this.run(); }
|
|
17
|
+
|
|
18
|
+
expire(stream) {
|
|
19
|
+
if (!this.active) return;
|
|
20
|
+
this.expiredStreams.add(stream);
|
|
21
|
+
if (this.flight) return this.flight;
|
|
22
|
+
if (this.attempts >= this.maxAttempts) {
|
|
23
|
+
this.ready = false;
|
|
24
|
+
this.onError(new Error("View recovery attempt limit reached"));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.attempts++;
|
|
28
|
+
return this.run();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
retry() {
|
|
32
|
+
if (this.flight) return this.flight;
|
|
33
|
+
this.attempts = 0;
|
|
34
|
+
return this.run();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
run() {
|
|
38
|
+
if (!this.active || this.flight) return this.flight;
|
|
39
|
+
const generation = ++this.generation;
|
|
40
|
+
this.ready = false;
|
|
41
|
+
const controller = new AbortController();
|
|
42
|
+
this.abort = controller;
|
|
43
|
+
this.flight = Promise.resolve().then(() => this.load(controller.signal)).then(bytes => {
|
|
44
|
+
if (!this.active || this.generation !== generation) return;
|
|
45
|
+
this.ready = true;
|
|
46
|
+
this.install(bytes, this.expiredStreams);
|
|
47
|
+
this.expiredStreams.clear();
|
|
48
|
+
}).catch(error => {
|
|
49
|
+
if (!this.active || this.generation !== generation) return;
|
|
50
|
+
this.ready = false;
|
|
51
|
+
this.onError(error);
|
|
52
|
+
throw error;
|
|
53
|
+
}).finally(() => { if (this.generation === generation) this.flight = null; });
|
|
54
|
+
return this.flight;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
accepts(generation) { return this.active && this.ready && generation === this.generation; }
|
|
58
|
+
|
|
59
|
+
close() {
|
|
60
|
+
this.active = false;
|
|
61
|
+
this.ready = false;
|
|
62
|
+
this.generation++;
|
|
63
|
+
this.abort?.abort();
|
|
64
|
+
this.expiredStreams.clear();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
// Generated by foundation_ui_wire::vocab::vocab_js. Do not edit.
|
|
2
|
+
export const VOCABULARY_VERSION = 12;
|
|
3
|
+
export const STRUCTURED_INPUT_VERSION = 9;
|
|
4
|
+
export const MANAGED_CONNECTION_VERSION = 10;
|
|
5
|
+
export const PROP_KIND = Object.freeze([
|
|
6
|
+
null,
|
|
7
|
+
"Length",
|
|
8
|
+
"Length",
|
|
9
|
+
"Alignment",
|
|
10
|
+
"ColorToken",
|
|
11
|
+
"FontToken",
|
|
12
|
+
"Bool",
|
|
13
|
+
"Text",
|
|
14
|
+
"Axis",
|
|
15
|
+
"Text",
|
|
16
|
+
"Bool",
|
|
17
|
+
"Text",
|
|
18
|
+
"Text",
|
|
19
|
+
"ColorToken",
|
|
20
|
+
"Length",
|
|
21
|
+
"Length",
|
|
22
|
+
"Bool",
|
|
23
|
+
null,
|
|
24
|
+
"Text",
|
|
25
|
+
"Text",
|
|
26
|
+
]);
|
|
27
|
+
export const WEB_KINDS = Object.freeze([
|
|
28
|
+
null,
|
|
29
|
+
Object.freeze({tag: "div", cls: "ewe-stack", attrs: Object.freeze([])}),
|
|
30
|
+
Object.freeze({tag: "span", cls: "ewe-text", attrs: Object.freeze([])}),
|
|
31
|
+
Object.freeze({tag: "img", cls: "ewe-image", attrs: Object.freeze([])}),
|
|
32
|
+
Object.freeze({tag: "button", cls: "ewe-button", attrs: Object.freeze([Object.freeze(["type", "button"])])}),
|
|
33
|
+
Object.freeze({tag: "input", cls: "ewe-text-input", attrs: Object.freeze([Object.freeze(["type", "text"])])}),
|
|
34
|
+
Object.freeze({tag: "input", cls: "ewe-toggle", attrs: Object.freeze([Object.freeze(["type", "checkbox"]), Object.freeze(["role", "switch"])])}),
|
|
35
|
+
Object.freeze({tag: "div", cls: "ewe-list", attrs: Object.freeze([Object.freeze(["role", "list"])])}),
|
|
36
|
+
Object.freeze({tag: "div", cls: "ewe-scroll", attrs: Object.freeze([])}),
|
|
37
|
+
Object.freeze({tag: "div", cls: "ewe-spacer", attrs: Object.freeze([Object.freeze(["aria-hidden", "true"])])}),
|
|
38
|
+
Object.freeze({tag: "div", cls: "ewe-overlay", attrs: Object.freeze([])}),
|
|
39
|
+
Object.freeze({tag: "dialog", cls: "ewe-modal", attrs: Object.freeze([])}),
|
|
40
|
+
Object.freeze({tag: "section", cls: "ewe-bottom-sheet", attrs: Object.freeze([])}),
|
|
41
|
+
Object.freeze({tag: "h1", cls: "ewe-navigation-title", attrs: Object.freeze([])}),
|
|
42
|
+
Object.freeze({tag: "button", cls: "ewe-toolbar-button", attrs: Object.freeze([Object.freeze(["type", "button"])])}),
|
|
43
|
+
Object.freeze({tag: "div", cls: "ewe-segmented-control", attrs: Object.freeze([Object.freeze(["role", "group"])])}),
|
|
44
|
+
Object.freeze({tag: "ul", cls: "ewe-inset-list", attrs: Object.freeze([])}),
|
|
45
|
+
Object.freeze({tag: "li", cls: "ewe-checklist-row", attrs: Object.freeze([])}),
|
|
46
|
+
Object.freeze({tag: "button", cls: "ewe-checkmark-button", attrs: Object.freeze([Object.freeze(["type", "button"])])}),
|
|
47
|
+
Object.freeze({tag: "button", cls: "ewe-destructive-button", attrs: Object.freeze([Object.freeze(["type", "button"])])}),
|
|
48
|
+
Object.freeze({tag: "p", cls: "ewe-list-footer", attrs: Object.freeze([])}),
|
|
49
|
+
Object.freeze({tag: "dialog", cls: "ewe-confirmation-dialog", attrs: Object.freeze([Object.freeze(["role", "alertdialog"])])}),
|
|
50
|
+
Object.freeze({tag: "h2", cls: "ewe-sheet-title", attrs: Object.freeze([])}),
|
|
51
|
+
Object.freeze({tag: "button", cls: "ewe-submit-button", attrs: Object.freeze([Object.freeze(["type", "submit"])])}),
|
|
52
|
+
Object.freeze({tag: "button", cls: "ewe-cancel-button", attrs: Object.freeze([Object.freeze(["type", "button"])])}),
|
|
53
|
+
Object.freeze({tag: "canvas", cls: "ewe-drawing-surface", attrs: Object.freeze([])}),
|
|
54
|
+
]);
|
|
55
|
+
export const WEB_EVENTS = Object.freeze([
|
|
56
|
+
null,
|
|
57
|
+
"click",
|
|
58
|
+
"change",
|
|
59
|
+
"submit",
|
|
60
|
+
"focus",
|
|
61
|
+
"blur",
|
|
62
|
+
]);
|
|
63
|
+
export const TAG_NAMES = Object.freeze([
|
|
64
|
+
"div",
|
|
65
|
+
"span",
|
|
66
|
+
"input",
|
|
67
|
+
"button",
|
|
68
|
+
"html",
|
|
69
|
+
"head",
|
|
70
|
+
"body",
|
|
71
|
+
"title",
|
|
72
|
+
"base",
|
|
73
|
+
"link",
|
|
74
|
+
"meta",
|
|
75
|
+
"style",
|
|
76
|
+
"script",
|
|
77
|
+
"noscript",
|
|
78
|
+
"template",
|
|
79
|
+
"slot",
|
|
80
|
+
"main",
|
|
81
|
+
"section",
|
|
82
|
+
"nav",
|
|
83
|
+
"article",
|
|
84
|
+
"aside",
|
|
85
|
+
"header",
|
|
86
|
+
"footer",
|
|
87
|
+
"address",
|
|
88
|
+
"h1",
|
|
89
|
+
"h2",
|
|
90
|
+
"h3",
|
|
91
|
+
"h4",
|
|
92
|
+
"h5",
|
|
93
|
+
"h6",
|
|
94
|
+
"hgroup",
|
|
95
|
+
"p",
|
|
96
|
+
"hr",
|
|
97
|
+
"pre",
|
|
98
|
+
"blockquote",
|
|
99
|
+
"ol",
|
|
100
|
+
"ul",
|
|
101
|
+
"menu",
|
|
102
|
+
"li",
|
|
103
|
+
"dl",
|
|
104
|
+
"dt",
|
|
105
|
+
"dd",
|
|
106
|
+
"figure",
|
|
107
|
+
"figcaption",
|
|
108
|
+
"search",
|
|
109
|
+
"a",
|
|
110
|
+
"em",
|
|
111
|
+
"strong",
|
|
112
|
+
"small",
|
|
113
|
+
"s",
|
|
114
|
+
"cite",
|
|
115
|
+
"q",
|
|
116
|
+
"dfn",
|
|
117
|
+
"abbr",
|
|
118
|
+
"ruby",
|
|
119
|
+
"rt",
|
|
120
|
+
"rp",
|
|
121
|
+
"data",
|
|
122
|
+
"time",
|
|
123
|
+
"code",
|
|
124
|
+
"var",
|
|
125
|
+
"samp",
|
|
126
|
+
"kbd",
|
|
127
|
+
"sub",
|
|
128
|
+
"sup",
|
|
129
|
+
"i",
|
|
130
|
+
"b",
|
|
131
|
+
"u",
|
|
132
|
+
"mark",
|
|
133
|
+
"bdi",
|
|
134
|
+
"bdo",
|
|
135
|
+
"br",
|
|
136
|
+
"wbr",
|
|
137
|
+
"ins",
|
|
138
|
+
"del",
|
|
139
|
+
"picture",
|
|
140
|
+
"source",
|
|
141
|
+
"img",
|
|
142
|
+
"iframe",
|
|
143
|
+
"embed",
|
|
144
|
+
"object",
|
|
145
|
+
"video",
|
|
146
|
+
"audio",
|
|
147
|
+
"track",
|
|
148
|
+
"map",
|
|
149
|
+
"area",
|
|
150
|
+
"svg",
|
|
151
|
+
"math",
|
|
152
|
+
"canvas",
|
|
153
|
+
"table",
|
|
154
|
+
"caption",
|
|
155
|
+
"colgroup",
|
|
156
|
+
"col",
|
|
157
|
+
"tbody",
|
|
158
|
+
"thead",
|
|
159
|
+
"tfoot",
|
|
160
|
+
"tr",
|
|
161
|
+
"td",
|
|
162
|
+
"th",
|
|
163
|
+
"form",
|
|
164
|
+
"label",
|
|
165
|
+
"select",
|
|
166
|
+
"datalist",
|
|
167
|
+
"optgroup",
|
|
168
|
+
"option",
|
|
169
|
+
"textarea",
|
|
170
|
+
"output",
|
|
171
|
+
"progress",
|
|
172
|
+
"meter",
|
|
173
|
+
"fieldset",
|
|
174
|
+
"legend",
|
|
175
|
+
"details",
|
|
176
|
+
"summary",
|
|
177
|
+
"dialog",
|
|
178
|
+
]);
|
|
179
|
+
export const ATTR_NAMES = Object.freeze([
|
|
180
|
+
"class",
|
|
181
|
+
"id",
|
|
182
|
+
"style",
|
|
183
|
+
"value",
|
|
184
|
+
"title",
|
|
185
|
+
"lang",
|
|
186
|
+
"dir",
|
|
187
|
+
"hidden",
|
|
188
|
+
"tabindex",
|
|
189
|
+
"accesskey",
|
|
190
|
+
"draggable",
|
|
191
|
+
"contenteditable",
|
|
192
|
+
"spellcheck",
|
|
193
|
+
"translate",
|
|
194
|
+
"role",
|
|
195
|
+
"slot",
|
|
196
|
+
"part",
|
|
197
|
+
"is",
|
|
198
|
+
"href",
|
|
199
|
+
"src",
|
|
200
|
+
"srcset",
|
|
201
|
+
"sizes",
|
|
202
|
+
"alt",
|
|
203
|
+
"rel",
|
|
204
|
+
"target",
|
|
205
|
+
"download",
|
|
206
|
+
"referrerpolicy",
|
|
207
|
+
"crossorigin",
|
|
208
|
+
"integrity",
|
|
209
|
+
"loading",
|
|
210
|
+
"media",
|
|
211
|
+
"type",
|
|
212
|
+
"name",
|
|
213
|
+
"placeholder",
|
|
214
|
+
"disabled",
|
|
215
|
+
"readonly",
|
|
216
|
+
"required",
|
|
217
|
+
"checked",
|
|
218
|
+
"selected",
|
|
219
|
+
"multiple",
|
|
220
|
+
"min",
|
|
221
|
+
"max",
|
|
222
|
+
"step",
|
|
223
|
+
"pattern",
|
|
224
|
+
"minlength",
|
|
225
|
+
"maxlength",
|
|
226
|
+
"autocomplete",
|
|
227
|
+
"autofocus",
|
|
228
|
+
"for",
|
|
229
|
+
"form",
|
|
230
|
+
"action",
|
|
231
|
+
"method",
|
|
232
|
+
"enctype",
|
|
233
|
+
"novalidate",
|
|
234
|
+
"accept",
|
|
235
|
+
"rows",
|
|
236
|
+
"cols",
|
|
237
|
+
"wrap",
|
|
238
|
+
"list",
|
|
239
|
+
"size",
|
|
240
|
+
"colspan",
|
|
241
|
+
"rowspan",
|
|
242
|
+
"headers",
|
|
243
|
+
"scope",
|
|
244
|
+
"width",
|
|
245
|
+
"height",
|
|
246
|
+
"controls",
|
|
247
|
+
"autoplay",
|
|
248
|
+
"loop",
|
|
249
|
+
"muted",
|
|
250
|
+
"preload",
|
|
251
|
+
"poster",
|
|
252
|
+
"playsinline",
|
|
253
|
+
"charset",
|
|
254
|
+
"content",
|
|
255
|
+
"http-equiv",
|
|
256
|
+
"open",
|
|
257
|
+
"label",
|
|
258
|
+
"datetime",
|
|
259
|
+
"cite",
|
|
260
|
+
"data",
|
|
261
|
+
]);
|
|
262
|
+
export const CORE_CSS = "[primal-id][hidden]{display:none!important}\n.ewe-stack{display:flex;flex-direction:column}\n.ewe-list{display:flex;flex-direction:column}\n.ewe-scroll{overflow:auto}\n.ewe-spacer{flex:1 1 auto}\n.ewe-drawing-surface{width:300px;height:150px}\n.ewe-navigation-title,.ewe-sheet-title{font-family:system-ui,sans-serif;line-height:1.2;letter-spacing:-.025em;margin:.3em 0}\n.ewe-toolbar-button,.ewe-submit-button,.ewe-cancel-button,.ewe-destructive-button,.ewe-checkmark-button,.ewe-segmented-control button{font:inherit;border:1px solid color-mix(in srgb,CanvasText 25%,Canvas);border-radius:.5em;padding:.45em .85em;cursor:pointer}\n.ewe-toolbar-button,.ewe-submit-button{align-self:flex-start;background:var(--color-primary,ButtonText);color:Canvas;color:contrast-color(var(--color-primary,ButtonText))}\n.ewe-cancel-button,.ewe-checkmark-button,.ewe-segmented-control button{background:Canvas;color:CanvasText}\n.ewe-destructive-button{background:Canvas;color:var(--color-error,#a51f26)}\n.ewe-segmented-control,.ewe-checklist-row{display:flex;align-items:center;flex-wrap:wrap;gap:.45em}\n.ewe-segmented-control{margin-block:.75em}\n.ewe-checklist-row{padding-block:.6em;border-block-end:1px solid color-mix(in srgb,CanvasText 15%,Canvas)}\n.ewe-checklist-row>.ewe-text{flex:1 1 auto}\n.ewe-inset-list{padding-inline-start:0;list-style:none;margin-block:.5em}\n.ewe-list-footer{font-size:.9em}\n.ewe-segmented-control button[aria-pressed=true]{background:var(--color-primary,ButtonText);color:Canvas;color:contrast-color(var(--color-primary,ButtonText));font-weight:600}\n.ewe-confirmation-dialog,.ewe-modal{font:inherit;color:CanvasText;background:Canvas;border:1px solid ButtonBorder;border-radius:.75em}\n.ewe-confirmation-dialog::backdrop,.ewe-modal::backdrop{background:rgb(0 0 0 / .35)}\n.ewe-confirmation-dialog>.ewe-sheet-title{margin-block-end:.8em}\n.ewe-overlay{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;pointer-events:none}\n.ewe-overlay[popover]{margin:0;border:0;padding:0;inline-size:auto;block-size:auto;overflow:visible;background:transparent;color:inherit}\n.ewe-overlay[popover]:not(:popover-open){display:none}\n.ewe-overlay>*{pointer-events:auto}\n.ewe-modal{max-block-size:100dvh;box-sizing:border-box}\n.ewe-modal:has(>.ewe-bottom-sheet){inset:auto 0 0;margin:0;inline-size:100%;max-inline-size:none;padding:0;border:0}\n.ewe-bottom-sheet{display:flex;flex-direction:column;margin-block-start:auto;max-block-size:100dvh;overflow:auto;padding-block-end:env(safe-area-inset-bottom);box-sizing:border-box;background:Canvas;color:CanvasText}\n.ewe-bottom-sheet:has(>.ewe-submit-button){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.8em;padding:1.25em max(1.25em,calc((100% - 36em)/2)) max(1.25em,env(safe-area-inset-bottom))}\n.ewe-bottom-sheet:has(>.ewe-submit-button)>*{grid-column:1/-1}\n.ewe-bottom-sheet:has(>.ewe-submit-button)>.ewe-cancel-button{grid-column:1;justify-self:end}\n.ewe-bottom-sheet:has(>.ewe-submit-button)>.ewe-submit-button{grid-column:2}\n.ewe-bottom-sheet>.ewe-text-input{font:inherit;padding:.65em .8em;border:1px solid GrayText;border-radius:.5em}\n";
|