marko 6.3.52 → 6.3.54
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 -0
- package/dist/common/constants/renderer-prop.d.ts +0 -1
- package/dist/common/constants/renderer-prop.debug.d.ts +0 -1
- package/dist/common/helpers.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 +5 -0
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +4 -0
- 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/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BJKb8-wr.js → dom-CI0Vojyk.js} +146 -88
- package/dist/debug/{dom-Dq_Yu7MS.mjs → dom-tl43c2wO.mjs} +113 -85
- package/dist/debug/dom.js +10 -8
- package/dist/debug/dom.mjs +7 -8
- package/dist/debug/html.js +52 -26
- package/dist/debug/html.mjs +52 -26
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +5 -4
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.d.ts +1 -0
- package/dist/dom/dynamic-tag-script.feat.js +4 -0
- package/dist/dom/dynamic-tag-script.feat.mjs +4 -0
- package/dist/dom/dynamic-tag-var.feat.js +1 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/dom/load.d.ts +2 -2
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/renderer.d.ts +2 -3
- package/dist/dom/resume.d.ts +1 -0
- package/dist/dom/signals.d.ts +1 -1
- package/dist/{dom-CzfddxCE.mjs → dom-4udEPZaj.mjs} +77 -58
- package/dist/{dom-CzGPOsST.js → dom-C1mr-TA7.js} +213 -174
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +40 -42
- package/dist/dom.mjs +6 -8
- package/dist/html/dynamic-tag.d.ts +2 -1
- package/dist/html/serializer.d.ts +3 -2
- package/dist/html/writer.d.ts +6 -5
- package/dist/html.js +35 -20
- package/dist/html.mjs +35 -20
- package/dist/translator/index.js +2863 -2666
- package/dist/translator/util/binding-has-prop.d.ts +1 -0
- package/dist/translator/util/branch-tag.d.ts +6 -1
- package/dist/translator/util/optional.d.ts +2 -0
- package/dist/translator/util/references.d.ts +26 -12
- package/dist/translator/util/runtime.d.ts +2 -1
- package/dist/translator/util/sections.d.ts +11 -8
- package/dist/translator/util/serialize-guard.d.ts +1 -7
- package/dist/translator/util/serialize-reasons.d.ts +3 -0
- package/dist/translator/util/set-tag-sections-downstream.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +4 -1
- package/dist/translator/util/structure.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -1
- package/dist/translator/visitors/function.d.ts +1 -0
- package/dist/translator/visitors/import-declaration.d.ts +1 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +5 -0
- package/package.json +4 -4
- package/tags/try.d.marko +2 -0
- package/tags-html.d.ts +6 -0
|
@@ -58,7 +58,6 @@ const Params = "params";
|
|
|
58
58
|
const Owner = "owner";
|
|
59
59
|
const Accessor = "accessor";
|
|
60
60
|
const LocalClosures = "localClosures";
|
|
61
|
-
const LocalClosureValues = "localClosureValues";
|
|
62
61
|
//#endregion
|
|
63
62
|
//#region src/common/helpers.ts
|
|
64
63
|
const htmlAttrNameReg = /^[^a-z_]|[^a-z0-9._:-]/i;
|
|
@@ -454,11 +453,6 @@ function abort(ctrl) {
|
|
|
454
453
|
ctrl.abort();
|
|
455
454
|
}
|
|
456
455
|
//#endregion
|
|
457
|
-
//#region src/common/meta.ts
|
|
458
|
-
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
459
|
-
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
460
|
-
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
461
|
-
//#endregion
|
|
462
456
|
//#region src/common/opt.ts
|
|
463
457
|
function toArray(opt) {
|
|
464
458
|
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
@@ -502,6 +496,11 @@ function parseHTML(html, ns) {
|
|
|
502
496
|
return parser.content || parser;
|
|
503
497
|
}
|
|
504
498
|
//#endregion
|
|
499
|
+
//#region src/common/meta.ts
|
|
500
|
+
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
501
|
+
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
502
|
+
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
503
|
+
//#endregion
|
|
505
504
|
//#region src/dom/scope.ts
|
|
506
505
|
let nextScopeId = 1e6;
|
|
507
506
|
let collectingScopes;
|
|
@@ -730,20 +729,24 @@ function _closure(...closureSignals) {
|
|
|
730
729
|
}
|
|
731
730
|
};
|
|
732
731
|
}
|
|
733
|
-
function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
|
|
734
|
-
const closureSignal = ((scope) => {
|
|
732
|
+
function _closure_get(valueAccessor, fn, getOwnerScope, resumeId, ownerValueAccessor) {
|
|
733
|
+
const closureSignal = ((scope, resumed) => {
|
|
734
|
+
const ownerScope = getOwnerScope ? getOwnerScope(scope) : scope["_"];
|
|
735
735
|
scope[closureSignal[SignalIndexAccessor]] = closureSignal[Index];
|
|
736
|
-
fn(scope);
|
|
737
|
-
subscribeToScopeSet(
|
|
736
|
+
if (!resumed || ownerValueAccessor in ownerScope) fn(scope);
|
|
737
|
+
subscribeToScopeSet(ownerScope, closureSignal[ScopeInstancesAccessor], scope);
|
|
738
738
|
});
|
|
739
739
|
closureSignal[ScopeInstancesAccessor] = ClosureScopes + valueAccessor;
|
|
740
740
|
closureSignal[SignalIndexAccessor] = ClosureSignalIndex + valueAccessor;
|
|
741
|
-
if (resumeId)
|
|
741
|
+
if (resumeId) {
|
|
742
|
+
ownerValueAccessor = valueAccessor;
|
|
743
|
+
_resumed[resumeId] = (scope) => closureSignal(scope, 1);
|
|
744
|
+
}
|
|
742
745
|
return closureSignal;
|
|
743
746
|
}
|
|
744
747
|
function _child_setup(setup) {
|
|
745
748
|
setup._ = (scope, owner) => {
|
|
746
|
-
scope["_"]
|
|
749
|
+
scope["_"] ||= owner;
|
|
747
750
|
queueRender(scope, setup, -1);
|
|
748
751
|
};
|
|
749
752
|
return setup;
|
|
@@ -787,8 +790,9 @@ function _el_read(value) {
|
|
|
787
790
|
}
|
|
788
791
|
function* traverse(scope, path, args, i = path.length - 1) {
|
|
789
792
|
if (rendering) _hoist_read_error();
|
|
790
|
-
if (scope) if (Symbol.iterator in scope)
|
|
791
|
-
|
|
793
|
+
if (scope) if (Symbol.iterator in scope) {
|
|
794
|
+
for (const childScope of scope.values()) if (childScope["#Gen"] !== 0) yield* traverse(childScope, path, args, i);
|
|
795
|
+
} else {
|
|
792
796
|
const item = scope[path[i]];
|
|
793
797
|
if (i) yield* traverse(item, path, args, i - 1);
|
|
794
798
|
else yield typeof item === "function" ? item(...args) : item;
|
|
@@ -1089,6 +1093,12 @@ function _var_resume(id, signal) {
|
|
|
1089
1093
|
function _el(id, accessor) {
|
|
1090
1094
|
return _resumed[id] = (scope) => () => _el_read(scope[accessor]);
|
|
1091
1095
|
}
|
|
1096
|
+
function _resume_dynamic_tag_var(accessor) {
|
|
1097
|
+
_resumed[DYNAMIC_TAG_VAR_REGISTER_ID + accessor] = (scope) => () => {
|
|
1098
|
+
const node = scope[accessor];
|
|
1099
|
+
return _el_read(node.nodeType === 8 ? node.previousSibling : node);
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1092
1102
|
//#endregion
|
|
1093
1103
|
//#region src/dom/renderer.ts
|
|
1094
1104
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
@@ -1122,7 +1132,7 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
1122
1132
|
} : (branch) => {
|
|
1123
1133
|
walk(branch[StartNode] = branch[EndNode] = new Text(), walks, branch);
|
|
1124
1134
|
};
|
|
1125
|
-
return (owner) => {
|
|
1135
|
+
return _resumed[id] = (owner) => {
|
|
1126
1136
|
return {
|
|
1127
1137
|
["id"]: id,
|
|
1128
1138
|
[Clone]: clone,
|
|
@@ -1133,16 +1143,29 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
1133
1143
|
};
|
|
1134
1144
|
};
|
|
1135
1145
|
}
|
|
1136
|
-
function _content_resume(
|
|
1137
|
-
return _resumed[id] =
|
|
1146
|
+
function _content_resume(renderer, hasLocalValues = 0) {
|
|
1147
|
+
return _resumed[renderer()["id"]] = (owner, ...values) => {
|
|
1148
|
+
for (let i = values.length, scope = owner; i > hasLocalValues;) {
|
|
1149
|
+
const closures = values[--i];
|
|
1150
|
+
for (const key in closures) if (!(key in scope)) scope[key] = closures[key];
|
|
1151
|
+
scope = scope["_"];
|
|
1152
|
+
}
|
|
1153
|
+
return renderer(owner, values[hasLocalValues - 1]);
|
|
1154
|
+
};
|
|
1138
1155
|
}
|
|
1139
1156
|
function _content_closures(renderer, closureFns) {
|
|
1140
1157
|
const closureSignals = {};
|
|
1141
1158
|
for (const key in closureFns) closureSignals[key] = _const(key, closureFns[key]);
|
|
1142
1159
|
return (owner, closureValues) => {
|
|
1143
1160
|
const instance = renderer(owner);
|
|
1144
|
-
instance[
|
|
1145
|
-
instance[
|
|
1161
|
+
const clone = instance[Clone];
|
|
1162
|
+
const setClosures = instance[LocalClosures] = (branch) => {
|
|
1163
|
+
for (const key in closureSignals) closureSignals[key](branch, closureValues[key]);
|
|
1164
|
+
};
|
|
1165
|
+
instance[Clone] = (branch, ns) => {
|
|
1166
|
+
clone(branch, ns);
|
|
1167
|
+
setClosures(branch);
|
|
1168
|
+
};
|
|
1146
1169
|
return instance;
|
|
1147
1170
|
};
|
|
1148
1171
|
}
|
|
@@ -1287,7 +1310,7 @@ function _attr_content(scope, nodeAccessor, value) {
|
|
|
1287
1310
|
setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch);
|
|
1288
1311
|
if (content?.["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[BranchScopes$1 + nodeAccessor]);
|
|
1289
1312
|
}
|
|
1290
|
-
|
|
1313
|
+
content?.[LocalClosures]?.(scope[BranchScopes$1 + nodeAccessor]);
|
|
1291
1314
|
}
|
|
1292
1315
|
function _attrs_script(scope, nodeAccessor) {
|
|
1293
1316
|
const el = scope[nodeAccessor];
|
|
@@ -1683,18 +1706,20 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1683
1706
|
return awaitBranch;
|
|
1684
1707
|
};
|
|
1685
1708
|
const awaitPromise = (scope, promise) => {
|
|
1686
|
-
if (!isPromise(
|
|
1709
|
+
if (!isPromise(scope[promiseAccessor])) scope[promiseAccessor] = 0;
|
|
1687
1710
|
let awaitBranch = scope[branchAccessor];
|
|
1688
|
-
const tryPlaceholder = findBranchWithKey(scope, PlaceholderContent);
|
|
1711
|
+
const tryPlaceholder = (isPromise(promise) || scope[promiseAccessor]) && findBranchWithKey(scope, "#PlaceholderContent");
|
|
1689
1712
|
const tryBranch = tryPlaceholder || awaitBranch;
|
|
1690
|
-
if (!
|
|
1691
|
-
scope[promiseAccessor] = () => awaitPromise(scope, promise);
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1713
|
+
if (!tryBranch) {
|
|
1714
|
+
const replay = scope[promiseAccessor] = () => replay === scope[promiseAccessor] && awaitPromise(scope, promise);
|
|
1715
|
+
const awaitCounter = findBranchWithKey(scope, PlaceholderContent)?.[AwaitCounter];
|
|
1716
|
+
if (awaitCounter?.i) {
|
|
1717
|
+
const complete = awaitCounter.c;
|
|
1718
|
+
awaitCounter.c = () => complete() || queueAsyncRender(scope, replay);
|
|
1719
|
+
}
|
|
1696
1720
|
return;
|
|
1697
1721
|
}
|
|
1722
|
+
if (!isPromise(promise)) return scope[promiseAccessor] ? awaitPromise(scope, Promise.resolve(promise)) : resolveAwait(scope, scope[nodeAccessor], promise);
|
|
1698
1723
|
let awaitCounter = tryBranch[AwaitCounter];
|
|
1699
1724
|
placeholderShown.add(pendingEffects);
|
|
1700
1725
|
if (!tryPlaceholder && !awaitCounter?.i) awaitCounter = createAwaitCounter(tryBranch, () => {
|
|
@@ -1705,7 +1730,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1705
1730
|
if (detachedParent === anchor.parentNode) anchor.remove();
|
|
1706
1731
|
else anchor.replaceWith(detachedParent);
|
|
1707
1732
|
}
|
|
1708
|
-
}
|
|
1733
|
+
}
|
|
1709
1734
|
});
|
|
1710
1735
|
if (!scope[promiseAccessor]) {
|
|
1711
1736
|
if (awaitBranch) awaitBranch[PendingRenders] ||= [];
|
|
@@ -1721,7 +1746,8 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1721
1746
|
if (thisPromise === scope[promiseAccessor]) {
|
|
1722
1747
|
const referenceNode = scope[nodeAccessor];
|
|
1723
1748
|
scope[promiseAccessor] = 0;
|
|
1724
|
-
if (scope["#ClosestBranch"]?.["#Gen"] === 0) {
|
|
1749
|
+
if (!scope[branchAccessor] || scope["#ClosestBranch"]?.["#Gen"] === 0) {
|
|
1750
|
+
if (!scope[branchAccessor]) awaitPromise(scope, data);
|
|
1725
1751
|
awaitCounter.c();
|
|
1726
1752
|
run();
|
|
1727
1753
|
return;
|
|
@@ -1768,11 +1794,7 @@ function _await_content(nodeAccessor, template, walks, setup) {
|
|
|
1768
1794
|
return (scope) => {
|
|
1769
1795
|
const pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope[Global], renderer, scope, scope[nodeAccessor].parentNode))[DetachedAwait] = renderer);
|
|
1770
1796
|
scope[branchAccessor][PendingScopes] = pendingScopes;
|
|
1771
|
-
|
|
1772
|
-
if (typeof resolveSync === "function") {
|
|
1773
|
-
scope[promiseAccessor] = 0;
|
|
1774
|
-
resolveSync();
|
|
1775
|
-
}
|
|
1797
|
+
if (typeof scope[promiseAccessor] === "function") scope[promiseAccessor]();
|
|
1776
1798
|
};
|
|
1777
1799
|
}
|
|
1778
1800
|
function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, PlaceholderContent)) {
|
|
@@ -1898,18 +1920,19 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
|
|
|
1898
1920
|
return (scope, newRenderer, getInput) => {
|
|
1899
1921
|
const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
1900
1922
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(normalizedRenderer)) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
|
1901
|
-
|
|
1923
|
+
const renderer = normalizedRenderer || (getContent ? getContent(scope) : void 0);
|
|
1924
|
+
setConditionalRenderer(scope, nodeAccessor, renderer, createBranchWithTagNameOrRenderer);
|
|
1902
1925
|
if (getTagVar) if (scope[childScopeAccessor]) {
|
|
1903
1926
|
scope[childScopeAccessor][TagVariable] = (value) => getTagVar()(scope, value);
|
|
1904
1927
|
if (typeof normalizedRenderer === "string") bindNativeTagVar?.(scope[childScopeAccessor]);
|
|
1905
1928
|
} else getTagVar()(scope, void 0);
|
|
1906
|
-
if (typeof
|
|
1929
|
+
if (typeof renderer === "string") {
|
|
1907
1930
|
if (getContent) {
|
|
1908
1931
|
const content = getContent(scope);
|
|
1909
|
-
setConditionalRenderer(scope[childScopeAccessor], `#${
|
|
1910
|
-
if (content["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[childScopeAccessor][`BranchScopes:#${
|
|
1932
|
+
setConditionalRenderer(scope[childScopeAccessor], `#${renderer.toLowerCase()}/0`, content, createAndSetupBranch);
|
|
1933
|
+
if (content["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[childScopeAccessor][`BranchScopes:#${renderer.toLowerCase()}/0`]);
|
|
1911
1934
|
}
|
|
1912
|
-
} else if (
|
|
1935
|
+
} else if (renderer?.["accessor"]) subscribeToScopeSet(renderer[Owner], renderer[Accessor], scope[childScopeAccessor]);
|
|
1913
1936
|
}
|
|
1914
1937
|
if (normalizedRenderer) {
|
|
1915
1938
|
const childScope = scope[childScopeAccessor];
|
|
@@ -1919,7 +1942,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
|
|
|
1919
1942
|
(getContent ? _attrs : _attrs_content)(childScope, nodeAccessor, (inputIsArgs ? args[0] : args) || {}, controllableRenders[childScope[nodeAccessor].tagName]);
|
|
1920
1943
|
if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
|
|
1921
1944
|
} else {
|
|
1922
|
-
|
|
1945
|
+
normalizedRenderer[LocalClosures]?.(childScope);
|
|
1923
1946
|
if (normalizedRenderer["params"]) if (inputIsArgs) normalizedRenderer[Params](childScope, normalizedRenderer._ ? args[0] : args);
|
|
1924
1947
|
else {
|
|
1925
1948
|
const inputWithContent = getContent ? {
|
|
@@ -1940,14 +1963,13 @@ const _dynamic_tag_content = /*@__PURE__*/ withBranches((nodeAccessor) => {
|
|
|
1940
1963
|
setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
|
|
1941
1964
|
if (renderer?.["accessor"]) subscribeToScopeSet(renderer[Owner], renderer[Accessor], scope[childScopeAccessor]);
|
|
1942
1965
|
}
|
|
1943
|
-
|
|
1966
|
+
renderer?.[LocalClosures]?.(scope[childScopeAccessor]);
|
|
1944
1967
|
};
|
|
1945
1968
|
});
|
|
1946
1969
|
let bindNativeTagVar;
|
|
1947
1970
|
function installDynamicTagVar(bind) {
|
|
1948
1971
|
bindNativeTagVar = bind;
|
|
1949
1972
|
}
|
|
1950
|
-
const _resume_dynamic_tag = /*@__PURE__*/ withBranches(() => _resumed[DYNAMIC_TAG_SCRIPT_REGISTER_ID] = dynamicTagScript);
|
|
1951
1973
|
function dynamicTagScript(branch) {
|
|
1952
1974
|
_attrs_script(branch, `#${branch[Renderer].toLowerCase()}/0`);
|
|
1953
1975
|
}
|
|
@@ -1971,7 +1993,7 @@ function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch)
|
|
|
1971
1993
|
referenceNode.remove();
|
|
1972
1994
|
}
|
|
1973
1995
|
}
|
|
1974
|
-
const loop = /*@__PURE__*/ withBranches((forEach) => (nodeAccessor, template, walks, setup, params) => {
|
|
1996
|
+
const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, template, walks, setup, params) => {
|
|
1975
1997
|
const scopesAccessor = BranchScopes$1 + nodeAccessor;
|
|
1976
1998
|
const keyedScopesAccessor = KeyedScopes + nodeAccessor;
|
|
1977
1999
|
const renderer = _content("", template, walks, setup)();
|
|
@@ -2032,61 +2054,67 @@ const loop = /*@__PURE__*/ withBranches((forEach) => (nodeAccessor, template, wa
|
|
|
2032
2054
|
for (let i = start; i <= newEnd; i++) insertBranchBefore(newScopes[i], parentNode, afterReference);
|
|
2033
2055
|
return;
|
|
2034
2056
|
}
|
|
2035
|
-
|
|
2036
|
-
const sources = new Array(diffLen);
|
|
2037
|
-
const pred = new Array(diffLen);
|
|
2038
|
-
const tails = [];
|
|
2039
|
-
let tail = -1;
|
|
2040
|
-
let lo;
|
|
2041
|
-
let hi;
|
|
2042
|
-
let mid;
|
|
2043
|
-
for (let i = diffLen; i--;) sources[i] = newScopes[start + i]["#LoopIndex"] ?? -1;
|
|
2044
|
-
for (let i = 0; i < diffLen; i++) if (~sources[i]) if (tail < 0 || sources[tails[tail]] < sources[i]) {
|
|
2045
|
-
if (~tail) pred[i] = tails[tail];
|
|
2046
|
-
tails[++tail] = i;
|
|
2047
|
-
} else {
|
|
2048
|
-
lo = 0;
|
|
2049
|
-
hi = tail;
|
|
2050
|
-
while (lo < hi) {
|
|
2051
|
-
mid = (lo + hi) / 2 | 0;
|
|
2052
|
-
if (sources[tails[mid]] < sources[i]) lo = mid + 1;
|
|
2053
|
-
else hi = mid;
|
|
2054
|
-
}
|
|
2055
|
-
if (sources[i] < sources[tails[lo]]) {
|
|
2056
|
-
if (lo > 0) pred[i] = tails[lo - 1];
|
|
2057
|
-
tails[lo] = i;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
hi = tails[tail];
|
|
2061
|
-
lo = tail + 1;
|
|
2062
|
-
while (lo-- > 0) {
|
|
2063
|
-
tails[lo] = hi;
|
|
2064
|
-
hi = pred[hi];
|
|
2065
|
-
}
|
|
2066
|
-
for (let i = diffLen; i--;) {
|
|
2067
|
-
if (~tail && i === tails[tail]) tail--;
|
|
2068
|
-
else insertBranchBefore(newScopes[start + i], parentNode, afterReference);
|
|
2069
|
-
afterReference = newScopes[start + i][StartNode];
|
|
2070
|
-
}
|
|
2057
|
+
reorder(newScopes, start, newEnd, parentNode, afterReference);
|
|
2071
2058
|
};
|
|
2072
2059
|
});
|
|
2073
2060
|
const _for_of = /*@__PURE__*/ loop(([all, by], cb) => {
|
|
2074
2061
|
by ||= bySecondArg;
|
|
2075
2062
|
if (typeof by === "string") forOf(all, (item, i) => cb(item[by], [item, i]));
|
|
2076
2063
|
else forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
2077
|
-
});
|
|
2064
|
+
}, reorderKeyed);
|
|
2078
2065
|
const _for_in = /*@__PURE__*/ loop(([obj, by], cb) => {
|
|
2079
2066
|
by ||= byFirstArg;
|
|
2080
2067
|
forIn(obj, (key, value) => cb(by(key, value), [key, value]));
|
|
2081
|
-
});
|
|
2068
|
+
}, reorderKeyed);
|
|
2082
2069
|
const _for_to = /*@__PURE__*/ loop(([to, from, step, by], cb) => {
|
|
2083
2070
|
by ||= byFirstArg;
|
|
2084
2071
|
forTo(to, from, step, (v) => cb(by(v), [v]));
|
|
2085
|
-
});
|
|
2072
|
+
}, reorderKeyed);
|
|
2086
2073
|
const _for_until = /*@__PURE__*/ loop(([until, from, step, by], cb) => {
|
|
2087
2074
|
by ||= byFirstArg;
|
|
2088
2075
|
forUntil(until, from, step, (v) => cb(by(v), [v]));
|
|
2089
|
-
});
|
|
2076
|
+
}, reorderKeyed);
|
|
2077
|
+
const _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, [item, i])));
|
|
2078
|
+
const _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, [v])));
|
|
2079
|
+
const _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, [v])));
|
|
2080
|
+
function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
|
|
2081
|
+
const diffLen = newEnd - start + 1;
|
|
2082
|
+
const sources = new Array(diffLen);
|
|
2083
|
+
const pred = new Array(diffLen);
|
|
2084
|
+
const tails = [];
|
|
2085
|
+
let tail = -1;
|
|
2086
|
+
let lo;
|
|
2087
|
+
let hi;
|
|
2088
|
+
let mid;
|
|
2089
|
+
for (let i = diffLen; i--;) sources[i] = newScopes[start + i]["#LoopIndex"] ?? -1;
|
|
2090
|
+
for (let i = 0; i < diffLen; i++) if (~sources[i]) if (tail < 0 || sources[tails[tail]] < sources[i]) {
|
|
2091
|
+
if (~tail) pred[i] = tails[tail];
|
|
2092
|
+
tails[++tail] = i;
|
|
2093
|
+
} else {
|
|
2094
|
+
lo = 0;
|
|
2095
|
+
hi = tail;
|
|
2096
|
+
while (lo < hi) {
|
|
2097
|
+
mid = (lo + hi) / 2 | 0;
|
|
2098
|
+
if (sources[tails[mid]] < sources[i]) lo = mid + 1;
|
|
2099
|
+
else hi = mid;
|
|
2100
|
+
}
|
|
2101
|
+
if (sources[i] < sources[tails[lo]]) {
|
|
2102
|
+
if (lo > 0) pred[i] = tails[lo - 1];
|
|
2103
|
+
tails[lo] = i;
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
hi = tails[tail];
|
|
2107
|
+
lo = tail + 1;
|
|
2108
|
+
while (lo-- > 0) {
|
|
2109
|
+
tails[lo] = hi;
|
|
2110
|
+
hi = pred[hi];
|
|
2111
|
+
}
|
|
2112
|
+
for (let i = diffLen; i--;) {
|
|
2113
|
+
if (~tail && i === tails[tail]) tail--;
|
|
2114
|
+
else insertBranchBefore(newScopes[start + i], parentNode, afterReference);
|
|
2115
|
+
afterReference = newScopes[start + i][StartNode];
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2090
2118
|
function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
|
|
2091
2119
|
if (typeof tagNameOrRenderer === "string") assertValidTagName(tagNameOrRenderer);
|
|
2092
2120
|
const branch = createBranch($global, tagNameOrRenderer, parentScope, parentNode);
|
|
@@ -2101,4 +2129,4 @@ function byFirstArg(name) {
|
|
|
2101
2129
|
return name;
|
|
2102
2130
|
}
|
|
2103
2131
|
//#endregion
|
|
2104
|
-
export {
|
|
2132
|
+
export { _attrs_content as $, DYNAMIC_TAG_SCRIPT_REGISTER_ID as $t, _attr_input_value_attribute_default as A, EndNode as An, _closure_get as At, _controllable_textarea as B, _let as Bt, _attr_input_checked as C, Owner as Cn, init as Ct, _attr_input_checked_default as D, Scope as Dn, withLazy as Dt, _attr_input_checkedValue_script as E, Pending as En, readyFailed as Et, _attr_select_value_default as F, PendingEffects as Fn, _global_read as Ft, _attr_class_item as G, _script as Gt, controllableScripts as H, _or as Ht, _attr_select_value_script as I, PendingRenders as In, _hoist as It, _attr_nonce as J, _assert_init as Jt, _attr_class_items as K, _var as Kt, _controllable_input as L, PlaceholderBranch as Ln, _hoist_resume as Lt, _attr_input_value_dynamic_default as M, Global as Mn, _el_read as Mt, _attr_input_value_script as N, Load as Nn, _for_closure as Nt, _attr_input_checked_script as O, AwaitCounter as On, _child_setup as Ot, _attr_select_value as P, ParentBranch as Pn, _for_selector as Pt, _attrs as Q, syncGen as Qt, _controllable_open as R, StartNode as Rn, _id as Rt, _attr_details_or_dialog_open_script as S, Clone as Sn, getRegisteredWithScope as St, _attr_input_checkedValue_default as T, Setup as Tn, ready as Tt, _attr as U, _return as Ut, controllableRenders as V, _let_change as Vt, _attr_class as W, _return_change as Wt, _attr_style_item as X, insertBranchBefore as Xt, _attr_style as Y, destroyBranch as Yt, _attr_style_items as Z, removeAndDestroyBranch as Zt, installDynamicTagVar as _, forUntil as _n, setupBranch as _t, _for_in as a, installCatch as an, _style_rule_item as at, _attr_details_or_dialog_open as b, _call as bn, _resumed as bt, _for_to as c, queueAsyncRender as cn, _text_content as ct, _for_until_unkeyed as d, run as dn, toInsertNode as dt, PLACEHOLDER_DISMISS_REGISTER_ID as en, _attrs_partial as et, _if as f, runEffects as fn, _content as ft, dynamicTagScript as g, forTo as gn, createBranch as gt, addAwaitCounter as h, forOf as hn, createAndSetupBranch as ht, _dynamic_tag_content as i, caughtError as in, _lifecycle as it, _attr_input_value_default as j, Gen$1 as jn, _const as jt, _attr_input_value as k, ClosestBranch as kn, _closure as kt, _for_to_unkeyed as l, queueEffect as ln, _to_text as lt, _try as m, forIn as mn, _content_resume as mt, _await_promise as n, $signal as nn, _attrs_script as nt, _for_of as o, placeholderShown as on, _style_shell as ot, _show as p, runId as pn, _content_closures as pt, _attr_content as q, _var_change as qt, _dynamic_tag as r, $signalReset as rn, _html as rt, _for_of_unkeyed as s, prepareEffects as sn, _text as st, _await_content as t, _on as tn, _attrs_partial_content as tt, _for_until as u, queueRender as un, insertChildNodes as ut, patchDynamicTag as v, _assert_hoist as vn, _el as vt, _attr_input_checkedValue as w, Params as wn, initEmbedded as wt, _attr_details_or_dialog_open_default as x, withBranches as xn, _var_resume as xt, renderCatch as y, _hoist_read_error as yn, _resume_dynamic_tag_var as yt, _controllable_select as z, TagVariable as zn, _if_closure as zt };
|
package/dist/debug/dom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
3
|
+
const require_control_flow = require("./dom-CI0Vojyk.js");
|
|
4
4
|
//#region src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
|
@@ -207,19 +207,18 @@ const _load_template = /*@__PURE__*/ require_control_flow.withLazy((id, load) =>
|
|
|
207
207
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r["params"] || noop }))));
|
|
208
208
|
return lazyTemplate;
|
|
209
209
|
});
|
|
210
|
-
const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((
|
|
210
|
+
const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((load) => {
|
|
211
211
|
let pending;
|
|
212
212
|
let renderer;
|
|
213
213
|
const insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
214
|
-
return (owner) => {
|
|
215
|
-
|
|
216
|
-
if (renderer) require_control_flow.queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
214
|
+
return (owner, child, marker) => {
|
|
215
|
+
if (renderer) require_control_flow.queueRender(child, insertCached, -1, marker);
|
|
217
216
|
else {
|
|
218
217
|
const awaitCounter = require_control_flow.addAwaitCounter(owner);
|
|
219
218
|
child[require_control_flow.Load] ||= /* @__PURE__ */ new Map();
|
|
220
219
|
(pending ||= load()).then((mod) => {
|
|
221
|
-
renderer
|
|
222
|
-
require_control_flow.queueAsyncRender(child, (child) => insertLoaded(renderer, child,
|
|
220
|
+
renderer ||= require_control_flow._content("", ...mod._)();
|
|
221
|
+
require_control_flow.queueAsyncRender(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
223
222
|
}, loadFailed(child, awaitCounter));
|
|
224
223
|
}
|
|
225
224
|
};
|
|
@@ -359,9 +358,12 @@ exports._el_read = require_control_flow._el_read;
|
|
|
359
358
|
exports._for_closure = require_control_flow._for_closure;
|
|
360
359
|
exports._for_in = require_control_flow._for_in;
|
|
361
360
|
exports._for_of = require_control_flow._for_of;
|
|
361
|
+
exports._for_of_unkeyed = require_control_flow._for_of_unkeyed;
|
|
362
362
|
exports._for_selector = require_control_flow._for_selector;
|
|
363
363
|
exports._for_to = require_control_flow._for_to;
|
|
364
|
+
exports._for_to_unkeyed = require_control_flow._for_to_unkeyed;
|
|
364
365
|
exports._for_until = require_control_flow._for_until;
|
|
366
|
+
exports._for_until_unkeyed = require_control_flow._for_until_unkeyed;
|
|
365
367
|
exports._global_read = require_control_flow._global_read;
|
|
366
368
|
exports._hoist = require_control_flow._hoist;
|
|
367
369
|
exports._hoist_read_error = require_control_flow._hoist_read_error;
|
|
@@ -383,7 +385,7 @@ exports._load_template = _load_template;
|
|
|
383
385
|
exports._load_visible_trigger = _load_visible_trigger;
|
|
384
386
|
exports._on = require_control_flow._on;
|
|
385
387
|
exports._or = require_control_flow._or;
|
|
386
|
-
exports.
|
|
388
|
+
exports._resume_dynamic_tag_var = require_control_flow._resume_dynamic_tag_var;
|
|
387
389
|
exports._resumed = require_control_flow._resumed;
|
|
388
390
|
exports._return = require_control_flow._return;
|
|
389
391
|
exports._return_change = require_control_flow._return_change;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as _attrs_content, A as _attr_input_value_attribute_default, An as EndNode, At as _closure_get, B as _controllable_textarea, Bt as _let, C as _attr_input_checked, Cn as Owner, Ct as init, D as _attr_input_checked_default, Dt as withLazy, E as _attr_input_checkedValue_script, Et as readyFailed, F as _attr_select_value_default, Ft as _global_read, G as _attr_class_item, Gt as _script, Ht as _or, I as _attr_select_value_script, It as _hoist, J as _attr_nonce, Jt as _assert_init, K as _attr_class_items, Kt as _var, L as _controllable_input, Lt as _hoist_resume, M as _attr_input_value_dynamic_default, Mn as Global, Mt as _el_read, N as _attr_input_value_script, Nn as Load, Nt as _for_closure, O as _attr_input_checked_script, Ot as _child_setup, P as _attr_select_value, Pt as _for_selector, Q as _attrs, Qt as syncGen, R as _controllable_open, Rn as StartNode, Rt as _id, S as _attr_details_or_dialog_open_script, Sn as Clone, St as getRegisteredWithScope, T as _attr_input_checkedValue_default, Tn as Setup, Tt as ready, U as _attr, Ut as _return, Vt as _let_change, W as _attr_class, Wt as _return_change, X as _attr_style_item, Xt as insertBranchBefore, Y as _attr_style, Yt as destroyBranch, Z as _attr_style_items, Zt as removeAndDestroyBranch, _n as forUntil, _t as setupBranch, a as _for_in, at as _style_rule_item, b as _attr_details_or_dialog_open, bn as _call, bt as _resumed, c as _for_to, cn as queueAsyncRender, ct as _text_content, d as _for_until_unkeyed, dn as run, dt as toInsertNode, et as _attrs_partial, f as _if, fn as runEffects, ft as _content, gn as forTo, gt as createBranch, h as addAwaitCounter, hn as forOf, ht as createAndSetupBranch, i as _dynamic_tag_content, it as _lifecycle, j as _attr_input_value_default, jt as _const, k as _attr_input_value, kt as _closure, l as _for_to_unkeyed, ln as queueEffect, lt as _to_text, m as _try, mn as forIn, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_script, o as _for_of, ot as _style_shell, p as _show, pn as runId, pt as _content_closures, q as _attr_content, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _html, s as _for_of_unkeyed, sn as prepareEffects, st as _text, t as _await_content, tn as _on, tt as _attrs_partial_content, u as _for_until, un as queueRender, ut as insertChildNodes, v as patchDynamicTag, vn as _assert_hoist, vt as _el, w as _attr_input_checkedValue, wn as Params, wt as initEmbedded, x as _attr_details_or_dialog_open_default, xt as _var_resume, y as renderCatch, yn as _hoist_read_error, yt as _resume_dynamic_tag_var, z as _controllable_select, zn as TagVariable, zt as _if_closure } from "./dom-tl43c2wO.mjs";
|
|
2
2
|
//#region src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
|
@@ -205,19 +205,18 @@ const _load_template = /*@__PURE__*/ withLazy((id, load) => {
|
|
|
205
205
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r["params"] || noop }))));
|
|
206
206
|
return lazyTemplate;
|
|
207
207
|
});
|
|
208
|
-
const _load_setup = /*@__PURE__*/ withLazy((
|
|
208
|
+
const _load_setup = /*@__PURE__*/ withLazy((load) => {
|
|
209
209
|
let pending;
|
|
210
210
|
let renderer;
|
|
211
211
|
const insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
212
|
-
return (owner) => {
|
|
213
|
-
|
|
214
|
-
if (renderer) queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
212
|
+
return (owner, child, marker) => {
|
|
213
|
+
if (renderer) queueRender(child, insertCached, -1, marker);
|
|
215
214
|
else {
|
|
216
215
|
const awaitCounter = addAwaitCounter(owner);
|
|
217
216
|
child[Load] ||= /* @__PURE__ */ new Map();
|
|
218
217
|
(pending ||= load()).then((mod) => {
|
|
219
|
-
renderer
|
|
220
|
-
queueAsyncRender(child, (child) => insertLoaded(renderer, child,
|
|
218
|
+
renderer ||= _content("", ...mod._)();
|
|
219
|
+
queueAsyncRender(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
221
220
|
}, loadFailed(child, awaitCounter));
|
|
222
221
|
}
|
|
223
222
|
};
|
|
@@ -290,4 +289,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
290
289
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
291
290
|
}
|
|
292
291
|
//#endregion
|
|
293
|
-
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _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, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _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,
|
|
292
|
+
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _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, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _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, _resume_dynamic_tag_var, _resumed, _return, _return_change, _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 };
|