marko 6.4.10 → 6.4.11
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/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/helpers.d.ts +1 -1
- package/dist/common/types.d.ts +4 -3
- 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 +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- 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-C1V5vpFs.mjs → dom-DjUZd-9y.mjs} +198 -214
- package/dist/debug/{dom-DNB5yq3U.js → dom-mQ5mPBTF.js} +203 -213
- package/dist/debug/dom.js +5 -8
- package/dist/debug/dom.mjs +5 -9
- package/dist/debug/html.js +68 -87
- package/dist/debug/html.mjs +68 -87
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +4 -4
- 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 +3 -3
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/load.d.ts +3 -4
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +1 -2
- package/dist/dom/signals.d.ts +5 -7
- package/dist/{dom-C2-Flitp.js → dom-B8j2453O.js} +143 -155
- package/dist/{dom-DsHYWMCR.mjs → dom-HEWdZCCb.mjs} +119 -136
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +17 -21
- package/dist/dom.mjs +5 -9
- package/dist/html/assets.d.ts +3 -4
- package/dist/html/for.d.ts +0 -1
- package/dist/html/writer.d.ts +2 -2
- package/dist/html.d.ts +1 -1
- package/dist/html.js +60 -72
- package/dist/html.mjs +60 -72
- package/dist/translator/index.d.ts +0 -1
- package/dist/translator/index.js +4629 -4485
- package/dist/translator/interop/out-global.d.ts +5 -0
- package/dist/translator/util/assert.d.ts +4 -0
- package/dist/translator/util/entry-builder.d.ts +1 -1
- package/dist/translator/util/finalize-references.d.ts +2 -1
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +7 -1
- package/dist/translator/util/references.d.ts +11 -5
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +6 -1
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/style-interpolation.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -0
- package/dist/translator/util/visitors.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/visitors/program/index.d.ts +0 -4
- package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
- package/package.json +4 -4
- package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
package/dist/debug/html.mjs
CHANGED
|
@@ -99,7 +99,7 @@ function escapeStyleValue(str) {
|
|
|
99
99
|
else if (c === closers[0]) closers = closers.slice(1);
|
|
100
100
|
return result + closers;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
function toDelimitedString(val, delimiter, stringify) {
|
|
103
103
|
let str = "";
|
|
104
104
|
let sep = "";
|
|
105
105
|
let part;
|
|
@@ -121,7 +121,7 @@ const toDelimitedString = function toDelimitedString(val, delimiter, stringify)
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return str;
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
function isEventHandler(name) {
|
|
126
126
|
return /^on[A-Z-]/.test(name);
|
|
127
127
|
}
|
|
@@ -275,6 +275,9 @@ const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
|
275
275
|
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
276
276
|
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
277
277
|
// src/common/opt.ts
|
|
278
|
+
function toArray(opt) {
|
|
279
|
+
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
280
|
+
}
|
|
278
281
|
function reduce(opt, cb, acc) {
|
|
279
282
|
if (opt) {
|
|
280
283
|
if (Array.isArray(opt)) for (const item of opt) acc = cb(acc, item);
|
|
@@ -702,7 +705,7 @@ function writeScopesRoot(state, flushes) {
|
|
|
702
705
|
} else buf.pop();
|
|
703
706
|
}
|
|
704
707
|
let extras = "";
|
|
705
|
-
if (state.deferredRefs.size ||
|
|
708
|
+
if (state.deferredRefs.size || hasMatchingCalls(state, state.channel?.readyId)) extras = state.writeTrailing(scopesIndex);
|
|
706
709
|
let result = extras && "(";
|
|
707
710
|
for (const chunk of buf) result += chunk;
|
|
708
711
|
result += extras;
|
|
@@ -796,9 +799,6 @@ function writeCallArg(state, val, valueId) {
|
|
|
796
799
|
}
|
|
797
800
|
} else state.buf.push("void 0");
|
|
798
801
|
}
|
|
799
|
-
function hasChannelCalls(state) {
|
|
800
|
-
return hasMatchingCalls(state, state.channel?.readyId);
|
|
801
|
-
}
|
|
802
802
|
function hasMatchingCalls(state, readyId) {
|
|
803
803
|
if (!readyId) return state.queuedCalls.length > 0;
|
|
804
804
|
for (const call of state.queuedReadyCalls) if (call.channel.readyId === readyId) return true;
|
|
@@ -1319,17 +1319,10 @@ function writeRequest(state, val, ref) {
|
|
|
1319
1319
|
options += sep + "credentials:" + quote(val.credentials, 0);
|
|
1320
1320
|
sep = ",";
|
|
1321
1321
|
}
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
options += sep + "headers:" +
|
|
1322
|
+
const headers = headersOption(state, val.headers, ref);
|
|
1323
|
+
if (headers) {
|
|
1324
|
+
options += sep + "headers:" + headers;
|
|
1325
1325
|
sep = ",";
|
|
1326
|
-
} else {
|
|
1327
|
-
state.refs.set(val.headers, new Reference(ref, "headers", state.flushId, null));
|
|
1328
|
-
const headers = stringEntriesToHeadersInit(val.headers);
|
|
1329
|
-
if (headers) {
|
|
1330
|
-
options += sep + "headers:" + headers;
|
|
1331
|
-
sep = ",";
|
|
1332
|
-
}
|
|
1333
1326
|
}
|
|
1334
1327
|
if (val.integrity) {
|
|
1335
1328
|
options += sep + "integrity:" + quote(val.integrity, 0);
|
|
@@ -1370,13 +1363,8 @@ function writeResponse(state, val, ref) {
|
|
|
1370
1363
|
options += sep + "statusText:" + quote(val.statusText, 0);
|
|
1371
1364
|
sep = ",";
|
|
1372
1365
|
}
|
|
1373
|
-
const
|
|
1374
|
-
if (
|
|
1375
|
-
else {
|
|
1376
|
-
state.refs.set(val.headers, new Reference(ref, "headers", state.flushId, null));
|
|
1377
|
-
const headers = stringEntriesToHeadersInit(val.headers);
|
|
1378
|
-
if (headers) options += sep + "headers:" + headers;
|
|
1379
|
-
}
|
|
1366
|
+
const headers = headersOption(state, val.headers, ref);
|
|
1367
|
+
if (headers) options += sep + "headers:" + headers;
|
|
1380
1368
|
if (!val.body || val.bodyUsed) state.buf.push("new Response" + (options ? "(null,{" + options + "})" : ""));
|
|
1381
1369
|
else {
|
|
1382
1370
|
state.buf.push("new Response(");
|
|
@@ -1384,6 +1372,12 @@ function writeResponse(state, val, ref) {
|
|
|
1384
1372
|
}
|
|
1385
1373
|
return true;
|
|
1386
1374
|
}
|
|
1375
|
+
function headersOption(state, headers, ref) {
|
|
1376
|
+
const seen = state.refs.get(headers);
|
|
1377
|
+
if (seen) return ensureRefAccess(state, seen);
|
|
1378
|
+
state.refs.set(headers, new Reference(ref, "headers", state.flushId, null));
|
|
1379
|
+
return stringEntriesToHeadersInit(headers);
|
|
1380
|
+
}
|
|
1387
1381
|
function writeIntl(state, val, name, ref) {
|
|
1388
1382
|
const { locale, ...options } = val.resolvedOptions();
|
|
1389
1383
|
state.buf.push("new Intl." + name + "(" + quote(locale, 0) + ",");
|
|
@@ -1911,7 +1905,7 @@ function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange, s
|
|
|
1911
1905
|
return normalizedOpen ? " open" : "";
|
|
1912
1906
|
}
|
|
1913
1907
|
function _attr_nonce() {
|
|
1914
|
-
return
|
|
1908
|
+
return getState().nonceAttr;
|
|
1915
1909
|
}
|
|
1916
1910
|
function _style_html(decls) {
|
|
1917
1911
|
const id = _id();
|
|
@@ -1975,7 +1969,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
|
|
|
1975
1969
|
break;
|
|
1976
1970
|
default:
|
|
1977
1971
|
if (name) assertValidAttrName(name);
|
|
1978
|
-
if (name && !(isNullishOrFalse(value) ||
|
|
1972
|
+
if (name && !(isNullishOrFalse(value) || name === "content" && tagName !== "meta" || skip.test(name))) {
|
|
1979
1973
|
if (isEventHandler(name)) {
|
|
1980
1974
|
if (!events) {
|
|
1981
1975
|
events = {};
|
|
@@ -2189,7 +2183,7 @@ function getScopeId(scope) {
|
|
|
2189
2183
|
return scope[K_SCOPE_ID];
|
|
2190
2184
|
}
|
|
2191
2185
|
function getScopeById(scopeId) {
|
|
2192
|
-
|
|
2186
|
+
return $chunk.boundary.state.scopes.get(scopeId);
|
|
2193
2187
|
}
|
|
2194
2188
|
function $global() {
|
|
2195
2189
|
return $chunk.boundary.state.$global;
|
|
@@ -2251,7 +2245,7 @@ function mayDrop(written) {
|
|
|
2251
2245
|
return false;
|
|
2252
2246
|
}
|
|
2253
2247
|
function _script(scopeId, registryId, markerGuard) {
|
|
2254
|
-
if (markerGuard === 0 && ($chunk.channel.readyId || $chunk
|
|
2248
|
+
if (markerGuard === 0 && ($chunk.channel.readyId || getAsyncContent($chunk))) _resume_branch(scopeId);
|
|
2255
2249
|
$chunk.boundary.state.queueEffect(scopeId, registryId);
|
|
2256
2250
|
}
|
|
2257
2251
|
function _trailers(html) {
|
|
@@ -2295,7 +2289,7 @@ function markText(scopeId, accessor, text, markerGuard) {
|
|
|
2295
2289
|
return text ? (markerGuard === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
2296
2290
|
}
|
|
2297
2291
|
function _resume_branch(scopeId) {
|
|
2298
|
-
const branchId =
|
|
2292
|
+
const branchId = getContext(kBranchId);
|
|
2299
2293
|
if (branchId !== void 0 && branchId !== scopeId) writeScope(scopeId, { [ClosestBranchId]: branchId });
|
|
2300
2294
|
}
|
|
2301
2295
|
function _attr_content(nodeAccessor, scopeId, content, markerGuard) {
|
|
@@ -2432,7 +2426,6 @@ function unsubscribe(subscribed, serializer) {
|
|
|
2432
2426
|
}
|
|
2433
2427
|
}
|
|
2434
2428
|
}
|
|
2435
|
-
const NOOP$2 = () => {};
|
|
2436
2429
|
function countResumeWrite(chunk) {
|
|
2437
2430
|
for (let boundary = chunk.boundary; boundary; boundary = boundary.parent) boundary.resumeWrites++;
|
|
2438
2431
|
}
|
|
@@ -2554,8 +2547,9 @@ var State = class {
|
|
|
2554
2547
|
return "<!--" + this.commentPrefix + code + str + "-->";
|
|
2555
2548
|
}
|
|
2556
2549
|
};
|
|
2550
|
+
function NOOP() {}
|
|
2557
2551
|
var Boundary = class {
|
|
2558
|
-
onNext = NOOP
|
|
2552
|
+
onNext = NOOP;
|
|
2559
2553
|
count = 0;
|
|
2560
2554
|
resumeWrites = 0;
|
|
2561
2555
|
state;
|
|
@@ -2819,7 +2813,7 @@ var Chunk = class Chunk {
|
|
|
2819
2813
|
const { readyId } = channel;
|
|
2820
2814
|
let scripts = "";
|
|
2821
2815
|
const held = this.takeDeferredReady();
|
|
2822
|
-
if (held) for (const chunk of
|
|
2816
|
+
if (held) for (const chunk of toArray(held)) {
|
|
2823
2817
|
if (chunk.boundary.aborted) continue;
|
|
2824
2818
|
scripts = concatScripts(scripts, chunk.flushReadyScripts(boundary, reservations, holdEffects));
|
|
2825
2819
|
if (chunk.effects || chunk.deferredReady) this.deferredReady = push(this.deferredReady, chunk);
|
|
@@ -2872,7 +2866,7 @@ var Chunk = class Chunk {
|
|
|
2872
2866
|
if (effects) {
|
|
2873
2867
|
needsWalk = true;
|
|
2874
2868
|
flushSerializerGlobals(boundary);
|
|
2875
|
-
state.resumes = state.resumes
|
|
2869
|
+
state.resumes = concatSequence(state.resumes, "\"" + effects + "\"");
|
|
2876
2870
|
}
|
|
2877
2871
|
let reordered = "";
|
|
2878
2872
|
let needsResumeArray = false;
|
|
@@ -3056,23 +3050,16 @@ function depsMarker(deps) {
|
|
|
3056
3050
|
return marker;
|
|
3057
3051
|
}
|
|
3058
3052
|
function getFilteredGlobals($global) {
|
|
3059
|
-
if (!$global) return 0;
|
|
3060
3053
|
const serializedGlobals = $global.serializedGlobals;
|
|
3061
3054
|
if (!serializedGlobals) return 0;
|
|
3062
3055
|
let filtered = 0;
|
|
3063
3056
|
if (Array.isArray(serializedGlobals)) for (const key of serializedGlobals) {
|
|
3064
3057
|
const value = $global[key];
|
|
3065
|
-
if (value !== void 0) {
|
|
3066
|
-
if (filtered) filtered[key] = value;
|
|
3067
|
-
else filtered = { [key]: value };
|
|
3068
|
-
}
|
|
3058
|
+
if (value !== void 0) (filtered ||= {})[key] = value;
|
|
3069
3059
|
}
|
|
3070
3060
|
else for (const key in serializedGlobals) if (serializedGlobals[key]) {
|
|
3071
3061
|
const value = $global[key];
|
|
3072
|
-
if (value !== void 0) {
|
|
3073
|
-
if (filtered) filtered[key] = value;
|
|
3074
|
-
else filtered = { [key]: value };
|
|
3075
|
-
}
|
|
3062
|
+
if (value !== void 0) (filtered ||= {})[key] = value;
|
|
3076
3063
|
}
|
|
3077
3064
|
return filtered;
|
|
3078
3065
|
}
|
|
@@ -3122,7 +3109,7 @@ const replaceUnsafeXML = (c) => c === "&" ? "&" : c === "<" ? "<" : "
|
|
|
3122
3109
|
const escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str;
|
|
3123
3110
|
function _escape(val) {
|
|
3124
3111
|
assertValidTextValue(val);
|
|
3125
|
-
return val ?
|
|
3112
|
+
return val || val === 0 ? typeof val === "number" ? val + "" : escapeXMLStr(val + "") : "";
|
|
3126
3113
|
}
|
|
3127
3114
|
const unsafeScriptReg = /<(\/?script|!--)/gi;
|
|
3128
3115
|
const escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\u003C$1") : str;
|
|
@@ -3165,34 +3152,31 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, m
|
|
|
3165
3152
|
assertValidTagName(renderer);
|
|
3166
3153
|
const input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
3167
3154
|
rendered = true;
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
if (
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
else if (renderContent) _dynamic_tag(branchId, `#${renderer.toLowerCase()}/0`, renderContent, void 0, 0, void 0, markerGuard);
|
|
3180
|
-
}
|
|
3181
|
-
_html(`</${renderer}>`);
|
|
3182
|
-
} else if (content) throw new Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
3183
|
-
const childScope = getScopeById(branchId);
|
|
3184
|
-
const needsScript = childScope && (childScope[`EventAttributes:#${renderer.toLowerCase()}/0`] || childScope[`ControlledHandler:#${renderer.toLowerCase()}/0`]);
|
|
3185
|
-
if (needsScript) {
|
|
3186
|
-
writeScope(branchId, { [Renderer]: renderer });
|
|
3187
|
-
_script(branchId, DYNAMIC_TAG_SCRIPT_REGISTER_ID);
|
|
3155
|
+
_scope_id();
|
|
3156
|
+
_html(`<${renderer}${_attrs(input, `#${renderer.toLowerCase()}/0`, branchId, renderer)}>`);
|
|
3157
|
+
if (!voidElementsReg.test(renderer)) {
|
|
3158
|
+
const renderContent = content || normalizeDynamicRenderer(input.content);
|
|
3159
|
+
if (renderer === "textarea") {
|
|
3160
|
+
if (renderContent) throw new Error("A dynamic tag rendering a `<textarea>` cannot have `content` and must use the `value` attribute instead.");
|
|
3161
|
+
_html(_attrs_textarea_value(branchId, `#${renderer.toLowerCase()}/0`, input));
|
|
3162
|
+
} else {
|
|
3163
|
+
if (renderContent && typeof renderContent !== "function") throw new Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
3164
|
+
if (renderer === "select" && ("value" in input || "valueChange" in input)) _attr_select_value(branchId, `#${renderer.toLowerCase()}/0`, input.value, input.valueChange, renderContent ? () => _dynamic_tag(branchId, `#${renderer.toLowerCase()}/0`, renderContent, void 0, 0, void 0, markerGuard) : void 0, 1);
|
|
3165
|
+
else if (renderContent) _dynamic_tag(branchId, `#${renderer.toLowerCase()}/0`, renderContent, void 0, 0, void 0, markerGuard);
|
|
3188
3166
|
}
|
|
3189
|
-
|
|
3190
|
-
};
|
|
3191
|
-
|
|
3167
|
+
_html(`</${renderer}>`);
|
|
3168
|
+
} else if (content) throw new Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
3169
|
+
const childScope = getScopeById(branchId);
|
|
3170
|
+
const needsScript = childScope && (childScope[`EventAttributes:#${renderer.toLowerCase()}/0`] || childScope[`ControlledHandler:#${renderer.toLowerCase()}/0`]);
|
|
3171
|
+
if (needsScript) {
|
|
3172
|
+
writeScope(branchId, { [Renderer]: renderer });
|
|
3173
|
+
_script(branchId, DYNAMIC_TAG_SCRIPT_REGISTER_ID);
|
|
3174
|
+
}
|
|
3175
|
+
if (shouldResume || needsScript) _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
3192
3176
|
result = _el(scopeId, DYNAMIC_TAG_VAR_REGISTER_ID + accessor);
|
|
3193
3177
|
} else {
|
|
3194
3178
|
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.`);
|
|
3195
|
-
const chunk =
|
|
3179
|
+
const chunk = $chunk;
|
|
3196
3180
|
const beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0;
|
|
3197
3181
|
const render = () => {
|
|
3198
3182
|
if (renderer) try {
|
|
@@ -3494,10 +3478,9 @@ var ServerRendered = class {
|
|
|
3494
3478
|
}
|
|
3495
3479
|
};
|
|
3496
3480
|
function settle(boundary) {
|
|
3497
|
-
boundary.onNext = NOOP
|
|
3481
|
+
boundary.onNext = NOOP;
|
|
3498
3482
|
boundary.state.$global.signal?.removeEventListener("abort", boundary);
|
|
3499
3483
|
}
|
|
3500
|
-
function NOOP$1() {}
|
|
3501
3484
|
// src/html/assets.ts
|
|
3502
3485
|
const kAssets = Symbol();
|
|
3503
3486
|
const kHead = Symbol();
|
|
@@ -3595,17 +3578,18 @@ function addAsset(g, id, flush, triggers) {
|
|
|
3595
3578
|
function triggerScript(id, html, triggers) {
|
|
3596
3579
|
const htmlStr = quoteScriptTemplateLiteral(html);
|
|
3597
3580
|
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))`;
|
|
3598
|
-
const exprs = triggers.map(
|
|
3599
|
-
const options = trigger.options && toObjectExpression(trigger.options);
|
|
3600
|
-
switch (trigger.type) {
|
|
3601
|
-
case "visible": return `(e=>e&&new IntersectionObserver((e,i)=>e.some(e=>e.isIntersecting)&&i.disconnect()+l()${options ? `,${options}` : ""}).observe(e))(${querySelectorOrLoad(trigger.selector)})`;
|
|
3602
|
-
case "idle": return `(self.requestIdleCallback||l)(l${options ? `,${options}` : ""})`;
|
|
3603
|
-
case "media": return `(m=>m.matches?l():m.addEventListener("change",l,{once:1}))(matchMedia(${JSON.stringify(trigger.selector)}))`;
|
|
3604
|
-
default: return `(e=>e?.addEventListener("${trigger.type.slice(3)}",l,{once:1}))(${querySelectorOrLoad(trigger.selector)})`;
|
|
3605
|
-
}
|
|
3606
|
-
});
|
|
3581
|
+
const exprs = triggers.map(triggerExpression);
|
|
3607
3582
|
return `((h,d,l=$=>{d||${insert}})=>${exprs.length > 1 ? `{${exprs.join(";")}}` : exprs[0]})(${htmlStr})`;
|
|
3608
3583
|
}
|
|
3584
|
+
function triggerExpression(trigger) {
|
|
3585
|
+
const options = trigger.options && toObjectExpression(trigger.options);
|
|
3586
|
+
switch (trigger.type) {
|
|
3587
|
+
case "visible": return `(e=>e&&new IntersectionObserver((e,i)=>e.some(e=>e.isIntersecting)&&i.disconnect()+l()${options ? `,${options}` : ""}).observe(e))(${querySelectorOrLoad(trigger.selector)})`;
|
|
3588
|
+
case "idle": return `(self.requestIdleCallback||l)(l${options ? `,${options}` : ""})`;
|
|
3589
|
+
case "media": return `(m=>m.matches?l():m.addEventListener("change",l,{once:1}))(matchMedia(${JSON.stringify(trigger.selector)}))`;
|
|
3590
|
+
default: return `(e=>e?.addEventListener("${trigger.type.slice(3)}",l,{once:1}))(${querySelectorOrLoad(trigger.selector)})`;
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3609
3593
|
function querySelectorOrLoad(selector) {
|
|
3610
3594
|
return `document.querySelector(${JSON.stringify(selector)})||${`(console.warn(${JSON.stringify(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`)}),l())`}`;
|
|
3611
3595
|
}
|
|
@@ -3740,7 +3724,8 @@ function forBranches(by, cb, iterate, scopeId, accessor, branchGuard, markerGuar
|
|
|
3740
3724
|
flushBranchIds = branchId + "";
|
|
3741
3725
|
}
|
|
3742
3726
|
}
|
|
3743
|
-
withBranchId(branchId, cb, a, b);
|
|
3727
|
+
if (resumeMarker) withBranchId(branchId, cb, a, b);
|
|
3728
|
+
else cb(a, b);
|
|
3744
3729
|
const branchScope = writeScope(branchId, resumeKeys && !sameAsIndex ? { [LoopKey]: itemKey } : {});
|
|
3745
3730
|
if (!resumeMarker) loopScopes = push(loopScopes, branchScope);
|
|
3746
3731
|
});
|
|
@@ -3753,7 +3738,7 @@ function _if(cb, scopeId, accessor, branchGuard, markerGuard, branchExprGuard, p
|
|
|
3753
3738
|
const branchId = _peek_scope_id();
|
|
3754
3739
|
const chunk = $chunk;
|
|
3755
3740
|
const beforeBranch = resumeMarker && resumeBranch && !singleNode ? deferBranchStart(chunk) : void 0;
|
|
3756
|
-
const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
|
|
3741
|
+
const branchIndex = resumeBranch && resumeMarker ? withBranchId(branchId, cb) : cb();
|
|
3757
3742
|
const shouldWriteBranch = resumeBranch && branchIndex !== void 0;
|
|
3758
3743
|
if (beforeBranch !== void 0) applyBranchStart(chunk, beforeBranch, shouldWriteBranch);
|
|
3759
3744
|
if (shouldWriteBranch && (branchIndex || !resumeMarker)) writeScope(scopeId, {
|
|
@@ -3767,11 +3752,8 @@ function resumesMarker(markerGuard, branchExprGuard, parentEndTag) {
|
|
|
3767
3752
|
}
|
|
3768
3753
|
function writeBranchEnd(scopeId, accessor, branchExprGuard, markerGuard, parentEndTag, singleNode, branchIds) {
|
|
3769
3754
|
const endTag = parentEndTag || "";
|
|
3770
|
-
if (resumesMarker(markerGuard, branchExprGuard, parentEndTag))
|
|
3771
|
-
|
|
3772
|
-
const mark = singleNode ? state.mark(parentEndTag ? "}" : "|", scopeId + " " + accessor + (branchIds || "")) : state.mark(parentEndTag ? ")" : "]", scopeId + " " + accessor + (branchIds || ""));
|
|
3773
|
-
$chunk.writeHTML(mark + endTag);
|
|
3774
|
-
} else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_mark(scopeId, accessor));
|
|
3755
|
+
if (resumesMarker(markerGuard, branchExprGuard, parentEndTag)) $chunk.writeHTML($chunk.boundary.state.mark(singleNode ? parentEndTag ? "}" : "|" : parentEndTag ? ")" : "]", scopeId + " " + accessor + branchIds) + endTag);
|
|
3756
|
+
else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_mark(scopeId, accessor));
|
|
3775
3757
|
else $chunk.writeHTML(endTag);
|
|
3776
3758
|
}
|
|
3777
3759
|
function _await(scopeId, accessor, promise, content, markerGuard) {
|
|
@@ -4010,14 +3992,14 @@ const compat = {
|
|
|
4010
3992
|
return joined;
|
|
4011
3993
|
},
|
|
4012
3994
|
appendChunks(chunks) {
|
|
4013
|
-
const chunk =
|
|
3995
|
+
const chunk = $chunk;
|
|
4014
3996
|
for (const part of chunks) {
|
|
4015
3997
|
chunk.append(part);
|
|
4016
3998
|
if (part.effects) chunk.lastEffect = part.lastEffect;
|
|
4017
3999
|
}
|
|
4018
4000
|
},
|
|
4019
4001
|
deferReorders(reorders) {
|
|
4020
|
-
const chunk =
|
|
4002
|
+
const chunk = $chunk;
|
|
4021
4003
|
for (let i = reorders.length; i--;) {
|
|
4022
4004
|
const carrier = chunk.fork(chunk.boundary, chunk.next);
|
|
4023
4005
|
carrier.deferredReorder = reorders[i];
|
|
@@ -4148,5 +4130,4 @@ function swapReorders(state, reorders) {
|
|
|
4148
4130
|
state.writeReorders = reorders;
|
|
4149
4131
|
return writeReorders;
|
|
4150
4132
|
}
|
|
4151
|
-
function NOOP() {}
|
|
4152
4133
|
export { $global, _assert_class_toggles, _assert_hoist, _attr, _attr_and, _attr_class, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _await, _content, _content_resume, _dynamic_tag, _el, _el_mark, _el_read_error, _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _html_mark, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _set_scope_reason, _show_end, _show_start, _signal_read_error, _style_html, _subscribe, _template, _text_mark, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, _write_guard, _write_if, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
|
|
@@ -2,7 +2,7 @@ import { type Scope } from "../common/types";
|
|
|
2
2
|
export declare function $signalReset(scope: Scope, id: string | number): void;
|
|
3
3
|
export declare function $signal(scope: Scope, id: string | number): AbortSignal;
|
|
4
4
|
/** Runs `abort` as a destroyed scope's `$signal` would fire, without creating one. */
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function onAbort(scope: Scope, id: string | number, abort: () => void): void;
|
|
6
6
|
/** Enrols `scope` with its branch so destroying the branch cleans it up. */
|
|
7
7
|
export declare function trackCleanup(scope: Scope, subscribers?: Set<Scope>): void;
|
|
8
8
|
export declare let abortsEnabled: undefined | 1;
|
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-B8j2453O.js"), deferToPendingTry = (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.sn(branch, require_control_flow.cn, require_control_flow.y))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
|
|
5
5
|
branch = branch.N;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
// src/dom/catch.feat.ts
|
|
9
|
-
require_control_flow.
|
|
9
|
+
require_control_flow.an((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 && !deferToPendingTry(fn, scope, branch) && fn(scope);
|
|
12
12
|
}, (runRender) => (render) => {
|
package/dist/dom/catch.feat.mjs
CHANGED
|
@@ -4,7 +4,7 @@ let deferToPendingTry = (fn, scope, branch) => {
|
|
|
4
4
|
branch = branch.N;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { an as installCatch, cn as queueEffect, sn as queueAsyncRender, v as renderCatch, y as runPendingEffects } from "../dom-HEWdZCCb.mjs";
|
|
8
8
|
// src/dom/catch.feat.ts
|
|
9
9
|
installCatch((effects) => {
|
|
10
10
|
let i = 0, fn, scope, branch;
|
|
@@ -19,8 +19,8 @@ export declare function dynamicTagScript(branch: Scope): void;
|
|
|
19
19
|
export declare function setBranch<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;
|
|
21
21
|
export declare const _for_in: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [obj: {}, by?: ((key: string, v: unknown) => unknown) | undefined]) => void;
|
|
22
|
-
export declare const _for_to: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [to: number, from
|
|
23
|
-
export declare const _for_until: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [until: number, from
|
|
22
|
+
export declare const _for_to: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [to: number, from?: number | undefined, step?: number | undefined, by?: ((v: number) => unknown) | undefined]) => void;
|
|
23
|
+
export declare const _for_until: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [until: number, from?: number | undefined, step?: number | undefined, by?: ((v: number) => unknown) | undefined]) => void;
|
|
24
24
|
export declare const _for_of_unkeyed: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [all: unknown[]]) => void;
|
|
25
|
-
export declare const _for_to_unkeyed: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [to: number, from
|
|
26
|
-
export declare const _for_until_unkeyed: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [until: number, from
|
|
25
|
+
export declare const _for_to_unkeyed: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [to: number, from?: number | undefined, step?: number | undefined]) => void;
|
|
26
|
+
export declare const _for_until_unkeyed: (nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, params?: Signal<unknown>) => (scope: Scope, value: [until: number, from?: number | undefined, step?: number | undefined]) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-B8j2453O.js");
|
|
3
3
|
require_control_flow.H[0] = require_control_flow.k, require_control_flow.H[1] = require_control_flow.D, require_control_flow.H[2] = require_control_flow.P;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { D as _attr_input_checkedValue_script, H as controllableScripts, P as _attr_input_value_script, k as _attr_input_checked_script } from "../dom-
|
|
1
|
+
import { D as _attr_input_checkedValue_script, H as controllableScripts, P as _attr_input_value_script, k as _attr_input_checked_script } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as _attr_details_or_dialog_open_script, H as controllableScripts } from "../dom-
|
|
1
|
+
import { C as _attr_details_or_dialog_open_script, H as controllableScripts } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
// src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { H as controllableScripts, L as _attr_select_value_script } from "../dom-
|
|
1
|
+
import { H as controllableScripts, L as _attr_select_value_script } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
// src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { H as controllableScripts, P as _attr_input_value_script } from "../dom-
|
|
1
|
+
import { H as controllableScripts, P as _attr_input_value_script } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
// src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-B8j2453O.js");
|
|
3
3
|
require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.U.INPUT = require_control_flow.R, require_control_flow.U.TEXTAREA = require_control_flow.V, require_control_flow.U.SELECT = require_control_flow.B, require_control_flow.U.DETAILS = require_control_flow.U.DIALOG = require_control_flow.z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as _controllable_select, R as _controllable_input, U as controllableSpreadHelpers, V as _controllable_textarea, z as _controllable_open } from "../dom-
|
|
1
|
+
import { B as _controllable_select, R as _controllable_input, U as controllableSpreadHelpers, V as _controllable_textarea, z as _controllable_open } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-B8j2453O.js");
|
|
3
3
|
// src/dom/dynamic-tag-script.feat.ts
|
|
4
|
-
require_control_flow.xt._d = require_control_flow.
|
|
4
|
+
require_control_flow.xt._d = require_control_flow.Sn(require_control_flow.h);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Sn as withBranches, h as dynamicTagScript, xt as _resumed } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
// src/dom/dynamic-tag-script.feat.ts
|
|
3
3
|
_resumed._d = withBranches(dynamicTagScript);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
3
|
-
require_control_flow.
|
|
4
|
-
branch.BR = require_control_flow.
|
|
2
|
+
let require_control_flow = require("../dom-B8j2453O.js");
|
|
3
|
+
require_control_flow.in(), require_control_flow.g((scope, branch, scopeKey, renderer) => {
|
|
4
|
+
branch.BR = require_control_flow.rn(scope, scopeKey), typeof renderer == "string" && branch.T((_) => branch.S);
|
|
5
5
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as installDynamicTagVar,
|
|
1
|
+
import { g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-HEWdZCCb.mjs";
|
|
2
2
|
installBranchRenders(), installDynamicTagVar((scope, branch, scopeKey, renderer) => {
|
|
3
3
|
branch.BR = createBranchRenders(scope, scopeKey), typeof renderer == "string" && branch.T((_) => branch.S);
|
|
4
4
|
});
|
package/dist/dom/lazy.feat.js
CHANGED
package/dist/dom/lazy.feat.mjs
CHANGED
package/dist/dom/load.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { type BranchScope, type Scope, type Template } from "../common/types";
|
|
2
2
|
import { type Renderer, type SetupFn } from "./renderer";
|
|
3
3
|
import type { Signal } from "./signals";
|
|
4
|
-
interface LoadModule {
|
|
5
|
-
_: [template: string, walks: string, setup: SetupFn];
|
|
6
|
-
}
|
|
7
4
|
interface LoadSignal {
|
|
8
5
|
_: Signal;
|
|
9
6
|
}
|
|
@@ -11,7 +8,9 @@ export interface LoadTrigger {
|
|
|
11
8
|
<T>(load: () => Promise<T>): () => Promise<T>;
|
|
12
9
|
}
|
|
13
10
|
export declare function _load_template(id: string, load: () => Promise<Renderer>): Template & Renderer;
|
|
14
|
-
export declare function _load_setup(load: () => Promise<
|
|
11
|
+
export declare function _load_setup(load: () => Promise<{
|
|
12
|
+
_: [template: string, walks: string, setup: SetupFn];
|
|
13
|
+
}>): (owner: Scope, child: BranchScope, marker: ChildNode) => void;
|
|
15
14
|
export declare function _load_signal(load: () => Promise<LoadSignal>): Signal;
|
|
16
15
|
export declare function _load_visible_trigger(selector: string, options?: IntersectionObserverInit): LoadTrigger;
|
|
17
16
|
export declare function _load_idle_trigger(options?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("../dom-
|
|
2
|
+
let require_control_flow = require("../dom-B8j2453O.js");
|
|
3
3
|
// src/dom/placeholder.feat.ts
|
|
4
4
|
require_control_flow.xt._f = (tryBranch) => {
|
|
5
5
|
tryBranch.P &&= (require_control_flow.Yt(tryBranch.P), 0);
|
package/dist/dom/queue.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PendingRenderProp, type Scope } from "../common/types";
|
|
2
2
|
import type { Signal } from "./signals";
|
|
3
|
-
type ExecFn<S extends Scope = Scope> = (scope: S, arg?: any) => void;
|
|
4
3
|
export type PendingRender = {
|
|
5
4
|
[PendingRenderProp.Key]: number;
|
|
6
5
|
[PendingRenderProp.Scope]: Scope;
|
|
@@ -16,7 +15,7 @@ export declare function queueRender<T, U extends Scope = Scope>(scope: U, signal
|
|
|
16
15
|
export declare let queuePendingRender: (render: PendingRender) => void;
|
|
17
16
|
export declare function createBranchRenders(scope: Scope, scopeKey: number): PendingRender;
|
|
18
17
|
export declare function installBranchRenders(): void;
|
|
19
|
-
export declare function queueEffect<S extends Scope
|
|
18
|
+
export declare function queueEffect<S extends Scope>(scope: S, fn: (scope: S) => void): void;
|
|
20
19
|
export declare function run(): void;
|
|
21
20
|
export declare function queueAsyncRender<T, U extends Scope = Scope>(scope: U, signal: Signal<T, U>, value?: T): void;
|
|
22
21
|
export declare function prepareEffects(fn: () => void): unknown[];
|
package/dist/dom/signals.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export declare function _let<T>(id: EncodedAccessor, fn?: SignalFn): (scope: Sco
|
|
|
8
8
|
export declare function _let_change<T>(id: EncodedAccessor, fn?: SignalFn): (scope: Scope, value: T, valueChange?: (v: T) => void) => T;
|
|
9
9
|
export declare function _const<T>(valueAccessor: EncodedAccessor, fn?: SignalFn): Signal<T>;
|
|
10
10
|
export declare function _or(id: number, fn: SignalFn, defaultPending?: number, scopeIdAccessor?: EncodedAccessor): Signal<never>;
|
|
11
|
-
export declare function _for_closure(ownerLoopNodeAccessor: EncodedAccessor, fn: SignalFn): SignalFn;
|
|
12
|
-
export declare function _for_selector(ownerLoopNodeAccessor: EncodedAccessor, ownerValueAccessor: EncodedAccessor, fn: SignalFn): SignalFn;
|
|
11
|
+
export declare function _for_closure(ownerLoopNodeAccessor: EncodedAccessor, fn: SignalFn, id: number, scopeIdAccessor?: EncodedAccessor): SignalFn;
|
|
12
|
+
export declare function _for_selector(ownerLoopNodeAccessor: EncodedAccessor, ownerValueAccessor: EncodedAccessor, fn: SignalFn, getValueScope?: (scope: Scope) => Scope): SignalFn;
|
|
13
13
|
export declare function _if_closure(ownerConditionalNodeAccessor: EncodedAccessor, branch: number, fn: SignalFn): SignalFn;
|
|
14
14
|
export declare function subscribeToScopeSet(owner: Record<Accessor, unknown>, accessor: Accessor, scope: Scope): void;
|
|
15
15
|
export declare function _closure(...closureSignals: ReturnType<typeof _closure_get>[]): (scope: Scope) => void;
|
|
@@ -26,9 +26,7 @@ export declare function _id(scope: Scope, accessor?: Accessor): string;
|
|
|
26
26
|
export declare function _script(id: string, fn: (scope: Scope) => void): (scope: Scope) => void;
|
|
27
27
|
export declare function _global_read($global: Record<string, unknown>, key: string): unknown;
|
|
28
28
|
export declare function _el_read<T>(value: T): T;
|
|
29
|
-
type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export declare function _hoist<T>(...path: HoistStep[]): (scope: Scope) => Hoisted<T>;
|
|
33
|
-
export declare function _hoist_resume<T>(id: string, ...path: HoistStep[]): (scope: Scope) => Hoisted<T>;
|
|
29
|
+
type HoistStep = EncodedAccessor | [Accessor, Accessor, number];
|
|
30
|
+
export declare function _hoist<T>(...path: HoistStep[]): (scope: Scope) => ((...args: unknown[]) => T) & Iterable<T>;
|
|
31
|
+
export declare function _hoist_resume<T>(id: string, ...path: HoistStep[]): (scope: Scope) => ((...args: unknown[]) => T) & Iterable<T>;
|
|
34
32
|
export {};
|