@vtex-email/core 0.3.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 +199 -24
- package/dist/markers/html-anchors.d.ts +31 -4
- package/dist/markers/html-anchors.d.ts.map +1 -1
- package/dist/profile.d.ts +11 -0
- 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
|
}
|
|
@@ -189,6 +304,7 @@ function checkCapabilities(sites, profile) {
|
|
|
189
304
|
continue;
|
|
190
305
|
}
|
|
191
306
|
diagnostics.push(...checkArguments(capability, site));
|
|
307
|
+
diagnostics.push(...checkHash(capability, site));
|
|
192
308
|
diagnostics.push(...checkLiterals(capability, site));
|
|
193
309
|
}
|
|
194
310
|
if (site.kind === "block") {
|
|
@@ -252,6 +368,27 @@ function checkHashKind(expected, actual) {
|
|
|
252
368
|
return actual.kind === expected;
|
|
253
369
|
}
|
|
254
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
|
+
}
|
|
255
392
|
if (!capability.hash) {
|
|
256
393
|
if (site.hash && Object.keys(site.hash).length > 0) {
|
|
257
394
|
return [errorDiagnostic("HBS002", `Helper ${capability.name} does not accept named arguments.`)];
|
|
@@ -393,23 +530,20 @@ function usedCapabilities(sites, profile) {
|
|
|
393
530
|
}
|
|
394
531
|
return profile.capabilities.filter((capability) => names.has(capability.name));
|
|
395
532
|
}
|
|
396
|
-
function materialize(marker, site) {
|
|
533
|
+
function materialize(marker, site, profile) {
|
|
397
534
|
if (marker.kind === "else") return { ok: true, marker: { ...marker } };
|
|
398
535
|
if (!site) return { ok: false, diagnostics: [errorDiagnostic("TOK001", "A marker has no descriptor.")] };
|
|
399
536
|
if (marker.kind === "text" && site.kind === "value" && site.path) {
|
|
400
537
|
return { ok: true, marker: { ...marker, replacement: emitInterpolation(site.path.emitted) } };
|
|
401
538
|
}
|
|
402
539
|
if (marker.kind === "text" && site.kind === "helper" && site.helper) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
)
|
|
411
|
-
}
|
|
412
|
-
};
|
|
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 } };
|
|
413
547
|
}
|
|
414
548
|
if (marker.kind === "text" && site.kind === "literal") {
|
|
415
549
|
const literal = site.args?.find((arg) => arg.kind === "literal");
|
|
@@ -871,6 +1005,13 @@ function isSafeEmailId(id) {
|
|
|
871
1005
|
var FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
872
1006
|
var IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
873
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
|
+
}
|
|
874
1015
|
function parentHops(segments) {
|
|
875
1016
|
let hops = 0;
|
|
876
1017
|
for (const segment of segments) {
|
|
@@ -884,7 +1025,7 @@ function parsePath(input, allowParent) {
|
|
|
884
1025
|
if (input === "@index") {
|
|
885
1026
|
return { ok: true, segments: ["@index"], emitted: "@index" };
|
|
886
1027
|
}
|
|
887
|
-
if (input.includes("@")
|
|
1028
|
+
if (input.includes("@")) {
|
|
888
1029
|
return { ok: false, message: `Unsupported path syntax: ${input}` };
|
|
889
1030
|
}
|
|
890
1031
|
const segments = [];
|
|
@@ -897,8 +1038,14 @@ function parsePath(input, allowParent) {
|
|
|
897
1038
|
if (cursor < input.length) {
|
|
898
1039
|
const rest = input.slice(cursor);
|
|
899
1040
|
if (rest.length === 0) return { ok: false, message: "Incomplete path." };
|
|
900
|
-
|
|
901
|
-
|
|
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)) {
|
|
902
1049
|
return { ok: false, message: `Unsupported path segment: ${segment}` };
|
|
903
1050
|
}
|
|
904
1051
|
if (FORBIDDEN_SEGMENTS.has(segment) || segment === "this") {
|
|
@@ -912,10 +1059,38 @@ function parsePath(input, allowParent) {
|
|
|
912
1059
|
}
|
|
913
1060
|
return { ok: true, segments, emitted: emitPath(segments) };
|
|
914
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
|
+
}
|
|
915
1089
|
function emitPath(segments) {
|
|
916
1090
|
let output = "";
|
|
917
|
-
for (const
|
|
918
|
-
|
|
1091
|
+
for (const raw of segments) {
|
|
1092
|
+
const segment = raw === ".." || raw === "@index" ? raw : emitSegment(raw);
|
|
1093
|
+
if (raw === "..") {
|
|
919
1094
|
output += output.length === 0 ? ".." : "/..";
|
|
920
1095
|
} else if (output.length === 0) {
|
|
921
1096
|
output = segment;
|
|
@@ -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/profile.d.ts
CHANGED
|
@@ -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,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,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,E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