marko 6.1.15 → 6.1.17
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/helpers.d.ts +1 -0
- package/dist/debug/dom.js +44 -8
- package/dist/debug/dom.mjs +44 -9
- package/dist/debug/html.js +8 -3
- package/dist/debug/html.mjs +8 -4
- package/dist/dom/control-flow.d.ts +1 -0
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +27 -3
- package/dist/dom.mjs +27 -3
- package/dist/html/content.d.ts +1 -0
- package/dist/html.d.ts +1 -1
- package/dist/html.js +7 -4
- package/dist/html.mjs +7 -4
- package/dist/translator/core/if.d.ts +1 -0
- package/dist/translator/core/style.d.ts +5 -0
- package/dist/translator/index.js +1322 -1172
- package/dist/translator/util/asset-imports.d.ts +13 -0
- package/dist/translator/util/binding-prop-tree.d.ts +6 -0
- package/dist/translator/util/entry-builder.d.ts +5 -3
- package/dist/translator/util/known-tag.d.ts +1 -1
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/visitors/program/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/common/helpers.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export declare function isEventHandler(name: string): name is `on${string}`;
|
|
|
9
9
|
export declare function getEventHandlerName(name: `on${string}`): string;
|
|
10
10
|
export declare function isVoid(value: unknown): value is false | null | undefined;
|
|
11
11
|
export declare function isNotVoid(value: unknown): boolean;
|
|
12
|
+
export declare function isPromise(value: unknown): value is Promise<unknown>;
|
|
12
13
|
export declare function normalizeDynamicRenderer<Renderer>(value: any): Renderer | string | undefined;
|
|
13
14
|
export declare const decodeAccessor: (num: number) => string;
|
package/dist/debug/dom.js
CHANGED
|
@@ -101,6 +101,9 @@ function getEventHandlerName(name) {
|
|
|
101
101
|
function isNotVoid(value) {
|
|
102
102
|
return value != null && value !== false;
|
|
103
103
|
}
|
|
104
|
+
function isPromise(value) {
|
|
105
|
+
return value != null && typeof value.then === "function";
|
|
106
|
+
}
|
|
104
107
|
function normalizeDynamicRenderer(value) {
|
|
105
108
|
if (value) {
|
|
106
109
|
if (typeof value === "string") return value;
|
|
@@ -1325,6 +1328,15 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1325
1328
|
const branchAccessor = "BranchScopes:" + nodeAccessor;
|
|
1326
1329
|
_enable_catch();
|
|
1327
1330
|
return (scope, promise) => {
|
|
1331
|
+
if (!isPromise(promise)) {
|
|
1332
|
+
if (!scope[promiseAccessor]) {
|
|
1333
|
+
const resolve = () => resolveAwait(scope, branchAccessor, nodeAccessor, scope[nodeAccessor], params, promise);
|
|
1334
|
+
if (scope[branchAccessor]) resolve();
|
|
1335
|
+
else scope[promiseAccessor] = resolve;
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
promise = Promise.resolve(promise);
|
|
1339
|
+
}
|
|
1328
1340
|
let awaitBranch = scope[branchAccessor];
|
|
1329
1341
|
const tryPlaceholder = findBranchWithKey(scope, "#PlaceholderContent");
|
|
1330
1342
|
const tryBranch = tryPlaceholder || awaitBranch;
|
|
@@ -1361,14 +1373,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1361
1373
|
const referenceNode = scope[nodeAccessor];
|
|
1362
1374
|
scope[promiseAccessor] = 0;
|
|
1363
1375
|
queueAsyncRender(scope, () => {
|
|
1364
|
-
|
|
1365
|
-
awaitBranch["#PendingScopes"] = awaitBranch["#PendingScopes"]?.forEach(syncGen);
|
|
1366
|
-
setupBranch(awaitBranch["#DetachedAwait"], awaitBranch);
|
|
1367
|
-
awaitBranch["#DetachedAwait"] = 0;
|
|
1368
|
-
insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
|
|
1369
|
-
referenceNode.remove();
|
|
1370
|
-
}
|
|
1371
|
-
params?.(awaitBranch, [data]);
|
|
1376
|
+
awaitBranch = resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, data);
|
|
1372
1377
|
const pendingRenders = awaitBranch["#PendingRenders"];
|
|
1373
1378
|
awaitBranch["#PendingRenders"] = 0;
|
|
1374
1379
|
pendingRenders?.forEach(queuePendingRender);
|
|
@@ -1399,12 +1404,30 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1399
1404
|
});
|
|
1400
1405
|
};
|
|
1401
1406
|
}
|
|
1407
|
+
function resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, value) {
|
|
1408
|
+
const awaitBranch = scope[branchAccessor];
|
|
1409
|
+
if (awaitBranch["#DetachedAwait"]) {
|
|
1410
|
+
awaitBranch["#PendingScopes"] = awaitBranch["#PendingScopes"]?.forEach(syncGen);
|
|
1411
|
+
setupBranch(awaitBranch["#DetachedAwait"], awaitBranch);
|
|
1412
|
+
awaitBranch["#DetachedAwait"] = 0;
|
|
1413
|
+
insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
|
|
1414
|
+
referenceNode.remove();
|
|
1415
|
+
}
|
|
1416
|
+
params?.(awaitBranch, [value]);
|
|
1417
|
+
return awaitBranch;
|
|
1418
|
+
}
|
|
1402
1419
|
function _await_content(nodeAccessor, template, walks, setup) {
|
|
1403
1420
|
const branchAccessor = "BranchScopes:" + nodeAccessor;
|
|
1421
|
+
const promiseAccessor = "Promise:" + nodeAccessor;
|
|
1404
1422
|
const renderer = _content("", template, walks, setup)();
|
|
1405
1423
|
return (scope) => {
|
|
1406
1424
|
const pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope["$global"], renderer, scope, scope[nodeAccessor].parentNode))["#DetachedAwait"] = renderer);
|
|
1407
1425
|
scope[branchAccessor]["#PendingScopes"] = pendingScopes;
|
|
1426
|
+
const resolveSync = scope[promiseAccessor];
|
|
1427
|
+
if (typeof resolveSync === "function") {
|
|
1428
|
+
scope[promiseAccessor] = 0;
|
|
1429
|
+
resolveSync();
|
|
1430
|
+
}
|
|
1408
1431
|
};
|
|
1409
1432
|
}
|
|
1410
1433
|
function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, "#PlaceholderContent")) {
|
|
@@ -1519,6 +1542,18 @@ let _dynamic_tag = function dynamicTag(nodeAccessor, getContent, getTagVar, inpu
|
|
|
1519
1542
|
}
|
|
1520
1543
|
};
|
|
1521
1544
|
};
|
|
1545
|
+
function _dynamic_tag_content(nodeAccessor) {
|
|
1546
|
+
const childScopeAccessor = "BranchScopes:" + nodeAccessor;
|
|
1547
|
+
const rendererAccessor = "ConditionalRenderer:" + nodeAccessor;
|
|
1548
|
+
enableBranches();
|
|
1549
|
+
return (scope, renderer) => {
|
|
1550
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = renderer?.["id"] || renderer)) {
|
|
1551
|
+
setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
|
|
1552
|
+
if (renderer?.["accessor"]) subscribeToScopeSet(renderer["owner"], renderer["accessor"], scope[childScopeAccessor]);
|
|
1553
|
+
}
|
|
1554
|
+
if (renderer) for (const accessor in renderer["localClosures"]) renderer["localClosures"][accessor](scope[childScopeAccessor], renderer["localClosureValues"][accessor]);
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1522
1557
|
function _resume_dynamic_tag() {
|
|
1523
1558
|
_resume(DYNAMIC_TAG_SCRIPT_REGISTER_ID, dynamicTagScript);
|
|
1524
1559
|
}
|
|
@@ -2136,6 +2171,7 @@ Object.defineProperty(exports, "_dynamic_tag", {
|
|
|
2136
2171
|
return _dynamic_tag;
|
|
2137
2172
|
}
|
|
2138
2173
|
});
|
|
2174
|
+
exports._dynamic_tag_content = _dynamic_tag_content;
|
|
2139
2175
|
exports._el = _el;
|
|
2140
2176
|
exports._el_read = _el_read;
|
|
2141
2177
|
exports._enable_catch = _enable_catch;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -99,6 +99,9 @@ function getEventHandlerName(name) {
|
|
|
99
99
|
function isNotVoid(value) {
|
|
100
100
|
return value != null && value !== false;
|
|
101
101
|
}
|
|
102
|
+
function isPromise(value) {
|
|
103
|
+
return value != null && typeof value.then === "function";
|
|
104
|
+
}
|
|
102
105
|
function normalizeDynamicRenderer(value) {
|
|
103
106
|
if (value) {
|
|
104
107
|
if (typeof value === "string") return value;
|
|
@@ -1323,6 +1326,15 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1323
1326
|
const branchAccessor = "BranchScopes:" + nodeAccessor;
|
|
1324
1327
|
_enable_catch();
|
|
1325
1328
|
return (scope, promise) => {
|
|
1329
|
+
if (!isPromise(promise)) {
|
|
1330
|
+
if (!scope[promiseAccessor]) {
|
|
1331
|
+
const resolve = () => resolveAwait(scope, branchAccessor, nodeAccessor, scope[nodeAccessor], params, promise);
|
|
1332
|
+
if (scope[branchAccessor]) resolve();
|
|
1333
|
+
else scope[promiseAccessor] = resolve;
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
promise = Promise.resolve(promise);
|
|
1337
|
+
}
|
|
1326
1338
|
let awaitBranch = scope[branchAccessor];
|
|
1327
1339
|
const tryPlaceholder = findBranchWithKey(scope, "#PlaceholderContent");
|
|
1328
1340
|
const tryBranch = tryPlaceholder || awaitBranch;
|
|
@@ -1359,14 +1371,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1359
1371
|
const referenceNode = scope[nodeAccessor];
|
|
1360
1372
|
scope[promiseAccessor] = 0;
|
|
1361
1373
|
queueAsyncRender(scope, () => {
|
|
1362
|
-
|
|
1363
|
-
awaitBranch["#PendingScopes"] = awaitBranch["#PendingScopes"]?.forEach(syncGen);
|
|
1364
|
-
setupBranch(awaitBranch["#DetachedAwait"], awaitBranch);
|
|
1365
|
-
awaitBranch["#DetachedAwait"] = 0;
|
|
1366
|
-
insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
|
|
1367
|
-
referenceNode.remove();
|
|
1368
|
-
}
|
|
1369
|
-
params?.(awaitBranch, [data]);
|
|
1374
|
+
awaitBranch = resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, data);
|
|
1370
1375
|
const pendingRenders = awaitBranch["#PendingRenders"];
|
|
1371
1376
|
awaitBranch["#PendingRenders"] = 0;
|
|
1372
1377
|
pendingRenders?.forEach(queuePendingRender);
|
|
@@ -1397,12 +1402,30 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1397
1402
|
});
|
|
1398
1403
|
};
|
|
1399
1404
|
}
|
|
1405
|
+
function resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, value) {
|
|
1406
|
+
const awaitBranch = scope[branchAccessor];
|
|
1407
|
+
if (awaitBranch["#DetachedAwait"]) {
|
|
1408
|
+
awaitBranch["#PendingScopes"] = awaitBranch["#PendingScopes"]?.forEach(syncGen);
|
|
1409
|
+
setupBranch(awaitBranch["#DetachedAwait"], awaitBranch);
|
|
1410
|
+
awaitBranch["#DetachedAwait"] = 0;
|
|
1411
|
+
insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
|
|
1412
|
+
referenceNode.remove();
|
|
1413
|
+
}
|
|
1414
|
+
params?.(awaitBranch, [value]);
|
|
1415
|
+
return awaitBranch;
|
|
1416
|
+
}
|
|
1400
1417
|
function _await_content(nodeAccessor, template, walks, setup) {
|
|
1401
1418
|
const branchAccessor = "BranchScopes:" + nodeAccessor;
|
|
1419
|
+
const promiseAccessor = "Promise:" + nodeAccessor;
|
|
1402
1420
|
const renderer = _content("", template, walks, setup)();
|
|
1403
1421
|
return (scope) => {
|
|
1404
1422
|
const pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope["$global"], renderer, scope, scope[nodeAccessor].parentNode))["#DetachedAwait"] = renderer);
|
|
1405
1423
|
scope[branchAccessor]["#PendingScopes"] = pendingScopes;
|
|
1424
|
+
const resolveSync = scope[promiseAccessor];
|
|
1425
|
+
if (typeof resolveSync === "function") {
|
|
1426
|
+
scope[promiseAccessor] = 0;
|
|
1427
|
+
resolveSync();
|
|
1428
|
+
}
|
|
1406
1429
|
};
|
|
1407
1430
|
}
|
|
1408
1431
|
function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, "#PlaceholderContent")) {
|
|
@@ -1517,6 +1540,18 @@ let _dynamic_tag = function dynamicTag(nodeAccessor, getContent, getTagVar, inpu
|
|
|
1517
1540
|
}
|
|
1518
1541
|
};
|
|
1519
1542
|
};
|
|
1543
|
+
function _dynamic_tag_content(nodeAccessor) {
|
|
1544
|
+
const childScopeAccessor = "BranchScopes:" + nodeAccessor;
|
|
1545
|
+
const rendererAccessor = "ConditionalRenderer:" + nodeAccessor;
|
|
1546
|
+
enableBranches();
|
|
1547
|
+
return (scope, renderer) => {
|
|
1548
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = renderer?.["id"] || renderer)) {
|
|
1549
|
+
setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
|
|
1550
|
+
if (renderer?.["accessor"]) subscribeToScopeSet(renderer["owner"], renderer["accessor"], scope[childScopeAccessor]);
|
|
1551
|
+
}
|
|
1552
|
+
if (renderer) for (const accessor in renderer["localClosures"]) renderer["localClosures"][accessor](scope[childScopeAccessor], renderer["localClosureValues"][accessor]);
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1520
1555
|
function _resume_dynamic_tag() {
|
|
1521
1556
|
_resume(DYNAMIC_TAG_SCRIPT_REGISTER_ID, dynamicTagScript);
|
|
1522
1557
|
}
|
|
@@ -2079,4 +2114,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
2079
2114
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
2080
2115
|
}
|
|
2081
2116
|
//#endregion
|
|
2082
|
-
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_default, _attr_input_value_default as _attr_textarea_value_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, _dynamic_tag, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_to, _for_until, _hoist, _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, _resume_dynamic_tag, _return, _return_change, _script, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
|
2117
|
+
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_default, _attr_input_value_default as _attr_textarea_value_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, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_to, _for_until, _hoist, _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, _resume_dynamic_tag, _return, _return_change, _script, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
package/dist/debug/html.js
CHANGED
|
@@ -100,6 +100,9 @@ function isVoid(value) {
|
|
|
100
100
|
function isNotVoid(value) {
|
|
101
101
|
return value != null && value !== false;
|
|
102
102
|
}
|
|
103
|
+
function isPromise(value) {
|
|
104
|
+
return value != null && typeof value.then === "function";
|
|
105
|
+
}
|
|
103
106
|
function normalizeDynamicRenderer(value) {
|
|
104
107
|
if (value) {
|
|
105
108
|
if (typeof value === "string") return value;
|
|
@@ -197,6 +200,10 @@ function joinWithAnd(a) {
|
|
|
197
200
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
198
201
|
//#endregion
|
|
199
202
|
//#region src/html/content.ts
|
|
203
|
+
function _to_text(val) {
|
|
204
|
+
assertValidTextValue(val);
|
|
205
|
+
return val || val === 0 ? val + "" : "";
|
|
206
|
+
}
|
|
200
207
|
function _unescaped(val) {
|
|
201
208
|
assertValidTextValue(val);
|
|
202
209
|
return val ? val + "" : val === 0 ? "0" : "";
|
|
@@ -2422,9 +2429,6 @@ function flushTickQueue() {
|
|
|
2422
2429
|
tickQueue = void 0;
|
|
2423
2430
|
for (const cb of queue) cb(true);
|
|
2424
2431
|
}
|
|
2425
|
-
function isPromise(value) {
|
|
2426
|
-
return value != null && typeof value.then === "function";
|
|
2427
|
-
}
|
|
2428
2432
|
function getFilteredGlobals($global) {
|
|
2429
2433
|
if (!$global) return 0;
|
|
2430
2434
|
const serializedGlobals = $global.serializedGlobals;
|
|
@@ -3199,6 +3203,7 @@ exports._serialize_if = _serialize_if;
|
|
|
3199
3203
|
exports._set_serialize_reason = _set_serialize_reason;
|
|
3200
3204
|
exports._subscribe = _subscribe;
|
|
3201
3205
|
exports._template = _template;
|
|
3206
|
+
exports._to_text = _to_text;
|
|
3202
3207
|
exports._trailers = _trailers;
|
|
3203
3208
|
exports._try = _try;
|
|
3204
3209
|
exports._unescaped = _unescaped;
|
package/dist/debug/html.mjs
CHANGED
|
@@ -98,6 +98,9 @@ function isVoid(value) {
|
|
|
98
98
|
function isNotVoid(value) {
|
|
99
99
|
return value != null && value !== false;
|
|
100
100
|
}
|
|
101
|
+
function isPromise(value) {
|
|
102
|
+
return value != null && typeof value.then === "function";
|
|
103
|
+
}
|
|
101
104
|
function normalizeDynamicRenderer(value) {
|
|
102
105
|
if (value) {
|
|
103
106
|
if (typeof value === "string") return value;
|
|
@@ -195,6 +198,10 @@ function joinWithAnd(a) {
|
|
|
195
198
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
196
199
|
//#endregion
|
|
197
200
|
//#region src/html/content.ts
|
|
201
|
+
function _to_text(val) {
|
|
202
|
+
assertValidTextValue(val);
|
|
203
|
+
return val || val === 0 ? val + "" : "";
|
|
204
|
+
}
|
|
198
205
|
function _unescaped(val) {
|
|
199
206
|
assertValidTextValue(val);
|
|
200
207
|
return val ? val + "" : val === 0 ? "0" : "";
|
|
@@ -2420,9 +2427,6 @@ function flushTickQueue() {
|
|
|
2420
2427
|
tickQueue = void 0;
|
|
2421
2428
|
for (const cb of queue) cb(true);
|
|
2422
2429
|
}
|
|
2423
|
-
function isPromise(value) {
|
|
2424
|
-
return value != null && typeof value.then === "function";
|
|
2425
|
-
}
|
|
2426
2430
|
function getFilteredGlobals($global) {
|
|
2427
2431
|
if (!$global) return 0;
|
|
2428
2432
|
const serializedGlobals = $global.serializedGlobals;
|
|
@@ -3132,4 +3136,4 @@ const compat = {
|
|
|
3132
3136
|
};
|
|
3133
3137
|
function NOOP() {}
|
|
3134
3138
|
//#endregion
|
|
3135
|
-
export { $global, _assert_hoist, _attr, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _escape, _escape_comment, _escape_script, _escape_style, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _set_serialize_reason, _subscribe, _template, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, withLoadAssets, withPageAssets };
|
|
3139
|
+
export { $global, _assert_hoist, _attr, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _escape, _escape_comment, _escape_script, _escape_style, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _set_serialize_reason, _subscribe, _template, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, withLoadAssets, withPageAssets };
|
|
@@ -12,6 +12,7 @@ export declare function renderCatch(scope: Scope, error: unknown): void;
|
|
|
12
12
|
export declare function _if(nodeAccessor: EncodedAccessor, ...branchesArgs: (string | SetupFn | 0)[]): (scope: Scope, newBranch: number) => void;
|
|
13
13
|
export declare function patchDynamicTag(fn: <T extends typeof _dynamic_tag>(cond: T) => T): void;
|
|
14
14
|
export declare let _dynamic_tag: (nodeAccessor: EncodedAccessor, getContent?: ((scope: Scope) => Renderer) | 0, getTagVar?: (() => Signal<unknown>) | 0, inputIsArgs?: 1) => Signal<Renderer | string | undefined>;
|
|
15
|
+
export declare function _dynamic_tag_content(nodeAccessor: EncodedAccessor): Signal<Renderer | undefined>;
|
|
15
16
|
export declare function _resume_dynamic_tag(): void;
|
|
16
17
|
export declare function setConditionalRenderer<T>(scope: Scope, nodeAccessor: Accessor, newRenderer: T, createBranch: ($global: Scope[AccessorProp.Global], renderer: NonNullable<T>, parentScope: Scope, parentNode: ParentNode) => BranchScope): void;
|
|
17
18
|
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;
|
package/dist/dom.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { forIn, forOf, forTo, forUntil } from "./common/for";
|
|
|
4
4
|
export { _call } from "./common/helpers";
|
|
5
5
|
export { $signal, $signalReset } from "./dom/abort-signal";
|
|
6
6
|
export { compat } from "./dom/compat";
|
|
7
|
-
export { _await_content, _await_promise, _dynamic_tag, _for_in, _for_of, _for_to, _for_until, _if, _resume_dynamic_tag, _try, } from "./dom/control-flow";
|
|
7
|
+
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_to, _for_until, _if, _resume_dynamic_tag, _try, } from "./dom/control-flow";
|
|
8
8
|
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, } from "./dom/controllable";
|
|
9
9
|
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _text, _text_content, _to_text, } from "./dom/dom";
|
|
10
10
|
export { _on } from "./dom/event";
|
package/dist/dom.js
CHANGED
|
@@ -138,6 +138,9 @@ function getEventHandlerName(name) {
|
|
|
138
138
|
function isNotVoid(value) {
|
|
139
139
|
return value != null && value !== !1;
|
|
140
140
|
}
|
|
141
|
+
function isPromise(value) {
|
|
142
|
+
return value != null && typeof value.then == "function";
|
|
143
|
+
}
|
|
141
144
|
function normalizeDynamicRenderer(value) {
|
|
142
145
|
if (value) {
|
|
143
146
|
if (typeof value == "string") return value;
|
|
@@ -872,6 +875,14 @@ function _await_promise(nodeAccessor, params) {
|
|
|
872
875
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
873
876
|
let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor;
|
|
874
877
|
return _enable_catch(), (scope, promise) => {
|
|
878
|
+
if (!isPromise(promise)) {
|
|
879
|
+
if (!scope[promiseAccessor]) {
|
|
880
|
+
let resolve = () => resolveAwait(scope, branchAccessor, nodeAccessor, scope[nodeAccessor], params, promise);
|
|
881
|
+
scope[branchAccessor] ? resolve() : scope[promiseAccessor] = resolve;
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
promise = Promise.resolve(promise);
|
|
885
|
+
}
|
|
875
886
|
let awaitBranch = scope[branchAccessor], tryPlaceholder = findBranchWithKey(scope, "Q"), tryBranch = tryPlaceholder || awaitBranch, awaitCounter = tryBranch.O;
|
|
876
887
|
placeholderShown.add(pendingEffects), tryPlaceholder ? scope[promiseAccessor] || (awaitBranch && (awaitBranch.W ||= []), awaitCounter = addAwaitCounter(scope, tryPlaceholder)) : (awaitCounter?.i || (awaitCounter = tryBranch.O = {
|
|
877
888
|
i: 0,
|
|
@@ -886,7 +897,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
886
897
|
if (thisPromise === scope[promiseAccessor]) {
|
|
887
898
|
let referenceNode = scope[nodeAccessor];
|
|
888
899
|
scope[promiseAccessor] = 0, queueAsyncRender(scope, () => {
|
|
889
|
-
|
|
900
|
+
awaitBranch = resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, data);
|
|
890
901
|
let pendingRenders = awaitBranch.W;
|
|
891
902
|
if (awaitBranch.W = 0, pendingRenders?.forEach(queuePendingRender), placeholderShown.add(pendingEffects), awaitCounter.c(), awaitCounter.m) {
|
|
892
903
|
let fnScopes = /* @__PURE__ */ new Map(), effects = awaitCounter.m([]);
|
|
@@ -906,12 +917,18 @@ function _await_promise(nodeAccessor, params) {
|
|
|
906
917
|
});
|
|
907
918
|
};
|
|
908
919
|
}
|
|
920
|
+
function resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, value) {
|
|
921
|
+
let awaitBranch = scope[branchAccessor];
|
|
922
|
+
return awaitBranch.V && (awaitBranch.Y = awaitBranch.Y?.forEach(syncGen), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch, [value]), awaitBranch;
|
|
923
|
+
}
|
|
909
924
|
function _await_content(nodeAccessor, template, walks, setup) {
|
|
910
925
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
911
|
-
let branchAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
926
|
+
let branchAccessor = "A" + nodeAccessor, promiseAccessor = "L" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
912
927
|
return (scope) => {
|
|
913
928
|
let pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope.$, renderer, scope, scope[nodeAccessor].parentNode)).V = renderer);
|
|
914
929
|
scope[branchAccessor].Y = pendingScopes;
|
|
930
|
+
let resolveSync = scope[promiseAccessor];
|
|
931
|
+
typeof resolveSync == "function" && (scope[promiseAccessor] = 0, resolveSync());
|
|
915
932
|
};
|
|
916
933
|
}
|
|
917
934
|
function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, "Q")) {
|
|
@@ -962,6 +979,13 @@ function _if(nodeAccessor, ...branchesArgs) {
|
|
|
962
979
|
function patchDynamicTag(fn) {
|
|
963
980
|
_dynamic_tag = fn(_dynamic_tag);
|
|
964
981
|
}
|
|
982
|
+
function _dynamic_tag_content(nodeAccessor) {
|
|
983
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
984
|
+
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
985
|
+
return enableBranches(), (scope, renderer) => {
|
|
986
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = renderer?.a || 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]);
|
|
987
|
+
};
|
|
988
|
+
}
|
|
965
989
|
function _resume_dynamic_tag() {
|
|
966
990
|
_resume("d", dynamicTagScript);
|
|
967
991
|
}
|
|
@@ -1257,4 +1281,4 @@ exports.$signal = $signal, exports.$signalReset = $signalReset, exports._assert_
|
|
|
1257
1281
|
get: function() {
|
|
1258
1282
|
return _dynamic_tag;
|
|
1259
1283
|
}
|
|
1260
|
-
}), exports._el = _el, exports._el_read = _el_read, exports._enable_catch = _enable_catch, exports._for_closure = _for_closure, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_resume = _hoist_resume, exports._html = _html, exports._id = _id, exports._if = _if, exports._if_closure = _if_closure, exports._let = _let, exports._let_change = _let_change, exports._lifecycle = _lifecycle, 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 = _on, exports._or = _or, exports._resume = _resume, exports._resume_dynamic_tag = _resume_dynamic_tag, exports._return = _return, exports._return_change = _return_change, exports._script = _script, exports._template = _template, exports._text = _text, exports._text_content = _text_content, exports._to_text = _to_text, exports._try = _try, exports._var = _var, exports._var_change = _var_change, exports._var_resume = _var_resume, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.init = init, exports.initEmbedded = initEmbedded, exports.ready = ready, exports.run = run;
|
|
1284
|
+
}), exports._dynamic_tag_content = _dynamic_tag_content, exports._el = _el, exports._el_read = _el_read, exports._enable_catch = _enable_catch, exports._for_closure = _for_closure, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_resume = _hoist_resume, exports._html = _html, exports._id = _id, exports._if = _if, exports._if_closure = _if_closure, exports._let = _let, exports._let_change = _let_change, exports._lifecycle = _lifecycle, 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 = _on, exports._or = _or, exports._resume = _resume, exports._resume_dynamic_tag = _resume_dynamic_tag, exports._return = _return, exports._return_change = _return_change, exports._script = _script, exports._template = _template, exports._text = _text, exports._text_content = _text_content, exports._to_text = _to_text, exports._try = _try, exports._var = _var, exports._var_change = _var_change, exports._var_resume = _var_resume, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.init = init, exports.initEmbedded = initEmbedded, exports.ready = ready, exports.run = run;
|
package/dist/dom.mjs
CHANGED
|
@@ -137,6 +137,9 @@ function getEventHandlerName(name) {
|
|
|
137
137
|
function isNotVoid(value) {
|
|
138
138
|
return value != null && value !== !1;
|
|
139
139
|
}
|
|
140
|
+
function isPromise(value) {
|
|
141
|
+
return value != null && typeof value.then == "function";
|
|
142
|
+
}
|
|
140
143
|
function normalizeDynamicRenderer(value) {
|
|
141
144
|
if (value) {
|
|
142
145
|
if (typeof value == "string") return value;
|
|
@@ -871,6 +874,14 @@ function _await_promise(nodeAccessor, params) {
|
|
|
871
874
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
872
875
|
let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor;
|
|
873
876
|
return _enable_catch(), (scope, promise) => {
|
|
877
|
+
if (!isPromise(promise)) {
|
|
878
|
+
if (!scope[promiseAccessor]) {
|
|
879
|
+
let resolve = () => resolveAwait(scope, branchAccessor, nodeAccessor, scope[nodeAccessor], params, promise);
|
|
880
|
+
scope[branchAccessor] ? resolve() : scope[promiseAccessor] = resolve;
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
promise = Promise.resolve(promise);
|
|
884
|
+
}
|
|
874
885
|
let awaitBranch = scope[branchAccessor], tryPlaceholder = findBranchWithKey(scope, "Q"), tryBranch = tryPlaceholder || awaitBranch, awaitCounter = tryBranch.O;
|
|
875
886
|
placeholderShown.add(pendingEffects), tryPlaceholder ? scope[promiseAccessor] || (awaitBranch && (awaitBranch.W ||= []), awaitCounter = addAwaitCounter(scope, tryPlaceholder)) : (awaitCounter?.i || (awaitCounter = tryBranch.O = {
|
|
876
887
|
i: 0,
|
|
@@ -885,7 +896,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
885
896
|
if (thisPromise === scope[promiseAccessor]) {
|
|
886
897
|
let referenceNode = scope[nodeAccessor];
|
|
887
898
|
scope[promiseAccessor] = 0, queueAsyncRender(scope, () => {
|
|
888
|
-
|
|
899
|
+
awaitBranch = resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, data);
|
|
889
900
|
let pendingRenders = awaitBranch.W;
|
|
890
901
|
if (awaitBranch.W = 0, pendingRenders?.forEach(queuePendingRender), placeholderShown.add(pendingEffects), awaitCounter.c(), awaitCounter.m) {
|
|
891
902
|
let fnScopes = /* @__PURE__ */ new Map(), effects = awaitCounter.m([]);
|
|
@@ -905,12 +916,18 @@ function _await_promise(nodeAccessor, params) {
|
|
|
905
916
|
});
|
|
906
917
|
};
|
|
907
918
|
}
|
|
919
|
+
function resolveAwait(scope, branchAccessor, nodeAccessor, referenceNode, params, value) {
|
|
920
|
+
let awaitBranch = scope[branchAccessor];
|
|
921
|
+
return awaitBranch.V && (awaitBranch.Y = awaitBranch.Y?.forEach(syncGen), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch, [value]), awaitBranch;
|
|
922
|
+
}
|
|
908
923
|
function _await_content(nodeAccessor, template, walks, setup) {
|
|
909
924
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
910
|
-
let branchAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
925
|
+
let branchAccessor = "A" + nodeAccessor, promiseAccessor = "L" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
911
926
|
return (scope) => {
|
|
912
927
|
let pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope.$, renderer, scope, scope[nodeAccessor].parentNode)).V = renderer);
|
|
913
928
|
scope[branchAccessor].Y = pendingScopes;
|
|
929
|
+
let resolveSync = scope[promiseAccessor];
|
|
930
|
+
typeof resolveSync == "function" && (scope[promiseAccessor] = 0, resolveSync());
|
|
914
931
|
};
|
|
915
932
|
}
|
|
916
933
|
function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, "Q")) {
|
|
@@ -961,6 +978,13 @@ function _if(nodeAccessor, ...branchesArgs) {
|
|
|
961
978
|
function patchDynamicTag(fn) {
|
|
962
979
|
_dynamic_tag = fn(_dynamic_tag);
|
|
963
980
|
}
|
|
981
|
+
function _dynamic_tag_content(nodeAccessor) {
|
|
982
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
983
|
+
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
984
|
+
return enableBranches(), (scope, renderer) => {
|
|
985
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = renderer?.a || 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]);
|
|
986
|
+
};
|
|
987
|
+
}
|
|
964
988
|
function _resume_dynamic_tag() {
|
|
965
989
|
_resume("d", dynamicTagScript);
|
|
966
990
|
}
|
|
@@ -1252,4 +1276,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
1252
1276
|
return document.querySelector(selector) || resolve();
|
|
1253
1277
|
}
|
|
1254
1278
|
//#endregion
|
|
1255
|
-
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_default, _attr_input_value_default as _attr_textarea_value_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, _dynamic_tag, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_to, _for_until, _hoist, _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, _resume_dynamic_tag, _return, _return_change, _script, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
|
1279
|
+
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_default, _attr_input_value_default as _attr_textarea_value_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, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_to, _for_until, _hoist, _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, _resume_dynamic_tag, _return, _return_change, _script, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
package/dist/html/content.d.ts
CHANGED
package/dist/html.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/erro
|
|
|
3
3
|
export { _flush_head, withLoadAssets, withPageAssets } from "./html/assets";
|
|
4
4
|
export { _attr, _attr_class, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, } from "./html/attrs";
|
|
5
5
|
export { compat } from "./html/compat";
|
|
6
|
-
export { _escape, _escape_comment, _escape_script, _escape_style, _unescaped, } from "./html/content";
|
|
6
|
+
export { _escape, _escape_comment, _escape_script, _escape_style, _to_text, _unescaped, } from "./html/content";
|
|
7
7
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
8
|
export { forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, } from "./html/for";
|
|
9
9
|
export { _template } from "./html/template";
|
package/dist/html.js
CHANGED
|
@@ -387,6 +387,9 @@ function isVoid(value) {
|
|
|
387
387
|
function isNotVoid(value) {
|
|
388
388
|
return value != null && value !== !1;
|
|
389
389
|
}
|
|
390
|
+
function isPromise(value) {
|
|
391
|
+
return value != null && typeof value.then == "function";
|
|
392
|
+
}
|
|
390
393
|
function normalizeDynamicRenderer(value) {
|
|
391
394
|
if (value) {
|
|
392
395
|
if (typeof value == "string") return value;
|
|
@@ -401,6 +404,9 @@ function _hoist_read_error() {}
|
|
|
401
404
|
function _assert_hoist(value) {}
|
|
402
405
|
//#endregion
|
|
403
406
|
//#region src/html/content.ts
|
|
407
|
+
function _to_text(val) {
|
|
408
|
+
return val || val === 0 ? val + "" : "";
|
|
409
|
+
}
|
|
404
410
|
function _unescaped(val) {
|
|
405
411
|
return val ? val + "" : val === 0 ? "0" : "";
|
|
406
412
|
}
|
|
@@ -1574,9 +1580,6 @@ function flushTickQueue() {
|
|
|
1574
1580
|
tickQueue = void 0;
|
|
1575
1581
|
for (let cb of queue) cb(!0);
|
|
1576
1582
|
}
|
|
1577
|
-
function isPromise(value) {
|
|
1578
|
-
return value != null && typeof value.then == "function";
|
|
1579
|
-
}
|
|
1580
1583
|
function getFilteredGlobals($global) {
|
|
1581
1584
|
if (!$global) return 0;
|
|
1582
1585
|
let serializedGlobals = $global.serializedGlobals;
|
|
@@ -1969,4 +1972,4 @@ exports.$global = $global, exports._assert_hoist = _assert_hoist, exports._attr
|
|
|
1969
1972
|
get: function() {
|
|
1970
1973
|
return _dynamic_tag;
|
|
1971
1974
|
}
|
|
1972
|
-
}), exports._el = _el, exports._el_read_error = _el_read_error, exports._el_resume = _el_resume, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._sep = _sep, exports._serialize_guard = _serialize_guard, exports._serialize_if = _serialize_if, exports._set_serialize_reason = _set_serialize_reason, exports._subscribe = _subscribe, exports._template = _template, exports._trailers = _trailers, exports._try = _try, exports._unescaped = _unescaped, exports._var = _var, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forInBy = forInBy, exports.forOf = forOf, exports.forOfBy = forOfBy, exports.forStepBy = forStepBy, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;
|
|
1975
|
+
}), exports._el = _el, exports._el_read_error = _el_read_error, exports._el_resume = _el_resume, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._sep = _sep, exports._serialize_guard = _serialize_guard, exports._serialize_if = _serialize_if, exports._set_serialize_reason = _set_serialize_reason, exports._subscribe = _subscribe, exports._template = _template, exports._to_text = _to_text, exports._trailers = _trailers, exports._try = _try, exports._unescaped = _unescaped, exports._var = _var, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forInBy = forInBy, exports.forOf = forOf, exports.forOfBy = forOfBy, exports.forStepBy = forStepBy, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;
|
package/dist/html.mjs
CHANGED
|
@@ -386,6 +386,9 @@ function isVoid(value) {
|
|
|
386
386
|
function isNotVoid(value) {
|
|
387
387
|
return value != null && value !== !1;
|
|
388
388
|
}
|
|
389
|
+
function isPromise(value) {
|
|
390
|
+
return value != null && typeof value.then == "function";
|
|
391
|
+
}
|
|
389
392
|
function normalizeDynamicRenderer(value) {
|
|
390
393
|
if (value) {
|
|
391
394
|
if (typeof value == "string") return value;
|
|
@@ -400,6 +403,9 @@ function _hoist_read_error() {}
|
|
|
400
403
|
function _assert_hoist(value) {}
|
|
401
404
|
//#endregion
|
|
402
405
|
//#region src/html/content.ts
|
|
406
|
+
function _to_text(val) {
|
|
407
|
+
return val || val === 0 ? val + "" : "";
|
|
408
|
+
}
|
|
403
409
|
function _unescaped(val) {
|
|
404
410
|
return val ? val + "" : val === 0 ? "0" : "";
|
|
405
411
|
}
|
|
@@ -1573,9 +1579,6 @@ function flushTickQueue() {
|
|
|
1573
1579
|
tickQueue = void 0;
|
|
1574
1580
|
for (let cb of queue) cb(!0);
|
|
1575
1581
|
}
|
|
1576
|
-
function isPromise(value) {
|
|
1577
|
-
return value != null && typeof value.then == "function";
|
|
1578
|
-
}
|
|
1579
1582
|
function getFilteredGlobals($global) {
|
|
1580
1583
|
if (!$global) return 0;
|
|
1581
1584
|
let serializedGlobals = $global.serializedGlobals;
|
|
@@ -1964,4 +1967,4 @@ function toObjectExpression(options) {
|
|
|
1964
1967
|
//#region src/html/compat.ts
|
|
1965
1968
|
function NOOP() {}
|
|
1966
1969
|
//#endregion
|
|
1967
|
-
export { $global, _assert_hoist, _attr, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _escape, _escape_comment, _escape_script, _escape_style, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _set_serialize_reason, _subscribe, _template, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, withLoadAssets, withPageAssets };
|
|
1970
|
+
export { $global, _assert_hoist, _attr, _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_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _escape, _escape_comment, _escape_script, _escape_style, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _set_serialize_reason, _subscribe, _template, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, withLoadAssets, withPageAssets };
|