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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// src/common/constants/accessor-prefix.debug.ts
|
|
3
3
|
const BranchScopes$1 = "BranchScopes:";
|
|
4
4
|
const ClosureScopes = "ClosureScopes:";
|
|
5
5
|
const ClosureSignalIndex = "ClosureSignalIndex:";
|
|
@@ -16,8 +16,7 @@ const Lifecycle = "Lifecycle:";
|
|
|
16
16
|
const Promise$1 = "Promise:";
|
|
17
17
|
const TagVariableChange$1 = "TagVariableChange:";
|
|
18
18
|
const TryBranch$1 = "TryBranch:";
|
|
19
|
-
|
|
20
|
-
//#region src/common/constants/accessor-prop.debug.ts
|
|
19
|
+
// src/common/constants/accessor-prop.debug.ts
|
|
21
20
|
const Global = "$global";
|
|
22
21
|
const AbortControllers = "#AbortControllers";
|
|
23
22
|
const AbortScopes = "#AbortScopes";
|
|
@@ -47,16 +46,13 @@ const Subscriptions = "#Subscriptions";
|
|
|
47
46
|
const TagVariable = "#TagVariable";
|
|
48
47
|
const TagVariableChange = "#TagVariableChange";
|
|
49
48
|
const TryBranch = "#TryBranch";
|
|
50
|
-
|
|
51
|
-
//#region src/common/constants/closure-scopes-prop.debug.ts
|
|
49
|
+
// src/common/constants/closure-scopes-prop.debug.ts
|
|
52
50
|
const Changed = "Changed";
|
|
53
|
-
|
|
54
|
-
//#region src/common/constants/closure-signal-prop.debug.ts
|
|
51
|
+
// src/common/constants/closure-signal-prop.debug.ts
|
|
55
52
|
const ScopesAccessor = "scopesAccessor";
|
|
56
53
|
const SignalIndexAccessor = "signalIndexAccessor";
|
|
57
54
|
const Index = "index";
|
|
58
|
-
|
|
59
|
-
//#region src/common/constants/keyed-scopes-prop.debug.ts
|
|
55
|
+
// src/common/constants/keyed-scopes-prop.debug.ts
|
|
60
56
|
const PreviousKey = "PreviousKey:";
|
|
61
57
|
const Scope = "scope";
|
|
62
58
|
const Signal = "signal";
|
|
@@ -70,8 +66,7 @@ const Accessor = "accessor";
|
|
|
70
66
|
const LocalClosures = "localClosures";
|
|
71
67
|
const Returns = "returns";
|
|
72
68
|
const Lazy = "lazy";
|
|
73
|
-
|
|
74
|
-
//#region src/common/helpers.ts
|
|
69
|
+
// src/common/helpers.ts
|
|
75
70
|
const invalidNativeAttrNameReg = /^[^a-z_]|[^a-z0-9._:-]/i;
|
|
76
71
|
const knownWrongAttrs = {
|
|
77
72
|
className: "class",
|
|
@@ -195,8 +190,7 @@ function withDynamicHtml(runtime) {
|
|
|
195
190
|
dynamicHtmlEnabled = 1;
|
|
196
191
|
return runtime;
|
|
197
192
|
}
|
|
198
|
-
|
|
199
|
-
//#region src/common/errors.ts
|
|
193
|
+
// src/common/errors.ts
|
|
200
194
|
const lowercaseOnAttrReg = /^on[a-z]/;
|
|
201
195
|
function assertValidAttrValue(name, value) {
|
|
202
196
|
if (value && typeof value !== "string" && lowercaseOnAttrReg.test(name)) throw new Error(`The \`${name}\` attribute must be a string or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}". To attach an event listener, use the \`on${name[2].toUpperCase()}${name.slice(3)}\` event handler instead.`);
|
|
@@ -311,8 +305,7 @@ function joinWithAnd(a) {
|
|
|
311
305
|
default: return `${a.slice(0, -1).join(", ")}, and ${a[a.length - 1]}`;
|
|
312
306
|
}
|
|
313
307
|
}
|
|
314
|
-
|
|
315
|
-
//#region src/common/for.ts
|
|
308
|
+
// src/common/for.ts
|
|
316
309
|
function forIn(obj, cb) {
|
|
317
310
|
for (const key in obj) cb(key, obj[key]);
|
|
318
311
|
}
|
|
@@ -339,8 +332,7 @@ function forUntil(until, from, step, cb) {
|
|
|
339
332
|
const delta = step || 1;
|
|
340
333
|
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
341
334
|
}
|
|
342
|
-
|
|
343
|
-
//#region src/dom/queue.ts
|
|
335
|
+
// src/dom/queue.ts
|
|
344
336
|
let rendering;
|
|
345
337
|
let runId = 2;
|
|
346
338
|
let pendingEffects = [];
|
|
@@ -480,8 +472,7 @@ function runRenders(renders = pendingRenders) {
|
|
|
480
472
|
runRender(render);
|
|
481
473
|
}
|
|
482
474
|
}
|
|
483
|
-
|
|
484
|
-
//#region src/dom/abort-signal.ts
|
|
475
|
+
// src/dom/abort-signal.ts
|
|
485
476
|
function $signalReset(scope, id) {
|
|
486
477
|
const ctrl = scope[AbortControllers]?.[id];
|
|
487
478
|
if (ctrl) {
|
|
@@ -515,8 +506,7 @@ let subscriptionsEnabled;
|
|
|
515
506
|
function abort(ctrl) {
|
|
516
507
|
ctrl.abort();
|
|
517
508
|
}
|
|
518
|
-
|
|
519
|
-
//#region src/common/opt.ts
|
|
509
|
+
// src/common/opt.ts
|
|
520
510
|
function toArray(opt) {
|
|
521
511
|
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
522
512
|
}
|
|
@@ -529,8 +519,7 @@ function forEach(opt, cb) {
|
|
|
529
519
|
function push(opt, item) {
|
|
530
520
|
return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
|
|
531
521
|
}
|
|
532
|
-
|
|
533
|
-
//#region src/dom/event.ts
|
|
522
|
+
// src/dom/event.ts
|
|
534
523
|
function _on(element, type, handler) {
|
|
535
524
|
assertHandlerIsFunction("on" + type[0].toUpperCase() + type.slice(1), handler);
|
|
536
525
|
delegate(type, handleDelegated);
|
|
@@ -552,21 +541,18 @@ function handleDelegated(ev) {
|
|
|
552
541
|
}
|
|
553
542
|
delete ev.currentTarget;
|
|
554
543
|
}
|
|
555
|
-
|
|
556
|
-
//#region src/dom/parse-html.ts
|
|
544
|
+
// src/dom/parse-html.ts
|
|
557
545
|
const parsers = {};
|
|
558
546
|
function parseHTML(html, ns) {
|
|
559
547
|
const parser = parsers[ns] ||= document.createElementNS(ns, "template");
|
|
560
548
|
parser.innerHTML = html;
|
|
561
549
|
return parser.content || parser;
|
|
562
550
|
}
|
|
563
|
-
|
|
564
|
-
//#region src/common/meta.ts
|
|
551
|
+
// src/common/meta.ts
|
|
565
552
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
566
553
|
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
567
554
|
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
568
|
-
|
|
569
|
-
//#region src/dom/scope.ts
|
|
555
|
+
// src/dom/scope.ts
|
|
570
556
|
let nextScopeId = 1e6;
|
|
571
557
|
let collectingScopes;
|
|
572
558
|
function createScope($global, closestBranch) {
|
|
@@ -633,8 +619,7 @@ function detachBranch(branch) {
|
|
|
633
619
|
fragment.namespaceURI = branch[StartNode].parentNode.namespaceURI;
|
|
634
620
|
insertChildNodes(fragment, null, branch[StartNode], branch[EndNode]);
|
|
635
621
|
}
|
|
636
|
-
|
|
637
|
-
//#region src/dom/schedule.ts
|
|
622
|
+
// src/dom/schedule.ts
|
|
638
623
|
let runTask;
|
|
639
624
|
let isScheduled;
|
|
640
625
|
let channel;
|
|
@@ -666,8 +651,7 @@ function triggerMacroTask() {
|
|
|
666
651
|
}
|
|
667
652
|
channel.port2.postMessage(0);
|
|
668
653
|
}
|
|
669
|
-
|
|
670
|
-
//#region src/dom/signals.ts
|
|
654
|
+
// src/dom/signals.ts
|
|
671
655
|
function _let(id, fn) {
|
|
672
656
|
const valueAccessor = id.slice(0, id.lastIndexOf("/"));
|
|
673
657
|
id = +id.slice(id.lastIndexOf("/") + 1);
|
|
@@ -865,8 +849,7 @@ function _hoist(...path) {
|
|
|
865
849
|
function _hoist_resume(id, ...path) {
|
|
866
850
|
return _resumed[id] = _hoist(...path);
|
|
867
851
|
}
|
|
868
|
-
|
|
869
|
-
//#region src/dom/walker.ts
|
|
852
|
+
// src/dom/walker.ts
|
|
870
853
|
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
871
854
|
let currentNode;
|
|
872
855
|
function walk(startNode, walkCodes, branch) {
|
|
@@ -918,8 +901,7 @@ function getDebugKey(index, node) {
|
|
|
918
901
|
return index;
|
|
919
902
|
}
|
|
920
903
|
const walkNextSibling = (_) => currentNode = currentNode.nextSibling || currentNode;
|
|
921
|
-
|
|
922
|
-
//#region src/dom/resume.ts
|
|
904
|
+
// src/dom/resume.ts
|
|
923
905
|
const _resumed = {};
|
|
924
906
|
let curRenders;
|
|
925
907
|
let embedRenders;
|
|
@@ -1157,8 +1139,7 @@ function _dynamic_tag_var_resume(accessor) {
|
|
|
1157
1139
|
return _el_read(node.nodeType === 8 ? node.previousSibling : node);
|
|
1158
1140
|
};
|
|
1159
1141
|
}
|
|
1160
|
-
|
|
1161
|
-
//#region src/dom/renderer.ts
|
|
1142
|
+
// src/dom/renderer.ts
|
|
1162
1143
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
1163
1144
|
const branch = createScope($global);
|
|
1164
1145
|
branch["_"] = renderer["owner"] || parentScope;
|
|
@@ -1248,8 +1229,7 @@ function createCloneableHTML(html, ns) {
|
|
|
1248
1229
|
branch[EndNode] = clone.lastChild;
|
|
1249
1230
|
};
|
|
1250
1231
|
}
|
|
1251
|
-
|
|
1252
|
-
//#region src/dom/dom.ts
|
|
1232
|
+
// src/dom/dom.ts
|
|
1253
1233
|
function _to_text(value) {
|
|
1254
1234
|
assertValidTextValue(value);
|
|
1255
1235
|
return value || value === 0 ? value + "" : "";
|
|
@@ -1456,8 +1436,7 @@ function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
|
1456
1436
|
startNode = next;
|
|
1457
1437
|
}
|
|
1458
1438
|
}
|
|
1459
|
-
|
|
1460
|
-
//#region src/dom/resolve-cursor-position.ts
|
|
1439
|
+
// src/dom/resolve-cursor-position.ts
|
|
1461
1440
|
const R = /[\p{L}\p{N}]/gu;
|
|
1462
1441
|
function resolveCursorPosition(inputType, initialPosition, initialValue, updatedValue) {
|
|
1463
1442
|
if ((initialPosition || initialPosition === 0) && (initialPosition !== initialValue.length || /kw/.test(inputType))) {
|
|
@@ -1471,8 +1450,7 @@ function resolveCursorPosition(inputType, initialPosition, initialValue, updated
|
|
|
1471
1450
|
}
|
|
1472
1451
|
return -1;
|
|
1473
1452
|
}
|
|
1474
|
-
|
|
1475
|
-
//#region src/dom/controllable.ts
|
|
1453
|
+
// src/dom/controllable.ts
|
|
1476
1454
|
let inputType = "";
|
|
1477
1455
|
function _attr_input_checked_default(scope, nodeAccessor, checked) {
|
|
1478
1456
|
const el = scope[nodeAccessor];
|
|
@@ -1767,8 +1745,7 @@ function _controllable_open(scope, nodeAccessor, nextAttrs) {
|
|
|
1767
1745
|
return /^open(?:Change)?$/;
|
|
1768
1746
|
}
|
|
1769
1747
|
}
|
|
1770
|
-
|
|
1771
|
-
//#region src/dom/control-flow.ts
|
|
1748
|
+
// src/dom/control-flow.ts
|
|
1772
1749
|
function _await_promise(nodeAccessor, params) {
|
|
1773
1750
|
const promiseAccessor = Promise$1 + nodeAccessor;
|
|
1774
1751
|
const branchAccessor = BranchScopes$1 + nodeAccessor;
|
|
@@ -2234,7 +2211,6 @@ function bySecondArg(_item, index) {
|
|
|
2234
2211
|
function byFirstArg(name) {
|
|
2235
2212
|
return name;
|
|
2236
2213
|
}
|
|
2237
|
-
//#endregion
|
|
2238
2214
|
Object.defineProperty(exports, "$signal", {
|
|
2239
2215
|
enumerable: true,
|
|
2240
2216
|
get: function() {
|
package/dist/debug/dom.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
4
|
-
|
|
3
|
+
const require_control_flow = require("./dom-DNB5yq3U.js");
|
|
4
|
+
// src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
|
7
7
|
function attrTag(attrs) {
|
|
@@ -21,12 +21,10 @@ function* attrTagIterator() {
|
|
|
21
21
|
yield this;
|
|
22
22
|
yield* this[rest];
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/common/compat-meta.ts
|
|
24
|
+
// src/common/compat-meta.ts
|
|
26
25
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
27
26
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
28
|
-
|
|
29
|
-
//#region src/dom/compat.ts
|
|
27
|
+
// src/dom/compat.ts
|
|
30
28
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
31
29
|
let classEventResolver;
|
|
32
30
|
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
@@ -120,8 +118,7 @@ const compat = {
|
|
|
120
118
|
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
121
119
|
}
|
|
122
120
|
};
|
|
123
|
-
|
|
124
|
-
//#region src/dom/template.ts
|
|
121
|
+
// src/dom/template.ts
|
|
125
122
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
126
123
|
const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
|
|
127
124
|
renderer.mount = mount;
|
|
@@ -193,8 +190,7 @@ function mount(input = {}, reference, position) {
|
|
|
193
190
|
}
|
|
194
191
|
};
|
|
195
192
|
}
|
|
196
|
-
|
|
197
|
-
//#region src/dom/load.ts
|
|
193
|
+
// src/dom/load.ts
|
|
198
194
|
const noop = (_) => 0;
|
|
199
195
|
function _load_template(id, load) {
|
|
200
196
|
let pending;
|
|
@@ -294,7 +290,6 @@ function _load_race_trigger(...triggers) {
|
|
|
294
290
|
function getSelectorOrResolve(selector, resolve) {
|
|
295
291
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
296
292
|
}
|
|
297
|
-
//#endregion
|
|
298
293
|
exports.$signal = require_control_flow.$signal;
|
|
299
294
|
exports.$signalReset = require_control_flow.$signalReset;
|
|
300
295
|
exports._assert_class_toggles = require_control_flow._assert_class_toggles;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as _attr_style_items, A as _attr_input_value, An as Setup, At as _closure_get, B as _controllable_select, Bt as _let, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dn as Owner, Dt as readyFailed, E as _attr_input_checkedValue_default, En as LocalClosures, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gn as StartNode, Gt as _script, Ht as _or, I as _attr_select_value_default, In as EndNode, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kn as TagVariable, Kt as _var, L as _attr_select_value_script, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, On as Params, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rn as Global, Rt as _id, S as _attr_details_or_dialog_open_default, Sn as _call, St as _var_resume, T as _attr_input_checkedValue, Tn as Lazy, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as forTo, _t as createBranch, a as _for_in, at as _html, b as startAwait, bn as _assert_hoist, bt as _el, c as _for_to, cn as queueAsyncRender, ct as _style_shell, d as _for_until_unkeyed, dn as rendering, dt as _to_text, et as _attrs, f as _if, fn as run, ft as _content, gn as forOf, gt as createAndSetupBranch, hn as forIn, ht as _return_setup, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _const, k as _attr_input_checked_script, kt as _closure, l as _for_to_unkeyed, ln as queueEffect, lt as _text, m as _try, mn as runId, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as runEffects, pt as _content_closures, q as _attr_class_items, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as prepareEffects, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueRender, ut as _text_content, v as renderCatch, vn as forUntil, vt as setupBranch, w as _attr_input_checked, wn as Clone, wt as init, x as _attr_details_or_dialog_open, xn as _hoist_read_error, xt as _resumed, yn as _assert_class_toggles, yt as _dynamic_tag_var_resume, z as _controllable_open, zn as Load, zt as _if_closure } from "./dom-
|
|
2
|
-
|
|
1
|
+
import { $ as _attr_style_items, A as _attr_input_value, An as Setup, At as _closure_get, B as _controllable_select, Bt as _let, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dn as Owner, Dt as readyFailed, E as _attr_input_checkedValue_default, En as LocalClosures, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gn as StartNode, Gt as _script, Ht as _or, I as _attr_select_value_default, In as EndNode, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kn as TagVariable, Kt as _var, L as _attr_select_value_script, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, On as Params, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rn as Global, Rt as _id, S as _attr_details_or_dialog_open_default, Sn as _call, St as _var_resume, T as _attr_input_checkedValue, Tn as Lazy, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as forTo, _t as createBranch, a as _for_in, at as _html, b as startAwait, bn as _assert_hoist, bt as _el, c as _for_to, cn as queueAsyncRender, ct as _style_shell, d as _for_until_unkeyed, dn as rendering, dt as _to_text, et as _attrs, f as _if, fn as run, ft as _content, gn as forOf, gt as createAndSetupBranch, hn as forIn, ht as _return_setup, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _const, k as _attr_input_checked_script, kt as _closure, l as _for_to_unkeyed, ln as queueEffect, lt as _text, m as _try, mn as runId, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as runEffects, pt as _content_closures, q as _attr_class_items, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as prepareEffects, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueRender, ut as _text_content, v as renderCatch, vn as forUntil, vt as setupBranch, w as _attr_input_checked, wn as Clone, wt as init, x as _attr_details_or_dialog_open, xn as _hoist_read_error, xt as _resumed, yn as _assert_class_toggles, yt as _dynamic_tag_var_resume, z as _controllable_open, zn as Load, zt as _if_closure } from "./dom-C1V5vpFs.mjs";
|
|
2
|
+
// src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
|
5
5
|
function attrTag(attrs) {
|
|
@@ -19,12 +19,10 @@ function* attrTagIterator() {
|
|
|
19
19
|
yield this;
|
|
20
20
|
yield* this[rest];
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region src/common/compat-meta.ts
|
|
22
|
+
// src/common/compat-meta.ts
|
|
24
23
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
25
24
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
26
|
-
|
|
27
|
-
//#region src/dom/compat.ts
|
|
25
|
+
// src/dom/compat.ts
|
|
28
26
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
29
27
|
let classEventResolver;
|
|
30
28
|
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
@@ -118,8 +116,7 @@ const compat = {
|
|
|
118
116
|
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
119
117
|
}
|
|
120
118
|
};
|
|
121
|
-
|
|
122
|
-
//#region src/dom/template.ts
|
|
119
|
+
// src/dom/template.ts
|
|
123
120
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
124
121
|
const renderer = _content(id, template, walks, setup, inputSignal)();
|
|
125
122
|
renderer.mount = mount;
|
|
@@ -191,8 +188,7 @@ function mount(input = {}, reference, position) {
|
|
|
191
188
|
}
|
|
192
189
|
};
|
|
193
190
|
}
|
|
194
|
-
|
|
195
|
-
//#region src/dom/load.ts
|
|
191
|
+
// src/dom/load.ts
|
|
196
192
|
const noop = (_) => 0;
|
|
197
193
|
function _load_template(id, load) {
|
|
198
194
|
let pending;
|
|
@@ -292,5 +288,4 @@ function _load_race_trigger(...triggers) {
|
|
|
292
288
|
function getSelectorOrResolve(selector, resolve) {
|
|
293
289
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
294
290
|
}
|
|
295
|
-
//#endregion
|
|
296
291
|
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
package/dist/debug/html.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
3
|
+
// src/common/attr-tag.ts
|
|
4
4
|
const empty = [];
|
|
5
5
|
const rest = Symbol("Attribute Tag");
|
|
6
6
|
function attrTag(attrs) {
|
|
@@ -20,8 +20,7 @@ function* attrTagIterator() {
|
|
|
20
20
|
yield this;
|
|
21
21
|
yield* this[rest];
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
//#region src/common/constants/accessor-prefix.debug.ts
|
|
23
|
+
// src/common/constants/accessor-prefix.debug.ts
|
|
25
24
|
const BranchScopes = "BranchScopes:";
|
|
26
25
|
const ConditionalRenderer = "ConditionalRenderer:";
|
|
27
26
|
const ControlledHandler = "ControlledHandler:";
|
|
@@ -38,8 +37,7 @@ const TagVariable = "#TagVariable";
|
|
|
38
37
|
const Owner = "owner";
|
|
39
38
|
const Embed = "embed";
|
|
40
39
|
const Lazy = "lazy";
|
|
41
|
-
|
|
42
|
-
//#region src/common/helpers.ts
|
|
40
|
+
// src/common/helpers.ts
|
|
43
41
|
const invalidNativeAttrNameReg = /^[^a-z_]|[^a-z0-9._:-]/i;
|
|
44
42
|
const knownWrongAttrs = {
|
|
45
43
|
className: "class",
|
|
@@ -156,8 +154,7 @@ function normalizeDynamicRenderer(value) {
|
|
|
156
154
|
if ("id" in normalized) return normalized;
|
|
157
155
|
}
|
|
158
156
|
}
|
|
159
|
-
|
|
160
|
-
//#region src/common/errors.ts
|
|
157
|
+
// src/common/errors.ts
|
|
161
158
|
const lowercaseOnAttrReg = /^on[a-z]/;
|
|
162
159
|
function assertValidAttrValue(name, value) {
|
|
163
160
|
if (value && typeof value !== "string" && lowercaseOnAttrReg.test(name)) throw new Error(`The \`${name}\` attribute must be a string or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}". To attach an event listener, use the \`on${name[2].toUpperCase()}${name.slice(3)}\` event handler instead.`);
|
|
@@ -275,13 +272,11 @@ function joinWithAnd(a) {
|
|
|
275
272
|
default: return `${a.slice(0, -1).join(", ")}, and ${a[a.length - 1]}`;
|
|
276
273
|
}
|
|
277
274
|
}
|
|
278
|
-
|
|
279
|
-
//#region src/common/meta.ts
|
|
275
|
+
// src/common/meta.ts
|
|
280
276
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
281
277
|
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
282
278
|
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
283
|
-
|
|
284
|
-
//#region src/common/opt.ts
|
|
279
|
+
// src/common/opt.ts
|
|
285
280
|
function reduce(opt, cb, acc) {
|
|
286
281
|
if (opt) {
|
|
287
282
|
if (Array.isArray(opt)) for (const item of opt) acc = cb(acc, item);
|
|
@@ -302,8 +297,7 @@ function concat(opt, other) {
|
|
|
302
297
|
}
|
|
303
298
|
return Array.isArray(other) ? [opt, ...other] : [opt, other];
|
|
304
299
|
}
|
|
305
|
-
|
|
306
|
-
//#region src/html/serializer.ts
|
|
300
|
+
// src/html/serializer.ts
|
|
307
301
|
const K_SCOPE_ID = Symbol("Scope ID");
|
|
308
302
|
const kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator");
|
|
309
303
|
const { hasOwnProperty } = {};
|
|
@@ -1842,8 +1836,7 @@ function patchIteratorNext(proto) {
|
|
|
1842
1836
|
};
|
|
1843
1837
|
proto.next[kTouchedIterator] = true;
|
|
1844
1838
|
}
|
|
1845
|
-
|
|
1846
|
-
//#region src/html/attrs.ts
|
|
1839
|
+
// src/html/attrs.ts
|
|
1847
1840
|
function _attr_class(value) {
|
|
1848
1841
|
return stringAttr("class", toDelimitedString(value, " ", stringifyClassEntry));
|
|
1849
1842
|
}
|
|
@@ -2075,8 +2068,7 @@ function normalizedValueMatches(a, b) {
|
|
|
2075
2068
|
function normalizeStrAttrValue(value) {
|
|
2076
2069
|
return isNotNullishOrFalse(value) && value !== true ? value + "" : "";
|
|
2077
2070
|
}
|
|
2078
|
-
|
|
2079
|
-
//#region src/html/inlined-runtimes.debug.ts
|
|
2071
|
+
// src/html/inlined-runtimes.debug.ts
|
|
2080
2072
|
const WALKER_RUNTIME_CODE = `((runtimeId) => (self[runtimeId] ||= (
|
|
2081
2073
|
renderId,
|
|
2082
2074
|
prefix = runtimeId + renderId,
|
|
@@ -2172,8 +2164,7 @@ const REORDER_RUNTIME_CODE = `((runtime) => {
|
|
|
2172
2164
|
}
|
|
2173
2165
|
};
|
|
2174
2166
|
})`;
|
|
2175
|
-
|
|
2176
|
-
//#region src/html/writer.ts
|
|
2167
|
+
// src/html/writer.ts
|
|
2177
2168
|
let $chunk;
|
|
2178
2169
|
function getChunk() {
|
|
2179
2170
|
return $chunk;
|
|
@@ -3119,8 +3110,7 @@ function flushTickQueue() {
|
|
|
3119
3110
|
});
|
|
3120
3111
|
}
|
|
3121
3112
|
}
|
|
3122
|
-
|
|
3123
|
-
//#region src/html/content.ts
|
|
3113
|
+
// src/html/content.ts
|
|
3124
3114
|
function _to_text(val) {
|
|
3125
3115
|
assertValidTextValue(val);
|
|
3126
3116
|
return val || val === 0 ? val + "" : "";
|
|
@@ -3164,8 +3154,7 @@ function _escape_comment(val) {
|
|
|
3164
3154
|
assertValidTextValue(val);
|
|
3165
3155
|
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
3166
3156
|
}
|
|
3167
|
-
|
|
3168
|
-
//#region src/html/dynamic-tag.ts
|
|
3157
|
+
// src/html/dynamic-tag.ts
|
|
3169
3158
|
const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
|
|
3170
3159
|
let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, markerGuard, tagVar) => {
|
|
3171
3160
|
const shouldResume = markerGuard !== 0;
|
|
@@ -3247,8 +3236,7 @@ const patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
|
|
|
3247
3236
|
return originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, markerGuard, tagVar);
|
|
3248
3237
|
};
|
|
3249
3238
|
})(_dynamic_tag);
|
|
3250
|
-
|
|
3251
|
-
//#region src/html/template.ts
|
|
3239
|
+
// src/html/template.ts
|
|
3252
3240
|
const CONSUMED_RESULT_MESSAGE = "Cannot read from a consumed render result";
|
|
3253
3241
|
const _template = (templateId, renderer, page) => {
|
|
3254
3242
|
renderer.render = render;
|
|
@@ -3512,8 +3500,7 @@ function settle(boundary) {
|
|
|
3512
3500
|
boundary.state.$global.signal?.removeEventListener("abort", boundary);
|
|
3513
3501
|
}
|
|
3514
3502
|
function NOOP$1() {}
|
|
3515
|
-
|
|
3516
|
-
//#region src/html/assets.ts
|
|
3503
|
+
// src/html/assets.ts
|
|
3517
3504
|
const kAssets = Symbol();
|
|
3518
3505
|
const kHead = Symbol();
|
|
3519
3506
|
function withLoadAssets(template, id, flush, assetId, triggers) {
|
|
@@ -3633,12 +3620,10 @@ function toObjectExpression(options) {
|
|
|
3633
3620
|
}
|
|
3634
3621
|
return result + "}";
|
|
3635
3622
|
}
|
|
3636
|
-
|
|
3637
|
-
//#region src/common/compat-meta.ts
|
|
3623
|
+
// src/common/compat-meta.ts
|
|
3638
3624
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
3639
3625
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
3640
|
-
|
|
3641
|
-
//#region src/common/for.ts
|
|
3626
|
+
// src/common/for.ts
|
|
3642
3627
|
function forIn(obj, cb) {
|
|
3643
3628
|
for (const key in obj) cb(key, obj[key]);
|
|
3644
3629
|
}
|
|
@@ -3665,8 +3650,7 @@ function forUntil(until, from, step, cb) {
|
|
|
3665
3650
|
const delta = step || 1;
|
|
3666
3651
|
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
3667
3652
|
}
|
|
3668
|
-
|
|
3669
|
-
//#region src/html/for.ts
|
|
3653
|
+
// src/html/for.ts
|
|
3670
3654
|
function forOfBy(by, item, index) {
|
|
3671
3655
|
return by ? typeof by === "string" ? item[by] : by(item, index) : index;
|
|
3672
3656
|
}
|
|
@@ -3676,8 +3660,7 @@ function forInBy(by, name, value) {
|
|
|
3676
3660
|
function forStepBy(by, index) {
|
|
3677
3661
|
return by ? by(index) : index;
|
|
3678
3662
|
}
|
|
3679
|
-
|
|
3680
|
-
//#region src/html/control-flow.ts
|
|
3663
|
+
// src/html/control-flow.ts
|
|
3681
3664
|
function _show_start(display, markerGuard, branchExprGuard, parentEndTag) {
|
|
3682
3665
|
if (display) {
|
|
3683
3666
|
if (resumesMarker(markerGuard, branchExprGuard, parentEndTag)) $chunk.writeHTML($chunk.boundary.state.mark("[", ""));
|
|
@@ -3957,8 +3940,7 @@ function writeTryRenderers(branchId, catchContent, placeholderContent) {
|
|
|
3957
3940
|
[PlaceholderContent]: placeholderContent
|
|
3958
3941
|
});
|
|
3959
3942
|
}
|
|
3960
|
-
|
|
3961
|
-
//#region src/html/compat.ts
|
|
3943
|
+
// src/html/compat.ts
|
|
3962
3944
|
const K_TAGS_API_STATE = Symbol();
|
|
3963
3945
|
const COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
|
|
3964
3946
|
const compat = {
|
|
@@ -4169,7 +4151,6 @@ function swapReorders(state, reorders) {
|
|
|
4169
4151
|
return writeReorders;
|
|
4170
4152
|
}
|
|
4171
4153
|
function NOOP() {}
|
|
4172
|
-
//#endregion
|
|
4173
4154
|
exports.$global = $global;
|
|
4174
4155
|
exports._assert_class_toggles = _assert_class_toggles;
|
|
4175
4156
|
exports._assert_hoist = _assert_hoist;
|