@vtex-email/core 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expression/path.d.ts.map +1 -1
- package/dist/index.js +359 -59
- package/dist/markers/bind.d.ts.map +1 -1
- package/dist/markers/html-anchors.d.ts +31 -4
- package/dist/markers/html-anchors.d.ts.map +1 -1
- package/dist/markers/sites.d.ts +3 -3
- package/dist/markers/sites.d.ts.map +1 -1
- package/dist/profile.d.ts +12 -1
- package/dist/profile.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/expression/path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/expression/path.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3G,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO9D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CA0CzE;AAkCD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAe5D"}
|
package/dist/index.js
CHANGED
|
@@ -138,7 +138,7 @@ function siteNode(site) {
|
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
140
|
function mapArgs(site) {
|
|
141
|
-
return
|
|
141
|
+
return [...site.args ?? [], ...Object.values(site.hash ?? {})].map((arg) => ({
|
|
142
142
|
kind: arg.kind,
|
|
143
143
|
emitted: arg.emitted,
|
|
144
144
|
parentHops: arg.path?.parentHops ?? 0
|
|
@@ -146,15 +146,130 @@ function mapArgs(site) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// src/markers/html-anchors.ts
|
|
149
|
-
import {
|
|
149
|
+
import { Tokenizer, TokenizerMode } from "parse5";
|
|
150
|
+
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
151
|
+
"area",
|
|
152
|
+
"base",
|
|
153
|
+
"br",
|
|
154
|
+
"col",
|
|
155
|
+
"embed",
|
|
156
|
+
"hr",
|
|
157
|
+
"img",
|
|
158
|
+
"input",
|
|
159
|
+
"link",
|
|
160
|
+
"meta",
|
|
161
|
+
"param",
|
|
162
|
+
"source",
|
|
163
|
+
"track",
|
|
164
|
+
"wbr"
|
|
165
|
+
]);
|
|
166
|
+
var CLOSES_P = /* @__PURE__ */ new Set([
|
|
167
|
+
"address",
|
|
168
|
+
"article",
|
|
169
|
+
"aside",
|
|
170
|
+
"blockquote",
|
|
171
|
+
"center",
|
|
172
|
+
"details",
|
|
173
|
+
"dialog",
|
|
174
|
+
"dir",
|
|
175
|
+
"div",
|
|
176
|
+
"dl",
|
|
177
|
+
"fieldset",
|
|
178
|
+
"figcaption",
|
|
179
|
+
"figure",
|
|
180
|
+
"footer",
|
|
181
|
+
"form",
|
|
182
|
+
"h1",
|
|
183
|
+
"h2",
|
|
184
|
+
"h3",
|
|
185
|
+
"h4",
|
|
186
|
+
"h5",
|
|
187
|
+
"h6",
|
|
188
|
+
"header",
|
|
189
|
+
"hgroup",
|
|
190
|
+
"hr",
|
|
191
|
+
"listing",
|
|
192
|
+
"main",
|
|
193
|
+
"menu",
|
|
194
|
+
"nav",
|
|
195
|
+
"ol",
|
|
196
|
+
"p",
|
|
197
|
+
"pre",
|
|
198
|
+
"search",
|
|
199
|
+
"section",
|
|
200
|
+
"summary",
|
|
201
|
+
"table",
|
|
202
|
+
"ul",
|
|
203
|
+
"xmp"
|
|
204
|
+
]);
|
|
205
|
+
var P_SCOPE_BOUNDARY = /* @__PURE__ */ new Set(["applet", "button", "caption", "html", "marquee", "object", "table", "td", "th"]);
|
|
206
|
+
var RAWTEXT_ELEMENTS = /* @__PURE__ */ new Set(["style", "xmp", "iframe", "noembed", "noframes"]);
|
|
207
|
+
var RCDATA_ELEMENTS = /* @__PURE__ */ new Set(["title", "textarea"]);
|
|
208
|
+
function span(location) {
|
|
209
|
+
return { startOffset: location.startOffset, endOffset: location.endOffset };
|
|
210
|
+
}
|
|
150
211
|
function parseHtml(html) {
|
|
151
|
-
|
|
212
|
+
const document = { childNodes: [] };
|
|
213
|
+
const stack = [];
|
|
214
|
+
const noop = () => {
|
|
215
|
+
};
|
|
216
|
+
const handler = {
|
|
217
|
+
onComment: noop,
|
|
218
|
+
onDoctype: noop,
|
|
219
|
+
onCharacter: noop,
|
|
220
|
+
onNullCharacter: noop,
|
|
221
|
+
onWhitespaceCharacter: noop,
|
|
222
|
+
onEof: noop,
|
|
223
|
+
onStartTag(token) {
|
|
224
|
+
const location = token.location;
|
|
225
|
+
if (!location) return;
|
|
226
|
+
const attrs = {};
|
|
227
|
+
for (const [name, value] of Object.entries(location.attrs ?? {})) attrs[name] = span(value);
|
|
228
|
+
const element = {
|
|
229
|
+
tagName: token.tagName,
|
|
230
|
+
attrs: token.attrs.map((attr) => ({ name: attr.name, value: attr.value })),
|
|
231
|
+
sourceCodeLocation: { ...span(location), startTag: span(location), attrs },
|
|
232
|
+
childNodes: []
|
|
233
|
+
};
|
|
234
|
+
if (CLOSES_P.has(token.tagName)) closeParagraph(stack);
|
|
235
|
+
const parent = stack.at(-1) ?? document;
|
|
236
|
+
parent.childNodes.push(element);
|
|
237
|
+
if (VOID_ELEMENTS.has(token.tagName) || token.selfClosing) return;
|
|
238
|
+
stack.push(element);
|
|
239
|
+
if (RAWTEXT_ELEMENTS.has(token.tagName)) tokenizer.state = TokenizerMode.RAWTEXT;
|
|
240
|
+
else if (RCDATA_ELEMENTS.has(token.tagName)) tokenizer.state = TokenizerMode.RCDATA;
|
|
241
|
+
else if (token.tagName === "script") tokenizer.state = TokenizerMode.SCRIPT_DATA;
|
|
242
|
+
},
|
|
243
|
+
onEndTag(token) {
|
|
244
|
+
const location = token.location;
|
|
245
|
+
if (!location) return;
|
|
246
|
+
for (let index = stack.length - 1; index >= 0; index -= 1) {
|
|
247
|
+
const element = stack[index];
|
|
248
|
+
if (element?.tagName !== token.tagName) continue;
|
|
249
|
+
element.sourceCodeLocation.endTag = span(location);
|
|
250
|
+
element.sourceCodeLocation.endOffset = location.endOffset;
|
|
251
|
+
stack.length = index;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const tokenizer = new Tokenizer({ sourceCodeLocationInfo: true }, handler);
|
|
257
|
+
tokenizer.write(html, true);
|
|
258
|
+
return document;
|
|
259
|
+
}
|
|
260
|
+
function closeParagraph(stack) {
|
|
261
|
+
for (let index = stack.length - 1; index >= 0; index -= 1) {
|
|
262
|
+
const tagName = stack[index]?.tagName ?? "";
|
|
263
|
+
if (tagName === "p") {
|
|
264
|
+
stack.length = index;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (P_SCOPE_BOUNDARY.has(tagName)) return;
|
|
268
|
+
}
|
|
152
269
|
}
|
|
153
270
|
function walkElements(node, visit) {
|
|
154
|
-
if ("tagName" in node
|
|
155
|
-
|
|
156
|
-
for (const child of node.childNodes) walkElements(child, visit);
|
|
157
|
-
}
|
|
271
|
+
if ("tagName" in node) visit(node);
|
|
272
|
+
for (const child of node.childNodes) walkElements(child, visit);
|
|
158
273
|
}
|
|
159
274
|
|
|
160
275
|
// src/markers/bind.ts
|
|
@@ -168,7 +283,7 @@ function bindSites(html, markers, sites, profile) {
|
|
|
168
283
|
const next = /* @__PURE__ */ new Map();
|
|
169
284
|
for (const [id, marker] of markers) {
|
|
170
285
|
const site = sites.get(id);
|
|
171
|
-
const filled = materialize(marker, site);
|
|
286
|
+
const filled = materialize(marker, site, profile);
|
|
172
287
|
if (!filled.ok) return filled;
|
|
173
288
|
next.set(id, filled.marker);
|
|
174
289
|
}
|
|
@@ -183,15 +298,17 @@ function checkCapabilities(sites, profile) {
|
|
|
183
298
|
const diagnostics = [];
|
|
184
299
|
for (const site of sites.values()) {
|
|
185
300
|
if (site.kind === "helper") {
|
|
186
|
-
const capability = findCapability(profile, site.helper ?? "");
|
|
301
|
+
const capability = findCapability(profile, site.helper ?? "", "inline");
|
|
187
302
|
if (!capability || capability.form !== "inline") {
|
|
188
303
|
diagnostics.push(errorDiagnostic("HBS002", `Helper is not enabled: ${site.helper ?? ""}`));
|
|
189
304
|
continue;
|
|
190
305
|
}
|
|
191
306
|
diagnostics.push(...checkArguments(capability, site));
|
|
307
|
+
diagnostics.push(...checkHash(capability, site));
|
|
308
|
+
diagnostics.push(...checkLiterals(capability, site));
|
|
192
309
|
}
|
|
193
310
|
if (site.kind === "block") {
|
|
194
|
-
const capability = findCapability(profile, site.block ?? "");
|
|
311
|
+
const capability = findCapability(profile, site.block ?? "", "block");
|
|
195
312
|
if (!capability || capability.form !== "block") {
|
|
196
313
|
diagnostics.push(errorDiagnostic("HBS002", `Block is not enabled: ${site.block ?? ""}`));
|
|
197
314
|
continue;
|
|
@@ -229,7 +346,16 @@ function checkArguments(capability, site) {
|
|
|
229
346
|
const diagnostics = [];
|
|
230
347
|
capability.args.forEach((expected, index) => {
|
|
231
348
|
const actual = args[index];
|
|
232
|
-
if (actual
|
|
349
|
+
if (!actual) return;
|
|
350
|
+
if (expected === "expression") {
|
|
351
|
+
if (actual.kind !== "path" && actual.kind !== "literal") {
|
|
352
|
+
diagnostics.push(
|
|
353
|
+
errorDiagnostic("HBS002", `Helper ${capability.name} argument ${index + 1} must be a path or literal.`)
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
if (actual.kind !== expected) {
|
|
233
359
|
diagnostics.push(
|
|
234
360
|
errorDiagnostic("HBS002", `Helper ${capability.name} argument ${index + 1} must be a ${expected}.`)
|
|
235
361
|
);
|
|
@@ -237,7 +363,32 @@ function checkArguments(capability, site) {
|
|
|
237
363
|
});
|
|
238
364
|
return diagnostics;
|
|
239
365
|
}
|
|
366
|
+
function checkHashKind(expected, actual) {
|
|
367
|
+
if (expected === "expression") return actual.kind === "path" || actual.kind === "literal";
|
|
368
|
+
return actual.kind === expected;
|
|
369
|
+
}
|
|
240
370
|
function checkHash(capability, site) {
|
|
371
|
+
if (capability.freeHash) {
|
|
372
|
+
const expected = capability.freeHash;
|
|
373
|
+
const diagnostics2 = [];
|
|
374
|
+
for (const [name, actual] of Object.entries(site.hash ?? {})) {
|
|
375
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
376
|
+
diagnostics2.push(
|
|
377
|
+
errorDiagnostic("HBS002", `Helper ${capability.name} named argument ${name} is not an identifier.`)
|
|
378
|
+
);
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
if (!checkHashKind(expected, actual)) {
|
|
382
|
+
diagnostics2.push(
|
|
383
|
+
errorDiagnostic(
|
|
384
|
+
"HBS002",
|
|
385
|
+
`Helper ${capability.name} named argument ${name} must be a ${expected === "expression" ? "path or literal" : expected}.`
|
|
386
|
+
)
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return diagnostics2;
|
|
391
|
+
}
|
|
241
392
|
if (!capability.hash) {
|
|
242
393
|
if (site.hash && Object.keys(site.hash).length > 0) {
|
|
243
394
|
return [errorDiagnostic("HBS002", `Helper ${capability.name} does not accept named arguments.`)];
|
|
@@ -252,11 +403,11 @@ function checkHash(capability, site) {
|
|
|
252
403
|
diagnostics.push(errorDiagnostic("HBS002", `Helper ${capability.name} requires named argument ${expected.name}.`));
|
|
253
404
|
continue;
|
|
254
405
|
}
|
|
255
|
-
if (
|
|
406
|
+
if (!checkHashKind(expected.kind, actual)) {
|
|
256
407
|
diagnostics.push(
|
|
257
408
|
errorDiagnostic(
|
|
258
409
|
"HBS002",
|
|
259
|
-
`Helper ${capability.name} named argument ${expected.name} must be a ${expected.kind}.`
|
|
410
|
+
`Helper ${capability.name} named argument ${expected.name} must be a ${expected.kind === "expression" ? "path or literal" : expected.kind}.`
|
|
260
411
|
)
|
|
261
412
|
);
|
|
262
413
|
}
|
|
@@ -329,7 +480,7 @@ function regionsFrom(sites, anchors, profile) {
|
|
|
329
480
|
for (const [id, site] of sites) {
|
|
330
481
|
if (site.kind !== "block" || !site.block) continue;
|
|
331
482
|
const anchor = anchors.get(id);
|
|
332
|
-
const capability = findCapability(profile, site.block);
|
|
483
|
+
const capability = findCapability(profile, site.block, "block");
|
|
333
484
|
if (!anchor || !capability) continue;
|
|
334
485
|
regions.push({
|
|
335
486
|
...anchor,
|
|
@@ -379,33 +530,37 @@ function usedCapabilities(sites, profile) {
|
|
|
379
530
|
}
|
|
380
531
|
return profile.capabilities.filter((capability) => names.has(capability.name));
|
|
381
532
|
}
|
|
382
|
-
function materialize(marker, site) {
|
|
533
|
+
function materialize(marker, site, profile) {
|
|
383
534
|
if (marker.kind === "else") return { ok: true, marker: { ...marker } };
|
|
384
535
|
if (!site) return { ok: false, diagnostics: [errorDiagnostic("TOK001", "A marker has no descriptor.")] };
|
|
385
536
|
if (marker.kind === "text" && site.kind === "value" && site.path) {
|
|
386
537
|
return { ok: true, marker: { ...marker, replacement: emitInterpolation(site.path.emitted) } };
|
|
387
538
|
}
|
|
388
539
|
if (marker.kind === "text" && site.kind === "helper" && site.helper) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
)
|
|
397
|
-
}
|
|
398
|
-
};
|
|
540
|
+
const parts = [
|
|
541
|
+
...(site.args ?? []).map((arg) => arg.emitted),
|
|
542
|
+
...Object.entries(site.hash ?? {}).map(([name, arg]) => `${name}=${arg.emitted}`)
|
|
543
|
+
];
|
|
544
|
+
const capability = findCapability(profile, site.helper, "inline");
|
|
545
|
+
const replacement = capability?.emit === "empty-block" ? `${emitBlockOpen(site.helper, parts)}${emitBlockClose(site.helper)}` : emitHelperCall(site.helper, parts);
|
|
546
|
+
return { ok: true, marker: { ...marker, replacement } };
|
|
399
547
|
}
|
|
400
548
|
if (marker.kind === "text" && site.kind === "literal") {
|
|
401
549
|
const literal = site.args?.find((arg) => arg.kind === "literal");
|
|
402
550
|
if (literal) return { ok: true, marker: { ...marker, replacement: emitInterpolation(literal.emitted) } };
|
|
403
551
|
}
|
|
404
552
|
if (marker.kind === "attr" && site.kind === "attr") {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
553
|
+
if (site.path) {
|
|
554
|
+
return { ok: true, marker: { ...marker, replacement: emitInterpolation(site.path.emitted) } };
|
|
555
|
+
}
|
|
556
|
+
const args = site.args ?? [];
|
|
557
|
+
if (args.length === 1 && args[0]?.kind === "literal" && args[0].emitted.startsWith('"')) {
|
|
558
|
+
return { ok: true, marker: { ...marker, replacement: emitInterpolation(args[0].emitted) } };
|
|
559
|
+
}
|
|
560
|
+
if (args.length >= 1) {
|
|
561
|
+
const replacement = args.map((arg) => arg.kind === "path" ? emitInterpolation(arg.emitted) : arg.emitted).join("");
|
|
562
|
+
return { ok: true, marker: { ...marker, replacement } };
|
|
563
|
+
}
|
|
409
564
|
}
|
|
410
565
|
if (marker.kind === "open" && site.kind === "block" && site.block && site.path) {
|
|
411
566
|
const parts = [site.path.emitted, ...(site.args ?? []).map((arg) => arg.emitted)];
|
|
@@ -639,20 +794,30 @@ function openEdits(source, id, marker, markers, located) {
|
|
|
639
794
|
const closed = explicitElement(source, id, located.get(id));
|
|
640
795
|
if (!closed.ok) return closed;
|
|
641
796
|
const { location } = closed;
|
|
797
|
+
const startTag = location.startTag;
|
|
798
|
+
const endTag = location.endTag;
|
|
799
|
+
if (!startTag || !endTag) return fail("TOK001", `Opening ${id} has no explicit tags.`);
|
|
642
800
|
const attr = location.attrs?.["data-anchor"];
|
|
643
801
|
if (!attr) return fail("TOK001", `Opening ${id} was not located.`);
|
|
644
802
|
const attrText = source.slice(attr.startOffset, attr.endOffset);
|
|
645
803
|
if (attrText !== `data-anchor="${id}"`) return fail("TOK001", `Anchor ${id} was escaped or shifted.`);
|
|
804
|
+
const startExpected = source.slice(startTag.startOffset, startTag.endOffset);
|
|
646
805
|
const edits = [
|
|
647
|
-
{
|
|
648
|
-
|
|
806
|
+
{
|
|
807
|
+
start: startTag.startOffset,
|
|
808
|
+
end: startTag.endOffset,
|
|
809
|
+
text: marker.open,
|
|
810
|
+
expected: startExpected,
|
|
811
|
+
rank: 0
|
|
812
|
+
}
|
|
649
813
|
];
|
|
650
814
|
if (!marker.elseId) {
|
|
815
|
+
const endExpected2 = source.slice(endTag.startOffset, endTag.endOffset);
|
|
651
816
|
edits.push({
|
|
652
|
-
start:
|
|
653
|
-
end:
|
|
817
|
+
start: endTag.startOffset,
|
|
818
|
+
end: endTag.endOffset,
|
|
654
819
|
text: marker.close,
|
|
655
|
-
expected:
|
|
820
|
+
expected: endExpected2,
|
|
656
821
|
rank: 1
|
|
657
822
|
});
|
|
658
823
|
return { ok: true, edits };
|
|
@@ -661,6 +826,14 @@ function openEdits(source, id, marker, markers, located) {
|
|
|
661
826
|
if (!alternative || alternative.kind !== "else" || alternative.openId !== id) {
|
|
662
827
|
return fail("TOK001", `Alternative for block ${id} is not balanced.`);
|
|
663
828
|
}
|
|
829
|
+
const endExpected = source.slice(endTag.startOffset, endTag.endOffset);
|
|
830
|
+
edits.push({
|
|
831
|
+
start: endTag.startOffset,
|
|
832
|
+
end: endTag.endOffset,
|
|
833
|
+
text: "",
|
|
834
|
+
expected: endExpected,
|
|
835
|
+
rank: 1
|
|
836
|
+
});
|
|
664
837
|
return { ok: true, edits };
|
|
665
838
|
}
|
|
666
839
|
function elseEdits(source, id, marker, markers, located) {
|
|
@@ -671,6 +844,9 @@ function elseEdits(source, id, marker, markers, located) {
|
|
|
671
844
|
}
|
|
672
845
|
if (!closed.ok) return closed;
|
|
673
846
|
const { location } = closed;
|
|
847
|
+
const startTag = location.startTag;
|
|
848
|
+
const endTag = location.endTag;
|
|
849
|
+
if (!startTag || !endTag) return fail("TOK001", `Alternative for block ${id} is not balanced.`);
|
|
674
850
|
const attr = location.attrs?.["data-anchor"];
|
|
675
851
|
if (!attr) return fail("TOK001", `Closing for block ${id} is not balanced.`);
|
|
676
852
|
const attrText = source.slice(attr.startOffset, attr.endOffset);
|
|
@@ -678,9 +854,20 @@ function elseEdits(source, id, marker, markers, located) {
|
|
|
678
854
|
return {
|
|
679
855
|
ok: true,
|
|
680
856
|
edits: [
|
|
681
|
-
{
|
|
682
|
-
|
|
683
|
-
|
|
857
|
+
{
|
|
858
|
+
start: startTag.startOffset,
|
|
859
|
+
end: startTag.endOffset,
|
|
860
|
+
text: "{{else}}",
|
|
861
|
+
expected: source.slice(startTag.startOffset, startTag.endOffset),
|
|
862
|
+
rank: 0
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
start: endTag.startOffset,
|
|
866
|
+
end: endTag.endOffset,
|
|
867
|
+
text: opener.close,
|
|
868
|
+
expected: source.slice(endTag.startOffset, endTag.endOffset),
|
|
869
|
+
rank: 1
|
|
870
|
+
}
|
|
684
871
|
]
|
|
685
872
|
};
|
|
686
873
|
}
|
|
@@ -715,16 +902,6 @@ function isImagePreload(element, attribute) {
|
|
|
715
902
|
const as = element.attrs.find((attr) => attr.name === "as")?.value;
|
|
716
903
|
return rel === "preload" && as === "image";
|
|
717
904
|
}
|
|
718
|
-
function anchorRemoval(source, start, end, attrText) {
|
|
719
|
-
const withSpace = start > 0 && source[start - 1] === " ";
|
|
720
|
-
return {
|
|
721
|
-
start: withSpace ? start - 1 : start,
|
|
722
|
-
end,
|
|
723
|
-
text: "",
|
|
724
|
-
expected: withSpace ? ` ${attrText}` : attrText,
|
|
725
|
-
rank: 2
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
905
|
function fail(code, message) {
|
|
729
906
|
return { ok: false, diagnostics: [errorDiagnostic(code, message)] };
|
|
730
907
|
}
|
|
@@ -828,6 +1005,13 @@ function isSafeEmailId(id) {
|
|
|
828
1005
|
var FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
829
1006
|
var IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
830
1007
|
var INDEX = /^[0-9]+$/;
|
|
1008
|
+
function isLiteralSegment(segment) {
|
|
1009
|
+
if (segment.length === 0) return false;
|
|
1010
|
+
for (const char of segment) {
|
|
1011
|
+
if (char === "[" || char === "]" || char === "{" || char === "}" || char.charCodeAt(0) < 32) return false;
|
|
1012
|
+
}
|
|
1013
|
+
return true;
|
|
1014
|
+
}
|
|
831
1015
|
function parentHops(segments) {
|
|
832
1016
|
let hops = 0;
|
|
833
1017
|
for (const segment of segments) {
|
|
@@ -841,7 +1025,7 @@ function parsePath(input, allowParent) {
|
|
|
841
1025
|
if (input === "@index") {
|
|
842
1026
|
return { ok: true, segments: ["@index"], emitted: "@index" };
|
|
843
1027
|
}
|
|
844
|
-
if (input.includes("@")
|
|
1028
|
+
if (input.includes("@")) {
|
|
845
1029
|
return { ok: false, message: `Unsupported path syntax: ${input}` };
|
|
846
1030
|
}
|
|
847
1031
|
const segments = [];
|
|
@@ -854,8 +1038,14 @@ function parsePath(input, allowParent) {
|
|
|
854
1038
|
if (cursor < input.length) {
|
|
855
1039
|
const rest = input.slice(cursor);
|
|
856
1040
|
if (rest.length === 0) return { ok: false, message: "Incomplete path." };
|
|
857
|
-
|
|
858
|
-
|
|
1041
|
+
const split = splitSegments(rest);
|
|
1042
|
+
if (!split.ok) return { ok: false, message: `${split.message}: ${input}` };
|
|
1043
|
+
for (const { segment, literal } of split.segments) {
|
|
1044
|
+
if (literal) {
|
|
1045
|
+
if (!isLiteralSegment(segment) || segment.trim() !== segment || segment === "." || segment === "..") {
|
|
1046
|
+
return { ok: false, message: `Unsupported path segment: [${segment}]` };
|
|
1047
|
+
}
|
|
1048
|
+
} else if (!IDENTIFIER.test(segment) && !INDEX.test(segment)) {
|
|
859
1049
|
return { ok: false, message: `Unsupported path segment: ${segment}` };
|
|
860
1050
|
}
|
|
861
1051
|
if (FORBIDDEN_SEGMENTS.has(segment) || segment === "this") {
|
|
@@ -869,10 +1059,38 @@ function parsePath(input, allowParent) {
|
|
|
869
1059
|
}
|
|
870
1060
|
return { ok: true, segments, emitted: emitPath(segments) };
|
|
871
1061
|
}
|
|
1062
|
+
function splitSegments(rest) {
|
|
1063
|
+
const segments = [];
|
|
1064
|
+
let cursor = 0;
|
|
1065
|
+
while (cursor <= rest.length) {
|
|
1066
|
+
if (rest[cursor] === "[") {
|
|
1067
|
+
const close = rest.indexOf("]", cursor + 1);
|
|
1068
|
+
if (close < 0) return { ok: false, message: "Unclosed segment literal" };
|
|
1069
|
+
segments.push({ segment: rest.slice(cursor + 1, close), literal: true });
|
|
1070
|
+
cursor = close + 1;
|
|
1071
|
+
} else {
|
|
1072
|
+
let end = rest.indexOf(".", cursor);
|
|
1073
|
+
if (end < 0) end = rest.length;
|
|
1074
|
+
const segment = rest.slice(cursor, end);
|
|
1075
|
+
if (segment.includes("[") || segment.includes("]")) return { ok: false, message: "Misplaced segment literal" };
|
|
1076
|
+
segments.push({ segment, literal: false });
|
|
1077
|
+
cursor = end;
|
|
1078
|
+
}
|
|
1079
|
+
if (cursor === rest.length) break;
|
|
1080
|
+
if (rest[cursor] !== ".") return { ok: false, message: 'Expected "." after a segment literal' };
|
|
1081
|
+
cursor += 1;
|
|
1082
|
+
if (cursor === rest.length) return { ok: false, message: "Incomplete path" };
|
|
1083
|
+
}
|
|
1084
|
+
return { ok: true, segments };
|
|
1085
|
+
}
|
|
1086
|
+
function emitSegment(segment) {
|
|
1087
|
+
return IDENTIFIER.test(segment) || INDEX.test(segment) ? segment : `[${segment}]`;
|
|
1088
|
+
}
|
|
872
1089
|
function emitPath(segments) {
|
|
873
1090
|
let output = "";
|
|
874
|
-
for (const
|
|
875
|
-
|
|
1091
|
+
for (const raw of segments) {
|
|
1092
|
+
const segment = raw === ".." || raw === "@index" ? raw : emitSegment(raw);
|
|
1093
|
+
if (raw === "..") {
|
|
876
1094
|
output += output.length === 0 ? ".." : "/..";
|
|
877
1095
|
} else if (output.length === 0) {
|
|
878
1096
|
output = segment;
|
|
@@ -1316,6 +1534,11 @@ function walk(nodes, stack, guards) {
|
|
|
1316
1534
|
diagnostics.push(...inspectRef(node, stack, guards));
|
|
1317
1535
|
continue;
|
|
1318
1536
|
}
|
|
1537
|
+
if (node.path === "@index") {
|
|
1538
|
+
diagnostics.push(...walk(node.children, stack, guards));
|
|
1539
|
+
diagnostics.push(...walk(node.fallback, stack, guards));
|
|
1540
|
+
continue;
|
|
1541
|
+
}
|
|
1319
1542
|
const absolute = absoluteSegments(node.path, node.parentHops, stack);
|
|
1320
1543
|
const missing = absolute ? null : contractDiagnostic(node.path, "missing");
|
|
1321
1544
|
if (!absolute || missing) {
|
|
@@ -1336,9 +1559,8 @@ function walk(nodes, stack, guards) {
|
|
|
1336
1559
|
continue;
|
|
1337
1560
|
}
|
|
1338
1561
|
const child = { schema: elements, prefix: [...absolute.segments, "[]"] };
|
|
1339
|
-
|
|
1340
|
-
diagnostics.push(...walk(node.
|
|
1341
|
-
diagnostics.push(...walk(node.fallback, outer, guards));
|
|
1562
|
+
diagnostics.push(...walk(node.children, [...stack, child], guards));
|
|
1563
|
+
diagnostics.push(...walk(node.fallback, stack, guards));
|
|
1342
1564
|
continue;
|
|
1343
1565
|
}
|
|
1344
1566
|
if (node.block === "group") {
|
|
@@ -1351,9 +1573,23 @@ function walk(nodes, stack, guards) {
|
|
|
1351
1573
|
schema: groupFrameSchema(elements),
|
|
1352
1574
|
prefix: [...absolute.segments, "group"]
|
|
1353
1575
|
};
|
|
1354
|
-
|
|
1355
|
-
diagnostics.push(...walk(node.
|
|
1356
|
-
|
|
1576
|
+
diagnostics.push(...walk(node.children, [...stack, child], guards));
|
|
1577
|
+
diagnostics.push(...walk(node.fallback, stack, guards));
|
|
1578
|
+
continue;
|
|
1579
|
+
}
|
|
1580
|
+
if (node.block === "with") {
|
|
1581
|
+
const child = { schema: lookup.schema, prefix: absolute.segments };
|
|
1582
|
+
diagnostics.push(...walk(node.children, [...stack, child], guards));
|
|
1583
|
+
diagnostics.push(...walk(node.fallback, stack, guards));
|
|
1584
|
+
continue;
|
|
1585
|
+
}
|
|
1586
|
+
if (node.block === "richShippingData") {
|
|
1587
|
+
const child = {
|
|
1588
|
+
schema: enrichShippingSchema(lookup.schema),
|
|
1589
|
+
prefix: absolute.segments
|
|
1590
|
+
};
|
|
1591
|
+
diagnostics.push(...walk(node.children, [...stack, child], guards));
|
|
1592
|
+
diagnostics.push(...walk(node.fallback, stack, guards));
|
|
1357
1593
|
continue;
|
|
1358
1594
|
}
|
|
1359
1595
|
const nextGuards = [...guards, absolute.segments];
|
|
@@ -1439,6 +1675,12 @@ function resolve(schema, segments) {
|
|
|
1439
1675
|
return { status: "found", optional: peeled.optional || next.optional, schema: next.schema };
|
|
1440
1676
|
}
|
|
1441
1677
|
if (current?.type === "array" && current.element) {
|
|
1678
|
+
if (segments[0] === "length") {
|
|
1679
|
+
if (segments.length === 1) {
|
|
1680
|
+
return { status: "found", optional: peeled.optional, schema: { def: { type: "number" } } };
|
|
1681
|
+
}
|
|
1682
|
+
return { status: "missing" };
|
|
1683
|
+
}
|
|
1442
1684
|
if (!/^[0-9]+$/.test(segments[0] ?? "")) return { status: "missing" };
|
|
1443
1685
|
const next = resolve(current.element, segments.slice(1));
|
|
1444
1686
|
if (next.status !== "found") return next;
|
|
@@ -1469,12 +1711,70 @@ function groupFrameSchema(element) {
|
|
|
1469
1711
|
type: "object",
|
|
1470
1712
|
shape: {
|
|
1471
1713
|
index: { def: { type: "number" } },
|
|
1472
|
-
value: {},
|
|
1714
|
+
value: { def: { type: "string" } },
|
|
1473
1715
|
items: { def: { type: "array", element } }
|
|
1474
1716
|
}
|
|
1475
1717
|
}
|
|
1476
1718
|
};
|
|
1477
1719
|
}
|
|
1720
|
+
var derivedLogisticsFields = {
|
|
1721
|
+
packageId: { def: { type: "string" } },
|
|
1722
|
+
shippingEstimate: { def: { type: "string" } },
|
|
1723
|
+
shippingEstimateDate: { def: { type: "string" } },
|
|
1724
|
+
shippingEstimateDays: { def: { type: "string" } },
|
|
1725
|
+
shippingEstimateDaysType: { def: { type: "string" } },
|
|
1726
|
+
deliveryWindow: {
|
|
1727
|
+
def: {
|
|
1728
|
+
type: "object",
|
|
1729
|
+
shape: {
|
|
1730
|
+
startDateUtc: { def: { type: "string" } },
|
|
1731
|
+
endDateUtc: { def: { type: "string" } }
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
availableDeliveryWindows: {
|
|
1736
|
+
def: {
|
|
1737
|
+
type: "array",
|
|
1738
|
+
element: {
|
|
1739
|
+
def: {
|
|
1740
|
+
type: "object",
|
|
1741
|
+
shape: {
|
|
1742
|
+
startDateUtc: { def: { type: "string" } },
|
|
1743
|
+
endDateUtc: { def: { type: "string" } }
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
function enrichShippingSchema(schema) {
|
|
1751
|
+
const peeled = peelSchema(schema);
|
|
1752
|
+
if (peeled.status !== "ready") return schema;
|
|
1753
|
+
const current = schemaDef(peeled.schema);
|
|
1754
|
+
if (!current || current.type !== "object" || !current.shape) return schema;
|
|
1755
|
+
const logistics = current.shape.logisticsInfo;
|
|
1756
|
+
if (!logistics) return schema;
|
|
1757
|
+
const elements = arrayElements(logistics);
|
|
1758
|
+
if (!elements) return schema;
|
|
1759
|
+
const elementPeeled = peelSchema(elements);
|
|
1760
|
+
const elementDef = elementPeeled.status === "ready" ? schemaDef(elementPeeled.schema) : null;
|
|
1761
|
+
const baseShape = elementDef?.type === "object" && elementDef.shape ? { ...elementDef.shape } : {};
|
|
1762
|
+
const enrichedElement = {
|
|
1763
|
+
def: {
|
|
1764
|
+
type: "object",
|
|
1765
|
+
shape: { ...baseShape, ...derivedLogisticsFields }
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
return {
|
|
1769
|
+
def: {
|
|
1770
|
+
type: "object",
|
|
1771
|
+
shape: {
|
|
1772
|
+
...current.shape,
|
|
1773
|
+
logisticsInfo: { def: { type: "array", element: enrichedElement } }
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1478
1778
|
export {
|
|
1479
1779
|
TOKEN_BODY_LENGTH,
|
|
1480
1780
|
TOKEN_LENGTH,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../src/markers/bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../src/markers/bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAW,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAA8B,UAAU,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AActC,MAAM,MAAM,UAAU,GAClB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,EAAE,CAAA;CAAE,GAC9F,OAAO,CAAA;AAEX,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,OAAO,EAAE,eAAe,GACvB,UAAU,CAuBZ"}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Anchor locator over the rendered HTML.
|
|
3
|
+
*
|
|
4
|
+
* Only the tokenizer of parse5 is used. Tree construction is intentionally skipped: the HTML tree builder applies
|
|
5
|
+
* table rules (foster parenting, implied `tbody`, implicit end tags), which move or implicitly close block hosts
|
|
6
|
+
* placed between table rows (`<tbody><vtx-anchor><tr>…</tr></vtx-anchor></tbody>`). Markers need the offsets of
|
|
7
|
+
* the tags exactly as React wrote them, so elements are paired by name on an explicit stack instead.
|
|
8
|
+
*/
|
|
9
|
+
export interface SourceSpan {
|
|
10
|
+
startOffset: number;
|
|
11
|
+
endOffset: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ElementLocation extends SourceSpan {
|
|
14
|
+
startTag?: SourceSpan;
|
|
15
|
+
endTag?: SourceSpan;
|
|
16
|
+
attrs?: Record<string, SourceSpan>;
|
|
17
|
+
}
|
|
18
|
+
export interface ElementNode {
|
|
19
|
+
tagName: string;
|
|
20
|
+
attrs: Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}>;
|
|
24
|
+
sourceCodeLocation: ElementLocation;
|
|
25
|
+
childNodes: ElementNode[];
|
|
26
|
+
}
|
|
27
|
+
export interface DocumentNode {
|
|
28
|
+
childNodes: ElementNode[];
|
|
29
|
+
}
|
|
30
|
+
export type TreeNode = ElementNode | DocumentNode;
|
|
31
|
+
export declare function parseHtml(html: string): DocumentNode;
|
|
5
32
|
export declare function walkElements(node: TreeNode, visit: (element: ElementNode) => void): void;
|
|
6
33
|
//# sourceMappingURL=html-anchors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-anchors.d.ts","sourceRoot":"","sources":["../../src/markers/html-anchors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html-anchors.d.ts","sourceRoot":"","sources":["../../src/markers/html-anchors.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC7C,kBAAkB,EAAE,eAAe,CAAA;IACnC,UAAU,EAAE,WAAW,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,WAAW,EAAE,CAAA;CAC1B;AAED,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAA;AAsEjD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAkDpD;AAcD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAGxF"}
|
package/dist/markers/sites.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export type BlockName = 'each' | 'if' | 'unless' | 'ifCond' | 'hasSubStr' | 'group' | 'eq';
|
|
1
|
+
export type BlockName = 'each' | 'if' | 'unless' | 'ifCond' | 'hasSubStr' | 'group' | 'eq' | 'with' | 'math' | 'richShippingData';
|
|
3
2
|
export type DynamicAttribute = 'href' | 'src' | 'alt' | 'title';
|
|
3
|
+
export type SiteArgKind = 'path' | 'literal';
|
|
4
4
|
export interface ResolvedPath {
|
|
5
5
|
emitted: string;
|
|
6
6
|
parentHops: number;
|
|
7
7
|
}
|
|
8
8
|
export interface SiteArgument {
|
|
9
|
-
kind:
|
|
9
|
+
kind: SiteArgKind;
|
|
10
10
|
emitted: string;
|
|
11
11
|
path?: ResolvedPath;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/markers/sites.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/markers/sites.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,OAAO,GACP,IAAI,GACJ,MAAM,GACN,MAAM,GACN,kBAAkB,CAAA;AAEtB,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAA;AAE/D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAA;AAE5C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IACvD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC9B,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B"}
|
package/dist/profile.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type Evidence = 'documented' | 'verified' | 'experimental';
|
|
2
|
-
export type ArgKind = 'path' | 'literal';
|
|
2
|
+
export type ArgKind = 'path' | 'literal' | 'expression';
|
|
3
3
|
export interface HashArg {
|
|
4
4
|
name: string;
|
|
5
5
|
kind: ArgKind;
|
|
@@ -15,6 +15,17 @@ export interface EmissionCapability {
|
|
|
15
15
|
};
|
|
16
16
|
args?: readonly ArgKind[];
|
|
17
17
|
hash?: readonly HashArg[];
|
|
18
|
+
/**
|
|
19
|
+
* Named arguments with author-chosen names (identifiers), each of this kind. Used by helpers such as eval whose
|
|
20
|
+
* hash carries variables. Mutually exclusive with hash.
|
|
21
|
+
*/
|
|
22
|
+
freeHash?: ArgKind;
|
|
23
|
+
/**
|
|
24
|
+
* How an inline capability is written. 'call' (default) is {{name args}}. 'empty-block' is
|
|
25
|
+
* {{#name args}}{{/name}}, for helpers that the destination only documents in block form and whose output is the
|
|
26
|
+
* helper return value (eval).
|
|
27
|
+
*/
|
|
28
|
+
emit?: 'call' | 'empty-block';
|
|
18
29
|
literals?: ReadonlyArray<{
|
|
19
30
|
index: number;
|
|
20
31
|
values: readonly string[];
|
package/dist/profile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,CAAA;AAEjE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,CAAA;AAEjE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,YAAY,CAAA;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IACpC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACzB,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;IAC7B,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;IACtE,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB,EAAE,OAAO,CAAA;IAC5B,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,MAAM,CAAA;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IACrC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,YAAY,KAAK,MAAM,CAAA;CAC9E;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,WAAW,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,OAAQ,SAAQ,eAAe;IAC9C,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;CACpC;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,EAAE,CAEpE;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAChC,kBAAkB,GAAG,SAAS,CAGhC"}
|