marko 6.4.9 → 6.4.10
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/cheatsheet.md +1 -1
- package/dist/debug/dom/catch.feat.js +2 -3
- package/dist/debug/dom/catch.feat.mjs +2 -3
- package/dist/debug/dom/controllable-input.feat.js +2 -3
- package/dist/debug/dom/controllable-input.feat.mjs +2 -3
- package/dist/debug/dom/controllable-open.feat.js +2 -3
- package/dist/debug/dom/controllable-open.feat.mjs +2 -3
- package/dist/debug/dom/controllable-select.feat.js +2 -3
- package/dist/debug/dom/controllable-select.feat.mjs +2 -3
- package/dist/debug/dom/controllable-textarea.feat.js +2 -3
- package/dist/debug/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/debug/dom/controllable.feat.js +2 -3
- package/dist/debug/dom/controllable.feat.mjs +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/debug/dom/lazy.feat.js +2 -3
- package/dist/debug/dom/lazy.feat.mjs +2 -3
- package/dist/debug/dom/placeholder.feat.js +2 -3
- package/dist/debug/dom/placeholder.feat.mjs +2 -3
- package/dist/debug/{dom-VKjkbuuo.mjs → dom-C1V5vpFs.mjs} +24 -48
- package/dist/debug/{dom-QkYva5Qx.js → dom-DNB5yq3U.js} +24 -48
- package/dist/debug/dom.js +6 -11
- package/dist/debug/dom.mjs +6 -11
- package/dist/debug/html.js +19 -38
- package/dist/debug/html.mjs +19 -38
- package/dist/dom/catch.feat.js +2 -3
- package/dist/dom/catch.feat.mjs +2 -3
- package/dist/dom/controllable-input.feat.js +1 -2
- package/dist/dom/controllable-input.feat.mjs +1 -2
- package/dist/dom/controllable-open.feat.js +2 -3
- package/dist/dom/controllable-open.feat.mjs +2 -3
- package/dist/dom/controllable-select.feat.js +2 -3
- package/dist/dom/controllable-select.feat.mjs +2 -3
- package/dist/dom/controllable-textarea.feat.js +2 -3
- package/dist/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/dom/controllable.feat.js +1 -2
- package/dist/dom/controllable.feat.mjs +1 -2
- package/dist/dom/dynamic-tag-script.feat.js +2 -3
- package/dist/dom/dynamic-tag-script.feat.mjs +2 -3
- package/dist/dom/dynamic-tag-var.feat.js +1 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -2
- package/dist/dom/lazy.feat.js +2 -3
- package/dist/dom/lazy.feat.mjs +2 -3
- package/dist/dom/placeholder.feat.js +2 -3
- package/dist/dom/placeholder.feat.mjs +2 -3
- package/dist/{dom-IujlfJ6b.js → dom-C2-Flitp.js} +40 -60
- package/dist/{dom-DtKQb840.mjs → dom-DsHYWMCR.mjs} +40 -61
- package/dist/dom.js +6 -10
- package/dist/dom.mjs +6 -11
- package/dist/html.js +39 -59
- package/dist/html.mjs +39 -60
- package/dist/translator/index.js +222 -355
- package/dist/translator/util/assert.d.ts +9 -2
- package/dist/translator/util/known-tag.d.ts +3 -0
- package/dist/translator/util/sources.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +3 -0
- package/package.json +6 -6
- package/tags/lifecycle.d.marko +2 -0
package/dist/html.mjs
CHANGED
|
@@ -425,7 +425,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
425
425
|
return !!pendingClassFunctions.get($global)?.length;
|
|
426
426
|
}
|
|
427
427
|
}, pendingClassFunctions = /* @__PURE__ */ new WeakMap();
|
|
428
|
-
|
|
428
|
+
// src/common/attr-tag.ts
|
|
429
429
|
function attrTag(attrs) {
|
|
430
430
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
431
431
|
}
|
|
@@ -435,8 +435,7 @@ function attrTags(first, attrs) {
|
|
|
435
435
|
function* attrTagIterator() {
|
|
436
436
|
yield this, yield* this[rest];
|
|
437
437
|
}
|
|
438
|
-
|
|
439
|
-
//#region src/common/helpers.ts
|
|
438
|
+
// src/common/helpers.ts
|
|
440
439
|
function stringifyClassEntry(name, value) {
|
|
441
440
|
return value ? name : "";
|
|
442
441
|
}
|
|
@@ -477,15 +476,13 @@ function normalizeDynamicRenderer(value) {
|
|
|
477
476
|
if ("a" in normalized) return normalized;
|
|
478
477
|
}
|
|
479
478
|
}
|
|
480
|
-
|
|
481
|
-
//#region src/common/errors.ts
|
|
479
|
+
// src/common/errors.ts
|
|
482
480
|
function _assert_class_toggles(classes, toggles) {}
|
|
483
481
|
function _el_read_error() {}
|
|
484
482
|
function _hoist_read_error() {}
|
|
485
483
|
function _signal_read_error() {}
|
|
486
484
|
function _assert_hoist(value) {}
|
|
487
|
-
|
|
488
|
-
//#region src/common/opt.ts
|
|
485
|
+
// src/common/opt.ts
|
|
489
486
|
function reduce(opt, cb, acc) {
|
|
490
487
|
if (opt) {
|
|
491
488
|
if (Array.isArray(opt)) for (let item of opt) acc = cb(acc, item);
|
|
@@ -1278,8 +1275,7 @@ function patchIteratorNext(proto) {
|
|
|
1278
1275
|
return this[kTouchedIterator] = 1, next.call(this, value);
|
|
1279
1276
|
}, proto.next[kTouchedIterator] = !0;
|
|
1280
1277
|
}
|
|
1281
|
-
|
|
1282
|
-
//#region src/html/attrs.ts
|
|
1278
|
+
// src/html/attrs.ts
|
|
1283
1279
|
function _attr_class(value) {
|
|
1284
1280
|
return stringAttr("class", toDelimitedString(value, " ", stringifyClassEntry));
|
|
1285
1281
|
}
|
|
@@ -1435,10 +1431,8 @@ function normalizedValueMatches(a, b) {
|
|
|
1435
1431
|
function normalizeStrAttrValue(value) {
|
|
1436
1432
|
return isNotNullishOrFalse(value) && value !== !0 ? value + "" : "";
|
|
1437
1433
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
//#endregion
|
|
1441
|
-
//#region src/html/writer.ts
|
|
1434
|
+
// src/html/inlined-runtimes.ts
|
|
1435
|
+
// src/html/writer.ts
|
|
1442
1436
|
function getChunk() {
|
|
1443
1437
|
return $chunk;
|
|
1444
1438
|
}
|
|
@@ -2078,8 +2072,7 @@ function flushTickQueue() {
|
|
|
2078
2072
|
});
|
|
2079
2073
|
}
|
|
2080
2074
|
}
|
|
2081
|
-
|
|
2082
|
-
//#region src/html/content.ts
|
|
2075
|
+
// src/html/content.ts
|
|
2083
2076
|
function _to_text(val) {
|
|
2084
2077
|
return val || val === 0 ? val + "" : "";
|
|
2085
2078
|
}
|
|
@@ -2104,16 +2097,14 @@ function escapeCommentStr(str) {
|
|
|
2104
2097
|
function _escape_comment(val) {
|
|
2105
2098
|
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
2106
2099
|
}
|
|
2107
|
-
|
|
2108
|
-
//#region src/html/dynamic-tag.ts
|
|
2100
|
+
// src/html/dynamic-tag.ts
|
|
2109
2101
|
function _content(id, fn, scopeId) {
|
|
2110
2102
|
return fn.a = id, fn.e = scopeId, fn;
|
|
2111
2103
|
}
|
|
2112
2104
|
function _content_resume(id, fn, scopeId, locals) {
|
|
2113
2105
|
return _resume(_content(id, fn, scopeId), id, scopeId, locals);
|
|
2114
2106
|
}
|
|
2115
|
-
|
|
2116
|
-
//#region src/html/template.ts
|
|
2107
|
+
// src/html/template.ts
|
|
2117
2108
|
function render(input = {}) {
|
|
2118
2109
|
return startRender(this, input, State);
|
|
2119
2110
|
}
|
|
@@ -2259,30 +2250,29 @@ var ServerRendered = class {
|
|
|
2259
2250
|
return;
|
|
2260
2251
|
}
|
|
2261
2252
|
let { boundary } = head, onNext = boundary.onNext = (write) => {
|
|
2262
|
-
if (flushing)
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
if (status === 2) {
|
|
2271
|
-
tick || offTick(onNext), settle(boundary), onAbort(boundary.reason);
|
|
2272
|
-
return;
|
|
2273
|
-
}
|
|
2274
|
-
if (write || status === 0) {
|
|
2275
|
-
if (head = head.consume(boundary), boundary.aborted) continue;
|
|
2276
|
-
let html = head.flushHTML(boundary);
|
|
2277
|
-
if (boundary.aborted) continue;
|
|
2278
|
-
if (html && onWrite(html), !boundary.count) {
|
|
2279
|
-
tick || offTick(onNext), settle(boundary), onClose();
|
|
2253
|
+
if (flushing) again = !0;
|
|
2254
|
+
else {
|
|
2255
|
+
flushing = !0;
|
|
2256
|
+
do {
|
|
2257
|
+
again = !1;
|
|
2258
|
+
let status = boundary.flush();
|
|
2259
|
+
if (status === 2) {
|
|
2260
|
+
tick || offTick(onNext), settle(boundary), onAbort(boundary.reason);
|
|
2280
2261
|
return;
|
|
2281
2262
|
}
|
|
2282
|
-
write
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2263
|
+
if (write || status === 0) {
|
|
2264
|
+
if (head = head.consume(boundary), boundary.aborted) continue;
|
|
2265
|
+
let html = head.flushHTML(boundary);
|
|
2266
|
+
if (boundary.aborted) continue;
|
|
2267
|
+
if (html && onWrite(html), !boundary.count) {
|
|
2268
|
+
tick || offTick(onNext), settle(boundary), onClose();
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
write && (tick = !0);
|
|
2272
|
+
} else tick && (tick = !1, queueTick(onNext));
|
|
2273
|
+
} while (again);
|
|
2274
|
+
flushing = !1;
|
|
2275
|
+
}
|
|
2286
2276
|
};
|
|
2287
2277
|
return onNext(), boundary;
|
|
2288
2278
|
}
|
|
@@ -2298,8 +2288,7 @@ function settle(boundary) {
|
|
|
2298
2288
|
boundary.onNext = NOOP$1, boundary.state.$global.signal?.removeEventListener("abort", boundary);
|
|
2299
2289
|
}
|
|
2300
2290
|
function NOOP$1() {}
|
|
2301
|
-
|
|
2302
|
-
//#region src/html/assets.ts
|
|
2291
|
+
// src/html/assets.ts
|
|
2303
2292
|
function withLoadAssets(template, id, flush, assetId, triggers) {
|
|
2304
2293
|
let renderer = (input) => (writeLoadAsset(assetId, flush, triggers), writeWaitReady(assetId, template(), input));
|
|
2305
2294
|
return _template(id, renderer), renderer;
|
|
@@ -2380,10 +2369,8 @@ function toObjectExpression(options) {
|
|
|
2380
2369
|
for (let key in options) Object.hasOwn(options, key) && (result += sep + toObjectKey(key) + ":" + JSON.stringify(options[key]), sep = ",");
|
|
2381
2370
|
return result + "}";
|
|
2382
2371
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
//#endregion
|
|
2386
|
-
//#region src/common/for.ts
|
|
2372
|
+
// src/common/compat-meta.ts
|
|
2373
|
+
// src/common/for.ts
|
|
2387
2374
|
function forIn(obj, cb) {
|
|
2388
2375
|
for (let key in obj) cb(key, obj[key]);
|
|
2389
2376
|
}
|
|
@@ -2401,8 +2388,7 @@ function forUntil(until, from, step, cb) {
|
|
|
2401
2388
|
let start = from || 0, delta = step || 1;
|
|
2402
2389
|
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
2403
2390
|
}
|
|
2404
|
-
|
|
2405
|
-
//#region src/html/for.ts
|
|
2391
|
+
// src/html/for.ts
|
|
2406
2392
|
function forOfBy(by, item, index) {
|
|
2407
2393
|
return by ? typeof by == "string" ? item[by] : by(item, index) : index;
|
|
2408
2394
|
}
|
|
@@ -2412,8 +2398,7 @@ function forInBy(by, name, value) {
|
|
|
2412
2398
|
function forStepBy(by, index) {
|
|
2413
2399
|
return by ? by(index) : index;
|
|
2414
2400
|
}
|
|
2415
|
-
|
|
2416
|
-
//#region src/html/control-flow.ts
|
|
2401
|
+
// src/html/control-flow.ts
|
|
2417
2402
|
function _show_start(display, markerGuard, branchExprGuard, parentEndTag) {
|
|
2418
2403
|
display ? resumesMarker(markerGuard, branchExprGuard, parentEndTag) && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
|
|
2419
2404
|
}
|
|
@@ -2525,17 +2510,13 @@ function _try(scopeId, accessor, content, placeholderContent, catchContent, plac
|
|
|
2525
2510
|
}
|
|
2526
2511
|
function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBranchId) {
|
|
2527
2512
|
let chunk = $chunk, { boundary } = chunk, body = chunk.fork(boundary, null);
|
|
2528
|
-
|
|
2529
|
-
chunk.append(body);
|
|
2530
|
-
return;
|
|
2531
|
-
}
|
|
2532
|
-
chunk.next = chunk.forkRest(boundary), captureContext(chunk), chunk.placeholder = {
|
|
2513
|
+
body === body.render(content) ? chunk.append(body) : (chunk.next = chunk.forkRest(boundary), captureContext(chunk), chunk.placeholder = {
|
|
2533
2514
|
body,
|
|
2534
2515
|
render: placeholder,
|
|
2535
2516
|
branchId,
|
|
2536
2517
|
scopeId,
|
|
2537
2518
|
placeholderBranchId
|
|
2538
|
-
};
|
|
2519
|
+
});
|
|
2539
2520
|
}
|
|
2540
2521
|
function tryBoundary(content, catchContent, branchId, renderers) {
|
|
2541
2522
|
let chunk = $chunk, { boundary } = chunk, { state } = boundary, bodyBoundary = new Boundary(state, void 0, boundary);
|
|
@@ -2588,8 +2569,7 @@ function writeTryRenderers(branchId, catchContent, placeholderContent) {
|
|
|
2588
2569
|
Q: placeholderContent
|
|
2589
2570
|
});
|
|
2590
2571
|
}
|
|
2591
|
-
|
|
2592
|
-
//#region src/html/compat.ts
|
|
2572
|
+
// src/html/compat.ts
|
|
2593
2573
|
function drainClassFunctions($global, writeScope) {
|
|
2594
2574
|
let pending = pendingClassFunctions.get($global), scopeByHost = {};
|
|
2595
2575
|
for (let [id, fn, hostId] of pending) register(id, fn, scopeByHost[hostId] ||= writeScope(hostId));
|
|
@@ -2600,5 +2580,4 @@ function swapReorders(state, reorders) {
|
|
|
2600
2580
|
return state.writeReorders = reorders, writeReorders;
|
|
2601
2581
|
}
|
|
2602
2582
|
function NOOP() {}
|
|
2603
|
-
//#endregion
|
|
2604
2583
|
export { $global, _assert_class_toggles, _assert_hoist, _attr, _attr_and, _attr_class, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _await, _content, _content_resume, _dynamic_tag, _el, _el_mark, _el_read_error, _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _html_mark, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _set_scope_reason, _show_end, _show_start, _signal_read_error, _style_html, _subscribe, _template, _text_mark, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, _write_guard, _write_if, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
|