marko 6.4.2 → 6.4.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/cheatsheet.md +2 -2
- package/dist/common/constants/accessor-prop.d.ts +1 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +1 -0
- package/dist/common/constants/renderer-prop.d.ts +2 -0
- package/dist/common/constants/renderer-prop.debug.d.ts +2 -0
- package/dist/common/types.d.ts +1 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +10 -2
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +10 -2
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-Cii0IA92.mjs → dom-BeY1nGUb.mjs} +74 -36
- package/dist/debug/{dom-BLbR0hEx.js → dom-CUxvM4i9.js} +109 -35
- package/dist/debug/dom.js +3 -1
- package/dist/debug/dom.mjs +3 -2
- package/dist/debug/html.js +37 -23
- package/dist/debug/html.mjs +37 -23
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +3 -3
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +4 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +4 -3
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +4 -1
- package/dist/dom/renderer.d.ts +9 -2
- package/dist/{dom-BPjLe6YU.mjs → dom-DefWmvQB.mjs} +59 -32
- package/dist/{dom-B8UEYzOz.js → dom-Diu8MpmL.js} +132 -90
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +30 -30
- package/dist/dom.mjs +2 -2
- package/dist/html/assets.d.ts +1 -1
- package/dist/html/content.d.ts +1 -0
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/template.d.ts +1 -0
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +25 -15
- package/dist/html.mjs +25 -15
- package/dist/translator/index.js +141 -83
- package/dist/translator/util/module-registrations.d.ts +1 -1
- package/dist/translator/util/solve-reasons.d.ts +1 -0
- package/dist/translator/visitors/function.d.ts +15 -10
- package/dist/translator/visitors/import-declaration.d.ts +3 -4
- package/package.json +3 -3
- package/tags-html.d.ts +9 -7
package/dist/debug/html.mjs
CHANGED
|
@@ -35,6 +35,7 @@ const Renderer = "#Renderer";
|
|
|
35
35
|
const TagVariable = "#TagVariable";
|
|
36
36
|
const Owner = "owner";
|
|
37
37
|
const Embed = "embed";
|
|
38
|
+
const Lazy = "lazy";
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/common/helpers.ts
|
|
40
41
|
const htmlAttrNameReg = /^[^a-z_]|[^a-z0-9._:-]/i;
|
|
@@ -1851,10 +1852,7 @@ function _attr_option_value(value) {
|
|
|
1851
1852
|
const valueAttr = _attr("value", value);
|
|
1852
1853
|
const selectedValue = getContext(kSelectedValue);
|
|
1853
1854
|
if (selectedValue !== void 0 && normalizedValueMatches(selectedValue, value)) {
|
|
1854
|
-
|
|
1855
|
-
const matched = getContext(kSelectedValueMatched);
|
|
1856
|
-
if (matched) matched.value = true;
|
|
1857
|
-
}
|
|
1855
|
+
getContext(kSelectedValueMatched)?.add(normalizeStrAttrValue(value));
|
|
1858
1856
|
return valueAttr + " selected";
|
|
1859
1857
|
}
|
|
1860
1858
|
return valueAttr;
|
|
@@ -1866,9 +1864,12 @@ function _attr_select_value(scopeId, nodeAccessor, value, valueChange, content,
|
|
|
1866
1864
|
if (content) {
|
|
1867
1865
|
const selectedValue = value ?? "";
|
|
1868
1866
|
if (valueChange) {
|
|
1869
|
-
const matched =
|
|
1867
|
+
const matched = /* @__PURE__ */ new Set();
|
|
1870
1868
|
withContext(kSelectedValue, selectedValue, () => withContext(kSelectedValueMatched, matched, content));
|
|
1871
|
-
if (
|
|
1869
|
+
if ((Array.isArray(value) ? value : [value]).some((v) => {
|
|
1870
|
+
const str = normalizeStrAttrValue(v);
|
|
1871
|
+
return str !== "" && !matched.has(str);
|
|
1872
|
+
})) console.error("A controlled `<select>`'s `value` has no matching `<option>`:", value);
|
|
1872
1873
|
} else withContext(kSelectedValue, selectedValue, content);
|
|
1873
1874
|
}
|
|
1874
1875
|
}
|
|
@@ -2323,9 +2324,12 @@ function _attr_content(nodeAccessor, scopeId, content, markerGuard) {
|
|
|
2323
2324
|
const shouldResume = markerGuard !== 0;
|
|
2324
2325
|
const render = normalizeServerRender(content);
|
|
2325
2326
|
const branchId = _peek_scope_id();
|
|
2326
|
-
if (render) {
|
|
2327
|
+
if (render) try {
|
|
2328
|
+
_set_scope_reason(shouldResume ? CLIENT_ALL : 0);
|
|
2327
2329
|
if (shouldResume) withBranchId(branchId, render);
|
|
2328
2330
|
else render();
|
|
2331
|
+
} finally {
|
|
2332
|
+
_set_scope_reason(void 0);
|
|
2329
2333
|
}
|
|
2330
2334
|
if (_peek_scope_id() !== branchId) {
|
|
2331
2335
|
if (shouldResume) writeScope(scopeId, {
|
|
@@ -2670,7 +2674,7 @@ function tryBoundary(content, catchContent, branchId, renderers) {
|
|
|
2670
2674
|
if (!renderersAtSettle) catchChunk.render(clearTryRenderers, branchId);
|
|
2671
2675
|
const inOrder = catchChunk === catchChunk.render(catchContent, catchBoundary.reason);
|
|
2672
2676
|
if (boundary.aborted) return;
|
|
2673
|
-
if (bodyEnd.consumed || !inOrder) catchChunk.
|
|
2677
|
+
if (bodyEnd.consumed || !inOrder) catchChunk.reorderBranch = branchId;
|
|
2674
2678
|
if (bodyEnd.consumed) {
|
|
2675
2679
|
catchChunk.reorderId = reorderId;
|
|
2676
2680
|
state.reorder(catchChunk);
|
|
@@ -2878,7 +2882,7 @@ var Chunk = class Chunk {
|
|
|
2878
2882
|
async = false;
|
|
2879
2883
|
consumed = false;
|
|
2880
2884
|
reorderId = null;
|
|
2881
|
-
|
|
2885
|
+
reorderBranch = 0;
|
|
2882
2886
|
deferredReady = null;
|
|
2883
2887
|
heldEffects = null;
|
|
2884
2888
|
deferredReorder = null;
|
|
@@ -3136,7 +3140,8 @@ var Chunk = class Chunk {
|
|
|
3136
3140
|
state.hasReorderRuntime = true;
|
|
3137
3141
|
scripts = concatScripts(scripts, REORDER_RUNTIME_CODE + "(" + runtimePrefix + ")");
|
|
3138
3142
|
}
|
|
3139
|
-
const { reorderId,
|
|
3143
|
+
const { reorderId, reorderBranch } = reorderedChunk;
|
|
3144
|
+
const rootBranch = reorderBranch || +reorderId;
|
|
3140
3145
|
const readyReservations = [];
|
|
3141
3146
|
let reorderHTML = "";
|
|
3142
3147
|
let reorderEffects = "";
|
|
@@ -3164,7 +3169,8 @@ var Chunk = class Chunk {
|
|
|
3164
3169
|
reorderScripts = concatScripts(reorderScripts, concatScripts(readyResumeScripts, cur.scripts));
|
|
3165
3170
|
if (cur.async) {
|
|
3166
3171
|
reorderHTML += state.mark("#", cur.reorderId = state.nextReorderId());
|
|
3167
|
-
|
|
3172
|
+
const holeBranch = cur.context?.[kBranchId];
|
|
3173
|
+
cur.reorderBranch = holeBranch > rootBranch ? holeBranch : reorderBranch;
|
|
3168
3174
|
(cur.boundary.pendingReorders ||= /* @__PURE__ */ new Set()).add(cur);
|
|
3169
3175
|
cur.html = cur.effects = cur.scripts = cur.lastEffect = "";
|
|
3170
3176
|
cur.next = null;
|
|
@@ -3180,7 +3186,7 @@ var Chunk = class Chunk {
|
|
|
3180
3186
|
}
|
|
3181
3187
|
for (const reservation of readyReservations) reordered = concatScripts(reordered, reservation);
|
|
3182
3188
|
reordered = concatScripts(reordered, reorderScripts && runtimePrefix + ".j" + toAccess(reorderId) + "=_=>{" + reorderScripts + "}");
|
|
3183
|
-
html += "<t hidden " + state.commentPrefix + "=" + reorderId + ">" +
|
|
3189
|
+
html += "<t hidden " + state.commentPrefix + "=" + reorderId + ">" + (reorderBranch ? state.mark("*", reorderBranch + "") : "") + reorderHTML + "</t>";
|
|
3184
3190
|
}
|
|
3185
3191
|
state.writeReorders = null;
|
|
3186
3192
|
}
|
|
@@ -3377,11 +3383,14 @@ function _escape(val) {
|
|
|
3377
3383
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
3378
3384
|
}
|
|
3379
3385
|
const unsafeScriptReg = /<(\/?script|!--)/gi;
|
|
3380
|
-
const escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\
|
|
3386
|
+
const escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\u003C$1") : str;
|
|
3381
3387
|
function _escape_script(val) {
|
|
3382
3388
|
assertValidTextValue(val);
|
|
3383
3389
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
3384
3390
|
}
|
|
3391
|
+
const unsafeScriptTemplateLiteralReg = /[`\\\r]|\$\{|<(?=\/?script|!--)/gi;
|
|
3392
|
+
const replaceUnsafeScriptTemplateLiteral = (c) => c === "<" ? "\\x3C" : c === "\r" ? "\\r" : "\\" + c;
|
|
3393
|
+
const quoteScriptTemplateLiteral = (str) => "`" + (unsafeScriptTemplateLiteralReg.test(str) ? str.replace(unsafeScriptTemplateLiteralReg, replaceUnsafeScriptTemplateLiteral) : str) + "`";
|
|
3385
3394
|
const unsafeStyleReg = /<(\/style)/gi;
|
|
3386
3395
|
const escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C$1") : str;
|
|
3387
3396
|
function _escape_style(val) {
|
|
@@ -3404,7 +3413,7 @@ function _escape_comment(val) {
|
|
|
3404
3413
|
//#endregion
|
|
3405
3414
|
//#region src/html/dynamic-tag.ts
|
|
3406
3415
|
const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
|
|
3407
|
-
let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, markerGuard) => {
|
|
3416
|
+
let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, markerGuard, tagVar) => {
|
|
3408
3417
|
const shouldResume = markerGuard !== 0;
|
|
3409
3418
|
const renderer = normalizeDynamicRenderer(tag);
|
|
3410
3419
|
const state = getState();
|
|
@@ -3441,11 +3450,12 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, m
|
|
|
3441
3450
|
renderNative();
|
|
3442
3451
|
result = _el(scopeId, DYNAMIC_TAG_VAR_REGISTER_ID + accessor);
|
|
3443
3452
|
} else {
|
|
3453
|
+
if (tagVar && renderer?.["lazy"]) throw new Error(`A dynamic tag with a [tag variable](https://markojs.com/docs/reference/language#tag-variables) rendered \`${renderer["id"]}\`, which is lazily loaded, so it does not support one. Import it without \`load\`, or remove the variable.`);
|
|
3444
3454
|
const chunk = getChunk();
|
|
3445
3455
|
const beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0;
|
|
3446
3456
|
const render = () => {
|
|
3447
3457
|
if (renderer) try {
|
|
3448
|
-
_set_scope_reason(shouldResume
|
|
3458
|
+
_set_scope_reason(shouldResume ? CLIENT_ALL : 0);
|
|
3449
3459
|
return inputIsArgs ? renderer(...inputOrArgs) : renderer(content ? {
|
|
3450
3460
|
...inputOrArgs,
|
|
3451
3461
|
content
|
|
@@ -3453,13 +3463,14 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, m
|
|
|
3453
3463
|
} finally {
|
|
3454
3464
|
_set_scope_reason(void 0);
|
|
3455
3465
|
}
|
|
3456
|
-
else if (content)
|
|
3466
|
+
else if (content) content();
|
|
3457
3467
|
};
|
|
3458
3468
|
result = shouldResume ? withBranchId(branchId, render) : render();
|
|
3459
3469
|
rendered = _peek_scope_id() !== branchId;
|
|
3460
3470
|
if (beforeBranch !== void 0) {
|
|
3461
3471
|
applyBranchStart(chunk, beforeBranch, rendered);
|
|
3462
3472
|
_html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : "")));
|
|
3473
|
+
if (renderer) _existing_scope(branchId);
|
|
3463
3474
|
}
|
|
3464
3475
|
}
|
|
3465
3476
|
if (rendered) {
|
|
@@ -3476,10 +3487,10 @@ function _content_resume(id, fn, scopeId, locals) {
|
|
|
3476
3487
|
return _resume(_content(id, fn, scopeId), id, scopeId, locals);
|
|
3477
3488
|
}
|
|
3478
3489
|
const patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
|
|
3479
|
-
_dynamic_tag = (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
|
3490
|
+
_dynamic_tag = (scopeId, accessor, tag, input, content, inputIsArgs, resume, tagVar) => {
|
|
3480
3491
|
const patched = patch(tag, scopeId, accessor);
|
|
3481
3492
|
if (patched !== tag) patched["id"] = tag;
|
|
3482
|
-
return originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, resume);
|
|
3493
|
+
return originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, resume, tagVar);
|
|
3483
3494
|
};
|
|
3484
3495
|
})(_dynamic_tag);
|
|
3485
3496
|
//#endregion
|
|
@@ -3752,10 +3763,13 @@ function NOOP$1() {}
|
|
|
3752
3763
|
const kAssets = Symbol();
|
|
3753
3764
|
const kHead = Symbol();
|
|
3754
3765
|
function withLoadAssets(renderer, flush, assetId, triggers) {
|
|
3755
|
-
return Object.assign((input) => {
|
|
3766
|
+
return register(renderer["id"], Object.assign((input) => {
|
|
3756
3767
|
writeLoadAsset(assetId, flush, triggers);
|
|
3757
3768
|
return writeWaitReady(assetId, renderer, input);
|
|
3758
|
-
},
|
|
3769
|
+
}, {
|
|
3770
|
+
...renderer,
|
|
3771
|
+
[Lazy]: 1
|
|
3772
|
+
}));
|
|
3759
3773
|
}
|
|
3760
3774
|
function writeLoadAsset(assetId, flush, triggers) {
|
|
3761
3775
|
const g = $global();
|
|
@@ -3804,7 +3818,7 @@ function writeAsset(g, asset) {
|
|
|
3804
3818
|
if (g[kHead] || g.__flush__ !== flushPage) {
|
|
3805
3819
|
const block = blockHTML(g, asset);
|
|
3806
3820
|
_html(block + (asset.triggers ? "" : deferHTML(g, asset)));
|
|
3807
|
-
if (block && isInResumedBranch()) writeScript(`document.head.insertAdjacentHTML("beforeend",${
|
|
3821
|
+
if (block && isInResumedBranch()) writeScript(`document.head.insertAdjacentHTML("beforeend",${quoteScriptTemplateLiteral(block)})`);
|
|
3808
3822
|
asset.htmlAt = catchableBoundary();
|
|
3809
3823
|
}
|
|
3810
3824
|
}
|
|
@@ -3840,8 +3854,8 @@ function addAsset(g, id, flush, triggers) {
|
|
|
3840
3854
|
return asset;
|
|
3841
3855
|
}
|
|
3842
3856
|
function triggerScript(id, html, triggers) {
|
|
3843
|
-
const htmlStr =
|
|
3844
|
-
const insert = `(d=new Range().createContextualFragment(h),d.querySelectorAll("script").forEach(s=>s.onerror=()=>console.error(${
|
|
3857
|
+
const htmlStr = quoteScriptTemplateLiteral(html);
|
|
3858
|
+
const insert = `(d=new Range().createContextualFragment(h),d.querySelectorAll("script").forEach(s=>s.onerror=()=>console.error(${quoteScriptTemplateLiteral(`The lazy module for "${id}" failed to load; its server-rendered content cannot become interactive.`)})),document.head.append(d))`;
|
|
3845
3859
|
const exprs = triggers.map((trigger) => {
|
|
3846
3860
|
const options = trigger.options && toObjectExpression(trigger.options);
|
|
3847
3861
|
switch (trigger.type) {
|
package/dist/dom/catch.feat.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js"), handlePendingTry = (fn, scope, branch) => {
|
|
3
3
|
for (; branch;) {
|
|
4
|
-
if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = () => complete() || require_control_flow.
|
|
4
|
+
if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = () => complete() || require_control_flow.ln(branch, require_control_flow.un, require_control_flow.b))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
|
|
5
5
|
branch = branch.N;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//#region src/dom/catch.feat.ts
|
|
9
|
-
require_control_flow.
|
|
9
|
+
require_control_flow.sn((effects) => {
|
|
10
10
|
let i = 0, fn, scope, branch;
|
|
11
11
|
for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !handlePendingTry(fn, scope, branch) && fn(scope);
|
|
12
12
|
}, (runRender) => (render) => {
|
package/dist/dom/catch.feat.mjs
CHANGED
|
@@ -4,7 +4,7 @@ let handlePendingTry = (fn, scope, branch) => {
|
|
|
4
4
|
branch = branch.N;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
import { b as runPendingEffects,
|
|
7
|
+
import { b as runPendingEffects, ln as queueAsyncRender, sn as installCatch, un as queueEffect, y as renderCatch } from "../dom-DefWmvQB.mjs";
|
|
8
8
|
//#region src/dom/catch.feat.ts
|
|
9
9
|
installCatch((effects) => {
|
|
10
10
|
let i = 0, fn, scope, branch;
|
|
@@ -11,10 +11,10 @@ export declare const _if: (nodeAccessor: EncodedAccessor, ...branchesArgs: (stri
|
|
|
11
11
|
export declare const _show: (nodeAccessor: EncodedAccessor, startNodeAccessor?: EncodedAccessor, endNodeAccessor?: EncodedAccessor) => (scope: Scope, display: unknown) => void;
|
|
12
12
|
export declare function rendererKey(renderer: Renderer | string | undefined): string | Renderer | undefined;
|
|
13
13
|
export declare function patchDynamicTag(fn: <T extends typeof _dynamic_tag>(cond: T) => T): void;
|
|
14
|
-
export declare let _dynamic_tag: (nodeAccessor: EncodedAccessor, getContent?: ((scope: Scope) => Renderer) | 0, getTagVar?: (() =>
|
|
14
|
+
export declare let _dynamic_tag: (nodeAccessor: EncodedAccessor, getContent?: ((scope: Scope) => Renderer) | 0, getTagVar?: (() => (scope: Scope, value?: unknown) => void) | 0, inputIsArgs?: 1) => Signal<Renderer | string | undefined>;
|
|
15
15
|
export declare const _dynamic_tag_content: (nodeAccessor: EncodedAccessor) => Signal<Renderer | undefined>;
|
|
16
|
-
export declare let
|
|
17
|
-
export declare function installDynamicTagVar(bind: typeof
|
|
16
|
+
export declare let bindTagVar: undefined | ((scope: Scope, branch: BranchScope, scopeKey: number, renderer: Renderer | string) => void);
|
|
17
|
+
export declare function installDynamicTagVar(bind: NonNullable<typeof bindTagVar>): void;
|
|
18
18
|
export declare function dynamicTagScript(branch: Scope): void;
|
|
19
19
|
export declare function setConditionalRenderer<T>(scope: Scope, nodeAccessor: Accessor, newRenderer: T, createBranch: ($global: Scope[typeof AccessorProp.Global], renderer: NonNullable<T>, parentScope: Scope, parentNode: ParentNode) => BranchScope): void;
|
|
20
20
|
export declare const _for_of: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [all: unknown[], by?: ((item: unknown, index: number) => unknown) | undefined]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js");
|
|
3
3
|
require_control_flow.U[0] = require_control_flow.k, require_control_flow.U[1] = require_control_flow.D, require_control_flow.U[2] = require_control_flow.P;
|
|
4
4
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as _attr_input_checkedValue_script, P as _attr_input_value_script, U as controllableScripts, k as _attr_input_checked_script } from "../dom-
|
|
1
|
+
import { D as _attr_input_checkedValue_script, P as _attr_input_value_script, U as controllableScripts, k as _attr_input_checked_script } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as _attr_details_or_dialog_open_script, U as controllableScripts } from "../dom-
|
|
1
|
+
import { C as _attr_details_or_dialog_open_script, U as controllableScripts } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
//#region src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as _attr_select_value_script, U as controllableScripts } from "../dom-
|
|
1
|
+
import { L as _attr_select_value_script, U as controllableScripts } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
//#region src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as _attr_input_value_script, U as controllableScripts } from "../dom-
|
|
1
|
+
import { P as _attr_input_value_script, U as controllableScripts } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
//#region src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js");
|
|
3
3
|
require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.H.INPUT = require_control_flow.R, require_control_flow.H.TEXTAREA = require_control_flow.V, require_control_flow.H.SELECT = require_control_flow.B, require_control_flow.H.DETAILS = require_control_flow.H.DIALOG = require_control_flow.z;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as _controllable_select, H as controllableRenders, R as _controllable_input, V as _controllable_textarea, z as _controllable_open } from "../dom-
|
|
1
|
+
import { B as _controllable_select, H as controllableRenders, R as _controllable_input, V as _controllable_textarea, z as _controllable_open } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js");
|
|
3
3
|
//#region src/dom/dynamic-tag-script.feat.ts
|
|
4
|
-
require_control_flow.
|
|
4
|
+
require_control_flow.Ct._d = require_control_flow.wn(require_control_flow.g);
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as _resumed, g as dynamicTagScript, wn as withBranches } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
//#region src/dom/dynamic-tag-script.feat.ts
|
|
3
3
|
_resumed._d = withBranches(dynamicTagScript);
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js");
|
|
3
|
+
require_control_flow.on(), require_control_flow._((scope, branch, scopeKey, renderer) => {
|
|
4
|
+
branch.BR = require_control_flow.an(scope, scopeKey), typeof renderer == "string" && branch.T(() => branch.S);
|
|
5
|
+
});
|
|
4
6
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { _ as installDynamicTagVar } from "../dom-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { _ as installDynamicTagVar, an as createBranchRenders, on as installBranchRenders } from "../dom-DefWmvQB.mjs";
|
|
2
|
+
installBranchRenders(), installDynamicTagVar((scope, branch, scopeKey, renderer) => {
|
|
3
|
+
branch.BR = createBranchRenders(scope, scopeKey), typeof renderer == "string" && branch.T(() => branch.S);
|
|
4
|
+
});
|
|
4
5
|
//#endregion
|
package/dist/dom/lazy.feat.js
CHANGED
package/dist/dom/lazy.feat.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-Diu8MpmL.js");
|
|
3
3
|
//#region src/dom/placeholder.feat.ts
|
|
4
|
-
require_control_flow.
|
|
5
|
-
tryBranch.P &&= (require_control_flow.
|
|
4
|
+
require_control_flow.Ct._f = (tryBranch) => {
|
|
5
|
+
tryBranch.P &&= (require_control_flow.Qt(tryBranch.P), 0);
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as _resumed, Qt as destroyBranch } from "../dom-DefWmvQB.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
_resumed._f = (tryBranch) => {
|
|
4
4
|
tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
|
package/dist/dom/queue.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ export declare let rendering: undefined | 0 | 1;
|
|
|
13
13
|
export declare let runId: number;
|
|
14
14
|
export declare let pendingEffects: unknown[];
|
|
15
15
|
export declare function queueRender<T, U extends Scope = Scope>(scope: U, signal: Signal<T, U>, signalKey: number, value?: T, scopeKey?: number): void;
|
|
16
|
-
export declare
|
|
16
|
+
export declare let queuePendingRender: (render: PendingRender) => void;
|
|
17
|
+
export declare function createBranchRenders(scope: Scope, scopeKey: number): PendingRender;
|
|
18
|
+
export declare function installBranchRenders(): void;
|
|
17
19
|
export declare function queueEffect<S extends Scope, T extends ExecFn<S>>(scope: S, fn: T): void;
|
|
18
20
|
export declare function run(): void;
|
|
19
21
|
export declare function queueAsyncRender<T, U extends Scope = Scope>(scope: U, signal: Signal<T, U>, value?: T): void;
|
|
@@ -21,4 +23,5 @@ export declare function prepareEffects(fn: () => void): unknown[];
|
|
|
21
23
|
export declare let runEffects: (effects: unknown[]) => void;
|
|
22
24
|
declare let runRender: (render: PendingRender) => void;
|
|
23
25
|
export declare function installCatch(catchEffects: typeof runEffects, wrapRender: (base: typeof runRender) => typeof runRender): void;
|
|
26
|
+
export declare function runRenders(renders?: PendingRender[]): void;
|
|
24
27
|
export {};
|
package/dist/dom/renderer.d.ts
CHANGED
|
@@ -4,16 +4,23 @@ export type Renderer = {
|
|
|
4
4
|
[RendererProp.Id]: string;
|
|
5
5
|
[RendererProp.Setup]: undefined | SetupFn;
|
|
6
6
|
[RendererProp.Clone]: (branch: BranchScope, ns: string) => void;
|
|
7
|
-
[RendererProp.Params]: Signal<unknown> | undefined;
|
|
7
|
+
[RendererProp.Params]: (Signal<unknown> & ReturnMark) | undefined;
|
|
8
8
|
[RendererProp.Owner]: Scope | undefined;
|
|
9
9
|
[RendererProp.Accessor]: Accessor | undefined;
|
|
10
10
|
[RendererProp.LocalClosures]?: SetupFn;
|
|
11
|
+
[RendererProp.Lazy]?: 1;
|
|
12
|
+
};
|
|
13
|
+
export type SetupFn = ((scope: Scope) => void) & ReturnMark;
|
|
14
|
+
export type ReturnMark = {
|
|
15
|
+
[RendererProp.Returns]?: 1;
|
|
11
16
|
};
|
|
12
|
-
export type SetupFn = (scope: Scope) => void;
|
|
13
17
|
export declare function createBranch($global: Scope[typeof AccessorProp.Global], renderer: Renderer | string, parentScope: Scope | undefined, parentNode: ParentNode): BranchScope;
|
|
14
18
|
export declare function setParentBranch(branch: BranchScope, parentBranch: BranchScope | undefined): void;
|
|
15
19
|
export declare function createAndSetupBranch($global: Scope[typeof AccessorProp.Global], renderer: Renderer, parentScope: Scope | undefined, parentNode: ParentNode): BranchScope;
|
|
16
20
|
export declare function setupBranch(renderer: Renderer, branch: BranchScope): BranchScope;
|
|
21
|
+
export declare function _return_setup<T extends ((...args: any[]) => unknown) | {
|
|
22
|
+
_: SetupFn;
|
|
23
|
+
}>(setup: T): T;
|
|
17
24
|
export declare function _content(id: string, template?: string | 0, walks?: string | 0, setup?: {
|
|
18
25
|
_: Signal<unknown>;
|
|
19
26
|
} | SetupFn | 0, params?: Signal<unknown> | 0, dynamicScopesAccessor?: Accessor): (owner?: Scope) => Renderer;
|