@bestagentkits/render 0.1.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/CHANGELOG.md +29 -0
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/cli.d.ts +18 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +336 -0
- package/dist/cli.js.map +1 -0
- package/dist/diagnostics.d.ts +45 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +57 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/diagram/adapter.d.ts +71 -0
- package/dist/diagram/adapter.d.ts.map +1 -0
- package/dist/diagram/adapter.js +87 -0
- package/dist/diagram/adapter.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +42 -0
- package/dist/errors.js.map +1 -0
- package/dist/hash.d.ts +14 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +27 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/yaml-error.d.ts +14 -0
- package/dist/internal/yaml-error.d.ts.map +1 -0
- package/dist/internal/yaml-error.js +12 -0
- package/dist/internal/yaml-error.js.map +1 -0
- package/dist/ir.d.ts +77 -0
- package/dist/ir.d.ts.map +1 -0
- package/dist/ir.js +20 -0
- package/dist/ir.js.map +1 -0
- package/dist/json.d.ts +23 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +47 -0
- package/dist/json.js.map +1 -0
- package/dist/registry/actions.d.ts +48 -0
- package/dist/registry/actions.d.ts.map +1 -0
- package/dist/registry/actions.js +274 -0
- package/dist/registry/actions.js.map +1 -0
- package/dist/registry/prop-schema.d.ts +108 -0
- package/dist/registry/prop-schema.d.ts.map +1 -0
- package/dist/registry/prop-schema.js +400 -0
- package/dist/registry/prop-schema.js.map +1 -0
- package/dist/registry/registry.d.ts +47 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +201 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry/roster.d.ts +53 -0
- package/dist/registry/roster.d.ts.map +1 -0
- package/dist/registry/roster.js +692 -0
- package/dist/registry/roster.js.map +1 -0
- package/dist/render/blocks.d.ts +41 -0
- package/dist/render/blocks.d.ts.map +1 -0
- package/dist/render/blocks.js +749 -0
- package/dist/render/blocks.js.map +1 -0
- package/dist/render/charts.d.ts +29 -0
- package/dist/render/charts.d.ts.map +1 -0
- package/dist/render/charts.js +235 -0
- package/dist/render/charts.js.map +1 -0
- package/dist/render/document.d.ts +40 -0
- package/dist/render/document.d.ts.map +1 -0
- package/dist/render/document.js +90 -0
- package/dist/render/document.js.map +1 -0
- package/dist/render/escape.d.ts +46 -0
- package/dist/render/escape.d.ts.map +1 -0
- package/dist/render/escape.js +108 -0
- package/dist/render/escape.js.map +1 -0
- package/dist/render/render.d.ts +52 -0
- package/dist/render/render.d.ts.map +1 -0
- package/dist/render/render.js +216 -0
- package/dist/render/render.js.map +1 -0
- package/dist/render/runtime.d.ts +25 -0
- package/dist/render/runtime.d.ts.map +1 -0
- package/dist/render/runtime.js +451 -0
- package/dist/render/runtime.js.map +1 -0
- package/dist/render/styles.d.ts +15 -0
- package/dist/render/styles.d.ts.map +1 -0
- package/dist/render/styles.js +163 -0
- package/dist/render/styles.js.map +1 -0
- package/dist/render/verify.d.ts +25 -0
- package/dist/render/verify.d.ts.map +1 -0
- package/dist/render/verify.js +168 -0
- package/dist/render/verify.js.map +1 -0
- package/dist/spec/bindings.d.ts +19 -0
- package/dist/spec/bindings.d.ts.map +1 -0
- package/dist/spec/bindings.js +51 -0
- package/dist/spec/bindings.js.map +1 -0
- package/dist/spec/bounds.d.ts +43 -0
- package/dist/spec/bounds.d.ts.map +1 -0
- package/dist/spec/bounds.js +144 -0
- package/dist/spec/bounds.js.map +1 -0
- package/dist/spec/forbidden.d.ts +27 -0
- package/dist/spec/forbidden.d.ts.map +1 -0
- package/dist/spec/forbidden.js +91 -0
- package/dist/spec/forbidden.js.map +1 -0
- package/dist/spec/migrate.d.ts +33 -0
- package/dist/spec/migrate.d.ts.map +1 -0
- package/dist/spec/migrate.js +113 -0
- package/dist/spec/migrate.js.map +1 -0
- package/dist/spec/normalize.d.ts +29 -0
- package/dist/spec/normalize.d.ts.map +1 -0
- package/dist/spec/normalize.js +649 -0
- package/dist/spec/normalize.js.map +1 -0
- package/dist/spec/parse.d.ts +22 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/spec/parse.js +62 -0
- package/dist/spec/parse.js.map +1 -0
- package/dist/spec/providers.d.ts +30 -0
- package/dist/spec/providers.d.ts.map +1 -0
- package/dist/spec/providers.js +64 -0
- package/dist/spec/providers.js.map +1 -0
- package/dist/spec/validate.d.ts +28 -0
- package/dist/spec/validate.d.ts.map +1 -0
- package/dist/spec/validate.js +68 -0
- package/dist/spec/validate.js.map +1 -0
- package/dist/theme/load-theme.d.ts +55 -0
- package/dist/theme/load-theme.d.ts.map +1 -0
- package/dist/theme/load-theme.js +219 -0
- package/dist/theme/load-theme.js.map +1 -0
- package/dist/theme/presets.d.ts +50 -0
- package/dist/theme/presets.d.ts.map +1 -0
- package/dist/theme/presets.js +304 -0
- package/dist/theme/presets.js.map +1 -0
- package/dist/theme/theme-catalog.d.ts +68 -0
- package/dist/theme/theme-catalog.d.ts.map +1 -0
- package/dist/theme/theme-catalog.js +198 -0
- package/dist/theme/theme-catalog.js.map +1 -0
- package/dist/theme/tokens.d.ts +38 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +190 -0
- package/dist/theme/tokens.js.map +1 -0
- package/dist/version.d.ts +12 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trusted interaction runtime.
|
|
3
|
+
*
|
|
4
|
+
* This is the only JavaScript the compiler emits, and it is a fixed program: a
|
|
5
|
+
* spec can bind actions, but it cannot author a handler, an expression, or a
|
|
6
|
+
* selector. Feature blocks are concatenated in a fixed order and only the
|
|
7
|
+
* features a page uses are included, so a page without a carousel ships no
|
|
8
|
+
* carousel code.
|
|
9
|
+
*
|
|
10
|
+
* Written in a conservative, dependency-free style (no arrow functions, no
|
|
11
|
+
* template literals) so the emitted artifact does not depend on a build step or
|
|
12
|
+
* a modern-browser-only syntax tier.
|
|
13
|
+
*/
|
|
14
|
+
/** Features that produce user-facing feedback and therefore need a live region. */
|
|
15
|
+
const ANNOUNCING_FEATURES = ['copy', 'filter', 'theme'];
|
|
16
|
+
const HELPERS = `
|
|
17
|
+
function q(sel, ctx) { return (ctx || doc).querySelector(sel); }
|
|
18
|
+
function qa(sel, ctx) { return Array.prototype.slice.call((ctx || doc).querySelectorAll(sel)); }
|
|
19
|
+
function byId(id) { return qa('[data-ak-id="' + id + '"]'); }
|
|
20
|
+
function announce(message) {
|
|
21
|
+
var region = q('[data-ak-live]');
|
|
22
|
+
if (region) region.textContent = message;
|
|
23
|
+
}
|
|
24
|
+
function readJson(el, attribute) {
|
|
25
|
+
var raw = el.getAttribute(attribute);
|
|
26
|
+
if (!raw) return [];
|
|
27
|
+
try { return JSON.parse(raw); } catch (error) { return []; }
|
|
28
|
+
}
|
|
29
|
+
function setPath(path, value) {
|
|
30
|
+
var parts = String(path).split('.');
|
|
31
|
+
if (parts[0] !== 'state' || parts.length < 2) return;
|
|
32
|
+
var cursor = state;
|
|
33
|
+
for (var i = 1; i < parts.length - 1; i += 1) {
|
|
34
|
+
if (typeof cursor[parts[i]] !== 'object' || cursor[parts[i]] === null) cursor[parts[i]] = {};
|
|
35
|
+
cursor = cursor[parts[i]];
|
|
36
|
+
}
|
|
37
|
+
cursor[parts[parts.length - 1]] = value;
|
|
38
|
+
syncBindings();
|
|
39
|
+
}
|
|
40
|
+
function readPath(path) {
|
|
41
|
+
var parts = String(path).split('.');
|
|
42
|
+
var cursor = state;
|
|
43
|
+
for (var i = 1; i < parts.length; i += 1) {
|
|
44
|
+
if (cursor === null || typeof cursor !== 'object') return undefined;
|
|
45
|
+
cursor = cursor[parts[i]];
|
|
46
|
+
}
|
|
47
|
+
return cursor;
|
|
48
|
+
}
|
|
49
|
+
function syncBindings() {
|
|
50
|
+
qa('[data-ak-bind]').forEach(function (el) {
|
|
51
|
+
var value = readPath(el.getAttribute('data-ak-bind'));
|
|
52
|
+
if (value === undefined || value === null) return;
|
|
53
|
+
var target = el.getAttribute('data-ak-bind-target');
|
|
54
|
+
if (target === 'value') { el.value = String(value); return; }
|
|
55
|
+
if (target === 'state') { el.setAttribute('data-ak-state', String(value)); return; }
|
|
56
|
+
if (el.tagName === 'INPUT' || el.tagName === 'OUTPUT' || el.tagName === 'SELECT') {
|
|
57
|
+
el.value = String(value);
|
|
58
|
+
} else {
|
|
59
|
+
el.textContent = String(value);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}`;
|
|
63
|
+
const FIRE = `
|
|
64
|
+
function fire(source, eventName, detail) {
|
|
65
|
+
var target = source;
|
|
66
|
+
while (target && target !== doc.documentElement) {
|
|
67
|
+
var bindings = readJson(target, 'data-ak-on-' + eventName);
|
|
68
|
+
if (bindings.length) {
|
|
69
|
+
for (var i = 0; i < bindings.length; i += 1) run(bindings[i], source, detail);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
target = target.parentElement;
|
|
73
|
+
}
|
|
74
|
+
}`;
|
|
75
|
+
const RUN = `
|
|
76
|
+
function run(action, source, detail) {
|
|
77
|
+
var type = action.action;
|
|
78
|
+
var targetId = action.target;
|
|
79
|
+
if (type === 'toggle') {
|
|
80
|
+
var nodes = byId(targetId);
|
|
81
|
+
nodes.forEach(function (node) {
|
|
82
|
+
if (node.tagName === 'DIALOG') openDialog(node);
|
|
83
|
+
else if (node.tagName === 'DETAILS') node.open = !node.open;
|
|
84
|
+
else if (node.hasAttribute('data-ak-theme-toggle')) toggleTheme();
|
|
85
|
+
else {
|
|
86
|
+
var collapsed = node.getAttribute('aria-expanded') === 'false' || node.hasAttribute('hidden');
|
|
87
|
+
if (collapsed) { node.removeAttribute('hidden'); node.setAttribute('aria-expanded', 'true'); }
|
|
88
|
+
else { node.setAttribute('hidden', ''); node.setAttribute('aria-expanded', 'false'); }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (type === 'expand' || type === 'collapse') {
|
|
94
|
+
byId(targetId).forEach(function (node) {
|
|
95
|
+
var open = type === 'expand';
|
|
96
|
+
if (node.tagName === 'DETAILS') node.open = open;
|
|
97
|
+
else node.setAttribute('aria-expanded', String(open));
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (type === 'copy') {
|
|
102
|
+
var text = '';
|
|
103
|
+
byId(targetId).forEach(function (node) { text += node.textContent || ''; });
|
|
104
|
+
copyText(text, action);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (type === 'download') {
|
|
108
|
+
var payload = '';
|
|
109
|
+
byId(targetId).forEach(function (node) { payload += node.textContent || ''; });
|
|
110
|
+
downloadText(payload, action.filename, source);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (type === 'open-url') {
|
|
114
|
+
var opened = window.open(action.url, '_blank', 'noopener,noreferrer');
|
|
115
|
+
if (opened) opened.opener = null;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (type === 'set-value') {
|
|
119
|
+
setPath(action.path, action.value);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (type === 'next' || type === 'previous') {
|
|
123
|
+
byId(targetId).forEach(function (node) { shiftSlide(node, type === 'next' ? 1 : -1, fire); });
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (type === 'filter') {
|
|
127
|
+
var query = detail && typeof detail.query === 'string' ? detail.query : String(action.query || '');
|
|
128
|
+
applyFilter(byId(targetId), query, action.match || 'text');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (type === 'select-tab') {
|
|
132
|
+
byId(targetId).forEach(function (node) { selectTab(node, action, fire); });
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (type === 'theme') {
|
|
136
|
+
applyTheme(action.value || 'toggle');
|
|
137
|
+
}
|
|
138
|
+
}`;
|
|
139
|
+
const THEME = `
|
|
140
|
+
function applyTheme(mode) {
|
|
141
|
+
var next = mode;
|
|
142
|
+
if (mode === 'toggle') {
|
|
143
|
+
var current = root.getAttribute('data-theme');
|
|
144
|
+
if (!current) current = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
145
|
+
next = current === 'dark' ? 'light' : 'dark';
|
|
146
|
+
}
|
|
147
|
+
if (mode === 'system') {
|
|
148
|
+
root.removeAttribute('data-theme');
|
|
149
|
+
next = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
150
|
+
} else {
|
|
151
|
+
root.setAttribute('data-theme', next);
|
|
152
|
+
}
|
|
153
|
+
try { window.localStorage.setItem('ak-render-theme', mode === 'system' ? 'system' : next); } catch (error) {}
|
|
154
|
+
qa('[data-ak-theme-toggle]').forEach(function (button) {
|
|
155
|
+
button.setAttribute('aria-pressed', String(next === 'dark'));
|
|
156
|
+
button.textContent = next === 'dark' ? 'Light' : 'Dark';
|
|
157
|
+
});
|
|
158
|
+
announce('Theme set to ' + next);
|
|
159
|
+
}
|
|
160
|
+
function toggleTheme() { applyTheme('toggle'); }
|
|
161
|
+
function restoreTheme() {
|
|
162
|
+
var stored = null;
|
|
163
|
+
try { stored = window.localStorage.getItem('ak-render-theme'); } catch (error) {}
|
|
164
|
+
if (!stored) return;
|
|
165
|
+
if (stored === 'system') applyTheme('system');
|
|
166
|
+
else applyTheme(stored);
|
|
167
|
+
}`;
|
|
168
|
+
const COPY = `
|
|
169
|
+
function copyText(text, action) {
|
|
170
|
+
var done = function () { announce('Copied to clipboard'); };
|
|
171
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
172
|
+
navigator.clipboard.writeText(text).then(done, function () { fallbackCopy(text, done); });
|
|
173
|
+
} else {
|
|
174
|
+
fallbackCopy(text, done);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function fallbackCopy(text, done) {
|
|
178
|
+
var area = doc.createElement('textarea');
|
|
179
|
+
area.value = text;
|
|
180
|
+
area.setAttribute('readonly', '');
|
|
181
|
+
area.style.position = 'fixed';
|
|
182
|
+
area.style.top = '-1000px';
|
|
183
|
+
doc.body.appendChild(area);
|
|
184
|
+
area.select();
|
|
185
|
+
try { doc.execCommand('copy'); done(); } catch (error) { announce('Copy failed'); }
|
|
186
|
+
doc.body.removeChild(area);
|
|
187
|
+
}
|
|
188
|
+
function downloadText(text, filename, source) {
|
|
189
|
+
var safeName = String(filename || 'artifact.txt').replace(/[^A-Za-z0-9._-]/g, '-').slice(0, 96);
|
|
190
|
+
var blob = new Blob([text], { type: 'text/plain;charset=utf-8' });
|
|
191
|
+
var url = URL.createObjectURL(blob);
|
|
192
|
+
var link = doc.createElement('a');
|
|
193
|
+
link.href = url;
|
|
194
|
+
link.download = safeName;
|
|
195
|
+
doc.body.appendChild(link);
|
|
196
|
+
link.click();
|
|
197
|
+
doc.body.removeChild(link);
|
|
198
|
+
window.setTimeout(function () { URL.revokeObjectURL(url); }, 0);
|
|
199
|
+
announce('Downloaded ' + safeName);
|
|
200
|
+
}`;
|
|
201
|
+
const DIALOG = `
|
|
202
|
+
var lastFocus = null;
|
|
203
|
+
function openDialog(dialog) {
|
|
204
|
+
lastFocus = doc.activeElement;
|
|
205
|
+
if (typeof dialog.showModal === 'function') dialog.showModal();
|
|
206
|
+
else dialog.setAttribute('open', '');
|
|
207
|
+
var focusable = q('button, [href], input', dialog);
|
|
208
|
+
if (focusable) focusable.focus();
|
|
209
|
+
fire(dialog, 'open');
|
|
210
|
+
}
|
|
211
|
+
function closeDialog(dialog) {
|
|
212
|
+
if (typeof dialog.close === 'function') dialog.close();
|
|
213
|
+
else dialog.removeAttribute('open');
|
|
214
|
+
if (lastFocus && typeof lastFocus.focus === 'function') lastFocus.focus();
|
|
215
|
+
fire(dialog, 'close');
|
|
216
|
+
}`;
|
|
217
|
+
const TABS = `
|
|
218
|
+
function selectTab(container, action, fireFn) {
|
|
219
|
+
var tabs = qa('[role="tab"]', container);
|
|
220
|
+
if (!tabs.length) return;
|
|
221
|
+
var index = tabs.length - 1;
|
|
222
|
+
if (typeof action.index === 'number') index = Math.min(Math.max(action.index, 0), tabs.length - 1);
|
|
223
|
+
else if (action.tabId) {
|
|
224
|
+
for (var i = 0; i < tabs.length; i += 1) if (tabs[i].getAttribute('data-ak-tab-id') === action.tabId) index = i;
|
|
225
|
+
} else {
|
|
226
|
+
var active = tabs.findIndex(function (tab) { return tab.getAttribute('aria-selected') === 'true'; });
|
|
227
|
+
if (active >= 0 && typeof action.index !== 'number' && !action.tabId) index = active;
|
|
228
|
+
}
|
|
229
|
+
activateTab(container, index, true, fireFn, true);
|
|
230
|
+
}
|
|
231
|
+
function activateTab(container, index, moveFocus, fireFn, announceChange) {
|
|
232
|
+
var tabs = qa('[role="tab"]', container);
|
|
233
|
+
qa('[role="tabpanel"]', container).forEach(function (panel, panelIndex) {
|
|
234
|
+
var selected = panelIndex === index;
|
|
235
|
+
panel.hidden = !selected;
|
|
236
|
+
panel.setAttribute('tabindex', selected ? '0' : '-1');
|
|
237
|
+
});
|
|
238
|
+
tabs.forEach(function (tab, tabIndex) {
|
|
239
|
+
var selected = tabIndex === index;
|
|
240
|
+
tab.setAttribute('aria-selected', String(selected));
|
|
241
|
+
tab.tabIndex = selected ? 0 : -1;
|
|
242
|
+
});
|
|
243
|
+
if (moveFocus && tabs[index]) tabs[index].focus();
|
|
244
|
+
// Only a user-driven change is worth announcing. Announcing the initial
|
|
245
|
+
// selection would make every page with tabs talk on load.
|
|
246
|
+
if (announceChange) announce('Tab ' + (index + 1) + ' of ' + tabs.length);
|
|
247
|
+
if (fireFn) fireFn(container, 'select', { index: index });
|
|
248
|
+
}
|
|
249
|
+
function wireTabs() {
|
|
250
|
+
qa('[data-ak-tabs]').forEach(function (container) {
|
|
251
|
+
activateTab(container, 0, false, fire, false);
|
|
252
|
+
qa('[role="tab"]', container).forEach(function (tab, index) {
|
|
253
|
+
tab.addEventListener('click', function () { selectTab(container, { index: index }, fire); }, false);
|
|
254
|
+
tab.addEventListener('keydown', function (event) {
|
|
255
|
+
var keys = ['ArrowRight', 'ArrowLeft', 'Home', 'End'];
|
|
256
|
+
if (keys.indexOf(event.key) === -1) return;
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
var total = qa('[role="tab"]', container).length;
|
|
259
|
+
var current = index;
|
|
260
|
+
if (event.key === 'ArrowRight') current = (index + 1) % total;
|
|
261
|
+
else if (event.key === 'ArrowLeft') current = (index - 1 + total) % total;
|
|
262
|
+
else if (event.key === 'Home') current = 0;
|
|
263
|
+
else current = total - 1;
|
|
264
|
+
activateTab(container, current, true, fire, true);
|
|
265
|
+
}, false);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
}`;
|
|
269
|
+
const CAROUSEL = `
|
|
270
|
+
function shiftSlide(carousel, delta, fireFn) {
|
|
271
|
+
var slides = qa('[data-ak-slide]', carousel);
|
|
272
|
+
if (!slides.length) return;
|
|
273
|
+
var current = slides.findIndex(function (slide) { return !slide.hidden; });
|
|
274
|
+
if (current < 0) current = 0;
|
|
275
|
+
var next = (current + delta + slides.length) % slides.length;
|
|
276
|
+
showSlide(carousel, next, fireFn, false);
|
|
277
|
+
}
|
|
278
|
+
function showSlide(carousel, index, fireFn, focus) {
|
|
279
|
+
var slides = qa('[data-ak-slide]', carousel);
|
|
280
|
+
if (!slides.length) return;
|
|
281
|
+
var bounded = Math.min(Math.max(index, 0), slides.length - 1);
|
|
282
|
+
slides.forEach(function (slide, slideIndex) {
|
|
283
|
+
var active = slideIndex === bounded;
|
|
284
|
+
slide.hidden = !active;
|
|
285
|
+
slide.setAttribute('aria-hidden', String(!active));
|
|
286
|
+
});
|
|
287
|
+
var buttons = qa('[data-ak-carousel]', carousel);
|
|
288
|
+
buttons.forEach(function (button) {
|
|
289
|
+
var isPrev = button.getAttribute('data-ak-carousel') === 'prev';
|
|
290
|
+
button.disabled = !carousel.hasAttribute('data-ak-loop') && ((isPrev && bounded === 0) || (!isPrev && bounded === slides.length - 1));
|
|
291
|
+
});
|
|
292
|
+
var status = q('[data-ak-carousel-status]', carousel);
|
|
293
|
+
if (status) status.textContent = (bounded + 1) + ' / ' + slides.length;
|
|
294
|
+
if (focus && slides[bounded]) slides[bounded].focus();
|
|
295
|
+
if (fireFn) fireFn(carousel, 'change', { index: bounded });
|
|
296
|
+
}
|
|
297
|
+
function wireCarousels() {
|
|
298
|
+
qa('[data-ak-carousel-root]').forEach(function (carousel) {
|
|
299
|
+
showSlide(carousel, 0, fire, false);
|
|
300
|
+
qa('[data-ak-carousel]', carousel).forEach(function (button) {
|
|
301
|
+
button.addEventListener('click', function () {
|
|
302
|
+
shiftSlide(carousel, button.getAttribute('data-ak-carousel') === 'next' ? 1 : -1, fire);
|
|
303
|
+
}, false);
|
|
304
|
+
});
|
|
305
|
+
carousel.addEventListener('keydown', function (event) {
|
|
306
|
+
if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
var delta = event.key === 'ArrowRight' ? 1 : -1;
|
|
309
|
+
var slides = qa('[data-ak-slide]', carousel);
|
|
310
|
+
var current = slides.findIndex(function (slide) { return !slide.hidden; });
|
|
311
|
+
showSlide(carousel, current + delta, fire, true);
|
|
312
|
+
}, false);
|
|
313
|
+
var startX = null;
|
|
314
|
+
carousel.addEventListener('touchstart', function (event) {
|
|
315
|
+
if (event.touches.length === 1) startX = event.touches[0].clientX;
|
|
316
|
+
}, { passive: true });
|
|
317
|
+
carousel.addEventListener('touchend', function (event) {
|
|
318
|
+
if (startX === null) return;
|
|
319
|
+
var endX = event.changedTouches.length ? event.changedTouches[0].clientX : startX;
|
|
320
|
+
var delta = endX - startX;
|
|
321
|
+
startX = null;
|
|
322
|
+
if (Math.abs(delta) < 40) return;
|
|
323
|
+
shiftSlide(carousel, delta < 0 ? 1 : -1, fire);
|
|
324
|
+
}, false);
|
|
325
|
+
});
|
|
326
|
+
}`;
|
|
327
|
+
const SLIDER = `
|
|
328
|
+
function wireSliders() {
|
|
329
|
+
qa('[data-ak-slider]').forEach(function (input) {
|
|
330
|
+
var output = q('[data-ak-slider-output]', input.closest('.ak-slider') || doc);
|
|
331
|
+
var sync = function () { if (output) output.textContent = input.value; };
|
|
332
|
+
sync();
|
|
333
|
+
input.addEventListener('input', function () {
|
|
334
|
+
sync();
|
|
335
|
+
fire(input, 'change', { value: input.value });
|
|
336
|
+
}, false);
|
|
337
|
+
});
|
|
338
|
+
}`;
|
|
339
|
+
const FILTER = `
|
|
340
|
+
function applyFilter(lists, query, match) {
|
|
341
|
+
var needle = String(query || '').trim().toLowerCase();
|
|
342
|
+
var visible = 0;
|
|
343
|
+
var total = 0;
|
|
344
|
+
lists.forEach(function (list) {
|
|
345
|
+
qa('[data-ak-filter-item]', list).forEach(function (item) {
|
|
346
|
+
total += 1;
|
|
347
|
+
var haystack = item.textContent || '';
|
|
348
|
+
if (match === 'label') haystack = item.getAttribute('data-ak-label') || haystack;
|
|
349
|
+
if (match === 'value') haystack = item.getAttribute('data-ak-value') || '';
|
|
350
|
+
var hit = needle === '' || haystack.toLowerCase().indexOf(needle) !== -1;
|
|
351
|
+
item.hidden = !hit;
|
|
352
|
+
if (hit) visible += 1;
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
announce(visible + ' of ' + total + ' items shown');
|
|
356
|
+
}
|
|
357
|
+
function wireFilters() {
|
|
358
|
+
qa('[data-ak-search]').forEach(function (input) {
|
|
359
|
+
var listId = input.getAttribute('data-ak-search');
|
|
360
|
+
input.addEventListener('input', function () {
|
|
361
|
+
applyFilter(byId(listId), input.value, input.getAttribute('data-ak-match') || 'text');
|
|
362
|
+
fire(input, 'filter', { query: input.value });
|
|
363
|
+
}, false);
|
|
364
|
+
});
|
|
365
|
+
}`;
|
|
366
|
+
const DELEGATION = `
|
|
367
|
+
doc.addEventListener('click', function (event) {
|
|
368
|
+
var target = event.target;
|
|
369
|
+
while (target && target !== doc.documentElement) {
|
|
370
|
+
if (target.hasAttribute && target.hasAttribute('data-ak-on-click')) {
|
|
371
|
+
var bindings = readJson(target, 'data-ak-on-click');
|
|
372
|
+
for (var i = 0; i < bindings.length; i += 1) run(bindings[i], target, null);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (target.hasAttribute && target.hasAttribute('data-ak-dialog-open')) {
|
|
376
|
+
var dialog = q('[data-ak-id="' + target.getAttribute('data-ak-dialog-open') + '"]');
|
|
377
|
+
if (dialog) openDialog(dialog);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (target.hasAttribute && target.hasAttribute('data-ak-dialog-close')) {
|
|
381
|
+
var panel = target.closest('dialog');
|
|
382
|
+
if (panel) closeDialog(panel);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
if (target.hasAttribute && target.hasAttribute('data-ak-theme-toggle')) {
|
|
386
|
+
toggleTheme();
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
target = target.parentElement;
|
|
390
|
+
}
|
|
391
|
+
}, false);
|
|
392
|
+
doc.addEventListener('keydown', function (event) {
|
|
393
|
+
if (event.key !== 'Escape') return;
|
|
394
|
+
var open = q('dialog[open]');
|
|
395
|
+
if (open) closeDialog(open);
|
|
396
|
+
}, false);`;
|
|
397
|
+
const BOOT = `
|
|
398
|
+
syncBindings();
|
|
399
|
+
restoreTheme();`;
|
|
400
|
+
/** Build the emitted runtime for the features a page actually uses. */
|
|
401
|
+
export function buildRuntime(options) {
|
|
402
|
+
const { features } = options;
|
|
403
|
+
const needsLiveRegion = ANNOUNCING_FEATURES.some((feature) => features.has(feature));
|
|
404
|
+
const parts = [];
|
|
405
|
+
if (features.has('theme'))
|
|
406
|
+
parts.push(THEME);
|
|
407
|
+
if (features.has('copy'))
|
|
408
|
+
parts.push(COPY);
|
|
409
|
+
if (features.has('dialog'))
|
|
410
|
+
parts.push(DIALOG);
|
|
411
|
+
if (features.has('filter'))
|
|
412
|
+
parts.push(FILTER);
|
|
413
|
+
if (features.has('carousel'))
|
|
414
|
+
parts.push(CAROUSEL);
|
|
415
|
+
if (features.has('slider'))
|
|
416
|
+
parts.push(SLIDER);
|
|
417
|
+
if (features.has('tabs'))
|
|
418
|
+
parts.push(TABS);
|
|
419
|
+
const wiring = [];
|
|
420
|
+
if (features.has('tabs'))
|
|
421
|
+
wiring.push('wireTabs();');
|
|
422
|
+
if (features.has('carousel'))
|
|
423
|
+
wiring.push('wireCarousels();');
|
|
424
|
+
if (features.has('slider'))
|
|
425
|
+
wiring.push('wireSliders();');
|
|
426
|
+
if (features.has('filter'))
|
|
427
|
+
wiring.push('wireFilters();');
|
|
428
|
+
return [
|
|
429
|
+
'(function () {',
|
|
430
|
+
'"use strict";',
|
|
431
|
+
'var doc = document;',
|
|
432
|
+
'var root = doc.documentElement;',
|
|
433
|
+
`var state = ${JSON.stringify(options.state)};`,
|
|
434
|
+
HELPERS,
|
|
435
|
+
RUN,
|
|
436
|
+
FIRE,
|
|
437
|
+
...parts,
|
|
438
|
+
DELEGATION,
|
|
439
|
+
BOOT,
|
|
440
|
+
...wiring,
|
|
441
|
+
needsLiveRegion ? '' : '',
|
|
442
|
+
'})();',
|
|
443
|
+
]
|
|
444
|
+
.filter((part) => part !== '')
|
|
445
|
+
.join('\n');
|
|
446
|
+
}
|
|
447
|
+
/** Features whose presence requires the live region in the document. */
|
|
448
|
+
export function needsLiveRegion(features) {
|
|
449
|
+
return ANNOUNCING_FEATURES.some((feature) => features.has(feature));
|
|
450
|
+
}
|
|
451
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/render/runtime.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emitted stylesheets.
|
|
3
|
+
*
|
|
4
|
+
* One base sheet plus per-feature sheets. The compiler emits only the feature
|
|
5
|
+
* sheets a page actually uses, which is both a size win and a correctness
|
|
6
|
+
* property: a page without a carousel cannot ship carousel CSS that a later
|
|
7
|
+
* change could accidentally apply.
|
|
8
|
+
*
|
|
9
|
+
* The sheets are static strings with no interpolation. Everything variable
|
|
10
|
+
* comes from theme tokens, so a spec cannot influence a declaration.
|
|
11
|
+
*/
|
|
12
|
+
import type { RuntimeFeature } from '../registry/roster.js';
|
|
13
|
+
export declare const BASE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{-webkit-text-size-adjust:100%}\nbody{margin:0;background:var(--ak-color-background);color:var(--ak-color-text);font-family:var(--ak-font-body);font-size:var(--ak-font-size-base);line-height:var(--ak-line-height)}\n.ak-skip{position:absolute;left:-9999px;top:0;background:var(--ak-color-surface);color:var(--ak-color-text);padding:calc(var(--ak-space-unit) * 1.5);z-index:10}\n.ak-skip:focus{left:0}\n.ak-shell{max-width:1100px;margin:0 auto;padding:calc(var(--ak-space-unit) * 3) calc(var(--ak-space-unit) * 2) calc(var(--ak-space-unit) * 8)}\n.ak-main{display:block}\n:where(a){color:var(--ak-color-accent)}\n:where(h1,h2,h3,h4,h5,h6){font-family:var(--ak-font-heading);line-height:1.2;margin:0}\nh1{font-size:calc(var(--ak-font-size-base) * 2.1)}\nh2{font-size:calc(var(--ak-font-size-base) * 1.6)}\nh3{font-size:calc(var(--ak-font-size-base) * 1.3)}\nh4,h5,h6{font-size:calc(var(--ak-font-size-base) * 1.1)}\np{margin:0}\nul,ol{margin:0;padding-left:1.4em}\ncode,kbd{font-family:var(--ak-font-mono)}\n:focus-visible{outline:2px solid var(--ak-color-accent);outline-offset:2px}\n.ak-block + .ak-block{margin-top:calc(var(--ak-space-unit) * 3)}\n[data-density=\"compact\"] .ak-block + .ak-block{margin-top:calc(var(--ak-space-unit) * 2)}\n[data-density=\"spacious\"] .ak-block + .ak-block{margin-top:calc(var(--ak-space-unit) * 4)}\n.ak-stack{display:flex;flex-direction:column;gap:calc(var(--ak-space-unit) * 2)}\n.ak-stack[data-gap=\"tight\"]{gap:var(--ak-space-unit)}\n.ak-stack[data-gap=\"loose\"]{gap:calc(var(--ak-space-unit) * 3)}\n.ak-grid{display:grid;gap:calc(var(--ak-space-unit) * 2);grid-template-columns:repeat(3,minmax(0,1fr))}\n.ak-grid[data-ak-columns=\"1\"],.ak-gallery[data-ak-columns=\"1\"]{grid-template-columns:minmax(0,1fr)}\n.ak-grid[data-ak-columns=\"2\"],.ak-gallery[data-ak-columns=\"2\"]{grid-template-columns:repeat(2,minmax(0,1fr))}\n.ak-grid[data-ak-columns=\"3\"],.ak-gallery[data-ak-columns=\"3\"]{grid-template-columns:repeat(3,minmax(0,1fr))}\n.ak-grid[data-ak-columns=\"4\"],.ak-gallery[data-ak-columns=\"4\"]{grid-template-columns:repeat(4,minmax(0,1fr))}\n.ak-grid[data-ak-columns=\"5\"],.ak-gallery[data-ak-columns=\"5\"]{grid-template-columns:repeat(5,minmax(0,1fr))}\n.ak-grid[data-ak-columns=\"6\"],.ak-gallery[data-ak-columns=\"6\"]{grid-template-columns:repeat(6,minmax(0,1fr))}\n.ak-split{display:grid;gap:calc(var(--ak-space-unit) * 2);grid-template-columns:1fr 1fr}\n.ak-split[data-ratio=\"wide-left\"]{grid-template-columns:2fr 1fr}\n.ak-split[data-ratio=\"wide-right\"]{grid-template-columns:1fr 2fr}\n.ak-muted{color:var(--ak-color-text-muted)}\n.ak-eyebrow,.ak-label{font-family:var(--ak-font-mono);font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--ak-color-text-muted)}\n.ak-hero{gap:var(--ak-space-unit);display:flex;flex-direction:column}\n.ak-hero h1{max-width:var(--ak-measure)}\n.ak-hero p{max-width:var(--ak-measure);font-size:calc(var(--ak-font-size-base) * 1.1);color:var(--ak-color-text-muted)}\n.ak-lead{font-size:calc(var(--ak-font-size-base) * 1.15)}\n.ak-caption{font-size:.85rem;color:var(--ak-color-text-muted)}\n.ak-prose{max-width:var(--ak-measure)}\n.ak-card,.ak-surface{background:var(--ak-color-surface);border:var(--ak-border-width) solid var(--ak-color-border);border-radius:var(--ak-radius-medium);padding:calc(var(--ak-space-unit) * 2)}\n.ak-card{display:flex;flex-direction:column;gap:var(--ak-space-unit)}\n.ak-card--elevated,.ak-surface{box-shadow:var(--ak-elevation-card)}\n.ak-section-head{display:flex;flex-direction:column;gap:.35em;margin-bottom:calc(var(--ak-space-unit) * 1.5)}\n.ak-divider{border:0;border-top:var(--ak-border-width) solid var(--ak-color-border);margin:calc(var(--ak-space-unit) * 2) 0;display:flex;align-items:center;gap:var(--ak-space-unit)}\n.ak-spacer{display:block}\n.ak-spacer[data-size=\"small\"]{height:var(--ak-space-unit)}\n.ak-spacer[data-size=\"medium\"]{height:calc(var(--ak-space-unit) * 2)}\n.ak-spacer[data-size=\"large\"]{height:calc(var(--ak-space-unit) * 4)}\n.ak-quote{border-left:3px solid var(--ak-color-accent);padding-left:calc(var(--ak-space-unit) * 2);font-size:calc(var(--ak-font-size-base) * 1.1)}\n.ak-quote cite{display:block;margin-top:.5em;color:var(--ak-color-text-muted);font-size:.9rem;font-style:normal}\n.ak-badge{display:inline-block;padding:.15em .6em;border-radius:999px;border:var(--ak-border-width) solid var(--ak-color-border);background:var(--ak-color-surface-raised);font-size:.78rem;font-family:var(--ak-font-mono)}\n.ak-badge[data-tone=\"info\"]{border-color:var(--ak-color-info);color:var(--ak-color-info)}\n.ak-badge[data-tone=\"success\"]{border-color:var(--ak-color-success);color:var(--ak-color-success)}\n.ak-badge[data-tone=\"warning\"]{border-color:var(--ak-color-warning);color:var(--ak-color-warning)}\n.ak-badge[data-tone=\"danger\"]{border-color:var(--ak-color-danger);color:var(--ak-color-danger)}\n.ak-kbd{display:inline-flex;gap:.2em}\n.ak-kbd kbd{border:var(--ak-border-width) solid var(--ak-color-border);border-bottom-width:2px;border-radius:var(--ak-radius-small);padding:.1em .4em;background:var(--ak-color-surface-raised);font-size:.85em}\n.ak-kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:.4em calc(var(--ak-space-unit) * 2);margin:0}\n.ak-kv dt{color:var(--ak-color-text-muted)}\n.ak-kv dd{margin:0}\n.ak-stats{display:grid;gap:calc(var(--ak-space-unit) * 2);grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin:0;padding:0;list-style:none}\n.ak-stat{background:var(--ak-color-surface);border:var(--ak-border-width) solid var(--ak-color-border);border-radius:var(--ak-radius-medium);padding:calc(var(--ak-space-unit) * 1.5)}\n.ak-stat dt{font-size:.8rem;color:var(--ak-color-text-muted);font-family:var(--ak-font-mono)}\n.ak-stat dd{margin:.2em 0 0;font-size:calc(var(--ak-font-size-base) * 1.5);font-family:var(--ak-font-heading)}\n.ak-steps{counter-reset:ak-step;list-style:none;padding:0;display:flex;flex-direction:column;gap:calc(var(--ak-space-unit) * 1.5)}\n.ak-steps li{counter-increment:ak-step;position:relative;padding-left:calc(var(--ak-space-unit) * 4)}\n.ak-steps li::before{content:counter(ak-step);position:absolute;left:0;top:0;width:24px;height:24px;border-radius:50%;background:var(--ak-color-accent);color:var(--ak-color-accent-contrast);display:flex;align-items:center;justify-content:center;font-family:var(--ak-font-mono);font-size:.8rem}\n.ak-timeline{list-style:none;padding:0;margin:0;border-left:var(--ak-border-width) solid var(--ak-color-border);display:flex;flex-direction:column;gap:calc(var(--ak-space-unit) * 2)}\n.ak-timeline li{position:relative;padding-left:calc(var(--ak-space-unit) * 2)}\n.ak-timeline li::before{content:\"\";position:absolute;left:calc(var(--ak-space-unit) * -1 - 3px);top:.45em;width:7px;height:7px;border-radius:50%;background:var(--ak-color-accent)}\n.ak-timeline time{display:block;font-family:var(--ak-font-mono);font-size:.78rem;color:var(--ak-color-text-muted)}\n.ak-table-wrap{overflow-x:auto}\ntable{border-collapse:collapse;width:100%;background:var(--ak-color-surface)}\ncaption{text-align:left;padding-bottom:.5em;color:var(--ak-color-text-muted)}\nth,td{text-align:left;padding:.55em .75em;border-bottom:var(--ak-border-width) solid var(--ak-color-border);vertical-align:top}\nthead th{background:var(--ak-color-surface-raised);font-family:var(--ak-font-mono);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}\n.ak-compare{display:grid;gap:calc(var(--ak-space-unit) * 2);grid-template-columns:1fr 1fr}\n.ak-compare h3{font-size:calc(var(--ak-font-size-base) * 1.05);margin-bottom:.5em}\n.ak-compare ul{margin:0}\n.ak-callout,.ak-alert{border-left:4px solid var(--ak-color-info);background:var(--ak-color-surface);border-radius:var(--ak-radius-medium);padding:calc(var(--ak-space-unit) * 1.5);display:flex;flex-direction:column;gap:.4em}\n.ak-callout[data-tone=\"success\"],.ak-alert[data-tone=\"success\"]{border-left-color:var(--ak-color-success)}\n.ak-callout[data-tone=\"warning\"],.ak-alert[data-tone=\"warning\"]{border-left-color:var(--ak-color-warning)}\n.ak-callout[data-tone=\"danger\"],.ak-alert[data-tone=\"danger\"]{border-left-color:var(--ak-color-danger)}\n.ak-code{margin:0;background:var(--ak-color-surface-raised);border:var(--ak-border-width) solid var(--ak-color-border);border-radius:var(--ak-radius-medium);padding:calc(var(--ak-space-unit) * 1.5);overflow-x:auto}\n.ak-code pre{margin:0;font-family:var(--ak-font-mono);font-size:.88rem;line-height:1.55}\n.ak-code-head{display:flex;justify-content:space-between;gap:var(--ak-space-unit);align-items:center;margin-bottom:.5em}\n.ak-btn{font:inherit;color:var(--ak-color-text);background:var(--ak-color-surface-raised);border:var(--ak-border-width) solid var(--ak-color-border);border-radius:var(--ak-radius-small);padding:.4em .8em;cursor:pointer;min-height:36px}\n.ak-btn:hover{border-color:var(--ak-color-accent)}\n.ak-btn[data-variant=\"primary\"]{background:var(--ak-color-accent);color:var(--ak-color-accent-contrast);border-color:var(--ak-color-accent)}\n.ak-btn[data-variant=\"ghost\"]{background:transparent;border-color:transparent}\n.ak-toolbar{display:flex;flex-wrap:wrap;gap:var(--ak-space-unit);align-items:center;padding:var(--ak-space-unit);background:var(--ak-color-surface);border:var(--ak-border-width) solid var(--ak-color-border);border-radius:var(--ak-radius-medium)}\n.ak-list{list-style:none;padding:0;display:flex;flex-direction:column;gap:.5em}\n.ak-list li{display:flex;gap:.5em;align-items:baseline;justify-content:space-between;border-bottom:var(--ak-border-width) solid var(--ak-color-border);padding-bottom:.4em}\n.ak-list li[hidden]{display:none}\nli.ak-hidden{display:none}\n.ak-progress{display:flex;flex-direction:column;gap:.35em}\n.ak-progress progress{width:100%;height:10px}\n.ak-progress progress::-webkit-progress-bar{background:var(--ak-color-surface-raised)}\n.ak-media{margin:0;display:flex;flex-direction:column;gap:.5em}\n.ak-media img,.ak-gallery img{max-width:100%;height:auto;border-radius:var(--ak-radius-medium);border:var(--ak-border-width) solid var(--ak-color-border);background:var(--ak-color-surface-raised)}\n.ak-media video{max-width:100%;border-radius:var(--ak-radius-medium)}\n.ak-gallery{display:grid;gap:calc(var(--ak-space-unit) * 2);grid-template-columns:repeat(3,minmax(0,1fr));list-style:none;padding:0;margin:0}\n.ak-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n@media (max-width:768px){body{--ak-font-size-base:16px}.ak-grid,.ak-compare,.ak-split,.ak-gallery{grid-template-columns:1fr!important}.ak-shell{padding:calc(var(--ak-space-unit) * 2) var(--ak-space-unit) calc(var(--ak-space-unit) * 6)}h1{font-size:calc(var(--ak-font-size-base) * 1.7)}}\n@media (max-width:480px){.ak-toolbar{flex-direction:column;align-items:stretch}.ak-stats{grid-template-columns:1fr 1fr}}\n@media print{.ak-skip,.ak-theme-toggle{display:none}}";
|
|
14
|
+
export declare const FEATURE_CSS: Readonly<Partial<Record<RuntimeFeature, string>>>;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/render/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,QAAQ,uwVA2GiC,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAmDzE,CAAC"}
|