marko 6.3.35 → 6.3.37
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/dist/common/meta.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-var.feat.js +7 -0
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +6 -0
- package/dist/debug/{dom-Bt4OoZ-j.js → dom-BkYlHM4b.js} +46 -12
- package/dist/debug/{dom-B57LrRnX.mjs → dom-woc_wRhN.mjs} +29 -13
- package/dist/debug/dom.js +7 -7
- package/dist/debug/dom.mjs +7 -7
- package/dist/debug/html.js +6 -4
- package/dist/debug/html.mjs +6 -4
- package/dist/dom/abort-signal.d.ts +2 -0
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +2 -0
- 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-var.feat.d.ts +1 -0
- package/dist/dom/dynamic-tag-var.feat.js +3 -0
- package/dist/dom/dynamic-tag-var.feat.mjs +4 -0
- package/dist/dom/load.d.ts +3 -3
- package/dist/dom/resume.d.ts +1 -0
- package/dist/{dom-BeF9xIzO.js → dom-B15s3PHD.js} +132 -120
- package/dist/{dom-BP2XSglG.mjs → dom-CPUybM_C.mjs} +19 -17
- package/dist/dom.js +57 -60
- package/dist/dom.mjs +28 -31
- package/dist/html.js +4 -4
- package/dist/html.mjs +4 -4
- package/dist/translator/index.js +177 -43
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/util/runtime.d.ts +1 -1
- package/dist/translator/util/traverse.d.ts +2 -0
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
8
8
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
9
9
|
}), runRender = (render) => {
|
|
10
10
|
(!branchesEnabled || render.b.F?.H !== 0) && render.c(render.b, render.d);
|
|
11
|
-
}, catchEnabled, delegate = (type, handler) => handler[1 + type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, destroyNestedScopes = function destroyNestedScopes(scope) {
|
|
11
|
+
}, catchEnabled, abortsEnabled, subscriptionsEnabled, delegate = (type, handler) => handler[1 + type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, destroyNestedScopes = function destroyNestedScopes(scope) {
|
|
12
12
|
scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
|
|
13
13
|
}, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), currentNode, walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
14
14
|
let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
|
|
@@ -26,7 +26,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
26
26
|
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
27
27
|
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
28
28
|
walkNextSibling();
|
|
29
|
-
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, isResuming, cloneCache = {}, R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
29
|
+
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
30
30
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
31
31
|
let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
|
|
32
32
|
for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
|
|
@@ -52,7 +52,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
52
52
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
53
53
|
return (scope, newRenderer, getInput) => {
|
|
54
54
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
55
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(normalizedRenderer)) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) if (setConditionalRenderer(scope, nodeAccessor, normalizedRenderer || (getContent ? getContent(scope) : void 0), createBranchWithTagNameOrRenderer), getTagVar && (scope[childScopeAccessor] ? scope[childScopeAccessor].T = (value) => getTagVar()(scope, value) : getTagVar()(scope, void 0)), typeof normalizedRenderer == "string") {
|
|
55
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(normalizedRenderer)) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) if (setConditionalRenderer(scope, nodeAccessor, normalizedRenderer || (getContent ? getContent(scope) : void 0), createBranchWithTagNameOrRenderer), getTagVar && (scope[childScopeAccessor] ? (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value), typeof normalizedRenderer == "string" && bindNativeTagVar?.(scope[childScopeAccessor])) : getTagVar()(scope, void 0)), typeof normalizedRenderer == "string") {
|
|
56
56
|
if (getContent) {
|
|
57
57
|
let content = getContent(scope);
|
|
58
58
|
setConditionalRenderer(scope[childScopeAccessor], "a", content, createAndSetupBranch), content.f && subscribeToScopeSet(content.e, content.f, scope[childScopeAccessor].Aa);
|
|
@@ -80,7 +80,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
80
80
|
return (scope, renderer) => {
|
|
81
81
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(renderer)) && (setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch), renderer?.f && subscribeToScopeSet(renderer.e, renderer.f, scope[childScopeAccessor])), renderer) for (let accessor in renderer.g) renderer.g[accessor](scope[childScopeAccessor], renderer.h[accessor]);
|
|
82
82
|
};
|
|
83
|
-
}), _resume_dynamic_tag = /*@__PURE__*/ withBranches(() => _resume("d", dynamicTagScript)), loop = /*@__PURE__*/ withBranches((forEach) => (nodeAccessor, template, walks, setup, params) => {
|
|
83
|
+
}), bindNativeTagVar, _resume_dynamic_tag = /*@__PURE__*/ withBranches(() => _resume("d", dynamicTagScript)), loop = /*@__PURE__*/ withBranches((forEach) => (nodeAccessor, template, walks, setup, params) => {
|
|
84
84
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
85
85
|
let scopesAccessor = "A" + nodeAccessor, keyedScopesAccessor = "O" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
86
86
|
return (scope, value) => {
|
|
@@ -221,7 +221,7 @@ function run() {
|
|
|
221
221
|
runEffects(effects);
|
|
222
222
|
}
|
|
223
223
|
function queueAsyncRender(scope, signal, value) {
|
|
224
|
-
queueRender(scope, signal, -1, value)
|
|
224
|
+
pendingRenders.length || queueMicrotask(run), queueRender(scope, signal, -1, value);
|
|
225
225
|
}
|
|
226
226
|
function prepareEffects(fn) {
|
|
227
227
|
let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
|
@@ -258,12 +258,12 @@ function $signalReset(scope, id) {
|
|
|
258
258
|
ctrl && (scope.A[id] = void 0, rendering ? queueEffect(ctrl, abort) : abort(ctrl));
|
|
259
259
|
}
|
|
260
260
|
function $signal(scope, id) {
|
|
261
|
-
return trackCleanup(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
|
|
261
|
+
return abortsEnabled = 1, trackCleanup(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
|
|
262
262
|
}
|
|
263
263
|
/** Enrols `scope` with its branch so destroying the branch cleans it up. */
|
|
264
264
|
function trackCleanup(scope, subscribers) {
|
|
265
265
|
let branch = scope.F;
|
|
266
|
-
branch && (branch.B ||= /* @__PURE__ */ new Set()).add(scope), subscribers && (scope.Z ||= []).push(subscribers);
|
|
266
|
+
branch && (branch.B ||= /* @__PURE__ */ new Set()).add(scope), subscribers && (subscriptionsEnabled = 1, (scope.Z ||= []).push(subscribers));
|
|
267
267
|
}
|
|
268
268
|
function abort(ctrl) {
|
|
269
269
|
ctrl.abort();
|
|
@@ -336,8 +336,7 @@ function destroyScope(scope) {
|
|
|
336
336
|
scope.H && (destroyNestedScopes(scope), cleanupScope(scope));
|
|
337
337
|
}
|
|
338
338
|
function cleanupScope(scope) {
|
|
339
|
-
scope.Z?.forEach(unsubscribe, scope);
|
|
340
|
-
for (let id in scope.A) $signalReset(scope, id);
|
|
339
|
+
if (subscriptionsEnabled && scope.Z?.forEach(unsubscribe, scope), abortsEnabled) for (let id in scope.A) $signalReset(scope, id);
|
|
341
340
|
}
|
|
342
341
|
function unsubscribe(subscribers) {
|
|
343
342
|
subscribers.delete(this);
|
|
@@ -506,6 +505,9 @@ function ready(readyId) {
|
|
|
506
505
|
(readyIds ||= /* @__PURE__ */ new Set()).add(readyId);
|
|
507
506
|
for (let renderId in curRenders) runResumeEffects(curRenders[renderId]);
|
|
508
507
|
}
|
|
508
|
+
function withLazy(runtime) {
|
|
509
|
+
return lazyEnabled = 1, runtime;
|
|
510
|
+
}
|
|
509
511
|
function initEmbedded(readyId, runtimeId) {
|
|
510
512
|
embedRenders || (embedRenders = /* @__PURE__ */ new Map(), new MutationObserver(() => {
|
|
511
513
|
for (let [anchor, [renderId, scopes]] of embedRenders) if (!anchor.isConnected) {
|
|
@@ -576,7 +578,7 @@ function init(runtimeId = "M") {
|
|
|
576
578
|
for (visit of visits = render.v) if (lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), visitType === "*") {
|
|
577
579
|
let prev = visit.previousSibling;
|
|
578
580
|
visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
|
|
579
|
-
} else branchesEnabled ? (visitBranches ||= createVisitBranches())() : render.b && (visits[retained++] = visit);
|
|
581
|
+
} else branchesEnabled ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && (visits[retained++] = visit);
|
|
580
582
|
return embedRenders && !embedAnchor && visit && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]), visits.length = retained, effects;
|
|
581
583
|
}, render.w = () => {
|
|
582
584
|
walk(), runResumeEffects(render);
|
|
@@ -693,7 +695,7 @@ function _attr_style_item(element, name, value) {
|
|
|
693
695
|
}
|
|
694
696
|
function _style_shell(scope, nodeAccessor) {
|
|
695
697
|
let element = scope[nodeAccessor], id = _id(scope);
|
|
696
|
-
_attr_nonce(scope, nodeAccessor), element
|
|
698
|
+
_attr_nonce(scope, nodeAccessor), _attr(element, "class", id), _text_content(element, "." + id + "~*{}");
|
|
697
699
|
}
|
|
698
700
|
function _style_rule_item(element, name, value) {
|
|
699
701
|
let text = element.textContent, decl = name + ":" + escapeStyleValue(_to_text(value)) + ";", start = text.indexOf("{" + name + ":");
|
|
@@ -967,14 +969,14 @@ function observeOnce(scope, nodeAccessor, init, callback) {
|
|
|
967
969
|
(scope["N" + nodeAccessor] ||= new MutationObserver(callback)).observe(scope[nodeAccessor], init);
|
|
968
970
|
}
|
|
969
971
|
function syncControllableFormInput(el, hasChanged, onChange) {
|
|
970
|
-
el._ = onChange, delegate("input", handleChange), el.form && delegate("reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange);
|
|
972
|
+
el._ = onChange, el.c = hasChanged, delegate("input", handleChange), el.form && delegate("reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange);
|
|
971
973
|
}
|
|
972
974
|
function handleChange(ev) {
|
|
973
975
|
ev.target._?.(ev);
|
|
974
976
|
}
|
|
975
977
|
function handleFormReset(ev) {
|
|
976
978
|
let handlers = [];
|
|
977
|
-
for (let el of ev.target.elements) el._ &&
|
|
979
|
+
for (let el of ev.target.elements) el._ && el.c(el) && handlers.push(el._);
|
|
978
980
|
requestAnimationFrame(() => {
|
|
979
981
|
if (!ev.defaultPrevented) for (let change of handlers) change();
|
|
980
982
|
});
|
|
@@ -988,9 +990,6 @@ function hasCheckboxChanged(el) {
|
|
|
988
990
|
function hasSelectChanged(el) {
|
|
989
991
|
for (let opt of el.options) if (opt.selected !== opt.defaultSelected) return !0;
|
|
990
992
|
}
|
|
991
|
-
function hasFormElementChanged(el) {
|
|
992
|
-
return el.options ? hasSelectChanged(el) : hasValueChanged(el) || hasCheckboxChanged(el);
|
|
993
|
-
}
|
|
994
993
|
function normalizeStrProp(value) {
|
|
995
994
|
return normalizeAttrValue(value) || "";
|
|
996
995
|
}
|
|
@@ -1129,6 +1128,9 @@ function rendererKey(renderer) {
|
|
|
1129
1128
|
function patchDynamicTag(fn) {
|
|
1130
1129
|
_dynamic_tag = fn(_dynamic_tag);
|
|
1131
1130
|
}
|
|
1131
|
+
function installDynamicTagVar(bind) {
|
|
1132
|
+
bindNativeTagVar = bind;
|
|
1133
|
+
}
|
|
1132
1134
|
function dynamicTagScript(branch) {
|
|
1133
1135
|
_attrs_script(branch, "a");
|
|
1134
1136
|
}
|
|
@@ -1147,4 +1149,4 @@ function byFirstArg(name) {
|
|
|
1147
1149
|
return name;
|
|
1148
1150
|
}
|
|
1149
1151
|
//#endregion
|
|
1150
|
-
export {
|
|
1152
|
+
export { _attrs_script as $, prepareEffects as $t, _attr_input_value_script as A, _hoist as At, _attr as B, _var as Bt, _attr_input_checkedValue_script as C, _child_setup as Ct, _attr_input_value_attribute_default as D, _el_read as Dt, _attr_input_value as E, _const as Et, _controllable_open as F, _let_change as Ft, _attr_nonce as G, removeAndDestroyBranch as Gt, _attr_class_item as H, _assert_init as Ht, _controllable_select as I, _or as It, _attr_style_items as J, $signal as Jt, _attr_style as K, syncGen as Kt, _controllable_textarea as L, _return as Lt, _attr_select_value_default as M, _id as Mt, _attr_select_value_script as N, _if_closure as Nt, _attr_input_value_default as O, _for_closure as Ot, _controllable_input as P, _let as Pt, _attrs_partial_content as Q, placeholderShown as Qt, controllableRenders as R, _return_change as Rt, _attr_input_checkedValue_default as S, withLazy as St, _attr_input_checked_script as T, _closure_get as Tt, _attr_class_items as U, destroyBranch as Ut, _attr_class as V, _var_change as Vt, _attr_content as W, insertBranchBefore as Wt, _attrs_content as X, caughtError as Xt, _attrs as Y, $signalReset as Yt, _attrs_partial as Z, installCatch as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a, forIn as an, _text_content as at, _attr_input_checked as b, initEmbedded as bt, _for_until as c, forUntil as cn, toInsertNode as ct, _show as d, decodeAccessor as dn, _content_resume as dt, queueAsyncRender as en, _html as et, _try as f, createAndSetupBranch as ft, renderCatch as g, _resume as gt, patchDynamicTag as h, _el as ht, _dynamic_tag_content as i, runId as in, _text as it, _attr_select_value as j, _hoist_resume as jt, _attr_input_value_dynamic_default as k, _for_selector as kt, _if as l, _assert_hoist as ln, _content as lt, installDynamicTagVar as m, setupBranch as mt, _await_promise as n, run as nn, _style_rule_item as nt, _for_of as o, forOf as on, _to_text as ot, addAwaitCounter as p, createBranch as pt, _attr_style_item as q, _on as qt, _dynamic_tag as r, runEffects as rn, _style_shell as rt, _for_to as s, forTo as sn, insertChildNodes as st, _await_content as t, queueEffect as tn, _lifecycle as tt, _resume_dynamic_tag as u, _call as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, getRegisteredWithScope as vt, _attr_input_checked_default as w, _closure as wt, _attr_input_checkedValue as x, ready as xt, _attr_details_or_dialog_open_script as y, init as yt, controllableScripts as z, _script as zt };
|
package/dist/dom.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
2
|
-
require_control_flow.
|
|
1
|
+
let require_control_flow = require("./dom-B15s3PHD.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
2
|
+
require_control_flow.yt($global.runtimeId);
|
|
3
3
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
4
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
5
5
|
}, compat = {
|
|
6
|
-
patchDynamicTag: require_control_flow.
|
|
7
|
-
queueEffect: require_control_flow
|
|
6
|
+
patchDynamicTag: require_control_flow.h,
|
|
7
|
+
queueEffect: require_control_flow.tn,
|
|
8
8
|
init(warp10Noop) {
|
|
9
|
-
require_control_flow.
|
|
9
|
+
require_control_flow.gt("$C_s", (scope) => {
|
|
10
10
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
11
11
|
let resolved = classEventResolver(scope[key], scope);
|
|
12
12
|
resolved !== scope[key] && (scope[key] = resolved);
|
|
13
13
|
}
|
|
14
|
-
}), require_control_flow.
|
|
14
|
+
}), require_control_flow.gt("$C_b", warp10Noop);
|
|
15
15
|
},
|
|
16
16
|
setClassEventResolver(fn) {
|
|
17
17
|
classEventResolver = fn;
|
|
@@ -35,36 +35,62 @@ let require_control_flow = require("./dom-BeF9xIzO.js"), empty = [], rest = Symb
|
|
|
35
35
|
branch.S = startNode, branch.K = endNode;
|
|
36
36
|
},
|
|
37
37
|
runComponentEffects() {
|
|
38
|
-
this.effects && require_control_flow.
|
|
38
|
+
this.effects && require_control_flow.rn(this.effects);
|
|
39
39
|
},
|
|
40
40
|
runComponentDestroy() {
|
|
41
|
-
this.scope && require_control_flow.
|
|
41
|
+
this.scope && require_control_flow.Ut(this.scope);
|
|
42
42
|
},
|
|
43
43
|
resolveRegistered(value, $global) {
|
|
44
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.
|
|
44
|
+
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.vt(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
45
45
|
},
|
|
46
46
|
createRenderer(params, clone) {
|
|
47
|
-
let renderer = require_control_flow.
|
|
47
|
+
let renderer = require_control_flow.lt("", 0, 0, 0, params)();
|
|
48
48
|
return renderer.b = (branch) => {
|
|
49
49
|
let cloned = clone();
|
|
50
50
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
51
51
|
}, renderer;
|
|
52
52
|
},
|
|
53
53
|
render(out, component, renderer, args) {
|
|
54
|
-
require_control_flow.
|
|
54
|
+
require_control_flow.yt(out.global.runtimeId);
|
|
55
55
|
let branch = component.scope, created = 0;
|
|
56
56
|
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
57
57
|
let input = args[0], normalizedInput = args[0] = {};
|
|
58
58
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
59
59
|
}
|
|
60
|
-
if (component.effects = require_control_flow
|
|
61
|
-
branch ||= (created = 1, component.scope = require_control_flow.
|
|
62
|
-
}), created) return require_control_flow.
|
|
60
|
+
if (component.effects = require_control_flow.$t(() => {
|
|
61
|
+
branch ||= (created = 1, component.scope = require_control_flow.ft(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
62
|
+
}), created) return require_control_flow.ct(branch.S, branch.K);
|
|
63
63
|
}
|
|
64
64
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
65
|
-
let renderer = require_control_flow.
|
|
66
|
-
return renderer.mount = mount, renderer._ = renderer, require_control_flow.
|
|
67
|
-
}
|
|
65
|
+
let renderer = require_control_flow.lt(id, template, walks, setup, inputSignal)();
|
|
66
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.gt(id, renderer);
|
|
67
|
+
}, _load_template = /*@__PURE__*/ require_control_flow.St((id, load) => {
|
|
68
|
+
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
69
|
+
let awaitCounter = require_control_flow.p(branch);
|
|
70
|
+
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
71
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.en(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
72
|
+
}, loadFailed(branch, awaitCounter));
|
|
73
|
+
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
74
|
+
return lazyTemplate;
|
|
75
|
+
}), _load_setup = /*@__PURE__*/ require_control_flow.St((nodeAccessor, childScopeAccessor, load) => {
|
|
76
|
+
nodeAccessor = require_control_flow.dn(nodeAccessor), childScopeAccessor = require_control_flow.dn(childScopeAccessor);
|
|
77
|
+
let pending, renderer;
|
|
78
|
+
return (owner) => {
|
|
79
|
+
let child = owner[childScopeAccessor];
|
|
80
|
+
if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
|
|
81
|
+
else {
|
|
82
|
+
let awaitCounter = require_control_flow.p(owner);
|
|
83
|
+
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
84
|
+
renderer = require_control_flow.lt("", ...mod._)(), require_control_flow.en(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
|
|
85
|
+
}, loadFailed(child, awaitCounter));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}), _load_signal = /*@__PURE__*/ require_control_flow.St((load) => {
|
|
89
|
+
let pending, signal;
|
|
90
|
+
return (scope, value) => {
|
|
91
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.in ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => require_control_flow.en(scope, signal = mod._, value), () => 0);
|
|
92
|
+
};
|
|
93
|
+
});
|
|
68
94
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
69
95
|
//#region src/common/attr-tag.ts
|
|
70
96
|
function attrTag(attrs) {
|
|
@@ -102,75 +128,46 @@ function mount(input = {}, reference, position) {
|
|
|
102
128
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
103
129
|
break;
|
|
104
130
|
}
|
|
105
|
-
let curValue, args = this.d, effects = require_control_flow
|
|
106
|
-
branch = require_control_flow.
|
|
131
|
+
let curValue, args = this.d, effects = require_control_flow.$t(() => {
|
|
132
|
+
branch = require_control_flow.pt($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
107
133
|
curValue = newValue;
|
|
108
134
|
}, this.c?.(branch), args?.(branch, input);
|
|
109
135
|
});
|
|
110
|
-
return require_control_flow.
|
|
136
|
+
return require_control_flow.st(parentNode, nextSibling, branch.S, branch.K), require_control_flow.rn(effects), {
|
|
111
137
|
get value() {
|
|
112
138
|
return curValue;
|
|
113
139
|
},
|
|
114
140
|
set value(newValue) {
|
|
115
|
-
require_control_flow.
|
|
141
|
+
require_control_flow.Vt(branch, newValue);
|
|
116
142
|
},
|
|
117
143
|
update(newInput = {}) {
|
|
118
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
144
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.rn(require_control_flow.$t(() => {
|
|
119
145
|
args(branch, newInput);
|
|
120
146
|
})));
|
|
121
147
|
},
|
|
122
148
|
destroy() {
|
|
123
|
-
require_control_flow.
|
|
149
|
+
require_control_flow.Gt(branch);
|
|
124
150
|
}
|
|
125
151
|
};
|
|
126
152
|
}
|
|
127
153
|
//#endregion
|
|
128
154
|
//#region src/dom/load.ts
|
|
129
|
-
function _load_template(id, load) {
|
|
130
|
-
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
131
|
-
let awaitCounter = require_control_flow.p(branch);
|
|
132
|
-
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
133
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.Qt(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
134
|
-
}, loadFailed(branch, awaitCounter));
|
|
135
|
-
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
136
|
-
return lazyTemplate;
|
|
137
|
-
}
|
|
138
|
-
function _load_setup(nodeAccessor, childScopeAccessor, load) {
|
|
139
|
-
nodeAccessor = require_control_flow.ln(nodeAccessor), childScopeAccessor = require_control_flow.ln(childScopeAccessor);
|
|
140
|
-
let pending, renderer;
|
|
141
|
-
return (owner) => {
|
|
142
|
-
let child = owner[childScopeAccessor];
|
|
143
|
-
if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
|
|
144
|
-
else {
|
|
145
|
-
let awaitCounter = require_control_flow.p(owner);
|
|
146
|
-
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
147
|
-
renderer = require_control_flow.ct("", ...mod._)(), require_control_flow.Qt(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
|
|
148
|
-
}, loadFailed(child, awaitCounter));
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
155
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
153
156
|
let parent = marker.parentNode, values = branch.X, insert = () => {
|
|
154
|
-
require_control_flow.
|
|
157
|
+
require_control_flow.Wt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
155
158
|
}, remaining;
|
|
156
|
-
if (require_control_flow.
|
|
159
|
+
if (require_control_flow.Kt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) {
|
|
157
160
|
let fail = loadFailed(branch, awaitCounter);
|
|
158
161
|
for (let [promise, entry] of values) promise.then((signal) => {
|
|
159
|
-
entry.b = signal, --remaining || require_control_flow.
|
|
160
|
-
require_control_flow.
|
|
162
|
+
entry.b = signal, --remaining || require_control_flow.en(branch, (branch) => {
|
|
163
|
+
require_control_flow.Kt(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
|
|
161
164
|
});
|
|
162
165
|
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
163
|
-
} else require_control_flow.
|
|
166
|
+
} else require_control_flow.mt(renderer, branch), insert();
|
|
164
167
|
}
|
|
165
168
|
function loadFailed(scope, awaitCounter) {
|
|
166
169
|
return (error) => {
|
|
167
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function _load_signal(load) {
|
|
171
|
-
let pending, signal;
|
|
172
|
-
return (scope, value) => {
|
|
173
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.nn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => require_control_flow.Qt(scope, signal = mod._, value), () => 0);
|
|
170
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.en(scope, require_control_flow.g, error);
|
|
174
171
|
};
|
|
175
172
|
}
|
|
176
173
|
function _load_visible_trigger(selector, options) {
|
|
@@ -196,9 +193,9 @@ function _load_race_trigger(...triggers) {
|
|
|
196
193
|
function getSelectorOrResolve(selector, resolve) {
|
|
197
194
|
return document.querySelector(selector) || resolve();
|
|
198
195
|
}
|
|
199
|
-
exports.$signal = require_control_flow.
|
|
196
|
+
exports.$signal = require_control_flow.Jt, exports.$signalReset = require_control_flow.Yt, exports._assert_hoist = require_control_flow.ln, exports._assert_init = require_control_flow.Ht, exports._attr = require_control_flow.B, exports._attr_class = require_control_flow.V, exports._attr_class_item = require_control_flow.H, exports._attr_class_items = require_control_flow.U, exports._attr_content = require_control_flow.W, exports._attr_details_open = require_control_flow._, exports._attr_dialog_open = require_control_flow._, exports._attr_details_open_default = require_control_flow.v, exports._attr_dialog_open_default = require_control_flow.v, exports._attr_details_open_script = require_control_flow.y, exports._attr_dialog_open_script = require_control_flow.y, exports._attr_input_checked = require_control_flow.b, exports._attr_input_checkedValue = require_control_flow.x, exports._attr_input_checkedValue_default = require_control_flow.S, exports._attr_input_checkedValue_script = require_control_flow.C, exports._attr_input_checked_default = require_control_flow.w, exports._attr_input_checked_script = require_control_flow.T, exports._attr_input_value = require_control_flow.E, exports._attr_textarea_value = require_control_flow.E, exports._attr_input_value_attribute_default = require_control_flow.D, exports._attr_input_value_default = require_control_flow.O, exports._attr_textarea_value_default = require_control_flow.O, exports._attr_input_value_dynamic_default = require_control_flow.k, exports._attr_input_value_script = require_control_flow.A, exports._attr_textarea_value_script = require_control_flow.A, exports._attr_nonce = require_control_flow.G, exports._attr_select_value = require_control_flow.j, exports._attr_select_value_default = require_control_flow.M, exports._attr_select_value_script = require_control_flow.N, exports._attr_style = require_control_flow.K, exports._attr_style_item = require_control_flow.q, exports._attr_style_items = require_control_flow.J, exports._attrs = require_control_flow.Y, exports._attrs_content = require_control_flow.X, exports._attrs_partial = require_control_flow.Z, exports._attrs_partial_content = require_control_flow.Q, exports._attrs_script = require_control_flow.$, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.un, exports._child_setup = require_control_flow.Ct, exports._closure = require_control_flow.wt, exports._closure_get = require_control_flow.Tt, exports._const = require_control_flow.Et, exports._content = require_control_flow.lt, exports._content_closures = require_control_flow.ut, exports._content_resume = require_control_flow.dt, exports._controllable_input = require_control_flow.P, exports._controllable_open = require_control_flow.F, exports._controllable_select = require_control_flow.I, exports._controllable_textarea = require_control_flow.L, Object.defineProperty(exports, "_dynamic_tag", {
|
|
200
197
|
enumerable: !0,
|
|
201
198
|
get: function() {
|
|
202
199
|
return require_control_flow.r;
|
|
203
200
|
}
|
|
204
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.
|
|
201
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.ht, exports._el_read = require_control_flow.Dt, exports._for_closure = require_control_flow.Ot, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.kt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._hoist = require_control_flow.At, exports._hoist_resume = require_control_flow.jt, exports._html = require_control_flow.et, exports._id = require_control_flow.Mt, exports._if = require_control_flow.l, exports._if_closure = require_control_flow.Nt, exports._let = require_control_flow.Pt, exports._let_change = require_control_flow.Ft, exports._lifecycle = require_control_flow.tt, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.qt, exports._or = require_control_flow.It, exports._resume = require_control_flow.gt, exports._resume_dynamic_tag = require_control_flow.u, exports._return = require_control_flow.Lt, exports._return_change = require_control_flow.Rt, exports._script = require_control_flow.zt, exports._show = require_control_flow.d, exports._style_rule_item = require_control_flow.nt, exports._style_shell = require_control_flow.rt, exports._template = _template, exports._text = require_control_flow.it, exports._text_content = require_control_flow.at, exports._to_text = require_control_flow.ot, exports._try = require_control_flow.f, exports._var = require_control_flow.Bt, exports._var_change = require_control_flow.Vt, exports._var_resume = require_control_flow._t, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.an, exports.forOf = require_control_flow.on, exports.forTo = require_control_flow.sn, exports.forUntil = require_control_flow.cn, exports.init = require_control_flow.yt, exports.initEmbedded = require_control_flow.bt, exports.ready = require_control_flow.xt, exports.run = require_control_flow.nn;
|
package/dist/dom.mjs
CHANGED
|
@@ -64,8 +64,34 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
64
64
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
65
65
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
66
66
|
return renderer.mount = mount, renderer._ = renderer, _resume(id, renderer);
|
|
67
|
-
}
|
|
68
|
-
|
|
67
|
+
}, _load_template = /*@__PURE__*/ withLazy((id, load) => {
|
|
68
|
+
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
69
|
+
let awaitCounter = addAwaitCounter(branch);
|
|
70
|
+
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
71
|
+
Object.assign(lazyTemplate, renderer), queueAsyncRender(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
72
|
+
}, loadFailed(branch, awaitCounter));
|
|
73
|
+
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
74
|
+
return lazyTemplate;
|
|
75
|
+
}), _load_setup = /*@__PURE__*/ withLazy((nodeAccessor, childScopeAccessor, load) => {
|
|
76
|
+
nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
|
|
77
|
+
let pending, renderer;
|
|
78
|
+
return (owner) => {
|
|
79
|
+
let child = owner[childScopeAccessor];
|
|
80
|
+
if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
|
|
81
|
+
else {
|
|
82
|
+
let awaitCounter = addAwaitCounter(owner);
|
|
83
|
+
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
84
|
+
renderer = _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
|
|
85
|
+
}, loadFailed(child, awaitCounter));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}), _load_signal = /*@__PURE__*/ withLazy((load) => {
|
|
89
|
+
let pending, signal;
|
|
90
|
+
return (scope, value) => {
|
|
91
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
import { $ as _attrs_script, $t as prepareEffects, A as _attr_input_value_script, At as _hoist, B as _attr, Bt as _var, C as _attr_input_checkedValue_script, Ct as _child_setup, D as _attr_input_value_attribute_default, Dt as _el_read, E as _attr_input_value, Et as _const, F as _controllable_open, Ft as _let_change, G as _attr_nonce, Gt as removeAndDestroyBranch, H as _attr_class_item, Ht as _assert_init, I as _controllable_select, It as _or, J as _attr_style_items, Jt as $signal, K as _attr_style, Kt as syncGen, L as _controllable_textarea, Lt as _return, M as _attr_select_value_default, Mt as _id, N as _attr_select_value_script, Nt as _if_closure, O as _attr_input_value_default, Ot as _for_closure, P as _controllable_input, Pt as _let, Q as _attrs_partial_content, Rt as _return_change, S as _attr_input_checkedValue_default, St as withLazy, T as _attr_input_checked_script, Tt as _closure_get, U as _attr_class_items, Ut as destroyBranch, V as _attr_class, Vt as _var_change, W as _attr_content, Wt as insertBranchBefore, X as _attrs_content, Y as _attrs, Yt as $signalReset, Z as _attrs_partial, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as forIn, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as forUntil, ct as toInsertNode, d as _show, dn as decodeAccessor, dt as _content_resume, en as queueAsyncRender, et as _html, f as _try, ft as createAndSetupBranch, g as renderCatch, gt as _resume, h as patchDynamicTag, ht as _el, i as _dynamic_tag_content, in as runId, it as _text, j as _attr_select_value, jt as _hoist_resume, k as _attr_input_value_dynamic_default, kt as _for_selector, l as _if, ln as _assert_hoist, lt as _content, mt as setupBranch, n as _await_promise, nn as run, nt as _style_rule_item, o as _for_of, on as forOf, ot as _to_text, p as addAwaitCounter, pt as createBranch, q as _attr_style_item, qt as _on, r as _dynamic_tag, rn as runEffects, rt as _style_shell, s as _for_to, sn as forTo, st as insertChildNodes, t as _await_content, tn as queueEffect, tt as _lifecycle, u as _resume_dynamic_tag, un as _call, ut as _content_closures, v as _attr_details_or_dialog_open_default, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as _closure, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yt as init, zt as _script } from "./dom-CPUybM_C.mjs";
|
|
69
95
|
//#region src/common/attr-tag.ts
|
|
70
96
|
function attrTag(attrs) {
|
|
71
97
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -126,29 +152,6 @@ function mount(input = {}, reference, position) {
|
|
|
126
152
|
}
|
|
127
153
|
//#endregion
|
|
128
154
|
//#region src/dom/load.ts
|
|
129
|
-
function _load_template(id, load) {
|
|
130
|
-
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
131
|
-
let awaitCounter = addAwaitCounter(branch);
|
|
132
|
-
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
133
|
-
Object.assign(lazyTemplate, renderer), queueAsyncRender(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
134
|
-
}, loadFailed(branch, awaitCounter));
|
|
135
|
-
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
136
|
-
return lazyTemplate;
|
|
137
|
-
}
|
|
138
|
-
function _load_setup(nodeAccessor, childScopeAccessor, load) {
|
|
139
|
-
nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
|
|
140
|
-
let pending, renderer;
|
|
141
|
-
return (owner) => {
|
|
142
|
-
let child = owner[childScopeAccessor];
|
|
143
|
-
if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
|
|
144
|
-
else {
|
|
145
|
-
let awaitCounter = addAwaitCounter(owner);
|
|
146
|
-
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
147
|
-
renderer = _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
|
|
148
|
-
}, loadFailed(child, awaitCounter));
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
155
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
153
156
|
let parent = marker.parentNode, values = branch.X, insert = () => {
|
|
154
157
|
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
@@ -167,12 +170,6 @@ function loadFailed(scope, awaitCounter) {
|
|
|
167
170
|
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), queueAsyncRender(scope, renderCatch, error);
|
|
168
171
|
};
|
|
169
172
|
}
|
|
170
|
-
function _load_signal(load) {
|
|
171
|
-
let pending, signal;
|
|
172
|
-
return (scope, value) => {
|
|
173
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
173
|
function _load_visible_trigger(selector, options) {
|
|
177
174
|
let pending, el;
|
|
178
175
|
return (load) => () => (pending ||= new Promise((resolve) => (el = getSelectorOrResolve(selector, resolve)) && new IntersectionObserver((entries, io) => entries.some((entry) => entry.isIntersecting) && resolve(io.disconnect()), options).observe(el))).then(load);
|
package/dist/html.js
CHANGED
|
@@ -255,15 +255,15 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
255
255
|
if (_scope_id(), _html(`<${renderer}${_attrs(input, "a", branchId, renderer)}>`), !voidElementsReg.test(renderer)) {
|
|
256
256
|
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
257
257
|
if (renderer === "textarea") _html(_attr_textarea_value(branchId, "a", input.value, input.valueChange, 1));
|
|
258
|
-
else
|
|
259
|
-
if (typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
260
|
-
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent, 1) : _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
258
|
+
else {
|
|
259
|
+
if (renderContent && typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
260
|
+
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent ? () => _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason) : void 0, 1) : renderContent && _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
261
261
|
}
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
265
|
needsScript && _script(branchId, "d"), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
266
|
-
})();
|
|
266
|
+
})(), result = _el(branchId, "e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
269
269
|
if (renderer) try {
|
package/dist/html.mjs
CHANGED
|
@@ -255,15 +255,15 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
255
255
|
if (_scope_id(), _html(`<${renderer}${_attrs(input, "a", branchId, renderer)}>`), !voidElementsReg.test(renderer)) {
|
|
256
256
|
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
257
257
|
if (renderer === "textarea") _html(_attr_textarea_value(branchId, "a", input.value, input.valueChange, 1));
|
|
258
|
-
else
|
|
259
|
-
if (typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
260
|
-
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent, 1) : _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
258
|
+
else {
|
|
259
|
+
if (renderContent && typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
260
|
+
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent ? () => _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason) : void 0, 1) : renderContent && _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
261
261
|
}
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
265
|
needsScript && _script(branchId, "d"), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
266
|
-
})();
|
|
266
|
+
})(), result = _el(branchId, "e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
269
269
|
if (renderer) try {
|