@marko/runtime-tags 6.2.2 → 6.2.4
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/README.md +1 -1
- package/dist/debug/html.js +4 -4
- package/dist/debug/html.mjs +4 -4
- package/dist/html.js +4 -4
- package/dist/html.mjs +4 -4
- package/dist/translator/index.js +72 -287
- package/dist/translator/util/serialize-guard.d.ts +1 -1
- package/dist/translator/util/static-text.d.ts +3 -0
- package/dist/translator/visitors/text.d.ts +7 -0
- package/package.json +1 -1
- package/tags-html.d.ts +22 -98
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ The following renders a button and a counter of how many times the button has be
|
|
|
47
47
|
<th><svg viewBox="0 0 448 512"><path d="M357.2 48L427.8 48 273.6 224.2 455 464 313 464 201.7 318.6 74.5 464 3.8 464 168.7 275.5-5.2 48 140.4 48 240.9 180.9 357.2 48zM332.4 421.8l39.1 0-252.4-333.8-42 0 255.3 333.8z"></path></svg>
|
|
48
48
|
<th><svg viewBox="0 0 512 512"><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM252.8 8c-138.7 0-244.8 105.3-244.8 244 0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1 100-33.2 167.8-128.1 167.8-239 0-138.7-112.5-244-251.2-244zM105.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>
|
|
49
49
|
<tbody><tr><td>
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
Hang out in our [Discord server](https://discord.gg/marko) to ask questions & discuss marko<td>
|
|
52
52
|
|
|
53
53
|
Keep up with the community on Bluesky at [@markojs.com](https://bsky.app/profile/markojs.com)<td>
|
package/dist/debug/html.js
CHANGED
|
@@ -263,7 +263,7 @@ const KNOWN_SYMBOLS = (() => {
|
|
|
263
263
|
}
|
|
264
264
|
return KNOWN_SYMBOLS;
|
|
265
265
|
})();
|
|
266
|
-
const KNOWN_FUNCTIONS = new Map([
|
|
266
|
+
const KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
267
267
|
[AggregateError, "AggregateError"],
|
|
268
268
|
[Array, "Array"],
|
|
269
269
|
[Array.from, "Array.from"],
|
|
@@ -482,7 +482,7 @@ const KNOWN_FUNCTIONS = new Map([
|
|
|
482
482
|
[WeakMap, "WeakMap"],
|
|
483
483
|
[WeakSet, "WeakSet"]
|
|
484
484
|
]);
|
|
485
|
-
const KNOWN_OBJECTS = new Map([
|
|
485
|
+
const KNOWN_OBJECTS = /* @__PURE__ */ new Map([
|
|
486
486
|
[Atomics, "Atomics"],
|
|
487
487
|
[console, "console"],
|
|
488
488
|
[globalThis, "globalThis"],
|
|
@@ -1002,7 +1002,7 @@ function writeArrayBuffer(state, val) {
|
|
|
1002
1002
|
return true;
|
|
1003
1003
|
}
|
|
1004
1004
|
function writeTypedArray(state, val, ref) {
|
|
1005
|
-
if (val.byteOffset || state.refs.has(val.buffer)) {
|
|
1005
|
+
if (val.byteOffset || val.byteLength < val.buffer.byteLength || state.refs.has(val.buffer)) {
|
|
1006
1006
|
const needsLength = val.byteOffset + val.byteLength < val.buffer.byteLength;
|
|
1007
1007
|
state.buf.push("new " + val.constructor.name + "(");
|
|
1008
1008
|
writeProp(state, val.buffer, ref, "buffer");
|
|
@@ -2440,7 +2440,7 @@ let tickQueue;
|
|
|
2440
2440
|
function queueTick(cb) {
|
|
2441
2441
|
if (tickQueue) tickQueue.add(cb);
|
|
2442
2442
|
else {
|
|
2443
|
-
tickQueue = new Set([cb]);
|
|
2443
|
+
tickQueue = /* @__PURE__ */ new Set([cb]);
|
|
2444
2444
|
tick(flushTickQueue);
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
package/dist/debug/html.mjs
CHANGED
|
@@ -261,7 +261,7 @@ const KNOWN_SYMBOLS = (() => {
|
|
|
261
261
|
}
|
|
262
262
|
return KNOWN_SYMBOLS;
|
|
263
263
|
})();
|
|
264
|
-
const KNOWN_FUNCTIONS = new Map([
|
|
264
|
+
const KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
265
265
|
[AggregateError, "AggregateError"],
|
|
266
266
|
[Array, "Array"],
|
|
267
267
|
[Array.from, "Array.from"],
|
|
@@ -480,7 +480,7 @@ const KNOWN_FUNCTIONS = new Map([
|
|
|
480
480
|
[WeakMap, "WeakMap"],
|
|
481
481
|
[WeakSet, "WeakSet"]
|
|
482
482
|
]);
|
|
483
|
-
const KNOWN_OBJECTS = new Map([
|
|
483
|
+
const KNOWN_OBJECTS = /* @__PURE__ */ new Map([
|
|
484
484
|
[Atomics, "Atomics"],
|
|
485
485
|
[console, "console"],
|
|
486
486
|
[globalThis, "globalThis"],
|
|
@@ -1000,7 +1000,7 @@ function writeArrayBuffer(state, val) {
|
|
|
1000
1000
|
return true;
|
|
1001
1001
|
}
|
|
1002
1002
|
function writeTypedArray(state, val, ref) {
|
|
1003
|
-
if (val.byteOffset || state.refs.has(val.buffer)) {
|
|
1003
|
+
if (val.byteOffset || val.byteLength < val.buffer.byteLength || state.refs.has(val.buffer)) {
|
|
1004
1004
|
const needsLength = val.byteOffset + val.byteLength < val.buffer.byteLength;
|
|
1005
1005
|
state.buf.push("new " + val.constructor.name + "(");
|
|
1006
1006
|
writeProp(state, val.buffer, ref, "buffer");
|
|
@@ -2438,7 +2438,7 @@ let tickQueue;
|
|
|
2438
2438
|
function queueTick(cb) {
|
|
2439
2439
|
if (tickQueue) tickQueue.add(cb);
|
|
2440
2440
|
else {
|
|
2441
|
-
tickQueue = new Set([cb]);
|
|
2441
|
+
tickQueue = /* @__PURE__ */ new Set([cb]);
|
|
2442
2442
|
tick(flushTickQueue);
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
package/dist/html.js
CHANGED
|
@@ -11,7 +11,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
11
11
|
typeof symbol == "symbol" && KNOWN_SYMBOLS.set(symbol, "Symbol." + name);
|
|
12
12
|
}
|
|
13
13
|
return KNOWN_SYMBOLS;
|
|
14
|
-
})(), KNOWN_FUNCTIONS = new Map([
|
|
14
|
+
})(), KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
15
15
|
[AggregateError, "AggregateError"],
|
|
16
16
|
[Array, "Array"],
|
|
17
17
|
[Array.from, "Array.from"],
|
|
@@ -229,7 +229,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
229
229
|
[URIError, "URIError"],
|
|
230
230
|
[WeakMap, "WeakMap"],
|
|
231
231
|
[WeakSet, "WeakSet"]
|
|
232
|
-
]), KNOWN_OBJECTS = new Map([
|
|
232
|
+
]), KNOWN_OBJECTS = /* @__PURE__ */ new Map([
|
|
233
233
|
[Atomics, "Atomics"],
|
|
234
234
|
[console, "console"],
|
|
235
235
|
[globalThis, "globalThis"],
|
|
@@ -755,7 +755,7 @@ function writeArrayBuffer(state, val) {
|
|
|
755
755
|
return state.buf.push(result), !0;
|
|
756
756
|
}
|
|
757
757
|
function writeTypedArray(state, val, ref) {
|
|
758
|
-
if (val.byteOffset || state.refs.has(val.buffer)) {
|
|
758
|
+
if (val.byteOffset || val.byteLength < val.buffer.byteLength || state.refs.has(val.buffer)) {
|
|
759
759
|
let needsLength = val.byteOffset + val.byteLength < val.buffer.byteLength;
|
|
760
760
|
state.buf.push("new " + val.constructor.name + "("), writeProp(state, val.buffer, ref, "buffer"), state.buf.push((val.byteOffset || needsLength ? "," + val.byteOffset + (needsLength ? "," + val.length : "") : "") + ")");
|
|
761
761
|
} else state.refs.set(val.buffer, new Reference(ref, "buffer", state.flush, null)), state.buf.push("new " + val.constructor.name + (val.length === 0 ? "" : "(" + (hasOnlyZeros(val) ? val.length : typedArrayToInitString(val)) + ")"));
|
|
@@ -1586,7 +1586,7 @@ function concatScripts(a, b) {
|
|
|
1586
1586
|
return a ? b ? a + ";" + b : a : b;
|
|
1587
1587
|
}
|
|
1588
1588
|
function queueTick(cb) {
|
|
1589
|
-
tickQueue ? tickQueue.add(cb) : (tickQueue = new Set([cb]), tick(flushTickQueue));
|
|
1589
|
+
tickQueue ? tickQueue.add(cb) : (tickQueue = /* @__PURE__ */ new Set([cb]), tick(flushTickQueue));
|
|
1590
1590
|
}
|
|
1591
1591
|
function offTick(cb) {
|
|
1592
1592
|
tickQueue?.delete(cb);
|
package/dist/html.mjs
CHANGED
|
@@ -11,7 +11,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
11
11
|
typeof symbol == "symbol" && KNOWN_SYMBOLS.set(symbol, "Symbol." + name);
|
|
12
12
|
}
|
|
13
13
|
return KNOWN_SYMBOLS;
|
|
14
|
-
})(), KNOWN_FUNCTIONS = new Map([
|
|
14
|
+
})(), KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
15
15
|
[AggregateError, "AggregateError"],
|
|
16
16
|
[Array, "Array"],
|
|
17
17
|
[Array.from, "Array.from"],
|
|
@@ -229,7 +229,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
229
229
|
[URIError, "URIError"],
|
|
230
230
|
[WeakMap, "WeakMap"],
|
|
231
231
|
[WeakSet, "WeakSet"]
|
|
232
|
-
]), KNOWN_OBJECTS = new Map([
|
|
232
|
+
]), KNOWN_OBJECTS = /* @__PURE__ */ new Map([
|
|
233
233
|
[Atomics, "Atomics"],
|
|
234
234
|
[console, "console"],
|
|
235
235
|
[globalThis, "globalThis"],
|
|
@@ -754,7 +754,7 @@ function writeArrayBuffer(state, val) {
|
|
|
754
754
|
return state.buf.push(result), !0;
|
|
755
755
|
}
|
|
756
756
|
function writeTypedArray(state, val, ref) {
|
|
757
|
-
if (val.byteOffset || state.refs.has(val.buffer)) {
|
|
757
|
+
if (val.byteOffset || val.byteLength < val.buffer.byteLength || state.refs.has(val.buffer)) {
|
|
758
758
|
let needsLength = val.byteOffset + val.byteLength < val.buffer.byteLength;
|
|
759
759
|
state.buf.push("new " + val.constructor.name + "("), writeProp(state, val.buffer, ref, "buffer"), state.buf.push((val.byteOffset || needsLength ? "," + val.byteOffset + (needsLength ? "," + val.length : "") : "") + ")");
|
|
760
760
|
} else state.refs.set(val.buffer, new Reference(ref, "buffer", state.flush, null)), state.buf.push("new " + val.constructor.name + (val.length === 0 ? "" : "(" + (hasOnlyZeros(val) ? val.length : typedArrayToInitString(val)) + ")"));
|
|
@@ -1585,7 +1585,7 @@ function concatScripts(a, b) {
|
|
|
1585
1585
|
return a ? b ? a + ";" + b : a : b;
|
|
1586
1586
|
}
|
|
1587
1587
|
function queueTick(cb) {
|
|
1588
|
-
tickQueue ? tickQueue.add(cb) : (tickQueue = new Set([cb]), tick(flushTickQueue));
|
|
1588
|
+
tickQueue ? tickQueue.add(cb) : (tickQueue = /* @__PURE__ */ new Set([cb]), tick(flushTickQueue));
|
|
1589
1589
|
}
|
|
1590
1590
|
function offTick(cb) {
|
|
1591
1591
|
tickQueue?.delete(cb);
|
package/dist/translator/index.js
CHANGED
|
@@ -305,235 +305,8 @@ patchIteratorNext(AsyncGenerator.prototype);
|
|
|
305
305
|
}
|
|
306
306
|
return KNOWN_SYMBOLS;
|
|
307
307
|
})();
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
[Array, "Array"],
|
|
311
|
-
[Array.from, "Array.from"],
|
|
312
|
-
[Array.isArray, "Array.isArray"],
|
|
313
|
-
[Array.of, "Array.of"],
|
|
314
|
-
[ArrayBuffer, "ArrayBuffer"],
|
|
315
|
-
[ArrayBuffer.isView, "ArrayBuffer.isView"],
|
|
316
|
-
[Atomics.add, "Atomics.add"],
|
|
317
|
-
[Atomics.and, "Atomics.and"],
|
|
318
|
-
[Atomics.compareExchange, "Atomics.compareExchange"],
|
|
319
|
-
[Atomics.exchange, "Atomics.exchange"],
|
|
320
|
-
[Atomics.isLockFree, "Atomics.isLockFree"],
|
|
321
|
-
[Atomics.load, "Atomics.load"],
|
|
322
|
-
[Atomics.notify, "Atomics.notify"],
|
|
323
|
-
[Atomics.or, "Atomics.or"],
|
|
324
|
-
[Atomics.store, "Atomics.store"],
|
|
325
|
-
[Atomics.sub, "Atomics.sub"],
|
|
326
|
-
[Atomics.wait, "Atomics.wait"],
|
|
327
|
-
[BigInt, "BigInt"],
|
|
328
|
-
[BigInt.asIntN, "BigInt.asIntN"],
|
|
329
|
-
[BigInt.asUintN, "BigInt.asUintN"],
|
|
330
|
-
[BigInt64Array, "BigInt64Array"],
|
|
331
|
-
[BigInt64Array.from, "BigInt64Array.from"],
|
|
332
|
-
[BigInt64Array.of, "BigInt64Array.of"],
|
|
333
|
-
[BigUint64Array, "BigUint64Array"],
|
|
334
|
-
[BigUint64Array.from, "BigUint64Array.from"],
|
|
335
|
-
[BigUint64Array.of, "BigUint64Array.of"],
|
|
336
|
-
[Boolean, "Boolean"],
|
|
337
|
-
[console.assert, "console.assert"],
|
|
338
|
-
[console.clear, "console.clear"],
|
|
339
|
-
[console.count, "console.count"],
|
|
340
|
-
[console.countReset, "console.countReset"],
|
|
341
|
-
[console.debug, "console.debug"],
|
|
342
|
-
[console.dir, "console.dir"],
|
|
343
|
-
[console.dirxml, "console.dirxml"],
|
|
344
|
-
[console.error, "console.error"],
|
|
345
|
-
[console.group, "console.group"],
|
|
346
|
-
[console.groupCollapsed, "console.groupCollapsed"],
|
|
347
|
-
[console.groupEnd, "console.groupEnd"],
|
|
348
|
-
[console.info, "console.info"],
|
|
349
|
-
[console.log, "console.log"],
|
|
350
|
-
[console.table, "console.table"],
|
|
351
|
-
[console.time, "console.time"],
|
|
352
|
-
[console.timeEnd, "console.timeEnd"],
|
|
353
|
-
[console.timeLog, "console.timeLog"],
|
|
354
|
-
[console.timeStamp, "console.timeStamp"],
|
|
355
|
-
[console.trace, "console.trace"],
|
|
356
|
-
[console.warn, "console.warn"],
|
|
357
|
-
[DataView, "DataView"],
|
|
358
|
-
[Date, "Date"],
|
|
359
|
-
[Date.now, "Date.now"],
|
|
360
|
-
[Date.parse, "Date.parse"],
|
|
361
|
-
[Date.UTC, "Date.UTC"],
|
|
362
|
-
[decodeURI, "decodeURI"],
|
|
363
|
-
[decodeURIComponent, "decodeURIComponent"],
|
|
364
|
-
[encodeURI, "encodeURI"],
|
|
365
|
-
[encodeURIComponent, "encodeURIComponent"],
|
|
366
|
-
[Error, "Error"],
|
|
367
|
-
[EvalError, "EvalError"],
|
|
368
|
-
[Float32Array, "Float32Array"],
|
|
369
|
-
[Float32Array.from, "Float32Array.from"],
|
|
370
|
-
[Float32Array.of, "Float32Array.of"],
|
|
371
|
-
[Float64Array, "Float64Array"],
|
|
372
|
-
[Float64Array.from, "Float64Array.from"],
|
|
373
|
-
[Float64Array.of, "Float64Array.of"],
|
|
374
|
-
[Function, "Function"],
|
|
375
|
-
[globalThis.atob, "atob"],
|
|
376
|
-
[globalThis.btoa, "btoa"],
|
|
377
|
-
[globalThis.clearImmediate, "clearImmediate"],
|
|
378
|
-
[globalThis.clearInterval, "clearInterval"],
|
|
379
|
-
[globalThis.clearTimeout, "clearTimeout"],
|
|
380
|
-
[globalThis.crypto?.getRandomValues, "crypto.getRandomValues"],
|
|
381
|
-
[globalThis.crypto?.randomUUID, "crypto.randomUUID"],
|
|
382
|
-
[globalThis.fetch, "fetch"],
|
|
383
|
-
[globalThis.performance?.now, "performance.now"],
|
|
384
|
-
[globalThis.queueMicrotask, "queueMicrotask"],
|
|
385
|
-
[globalThis.setImmediate, "setImmediate"],
|
|
386
|
-
[globalThis.setInterval, "setInterval"],
|
|
387
|
-
[globalThis.setTimeout, "setTimeout"],
|
|
388
|
-
[globalThis.structuredClone, "structuredClone"],
|
|
389
|
-
[globalThis.URL, "URL"],
|
|
390
|
-
[globalThis.URLSearchParams, "URLSearchParams"],
|
|
391
|
-
[globalThis.WritableStream, "WritableStream"],
|
|
392
|
-
[Int16Array, "Int16Array"],
|
|
393
|
-
[Int16Array.from, "Int16Array.from"],
|
|
394
|
-
[Int16Array.of, "Int16Array.of"],
|
|
395
|
-
[Int32Array, "Int32Array"],
|
|
396
|
-
[Int32Array.from, "Int32Array.from"],
|
|
397
|
-
[Int32Array.of, "Int32Array.of"],
|
|
398
|
-
[Int8Array, "Int8Array"],
|
|
399
|
-
[Int8Array.from, "Int8Array.from"],
|
|
400
|
-
[Int8Array.of, "Int8Array.of"],
|
|
401
|
-
[Intl.Collator, "Intl.Collator"],
|
|
402
|
-
[Intl.DateTimeFormat, "Intl.DateTimeFormat"],
|
|
403
|
-
[Intl.DisplayNames, "Intl.DisplayNames"],
|
|
404
|
-
[Intl.getCanonicalLocales, "Intl.getCanonicalLocales"],
|
|
405
|
-
[Intl.ListFormat, "Intl.ListFormat"],
|
|
406
|
-
[Intl.Locale, "Intl.Locale"],
|
|
407
|
-
[Intl.NumberFormat, "Intl.NumberFormat"],
|
|
408
|
-
[Intl.PluralRules, "Intl.PluralRules"],
|
|
409
|
-
[Intl.RelativeTimeFormat, "Intl.RelativeTimeFormat"],
|
|
410
|
-
[Intl.Segmenter, "Intl.Segmenter"],
|
|
411
|
-
[Intl.supportedValuesOf, "Intl.supportedValuesOf"],
|
|
412
|
-
[isFinite, "isFinite"],
|
|
413
|
-
[isNaN, "isNaN"],
|
|
414
|
-
[JSON.parse, "JSON.parse"],
|
|
415
|
-
[JSON.stringify, "JSON.stringify"],
|
|
416
|
-
[Map, "Map"],
|
|
417
|
-
[Map.groupBy, "Map.groupBy"],
|
|
418
|
-
[Math.abs, "Math.abs"],
|
|
419
|
-
[Math.acos, "Math.acos"],
|
|
420
|
-
[Math.acosh, "Math.acosh"],
|
|
421
|
-
[Math.asin, "Math.asin"],
|
|
422
|
-
[Math.asinh, "Math.asinh"],
|
|
423
|
-
[Math.atan, "Math.atan"],
|
|
424
|
-
[Math.atan2, "Math.atan2"],
|
|
425
|
-
[Math.atanh, "Math.atanh"],
|
|
426
|
-
[Math.cbrt, "Math.cbrt"],
|
|
427
|
-
[Math.ceil, "Math.ceil"],
|
|
428
|
-
[Math.clz32, "Math.clz32"],
|
|
429
|
-
[Math.cos, "Math.cos"],
|
|
430
|
-
[Math.cosh, "Math.cosh"],
|
|
431
|
-
[Math.exp, "Math.exp"],
|
|
432
|
-
[Math.expm1, "Math.expm1"],
|
|
433
|
-
[Math.floor, "Math.floor"],
|
|
434
|
-
[Math.fround, "Math.fround"],
|
|
435
|
-
[Math.hypot, "Math.hypot"],
|
|
436
|
-
[Math.imul, "Math.imul"],
|
|
437
|
-
[Math.log, "Math.log"],
|
|
438
|
-
[Math.log10, "Math.log10"],
|
|
439
|
-
[Math.log1p, "Math.log1p"],
|
|
440
|
-
[Math.log2, "Math.log2"],
|
|
441
|
-
[Math.max, "Math.max"],
|
|
442
|
-
[Math.min, "Math.min"],
|
|
443
|
-
[Math.pow, "Math.pow"],
|
|
444
|
-
[Math.random, "Math.random"],
|
|
445
|
-
[Math.round, "Math.round"],
|
|
446
|
-
[Math.sign, "Math.sign"],
|
|
447
|
-
[Math.sin, "Math.sin"],
|
|
448
|
-
[Math.sinh, "Math.sinh"],
|
|
449
|
-
[Math.sqrt, "Math.sqrt"],
|
|
450
|
-
[Math.tan, "Math.tan"],
|
|
451
|
-
[Math.tanh, "Math.tanh"],
|
|
452
|
-
[Math.trunc, "Math.trunc"],
|
|
453
|
-
[Number, "Number"],
|
|
454
|
-
[Number.isFinite, "Number.isFinite"],
|
|
455
|
-
[Number.isInteger, "Number.isInteger"],
|
|
456
|
-
[Number.isNaN, "Number.isNaN"],
|
|
457
|
-
[Number.isSafeInteger, "Number.isSafeInteger"],
|
|
458
|
-
[Number.parseFloat, "Number.parseFloat"],
|
|
459
|
-
[Number.parseInt, "Number.parseInt"],
|
|
460
|
-
[Object, "Object"],
|
|
461
|
-
[Object.assign, "Object.assign"],
|
|
462
|
-
[Object.create, "Object.create"],
|
|
463
|
-
[Object.defineProperties, "Object.defineProperties"],
|
|
464
|
-
[Object.defineProperty, "Object.defineProperty"],
|
|
465
|
-
[Object.entries, "Object.entries"],
|
|
466
|
-
[Object.freeze, "Object.freeze"],
|
|
467
|
-
[Object.fromEntries, "Object.fromEntries"],
|
|
468
|
-
[Object.getOwnPropertyDescriptor, "Object.getOwnPropertyDescriptor"],
|
|
469
|
-
[Object.getOwnPropertyDescriptors, "Object.getOwnPropertyDescriptors"],
|
|
470
|
-
[Object.getOwnPropertyNames, "Object.getOwnPropertyNames"],
|
|
471
|
-
[Object.getOwnPropertySymbols, "Object.getOwnPropertySymbols"],
|
|
472
|
-
[Object.getPrototypeOf, "Object.getPrototypeOf"],
|
|
473
|
-
[Object.is, "Object.is"],
|
|
474
|
-
[Object.isExtensible, "Object.isExtensible"],
|
|
475
|
-
[Object.isFrozen, "Object.isFrozen"],
|
|
476
|
-
[Object.isSealed, "Object.isSealed"],
|
|
477
|
-
[Object.keys, "Object.keys"],
|
|
478
|
-
[Object.preventExtensions, "Object.preventExtensions"],
|
|
479
|
-
[Object.seal, "Object.seal"],
|
|
480
|
-
[Object.setPrototypeOf, "Object.setPrototypeOf"],
|
|
481
|
-
[Object.values, "Object.values"],
|
|
482
|
-
[parseFloat, "parseFloat"],
|
|
483
|
-
[parseInt, "parseInt"],
|
|
484
|
-
[Promise, "Promise"],
|
|
485
|
-
[Proxy, "Proxy"],
|
|
486
|
-
[RangeError, "RangeError"],
|
|
487
|
-
[ReferenceError, "ReferenceError"],
|
|
488
|
-
[Reflect.apply, "Reflect.apply"],
|
|
489
|
-
[Reflect.construct, "Reflect.construct"],
|
|
490
|
-
[Reflect.defineProperty, "Reflect.defineProperty"],
|
|
491
|
-
[Reflect.deleteProperty, "Reflect.deleteProperty"],
|
|
492
|
-
[Reflect.get, "Reflect.get"],
|
|
493
|
-
[Reflect.getOwnPropertyDescriptor, "Reflect.getOwnPropertyDescriptor"],
|
|
494
|
-
[Reflect.getPrototypeOf, "Reflect.getPrototypeOf"],
|
|
495
|
-
[Reflect.has, "Reflect.has"],
|
|
496
|
-
[Reflect.isExtensible, "Reflect.isExtensible"],
|
|
497
|
-
[Reflect.ownKeys, "Reflect.ownKeys"],
|
|
498
|
-
[Reflect.preventExtensions, "Reflect.preventExtensions"],
|
|
499
|
-
[Reflect.set, "Reflect.set"],
|
|
500
|
-
[Reflect.setPrototypeOf, "Reflect.setPrototypeOf"],
|
|
501
|
-
[RegExp, "RegExp"],
|
|
502
|
-
[Set, "Set"],
|
|
503
|
-
[String, "String"],
|
|
504
|
-
[String.fromCharCode, "String.fromCharCode"],
|
|
505
|
-
[String.fromCodePoint, "String.fromCodePoint"],
|
|
506
|
-
[String.raw, "String.raw"],
|
|
507
|
-
[Symbol, "Symbol"],
|
|
508
|
-
[Symbol.for, "Symbol.for"],
|
|
509
|
-
[SyntaxError, "SyntaxError"],
|
|
510
|
-
[TypeError, "TypeError"],
|
|
511
|
-
[Uint16Array, "Uint16Array"],
|
|
512
|
-
[Uint16Array.from, "Uint16Array.from"],
|
|
513
|
-
[Uint16Array.of, "Uint16Array.of"],
|
|
514
|
-
[Uint32Array, "Uint32Array"],
|
|
515
|
-
[Uint32Array.from, "Uint32Array.from"],
|
|
516
|
-
[Uint32Array.of, "Uint32Array.of"],
|
|
517
|
-
[Uint8Array, "Uint8Array"],
|
|
518
|
-
[Uint8Array.from, "Uint8Array.from"],
|
|
519
|
-
[Uint8Array.of, "Uint8Array.of"],
|
|
520
|
-
[Uint8ClampedArray, "Uint8ClampedArray"],
|
|
521
|
-
[Uint8ClampedArray.from, "Uint8ClampedArray.from"],
|
|
522
|
-
[Uint8ClampedArray.of, "Uint8ClampedArray.of"],
|
|
523
|
-
[URIError, "URIError"],
|
|
524
|
-
[WeakMap, "WeakMap"],
|
|
525
|
-
[WeakSet, "WeakSet"]
|
|
526
|
-
]);
|
|
527
|
-
new Map([
|
|
528
|
-
[Atomics, "Atomics"],
|
|
529
|
-
[console, "console"],
|
|
530
|
-
[globalThis, "globalThis"],
|
|
531
|
-
[globalThis.crypto, "crypto"],
|
|
532
|
-
[Intl, "Intl"],
|
|
533
|
-
[JSON, "JSON"],
|
|
534
|
-
[Math, "Math"],
|
|
535
|
-
[Reflect, "Reflect"]
|
|
536
|
-
]);
|
|
308
|
+
Array.from, Array.isArray, Array.of, ArrayBuffer.isView, Atomics.add, Atomics.and, Atomics.compareExchange, Atomics.exchange, Atomics.isLockFree, Atomics.load, Atomics.notify, Atomics.or, Atomics.store, Atomics.sub, Atomics.wait, BigInt.asIntN, BigInt.asUintN, BigInt64Array, BigInt64Array.from, BigInt64Array.of, BigUint64Array, BigUint64Array.from, BigUint64Array.of, console.timeStamp, Date.now, Date.parse, Date.UTC, Float32Array.from, Float32Array.of, Float64Array.from, Float64Array.of, globalThis.atob, globalThis.btoa, globalThis.clearImmediate, globalThis.clearInterval, globalThis.clearTimeout, globalThis.crypto?.getRandomValues, globalThis.crypto?.randomUUID, globalThis.fetch, globalThis.performance?.now, globalThis.queueMicrotask, globalThis.setImmediate, globalThis.setInterval, globalThis.setTimeout, globalThis.structuredClone, globalThis.URL, globalThis.URLSearchParams, globalThis.WritableStream, Int16Array.from, Int16Array.of, Int32Array.from, Int32Array.of, Int8Array.from, Int8Array.of, Intl.Collator, Intl.DateTimeFormat, Intl.DisplayNames, Intl.getCanonicalLocales, Intl.ListFormat, Intl.Locale, Intl.NumberFormat, Intl.PluralRules, Intl.RelativeTimeFormat, Intl.Segmenter, Intl.supportedValuesOf, Map.groupBy, Number.isFinite, Number.isInteger, Number.isNaN, Number.isSafeInteger, Number.parseFloat, Number.parseInt, String.fromCharCode, String.fromCodePoint, String.raw, Symbol.for, Uint16Array.from, Uint16Array.of, Uint32Array.from, Uint32Array.of, Uint8Array.from, Uint8Array.of, Uint8ClampedArray.from, Uint8ClampedArray.of;
|
|
309
|
+
Atomics, globalThis.crypto;
|
|
537
310
|
function toAccess(accessor) {
|
|
538
311
|
const start = accessor[0];
|
|
539
312
|
return start === "[" ? accessor : start === "\"" || start >= "0" && start <= "9" ? "[" + accessor + "]" : "." + accessor;
|
|
@@ -1679,7 +1452,7 @@ var function_default = { analyze(fn) {
|
|
|
1679
1452
|
if (refs === true) registerFunction(fnExtra, true);
|
|
1680
1453
|
else if (refs.size) getReferencesByFn().set(fnExtra, refs);
|
|
1681
1454
|
} else if (shouldAlwaysRegister(markoRoot)) registerFunction(fnExtra, true);
|
|
1682
|
-
else getReferencesByFn().set(fnExtra, new Set([exprRoot.node.extra ??= {}]));
|
|
1455
|
+
else getReferencesByFn().set(fnExtra, /* @__PURE__ */ new Set([exprRoot.node.extra ??= {}]));
|
|
1683
1456
|
} };
|
|
1684
1457
|
function finalizeFunctionRegistry() {
|
|
1685
1458
|
for (const [fnExtra, exprExtras] of getReferencesByFn()) {
|
|
@@ -2247,7 +2020,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
|
|
|
2247
2020
|
const { hasOwnProperty } = {};
|
|
2248
2021
|
//#endregion
|
|
2249
2022
|
//#region src/translator/util/runtime.ts
|
|
2250
|
-
const pureDOMFunctions = new Set([
|
|
2023
|
+
const pureDOMFunctions = /* @__PURE__ */ new Set([
|
|
2251
2024
|
"_await_promise",
|
|
2252
2025
|
"_await_content",
|
|
2253
2026
|
"_child_setup",
|
|
@@ -2443,10 +2216,10 @@ function normalizeStringExpression(parts, useIife) {
|
|
|
2443
2216
|
const exprLen = content.expressions.length;
|
|
2444
2217
|
shiftItems(parts, nextIndex, content.quasis.length + exprLen);
|
|
2445
2218
|
for (let j = 0; j < exprLen; j++) {
|
|
2446
|
-
parts[nextIndex++] = content.quasis[j].value.
|
|
2219
|
+
parts[nextIndex++] = content.quasis[j].value.cooked ?? "";
|
|
2447
2220
|
parts[nextIndex++] = content.expressions[j];
|
|
2448
2221
|
}
|
|
2449
|
-
parts[nextIndex] = content.quasis[exprLen].value.
|
|
2222
|
+
parts[nextIndex] = content.quasis[exprLen].value.cooked ?? "";
|
|
2450
2223
|
continue;
|
|
2451
2224
|
} else {
|
|
2452
2225
|
exprs.push(content);
|
|
@@ -2606,7 +2379,8 @@ function exit(path) {
|
|
|
2606
2379
|
getSteps(getSection(path)).push(1);
|
|
2607
2380
|
}
|
|
2608
2381
|
function enterShallow(path) {
|
|
2609
|
-
|
|
2382
|
+
const section = getSection(path);
|
|
2383
|
+
getSteps(section).push(0, 1);
|
|
2610
2384
|
}
|
|
2611
2385
|
function injectWalks(tag, name, expr) {
|
|
2612
2386
|
const section = getSection(tag);
|
|
@@ -3862,15 +3636,15 @@ function replaceRegisteredFunctionNode(node) {
|
|
|
3862
3636
|
switch (node.type) {
|
|
3863
3637
|
case "ClassMethod": {
|
|
3864
3638
|
const replacement = getRegisteredFnExpression(node);
|
|
3865
|
-
return replacement && _marko_compiler.types.classProperty(node.key, replacement);
|
|
3639
|
+
return replacement && _marko_compiler.types.classProperty(node.key, replacement, void 0, void 0, node.computed, node.static);
|
|
3866
3640
|
}
|
|
3867
3641
|
case "ClassPrivateMethod": {
|
|
3868
3642
|
const replacement = getRegisteredFnExpression(node);
|
|
3869
|
-
return replacement && _marko_compiler.types.classPrivateProperty(node.key, replacement);
|
|
3643
|
+
return replacement && _marko_compiler.types.classPrivateProperty(node.key, replacement, void 0, node.static);
|
|
3870
3644
|
}
|
|
3871
3645
|
case "ObjectMethod": {
|
|
3872
3646
|
const replacement = getRegisteredFnExpression(node);
|
|
3873
|
-
return replacement && _marko_compiler.types.objectProperty(node.key, replacement);
|
|
3647
|
+
return replacement && _marko_compiler.types.objectProperty(node.key, replacement, node.computed);
|
|
3874
3648
|
}
|
|
3875
3649
|
case "ArrowFunctionExpression":
|
|
3876
3650
|
case "FunctionExpression": return getRegisteredFnExpression(node);
|
|
@@ -3983,6 +3757,9 @@ var for_default = {
|
|
|
3983
3757
|
if (!isAttrTag) allowAttrs.push("by");
|
|
3984
3758
|
(0, _marko_compiler_babel_utils.assertAllowedAttributes)(tag, allowAttrs);
|
|
3985
3759
|
if (isAttrTag) return;
|
|
3760
|
+
if (forType !== "of") {
|
|
3761
|
+
if (getKnownAttrValues(tag.node).by?.type === "StringLiteral") throw (tag.get("attributes").find((attr) => attr.isMarkoAttribute() && attr.node.name === "by") || tag).buildCodeFrameError(`The [\`<for>\` tag](https://markojs.com/docs/reference/core-tag#for) only supports a string \`by\` key with \`of\`; use a \`by=(${forType === "in" ? "key, value" : "index"}) => ...\` function for \`<for ${forType}>\`.`);
|
|
3762
|
+
}
|
|
3986
3763
|
const bodySection = startSection(tagBody);
|
|
3987
3764
|
if (!bodySection) {
|
|
3988
3765
|
dropNodes(getAllTagReferenceNodes(tag.node));
|
|
@@ -5760,7 +5537,7 @@ var program_default = {
|
|
|
5760
5537
|
if (isDOMPageEntry) {
|
|
5761
5538
|
const entryFile = program.hub.file;
|
|
5762
5539
|
const { filename } = entryFile.opts;
|
|
5763
|
-
const visitedFiles = new Set([(0, _marko_compiler_babel_utils.resolveRelativePath)(entryFile, filename)]);
|
|
5540
|
+
const visitedFiles = /* @__PURE__ */ new Set([(0, _marko_compiler_babel_utils.resolveRelativePath)(entryFile, filename)]);
|
|
5764
5541
|
entry_builder_default.visit(entryFile, entryFile, function visitChild(resolved) {
|
|
5765
5542
|
if (!visitedFiles.has(resolved)) {
|
|
5766
5543
|
visitedFiles.add(resolved);
|
|
@@ -5902,7 +5679,7 @@ function knownTagAnalyze(tag, contentSection, propTree) {
|
|
|
5902
5679
|
const tagBody = tag.get("body");
|
|
5903
5680
|
const tagExtra = tag.node.extra ??= {};
|
|
5904
5681
|
const childScopeBinding = tagExtra[kChildScopeBinding] = createBinding("#childScope", 0, section);
|
|
5905
|
-
const attrExprs = new Set([tagExtra]);
|
|
5682
|
+
const attrExprs = /* @__PURE__ */ new Set([tagExtra]);
|
|
5906
5683
|
startSection(tagBody);
|
|
5907
5684
|
trackParamsReferences(tagBody, 3);
|
|
5908
5685
|
getKnownTags(section).push(tagExtra);
|
|
@@ -5938,7 +5715,7 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
|
|
|
5938
5715
|
const peekScopeId = generateUidIdentifier(childScopeBinding?.name);
|
|
5939
5716
|
tag.insertBefore(_marko_compiler.types.variableDeclaration("const", [_marko_compiler.types.variableDeclarator(peekScopeId, callRuntime("_peek_scope_id"))]));
|
|
5940
5717
|
setBindingSerializedValue(section, childScopeBinding, callRuntime("_existing_scope", peekScopeId));
|
|
5941
|
-
if (tagVar) statements.push(_marko_compiler.types.expressionStatement(callRuntime("_var", getScopeIdIdentifier(section), getScopeAccessorLiteral(tag.node.extra[kChildOffsetScopeBinding$1]), peekScopeId, _marko_compiler.types.stringLiteral(getResumeRegisterId(section,
|
|
5718
|
+
if (tagVar) statements.push(_marko_compiler.types.expressionStatement(callRuntime("_var", getScopeIdIdentifier(section), getScopeAccessorLiteral(tag.node.extra[kChildOffsetScopeBinding$1]), peekScopeId, _marko_compiler.types.stringLiteral(getResumeRegisterId(section, tagVar.extra?.binding, "var")))));
|
|
5942
5719
|
}
|
|
5943
5720
|
if (contentSection.paramReasonGroups) {
|
|
5944
5721
|
let childSerializeReasonExpr;
|
|
@@ -6685,9 +6462,9 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
|
|
|
6685
6462
|
for (const prop of lVal.properties) if (prop.type === "RestElement") createBindingsAndTrackReferences(prop.argument, type, scope, section, patternBinding, void 0, excludeProperties);
|
|
6686
6463
|
else {
|
|
6687
6464
|
let key;
|
|
6688
|
-
if (prop.key.type === "Identifier") key = prop.key.name;
|
|
6465
|
+
if (!prop.computed && prop.key.type === "Identifier") key = prop.key.name;
|
|
6689
6466
|
else if (prop.key.type === "StringLiteral") key = prop.key.value;
|
|
6690
|
-
else throw
|
|
6467
|
+
else throw scope.path.hub.buildError(prop.key, "Only identifier and string literal keys are supported when destructuring.");
|
|
6691
6468
|
if (hasRest) excludeProperties = propsUtil.add(excludeProperties, key);
|
|
6692
6469
|
if (_marko_compiler.types.isLVal(prop.value)) {
|
|
6693
6470
|
createBindingsAndTrackReferences(prop.value, type, scope, section, patternBinding, key, void 0);
|
|
@@ -6704,7 +6481,7 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
|
|
|
6704
6481
|
if (element) {
|
|
6705
6482
|
if (element.type === "RestElement") {
|
|
6706
6483
|
excludeProperties = i > 0 ? addNumericPropertiesUntil(excludeProperties, i) : void 0;
|
|
6707
|
-
createBindingsAndTrackReferences(element.argument, type, scope, section, patternBinding,
|
|
6484
|
+
createBindingsAndTrackReferences(element.argument, type, scope, section, patternBinding, void 0, excludeProperties, i);
|
|
6708
6485
|
} else if (_marko_compiler.types.isLVal(element)) createBindingsAndTrackReferences(element, type, scope, section, patternBinding, `${i}`, void 0);
|
|
6709
6486
|
}
|
|
6710
6487
|
}
|
|
@@ -8239,7 +8016,6 @@ var log_default = {
|
|
|
8239
8016
|
};
|
|
8240
8017
|
//#endregion
|
|
8241
8018
|
//#region src/translator/core/script.ts
|
|
8242
|
-
const htmlScriptTagAlternateMsg = " For a native html [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) use the `html-script` core tag instead.";
|
|
8243
8019
|
var script_default = {
|
|
8244
8020
|
parse(tag) {
|
|
8245
8021
|
const { node } = tag;
|
|
@@ -8247,7 +8023,7 @@ var script_default = {
|
|
|
8247
8023
|
if (body.length) {
|
|
8248
8024
|
let code = "";
|
|
8249
8025
|
for (const child of body) {
|
|
8250
|
-
if (child.type !== "MarkoText") throw tag.hub.file.hub.buildError(child, "Unexpected content in [`<script>` tag](https://markojs.com/docs/reference/core-tag#script). Only javascript and typescript is supported.
|
|
8026
|
+
if (child.type !== "MarkoText") throw tag.hub.file.hub.buildError(child, "Unexpected content in [`<script>` tag](https://markojs.com/docs/reference/core-tag#script). Only javascript and typescript is supported. For a native html [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) use the `html-script` core tag instead.", SyntaxError);
|
|
8251
8027
|
code += child.value;
|
|
8252
8028
|
}
|
|
8253
8029
|
const start = body[0]?.start;
|
|
@@ -8266,7 +8042,7 @@ var script_default = {
|
|
|
8266
8042
|
(0, _marko_compiler_babel_utils.assertNoParams)(tag);
|
|
8267
8043
|
assertNoBodyContent(tag);
|
|
8268
8044
|
(0, _marko_compiler_babel_utils.assertNoAttributeTags)(tag);
|
|
8269
|
-
if (node.var) throw tag.hub.buildError(node.var, "The [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) does not support a tag variable reference.
|
|
8045
|
+
if (node.var) throw tag.hub.buildError(node.var, "The [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) does not support a tag variable reference. For a native html [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) use the `html-script` core tag instead.");
|
|
8270
8046
|
let seenValueAttr = false;
|
|
8271
8047
|
for (const attr of node.attributes) if (attr.type === "MarkoAttribute" && attr.name === "value") {
|
|
8272
8048
|
if (seenValueAttr) throw tag.hub.buildError(attr, "Invalid duplicate value attribute.");
|
|
@@ -8274,7 +8050,7 @@ var script_default = {
|
|
|
8274
8050
|
(attr.value.extra ??= {}).isEffect = true;
|
|
8275
8051
|
addSetupExpr(getOrCreateSection(tag), attr.value);
|
|
8276
8052
|
(0, _marko_compiler_babel_utils.getProgram)().node.extra.isInteractive = true;
|
|
8277
|
-
} else throw tag.hub.buildError(attr, "The [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) does not support html attributes.
|
|
8053
|
+
} else throw tag.hub.buildError(attr, "The [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) does not support html attributes. For a native html [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) use the `html-script` core tag instead.");
|
|
8278
8054
|
if (!seenValueAttr) dropNodes(getAllTagReferenceNodes(node));
|
|
8279
8055
|
},
|
|
8280
8056
|
translate: { exit(tag) {
|
|
@@ -8529,9 +8305,6 @@ var static_default = {
|
|
|
8529
8305
|
descriptionMoreURL: "https://markojs.com/docs/syntax/#static-javascript"
|
|
8530
8306
|
}]
|
|
8531
8307
|
};
|
|
8532
|
-
//#endregion
|
|
8533
|
-
//#region src/translator/util/style-interpolation.ts
|
|
8534
|
-
const htmlStyleTagAlternateMsg = " For a native html [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) use the `html-style` core tag instead.";
|
|
8535
8308
|
function checkStyleInterpolations(tag) {
|
|
8536
8309
|
const { body } = tag.node.body;
|
|
8537
8310
|
let stringQuote = "";
|
|
@@ -8612,6 +8385,7 @@ const cssGluedBefore = /[\w%]$/;
|
|
|
8612
8385
|
//#endregion
|
|
8613
8386
|
//#region src/translator/core/style.ts
|
|
8614
8387
|
const STYLE_EXT_REG = /^style((?:\.[a-zA-Z0-9$_-]+)+)?/;
|
|
8388
|
+
const programStyleCounts = /* @__PURE__ */ new WeakMap();
|
|
8615
8389
|
var style_default = {
|
|
8616
8390
|
analyze(tag) {
|
|
8617
8391
|
(0, _marko_compiler_babel_utils.assertNoArgs)(tag);
|
|
@@ -8665,7 +8439,7 @@ function collectDynamicStyleNames(tag) {
|
|
|
8665
8439
|
index = dynamicStyleNameOffset(tag);
|
|
8666
8440
|
}
|
|
8667
8441
|
names.push(dynamicStyleName(tag, index++));
|
|
8668
|
-
} else if (!_marko_compiler.types.isMarkoText(child)) throw tag.hub.buildError(child, "The [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) only supports text and `${...}` interpolations.
|
|
8442
|
+
} else if (!_marko_compiler.types.isMarkoText(child)) throw tag.hub.buildError(child, "The [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) only supports text and `${...}` interpolations. For a native html [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) use the `html-style` core tag instead.");
|
|
8669
8443
|
return names;
|
|
8670
8444
|
}
|
|
8671
8445
|
function dynamicStyleNameOffset(tag) {
|
|
@@ -8698,7 +8472,7 @@ function assertNoStyleAttributes(tag) {
|
|
|
8698
8472
|
const extClass = (STYLE_EXT_REG.exec(node.rawValue || "")?.[1]?.slice(1))?.replace(/\./g, " ");
|
|
8699
8473
|
for (const attr of node.attributes) {
|
|
8700
8474
|
if (attr.start == null && attr.type === "MarkoAttribute" && attr.name === "class" && attr.value.type === "StringLiteral" && attr.value.value === extClass) continue;
|
|
8701
|
-
throw tag.hub.buildError(attr.value, "The `style` does not support html attributes.
|
|
8475
|
+
throw tag.hub.buildError(attr.value, "The `style` does not support html attributes. For a native html [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) use the `html-style` core tag instead.");
|
|
8702
8476
|
}
|
|
8703
8477
|
}
|
|
8704
8478
|
function translateHTML$1(tag) {
|
|
@@ -8770,6 +8544,11 @@ function getStyleImportPath(file, node, names) {
|
|
|
8770
8544
|
const { filename, sourceMaps } = file.opts;
|
|
8771
8545
|
let ext = STYLE_EXT_REG.exec(node.rawValue || "")?.[1] || ".css";
|
|
8772
8546
|
if (node.var && !/\.module\./.test(ext)) ext = ".module" + ext;
|
|
8547
|
+
const program = (0, _marko_compiler_babel_utils.getProgram)().node;
|
|
8548
|
+
let counts = programStyleCounts.get(program);
|
|
8549
|
+
if (!counts) programStyleCounts.set(program, counts = {});
|
|
8550
|
+
const index = counts[ext] || 0;
|
|
8551
|
+
counts[ext] = index + 1;
|
|
8773
8552
|
const magicString = sourceMaps ? new magic_string.default(file.code, { filename }) : void 0;
|
|
8774
8553
|
let code = "";
|
|
8775
8554
|
let last = 0;
|
|
@@ -8802,7 +8581,7 @@ function getStyleImportPath(file, node, names) {
|
|
|
8802
8581
|
}
|
|
8803
8582
|
}
|
|
8804
8583
|
return resolveVirtualDependency(filename, {
|
|
8805
|
-
virtualPath: `./${path.default.basename(filename)
|
|
8584
|
+
virtualPath: `./${path.default.basename(filename)}${index ? `.${index}` : ""}${ext}`,
|
|
8806
8585
|
code,
|
|
8807
8586
|
map
|
|
8808
8587
|
});
|
|
@@ -9070,10 +8849,32 @@ function parseTriggerType(type) {
|
|
|
9070
8849
|
}
|
|
9071
8850
|
}
|
|
9072
8851
|
//#endregion
|
|
8852
|
+
//#region src/translator/util/static-text.ts
|
|
8853
|
+
function isStaticText(node) {
|
|
8854
|
+
switch (node?.type) {
|
|
8855
|
+
case "MarkoText": return true;
|
|
8856
|
+
case "MarkoPlaceholder":
|
|
8857
|
+
if (node.escape) {
|
|
8858
|
+
const { confident, computed } = evaluate(node.value);
|
|
8859
|
+
return confident && isNotVoid(computed);
|
|
8860
|
+
}
|
|
8861
|
+
return false;
|
|
8862
|
+
}
|
|
8863
|
+
}
|
|
8864
|
+
function getPrevStaticSibling(path) {
|
|
8865
|
+
let prev = path.getPrevSibling();
|
|
8866
|
+
while (prev.node && (prev.isMarkoComment() || prev.isMarkoPlaceholder() && isEmptyPlaceholder(prev.node))) prev = prev.getPrevSibling();
|
|
8867
|
+
return prev.node;
|
|
8868
|
+
}
|
|
8869
|
+
function isEmptyPlaceholder(placeholder) {
|
|
8870
|
+
const { confident, computed } = evaluate(placeholder.value);
|
|
8871
|
+
return confident && isVoid(computed);
|
|
8872
|
+
}
|
|
8873
|
+
//#endregion
|
|
9073
8874
|
//#region src/translator/visitors/placeholder.ts
|
|
9074
8875
|
const kNodeBinding = Symbol("placeholder node binding");
|
|
9075
8876
|
const kSiblingText = Symbol("placeholder has sibling text");
|
|
9076
|
-
const kSharedText = Symbol("placeholder will merge its visitor with a another node");
|
|
8877
|
+
const kSharedText$1 = Symbol("placeholder will merge its visitor with a another node");
|
|
9077
8878
|
var placeholder_default = {
|
|
9078
8879
|
analyze(placeholder) {
|
|
9079
8880
|
if (isNonHTMLText(placeholder)) return;
|
|
@@ -9082,7 +8883,7 @@ var placeholder_default = {
|
|
|
9082
8883
|
const { confident, computed } = valueExtra;
|
|
9083
8884
|
if (confident && isVoid(computed)) return;
|
|
9084
8885
|
if (isStaticText(node)) {
|
|
9085
|
-
if (isStaticText(
|
|
8886
|
+
if (isStaticText(getPrevStaticSibling(placeholder))) (node.extra ??= {})[kSharedText$1] = true;
|
|
9086
8887
|
} else {
|
|
9087
8888
|
const section = getOrCreateSection(placeholder);
|
|
9088
8889
|
const nodeBinding = (node.extra ??= {})[kNodeBinding] = createBinding("#text", 0, section);
|
|
@@ -9126,7 +8927,7 @@ var placeholder_default = {
|
|
|
9126
8927
|
if (nodeBinding) markNode(placeholder, nodeBinding, markerSerializeReason);
|
|
9127
8928
|
} else addStatement("render", section, valueExtra.referencedBindings, _marko_compiler.types.expressionStatement(method === "_text" ? callRuntime("_text", createScopeReadExpression(nodeBinding), value) : callRuntime("_html", scopeIdentifier, value, getScopeAccessorLiteral(nodeBinding))), void 0, true);
|
|
9128
8929
|
}
|
|
9129
|
-
if (!extra[kSharedText]) enterShallow(placeholder);
|
|
8930
|
+
if (!extra[kSharedText$1]) enterShallow(placeholder);
|
|
9130
8931
|
placeholder.remove();
|
|
9131
8932
|
} }
|
|
9132
8933
|
};
|
|
@@ -9196,29 +8997,6 @@ function getInlinedBodyTag(parent) {
|
|
|
9196
8997
|
if (tag.isMarkoTag() && isCoreTagName(tag, "show")) return tag;
|
|
9197
8998
|
}
|
|
9198
8999
|
}
|
|
9199
|
-
function isStaticText(node) {
|
|
9200
|
-
switch (node?.type) {
|
|
9201
|
-
case "MarkoText": return true;
|
|
9202
|
-
case "MarkoPlaceholder": if (node.escape) {
|
|
9203
|
-
const { confident, computed } = evaluate(node.value);
|
|
9204
|
-
return confident && isNotVoid(computed);
|
|
9205
|
-
} else return false;
|
|
9206
|
-
}
|
|
9207
|
-
}
|
|
9208
|
-
function getPrev(path) {
|
|
9209
|
-
let prev = path.getPrevSibling();
|
|
9210
|
-
while (prev.node && (prev.isMarkoComment() || prev.isMarkoPlaceholder() && isEmptyPlaceholder(prev.node))) prev = prev.getPrevSibling();
|
|
9211
|
-
return prev.node;
|
|
9212
|
-
}
|
|
9213
|
-
function getNext(path) {
|
|
9214
|
-
let next = path.getNextSibling();
|
|
9215
|
-
while (next.node && (next.isMarkoComment() || next.isMarkoPlaceholder() && isEmptyPlaceholder(next.node))) next = next.getNextSibling();
|
|
9216
|
-
return next.node;
|
|
9217
|
-
}
|
|
9218
|
-
function isEmptyPlaceholder(placeholder) {
|
|
9219
|
-
const { confident, computed } = evaluate(placeholder.value);
|
|
9220
|
-
return confident && isVoid(computed);
|
|
9221
|
-
}
|
|
9222
9000
|
//#endregion
|
|
9223
9001
|
//#region src/translator/visitors/referenced-identifier.ts
|
|
9224
9002
|
const abortIdsByExpressionForSection = /* @__PURE__ */ new WeakMap();
|
|
@@ -9728,12 +9506,19 @@ var tag_default = {
|
|
|
9728
9506
|
};
|
|
9729
9507
|
//#endregion
|
|
9730
9508
|
//#region src/translator/visitors/text.ts
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
}
|
|
9509
|
+
const kSharedText = Symbol("text merges its walk step with a sibling node");
|
|
9510
|
+
var text_default = {
|
|
9511
|
+
analyze(text) {
|
|
9512
|
+
if (isNonHTMLText(text)) return;
|
|
9513
|
+
if (isStaticText(getPrevStaticSibling(text))) (text.node.extra ??= {})[kSharedText] = true;
|
|
9514
|
+
},
|
|
9515
|
+
translate: { exit(text) {
|
|
9516
|
+
if (isNonHTMLText(text)) return;
|
|
9517
|
+
writeTo(text)`${text.node.value}`;
|
|
9518
|
+
if (!text.node.extra?.[kSharedText]) enterShallow(text);
|
|
9519
|
+
text.remove();
|
|
9520
|
+
} }
|
|
9521
|
+
};
|
|
9737
9522
|
//#endregion
|
|
9738
9523
|
//#region src/translator/interop/build-aggregate-error.ts
|
|
9739
9524
|
function buildAggregateError(file, rootMsg, ...paths) {
|
|
@@ -9940,7 +9725,7 @@ function createInteropTranslator(translate5) {
|
|
|
9940
9725
|
const entryFile = program.hub.file;
|
|
9941
9726
|
const { output, entry } = entryFile.markoOpts;
|
|
9942
9727
|
if (!(output === "dom" && entry === "page" || output === "hydrate")) return enterProgram?.call(this, program, state);
|
|
9943
|
-
const visitedFiles = new Set([(0, _marko_compiler_babel_utils.resolveRelativePath)(entryFile, entryFile.opts.filename)]);
|
|
9728
|
+
const visitedFiles = /* @__PURE__ */ new Set([(0, _marko_compiler_babel_utils.resolveRelativePath)(entryFile, entryFile.opts.filename)]);
|
|
9944
9729
|
entryBuilder.visit(entryFile, entryFile, function visitChild(resolved) {
|
|
9945
9730
|
if (!visitedFiles.has(resolved)) {
|
|
9946
9731
|
visitedFiles.add(resolved);
|
|
@@ -9979,7 +9764,7 @@ function mergeTaglibs(libs5, libs6) {
|
|
|
9979
9764
|
const libs5Map = new Map(libs5);
|
|
9980
9765
|
const libs6Map = new Map(libs6);
|
|
9981
9766
|
const merged = [];
|
|
9982
|
-
for (const taglibId of new Set([...libs5Map.keys(), ...libs6Map.keys()])) merged.push([taglibId, mergeObjects(libs5Map.get(taglibId), libs6Map.get(taglibId), (key, value5, value6) => {
|
|
9767
|
+
for (const taglibId of /* @__PURE__ */ new Set([...libs5Map.keys(), ...libs6Map.keys()])) merged.push([taglibId, mergeObjects(libs5Map.get(taglibId), libs6Map.get(taglibId), (key, value5, value6) => {
|
|
9983
9768
|
switch (key) {
|
|
9984
9769
|
case "migrate":
|
|
9985
9770
|
case "analyze":
|
|
@@ -4,4 +4,4 @@ import { type SerializeReason, type SerializeReasons } from "./serialize-reasons
|
|
|
4
4
|
export declare function getScopeReasonDeclaration(section: Section): t.VariableDeclaration;
|
|
5
5
|
export declare function getSerializeGuard(section: Section, reason: undefined | SerializeReason, optional: boolean): t.Expression | undefined;
|
|
6
6
|
export declare function getSerializeGuardForAny(section: Section, reasons: undefined | SerializeReasons, optional: boolean): t.Expression | undefined;
|
|
7
|
-
export declare function getExprIfSerialized<T extends undefined | SerializeReason, R extends T extends {} ? t.Expression : undefined>(section: Section, reason: T, expr: t.Expression): R;
|
|
7
|
+
export declare function getExprIfSerialized<T extends undefined | SerializeReason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
declare const kSharedText: unique symbol;
|
|
3
|
+
declare module "@marko/compiler/dist/types" {
|
|
4
|
+
interface NodeExtra {
|
|
5
|
+
[kSharedText]?: true;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
2
8
|
declare const _default: {
|
|
9
|
+
analyze(this: unknown, text: t.NodePath<t.MarkoText>): void;
|
|
3
10
|
translate: {
|
|
4
11
|
exit(this: unknown, text: t.NodePath<t.MarkoText>): void;
|
|
5
12
|
};
|
package/package.json
CHANGED
package/tags-html.d.ts
CHANGED
|
@@ -922,13 +922,7 @@ declare global {
|
|
|
922
922
|
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method
|
|
923
923
|
*/
|
|
924
924
|
method?:
|
|
925
|
-
|
|
|
926
|
-
| "POST"
|
|
927
|
-
| "post"
|
|
928
|
-
| "GET"
|
|
929
|
-
| "get"
|
|
930
|
-
| "dialog"
|
|
931
|
-
| "DIALOG";
|
|
925
|
+
AttrMissing | "POST" | "post" | "GET" | "get" | "dialog" | "DIALOG";
|
|
932
926
|
/**
|
|
933
927
|
* The name attribute represents the form's name within the forms collection.
|
|
934
928
|
* @see https://html.spec.whatwg.org/multipage/forms.html#attr-form-name
|
|
@@ -2645,12 +2639,7 @@ declare global {
|
|
|
2645
2639
|
* @see https://svgwg.org/specs/animations/#AnimateTransformElementTypeAttribute
|
|
2646
2640
|
*/
|
|
2647
2641
|
type?:
|
|
2648
|
-
|
|
|
2649
|
-
| "translate"
|
|
2650
|
-
| "scale"
|
|
2651
|
-
| "rotate"
|
|
2652
|
-
| "skewX"
|
|
2653
|
-
| "skewY";
|
|
2642
|
+
AttrMissing | "translate" | "scale" | "rotate" | "skewX" | "skewY";
|
|
2654
2643
|
}
|
|
2655
2644
|
|
|
2656
2645
|
/**
|
|
@@ -3577,11 +3566,7 @@ declare global {
|
|
|
3577
3566
|
* @see https://www.w3.org/TR/SVG2/painting.html#OrientAttribute
|
|
3578
3567
|
*/
|
|
3579
3568
|
orient?:
|
|
3580
|
-
|
|
|
3581
|
-
| "auto"
|
|
3582
|
-
| "auto-start-reverse"
|
|
3583
|
-
| number
|
|
3584
|
-
| (string & {});
|
|
3569
|
+
AttrMissing | "auto" | "auto-start-reverse" | number | (string & {});
|
|
3585
3570
|
}
|
|
3586
3571
|
|
|
3587
3572
|
/**
|
|
@@ -3701,9 +3686,7 @@ declare global {
|
|
|
3701
3686
|
* @see https://www.w3.org/TR/SVG2/pservers.html#PatternElementPatternContentUnitsAttribute
|
|
3702
3687
|
*/
|
|
3703
3688
|
patternContentUnits?:
|
|
3704
|
-
|
|
|
3705
|
-
| "userSpaceOnUse"
|
|
3706
|
-
| "objectBoundingBox";
|
|
3689
|
+
AttrMissing | "userSpaceOnUse" | "objectBoundingBox";
|
|
3707
3690
|
|
|
3708
3691
|
/**
|
|
3709
3692
|
* @see https://www.w3.org/TR/SVG2/pservers.html#PatternElementPatternTransformAttribute
|
|
@@ -3951,23 +3934,13 @@ declare global {
|
|
|
3951
3934
|
* @see https://www.w3.org/TR/SVG2/struct.html#SymbolElementRefXAttribute
|
|
3952
3935
|
*/
|
|
3953
3936
|
refX?:
|
|
3954
|
-
|
|
|
3955
|
-
| "left"
|
|
3956
|
-
| "center"
|
|
3957
|
-
| "right"
|
|
3958
|
-
| number
|
|
3959
|
-
| (string & {});
|
|
3937
|
+
AttrMissing | "left" | "center" | "right" | number | (string & {});
|
|
3960
3938
|
|
|
3961
3939
|
/**
|
|
3962
3940
|
* @see https://www.w3.org/TR/SVG2/struct.html#SymbolElementRefYAttribute
|
|
3963
3941
|
*/
|
|
3964
3942
|
refY?:
|
|
3965
|
-
|
|
|
3966
|
-
| "top"
|
|
3967
|
-
| "center"
|
|
3968
|
-
| "bottom"
|
|
3969
|
-
| number
|
|
3970
|
-
| (string & {});
|
|
3943
|
+
AttrMissing | "top" | "center" | "bottom" | number | (string & {});
|
|
3971
3944
|
|
|
3972
3945
|
/**
|
|
3973
3946
|
* @see https://www.w3.org/TR/SVG2/geometry.html#XProperty
|
|
@@ -4197,11 +4170,7 @@ declare global {
|
|
|
4197
4170
|
* @see https://html.spec.whatwg.org/multipage/interaction.html#attr-autocapitalize
|
|
4198
4171
|
*/
|
|
4199
4172
|
autocapitalize?:
|
|
4200
|
-
|
|
|
4201
|
-
| "characters"
|
|
4202
|
-
| "none"
|
|
4203
|
-
| "sentences"
|
|
4204
|
-
| "words";
|
|
4173
|
+
AttrOnOff | "characters" | "none" | "sentences" | "words";
|
|
4205
4174
|
|
|
4206
4175
|
/**
|
|
4207
4176
|
* Indicates whether the element should automatically get focus when the page loads.
|
|
@@ -4470,16 +4439,13 @@ declare global {
|
|
|
4470
4439
|
color?: AttrMissing | csstype.Property.Color;
|
|
4471
4440
|
"color-interpolation"?: AttrMissing | csstype.Property.ColorInterpolation;
|
|
4472
4441
|
"color-interpolation-filters"?:
|
|
4473
|
-
|
|
|
4474
|
-
| csstype.Property.ColorInterpolation;
|
|
4442
|
+
AttrMissing | csstype.Property.ColorInterpolation;
|
|
4475
4443
|
"color-rendering"?: AttrMissing | csstype.Property.ColorRendering;
|
|
4476
4444
|
cursor?: AttrMissing | csstype.Property.Cursor;
|
|
4477
4445
|
direction?: AttrMissing | csstype.Property.Direction;
|
|
4478
4446
|
display?: AttrMissing | csstype.Property.Display;
|
|
4479
4447
|
"dominant-baseline"?:
|
|
4480
|
-
|
|
|
4481
|
-
| csstype.Property.DominantBaseline
|
|
4482
|
-
| number;
|
|
4448
|
+
AttrMissing | csstype.Property.DominantBaseline | number;
|
|
4483
4449
|
/**
|
|
4484
4450
|
* @see https://www.w3.org/TR/SVG11/filters.html#EnableBackgroundProperty
|
|
4485
4451
|
*/
|
|
@@ -4494,19 +4460,15 @@ declare global {
|
|
|
4494
4460
|
"font-family"?: AttrMissing | csstype.Property.FontFamily;
|
|
4495
4461
|
"font-size"?: AttrMissing | csstype.Property.FontSize | number;
|
|
4496
4462
|
"font-size-adjust"?:
|
|
4497
|
-
|
|
|
4498
|
-
| csstype.Property.FontSizeAdjust
|
|
4499
|
-
| number;
|
|
4463
|
+
AttrMissing | csstype.Property.FontSizeAdjust | number;
|
|
4500
4464
|
"font-stretch"?: AttrMissing | csstype.Property.FontStretch;
|
|
4501
4465
|
"font-style"?: AttrMissing | csstype.Property.FontStyle;
|
|
4502
4466
|
"font-variant"?: AttrMissing | csstype.Property.FontVariant;
|
|
4503
4467
|
"font-weight"?: AttrMissing | csstype.Property.FontWeight | number;
|
|
4504
4468
|
"glyph-orientation-horizontal"?:
|
|
4505
|
-
|
|
|
4506
|
-
| csstype.Property.GlyphOrientationVertical;
|
|
4469
|
+
AttrMissing | csstype.Property.GlyphOrientationVertical;
|
|
4507
4470
|
"glyph-orientation-vertical"?:
|
|
4508
|
-
|
|
|
4509
|
-
| csstype.Property.GlyphOrientationVertical;
|
|
4471
|
+
AttrMissing | csstype.Property.GlyphOrientationVertical;
|
|
4510
4472
|
"image-rendering"?: AttrMissing | csstype.Property.ImageRendering;
|
|
4511
4473
|
isolation?: AttrMissing | csstype.Property.Isolation;
|
|
4512
4474
|
kerning?: AttrMissing | csstype.Property.FontKerning | number;
|
|
@@ -4526,19 +4488,13 @@ declare global {
|
|
|
4526
4488
|
"stop-opacity"?: AttrMissing | csstype.Property.StopOpacity | number;
|
|
4527
4489
|
stroke?: AttrMissing | csstype.Property.Stroke;
|
|
4528
4490
|
"stroke-dasharray"?:
|
|
4529
|
-
|
|
|
4530
|
-
| csstype.Property.StrokeDasharray
|
|
4531
|
-
| number;
|
|
4491
|
+
AttrMissing | csstype.Property.StrokeDasharray | number;
|
|
4532
4492
|
"stroke-dashoffset"?:
|
|
4533
|
-
|
|
|
4534
|
-
| csstype.Property.StrokeDashoffset
|
|
4535
|
-
| number;
|
|
4493
|
+
AttrMissing | csstype.Property.StrokeDashoffset | number;
|
|
4536
4494
|
"stroke-linecap"?: AttrMissing | csstype.Property.StrokeLinecap;
|
|
4537
4495
|
"stroke-linejoin"?: AttrMissing | csstype.Property.StrokeLinejoin;
|
|
4538
4496
|
"stroke-miterlimit"?:
|
|
4539
|
-
|
|
|
4540
|
-
| csstype.Property.StrokeMiterlimit
|
|
4541
|
-
| number;
|
|
4497
|
+
AttrMissing | csstype.Property.StrokeMiterlimit | number;
|
|
4542
4498
|
"stroke-opacity"?: AttrMissing | csstype.Property.StrokeOpacity | number;
|
|
4543
4499
|
"stroke-width"?: AttrMissing | csstype.Property.StrokeWidth | number;
|
|
4544
4500
|
"text-anchor"?: AttrMissing | csstype.Property.TextAnchor;
|
|
@@ -5596,13 +5552,7 @@ interface CommonAttributes<T extends Element> {
|
|
|
5596
5552
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-current
|
|
5597
5553
|
*/
|
|
5598
5554
|
"aria-current"?:
|
|
5599
|
-
|
|
|
5600
|
-
| "date"
|
|
5601
|
-
| "location"
|
|
5602
|
-
| "page"
|
|
5603
|
-
| "step"
|
|
5604
|
-
| "time"
|
|
5605
|
-
| "true";
|
|
5555
|
+
AttrBooleanString | "date" | "location" | "page" | "step" | "time" | "true";
|
|
5606
5556
|
/**
|
|
5607
5557
|
* Identifies the element (or elements) that describes the object.
|
|
5608
5558
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-describedby
|
|
@@ -5631,13 +5581,7 @@ interface CommonAttributes<T extends Element> {
|
|
|
5631
5581
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-dropeffect
|
|
5632
5582
|
* */
|
|
5633
5583
|
"aria-dropeffect"?:
|
|
5634
|
-
|
|
|
5635
|
-
| "copy"
|
|
5636
|
-
| "execute"
|
|
5637
|
-
| "link"
|
|
5638
|
-
| "move"
|
|
5639
|
-
| "none"
|
|
5640
|
-
| "popup";
|
|
5584
|
+
AttrMissing | "copy" | "execute" | "link" | "move" | "none" | "popup";
|
|
5641
5585
|
/**
|
|
5642
5586
|
* Identifies the element that provides an error message for the object.
|
|
5643
5587
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-errormessage
|
|
@@ -5667,12 +5611,7 @@ interface CommonAttributes<T extends Element> {
|
|
|
5667
5611
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
|
|
5668
5612
|
*/
|
|
5669
5613
|
"aria-haspopup"?:
|
|
5670
|
-
|
|
|
5671
|
-
| "dialog"
|
|
5672
|
-
| "grid"
|
|
5673
|
-
| "listbox"
|
|
5674
|
-
| "menu"
|
|
5675
|
-
| "tree";
|
|
5614
|
+
AttrBooleanString | "dialog" | "grid" | "listbox" | "menu" | "tree";
|
|
5676
5615
|
/**
|
|
5677
5616
|
* Indicates whether the element is exposed to an accessibility API.
|
|
5678
5617
|
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-hidden
|
|
@@ -5928,22 +5867,13 @@ interface CommonAttributes<T extends Element> {
|
|
|
5928
5867
|
}
|
|
5929
5868
|
type AttrMissing = undefined | null | false;
|
|
5930
5869
|
type AttrClass =
|
|
5931
|
-
| AttrMissing
|
|
5932
|
-
| string
|
|
5933
|
-
| AttrClass[]
|
|
5934
|
-
| Record<string, AttrMissing | boolean>;
|
|
5870
|
+
AttrMissing | string | AttrClass[] | Record<string, AttrMissing | boolean>;
|
|
5935
5871
|
type AttrStyle = AttrMissing | string | Marko.CSS.Properties | AttrStyle[];
|
|
5936
5872
|
type AttrCrossOrigin = AttrBoolean | "anonymous" | "use-credentials";
|
|
5937
5873
|
type AttrEventHandler<Event, Target> =
|
|
5938
|
-
|
|
|
5939
|
-
| ((event: Event, target: Target) => unknown);
|
|
5874
|
+
AttrMissing | ((event: Event, target: Target) => unknown);
|
|
5940
5875
|
type AttrTarget =
|
|
5941
|
-
|
|
|
5942
|
-
| "_blank"
|
|
5943
|
-
| "_parent"
|
|
5944
|
-
| "_self"
|
|
5945
|
-
| "_top"
|
|
5946
|
-
| (string & {});
|
|
5876
|
+
AttrMissing | "_blank" | "_parent" | "_self" | "_top" | (string & {});
|
|
5947
5877
|
type AttrReferrerPolicy =
|
|
5948
5878
|
| AttrMissing
|
|
5949
5879
|
| "no-referrer-when-downgrade"
|
|
@@ -5973,13 +5903,7 @@ type AttrHref =
|
|
|
5973
5903
|
* so any URL is accepted while suggesting common prefixes in autocomplete.
|
|
5974
5904
|
*/
|
|
5975
5905
|
type AttrSrc =
|
|
5976
|
-
|
|
|
5977
|
-
| "/"
|
|
5978
|
-
| "./"
|
|
5979
|
-
| "https://"
|
|
5980
|
-
| "data:"
|
|
5981
|
-
| "blob:"
|
|
5982
|
-
| (string & {});
|
|
5906
|
+
AttrMissing | "/" | "./" | "https://" | "data:" | "blob:" | (string & {});
|
|
5983
5907
|
/**
|
|
5984
5908
|
* MIME type for type, codetype, and enctype attributes. Use (string & {}) so
|
|
5985
5909
|
* any MIME type is accepted while suggesting common values in autocomplete.
|