@wireweave/core 4.0.0-beta.15 → 4.0.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.cjs +13 -13
- package/dist/app.js +2 -2
- package/dist/{chunk-24W2GEKO.js → chunk-6EMG345O.js} +2 -2
- package/dist/{chunk-VCHXMPZL.cjs → chunk-7ZRMSFWZ.cjs} +37 -37
- package/dist/{chunk-ZPHNXJRY.cjs → chunk-CGTYVLPA.cjs} +4 -4
- package/dist/{chunk-H2SWIUMU.cjs → chunk-EWCLLW6P.cjs} +2 -0
- package/dist/{chunk-XODYFTKU.cjs → chunk-J5WEVZIX.cjs} +89 -502
- package/dist/chunk-KEQRLZQP.js +3066 -0
- package/dist/{chunk-XYACLXXF.js → chunk-LBJTNQXU.js} +1 -1
- package/dist/{chunk-NPDSIAWT.js → chunk-MLCJ6NIB.js} +3 -3
- package/dist/{chunk-NZGEUVB4.js → chunk-NMIPMOEJ.js} +26 -439
- package/dist/chunk-WCCYK5WK.cjs +3077 -0
- package/dist/{chunk-KMZXXIM2.cjs → chunk-XZL42ZQ2.cjs} +28 -28
- package/dist/{chunk-UGMDBW46.js → chunk-YAANMWP2.js} +2 -0
- package/dist/index.cjs +238 -222
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/dist/interaction.cjs +6 -6
- package/dist/interaction.js +1 -1
- package/dist/parser.cjs +9 -9
- package/dist/parser.js +1 -1
- package/dist/renderer.cjs +32 -32
- package/dist/renderer.js +3 -3
- package/dist/spec.cjs +39 -23
- package/dist/spec.d.cts +45 -1
- package/dist/spec.d.ts +45 -1
- package/dist/spec.js +1 -1
- package/package.json +19 -13
- package/dist/chunk-MD6MNOEQ.cjs +0 -2884
- package/dist/chunk-V3HVWC7C.js +0 -2874
package/dist/app.cjs
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkJ5WEVZIX_cjs = require('./chunk-J5WEVZIX.cjs');
|
|
4
|
+
var chunk7ZRMSFWZ_cjs = require('./chunk-7ZRMSFWZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "advanceClock", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkJ5WEVZIX_cjs.advanceClock; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "compileApp", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkJ5WEVZIX_cjs.compileApp; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "createAppComponentInstanceId", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkJ5WEVZIX_cjs.createAppComponentInstanceId; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "createAppNodeId", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkJ5WEVZIX_cjs.createAppNodeId; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "createRuntime", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkJ5WEVZIX_cjs.createRuntime; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "linkAndCompileApp", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkJ5WEVZIX_cjs.linkAndCompileApp; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "linkApp", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkJ5WEVZIX_cjs.linkApp; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "reduceEvent", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkJ5WEVZIX_cjs.reduceEvent; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "renderSite", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkJ5WEVZIX_cjs.renderSite; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "resetRuntime", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkJ5WEVZIX_cjs.resetRuntime; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "createAppBundle", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk7ZRMSFWZ_cjs.createAppBundle; }
|
|
51
51
|
});
|
package/dist/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { advanceClock, compileApp, createAppComponentInstanceId, createAppNodeId, createRuntime, linkAndCompileApp, linkApp, reduceEvent, renderSite, resetRuntime } from './chunk-
|
|
2
|
-
export { createAppBundle } from './chunk-
|
|
1
|
+
export { advanceClock, compileApp, createAppComponentInstanceId, createAppNodeId, createRuntime, linkAndCompileApp, linkApp, reduceEvent, renderSite, resetRuntime } from './chunk-NMIPMOEJ.js';
|
|
2
|
+
export { createAppBundle } from './chunk-6EMG345O.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { digestBytesV4, parseV4, digestV4, V4ParseError, getV4SourceSpan } from './chunk-
|
|
2
|
-
import { INTERACTIVE_ATTR_NAMES, filterUnscopedPages, filterVariantScope, expandRepeats, buildSiteModel, collectInteractions, darkTheme, defaultTheme, generateStyles, resolvePageDimensions, HtmlRenderer, VISIBLE_GUARD_ATTR, ENABLED_GUARD_ATTR, VARIANT_SCOPE_ATTR, EXTERNAL_NAVIGATE_ATTR, TYPED_INTERACTION_ATTR, INERT_HREF } from './chunk-
|
|
1
|
+
import { digestBytesV4, parseV4, digestV4, V4ParseError, getV4SourceSpan } from './chunk-YAANMWP2.js';
|
|
2
|
+
import { INTERACTIVE_ATTR_NAMES, filterUnscopedPages, filterVariantScope, expandRepeats, buildSiteModel, collectInteractions, darkTheme, defaultTheme, generateStyles, resolvePageDimensions, HtmlRenderer, VISIBLE_GUARD_ATTR, ENABLED_GUARD_ATTR, VARIANT_SCOPE_ATTR, EXTERNAL_NAVIGATE_ATTR, TYPED_INTERACTION_ATTR, INERT_HREF } from './chunk-LBJTNQXU.js';
|
|
3
3
|
import { __publicField } from './chunk-PKBMQBKP.js';
|
|
4
4
|
|
|
5
5
|
// src/ast/expand-variants.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkEWCLLW6P_cjs = require('./chunk-EWCLLW6P.cjs');
|
|
4
|
+
var chunkCGTYVLPA_cjs = require('./chunk-CGTYVLPA.cjs');
|
|
5
5
|
var chunkETV4XYOV_cjs = require('./chunk-ETV4XYOV.cjs');
|
|
6
6
|
|
|
7
7
|
// src/ast/expand-variants.ts
|
|
@@ -33,14 +33,14 @@ function hasVariants(document) {
|
|
|
33
33
|
return document.children.some((child) => child.type === "Page" && variantNames(child).length > 0);
|
|
34
34
|
}
|
|
35
35
|
function expandVariants(document) {
|
|
36
|
-
if (!hasVariants(document)) return
|
|
36
|
+
if (!hasVariants(document)) return chunkCGTYVLPA_cjs.filterUnscopedPages(document);
|
|
37
37
|
return {
|
|
38
38
|
...document,
|
|
39
39
|
children: document.children.flatMap((child) => {
|
|
40
40
|
if (child.type !== "Page") return [child];
|
|
41
41
|
const names = variantNames(child);
|
|
42
42
|
if (names.length === 0) {
|
|
43
|
-
const filtered =
|
|
43
|
+
const filtered = chunkCGTYVLPA_cjs.filterVariantScope(child.children, void 0);
|
|
44
44
|
return [filtered === child.children ? child : { ...child, children: filtered }];
|
|
45
45
|
}
|
|
46
46
|
return names.map((variant, position) => {
|
|
@@ -48,7 +48,7 @@ function expandVariants(document) {
|
|
|
48
48
|
delete clone.variants;
|
|
49
49
|
clone.variant = variant;
|
|
50
50
|
if (position > 0) delete clone.states;
|
|
51
|
-
clone.children =
|
|
51
|
+
clone.children = chunkCGTYVLPA_cjs.filterVariantScope(clone.children, variant);
|
|
52
52
|
return clone;
|
|
53
53
|
});
|
|
54
54
|
})
|
|
@@ -204,7 +204,7 @@ function validateAppAssets(profile) {
|
|
|
204
204
|
issues.push(issue("app.asset-byte-length-mismatch", index, { id }));
|
|
205
205
|
continue;
|
|
206
206
|
}
|
|
207
|
-
if (
|
|
207
|
+
if (chunkEWCLLW6P_cjs.digestBytesV4(bytes) !== expectedDigest) {
|
|
208
208
|
issues.push(issue("app.asset-digest-mismatch", index, { id }));
|
|
209
209
|
continue;
|
|
210
210
|
}
|
|
@@ -346,7 +346,7 @@ function sourceId(value) {
|
|
|
346
346
|
}
|
|
347
347
|
function sourceOf(value, fallback) {
|
|
348
348
|
var _a;
|
|
349
|
-
const found = (_a =
|
|
349
|
+
const found = (_a = chunkEWCLLW6P_cjs.getV4SourceSpan(value)) != null ? _a : fallback;
|
|
350
350
|
return found === void 0 ? { sourceId: "app", start: 0, end: 0, startLine: 1, startColumn: 1, endLine: 1, endColumn: 1 } : { ...found, sourceId: sourceId(found.sourceId) };
|
|
351
351
|
}
|
|
352
352
|
function createAppBundle(documents, options) {
|
|
@@ -360,7 +360,7 @@ function createAppBundle(documents, options) {
|
|
|
360
360
|
jcs(options);
|
|
361
361
|
if (!identifiers.test(options.id))
|
|
362
362
|
return failed([diagnostic("WW_SCHEMA", "app.invalid-id", void 0, {}, "schema")]);
|
|
363
|
-
const configuration =
|
|
363
|
+
const configuration = chunkEWCLLW6P_cjs.parseV4(
|
|
364
364
|
`app ${options.id} entry=${dsl(options.entry)} profile=${dsl(options.profile)} states=${dsl(options.states)} registry=${dsl(options.registry)} fixtures=${dsl(options.fixtures)} {}`,
|
|
365
365
|
{ languageVersion: "4.0.0", sourceId: "app" }
|
|
366
366
|
);
|
|
@@ -395,8 +395,8 @@ function createAppBundle(documents, options) {
|
|
|
395
395
|
);
|
|
396
396
|
continue;
|
|
397
397
|
}
|
|
398
|
-
const reparsed =
|
|
399
|
-
if (
|
|
398
|
+
const reparsed = chunkEWCLLW6P_cjs.parseV4(bytes, { languageVersion: "4.0.0", sourceId: `${module.id}.wf` });
|
|
399
|
+
if (chunkEWCLLW6P_cjs.digestV4(bytes) !== module.sourceDigest || reparsed.modules.length !== 1 || jcs(reparsed.modules[0]) !== jcs(module)) {
|
|
400
400
|
diagnostics.push(
|
|
401
401
|
diagnostic(
|
|
402
402
|
"WW_IMPORT",
|
|
@@ -450,7 +450,7 @@ function createAppBundle(documents, options) {
|
|
|
450
450
|
bundles.set(bundle, { sourceByPath });
|
|
451
451
|
return { ok: true, value: bundle, diagnostics: [] };
|
|
452
452
|
} catch (error) {
|
|
453
|
-
if (error instanceof
|
|
453
|
+
if (error instanceof chunkEWCLLW6P_cjs.V4ParseError)
|
|
454
454
|
return failed(error.diagnostics.map((item) => ({ ...item, phase: item.phase })));
|
|
455
455
|
if (error instanceof TypeError)
|
|
456
456
|
return failed([diagnostic("WW_SCHEMA", "app.invalid-json", void 0, {}, "schema")]);
|
|
@@ -688,7 +688,7 @@ var Linker = class {
|
|
|
688
688
|
const right = `${textValue(b.kind)}\0${textValue(b.namespace)}\0${textValue(b.id)}`;
|
|
689
689
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
690
690
|
});
|
|
691
|
-
if (jcs(entries) !== jcs(sorted) ||
|
|
691
|
+
if (jcs(entries) !== jcs(sorted) || chunkEWCLLW6P_cjs.digestV4(jcs(entries)) !== this.bundle.registry.digest)
|
|
692
692
|
this.error("WW_REGISTRY", "app.registry-digest");
|
|
693
693
|
for (const entry of entries) {
|
|
694
694
|
if (typeof entry.id !== "string" || !uuids.test(entry.id) || typeof entry.namespace !== "string" || !["Requirement", "ImplementationObligation"].includes(textValue(entry.kind))) {
|
|
@@ -880,7 +880,7 @@ var Linker = class {
|
|
|
880
880
|
kind: "shell",
|
|
881
881
|
namespace: layout.module.namespace,
|
|
882
882
|
id: layout.definition.id,
|
|
883
|
-
profileDigest:
|
|
883
|
+
profileDigest: chunkEWCLLW6P_cjs.digestV4(jcs(this.bundle.profile))
|
|
884
884
|
};
|
|
885
885
|
const children = this.expandChildren([layout.definition], {
|
|
886
886
|
owner: layout,
|
|
@@ -1024,9 +1024,9 @@ var Linker = class {
|
|
|
1024
1024
|
definitionId: context.owner.definition.id,
|
|
1025
1025
|
instanceRoot: context.root,
|
|
1026
1026
|
instancePath: context.path,
|
|
1027
|
-
localId: (_e = primitive.id) != null ? _e : slot ? "_slot" : `_node_${
|
|
1027
|
+
localId: (_e = primitive.id) != null ? _e : slot ? "_slot" : `_node_${chunkEWCLLW6P_cjs.digestV4((_d = this.pathByNode.get(node)) != null ? _d : textValue(source.start)).slice(7)}`
|
|
1028
1028
|
};
|
|
1029
|
-
const renderedId = `wf-${
|
|
1029
|
+
const renderedId = `wf-${chunkEWCLLW6P_cjs.digestV4(jcs({ identity, projectionId: this.bundle.profile.id })).slice(7)}`;
|
|
1030
1030
|
if (this.domIds.has(renderedId))
|
|
1031
1031
|
this.error("WW_DUPLICATE_ID", "app.rendered-identity-collision", node);
|
|
1032
1032
|
this.domIds.add(renderedId);
|
|
@@ -1070,9 +1070,9 @@ var Linker = class {
|
|
|
1070
1070
|
}[node.kind];
|
|
1071
1071
|
if (parent !== void 0) snippet = `${parent} { ${snippet} }`;
|
|
1072
1072
|
try {
|
|
1073
|
-
|
|
1073
|
+
chunkEWCLLW6P_cjs.parseV4(`page { ${snippet} }`, { languageVersion: "4.0.0" });
|
|
1074
1074
|
} catch (error) {
|
|
1075
|
-
if (error instanceof
|
|
1075
|
+
if (error instanceof chunkEWCLLW6P_cjs.V4ParseError)
|
|
1076
1076
|
this.error("WW_PARAMETER", "app.substituted-attribute-domain", source);
|
|
1077
1077
|
else throw error;
|
|
1078
1078
|
}
|
|
@@ -1555,7 +1555,7 @@ function linkAppV4(bundle) {
|
|
|
1555
1555
|
kind: "LinkedApp",
|
|
1556
1556
|
languageVersion: "4.0.0",
|
|
1557
1557
|
id: bundle.id,
|
|
1558
|
-
digest:
|
|
1558
|
+
digest: chunkEWCLLW6P_cjs.digestV4(jcs(bundle)),
|
|
1559
1559
|
sourceMap
|
|
1560
1560
|
});
|
|
1561
1561
|
links.set(linked, {
|
|
@@ -1670,7 +1670,7 @@ function generateSiteStyles(prefix) {
|
|
|
1670
1670
|
|
|
1671
1671
|
// src/renderer/site/runtime.ts
|
|
1672
1672
|
var ID_SCOPE_ATTR = "data-id-scope";
|
|
1673
|
-
var [NAVIGATE_ATTR, OPENS_ATTR, TOGGLES_ATTR, ACTION_ATTR] =
|
|
1673
|
+
var [NAVIGATE_ATTR, OPENS_ATTR, TOGGLES_ATTR, ACTION_ATTR] = chunkCGTYVLPA_cjs.INTERACTIVE_ATTR_NAMES;
|
|
1674
1674
|
function embedJson(value) {
|
|
1675
1675
|
return JSON.stringify(value).replace(/</g, "\\u003C");
|
|
1676
1676
|
}
|
|
@@ -1897,16 +1897,16 @@ function siteRuntime(registry, prefix) {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
|
|
1899
1899
|
function applyOutcomes() {
|
|
1900
|
-
var visible = site.querySelectorAll('[' + ${embedJson(
|
|
1900
|
+
var visible = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.VISIBLE_GUARD_ATTR)} + ']');
|
|
1901
1901
|
for (var i = 0; i < visible.length; i++) {
|
|
1902
|
-
var visibleGuard = parseJson(visible[i].getAttribute(${embedJson(
|
|
1902
|
+
var visibleGuard = parseJson(visible[i].getAttribute(${embedJson(chunkCGTYVLPA_cjs.VISIBLE_GUARD_ATTR)}), null);
|
|
1903
1903
|
if (guardPasses(visibleGuard)) visible[i].removeAttribute('hidden');
|
|
1904
1904
|
else visible[i].setAttribute('hidden', 'hidden');
|
|
1905
1905
|
}
|
|
1906
1906
|
|
|
1907
|
-
var enabled = site.querySelectorAll('[' + ${embedJson(
|
|
1907
|
+
var enabled = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.ENABLED_GUARD_ATTR)} + ']');
|
|
1908
1908
|
for (var j = 0; j < enabled.length; j++) {
|
|
1909
|
-
var enabledGuard = parseJson(enabled[j].getAttribute(${embedJson(
|
|
1909
|
+
var enabledGuard = parseJson(enabled[j].getAttribute(${embedJson(chunkCGTYVLPA_cjs.ENABLED_GUARD_ATTR)}), null);
|
|
1910
1910
|
if (guardPasses(enabledGuard)) {
|
|
1911
1911
|
enabled[j].removeAttribute('disabled');
|
|
1912
1912
|
enabled[j].removeAttribute('aria-disabled');
|
|
@@ -1920,9 +1920,9 @@ function siteRuntime(registry, prefix) {
|
|
|
1920
1920
|
function applyVariantScopes() {
|
|
1921
1921
|
var screen = current === null ? null : screens[current];
|
|
1922
1922
|
var variant = screen ? screen.getAttribute('data-wf-variant') : null;
|
|
1923
|
-
var scoped = site.querySelectorAll('[' + ${embedJson(
|
|
1923
|
+
var scoped = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.VARIANT_SCOPE_ATTR)} + ']');
|
|
1924
1924
|
for (var i = 0; i < scoped.length; i++) {
|
|
1925
|
-
var names = parseJson(scoped[i].getAttribute(${embedJson(
|
|
1925
|
+
var names = parseJson(scoped[i].getAttribute(${embedJson(chunkCGTYVLPA_cjs.VARIANT_SCOPE_ATTR)}), []);
|
|
1926
1926
|
var visible = variant !== null && names.indexOf(variant) >= 0;
|
|
1927
1927
|
if (visible) scoped[i].removeAttribute('hidden');
|
|
1928
1928
|
else scoped[i].setAttribute('hidden', 'hidden');
|
|
@@ -1980,7 +1980,7 @@ function siteRuntime(registry, prefix) {
|
|
|
1980
1980
|
if (!isChrome(links[j])) continue;
|
|
1981
1981
|
// An external target names no screen, so it can never be the current
|
|
1982
1982
|
// one. Same marker, same skip: the registry is not consulted.
|
|
1983
|
-
if (links[j].hasAttribute(${embedJson(
|
|
1983
|
+
if (links[j].hasAttribute(${embedJson(chunkCGTYVLPA_cjs.EXTERNAL_NAVIGATE_ATTR)})) continue;
|
|
1984
1984
|
var target = resolve(links[j].getAttribute(${embedJson(NAVIGATE_ATTR)}));
|
|
1985
1985
|
if (target === key) links[j].classList.add(NAV_ACTIVE);
|
|
1986
1986
|
else links[j].classList.remove(NAV_ACTIVE);
|
|
@@ -2037,9 +2037,9 @@ function siteRuntime(registry, prefix) {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
|
|
2039
2039
|
document.addEventListener('click', function (event) {
|
|
2040
|
-
var typed = event.target.closest ? event.target.closest('[' + ${embedJson(
|
|
2040
|
+
var typed = event.target.closest ? event.target.closest('[' + ${embedJson(chunkCGTYVLPA_cjs.TYPED_INTERACTION_ATTR)} + ']') : null;
|
|
2041
2041
|
if (typed) {
|
|
2042
|
-
var signatures = parseJson(typed.getAttribute(${embedJson(
|
|
2042
|
+
var signatures = parseJson(typed.getAttribute(${embedJson(chunkCGTYVLPA_cjs.TYPED_INTERACTION_ATTR)}), []);
|
|
2043
2043
|
var matched = false;
|
|
2044
2044
|
for (var typedIndex = 0; typedIndex < signatures.length; typedIndex++) {
|
|
2045
2045
|
var normalized = interactionFor(current, typed, signatures[typedIndex]);
|
|
@@ -2060,7 +2060,7 @@ function siteRuntime(registry, prefix) {
|
|
|
2060
2060
|
// drift surface, and the two disagreeing is how a runtime ends up hunting
|
|
2061
2061
|
// for a screen named "https://\u2026". Marked elements skip the registry
|
|
2062
2062
|
// entirely: the lookup is not attempted, not merely discarded.
|
|
2063
|
-
if (mover && !mover.hasAttribute(${embedJson(
|
|
2063
|
+
if (mover && !mover.hasAttribute(${embedJson(chunkCGTYVLPA_cjs.EXTERNAL_NAVIGATE_ATTR)})) {
|
|
2064
2064
|
var navigateTarget = mover.getAttribute(${embedJson(NAVIGATE_ATTR)});
|
|
2065
2065
|
var key = routeAllowed(current, navigateTarget) ? resolve(navigateTarget) : null;
|
|
2066
2066
|
if (key !== null) {
|
|
@@ -2126,7 +2126,7 @@ function siteRuntime(registry, prefix) {
|
|
|
2126
2126
|
// authored fragment link is left alone too \u2014 the hashchange handler below is
|
|
2127
2127
|
// how that is supposed to work.
|
|
2128
2128
|
var link = event.target.closest ? event.target.closest('a[href]') : null;
|
|
2129
|
-
if (link && link.getAttribute('href') === ${embedJson(
|
|
2129
|
+
if (link && link.getAttribute('href') === ${embedJson(chunkCGTYVLPA_cjs.INERT_HREF)}) event.preventDefault();
|
|
2130
2130
|
});
|
|
2131
2131
|
|
|
2132
2132
|
document.addEventListener('keydown', function (event) {
|
|
@@ -2159,7 +2159,7 @@ function attrs(pairs) {
|
|
|
2159
2159
|
return pairs.filter((pair) => pair[1] !== void 0).map(([name, value]) => ` ${name}="${escapeAttr(value)}"`).join("");
|
|
2160
2160
|
}
|
|
2161
2161
|
function renderHostedScreen(screen, shell, make, prefix) {
|
|
2162
|
-
const { width, height } =
|
|
2162
|
+
const { width, height } = chunkCGTYVLPA_cjs.resolvePageDimensions(screen.page);
|
|
2163
2163
|
const conflict = width !== shell.width || height !== shell.height ? `${width}x${height}` : void 0;
|
|
2164
2164
|
const scope = screenScope(screen.index);
|
|
2165
2165
|
const marks = attrs([
|
|
@@ -2254,10 +2254,10 @@ function compactRuntimeInteractions(model, interactions) {
|
|
|
2254
2254
|
function renderSite(document, options = {}) {
|
|
2255
2255
|
var _a;
|
|
2256
2256
|
const prefix = (_a = options.classPrefix) != null ? _a : DEFAULT_PREFIX;
|
|
2257
|
-
document =
|
|
2258
|
-
const model =
|
|
2259
|
-
const interactionModel =
|
|
2260
|
-
const make = (idScope) => new
|
|
2257
|
+
document = chunkCGTYVLPA_cjs.expandRepeats(expandVariants(document));
|
|
2258
|
+
const model = chunkCGTYVLPA_cjs.buildSiteModel(document);
|
|
2259
|
+
const interactionModel = chunkCGTYVLPA_cjs.collectInteractions(document);
|
|
2260
|
+
const make = (idScope) => new chunkCGTYVLPA_cjs.HtmlRenderer({
|
|
2261
2261
|
theme: options.theme,
|
|
2262
2262
|
classPrefix: prefix,
|
|
2263
2263
|
background: options.background,
|
|
@@ -2267,8 +2267,8 @@ function renderSite(document, options = {}) {
|
|
|
2267
2267
|
});
|
|
2268
2268
|
const shells = model.shells.map((shell, index) => renderShell(shell, index, make, prefix)).join("\n");
|
|
2269
2269
|
const standalone = model.screens.filter((screen) => screen.shell === void 0).map((screen) => renderStandaloneScreen(screen, make, prefix)).join("\n");
|
|
2270
|
-
const theme = options.theme === "dark" ?
|
|
2271
|
-
const css =
|
|
2270
|
+
const theme = options.theme === "dark" ? chunkCGTYVLPA_cjs.darkTheme : chunkCGTYVLPA_cjs.defaultTheme;
|
|
2271
|
+
const css = chunkCGTYVLPA_cjs.generateStyles(theme, prefix, options.annotationStyle) + generateSiteStyles(prefix);
|
|
2272
2272
|
const entry = resolveEntry(model, options);
|
|
2273
2273
|
const fragments = model.screens.map((screen) => {
|
|
2274
2274
|
var _a2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWCCYK5WK_cjs = require('./chunk-WCCYK5WK.cjs');
|
|
4
4
|
var chunkETV4XYOV_cjs = require('./chunk-ETV4XYOV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/ast/guards.ts
|
|
@@ -2711,7 +2711,7 @@ var BaseRenderer = class {
|
|
|
2711
2711
|
var INTERACTION_KINDS = ["navigate", "opens", "toggles", "action"];
|
|
2712
2712
|
function categoryOf(node) {
|
|
2713
2713
|
var _a;
|
|
2714
|
-
return (_a =
|
|
2714
|
+
return (_a = chunkWCCYK5WK_cjs.ELEMENT_NODE_TYPE_MAP.get(node.type)) == null ? void 0 : _a.category;
|
|
2715
2715
|
}
|
|
2716
2716
|
function getLabel(node) {
|
|
2717
2717
|
if ("label" in node && typeof node.label === "string") return node.label;
|
|
@@ -50913,7 +50913,7 @@ exports.HtmlRenderer = class HtmlRenderer extends BaseRenderer {
|
|
|
50913
50913
|
*/
|
|
50914
50914
|
renderPage(node) {
|
|
50915
50915
|
var _a, _b;
|
|
50916
|
-
let viewport =
|
|
50916
|
+
let viewport = chunkWCCYK5WK_cjs.resolveViewport(node.viewport, node.device);
|
|
50917
50917
|
const nodeAny = node;
|
|
50918
50918
|
const explicitW = (_a = node.w) != null ? _a : nodeAny.width;
|
|
50919
50919
|
const explicitH = (_b = node.h) != null ? _b : nodeAny.height;
|
|
@@ -51454,7 +51454,7 @@ function resolvePageDimensions(page) {
|
|
|
51454
51454
|
if (typeof explicitW === "number" && typeof explicitH === "number") {
|
|
51455
51455
|
return { width: explicitW, height: explicitH };
|
|
51456
51456
|
}
|
|
51457
|
-
const viewport =
|
|
51457
|
+
const viewport = chunkWCCYK5WK_cjs.resolveViewport(page.viewport, page.device);
|
|
51458
51458
|
return { width: viewport.width, height: viewport.height };
|
|
51459
51459
|
}
|
|
51460
51460
|
/**
|
|
@@ -2815,6 +2815,7 @@ var schema_default = {
|
|
|
2815
2815
|
"pb",
|
|
2816
2816
|
"pl",
|
|
2817
2817
|
"pr",
|
|
2818
|
+
"primary",
|
|
2818
2819
|
"pt",
|
|
2819
2820
|
"px",
|
|
2820
2821
|
"py",
|
|
@@ -7105,6 +7106,7 @@ var schema_default = {
|
|
|
7105
7106
|
"pb",
|
|
7106
7107
|
"pl",
|
|
7107
7108
|
"pr",
|
|
7109
|
+
"primary",
|
|
7108
7110
|
"pt",
|
|
7109
7111
|
"px",
|
|
7110
7112
|
"py",
|