@wireweave/core 4.0.0-beta.13 → 4.0.0-beta.14
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 +16 -15
- package/dist/app.d.cts +4 -144
- package/dist/app.d.ts +4 -144
- package/dist/app.js +2 -1
- package/dist/{chunk-FS6A6EJ4.js → chunk-2Y3GKARZ.js} +3 -1312
- package/dist/chunk-4DDV6Z2X.js +389 -0
- package/dist/chunk-LA5LKIEL.cjs +396 -0
- package/dist/chunk-NV6UV5ID.cjs +2145 -0
- package/dist/{chunk-4UZBGIGJ.cjs → chunk-SAN6CJEE.cjs} +60 -1370
- package/dist/chunk-TQSOLTMZ.js +2132 -0
- package/dist/index-BD_4rXH-.d.cts +1031 -0
- package/dist/{index-BGU_4N4W.d.ts → index-BEnsO2kE.d.ts} +143 -1
- package/dist/{index-DyXaMSgd.d.cts → index-YSIzfhOd.d.cts} +143 -1
- package/dist/index-g9yV20xb.d.ts +1031 -0
- package/dist/index.cjs +235 -44
- package/dist/index.d.cts +11 -188
- package/dist/index.d.ts +11 -188
- package/dist/index.js +204 -17
- package/dist/renderer.cjs +8 -8
- package/dist/renderer.d.cts +4 -756
- package/dist/renderer.d.ts +4 -756
- package/dist/renderer.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-4TMDPWPR.cjs +0 -186
- package/dist/chunk-5DGRIQDU.cjs +0 -824
- package/dist/chunk-JJWAFHSV.js +0 -821
- package/dist/chunk-R5WBZWBC.js +0 -180
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkNV6UV5ID_cjs = require('./chunk-NV6UV5ID.cjs');
|
|
3
4
|
var chunkIMUVIIJR_cjs = require('./chunk-IMUVIIJR.cjs');
|
|
4
|
-
var chunk5DGRIQDU_cjs = require('./chunk-5DGRIQDU.cjs');
|
|
5
5
|
var chunkETV4XYOV_cjs = require('./chunk-ETV4XYOV.cjs');
|
|
6
6
|
|
|
7
7
|
// src/ast/component-parameters.ts
|
|
@@ -42,1315 +42,6 @@ function collectParameterReferences(children) {
|
|
|
42
42
|
return found;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// src/app/v4.ts
|
|
46
|
-
var bundleBrand = /* @__PURE__ */ Symbol("AppBundle");
|
|
47
|
-
var linkedBrand = /* @__PURE__ */ Symbol("LinkedApp");
|
|
48
|
-
var bundles = /* @__PURE__ */ new WeakMap();
|
|
49
|
-
var links = /* @__PURE__ */ new WeakMap();
|
|
50
|
-
var identifiers = /^[A-Za-z_][A-Za-z0-9_-]{0,127}$/;
|
|
51
|
-
var uuids = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
52
|
-
var containers = new Set(
|
|
53
|
-
"page header main footer sidebar section row col stack relative card modal drawer accordion popover form tab nav-group list-item annotation-item".split(
|
|
54
|
-
" "
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
function textValue(value) {
|
|
58
|
-
if (typeof value === "string") return value;
|
|
59
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
60
|
-
return value === void 0 || value === null ? "" : jcs(value);
|
|
61
|
-
}
|
|
62
|
-
function object(value) {
|
|
63
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
64
|
-
}
|
|
65
|
-
function isArray(value) {
|
|
66
|
-
return Array.isArray(value);
|
|
67
|
-
}
|
|
68
|
-
function diagnostic(code, messageKey, source, details = {}, phase = "link", path = "") {
|
|
69
|
-
var _a, _b, _c;
|
|
70
|
-
return {
|
|
71
|
-
severity: "error",
|
|
72
|
-
code,
|
|
73
|
-
phase,
|
|
74
|
-
sourceId: (_a = source == null ? void 0 : source.sourceId) != null ? _a : "app",
|
|
75
|
-
start: (_b = source == null ? void 0 : source.start) != null ? _b : 0,
|
|
76
|
-
end: (_c = source == null ? void 0 : source.end) != null ? _c : 0,
|
|
77
|
-
path,
|
|
78
|
-
messageKey,
|
|
79
|
-
details,
|
|
80
|
-
related: []
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function failed(diagnostics) {
|
|
84
|
-
const sorted = diagnostics.slice().sort(
|
|
85
|
-
(a, b) => (a.sourceId < b.sourceId ? -1 : a.sourceId > b.sourceId ? 1 : 0) || a.start - b.start || (a.phase < b.phase ? -1 : a.phase > b.phase ? 1 : 0) || (a.code < b.code ? -1 : a.code > b.code ? 1 : 0)
|
|
86
|
-
);
|
|
87
|
-
if (sorted.length > 1e3) {
|
|
88
|
-
const omitted = sorted.length - 999;
|
|
89
|
-
sorted.length = 999;
|
|
90
|
-
sorted.push(diagnostic("WW_DIAGNOSTIC_LIMIT", "app.diagnostic-limit", void 0, { omitted }));
|
|
91
|
-
}
|
|
92
|
-
return { ok: false, value: null, html: null, diagnostics: sorted };
|
|
93
|
-
}
|
|
94
|
-
function jcs(value, depth = 0, ancestors = /* @__PURE__ */ new Set()) {
|
|
95
|
-
if (depth > 512) throw new TypeError("JSON nesting limit");
|
|
96
|
-
if (value === null || typeof value === "boolean" || typeof value === "string")
|
|
97
|
-
return JSON.stringify(value);
|
|
98
|
-
if (typeof value === "number") {
|
|
99
|
-
if (!Number.isFinite(value)) throw new TypeError("Non-finite JSON number");
|
|
100
|
-
return JSON.stringify(value);
|
|
101
|
-
}
|
|
102
|
-
if (typeof value !== "object" || value === null || ancestors.has(value))
|
|
103
|
-
throw new TypeError("Invalid or cyclic JSON value");
|
|
104
|
-
ancestors.add(value);
|
|
105
|
-
try {
|
|
106
|
-
if (Array.isArray(value))
|
|
107
|
-
return `[${value.map((item) => jcs(item, depth + 1, ancestors)).join(",")}]`;
|
|
108
|
-
if (Object.prototype.toString.call(value) !== "[object Object]")
|
|
109
|
-
throw new TypeError("Invalid JSON object");
|
|
110
|
-
return `{${Object.keys(value).sort().map(
|
|
111
|
-
(key) => `${JSON.stringify(key)}:${jcs(value[key], depth + 1, ancestors)}`
|
|
112
|
-
).join(",")}}`;
|
|
113
|
-
} finally {
|
|
114
|
-
ancestors.delete(value);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function freeze(value) {
|
|
118
|
-
const stack = [value];
|
|
119
|
-
while (stack.length > 0) {
|
|
120
|
-
const current = stack.pop();
|
|
121
|
-
if (current !== null && typeof current === "object" && !Object.isFrozen(current)) {
|
|
122
|
-
for (const child of Object.values(current)) stack.push(child);
|
|
123
|
-
Object.freeze(current);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return value;
|
|
127
|
-
}
|
|
128
|
-
function dsl(value) {
|
|
129
|
-
if (Array.isArray(value)) return `[${value.map(dsl).join(",")}]`;
|
|
130
|
-
if (object(value))
|
|
131
|
-
return `{${Object.entries(value).map(([key, item]) => `${JSON.stringify(key)}=${dsl(item)}`).join(",")}}`;
|
|
132
|
-
return JSON.stringify(value);
|
|
133
|
-
}
|
|
134
|
-
function plain(value) {
|
|
135
|
-
return JSON.parse(jcs(value));
|
|
136
|
-
}
|
|
137
|
-
function sourceId(value) {
|
|
138
|
-
var _a;
|
|
139
|
-
return (_a = value.split(/[\\/]/).filter(Boolean).at(-1)) != null ? _a : "source.wf";
|
|
140
|
-
}
|
|
141
|
-
function sourceOf(value, fallback) {
|
|
142
|
-
var _a;
|
|
143
|
-
const found = (_a = chunkIMUVIIJR_cjs.getV4SourceSpan(value)) != null ? _a : fallback;
|
|
144
|
-
return found === void 0 ? { sourceId: "app", start: 0, end: 0, startLine: 1, startColumn: 1, endLine: 1, endColumn: 1 } : { ...found, sourceId: sourceId(found.sourceId) };
|
|
145
|
-
}
|
|
146
|
-
function createAppBundle(documents, options) {
|
|
147
|
-
if (!isArray(documents) || !object(options) || !object(options.moduleSources))
|
|
148
|
-
throw new TypeError("Parsed documents and explicit bundle options are required");
|
|
149
|
-
const diagnostics = [];
|
|
150
|
-
const modules = [];
|
|
151
|
-
const sourceByPath = /* @__PURE__ */ new Map();
|
|
152
|
-
try {
|
|
153
|
-
jcs(options);
|
|
154
|
-
if (!identifiers.test(options.id))
|
|
155
|
-
return failed([diagnostic("WW_SCHEMA", "app.invalid-id", void 0, {}, "schema")]);
|
|
156
|
-
const configuration = chunkIMUVIIJR_cjs.parseV4(
|
|
157
|
-
`app ${options.id} entry=${dsl(options.entry)} profile=${dsl(options.profile)} states=${dsl(options.states)} registry=${dsl(options.registry)} fixtures=${dsl(options.fixtures)} {}`,
|
|
158
|
-
{ languageVersion: "4.0.0", sourceId: "app" }
|
|
159
|
-
);
|
|
160
|
-
for (const document2 of documents) {
|
|
161
|
-
if (document2.languageVersion !== "4.0.0" || document2.schemaVersion !== "1.0.0" || !isArray(document2.modules)) {
|
|
162
|
-
diagnostics.push(
|
|
163
|
-
diagnostic("WW_UNSUPPORTED_VERSION", "app.document-version", void 0, {}, "schema")
|
|
164
|
-
);
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
for (const module of document2.modules) {
|
|
168
|
-
const bytes = options.moduleSources[module.id];
|
|
169
|
-
if (modules.some((prior) => prior.id === module.id)) {
|
|
170
|
-
diagnostics.push(
|
|
171
|
-
diagnostic("WW_DUPLICATE_ID", "app.duplicate-module", sourceOf(module), {
|
|
172
|
-
id: module.id
|
|
173
|
-
})
|
|
174
|
-
);
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
if (typeof bytes !== "string") {
|
|
178
|
-
diagnostics.push(
|
|
179
|
-
diagnostic(
|
|
180
|
-
"WW_IMPORT",
|
|
181
|
-
"app.missing-source-bytes",
|
|
182
|
-
sourceOf(module),
|
|
183
|
-
{ id: module.id },
|
|
184
|
-
"import"
|
|
185
|
-
)
|
|
186
|
-
);
|
|
187
|
-
continue;
|
|
188
|
-
}
|
|
189
|
-
const reparsed = chunkIMUVIIJR_cjs.parseV4(bytes, { languageVersion: "4.0.0", sourceId: `${module.id}.wf` });
|
|
190
|
-
if (chunkIMUVIIJR_cjs.digestV4(bytes) !== module.sourceDigest || reparsed.modules.length !== 1 || jcs(reparsed.modules[0]) !== jcs(module)) {
|
|
191
|
-
diagnostics.push(
|
|
192
|
-
diagnostic(
|
|
193
|
-
"WW_IMPORT",
|
|
194
|
-
"app.source-content-mismatch",
|
|
195
|
-
sourceOf(module),
|
|
196
|
-
{ id: module.id },
|
|
197
|
-
"import"
|
|
198
|
-
)
|
|
199
|
-
);
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
const stack = [
|
|
203
|
-
{ value: reparsed.modules[0], path: module.id, fallback: sourceOf(reparsed.modules[0]) }
|
|
204
|
-
];
|
|
205
|
-
while (stack.length > 0) {
|
|
206
|
-
const item = stack.pop();
|
|
207
|
-
if (item.value !== null && typeof item.value === "object") {
|
|
208
|
-
const span = sourceOf(item.value, item.fallback);
|
|
209
|
-
sourceByPath.set(item.path, span);
|
|
210
|
-
for (const [key, value] of Object.entries(item.value))
|
|
211
|
-
stack.push({ value, path: `${item.path}/${key}`, fallback: span });
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
modules.push(plain(module));
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
if (modules.length === 0 || modules.length > 256)
|
|
218
|
-
diagnostics.push(diagnostic("WW_LIMIT", "app.module-count", void 0, {}, "schema"));
|
|
219
|
-
for (const id of Object.keys(options.moduleSources))
|
|
220
|
-
if (!modules.some((module) => module.id === id)) {
|
|
221
|
-
diagnostics.push(
|
|
222
|
-
diagnostic("WW_IMPORT", "app.unselected-source", void 0, { id }, "import")
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
if (diagnostics.length > 0) return failed(diagnostics);
|
|
226
|
-
const candidate = {
|
|
227
|
-
[bundleBrand]: true,
|
|
228
|
-
schemaVersion: "1.0.0",
|
|
229
|
-
languageVersion: "4.0.0",
|
|
230
|
-
id: configuration.app.id,
|
|
231
|
-
entry: configuration.app.entry,
|
|
232
|
-
profile: configuration.app.profile,
|
|
233
|
-
states: configuration.states,
|
|
234
|
-
registry: configuration.registry,
|
|
235
|
-
fixtures: configuration.fixtures,
|
|
236
|
-
modules
|
|
237
|
-
};
|
|
238
|
-
if (new TextEncoder().encode(jcs(candidate)).byteLength > 64 * 1024 * 1024)
|
|
239
|
-
return failed([diagnostic("WW_LIMIT", "app.bundle-byte-limit")]);
|
|
240
|
-
const bundle = freeze(candidate);
|
|
241
|
-
bundles.set(bundle, { sourceByPath });
|
|
242
|
-
return { ok: true, value: bundle, diagnostics: [] };
|
|
243
|
-
} catch (error) {
|
|
244
|
-
if (error instanceof chunkIMUVIIJR_cjs.V4ParseError)
|
|
245
|
-
return failed(error.diagnostics.map((item) => ({ ...item, phase: "schema" })));
|
|
246
|
-
if (error instanceof TypeError)
|
|
247
|
-
return failed([diagnostic("WW_SCHEMA", "app.invalid-json", void 0, {}, "schema")]);
|
|
248
|
-
throw error;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
var Linker = class {
|
|
252
|
-
constructor(bundle, data) {
|
|
253
|
-
chunkETV4XYOV_cjs.__publicField(this, "bundle", bundle);
|
|
254
|
-
chunkETV4XYOV_cjs.__publicField(this, "data", data);
|
|
255
|
-
chunkETV4XYOV_cjs.__publicField(this, "diagnostics", []);
|
|
256
|
-
chunkETV4XYOV_cjs.__publicField(this, "owners", /* @__PURE__ */ new Map());
|
|
257
|
-
chunkETV4XYOV_cjs.__publicField(this, "moduleById", /* @__PURE__ */ new Map());
|
|
258
|
-
chunkETV4XYOV_cjs.__publicField(this, "ownerByNode", /* @__PURE__ */ new WeakMap());
|
|
259
|
-
chunkETV4XYOV_cjs.__publicField(this, "pathByNode", /* @__PURE__ */ new WeakMap());
|
|
260
|
-
chunkETV4XYOV_cjs.__publicField(this, "expanded", []);
|
|
261
|
-
chunkETV4XYOV_cjs.__publicField(this, "screens", []);
|
|
262
|
-
chunkETV4XYOV_cjs.__publicField(this, "shells", []);
|
|
263
|
-
chunkETV4XYOV_cjs.__publicField(this, "moduleEdges", /* @__PURE__ */ new Map());
|
|
264
|
-
chunkETV4XYOV_cjs.__publicField(this, "definitionEdges", /* @__PURE__ */ new Map());
|
|
265
|
-
chunkETV4XYOV_cjs.__publicField(this, "registry", /* @__PURE__ */ new Map());
|
|
266
|
-
chunkETV4XYOV_cjs.__publicField(this, "expandedCount", 0);
|
|
267
|
-
chunkETV4XYOV_cjs.__publicField(this, "domIds", /* @__PURE__ */ new Set());
|
|
268
|
-
}
|
|
269
|
-
source(node) {
|
|
270
|
-
var _a, _b;
|
|
271
|
-
return (_b = this.data.sourceByPath.get((_a = this.pathByNode.get(node)) != null ? _a : "")) != null ? _b : sourceOf(node);
|
|
272
|
-
}
|
|
273
|
-
error(code, key, node, details = {}) {
|
|
274
|
-
var _a;
|
|
275
|
-
this.diagnostics.push(
|
|
276
|
-
diagnostic(
|
|
277
|
-
code,
|
|
278
|
-
key,
|
|
279
|
-
node === void 0 ? void 0 : this.source(node),
|
|
280
|
-
details,
|
|
281
|
-
code === "WW_IMPORT" ? "import" : "link",
|
|
282
|
-
node === void 0 ? "" : (_a = this.pathByNode.get(node)) != null ? _a : ""
|
|
283
|
-
)
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
key(namespace, kind, id) {
|
|
287
|
-
return `${namespace}/${kind}/${id}`;
|
|
288
|
-
}
|
|
289
|
-
walk(root, visit, rootPath) {
|
|
290
|
-
const stack = [{ node: root, path: rootPath }];
|
|
291
|
-
while (stack.length > 0) {
|
|
292
|
-
const { node, path } = stack.pop();
|
|
293
|
-
visit(node, path);
|
|
294
|
-
if (node.kind === "use") {
|
|
295
|
-
for (let i = node.fills.length - 1; i >= 0; i--)
|
|
296
|
-
for (let j = node.fills[i].children.length - 1; j >= 0; j--)
|
|
297
|
-
stack.push({
|
|
298
|
-
node: node.fills[i].children[j],
|
|
299
|
-
path: `${path}/fills/${i}/children/${j}`
|
|
300
|
-
});
|
|
301
|
-
} else if ("children" in node)
|
|
302
|
-
for (let i = node.children.length - 1; i >= 0; i--)
|
|
303
|
-
stack.push({ node: node.children[i], path: `${path}/children/${i}` });
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
index() {
|
|
307
|
-
const namespaces = /* @__PURE__ */ new Set();
|
|
308
|
-
for (const module of this.bundle.modules) {
|
|
309
|
-
this.pathByNode.set(module, module.id);
|
|
310
|
-
this.moduleById.set(module.id, module);
|
|
311
|
-
if (namespaces.has(module.namespace))
|
|
312
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-namespace", module, {
|
|
313
|
-
namespace: module.namespace
|
|
314
|
-
});
|
|
315
|
-
namespaces.add(module.namespace);
|
|
316
|
-
for (const [index, definition] of module.definitions.entries()) {
|
|
317
|
-
const id = definition.id;
|
|
318
|
-
if (id === void 0) {
|
|
319
|
-
this.error("WW_REFERENCE", "app.page-id-required", module);
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
const key = this.key(module.namespace, definition.kind, id);
|
|
323
|
-
const owner = { module, definition, key };
|
|
324
|
-
this.walk(
|
|
325
|
-
definition,
|
|
326
|
-
(node, path) => {
|
|
327
|
-
this.ownerByNode.set(node, owner);
|
|
328
|
-
this.pathByNode.set(node, path);
|
|
329
|
-
},
|
|
330
|
-
`${module.id}/definitions/${index}`
|
|
331
|
-
);
|
|
332
|
-
if (this.owners.has(key))
|
|
333
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-definition", definition, { id });
|
|
334
|
-
else this.owners.set(key, owner);
|
|
335
|
-
const localIds = /* @__PURE__ */ new Set();
|
|
336
|
-
this.walk(
|
|
337
|
-
definition,
|
|
338
|
-
(node) => {
|
|
339
|
-
if ("id" in node && node.id !== void 0) {
|
|
340
|
-
if (localIds.has(node.id))
|
|
341
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-local-id", node, { id: node.id });
|
|
342
|
-
localIds.add(node.id);
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
""
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
resolve(owner, kind, id, alias, node = owner.definition) {
|
|
351
|
-
let namespace = owner.module.namespace;
|
|
352
|
-
if (alias !== void 0) {
|
|
353
|
-
const imported = owner.module.imports.find((item) => item.namespace === alias);
|
|
354
|
-
const target2 = imported === void 0 ? void 0 : this.moduleById.get(imported.moduleId);
|
|
355
|
-
if (target2 === void 0 || imported === void 0 || !imported.symbols.some((symbol) => symbol.kind === kind && symbol.id === id)) {
|
|
356
|
-
this.error("WW_REFERENCE", "app.unimported-symbol", node, { kind, id, namespace: alias });
|
|
357
|
-
return void 0;
|
|
358
|
-
}
|
|
359
|
-
namespace = target2.namespace;
|
|
360
|
-
}
|
|
361
|
-
const target = this.owners.get(this.key(namespace, kind, id));
|
|
362
|
-
if (target === void 0)
|
|
363
|
-
this.error("WW_REFERENCE", "app.missing-symbol", node, { kind, id, namespace });
|
|
364
|
-
return target;
|
|
365
|
-
}
|
|
366
|
-
imports() {
|
|
367
|
-
for (const module of this.bundle.modules) {
|
|
368
|
-
const aliases = /* @__PURE__ */ new Set();
|
|
369
|
-
const edges = [];
|
|
370
|
-
for (const [index, imported] of module.imports.entries()) {
|
|
371
|
-
this.pathByNode.set(imported, `${module.id}/imports/${index}`);
|
|
372
|
-
if (aliases.has(imported.namespace))
|
|
373
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-import-alias", imported);
|
|
374
|
-
aliases.add(imported.namespace);
|
|
375
|
-
const target = this.moduleById.get(imported.moduleId);
|
|
376
|
-
if (target === void 0 || target.sourceDigest !== imported.digest) {
|
|
377
|
-
this.error("WW_IMPORT", "app.import-digest-or-module", imported);
|
|
378
|
-
continue;
|
|
379
|
-
}
|
|
380
|
-
edges.push(target.id);
|
|
381
|
-
const selected = /* @__PURE__ */ new Set();
|
|
382
|
-
for (const symbol of imported.symbols) {
|
|
383
|
-
const key = `${symbol.kind}/${symbol.id}`;
|
|
384
|
-
if (selected.has(key))
|
|
385
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-import-symbol", imported);
|
|
386
|
-
selected.add(key);
|
|
387
|
-
if (!target.exports.some((entry) => entry.kind === symbol.kind && entry.id === symbol.id))
|
|
388
|
-
this.error("WW_IMPORT", "app.unexported-symbol", imported, { symbol: key });
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
const exports = /* @__PURE__ */ new Set();
|
|
392
|
-
for (const item of module.exports) {
|
|
393
|
-
const key = this.key(module.namespace, item.kind, item.id);
|
|
394
|
-
if (exports.has(key)) this.error("WW_DUPLICATE_ID", "app.duplicate-export", module);
|
|
395
|
-
exports.add(key);
|
|
396
|
-
if (!this.owners.has(key))
|
|
397
|
-
this.error("WW_IMPORT", "app.missing-export", module, { id: item.id });
|
|
398
|
-
}
|
|
399
|
-
this.moduleEdges.set(module.id, edges);
|
|
400
|
-
}
|
|
401
|
-
this.cycles(this.moduleEdges, 64);
|
|
402
|
-
}
|
|
403
|
-
cycles(edges, depthLimit) {
|
|
404
|
-
var _a, _b, _c;
|
|
405
|
-
const colors = /* @__PURE__ */ new Map();
|
|
406
|
-
for (const start of edges.keys()) {
|
|
407
|
-
if (colors.has(start)) continue;
|
|
408
|
-
const frames = [{ id: start, cursor: 0 }];
|
|
409
|
-
colors.set(start, 1);
|
|
410
|
-
while (frames.length > 0) {
|
|
411
|
-
const current = frames[frames.length - 1];
|
|
412
|
-
const neighbors = (_a = edges.get(current.id)) != null ? _a : [];
|
|
413
|
-
if (current.cursor === neighbors.length) {
|
|
414
|
-
colors.set(current.id, 2);
|
|
415
|
-
frames.pop();
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
const next = neighbors[current.cursor++];
|
|
419
|
-
if (colors.get(next) === 1) {
|
|
420
|
-
this.error(
|
|
421
|
-
"WW_CYCLE",
|
|
422
|
-
"app.dependency-cycle",
|
|
423
|
-
(_c = (_b = this.owners.get(current.id)) == null ? void 0 : _b.definition) != null ? _c : this.moduleById.get(current.id),
|
|
424
|
-
{ from: current.id, to: next }
|
|
425
|
-
);
|
|
426
|
-
continue;
|
|
427
|
-
}
|
|
428
|
-
if (colors.has(next)) continue;
|
|
429
|
-
if (frames.length >= depthLimit) {
|
|
430
|
-
this.error("WW_LIMIT", "app.dependency-depth", void 0, { id: next });
|
|
431
|
-
continue;
|
|
432
|
-
}
|
|
433
|
-
colors.set(next, 1);
|
|
434
|
-
frames.push({ id: next, cursor: 0 });
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
references() {
|
|
439
|
-
for (const owner of this.owners.values()) {
|
|
440
|
-
const edges = [];
|
|
441
|
-
const slots = /* @__PURE__ */ new Set();
|
|
442
|
-
this.walk(
|
|
443
|
-
owner.definition,
|
|
444
|
-
(node) => {
|
|
445
|
-
var _a;
|
|
446
|
-
if (node.kind === "use") {
|
|
447
|
-
const target = this.resolve(owner, "component", node.name, node.namespace, node);
|
|
448
|
-
if (target !== void 0) edges.push(target.key);
|
|
449
|
-
}
|
|
450
|
-
if (node.kind === "slot") {
|
|
451
|
-
const name = (_a = node.name) != null ? _a : "";
|
|
452
|
-
if (slots.has(name)) this.error("WW_SLOT", "app.duplicate-slot", node);
|
|
453
|
-
slots.add(name);
|
|
454
|
-
if (owner.definition.kind === "component" && name === "")
|
|
455
|
-
this.error("WW_SLOT", "app.component-slot-name", node);
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
""
|
|
459
|
-
);
|
|
460
|
-
if (owner.definition.kind === "layout" && (slots.size !== 1 || !slots.has("")))
|
|
461
|
-
this.error("WW_SLOT", "app.layout-slot-cardinality", owner.definition);
|
|
462
|
-
const uses = owner.definition.attributes.uses;
|
|
463
|
-
if (typeof uses === "string") {
|
|
464
|
-
if (owner.definition.kind !== "page")
|
|
465
|
-
this.error("WW_REFERENCE", "app.layout-nesting", owner.definition);
|
|
466
|
-
const [alias, id] = uses.includes("::") ? uses.split("::") : [void 0, uses];
|
|
467
|
-
const target = this.resolve(owner, "layout", id, alias);
|
|
468
|
-
if (target !== void 0) edges.push(target.key);
|
|
469
|
-
}
|
|
470
|
-
this.definitionEdges.set(owner.key, edges);
|
|
471
|
-
}
|
|
472
|
-
this.cycles(this.definitionEdges, 1e4);
|
|
473
|
-
}
|
|
474
|
-
registryChecks() {
|
|
475
|
-
const entries = this.bundle.registry.entries;
|
|
476
|
-
const sorted = entries.slice().sort((a, b) => {
|
|
477
|
-
const left = `${textValue(a.kind)}\0${textValue(a.namespace)}\0${textValue(a.id)}`;
|
|
478
|
-
const right = `${textValue(b.kind)}\0${textValue(b.namespace)}\0${textValue(b.id)}`;
|
|
479
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
480
|
-
});
|
|
481
|
-
if (jcs(entries) !== jcs(sorted) || chunkIMUVIIJR_cjs.digestV4(jcs(entries)) !== this.bundle.registry.digest)
|
|
482
|
-
this.error("WW_REGISTRY", "app.registry-digest");
|
|
483
|
-
for (const entry of entries) {
|
|
484
|
-
if (typeof entry.id !== "string" || !uuids.test(entry.id) || typeof entry.namespace !== "string" || !["Requirement", "ImplementationObligation"].includes(textValue(entry.kind))) {
|
|
485
|
-
this.error("WW_REGISTRY", "app.registry-identity");
|
|
486
|
-
continue;
|
|
487
|
-
}
|
|
488
|
-
if (this.registry.has(entry.id))
|
|
489
|
-
this.error("WW_REGISTRY", "app.duplicate-registry-id", void 0, { id: entry.id });
|
|
490
|
-
this.registry.set(entry.id, entry);
|
|
491
|
-
if (typeof entry.title !== "string" || entry.title.length === 0 || !Array.isArray(entry.acceptance) || entry.acceptance.length === 0)
|
|
492
|
-
this.error("WW_REGISTRY", "app.incomplete-requirement", void 0, { id: entry.id });
|
|
493
|
-
if (entry.kind === "ImplementationObligation") {
|
|
494
|
-
for (const field of ["trigger", "authority"])
|
|
495
|
-
if (typeof entry[field] !== "string" || entry[field].length === 0)
|
|
496
|
-
this.error("WW_REGISTRY", "app.incomplete-obligation", void 0, {
|
|
497
|
-
id: entry.id,
|
|
498
|
-
field
|
|
499
|
-
});
|
|
500
|
-
for (const field of ["preconditions", "success", "failureCases", "requirementRefs"])
|
|
501
|
-
if (!Array.isArray(entry[field]) || field !== "preconditions" && entry[field].length === 0)
|
|
502
|
-
this.error("WW_REGISTRY", "app.incomplete-obligation", void 0, {
|
|
503
|
-
id: entry.id,
|
|
504
|
-
field
|
|
505
|
-
});
|
|
506
|
-
for (const field of ["request", "response"])
|
|
507
|
-
if (!object(entry[field]) || !["schema", "not-applicable"].includes(textValue(entry[field].mode)))
|
|
508
|
-
this.error("WW_REGISTRY", "app.incomplete-obligation", void 0, {
|
|
509
|
-
id: entry.id,
|
|
510
|
-
field
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
for (const entry of entries) {
|
|
515
|
-
for (const ref of Array.isArray(entry.requirementRefs) ? entry.requirementRefs : []) {
|
|
516
|
-
const target = object(ref) ? this.registry.get(textValue(ref.id)) : void 0;
|
|
517
|
-
if ((target == null ? void 0 : target.kind) !== "Requirement" || !object(ref) || ref.namespace !== target.namespace || ref.kind !== "Requirement")
|
|
518
|
-
this.error("WW_REGISTRY", "app.obligation-requirement-reference");
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
for (const owner of this.owners.values())
|
|
522
|
-
this.walk(
|
|
523
|
-
owner.definition,
|
|
524
|
-
(node) => {
|
|
525
|
-
if (!("attributes" in node)) return;
|
|
526
|
-
this.registryRefs(node.attributes, node);
|
|
527
|
-
for (const handler of asObjects(node.attributes.on))
|
|
528
|
-
for (const operation of asObjects(handler.operations))
|
|
529
|
-
this.registryRefs(operation, node);
|
|
530
|
-
},
|
|
531
|
-
""
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
registryRefs(value, node) {
|
|
535
|
-
var _a;
|
|
536
|
-
for (const [field, kind] of [
|
|
537
|
-
["requirementRefs", "Requirement"],
|
|
538
|
-
["obligationRefs", "ImplementationObligation"]
|
|
539
|
-
]) {
|
|
540
|
-
for (const id of Array.isArray(value[field]) ? value[field] : []) {
|
|
541
|
-
if (typeof id !== "string" || ((_a = this.registry.get(id)) == null ? void 0 : _a.kind) !== kind)
|
|
542
|
-
this.error("WW_REGISTRY", "app.unresolved-registry-reference", node, { field, id });
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
binding(value) {
|
|
547
|
-
if (!object(value)) {
|
|
548
|
-
this.error("WW_REGISTRY", "app.invalid-source-binding");
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
if (value.scope === "instance" && (!object(value.instanceRoot) || !Array.isArray(value.instancePath))) {
|
|
552
|
-
this.error("WW_REGISTRY", "app.invalid-instance-binding");
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
if (!["module", "definition", "instance", "app-state"].includes(textValue(value.scope))) {
|
|
556
|
-
this.error("WW_REGISTRY", "app.invalid-source-binding");
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if (value.scope === "app-state") {
|
|
560
|
-
if (value.appId !== this.bundle.id || !this.bundle.states.some((state) => `app:${textValue(state.id)}` === value.stateRef))
|
|
561
|
-
this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
const module = this.moduleById.get(textValue(value.moduleId));
|
|
565
|
-
if (module === void 0) {
|
|
566
|
-
this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
if (value.scope === "module") return;
|
|
570
|
-
const owner = this.owners.get(
|
|
571
|
-
this.key(module.namespace, textValue(value.definitionKind), textValue(value.definitionId))
|
|
572
|
-
);
|
|
573
|
-
if (owner === void 0) {
|
|
574
|
-
this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
if (value.scope === "instance" && (value.appId !== this.bundle.id || !this.expanded.some(
|
|
578
|
-
(entry) => entry.owner === owner && jcs(entry.identity.instanceRoot) === jcs(value.instanceRoot) && jcs(entry.identity.instancePath) === jcs(value.instancePath) && (!["element", "operation"].includes(textValue(value.targetKind)) || entry.node.id === value.elementId)
|
|
579
|
-
)))
|
|
580
|
-
this.error("WW_REGISTRY", "app.unresolved-instance-binding");
|
|
581
|
-
if (value.targetKind === "definition") return;
|
|
582
|
-
if (value.targetKind === "variant") {
|
|
583
|
-
if (!Array.isArray(owner.definition.attributes.variants) || !owner.definition.attributes.variants.includes(value.variantId))
|
|
584
|
-
this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
if (value.targetKind === "state") {
|
|
588
|
-
const scope = owner.definition.kind === "page" ? "screen" : owner.definition.kind === "layout" ? "shell" : "component";
|
|
589
|
-
if (!asObjects(owner.definition.attributes.states).some(
|
|
590
|
-
(state) => value.stateRef === `${scope}:${textValue(state.id)}`
|
|
591
|
-
))
|
|
592
|
-
this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
let found = false;
|
|
596
|
-
this.walk(
|
|
597
|
-
owner.definition,
|
|
598
|
-
(node) => {
|
|
599
|
-
if (!("id" in node) || node.id !== value.elementId || !("attributes" in node)) return;
|
|
600
|
-
found = value.targetKind === "element" || asObjects(node.attributes.on).some(
|
|
601
|
-
(handler) => asObjects(handler.operations).some((operation) => operation.id === value.operationId)
|
|
602
|
-
);
|
|
603
|
-
},
|
|
604
|
-
""
|
|
605
|
-
);
|
|
606
|
-
if (!found) this.error("WW_REGISTRY", "app.unresolved-source-binding");
|
|
607
|
-
}
|
|
608
|
-
route(reference, node, code = "WW_REFERENCE") {
|
|
609
|
-
const target = this.owners.get(this.key(reference.namespace, "page", reference.id));
|
|
610
|
-
if (target === void 0 || reference.variant !== void 0 && (!Array.isArray(target.definition.attributes.variants) || !target.definition.attributes.variants.includes(reference.variant))) {
|
|
611
|
-
this.error(code, "app.unresolved-route", node, {
|
|
612
|
-
namespace: reference.namespace,
|
|
613
|
-
id: reference.id
|
|
614
|
-
});
|
|
615
|
-
return void 0;
|
|
616
|
-
}
|
|
617
|
-
return target;
|
|
618
|
-
}
|
|
619
|
-
frame(owner) {
|
|
620
|
-
var _a;
|
|
621
|
-
const attrs = owner.definition.attributes;
|
|
622
|
-
const { width, height } = this.bundle.profile;
|
|
623
|
-
const pair = attrs.viewport === void 0 ? null : /^(\d+)(?:x(\d+))?$/.exec(textValue(attrs.viewport));
|
|
624
|
-
const presets = {
|
|
625
|
-
"desktop-sm": [1280, 800],
|
|
626
|
-
desktop: [1440, 900],
|
|
627
|
-
"desktop-lg": [1920, 1080],
|
|
628
|
-
"desktop-xl": [2560, 1440],
|
|
629
|
-
ipad: [1024, 768],
|
|
630
|
-
"ipad-portrait": [768, 1024],
|
|
631
|
-
"ipad-pro": [1366, 1024],
|
|
632
|
-
"ipad-pro-portrait": [1024, 1366],
|
|
633
|
-
"iphone-se": [375, 667],
|
|
634
|
-
iphone14: [390, 844],
|
|
635
|
-
"iphone14-pro": [393, 852],
|
|
636
|
-
"iphone14-pro-max": [430, 932],
|
|
637
|
-
android: [360, 800],
|
|
638
|
-
"android-lg": [412, 915]
|
|
639
|
-
};
|
|
640
|
-
const device = presets[textValue(attrs.device)];
|
|
641
|
-
if (attrs.viewport !== void 0 && (pair === null || Number(pair[1]) !== width || Number((_a = pair[2]) != null ? _a : 900) !== height) || attrs.device !== void 0 && (!device || device[0] !== width || device[1] !== height) || ["w", "width"].some(
|
|
642
|
-
(key) => attrs[key] !== void 0 && attrs[key] !== width && attrs[key] !== "screen" && attrs[key] !== "full"
|
|
643
|
-
) || ["h", "height"].some(
|
|
644
|
-
(key) => attrs[key] !== void 0 && attrs[key] !== height && attrs[key] !== "screen" && attrs[key] !== "full"
|
|
645
|
-
))
|
|
646
|
-
this.error("WW_VIEWPORT", "app.incompatible-frame", owner.definition);
|
|
647
|
-
}
|
|
648
|
-
expandAll() {
|
|
649
|
-
var _a;
|
|
650
|
-
this.route(this.bundle.entry, void 0, "WW_ROUTE");
|
|
651
|
-
const pages = [...this.owners.values()].filter((owner) => owner.definition.kind === "page");
|
|
652
|
-
if (pages.length === 0 || pages.length > 2e3) this.error("WW_LIMIT", "app.screen-count");
|
|
653
|
-
for (const owner of pages) {
|
|
654
|
-
this.frame(owner);
|
|
655
|
-
const screen = {
|
|
656
|
-
owner,
|
|
657
|
-
route: { namespace: owner.module.namespace, id: owner.definition.id },
|
|
658
|
-
children: []
|
|
659
|
-
};
|
|
660
|
-
const root = { kind: "screen", ...screen.route };
|
|
661
|
-
const uses = owner.definition.attributes.uses;
|
|
662
|
-
if (typeof uses === "string") {
|
|
663
|
-
const [alias, id] = uses.includes("::") ? uses.split("::") : [void 0, uses];
|
|
664
|
-
const layout = this.resolve(owner, "layout", id, alias);
|
|
665
|
-
if (layout !== void 0) {
|
|
666
|
-
screen.shell = layout.key;
|
|
667
|
-
if (!this.shells.some((shell) => shell.owner === layout)) {
|
|
668
|
-
this.frame(layout);
|
|
669
|
-
const shellRoot = {
|
|
670
|
-
kind: "shell",
|
|
671
|
-
namespace: layout.module.namespace,
|
|
672
|
-
id: layout.definition.id,
|
|
673
|
-
profileDigest: chunkIMUVIIJR_cjs.digestV4(jcs(this.bundle.profile))
|
|
674
|
-
};
|
|
675
|
-
const children = this.expandChildren([layout.definition], {
|
|
676
|
-
owner: layout,
|
|
677
|
-
root: shellRoot,
|
|
678
|
-
path: [],
|
|
679
|
-
bindings: {},
|
|
680
|
-
fills: /* @__PURE__ */ new Map(),
|
|
681
|
-
invocationSources: [],
|
|
682
|
-
depth: 0
|
|
683
|
-
});
|
|
684
|
-
const slot = this.expanded.find((node) => node.slot && node.owner === layout);
|
|
685
|
-
this.shells.push({ owner: layout, children, slotId: (_a = slot == null ? void 0 : slot.renderedId) != null ? _a : "" });
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
screen.children = this.expandChildren([owner.definition], {
|
|
690
|
-
owner,
|
|
691
|
-
root,
|
|
692
|
-
path: [],
|
|
693
|
-
bindings: {},
|
|
694
|
-
fills: /* @__PURE__ */ new Map(),
|
|
695
|
-
invocationSources: [],
|
|
696
|
-
depth: 0
|
|
697
|
-
});
|
|
698
|
-
this.screens.push(screen);
|
|
699
|
-
if (this.expandedCount > 1e6) break;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
expandChildren(nodes, context) {
|
|
703
|
-
var _a, _b, _c, _d, _e;
|
|
704
|
-
const result = [];
|
|
705
|
-
for (const node of nodes) {
|
|
706
|
-
if (++this.expandedCount > 1e6 || context.depth > 128) {
|
|
707
|
-
this.error("WW_LIMIT", "app.expansion-limit", node);
|
|
708
|
-
break;
|
|
709
|
-
}
|
|
710
|
-
if (node.kind === "use") {
|
|
711
|
-
const target = this.resolve(context.owner, "component", node.name, node.namespace, node);
|
|
712
|
-
if (target === void 0 || target.definition.kind !== "component") continue;
|
|
713
|
-
if (this.bundle.profile.id === "neutral-app" && this.source(node).authoredId === false)
|
|
714
|
-
this.error("WW_REFERENCE", "app.invocation-id-required", node);
|
|
715
|
-
const bindings = {};
|
|
716
|
-
const parameters = target.definition.parameters;
|
|
717
|
-
for (const name of Object.keys(node.inputs))
|
|
718
|
-
if (!parameters.some((parameter) => parameter.id === name))
|
|
719
|
-
this.error("WW_PARAMETER", "app.unknown-argument", node, { name });
|
|
720
|
-
for (const parameter of parameters) {
|
|
721
|
-
const input = node.inputs[parameter.id];
|
|
722
|
-
const value = input === void 0 ? parameter.default : "literal" in input ? input.literal : context.bindings[input.param];
|
|
723
|
-
if (!matchesType(value, parameter.type))
|
|
724
|
-
this.error("WW_PARAMETER", "app.argument-type", node, {
|
|
725
|
-
name: parameter.id,
|
|
726
|
-
type: parameter.type
|
|
727
|
-
});
|
|
728
|
-
else Object.defineProperty(bindings, parameter.id, { value, enumerable: true });
|
|
729
|
-
}
|
|
730
|
-
const slots = /* @__PURE__ */ new Set();
|
|
731
|
-
this.walk(
|
|
732
|
-
target.definition,
|
|
733
|
-
(child) => {
|
|
734
|
-
var _a2;
|
|
735
|
-
if (child.kind === "slot") slots.add((_a2 = child.name) != null ? _a2 : "");
|
|
736
|
-
},
|
|
737
|
-
""
|
|
738
|
-
);
|
|
739
|
-
const fills = /* @__PURE__ */ new Map();
|
|
740
|
-
for (const fill of node.fills) {
|
|
741
|
-
if (!slots.has(fill.name))
|
|
742
|
-
this.error("WW_SLOT", "app.unknown-fill", node, { name: fill.name });
|
|
743
|
-
if (fills.has(fill.name))
|
|
744
|
-
this.error("WW_SLOT", "app.duplicate-fill", node, { name: fill.name });
|
|
745
|
-
fills.set(fill.name, { nodes: fill.children, context });
|
|
746
|
-
}
|
|
747
|
-
if (this.diagnostics.length > 0) continue;
|
|
748
|
-
const children = this.expandChildren(target.definition.children, {
|
|
749
|
-
...context,
|
|
750
|
-
owner: target,
|
|
751
|
-
bindings,
|
|
752
|
-
fills,
|
|
753
|
-
path: [...context.path, { kind: "use", id: node.id }],
|
|
754
|
-
invocationSources: [...context.invocationSources, this.source(node)],
|
|
755
|
-
depth: context.depth + 1
|
|
756
|
-
});
|
|
757
|
-
for (const child of children) result.push(child);
|
|
758
|
-
} else if (node.kind === "repeat") {
|
|
759
|
-
if (this.bundle.profile.id === "neutral-app" && node.id === void 0)
|
|
760
|
-
this.error("WW_REFERENCE", "app.repeat-id-required", node);
|
|
761
|
-
if (node.count > 0 && node.count * node.children.length + this.expandedCount > 1e6) {
|
|
762
|
-
this.error("WW_LIMIT", "app.expansion-limit", node);
|
|
763
|
-
continue;
|
|
764
|
-
}
|
|
765
|
-
for (let index = 0; index < node.count; index++) {
|
|
766
|
-
const children = this.expandChildren(node.children, {
|
|
767
|
-
...context,
|
|
768
|
-
path: [
|
|
769
|
-
...context.path,
|
|
770
|
-
{ kind: "repeat", id: (_a = node.id) != null ? _a : `_repeat_${this.source(node).start}`, index }
|
|
771
|
-
],
|
|
772
|
-
depth: context.depth + 1
|
|
773
|
-
});
|
|
774
|
-
for (const child of children) result.push(child);
|
|
775
|
-
if (this.expandedCount > 1e6) break;
|
|
776
|
-
}
|
|
777
|
-
} else if (node.kind === "slot" && context.owner.definition.kind === "component") {
|
|
778
|
-
const fill = context.fills.get((_b = node.name) != null ? _b : "");
|
|
779
|
-
if (fill !== void 0) {
|
|
780
|
-
const children = this.expandChildren(fill.nodes, {
|
|
781
|
-
...fill.context,
|
|
782
|
-
root: context.root,
|
|
783
|
-
path: context.path,
|
|
784
|
-
invocationSources: context.invocationSources,
|
|
785
|
-
depth: context.depth + 1
|
|
786
|
-
});
|
|
787
|
-
for (const child of children) result.push(child);
|
|
788
|
-
}
|
|
789
|
-
} else {
|
|
790
|
-
if (node.kind === "component" || node.kind === "layout" && node !== context.owner.definition) {
|
|
791
|
-
this.error("WW_SCHEMA", "app.nested-definition", node);
|
|
792
|
-
continue;
|
|
793
|
-
}
|
|
794
|
-
const slot = node.kind === "slot";
|
|
795
|
-
const source = this.source(node);
|
|
796
|
-
const replacement = (value) => context.owner.definition.kind === "component" ? substitute(
|
|
797
|
-
value,
|
|
798
|
-
context.bindings,
|
|
799
|
-
(name) => this.error("WW_PARAMETER", "app.unbound-parameter", node, { name })
|
|
800
|
-
) : value;
|
|
801
|
-
const authored = node;
|
|
802
|
-
const primitive = slot ? { kind: "section", attributes: {}, children: [] } : {
|
|
803
|
-
...authored,
|
|
804
|
-
...node.kind === "layout" ? { kind: "section" } : {},
|
|
805
|
-
attributes: plain(replacement(authored.attributes)),
|
|
806
|
-
...authored.label === void 0 ? {} : { label: replacement(authored.label) },
|
|
807
|
-
children: []
|
|
808
|
-
};
|
|
809
|
-
this.pathByNode.set(primitive, (_c = this.pathByNode.get(node)) != null ? _c : "");
|
|
810
|
-
if (context.owner.definition.kind === "component") this.checkSubstituted(primitive, node);
|
|
811
|
-
const identity = {
|
|
812
|
-
namespace: context.owner.module.namespace,
|
|
813
|
-
definitionKind: context.owner.definition.kind,
|
|
814
|
-
definitionId: context.owner.definition.id,
|
|
815
|
-
instanceRoot: context.root,
|
|
816
|
-
instancePath: context.path,
|
|
817
|
-
localId: (_e = primitive.id) != null ? _e : slot ? "_slot" : `_node_${chunkIMUVIIJR_cjs.digestV4((_d = this.pathByNode.get(node)) != null ? _d : textValue(source.start)).slice(7)}`
|
|
818
|
-
};
|
|
819
|
-
const renderedId = `wf-${chunkIMUVIIJR_cjs.digestV4(jcs({ identity, projectionId: this.bundle.profile.id })).slice(7)}`;
|
|
820
|
-
if (this.domIds.has(renderedId))
|
|
821
|
-
this.error("WW_DUPLICATE_ID", "app.rendered-identity-collision", node);
|
|
822
|
-
this.domIds.add(renderedId);
|
|
823
|
-
const expanded = {
|
|
824
|
-
node: primitive,
|
|
825
|
-
owner: context.owner,
|
|
826
|
-
identity,
|
|
827
|
-
renderedId,
|
|
828
|
-
source,
|
|
829
|
-
invocationSources: context.invocationSources,
|
|
830
|
-
children: [],
|
|
831
|
-
stateBindings: {},
|
|
832
|
-
...slot ? { slot: true } : {}
|
|
833
|
-
};
|
|
834
|
-
this.expanded.push(expanded);
|
|
835
|
-
if (!slot && "children" in node) {
|
|
836
|
-
expanded.children = this.expandChildren(node.children, {
|
|
837
|
-
...context,
|
|
838
|
-
depth: context.depth + 1
|
|
839
|
-
});
|
|
840
|
-
for (const child of expanded.children) child.parent = expanded;
|
|
841
|
-
}
|
|
842
|
-
result.push(expanded);
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
return result;
|
|
846
|
-
}
|
|
847
|
-
checkSubstituted(node, source) {
|
|
848
|
-
const name = node.kind === "nav-item" || node.kind === "dropdown-item" || node.kind === "list-item" || node.kind === "annotation-item" ? "item" : node.kind === "nav-group" ? "group" : node.kind;
|
|
849
|
-
const label = node.label === void 0 ? "" : ` ${dsl(node.label)}`;
|
|
850
|
-
let snippet = `${name}${node.number === void 0 ? "" : ` ${node.number}`}${label} ${attrsDsl(node.attributes)}${containers.has(node.kind) ? " {}" : ""}`;
|
|
851
|
-
if (node.kind === "table") snippet = `table ${attrsDsl(node.attributes)} {}`;
|
|
852
|
-
const parent = {
|
|
853
|
-
"nav-item": "nav",
|
|
854
|
-
"nav-group": "nav",
|
|
855
|
-
"dropdown-item": "dropdown",
|
|
856
|
-
"list-item": "list",
|
|
857
|
-
tab: "tabs",
|
|
858
|
-
option: "select",
|
|
859
|
-
"annotation-item": "annotations"
|
|
860
|
-
}[node.kind];
|
|
861
|
-
if (parent !== void 0) snippet = `${parent} { ${snippet} }`;
|
|
862
|
-
try {
|
|
863
|
-
chunkIMUVIIJR_cjs.parseV4(`page { ${snippet} }`, { languageVersion: "4.0.0" });
|
|
864
|
-
} catch (error) {
|
|
865
|
-
if (error instanceof chunkIMUVIIJR_cjs.V4ParseError)
|
|
866
|
-
this.error("WW_PARAMETER", "app.substituted-attribute-domain", source);
|
|
867
|
-
else throw error;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
state(ref, expanded) {
|
|
871
|
-
var _a, _b, _c;
|
|
872
|
-
const [scope, id] = ref.split(":");
|
|
873
|
-
let declarations = [];
|
|
874
|
-
if (scope === "app") declarations = this.bundle.states;
|
|
875
|
-
else if (scope === "component" && expanded.owner.definition.kind === "component")
|
|
876
|
-
declarations = asObjects(expanded.owner.definition.attributes.states);
|
|
877
|
-
else if (scope === "screen" && expanded.identity.instanceRoot.kind === "screen") {
|
|
878
|
-
const root = expanded.identity.instanceRoot;
|
|
879
|
-
const owner = this.owners.get(this.key(root.namespace, "page", root.id));
|
|
880
|
-
declarations = asObjects(owner == null ? void 0 : owner.definition.attributes.states);
|
|
881
|
-
} else if (scope === "shell") {
|
|
882
|
-
const root = expanded.identity.instanceRoot;
|
|
883
|
-
const screen = root.kind === "screen" ? this.screens.find(
|
|
884
|
-
(screen2) => screen2.route.namespace === root.namespace && screen2.route.id === root.id
|
|
885
|
-
) : void 0;
|
|
886
|
-
const owner = root.kind === "shell" ? this.owners.get(this.key(root.namespace, "layout", root.id)) : this.owners.get((_a = screen == null ? void 0 : screen.shell) != null ? _a : "");
|
|
887
|
-
declarations = asObjects(owner == null ? void 0 : owner.definition.attributes.states);
|
|
888
|
-
}
|
|
889
|
-
const state = declarations.find((state2) => state2.id === id);
|
|
890
|
-
if (state === void 0) this.error("WW_STATE", "app.unresolved-state", expanded.node, { ref });
|
|
891
|
-
else {
|
|
892
|
-
const root = expanded.identity.instanceRoot;
|
|
893
|
-
const shellOwner = root.kind === "shell" ? this.owners.get(this.key(root.namespace, "layout", root.id)) : this.owners.get(
|
|
894
|
-
(_c = (_b = this.screens.find(
|
|
895
|
-
(screen) => screen.route.namespace === root.namespace && screen.route.id === root.id
|
|
896
|
-
)) == null ? void 0 : _b.shell) != null ? _c : ""
|
|
897
|
-
);
|
|
898
|
-
const stateRoot = scope === "app" ? "app" : scope === "shell" ? `shell/${shellOwner == null ? void 0 : shellOwner.module.namespace}/${shellOwner == null ? void 0 : shellOwner.definition.id}` : `${root.kind}/${root.namespace}/${root.id}`;
|
|
899
|
-
const key = scope === "app" ? ref : scope === "component" ? `${expanded.owner.key}/${jcs(root)}/${jcs(componentPath(expanded.identity.instancePath))}/${id}` : scope === "screen" ? `screen/${root.namespace}/${root.id}/${id}` : `${stateRoot}/${id}`;
|
|
900
|
-
expanded.stateBindings[ref] = {
|
|
901
|
-
key,
|
|
902
|
-
initial: state.initial,
|
|
903
|
-
type: textValue(state.type),
|
|
904
|
-
lifetime: state.lifetime === "mount" ? "mount" : "session",
|
|
905
|
-
sensitive: state.sensitive === true,
|
|
906
|
-
root: stateRoot
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
return state;
|
|
910
|
-
}
|
|
911
|
-
semantics() {
|
|
912
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
913
|
-
for (const entry of this.bundle.registry.entries)
|
|
914
|
-
for (const binding of Array.isArray(entry.bindings) ? entry.bindings : [])
|
|
915
|
-
this.binding(binding);
|
|
916
|
-
if (asObjects(this.bundle.profile.assets).length > 0 || this.bundle.profile.fontAssetId !== void 0)
|
|
917
|
-
this.error("WW_ASSET", "app.asset-decoder-unavailable");
|
|
918
|
-
const scopes = [
|
|
919
|
-
{ node: void 0, states: this.bundle.states, app: true },
|
|
920
|
-
...[...this.owners.values()].map((owner) => ({
|
|
921
|
-
node: owner.definition,
|
|
922
|
-
states: asObjects(owner.definition.attributes.states),
|
|
923
|
-
app: false
|
|
924
|
-
}))
|
|
925
|
-
];
|
|
926
|
-
for (const scope of scopes) {
|
|
927
|
-
const ids = /* @__PURE__ */ new Set();
|
|
928
|
-
for (const state of scope.states) {
|
|
929
|
-
const id = textValue(state.id);
|
|
930
|
-
if (!matchesType(state.initial, textValue(state.type)))
|
|
931
|
-
this.error("WW_STATE", "app.state-initial-type", scope.node);
|
|
932
|
-
if (ids.has(id)) this.error("WW_DUPLICATE_ID", "app.duplicate-state", scope.node, { id });
|
|
933
|
-
ids.add(id);
|
|
934
|
-
if (scope.app && state.lifetime !== "session")
|
|
935
|
-
this.error("WW_STATE", "app.app-state-lifetime", scope.node);
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
const fixtureIds = /* @__PURE__ */ new Set();
|
|
939
|
-
for (const fixture of this.bundle.fixtures) {
|
|
940
|
-
const id = textValue(fixture.id);
|
|
941
|
-
if (fixtureIds.has(id))
|
|
942
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-fixture", void 0, { id });
|
|
943
|
-
fixtureIds.add(id);
|
|
944
|
-
}
|
|
945
|
-
for (const expanded of this.expanded) {
|
|
946
|
-
const { node, owner } = expanded;
|
|
947
|
-
const attrs = node.attributes;
|
|
948
|
-
const strict = this.bundle.profile.id === "neutral-app";
|
|
949
|
-
if (["row", "col", "stack"].includes(node.kind) && ["left", "right", "justify"].includes(textValue(attrs.align)))
|
|
950
|
-
this.error("WW_LAYOUT", "app.container-alignment", node);
|
|
951
|
-
if (attrs.src !== void 0 && attrs.src !== true)
|
|
952
|
-
this.error("WW_ASSET", "app.unresolved-asset", node);
|
|
953
|
-
const interactive = [
|
|
954
|
-
"input",
|
|
955
|
-
"textarea",
|
|
956
|
-
"select",
|
|
957
|
-
"checkbox",
|
|
958
|
-
"radio",
|
|
959
|
-
"switch",
|
|
960
|
-
"slider",
|
|
961
|
-
"button",
|
|
962
|
-
"link",
|
|
963
|
-
"nav-item",
|
|
964
|
-
"dropdown-item"
|
|
965
|
-
];
|
|
966
|
-
const descendants = (root) => {
|
|
967
|
-
const result = [], pending = [...root.children];
|
|
968
|
-
while (pending.length) {
|
|
969
|
-
const child = pending.pop();
|
|
970
|
-
result.push(child);
|
|
971
|
-
pending.push(...child.children);
|
|
972
|
-
}
|
|
973
|
-
return result;
|
|
974
|
-
};
|
|
975
|
-
const descend = ["form", "card", "tooltip"].includes(node.kind) || attrs.initialFocus !== void 0 || attrs.order !== void 0 ? descendants(expanded) : [];
|
|
976
|
-
if (node.kind === "form") {
|
|
977
|
-
if (descend.some((child) => child.node.kind === "form"))
|
|
978
|
-
this.error("WW_FORM", "app.nested-form", node);
|
|
979
|
-
const names = /* @__PURE__ */ new Map();
|
|
980
|
-
for (const child of descend.filter(
|
|
981
|
-
(child2) => ["input", "textarea", "select", "checkbox", "radio", "switch", "slider"].includes(
|
|
982
|
-
child2.node.kind
|
|
983
|
-
)
|
|
984
|
-
)) {
|
|
985
|
-
const name = textValue((_a = child.node.attributes.name) != null ? _a : child.node.id);
|
|
986
|
-
const previous = names.get(name);
|
|
987
|
-
if (previous && !(previous.node.kind === "radio" && child.node.kind === "radio" && jcs(previous.node.attributes.bind) === jcs(child.node.attributes.bind) && jcs(previous.node.attributes.value) !== jcs(child.node.attributes.value)))
|
|
988
|
-
this.error("WW_FORM", "app.duplicate-field-name", child.node, { name });
|
|
989
|
-
names.set(name, child);
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
if (node.kind === "card" && (attrs.on !== void 0 || attrs.navigate !== void 0) && descend.some((child) => interactive.includes(child.node.kind)))
|
|
993
|
-
this.error("WW_ACCESSIBILITY", "app.nested-interactive-card", node);
|
|
994
|
-
if (attrs.role !== void 0) {
|
|
995
|
-
const natural = {
|
|
996
|
-
button: ["button"],
|
|
997
|
-
link: ["link"],
|
|
998
|
-
image: ["img"],
|
|
999
|
-
alert: ["alert", "status"],
|
|
1000
|
-
toast: ["status", "alert"],
|
|
1001
|
-
spinner: ["status"],
|
|
1002
|
-
section: ["region"]
|
|
1003
|
-
};
|
|
1004
|
-
if (!((_b = natural[node.kind]) != null ? _b : []).includes(textValue(attrs.role)))
|
|
1005
|
-
this.error("WW_ACCESSIBILITY", "app.incompatible-role", node);
|
|
1006
|
-
}
|
|
1007
|
-
if (attrs.initialFocus !== void 0 && !descend.some(
|
|
1008
|
-
(child) => child.node.id === attrs.initialFocus && interactive.includes(child.node.kind) && child.node.attributes.disabled !== true
|
|
1009
|
-
))
|
|
1010
|
-
this.error("WW_ACCESSIBILITY", "app.invalid-initial-focus", node);
|
|
1011
|
-
if (node.kind === "tooltip" && (expanded.children.length !== 1 || descend.slice(1).some((child) => interactive.includes(child.node.kind))))
|
|
1012
|
-
this.error("WW_ACCESSIBILITY", "app.tooltip-trigger", node);
|
|
1013
|
-
if (node.kind === "tabs" && (typeof attrs.active === "boolean" || Number((_c = attrs.active) != null ? _c : 0) >= expanded.children.filter((child) => child.node.kind === "tab").length || ((_e = expanded.children.filter((child) => child.node.kind === "tab")[Number((_d = attrs.active) != null ? _d : 0)]) == null ? void 0 : _e.node.attributes.disabled) === true))
|
|
1014
|
-
this.error("WW_ACCESSIBILITY", "app.tab-selection", node);
|
|
1015
|
-
if (attrs.order !== void 0 && attrs.order !== 0 && (interactive.includes(node.kind) || descend.some((child) => interactive.includes(child.node.kind))))
|
|
1016
|
-
this.error("WW_ACCESSIBILITY", "app.visual-focus-order", node);
|
|
1017
|
-
for (const key of ["p", "px", "py", "pt", "pr", "pb", "pl", "gap"])
|
|
1018
|
-
if (attrs[key] === "auto" || (typeof attrs[key] === "number" ? Number(attrs[key]) < 0 : object(attrs[key]) && Number(attrs[key].value) < 0))
|
|
1019
|
-
this.error("WW_LAYOUT", "app.invalid-spacing", node, { key });
|
|
1020
|
-
for (const key of ["m", "my", "mt", "mr", "mb", "ml"])
|
|
1021
|
-
if (attrs[key] === "auto") this.error("WW_LAYOUT", "app.invalid-spacing", node, { key });
|
|
1022
|
-
for (const [minimum, maximum] of [
|
|
1023
|
-
["minW", "maxW"],
|
|
1024
|
-
["minH", "maxH"],
|
|
1025
|
-
["minLength", "maxLength"],
|
|
1026
|
-
["min", "max"]
|
|
1027
|
-
])
|
|
1028
|
-
if (typeof attrs[minimum] === "number" && typeof attrs[maximum] === "number" && Number(attrs[minimum]) > Number(attrs[maximum]))
|
|
1029
|
-
this.error("WW_LAYOUT", "app.inverted-bounds", node, { minimum, maximum });
|
|
1030
|
-
for (const key of ["minW", "maxW", "minH", "maxH"])
|
|
1031
|
-
if (typeof attrs[key] === "string")
|
|
1032
|
-
this.error("WW_LAYOUT", "app.bound-keyword", node, { key });
|
|
1033
|
-
if (attrs.h === "fit" || typeof attrs.flex === "number" && attrs.flex < 0 || typeof attrs.step === "number" && attrs.step <= 0)
|
|
1034
|
-
this.error("WW_LAYOUT", "app.invalid-layout-value", node);
|
|
1035
|
-
if (attrs.bold === true && attrs.weight !== void 0 && attrs.weight !== "bold" || attrs.primary === true && attrs.secondary === true || attrs.outline === true && attrs.ghost === true)
|
|
1036
|
-
this.error("WW_LAYOUT", "app.conflicting-presentation", node);
|
|
1037
|
-
if (node.kind !== "page" && (attrs.x !== void 0 || attrs.y !== void 0 || attrs.anchor !== void 0)) {
|
|
1038
|
-
let parent = expanded.parent;
|
|
1039
|
-
while (parent && parent.node.kind !== "relative") parent = parent.parent;
|
|
1040
|
-
if (!parent) this.error("WW_LAYOUT", "app.missing-relative-container", node);
|
|
1041
|
-
}
|
|
1042
|
-
if (object(attrs.h) && attrs.h.unit === "%") {
|
|
1043
|
-
const height = (_h = (_f = expanded.parent) == null ? void 0 : _f.node.attributes.h) != null ? _h : (_g = expanded.parent) == null ? void 0 : _g.node.attributes.height;
|
|
1044
|
-
if (((_i = expanded.parent) == null ? void 0 : _i.node.kind) !== "page" && (height === void 0 || height === "auto"))
|
|
1045
|
-
this.error("WW_LAYOUT", "app.indefinite-percentage-height", node);
|
|
1046
|
-
}
|
|
1047
|
-
if (strict && ["input", "textarea", "select", "checkbox", "radio", "switch", "slider", "button"].includes(
|
|
1048
|
-
node.kind
|
|
1049
|
-
) && ![node.label, attrs.label, attrs.aria, attrs["aria-label"]].some(
|
|
1050
|
-
(label) => typeof label === "string" && label.trim().length > 0
|
|
1051
|
-
))
|
|
1052
|
-
this.error("WW_ACCESSIBILITY", "app.missing-control-name", node);
|
|
1053
|
-
if (attrs.aria !== void 0 && attrs["aria-label"] !== void 0 && attrs.aria !== attrs["aria-label"])
|
|
1054
|
-
this.error("WW_ACCESSIBILITY", "app.conflicting-name", node);
|
|
1055
|
-
if (node.kind === "button" && (attrs.buttonType === "submit" || attrs.action === "submit" || attrs.form !== void 0)) {
|
|
1056
|
-
let target = expanded.parent;
|
|
1057
|
-
if (typeof attrs.form === "string")
|
|
1058
|
-
target = this.element(
|
|
1059
|
-
{
|
|
1060
|
-
scope: owner.definition.kind === "component" ? "component" : owner.definition.kind === "layout" ? "shell" : "screen",
|
|
1061
|
-
id: attrs.form
|
|
1062
|
-
},
|
|
1063
|
-
expanded
|
|
1064
|
-
);
|
|
1065
|
-
else while (target !== void 0 && target.node.kind !== "form") target = target.parent;
|
|
1066
|
-
if ((target == null ? void 0 : target.node.kind) !== "form" || target.node.id === void 0)
|
|
1067
|
-
this.error("WW_REFERENCE", "app.missing-form", node);
|
|
1068
|
-
else expanded.formTarget = target.renderedId;
|
|
1069
|
-
if (attrs.action === "submit" && attrs.buttonType !== void 0 && attrs.buttonType !== "submit")
|
|
1070
|
-
this.error("WW_EVENT", "app.conflicting-submit-button", node);
|
|
1071
|
-
}
|
|
1072
|
-
if (strict && node.id === void 0 && ["on", "bind", "navigate", "opens", "toggles", "action"].some(
|
|
1073
|
-
(key) => attrs[key] !== void 0
|
|
1074
|
-
))
|
|
1075
|
-
this.error("WW_REFERENCE", "app.addressed-id-required", node);
|
|
1076
|
-
if (attrs.navigate !== void 0) {
|
|
1077
|
-
if (typeof attrs.navigate !== "string" || !attrs.navigate.includes("::") && /^[A-Za-z][A-Za-z0-9+.-]*:/.test(attrs.navigate))
|
|
1078
|
-
this.error("WW_REFERENCE", "app.explicit-url-required", node);
|
|
1079
|
-
else {
|
|
1080
|
-
const [alias, id] = attrs.navigate.includes("::") ? attrs.navigate.split("::") : [void 0, attrs.navigate];
|
|
1081
|
-
const target = this.resolve(owner, "page", id, alias, node);
|
|
1082
|
-
if (target !== void 0)
|
|
1083
|
-
expanded.route = { namespace: target.module.namespace, id: target.definition.id };
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
if (typeof attrs.href === "string" && !safeUrl(attrs.href))
|
|
1087
|
-
this.error("WW_REFERENCE", "app.unsafe-url", node);
|
|
1088
|
-
if (attrs.action !== void 0 && !["back", "close", "submit"].includes(textValue(attrs.action)))
|
|
1089
|
-
this.error("WW_REFERENCE", "app.unknown-action", node);
|
|
1090
|
-
const shorthand = ["navigate", "opens", "toggles"].filter((key) => attrs[key] !== void 0);
|
|
1091
|
-
if (attrs.action === "back" || attrs.action === "close") shorthand.push("action");
|
|
1092
|
-
if (shorthand.length > 1 || shorthand.length > 0 && asObjects(attrs.on).some((handler) => handler.event === "click"))
|
|
1093
|
-
this.error("WW_EVENT", "app.competing-click-handlers", node);
|
|
1094
|
-
if (shorthand.length === 1) {
|
|
1095
|
-
let effect;
|
|
1096
|
-
if (expanded.route)
|
|
1097
|
-
effect = {
|
|
1098
|
-
kind: "navigate",
|
|
1099
|
-
target: { kind: "screen", screen: { ...expanded.route } },
|
|
1100
|
-
history: "push"
|
|
1101
|
-
};
|
|
1102
|
-
else if (attrs.action === "back") effect = { kind: "navigateBack" };
|
|
1103
|
-
else {
|
|
1104
|
-
const scope = owner.definition.kind === "component" ? "component" : owner.definition.kind === "layout" ? "shell" : "screen";
|
|
1105
|
-
let id = textValue((_j = attrs.opens) != null ? _j : attrs.toggles);
|
|
1106
|
-
if (attrs.action === "close") {
|
|
1107
|
-
let parent = expanded.parent;
|
|
1108
|
-
while (parent && !["modal", "drawer", "popover", "dropdown"].includes(parent.node.kind))
|
|
1109
|
-
parent = parent.parent;
|
|
1110
|
-
if (!(parent == null ? void 0 : parent.node.id)) this.error("WW_REFERENCE", "app.missing-owning-overlay", node);
|
|
1111
|
-
else id = parent.node.id;
|
|
1112
|
-
}
|
|
1113
|
-
if (id)
|
|
1114
|
-
effect = {
|
|
1115
|
-
kind: attrs.action === "close" ? "close" : attrs.toggles === void 0 ? "open" : "toggleOverlay",
|
|
1116
|
-
target: { scope, id }
|
|
1117
|
-
};
|
|
1118
|
-
}
|
|
1119
|
-
if (effect)
|
|
1120
|
-
attrs.on = [
|
|
1121
|
-
...asObjects(attrs.on),
|
|
1122
|
-
{
|
|
1123
|
-
id: "shorthand_click",
|
|
1124
|
-
event: "click",
|
|
1125
|
-
concurrency: "drop",
|
|
1126
|
-
operations: [
|
|
1127
|
-
{
|
|
1128
|
-
id: "primary_click",
|
|
1129
|
-
executionClass: "executable",
|
|
1130
|
-
effect,
|
|
1131
|
-
after: [],
|
|
1132
|
-
onFailure: "stop",
|
|
1133
|
-
obligationRefs: []
|
|
1134
|
-
}
|
|
1135
|
-
]
|
|
1136
|
-
}
|
|
1137
|
-
];
|
|
1138
|
-
}
|
|
1139
|
-
const declarationScope = owner.definition.kind === "component" ? "component" : owner.definition.kind === "layout" ? "shell" : "screen";
|
|
1140
|
-
for (const declaration of asObjects(owner.definition.attributes.states))
|
|
1141
|
-
this.state(`${declarationScope}:${textValue(declaration.id)}`, expanded);
|
|
1142
|
-
const stack = [attrs];
|
|
1143
|
-
while (stack.length > 0) {
|
|
1144
|
-
const value = stack.pop();
|
|
1145
|
-
if (Array.isArray(value)) {
|
|
1146
|
-
for (const item of value) stack.push(item);
|
|
1147
|
-
continue;
|
|
1148
|
-
}
|
|
1149
|
-
if (!object(value)) continue;
|
|
1150
|
-
if (typeof value.state === "string") this.state(value.state, expanded);
|
|
1151
|
-
for (const key of ["resultState", "statusState", "errorState", "source", "target"])
|
|
1152
|
-
if (typeof value[key] === "string" && /^(app|shell|screen|component):/.test(value[key]))
|
|
1153
|
-
this.state(value[key], expanded);
|
|
1154
|
-
if (object(value.read) && Array.isArray(value.read.path) && value.read.path.some(
|
|
1155
|
-
(part) => ["__proto__", "constructor", "prototype"].includes(textValue(part))
|
|
1156
|
-
))
|
|
1157
|
-
this.error("WW_EFFECT", "app.unsafe-read-path", node);
|
|
1158
|
-
for (const [key, child] of Object.entries(value))
|
|
1159
|
-
if (!["literal", "initial", "states", "options"].includes(key)) stack.push(child);
|
|
1160
|
-
}
|
|
1161
|
-
if (object(attrs.bind)) {
|
|
1162
|
-
const state = this.state(textValue(attrs.bind.state), expanded);
|
|
1163
|
-
if (state !== void 0 && (attrs.bind.property === "checked" && state.type !== "boolean" || attrs.bind.property === "value" && !["number", "string", "boolean"].includes(textValue(state.type))))
|
|
1164
|
-
this.error("WW_STATE", "app.binding-type", node);
|
|
1165
|
-
}
|
|
1166
|
-
if (object(attrs.data) && typeof attrs.data.state === "string") {
|
|
1167
|
-
const state = this.state(attrs.data.state, expanded);
|
|
1168
|
-
if (state !== void 0) {
|
|
1169
|
-
const rows = state.initial;
|
|
1170
|
-
const columns = Array.isArray(attrs.columns) ? attrs.columns : [];
|
|
1171
|
-
if (!Array.isArray(rows) || node.kind === "table" && rows.some(
|
|
1172
|
-
(row) => !object(row) || columns.some(
|
|
1173
|
-
(column) => typeof column !== "string" || !Object.hasOwn(row, column) || row[column] !== null && !["string", "number", "boolean"].includes(typeof row[column])
|
|
1174
|
-
)
|
|
1175
|
-
))
|
|
1176
|
-
this.error("WW_STATE", "app.bound-data-shape", node);
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
const handlerIds = /* @__PURE__ */ new Set(), events = /* @__PURE__ */ new Set(), operationIds = /* @__PURE__ */ new Set();
|
|
1180
|
-
for (const handler of asObjects(attrs.on)) {
|
|
1181
|
-
const event = `${textValue(handler.event)}/${textValue((_k = handler.key) != null ? _k : "")}`;
|
|
1182
|
-
if (handlerIds.has(textValue(handler.id)) || events.has(event))
|
|
1183
|
-
this.error("WW_DUPLICATE_ID", "app.duplicate-handler", node);
|
|
1184
|
-
handlerIds.add(textValue(handler.id));
|
|
1185
|
-
events.add(event);
|
|
1186
|
-
const lifecycleOwner = node.kind === "page" || owner.definition.kind === "layout" && node.id === owner.definition.id;
|
|
1187
|
-
if (["enter", "exit"].includes(textValue(handler.event)) && !lifecycleOwner || handler.event === "submit" && node.kind !== "form")
|
|
1188
|
-
this.error("WW_EVENT", "app.event-owner", node);
|
|
1189
|
-
const previous = /* @__PURE__ */ new Set();
|
|
1190
|
-
for (const operation of asObjects(handler.operations)) {
|
|
1191
|
-
const id = textValue(operation.id);
|
|
1192
|
-
if (operationIds.has(id)) this.error("WW_DUPLICATE_ID", "app.duplicate-operation", node);
|
|
1193
|
-
operationIds.add(id);
|
|
1194
|
-
for (const dependency of Array.isArray(operation.after) ? operation.after : [])
|
|
1195
|
-
if (!previous.has(textValue(dependency)))
|
|
1196
|
-
this.error("WW_EFFECT", "app.operation-dependency", node, { id });
|
|
1197
|
-
previous.add(id);
|
|
1198
|
-
const effect = object(operation.effect) ? operation.effect : {};
|
|
1199
|
-
if (object(effect.target) && ["open", "close", "toggleOverlay", "focus", "validate"].includes(textValue(effect.kind))) {
|
|
1200
|
-
const target = this.element(effect.target, expanded);
|
|
1201
|
-
if (target === void 0 || effect.kind === "validate" && target.node.kind !== "form" || ["open", "close", "toggleOverlay"].includes(textValue(effect.kind)) && !["modal", "drawer", "popover", "dropdown", "tooltip"].includes(target.node.kind))
|
|
1202
|
-
this.error("WW_REFERENCE", "app.invalid-effect-target", node);
|
|
1203
|
-
else {
|
|
1204
|
-
(_l = expanded.effectTargets) != null ? _l : expanded.effectTargets = {};
|
|
1205
|
-
expanded.effectTargets[`${textValue(effect.target.scope)}:${textValue(effect.target.id)}`] = target.renderedId;
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
if (handler.event === "exit" && (operation.executionClass !== "executable" || !["set", "reset", "toggle", "filter", "sort", "close"].includes(
|
|
1209
|
-
textValue(effect.kind)
|
|
1210
|
-
)))
|
|
1211
|
-
this.error("WW_EVENT", "app.exit-effect", node);
|
|
1212
|
-
if (effect.kind === "simulate") {
|
|
1213
|
-
const fixture = this.bundle.fixtures.find((fixture2) => fixture2.id === effect.fixtureRef);
|
|
1214
|
-
if (!fixtureIds.has(textValue(effect.fixtureRef)))
|
|
1215
|
-
this.error("WW_EFFECT", "app.missing-fixture", node);
|
|
1216
|
-
const result = expanded.stateBindings[textValue(effect.resultState)], status = expanded.stateBindings[textValue(effect.statusState)], error = expanded.stateBindings[textValue(effect.errorState)];
|
|
1217
|
-
if (!result || !status || !error || (/* @__PURE__ */ new Set([result.key, status.key, error.key])).size !== 3 || status.type !== "string" || status.initial !== "idle" || error.type !== "record" || jcs(error.initial) !== "{}")
|
|
1218
|
-
this.error("WW_EFFECT", "app.fixture-output-contract", node);
|
|
1219
|
-
else if (asObjects(fixture == null ? void 0 : fixture.steps).some(
|
|
1220
|
-
(step) => step.outcome === "success" && !matchesType(step.value, result.type)
|
|
1221
|
-
))
|
|
1222
|
-
this.error("WW_EFFECT", "app.fixture-result-type", node);
|
|
1223
|
-
}
|
|
1224
|
-
if (effect.kind === "navigate" && object(effect.target)) {
|
|
1225
|
-
if (effect.target.kind === "screen" && object(effect.target.screen))
|
|
1226
|
-
this.route(effect.target.screen, node);
|
|
1227
|
-
if (effect.target.kind === "url" && !safeUrl(textValue(effect.target.url)))
|
|
1228
|
-
this.error("WW_REFERENCE", "app.unsafe-url", node);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
const stateKeys = new Set(this.bundle.states.map((state) => `app:${textValue(state.id)}`));
|
|
1234
|
-
for (const entry of this.expanded)
|
|
1235
|
-
for (const state of Object.values(entry.stateBindings)) stateKeys.add(state.key);
|
|
1236
|
-
if (stateKeys.size > 4096) this.error("WW_LIMIT", "app.state-count");
|
|
1237
|
-
for (const screen of this.screens) {
|
|
1238
|
-
const active = this.expanded.filter(
|
|
1239
|
-
(entry) => entry.identity.instanceRoot.kind === "screen" ? entry.identity.instanceRoot.namespace === screen.route.namespace && entry.identity.instanceRoot.id === screen.route.id : entry.owner.key === screen.shell
|
|
1240
|
-
);
|
|
1241
|
-
if (active.filter((entry) => entry.node.kind === "main").length > 1)
|
|
1242
|
-
this.error("WW_ACCESSIBILITY", "app.multiple-main-landmarks", (_m = screen.children[0]) == null ? void 0 : _m.node);
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
element(ref, source) {
|
|
1246
|
-
const kind = ref.scope === "screen" ? "page" : ref.scope === "shell" ? "layout" : "component";
|
|
1247
|
-
const candidates = this.expanded.filter(
|
|
1248
|
-
(entry) => entry.node.id === ref.id && entry.owner.definition.kind === kind && (kind === "component" ? entry.owner === source.owner : true) && jcs(entry.identity.instanceRoot) === jcs(source.identity.instanceRoot) && entry.identity.instancePath.length <= source.identity.instancePath.length && entry.identity.instancePath.every(
|
|
1249
|
-
(step, index) => jcs(step) === jcs(source.identity.instancePath[index])
|
|
1250
|
-
)
|
|
1251
|
-
);
|
|
1252
|
-
candidates.sort((a, b) => b.identity.instancePath.length - a.identity.instancePath.length);
|
|
1253
|
-
return candidates[0];
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
function matchesType(value, type) {
|
|
1257
|
-
return type === "record" ? object(value) : type === "list" ? Array.isArray(value) : typeof value === type;
|
|
1258
|
-
}
|
|
1259
|
-
function componentPath(path) {
|
|
1260
|
-
for (let index = path.length - 1; index >= 0; index--)
|
|
1261
|
-
if (path[index].kind === "use") return path.slice(0, index + 1);
|
|
1262
|
-
return [];
|
|
1263
|
-
}
|
|
1264
|
-
function substitute(value, bindings, missing) {
|
|
1265
|
-
if (typeof value === "string") {
|
|
1266
|
-
if (value.startsWith("$$")) return value.slice(1);
|
|
1267
|
-
const match = /^\$([A-Za-z_][A-Za-z0-9_-]*)$/.exec(value);
|
|
1268
|
-
if (match === null) return value;
|
|
1269
|
-
if (!Object.hasOwn(bindings, match[1])) {
|
|
1270
|
-
missing(match[1]);
|
|
1271
|
-
return value;
|
|
1272
|
-
}
|
|
1273
|
-
return bindings[match[1]];
|
|
1274
|
-
}
|
|
1275
|
-
if (Array.isArray(value)) return value.map((item) => substitute(item, bindings, missing));
|
|
1276
|
-
if (object(value)) {
|
|
1277
|
-
if (typeof value.param === "string" && Object.keys(value).length === 1) {
|
|
1278
|
-
if (!Object.hasOwn(bindings, value.param)) {
|
|
1279
|
-
missing(value.param);
|
|
1280
|
-
return value;
|
|
1281
|
-
}
|
|
1282
|
-
return { literal: bindings[value.param] };
|
|
1283
|
-
}
|
|
1284
|
-
return Object.fromEntries(
|
|
1285
|
-
Object.entries(value).map(([key, item]) => [key, substitute(item, bindings, missing)])
|
|
1286
|
-
);
|
|
1287
|
-
}
|
|
1288
|
-
return value;
|
|
1289
|
-
}
|
|
1290
|
-
function attrsDsl(attrs) {
|
|
1291
|
-
return Object.entries(attrs).map(([key, value]) => `${key}=${dsl(value)}`).join(" ");
|
|
1292
|
-
}
|
|
1293
|
-
function safeUrl(value) {
|
|
1294
|
-
if ([...value].some((character) => character.charCodeAt(0) <= 32 || character.charCodeAt(0) === 127))
|
|
1295
|
-
return false;
|
|
1296
|
-
try {
|
|
1297
|
-
const url = new URL(value);
|
|
1298
|
-
return ["https:", "http:", "mailto:", "tel:"].includes(url.protocol) && !url.username && !url.password;
|
|
1299
|
-
} catch {
|
|
1300
|
-
return false;
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
function asObjects(value) {
|
|
1304
|
-
return Array.isArray(value) ? value.filter(object) : [];
|
|
1305
|
-
}
|
|
1306
|
-
function linkAppV4(bundle) {
|
|
1307
|
-
const data = typeof bundle === "object" && bundle !== null ? bundles.get(bundle) : void 0;
|
|
1308
|
-
if (data === void 0) return failed([diagnostic("WW_SCHEMA", "app.untrusted-bundle")]);
|
|
1309
|
-
const linker = new Linker(bundle, data);
|
|
1310
|
-
linker.index();
|
|
1311
|
-
linker.imports();
|
|
1312
|
-
linker.references();
|
|
1313
|
-
linker.registryChecks();
|
|
1314
|
-
if (linker.diagnostics.length > 0) return failed(linker.diagnostics);
|
|
1315
|
-
linker.expandAll();
|
|
1316
|
-
linker.semantics();
|
|
1317
|
-
if (linker.diagnostics.length > 0) return failed(linker.diagnostics);
|
|
1318
|
-
const sourceMap = linker.expanded.map((entry) => ({
|
|
1319
|
-
renderedId: entry.renderedId,
|
|
1320
|
-
identity: entry.identity,
|
|
1321
|
-
moduleId: entry.owner.module.id,
|
|
1322
|
-
source: entry.source,
|
|
1323
|
-
invocationSources: entry.invocationSources,
|
|
1324
|
-
requirementRefs: stringArray(entry.node.attributes.requirementRefs),
|
|
1325
|
-
obligationRefs: stringArray(entry.node.attributes.obligationRefs),
|
|
1326
|
-
operationIds: asObjects(entry.node.attributes.on).flatMap(
|
|
1327
|
-
(handler) => asObjects(handler.operations).map((operation) => textValue(operation.id))
|
|
1328
|
-
)
|
|
1329
|
-
}));
|
|
1330
|
-
const linked = freeze({
|
|
1331
|
-
[linkedBrand]: true,
|
|
1332
|
-
kind: "LinkedApp",
|
|
1333
|
-
languageVersion: "4.0.0",
|
|
1334
|
-
id: bundle.id,
|
|
1335
|
-
digest: chunkIMUVIIJR_cjs.digestV4(jcs(bundle)),
|
|
1336
|
-
sourceMap
|
|
1337
|
-
});
|
|
1338
|
-
links.set(linked, {
|
|
1339
|
-
bundle,
|
|
1340
|
-
screens: linker.screens,
|
|
1341
|
-
shells: linker.shells,
|
|
1342
|
-
nodes: linker.expanded,
|
|
1343
|
-
sourceMap
|
|
1344
|
-
});
|
|
1345
|
-
return { ok: true, value: linked, diagnostics: [] };
|
|
1346
|
-
}
|
|
1347
|
-
function stringArray(value) {
|
|
1348
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
1349
|
-
}
|
|
1350
|
-
function getLinkedAppData(linked) {
|
|
1351
|
-
return typeof linked === "object" && linked !== null ? links.get(linked) : void 0;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
45
|
// src/app/linker.ts
|
|
1355
46
|
function createAppNodeId(namespace, kind, id) {
|
|
1356
47
|
return `${encodeURIComponent(namespace)}:${kind}:${encodeURIComponent(id)}`;
|
|
@@ -1714,7 +405,7 @@ function expandNode(node, path, context) {
|
|
|
1714
405
|
return clone;
|
|
1715
406
|
}
|
|
1716
407
|
function linkApp(input, modules) {
|
|
1717
|
-
if (modules === void 0) return linkAppV4(input);
|
|
408
|
+
if (modules === void 0) return chunkNV6UV5ID_cjs.linkAppV4(input);
|
|
1718
409
|
return linkLegacyApp(input, modules);
|
|
1719
410
|
}
|
|
1720
411
|
function linkLegacyApp(manifest, modules) {
|
|
@@ -1926,7 +617,7 @@ function compileApp(document2, options = {}) {
|
|
|
1926
617
|
type: "Document",
|
|
1927
618
|
children: [...document2.layouts.map(projectLayout), ...document2.screens.map(projectScreen)]
|
|
1928
619
|
};
|
|
1929
|
-
return
|
|
620
|
+
return chunkNV6UV5ID_cjs.renderSite(projected, { ...options, annotationStyle: "neutral" });
|
|
1930
621
|
}
|
|
1931
622
|
function linkAndCompileApp(input, modules, options = {}) {
|
|
1932
623
|
if (modules === void 0) {
|
|
@@ -1938,13 +629,13 @@ function linkAndCompileApp(input, modules, options = {}) {
|
|
|
1938
629
|
return { ...linked, html: compileApp(linked.document, options) };
|
|
1939
630
|
}
|
|
1940
631
|
function escape(value) {
|
|
1941
|
-
return textValue(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
632
|
+
return chunkNV6UV5ID_cjs.textValue(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1942
633
|
}
|
|
1943
634
|
function attribute(name, value) {
|
|
1944
635
|
return value === void 0 || value === false ? "" : ` ${name}="${escape(value === true ? "" : value)}"`;
|
|
1945
636
|
}
|
|
1946
637
|
function jsonBlock(value) {
|
|
1947
|
-
return jcs(value).replace(/</g, "\\u003c");
|
|
638
|
+
return chunkNV6UV5ID_cjs.jcs(value).replace(/</g, "\\u003c");
|
|
1948
639
|
}
|
|
1949
640
|
function address(route) {
|
|
1950
641
|
return `#wf/${encodeURIComponent(route.namespace)}/${encodeURIComponent(route.id)}${route.variant === void 0 ? "" : `?variant=${encodeURIComponent(route.variant)}`}`;
|
|
@@ -1974,40 +665,40 @@ var HtmlArtifact = class {
|
|
|
1974
665
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1975
666
|
const { node, renderedId } = entry;
|
|
1976
667
|
const attrs = node.attributes;
|
|
1977
|
-
const label = (_b = node.label) != null ? _b : textValue((_a = attrs.label) != null ? _a : "");
|
|
668
|
+
const label = (_b = node.label) != null ? _b : chunkNV6UV5ID_cjs.textValue((_a = attrs.label) != null ? _a : "");
|
|
1978
669
|
const children = () => entry.children.map((child) => this.node(child)).join("");
|
|
1979
|
-
let common = attribute("id", renderedId) + attribute("class", `wf-node wf-${node.kind} ${renderedId}`) + attribute("data-wf-kind", node.kind) + attribute("data-wf-source", entry.owner.module.id) + attribute("data-wf-identity", jcs(entry.identity)) + attribute(
|
|
670
|
+
let common = attribute("id", renderedId) + attribute("class", `wf-node wf-${node.kind} ${renderedId}`) + attribute("data-wf-kind", node.kind) + attribute("data-wf-source", entry.owner.module.id) + attribute("data-wf-identity", chunkNV6UV5ID_cjs.jcs(entry.identity)) + attribute(
|
|
1980
671
|
"data-wf-requirements",
|
|
1981
|
-
attrs.requirementRefs === void 0 ? void 0 : jcs(attrs.requirementRefs)
|
|
672
|
+
attrs.requirementRefs === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.requirementRefs)
|
|
1982
673
|
) + attribute(
|
|
1983
674
|
"data-wf-obligations",
|
|
1984
|
-
attrs.obligationRefs === void 0 ? void 0 : jcs(attrs.obligationRefs)
|
|
1985
|
-
) + attribute("data-wf-on", attrs.on === void 0 ? void 0 : jcs(attrs.on)) + attribute("data-wf-bind", attrs.bind === void 0 ? void 0 : jcs(attrs.bind)) + attribute("data-wf-data", attrs.data === void 0 ? void 0 : jcs(attrs.data)) + attribute("data-wf-columns", attrs.columns === void 0 ? void 0 : jcs(attrs.columns)) + attribute(
|
|
675
|
+
attrs.obligationRefs === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.obligationRefs)
|
|
676
|
+
) + attribute("data-wf-on", attrs.on === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.on)) + attribute("data-wf-bind", attrs.bind === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.bind)) + attribute("data-wf-data", attrs.data === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.data)) + attribute("data-wf-columns", attrs.columns === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.columns)) + attribute(
|
|
1986
677
|
"data-wf-targets",
|
|
1987
|
-
entry.effectTargets === void 0 ? void 0 : jcs(entry.effectTargets)
|
|
678
|
+
entry.effectTargets === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(entry.effectTargets)
|
|
1988
679
|
) + attribute(
|
|
1989
680
|
"data-wf-visible-when",
|
|
1990
|
-
attrs.visibleWhen === void 0 ? void 0 : jcs(attrs.visibleWhen)
|
|
681
|
+
attrs.visibleWhen === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.visibleWhen)
|
|
1991
682
|
) + attribute(
|
|
1992
683
|
"data-wf-enabled-when",
|
|
1993
|
-
attrs.enabledWhen === void 0 ? void 0 : jcs(attrs.enabledWhen)
|
|
1994
|
-
) + attribute("data-wf-when", attrs.when === void 0 ? void 0 : jcs(attrs.when)) + attribute("data-wf-state-bindings", jcs(entry.stateBindings)) + attribute("data-wf-navigate", entry.route === void 0 ? void 0 : address(entry.route)) + attribute("aria-label", (_c = attrs["aria-label"]) != null ? _c : attrs.aria) + attribute("aria-busy", attrs.loading === true ? "true" : void 0) + attribute(
|
|
684
|
+
attrs.enabledWhen === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.enabledWhen)
|
|
685
|
+
) + attribute("data-wf-when", attrs.when === void 0 ? void 0 : chunkNV6UV5ID_cjs.jcs(attrs.when)) + attribute("data-wf-state-bindings", chunkNV6UV5ID_cjs.jcs(entry.stateBindings)) + attribute("data-wf-navigate", entry.route === void 0 ? void 0 : address(entry.route)) + attribute("aria-label", (_c = attrs["aria-label"]) != null ? _c : attrs.aria) + attribute("aria-busy", attrs.loading === true ? "true" : void 0) + attribute(
|
|
1995
686
|
"data-wf-disabled",
|
|
1996
687
|
attrs.disabled === true || attrs.loading === true ? true : void 0
|
|
1997
688
|
) + attribute("data-wf-action", attrs.action);
|
|
1998
|
-
for (const handler of asObjects(attrs.on))
|
|
1999
|
-
for (const operation of asObjects(handler.operations)) {
|
|
689
|
+
for (const handler of chunkNV6UV5ID_cjs.asObjects(attrs.on))
|
|
690
|
+
for (const operation of chunkNV6UV5ID_cjs.asObjects(handler.operations)) {
|
|
2000
691
|
if (operation.executionClass === "specified") {
|
|
2001
692
|
this.unsupported.push({
|
|
2002
693
|
renderedId,
|
|
2003
|
-
handlerId: textValue(handler.id),
|
|
2004
|
-
operationId: textValue(operation.id)
|
|
694
|
+
handlerId: chunkNV6UV5ID_cjs.textValue(handler.id),
|
|
695
|
+
operationId: chunkNV6UV5ID_cjs.textValue(operation.id)
|
|
2005
696
|
});
|
|
2006
697
|
}
|
|
2007
698
|
}
|
|
2008
699
|
if (entry.slot) return `<div${common} data-wf-slot="${escape(entry.owner.key)}"></div>`;
|
|
2009
700
|
this.layout(entry);
|
|
2010
|
-
const bound = object(attrs.bind) ? entry.stateBindings[textValue(attrs.bind.state)] : void 0;
|
|
701
|
+
const bound = chunkNV6UV5ID_cjs.object(attrs.bind) ? entry.stateBindings[chunkNV6UV5ID_cjs.textValue(attrs.bind.state)] : void 0;
|
|
2011
702
|
const value = (_d = bound == null ? void 0 : bound.initial) != null ? _d : attrs.value;
|
|
2012
703
|
const disabled = attrs.disabled === true || attrs.loading === true;
|
|
2013
704
|
const labelled = (control) => `<div class="wf-field" data-wf-field="${renderedId}">${label ? `<label for="${renderedId}">${escape(label)}</label>` : ""}${control}<span id="${renderedId}-error" role="alert" hidden></span></div>`;
|
|
@@ -2024,7 +715,7 @@ var HtmlArtifact = class {
|
|
|
2024
715
|
);
|
|
2025
716
|
if (node.kind === "select")
|
|
2026
717
|
return labelled(
|
|
2027
|
-
`<select${common}${scalarAttrs}>${asObjects(attrs.options).map(
|
|
718
|
+
`<select${common}${scalarAttrs}>${chunkNV6UV5ID_cjs.asObjects(attrs.options).map(
|
|
2028
719
|
(option) => `<option${attribute("value", option.value)}${attribute("selected", value === option.value)}${attribute("disabled", option.disabled)}>${escape(option.label)}</option>`
|
|
2029
720
|
).join("")}</select>`
|
|
2030
721
|
);
|
|
@@ -2064,11 +755,11 @@ var HtmlArtifact = class {
|
|
|
2064
755
|
if (node.kind === "table") {
|
|
2065
756
|
const columns = Array.isArray(attrs.columns) ? attrs.columns : [];
|
|
2066
757
|
let rows = (_k = node.items) != null ? _k : [];
|
|
2067
|
-
if (object(attrs.data)) {
|
|
2068
|
-
const initial = (_l = entry.stateBindings[textValue(attrs.data.state)]) == null ? void 0 : _l.initial;
|
|
758
|
+
if (chunkNV6UV5ID_cjs.object(attrs.data)) {
|
|
759
|
+
const initial = (_l = entry.stateBindings[chunkNV6UV5ID_cjs.textValue(attrs.data.state)]) == null ? void 0 : _l.initial;
|
|
2069
760
|
if (Array.isArray(initial))
|
|
2070
761
|
rows = initial.map(
|
|
2071
|
-
(record) => columns.map((column) => object(record) ? record[textValue(column)] : null)
|
|
762
|
+
(record) => columns.map((column) => chunkNV6UV5ID_cjs.object(record) ? record[chunkNV6UV5ID_cjs.textValue(column)] : null)
|
|
2072
763
|
);
|
|
2073
764
|
}
|
|
2074
765
|
return `<table${common}><thead><tr>${columns.map((column) => `<th scope="col">${escape(column)}</th>`).join("")}</tr></thead><tbody>${rows.map((row) => `<tr>${(Array.isArray(row) ? row : []).map((cell) => `<td>${escape(cell != null ? cell : "")}</td>`).join("")}</tr>`).join("")}</tbody></table>`;
|
|
@@ -2106,9 +797,9 @@ var HtmlArtifact = class {
|
|
|
2106
797
|
const length = (value, axis, spacing = false) => {
|
|
2107
798
|
if (typeof value === "number")
|
|
2108
799
|
return `${spacing && [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20].includes(value) ? value * 4 : value}px`;
|
|
2109
|
-
if (object(value)) {
|
|
800
|
+
if (chunkNV6UV5ID_cjs.object(value)) {
|
|
2110
801
|
const amount = Number(value.value);
|
|
2111
|
-
return value.unit === "vh" ? `${amount * Number(profile.height) / 100}px` : value.unit === "vw" ? `${amount * Number(profile.width) / 100}px` : value.unit === "rem" ? `${amount * 16}px` : `${amount}${textValue(value.unit)}`;
|
|
802
|
+
return value.unit === "vh" ? `${amount * Number(profile.height) / 100}px` : value.unit === "vw" ? `${amount * Number(profile.width) / 100}px` : value.unit === "rem" ? `${amount * 16}px` : `${amount}${chunkNV6UV5ID_cjs.textValue(value.unit)}`;
|
|
2112
803
|
}
|
|
2113
804
|
return value === "full" ? "100%" : value === "screen" ? `${Number(profile[axis])}px` : value === "fit" ? "fit-content" : "auto";
|
|
2114
805
|
};
|
|
@@ -2145,10 +836,10 @@ var HtmlArtifact = class {
|
|
|
2145
836
|
if (["row", "col", "stack"].includes(kind)) {
|
|
2146
837
|
styles.push(
|
|
2147
838
|
"display:flex",
|
|
2148
|
-
`flex-direction:${textValue((_a = a.direction) != null ? _a : kind === "row" ? "row" : "column")}`,
|
|
839
|
+
`flex-direction:${chunkNV6UV5ID_cjs.textValue((_a = a.direction) != null ? _a : kind === "row" ? "row" : "column")}`,
|
|
2149
840
|
`flex-wrap:${a.wrap === true ? "wrap" : "nowrap"}`,
|
|
2150
|
-
`justify-content:${(_c = { start: "flex-start", end: "flex-end", between: "space-between", around: "space-around", evenly: "space-evenly" }[textValue(a.justify)]) != null ? _c : textValue((_b = a.justify) != null ? _b : "flex-start")}`,
|
|
2151
|
-
`align-items:${(_e = { start: "flex-start", end: "flex-end" }[textValue(a.align)]) != null ? _e : textValue((_d = a.align) != null ? _d : "stretch")}`
|
|
841
|
+
`justify-content:${(_c = { start: "flex-start", end: "flex-end", between: "space-between", around: "space-around", evenly: "space-evenly" }[chunkNV6UV5ID_cjs.textValue(a.justify)]) != null ? _c : chunkNV6UV5ID_cjs.textValue((_b = a.justify) != null ? _b : "flex-start")}`,
|
|
842
|
+
`align-items:${(_e = { start: "flex-start", end: "flex-end" }[chunkNV6UV5ID_cjs.textValue(a.align)]) != null ? _e : chunkNV6UV5ID_cjs.textValue((_d = a.align) != null ? _d : "stretch")}`
|
|
2152
843
|
);
|
|
2153
844
|
}
|
|
2154
845
|
if (a.flex !== void 0)
|
|
@@ -2166,7 +857,7 @@ var HtmlArtifact = class {
|
|
|
2166
857
|
if (a.order !== void 0) styles.push(`order:${Number(a.order)}`);
|
|
2167
858
|
if (a.scroll === true) styles.push("overflow:auto");
|
|
2168
859
|
if (kind !== "page" && (a.x !== void 0 || a.y !== void 0 || a.anchor !== void 0)) {
|
|
2169
|
-
const anchor = textValue((_i = a.anchor) != null ? _i : "top-left"), vertical = anchor === "center" ? "center" : anchor.split("-")[0], horizontal = anchor === "center" ? "center" : anchor.split("-")[1];
|
|
860
|
+
const anchor = chunkNV6UV5ID_cjs.textValue((_i = a.anchor) != null ? _i : "top-left"), vertical = anchor === "center" ? "center" : anchor.split("-")[0], horizontal = anchor === "center" ? "center" : anchor.split("-")[1];
|
|
2170
861
|
styles.push(
|
|
2171
862
|
"position:absolute",
|
|
2172
863
|
`left:calc(${horizontal === "center" ? "50%" : horizontal === "right" ? "100%" : "0%"} + ${Number((_j = a.x) != null ? _j : 0)}px)`,
|
|
@@ -2184,11 +875,11 @@ var HtmlArtifact = class {
|
|
|
2184
875
|
styles.push("background:#f4f4f5");
|
|
2185
876
|
if (a.shadow !== void 0 && a.shadow !== "none")
|
|
2186
877
|
styles.push(
|
|
2187
|
-
`box-shadow:0 ${{ sm: 1, md: 2, lg: 4, xl: 8 }[textValue(a.shadow)]}px ${{ sm: 1, md: 2, lg: 4, xl: 8 }[textValue(a.shadow)]}px #71717a`
|
|
878
|
+
`box-shadow:0 ${{ sm: 1, md: 2, lg: 4, xl: 8 }[chunkNV6UV5ID_cjs.textValue(a.shadow)]}px ${{ sm: 1, md: 2, lg: 4, xl: 8 }[chunkNV6UV5ID_cjs.textValue(a.shadow)]}px #71717a`
|
|
2188
879
|
);
|
|
2189
880
|
if (a.bold === true || a.weight !== void 0)
|
|
2190
881
|
styles.push(
|
|
2191
|
-
`font-weight:${a.bold === true ? 700 : { normal: 400, medium: 500, semibold: 600, bold: 700 }[textValue(a.weight)]}`
|
|
882
|
+
`font-weight:${a.bold === true ? 700 : { normal: 400, medium: 500, semibold: 600, bold: 700 }[chunkNV6UV5ID_cjs.textValue(a.weight)]}`
|
|
2192
883
|
);
|
|
2193
884
|
if (typeof a.size === "string") {
|
|
2194
885
|
const font = { xs: 12, sm: 14, base: 16, md: 16, lg: 18, xl: 20, "2xl": 24, "3xl": 30 }[a.size];
|
|
@@ -2201,7 +892,7 @@ var HtmlArtifact = class {
|
|
|
2201
892
|
);
|
|
2202
893
|
} else if (typeof a.size === "number") styles.push(`width:${a.size}px`, `height:${a.size}px`);
|
|
2203
894
|
if (["text", "title", "link"].includes(kind) && a.align !== void 0)
|
|
2204
|
-
styles.push(`text-align:${textValue(a.align)}`);
|
|
895
|
+
styles.push(`text-align:${chunkNV6UV5ID_cjs.textValue(a.align)}`);
|
|
2205
896
|
if (styles.length) this.rules.push(`#wireweave-app .${entry.renderedId}{${styles.join(";")}}`);
|
|
2206
897
|
}
|
|
2207
898
|
html() {
|
|
@@ -2218,7 +909,7 @@ var HtmlArtifact = class {
|
|
|
2218
909
|
return `<section data-wf-requirement="${escape(entry.id)}"><h3>${escape(entry.title)}</h3><p>${escape((_b = (_a = entry.behavior) != null ? _a : entry.trigger) != null ? _b : "")}</p></section>`;
|
|
2219
910
|
}
|
|
2220
911
|
).join("");
|
|
2221
|
-
const css = `#wireweave-app{font:16px/1.5 system-ui,sans-serif;color:#18181b;background:white}#wireweave-app [hidden]{display:none!important}#wireweave-app *{box-sizing:border-box}#wireweave-app :focus-visible{outline:2px solid #18181b;outline-offset:2px}#wireweave-app button,#wireweave-app input,#wireweave-app select{min-height:24px;font:inherit}#wireweave-app .wf-row{display:flex;gap:0}#wireweave-app .wf-col{flex:1}#wireweave-app .wf-stack,#wireweave-app .wf-field{display:flex;flex-direction:column;gap:8px}#wireweave-app .wf-page,#wireweave-app [data-wf-shell]{width:${textValue(bundle.profile.width)}px;height:${textValue(bundle.profile.height)}px;overflow:auto}#wireweave-app .wf-card,#wireweave-app th,#wireweave-app td{border:1px solid #71717a;padding:8px}#wireweave-app .wf-relative{position:relative}#wireweave-app [data-wf-slot]{display:contents}${this.rules.join("")}#wireweave-app[data-wf-view=accessible] .wf-node,#wireweave-app[data-wf-view=accessible] [data-wf-shell]{position:static!important;transform:none!important;width:auto!important;height:auto!important;min-width:0!important;max-width:100%!important;min-height:0!important;overflow-wrap:anywhere;order:0!important}#wireweave-app[data-wf-view=accessible] .wf-row{flex-direction:column!important;flex-wrap:wrap!important}#wireweave-app[data-wf-view=accessible] .wf-col{flex-basis:auto!important}#wireweave-app .wf-field{min-width:0}#wireweave-app .wf-field input,#wireweave-app .wf-field textarea,#wireweave-app .wf-field select{max-width:100%}#wireweave-app [data-wf-field][hidden]{display:none!important}#wireweave-app [role=tablist]{display:flex;flex-wrap:wrap}#wireweave-app [role=tooltip]{background:#f4f4f5;border:1px solid #71717a}#wireweave-app dialog{color:#18181b;background:white;max-width:100%;max-height:100%;overflow:auto}`;
|
|
912
|
+
const css = `#wireweave-app{font:16px/1.5 system-ui,sans-serif;color:#18181b;background:white}#wireweave-app [hidden]{display:none!important}#wireweave-app *{box-sizing:border-box}#wireweave-app :focus-visible{outline:2px solid #18181b;outline-offset:2px}#wireweave-app button,#wireweave-app input,#wireweave-app select{min-height:24px;font:inherit}#wireweave-app .wf-row{display:flex;gap:0}#wireweave-app .wf-col{flex:1}#wireweave-app .wf-stack,#wireweave-app .wf-field{display:flex;flex-direction:column;gap:8px}#wireweave-app .wf-page,#wireweave-app [data-wf-shell]{width:${chunkNV6UV5ID_cjs.textValue(bundle.profile.width)}px;height:${chunkNV6UV5ID_cjs.textValue(bundle.profile.height)}px;overflow:auto}#wireweave-app .wf-card,#wireweave-app th,#wireweave-app td{border:1px solid #71717a;padding:8px}#wireweave-app .wf-relative{position:relative}#wireweave-app [data-wf-slot]{display:contents}${this.rules.join("")}#wireweave-app[data-wf-view=accessible] .wf-node,#wireweave-app[data-wf-view=accessible] [data-wf-shell]{position:static!important;transform:none!important;width:auto!important;height:auto!important;min-width:0!important;max-width:100%!important;min-height:0!important;overflow-wrap:anywhere;order:0!important}#wireweave-app[data-wf-view=accessible] .wf-row{flex-direction:column!important;flex-wrap:wrap!important}#wireweave-app[data-wf-view=accessible] .wf-col{flex-basis:auto!important}#wireweave-app .wf-field{min-width:0}#wireweave-app .wf-field input,#wireweave-app .wf-field textarea,#wireweave-app .wf-field select{max-width:100%}#wireweave-app [data-wf-field][hidden]{display:none!important}#wireweave-app [role=tablist]{display:flex;flex-wrap:wrap}#wireweave-app [role=tooltip]{background:#f4f4f5;border:1px solid #71717a}#wireweave-app dialog{color:#18181b;background:white;max-width:100%;max-height:100%;overflow:auto}`;
|
|
2222
913
|
const runtimeData = this.program;
|
|
2223
914
|
const csp = `default-src 'none'; script-src 'sha256-${hashBase64(NATIVE_RUNTIME)}'; style-src 'sha256-${hashBase64(css)}'; img-src data:; font-src data:; connect-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-src 'none'`;
|
|
2224
915
|
return `<!DOCTYPE html>
|
|
@@ -3761,15 +2452,15 @@ var snapshotPrograms = /* @__PURE__ */ new WeakMap();
|
|
|
3761
2452
|
function runtimeProgram(linked) {
|
|
3762
2453
|
const cached = programCache.get(linked);
|
|
3763
2454
|
if (cached) return cached;
|
|
3764
|
-
const data = getLinkedAppData(linked);
|
|
2455
|
+
const data = chunkNV6UV5ID_cjs.getLinkedAppData(linked);
|
|
3765
2456
|
if (!data) throw new TypeError("Untrusted LinkedApp");
|
|
3766
2457
|
const states = {};
|
|
3767
2458
|
for (const state of data.bundle.states) {
|
|
3768
|
-
const key = `app:${textValue(state.id)}`;
|
|
2459
|
+
const key = `app:${chunkNV6UV5ID_cjs.textValue(state.id)}`;
|
|
3769
2460
|
states[key] = {
|
|
3770
2461
|
key,
|
|
3771
2462
|
initial: state.initial,
|
|
3772
|
-
type: textValue(state.type),
|
|
2463
|
+
type: chunkNV6UV5ID_cjs.textValue(state.type),
|
|
3773
2464
|
lifetime: "session",
|
|
3774
2465
|
sensitive: state.sensitive === true,
|
|
3775
2466
|
root: "app"
|
|
@@ -3781,14 +2472,14 @@ function runtimeProgram(linked) {
|
|
|
3781
2472
|
let form = entry.parent;
|
|
3782
2473
|
while (form && form.node.kind !== "form") form = form.parent;
|
|
3783
2474
|
const root = entry.identity.instanceRoot;
|
|
3784
|
-
const handlers = asObjects(entry.node.attributes.on).map((handler) => ({
|
|
3785
|
-
id: textValue(handler.id),
|
|
3786
|
-
event: textValue(handler.event),
|
|
3787
|
-
...handler.key === void 0 ? {} : { key: textValue(handler.key) },
|
|
2475
|
+
const handlers = chunkNV6UV5ID_cjs.asObjects(entry.node.attributes.on).map((handler) => ({
|
|
2476
|
+
id: chunkNV6UV5ID_cjs.textValue(handler.id),
|
|
2477
|
+
event: chunkNV6UV5ID_cjs.textValue(handler.event),
|
|
2478
|
+
...handler.key === void 0 ? {} : { key: chunkNV6UV5ID_cjs.textValue(handler.key) },
|
|
3788
2479
|
...handler.guard === void 0 ? {} : { guard: handler.guard },
|
|
3789
2480
|
concurrency: handler.concurrency === "queue" ? "queue" : "drop",
|
|
3790
|
-
operations: asObjects(handler.operations).map((operation) => ({
|
|
3791
|
-
id: textValue(operation.id),
|
|
2481
|
+
operations: chunkNV6UV5ID_cjs.asObjects(handler.operations).map((operation) => ({
|
|
2482
|
+
id: chunkNV6UV5ID_cjs.textValue(operation.id),
|
|
3792
2483
|
executionClass: operation.executionClass,
|
|
3793
2484
|
effect: operation.effect,
|
|
3794
2485
|
after: operation.after,
|
|
@@ -3823,10 +2514,10 @@ function runtimeProgram(linked) {
|
|
|
3823
2514
|
form: (_e = (_d = entry.formTarget) != null ? _d : form == null ? void 0 : form.renderedId) != null ? _e : null
|
|
3824
2515
|
};
|
|
3825
2516
|
});
|
|
3826
|
-
const program = freeze({
|
|
2517
|
+
const program = chunkNV6UV5ID_cjs.freeze({
|
|
3827
2518
|
appId: data.bundle.id,
|
|
3828
2519
|
modelDigest: linked.digest,
|
|
3829
|
-
profileDigest: chunkIMUVIIJR_cjs.digestV4(jcs(data.bundle.profile)),
|
|
2520
|
+
profileDigest: chunkIMUVIIJR_cjs.digestV4(chunkNV6UV5ID_cjs.jcs(data.bundle.profile)),
|
|
3830
2521
|
profile: data.bundle.profile,
|
|
3831
2522
|
entry: data.bundle.entry,
|
|
3832
2523
|
nodes: runtimeNodes,
|
|
@@ -3846,11 +2537,11 @@ function runtimeProgram(linked) {
|
|
|
3846
2537
|
slot: shell.slotId
|
|
3847
2538
|
})),
|
|
3848
2539
|
fixtures: data.bundle.fixtures.map((fixture) => ({
|
|
3849
|
-
id: textValue(fixture.id),
|
|
3850
|
-
exhaustion: textValue(fixture.exhaustion),
|
|
3851
|
-
steps: asObjects(fixture.steps).map((step) => ({
|
|
2540
|
+
id: chunkNV6UV5ID_cjs.textValue(fixture.id),
|
|
2541
|
+
exhaustion: chunkNV6UV5ID_cjs.textValue(fixture.exhaustion),
|
|
2542
|
+
steps: chunkNV6UV5ID_cjs.asObjects(fixture.steps).map((step) => ({
|
|
3852
2543
|
delayMs: Number(step.delayMs),
|
|
3853
|
-
outcome: textValue(step.outcome),
|
|
2544
|
+
outcome: chunkNV6UV5ID_cjs.textValue(step.outcome),
|
|
3854
2545
|
value: step.value
|
|
3855
2546
|
}))
|
|
3856
2547
|
})),
|
|
@@ -3860,7 +2551,7 @@ function runtimeProgram(linked) {
|
|
|
3860
2551
|
return program;
|
|
3861
2552
|
}
|
|
3862
2553
|
function ownSnapshot(snapshot, program) {
|
|
3863
|
-
freeze(snapshot);
|
|
2554
|
+
chunkNV6UV5ID_cjs.freeze(snapshot);
|
|
3864
2555
|
snapshotPrograms.set(snapshot, program);
|
|
3865
2556
|
return snapshot;
|
|
3866
2557
|
}
|
|
@@ -4287,15 +2978,15 @@ function browserAdapter(engine, program) {
|
|
|
4287
2978
|
}
|
|
4288
2979
|
var NATIVE_RUNTIME = `(()=>{const program=JSON.parse(document.getElementById("wf-runtime-data").textContent);(${browserAdapter.toString()})((${runtimeEngine.toString()})(program),program);})();`;
|
|
4289
2980
|
function compileAppV4(linked) {
|
|
4290
|
-
const data = getLinkedAppData(linked);
|
|
2981
|
+
const data = chunkNV6UV5ID_cjs.getLinkedAppData(linked);
|
|
4291
2982
|
if (data === void 0)
|
|
4292
|
-
return failed([diagnostic("WW_SCHEMA", "app.untrusted-linked-model", void 0, {}, "compile")]);
|
|
2983
|
+
return chunkNV6UV5ID_cjs.failed([chunkNV6UV5ID_cjs.diagnostic("WW_SCHEMA", "app.untrusted-linked-model", void 0, {}, "compile")]);
|
|
4293
2984
|
if (data.artifact !== void 0) return { ok: true, value: data.artifact, diagnostics: [] };
|
|
4294
2985
|
const renderer = new HtmlArtifact(data, runtimeProgram(linked));
|
|
4295
2986
|
const html = renderer.html();
|
|
4296
2987
|
if (new TextEncoder().encode(html).byteLength > 64 * 1024 * 1024)
|
|
4297
|
-
return failed([diagnostic("WW_LIMIT", "app.html-byte-limit", void 0, {}, "compile")]);
|
|
4298
|
-
const artifact = freeze({
|
|
2988
|
+
return chunkNV6UV5ID_cjs.failed([chunkNV6UV5ID_cjs.diagnostic("WW_LIMIT", "app.html-byte-limit", void 0, {}, "compile")]);
|
|
2989
|
+
const artifact = chunkNV6UV5ID_cjs.freeze({
|
|
4299
2990
|
kind: "AppArtifact",
|
|
4300
2991
|
schemaVersion: "1.0.0",
|
|
4301
2992
|
languageVersion: "4.0.0",
|
|
@@ -4305,7 +2996,7 @@ function compileAppV4(linked) {
|
|
|
4305
2996
|
byteLength: new TextEncoder().encode(html).byteLength,
|
|
4306
2997
|
digest: chunkIMUVIIJR_cjs.digestV4(html),
|
|
4307
2998
|
modelDigest: linked.digest,
|
|
4308
|
-
profileDigest: chunkIMUVIIJR_cjs.digestV4(jcs(data.bundle.profile)),
|
|
2999
|
+
profileDigest: chunkIMUVIIJR_cjs.digestV4(chunkNV6UV5ID_cjs.jcs(data.bundle.profile)),
|
|
4309
3000
|
runtimeDigest: chunkIMUVIIJR_cjs.digestV4(NATIVE_RUNTIME),
|
|
4310
3001
|
registryDigest: data.bundle.registry.digest,
|
|
4311
3002
|
entry: data.bundle.entry,
|
|
@@ -4314,12 +3005,12 @@ function compileAppV4(linked) {
|
|
|
4314
3005
|
renderedId: screen.children[0].renderedId
|
|
4315
3006
|
})),
|
|
4316
3007
|
operationIndex: data.nodes.flatMap(
|
|
4317
|
-
(node) => asObjects(node.node.attributes.on).flatMap(
|
|
4318
|
-
(handler) => asObjects(handler.operations).map((operation) => ({
|
|
3008
|
+
(node) => chunkNV6UV5ID_cjs.asObjects(node.node.attributes.on).flatMap(
|
|
3009
|
+
(handler) => chunkNV6UV5ID_cjs.asObjects(handler.operations).map((operation) => ({
|
|
4319
3010
|
renderedId: node.renderedId,
|
|
4320
|
-
handlerId: textValue(handler.id),
|
|
4321
|
-
operationId: textValue(operation.id),
|
|
4322
|
-
executionClass: textValue(operation.executionClass),
|
|
3011
|
+
handlerId: chunkNV6UV5ID_cjs.textValue(handler.id),
|
|
3012
|
+
operationId: chunkNV6UV5ID_cjs.textValue(operation.id),
|
|
3013
|
+
executionClass: chunkNV6UV5ID_cjs.textValue(operation.executionClass),
|
|
4323
3014
|
operation
|
|
4324
3015
|
}))
|
|
4325
3016
|
)
|
|
@@ -4328,7 +3019,7 @@ function compileAppV4(linked) {
|
|
|
4328
3019
|
manifest: {
|
|
4329
3020
|
appId: data.bundle.id,
|
|
4330
3021
|
modelDigest: linked.digest,
|
|
4331
|
-
profileDigest: chunkIMUVIIJR_cjs.digestV4(jcs(data.bundle.profile)),
|
|
3022
|
+
profileDigest: chunkIMUVIIJR_cjs.digestV4(chunkNV6UV5ID_cjs.jcs(data.bundle.profile)),
|
|
4332
3023
|
registryDigest: data.bundle.registry.digest,
|
|
4333
3024
|
htmlDigest: chunkIMUVIIJR_cjs.digestV4(html),
|
|
4334
3025
|
runtimeDigest: chunkIMUVIIJR_cjs.digestV4(NATIVE_RUNTIME),
|
|
@@ -4347,7 +3038,6 @@ function renderSite2(bundle) {
|
|
|
4347
3038
|
exports.advanceClock = advanceClock;
|
|
4348
3039
|
exports.collectParameterReferences = collectParameterReferences;
|
|
4349
3040
|
exports.compileApp = compileApp;
|
|
4350
|
-
exports.createAppBundle = createAppBundle;
|
|
4351
3041
|
exports.createAppComponentInstanceId = createAppComponentInstanceId;
|
|
4352
3042
|
exports.createAppNodeId = createAppNodeId;
|
|
4353
3043
|
exports.createRuntime = createRuntime;
|