marko 6.3.46 → 6.3.47
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/constants/resume-symbol.d.ts +5 -2
- package/dist/common/helpers.d.ts +2 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.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-WyMgkHne.js → dom-BheMBjYT.js} +17 -8
- package/dist/debug/{dom-CIt3_Sdm.mjs → dom-DyBeisho.mjs} +17 -8
- package/dist/debug/dom.js +1 -1
- package/dist/debug/dom.mjs +1 -1
- package/dist/debug/html.js +19 -5
- package/dist/debug/html.mjs +18 -5
- package/dist/dom/catch.feat.js +1 -1
- package/dist/dom/catch.feat.mjs +1 -1
- 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/dom.d.ts +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-DN6BTUmH.mjs → dom-BbknkVDz.mjs} +11 -12
- package/dist/{dom-R3sALHJt.js → dom-DprILxYO.js} +11 -12
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/html/writer.d.ts +2 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +16 -5
- package/dist/html.mjs +16 -5
- package/dist/translator/index.js +11 -19
- package/dist/translator/visitors/constants/sibling-text.d.ts +0 -1
- package/package.json +3 -3
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export declare const Node = "
|
|
1
|
+
export declare const Node = "$";
|
|
2
|
+
export declare const EmptyText = "%";
|
|
3
|
+
export declare const HtmlStart = "&";
|
|
4
|
+
export declare const HtmlEnd = "'";
|
|
2
5
|
export declare const BranchStart = "[";
|
|
3
6
|
export declare const BranchEnd = "]";
|
|
4
|
-
export declare const BranchEndNativeTag = "
|
|
7
|
+
export declare const BranchEndNativeTag = "(";
|
|
5
8
|
export declare const BranchEndSingleNode = "|";
|
|
6
9
|
export declare const BranchEndOnlyChildInParent = ")";
|
|
7
10
|
export declare const BranchEndSingleNodeOnlyChildInParent = "}";
|
package/dist/common/helpers.d.ts
CHANGED
|
@@ -15,3 +15,5 @@ export declare function normalizeDynamicRenderer<Renderer>(value: any): Renderer
|
|
|
15
15
|
export declare const decodeAccessor: (num: number) => string;
|
|
16
16
|
export declare let branchesEnabled: undefined | 1;
|
|
17
17
|
export declare function withBranches<T>(runtime?: T): T;
|
|
18
|
+
export declare let dynamicHtmlEnabled: undefined | 1;
|
|
19
|
+
export declare function withDynamicHtml<T>(runtime: T): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as PendingEffects, Sn as Scope, g as renderCatch, jn as PendingRenders, kn as ParentBranch, nn as installCatch, rn as placeholderShown, tn as caughtError, wn as ClosestBranch, xn as Pending } from "../dom-
|
|
1
|
+
import { An as PendingEffects, Sn as Scope, g as renderCatch, jn as PendingRenders, kn as ParentBranch, nn as installCatch, rn as placeholderShown, tn as caughtError, wn as ClosestBranch, xn as Pending } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/catch.feat.ts
|
|
3
3
|
const handlePendingTry = (fn, scope, branch) => {
|
|
4
4
|
while (branch) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/controllable-input.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
|
|
5
5
|
require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/controllable-input.feat.ts
|
|
3
3
|
controllableScripts[0] = _attr_input_checked_script;
|
|
4
4
|
controllableScripts[1] = _attr_input_checkedValue_script;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/controllable-open.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/controllable-select.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/controllable-textarea.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-
|
|
1
|
+
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-DyBeisho.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/dynamic-tag-var.feat.ts
|
|
4
4
|
const elementGetter = (branch) => () => require_control_flow._el_read(branch[require_control_flow.StartNode]);
|
|
5
5
|
require_control_flow.installDynamicTagVar((branch) => branch[require_control_flow.TagVariable](elementGetter(branch)));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nn as StartNode, Pn as TagVariable, Zt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, kt as _el_read, m as installDynamicTagVar } from "../dom-
|
|
1
|
+
import { Nn as StartNode, Pn as TagVariable, Zt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, kt as _el_read, m as installDynamicTagVar } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/dynamic-tag-var.feat.ts
|
|
3
3
|
const elementGetter = (branch) => () => _el_read(branch[StartNode]);
|
|
4
4
|
installDynamicTagVar((branch) => branch[TagVariable](elementGetter(branch)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BheMBjYT.js");
|
|
3
3
|
//#region src/dom/placeholder.feat.ts
|
|
4
4
|
require_control_flow.registeredValues[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
5
5
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as registeredValues, Kt as destroyBranch, Mn as PlaceholderBranch, Qt as PLACEHOLDER_DISMISS_REGISTER_ID } from "../dom-
|
|
1
|
+
import { Ct as registeredValues, Kt as destroyBranch, Mn as PlaceholderBranch, Qt as PLACEHOLDER_DISMISS_REGISTER_ID } from "../dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
registeredValues[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
4
4
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -178,6 +178,11 @@ function withBranches(runtime) {
|
|
|
178
178
|
branchesEnabled = 1;
|
|
179
179
|
return runtime;
|
|
180
180
|
}
|
|
181
|
+
let dynamicHtmlEnabled;
|
|
182
|
+
function withDynamicHtml(runtime) {
|
|
183
|
+
dynamicHtmlEnabled = 1;
|
|
184
|
+
return runtime;
|
|
185
|
+
}
|
|
181
186
|
//#endregion
|
|
182
187
|
//#region src/common/errors.ts
|
|
183
188
|
const lowercaseEventHandlerReg = /^on[a-z]/;
|
|
@@ -944,7 +949,7 @@ function init(runtimeId = "M") {
|
|
|
944
949
|
while (startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling));
|
|
945
950
|
branch["_"] ??= visitScope;
|
|
946
951
|
branch[EndNode] = branch[StartNode] = startVisit;
|
|
947
|
-
if (visitType === "
|
|
952
|
+
if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
|
|
948
953
|
} else {
|
|
949
954
|
curBranchScopes = push(curBranchScopes, branch);
|
|
950
955
|
if (accessor) {
|
|
@@ -1011,6 +1016,7 @@ function init(runtimeId = "M") {
|
|
|
1011
1016
|
let lastToken;
|
|
1012
1017
|
let lastTokenIndex;
|
|
1013
1018
|
let visitBranches;
|
|
1019
|
+
let htmlStart;
|
|
1014
1020
|
let embedAnchor;
|
|
1015
1021
|
serializeContext._ = registeredValues;
|
|
1016
1022
|
if (render.m) throw new Error(`Marko rendered multiple times with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as ${JSON.stringify(renderId)}. Ensure each render into a page has a unique $global.renderId.`);
|
|
@@ -1029,11 +1035,14 @@ function init(runtimeId = "M") {
|
|
|
1029
1035
|
visitText = visit.data;
|
|
1030
1036
|
visitType = visitText[lastTokenIndex++];
|
|
1031
1037
|
visitScope = getScope(nextToken());
|
|
1032
|
-
if (visitType === "
|
|
1033
|
-
|
|
1034
|
-
visitScope[nextToken()] =
|
|
1035
|
-
|
|
1036
|
-
|
|
1038
|
+
if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'") if (visitType === "&") htmlStart = visit;
|
|
1039
|
+
else {
|
|
1040
|
+
visitScope[nextToken()] = htmlStart;
|
|
1041
|
+
visitScope[DynamicHTMLLastChild + lastToken] = visit;
|
|
1042
|
+
}
|
|
1043
|
+
else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
|
|
1044
|
+
else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
|
|
1045
|
+
else visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
|
|
1037
1046
|
}
|
|
1038
1047
|
if (embedRenders && !embedAnchor && visit) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
|
|
1039
1048
|
visits.length = retained;
|
|
@@ -1283,14 +1292,14 @@ function _attrs_script(scope, nodeAccessor) {
|
|
|
1283
1292
|
controllableScripts[scope[ControlledType + nodeAccessor]]?.(scope, nodeAccessor);
|
|
1284
1293
|
for (const name in events) _on(el, name, events[name]);
|
|
1285
1294
|
}
|
|
1286
|
-
function _html(scope, value, accessor) {
|
|
1295
|
+
const _html = /*@__PURE__*/ withDynamicHtml(function _html(scope, value, accessor) {
|
|
1287
1296
|
const firstChild = scope[accessor];
|
|
1288
1297
|
const parentNode = firstChild.parentNode;
|
|
1289
1298
|
const lastChild = scope["DynamicHTMLLastChild:" + accessor] || firstChild;
|
|
1290
1299
|
const newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
1291
1300
|
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope[DynamicHTMLLastChild + accessor] = newContent.lastChild);
|
|
1292
1301
|
removeChildNodes(firstChild, lastChild);
|
|
1293
|
-
}
|
|
1302
|
+
});
|
|
1294
1303
|
function normalizeClientRender(value) {
|
|
1295
1304
|
const renderer = normalizeDynamicRenderer(value);
|
|
1296
1305
|
if (renderer) if (renderer["id"]) return renderer;
|
|
@@ -177,6 +177,11 @@ function withBranches(runtime) {
|
|
|
177
177
|
branchesEnabled = 1;
|
|
178
178
|
return runtime;
|
|
179
179
|
}
|
|
180
|
+
let dynamicHtmlEnabled;
|
|
181
|
+
function withDynamicHtml(runtime) {
|
|
182
|
+
dynamicHtmlEnabled = 1;
|
|
183
|
+
return runtime;
|
|
184
|
+
}
|
|
180
185
|
//#endregion
|
|
181
186
|
//#region src/common/errors.ts
|
|
182
187
|
const lowercaseEventHandlerReg = /^on[a-z]/;
|
|
@@ -943,7 +948,7 @@ function init(runtimeId = "M") {
|
|
|
943
948
|
while (startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling));
|
|
944
949
|
branch["_"] ??= visitScope;
|
|
945
950
|
branch[EndNode] = branch[StartNode] = startVisit;
|
|
946
|
-
if (visitType === "
|
|
951
|
+
if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
|
|
947
952
|
} else {
|
|
948
953
|
curBranchScopes = push(curBranchScopes, branch);
|
|
949
954
|
if (accessor) {
|
|
@@ -1010,6 +1015,7 @@ function init(runtimeId = "M") {
|
|
|
1010
1015
|
let lastToken;
|
|
1011
1016
|
let lastTokenIndex;
|
|
1012
1017
|
let visitBranches;
|
|
1018
|
+
let htmlStart;
|
|
1013
1019
|
let embedAnchor;
|
|
1014
1020
|
serializeContext._ = registeredValues;
|
|
1015
1021
|
if (render.m) throw new Error(`Marko rendered multiple times with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as ${JSON.stringify(renderId)}. Ensure each render into a page has a unique $global.renderId.`);
|
|
@@ -1028,11 +1034,14 @@ function init(runtimeId = "M") {
|
|
|
1028
1034
|
visitText = visit.data;
|
|
1029
1035
|
visitType = visitText[lastTokenIndex++];
|
|
1030
1036
|
visitScope = getScope(nextToken());
|
|
1031
|
-
if (visitType === "
|
|
1032
|
-
|
|
1033
|
-
visitScope[nextToken()] =
|
|
1034
|
-
|
|
1035
|
-
|
|
1037
|
+
if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'") if (visitType === "&") htmlStart = visit;
|
|
1038
|
+
else {
|
|
1039
|
+
visitScope[nextToken()] = htmlStart;
|
|
1040
|
+
visitScope[DynamicHTMLLastChild + lastToken] = visit;
|
|
1041
|
+
}
|
|
1042
|
+
else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
|
|
1043
|
+
else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
|
|
1044
|
+
else visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
|
|
1036
1045
|
}
|
|
1037
1046
|
if (embedRenders && !embedAnchor && visit) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]);
|
|
1038
1047
|
visits.length = retained;
|
|
@@ -1282,14 +1291,14 @@ function _attrs_script(scope, nodeAccessor) {
|
|
|
1282
1291
|
controllableScripts[scope[ControlledType + nodeAccessor]]?.(scope, nodeAccessor);
|
|
1283
1292
|
for (const name in events) _on(el, name, events[name]);
|
|
1284
1293
|
}
|
|
1285
|
-
function _html(scope, value, accessor) {
|
|
1294
|
+
const _html = /*@__PURE__*/ withDynamicHtml(function _html(scope, value, accessor) {
|
|
1286
1295
|
const firstChild = scope[accessor];
|
|
1287
1296
|
const parentNode = firstChild.parentNode;
|
|
1288
1297
|
const lastChild = scope["DynamicHTMLLastChild:" + accessor] || firstChild;
|
|
1289
1298
|
const newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
1290
1299
|
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope[DynamicHTMLLastChild + accessor] = newContent.lastChild);
|
|
1291
1300
|
removeChildNodes(firstChild, lastChild);
|
|
1292
|
-
}
|
|
1301
|
+
});
|
|
1293
1302
|
function normalizeClientRender(value) {
|
|
1294
1303
|
const renderer = normalizeDynamicRenderer(value);
|
|
1295
1304
|
if (renderer) if (renderer["id"]) return renderer;
|
package/dist/debug/dom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
3
|
+
const require_control_flow = require("./dom-BheMBjYT.js");
|
|
4
4
|
//#region src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as _attrs_script, $t as $signal, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dn as Global, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nn as StartNode, Nt as _hoist, O as _attr_input_value_default, On as Load, Ot as _const, P as _controllable_input, Pn as TagVariable, Pt as _hoist_resume, Q as _attrs_partial_content, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tn as EndNode, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, _ as _attr_details_or_dialog_open, _n as Clone, _t as _var_resume, a as _for_in, an as queueAsyncRender, at as _text_content, b as _attr_input_checked, bn as Setup, bt as initEmbedded, c as _for_until, cn as runEffects, ct as toInsertNode, d as _show, dn as forOf, dt as _content_resume, en as $signalReset, et as _html, f as _try, fn as forTo, ft as createAndSetupBranch, g as renderCatch, gn as _call, gt as _resume, h as patchDynamicTag, hn as _hoist_read_error, ht as _el, i as _dynamic_tag_content, in as prepareEffects, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as runId, lt as _content, mn as _assert_hoist, mt as setupBranch, n as _await_promise, nt as _style_rule_item, o as _for_of, on as queueEffect, ot as _to_text, p as addAwaitCounter, pn as forUntil, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rt as _style_shell, s as _for_to, sn as run, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forIn, ut as _content_closures, v as _attr_details_or_dialog_open_default, vn as Owner, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yn as Params, yt as init, zt as _or } from "./dom-
|
|
1
|
+
import { $ as _attrs_script, $t as $signal, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dn as Global, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nn as StartNode, Nt as _hoist, O as _attr_input_value_default, On as Load, Ot as _const, P as _controllable_input, Pn as TagVariable, Pt as _hoist_resume, Q as _attrs_partial_content, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tn as EndNode, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, _ as _attr_details_or_dialog_open, _n as Clone, _t as _var_resume, a as _for_in, an as queueAsyncRender, at as _text_content, b as _attr_input_checked, bn as Setup, bt as initEmbedded, c as _for_until, cn as runEffects, ct as toInsertNode, d as _show, dn as forOf, dt as _content_resume, en as $signalReset, et as _html, f as _try, fn as forTo, ft as createAndSetupBranch, g as renderCatch, gn as _call, gt as _resume, h as patchDynamicTag, hn as _hoist_read_error, ht as _el, i as _dynamic_tag_content, in as prepareEffects, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as runId, lt as _content, mn as _assert_hoist, mt as setupBranch, n as _await_promise, nt as _style_rule_item, o as _for_of, on as queueEffect, ot as _to_text, p as addAwaitCounter, pn as forUntil, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rt as _style_shell, s as _for_to, sn as run, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forIn, ut as _content_closures, v as _attr_details_or_dialog_open_default, vn as Owner, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yn as Params, yt as init, zt as _or } from "./dom-DyBeisho.mjs";
|
|
2
2
|
//#region src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
package/dist/debug/html.js
CHANGED
|
@@ -2022,10 +2022,23 @@ function _el_resume(scopeId, accessor, shouldResume) {
|
|
|
2022
2022
|
if (shouldResume === 0) return "";
|
|
2023
2023
|
const { state } = $chunk.boundary;
|
|
2024
2024
|
state.needsMainRuntime = true;
|
|
2025
|
-
return state.mark("
|
|
2025
|
+
return state.mark("$", scopeId + " " + accessor);
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return
|
|
2027
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
2028
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
2029
|
+
}
|
|
2030
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
2031
|
+
const html = _unescaped(val);
|
|
2032
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
2033
|
+
const { state } = $chunk.boundary;
|
|
2034
|
+
state.needsMainRuntime = true;
|
|
2035
|
+
return state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
2036
|
+
}
|
|
2037
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
2038
|
+
if (shouldResume === 0) return text;
|
|
2039
|
+
const { state } = $chunk.boundary;
|
|
2040
|
+
state.needsMainRuntime = true;
|
|
2041
|
+
return text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
2029
2042
|
}
|
|
2030
2043
|
function _resume_branch(scopeId) {
|
|
2031
2044
|
const branchId = $chunk.context?.[kBranchId];
|
|
@@ -3111,7 +3124,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
|
|
|
3111
3124
|
writeScope(branchId, { [Renderer]: renderer });
|
|
3112
3125
|
_script(branchId, DYNAMIC_TAG_SCRIPT_REGISTER_ID);
|
|
3113
3126
|
}
|
|
3114
|
-
if (shouldResume || needsScript) _html(state.mark("
|
|
3127
|
+
if (shouldResume || needsScript) _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
3115
3128
|
};
|
|
3116
3129
|
renderNative();
|
|
3117
3130
|
result = _el(branchId, DYNAMIC_TAG_VAR_REGISTER_ID);
|
|
@@ -3696,6 +3709,7 @@ exports._for_until = _for_until;
|
|
|
3696
3709
|
exports._hoist = _hoist;
|
|
3697
3710
|
exports._hoist_read_error = _hoist_read_error;
|
|
3698
3711
|
exports._html = _html;
|
|
3712
|
+
exports._html_resume = _html_resume;
|
|
3699
3713
|
exports._id = _id;
|
|
3700
3714
|
exports._if = _if;
|
|
3701
3715
|
exports._peek_scope_id = _peek_scope_id;
|
|
@@ -3712,7 +3726,6 @@ exports._scope_id = _scope_id;
|
|
|
3712
3726
|
exports._scope_reason = _scope_reason;
|
|
3713
3727
|
exports._scope_with_id = _scope_with_id;
|
|
3714
3728
|
exports._script = _script;
|
|
3715
|
-
exports._sep = _sep;
|
|
3716
3729
|
exports._serialize_guard = _serialize_guard;
|
|
3717
3730
|
exports._serialize_if = _serialize_if;
|
|
3718
3731
|
exports._set_serialize_reason = _set_serialize_reason;
|
|
@@ -3721,6 +3734,7 @@ exports._show_start = _show_start;
|
|
|
3721
3734
|
exports._style_html = _style_html;
|
|
3722
3735
|
exports._subscribe = _subscribe;
|
|
3723
3736
|
exports._template = _template;
|
|
3737
|
+
exports._text_resume = _text_resume;
|
|
3724
3738
|
exports._textarea_value = _textarea_value;
|
|
3725
3739
|
exports._to_text = _to_text;
|
|
3726
3740
|
exports._trailers = _trailers;
|
package/dist/debug/html.mjs
CHANGED
|
@@ -2020,10 +2020,23 @@ function _el_resume(scopeId, accessor, shouldResume) {
|
|
|
2020
2020
|
if (shouldResume === 0) return "";
|
|
2021
2021
|
const { state } = $chunk.boundary;
|
|
2022
2022
|
state.needsMainRuntime = true;
|
|
2023
|
-
return state.mark("
|
|
2023
|
+
return state.mark("$", scopeId + " " + accessor);
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return
|
|
2025
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
2026
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
2027
|
+
}
|
|
2028
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
2029
|
+
const html = _unescaped(val);
|
|
2030
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
2031
|
+
const { state } = $chunk.boundary;
|
|
2032
|
+
state.needsMainRuntime = true;
|
|
2033
|
+
return state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
2034
|
+
}
|
|
2035
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
2036
|
+
if (shouldResume === 0) return text;
|
|
2037
|
+
const { state } = $chunk.boundary;
|
|
2038
|
+
state.needsMainRuntime = true;
|
|
2039
|
+
return text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
2027
2040
|
}
|
|
2028
2041
|
function _resume_branch(scopeId) {
|
|
2029
2042
|
const branchId = $chunk.context?.[kBranchId];
|
|
@@ -3109,7 +3122,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
|
|
|
3109
3122
|
writeScope(branchId, { [Renderer]: renderer });
|
|
3110
3123
|
_script(branchId, DYNAMIC_TAG_SCRIPT_REGISTER_ID);
|
|
3111
3124
|
}
|
|
3112
|
-
if (shouldResume || needsScript) _html(state.mark("
|
|
3125
|
+
if (shouldResume || needsScript) _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
3113
3126
|
};
|
|
3114
3127
|
renderNative();
|
|
3115
3128
|
result = _el(branchId, DYNAMIC_TAG_VAR_REGISTER_ID);
|
|
@@ -3646,4 +3659,4 @@ function drainClassFunctions($global, writeScope) {
|
|
|
3646
3659
|
}
|
|
3647
3660
|
function NOOP() {}
|
|
3648
3661
|
//#endregion
|
|
3649
|
-
export { $global, _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, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _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, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script,
|
|
3662
|
+
export { $global, _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, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _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_resume, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _style_html, _subscribe, _template, _text_resume, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
|
package/dist/dom/catch.feat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DprILxYO.js"), handlePendingTry = (fn, scope, branch) => {
|
|
2
2
|
for (; branch;) {
|
|
3
3
|
if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
|
|
4
4
|
branch = branch.N;
|
package/dist/dom/catch.feat.mjs
CHANGED
|
@@ -4,7 +4,7 @@ let handlePendingTry = (fn, scope, branch) => {
|
|
|
4
4
|
branch = branch.N;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
import { $t as caughtError, en as installCatch, g as renderCatch, tn as placeholderShown } from "../dom-
|
|
7
|
+
import { $t as caughtError, en as installCatch, g as renderCatch, tn as placeholderShown } from "../dom-BbknkVDz.mjs";
|
|
8
8
|
//#region src/dom/catch.feat.ts
|
|
9
9
|
installCatch((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
|
|
10
10
|
if (checkPending || caughtError.has(effects)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DprILxYO.js");
|
|
2
2
|
require_control_flow.z[0] = require_control_flow.T, require_control_flow.z[1] = require_control_flow.C, require_control_flow.z[2] = require_control_flow.A;
|
|
3
3
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
//#region src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
//#region src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
//#region src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DprILxYO.js");
|
|
2
2
|
require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.R.INPUT = require_control_flow.P, require_control_flow.R.TEXTAREA = require_control_flow.L, require_control_flow.R.SELECT = require_control_flow.I, require_control_flow.R.DETAILS = require_control_flow.R.DIALOG = require_control_flow.F;
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-
|
|
1
|
+
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
package/dist/dom/dom.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function _attrs_partial(scope: Scope, nodeAccessor: Accessor, nex
|
|
|
19
19
|
export declare function _attrs_partial_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1>, controllable?: ControllableAttrs): void;
|
|
20
20
|
export declare function _attr_content(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
|
|
21
21
|
export declare function _attrs_script(scope: Scope, nodeAccessor: Accessor): void;
|
|
22
|
-
export declare
|
|
22
|
+
export declare const _html: (scope: Scope, value: unknown, accessor: Accessor) => void;
|
|
23
23
|
export declare function normalizeAttrValue(value: unknown): string | undefined;
|
|
24
24
|
export declare function _lifecycle(scope: Scope, thisObj: Record<string, unknown> & {
|
|
25
25
|
onMount?: (this: unknown) => Record<string, unknown> | void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DprILxYO.js"), elementGetter = (branch) => () => branch.S;
|
|
2
2
|
require_control_flow.m((branch) => branch.T(elementGetter(branch))), require_control_flow.gt("_e", elementGetter);
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
let elementGetter = (branch) => () => branch.S;
|
|
2
|
-
import { gt as _resume, m as installDynamicTagVar } from "../dom-
|
|
2
|
+
import { gt as _resume, m as installDynamicTagVar } from "../dom-BbknkVDz.mjs";
|
|
3
3
|
installDynamicTagVar((branch) => branch.T(elementGetter(branch))), _resume("_e", elementGetter);
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as registeredValues, Kt as destroyBranch } from "../dom-
|
|
1
|
+
import { Ct as registeredValues, Kt as destroyBranch } from "../dom-BbknkVDz.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
registeredValues._f = (tryBranch) => {
|
|
4
4
|
tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
|
|
@@ -4,7 +4,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
4
4
|
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
5
5
|
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
6
6
|
return str;
|
|
7
|
-
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
|
|
7
|
+
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
|
|
8
8
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
9
9
|
}), runRender = (render) => {
|
|
10
10
|
(!branchesEnabled || render.b.F?.H !== 0) && render.c(render.b, render.d);
|
|
@@ -26,7 +26,10 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
26
26
|
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
27
27
|
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
28
28
|
walkNextSibling();
|
|
29
|
-
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {},
|
|
29
|
+
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
|
|
30
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
31
|
+
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
|
|
32
|
+
}), R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
30
33
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
31
34
|
let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
|
|
32
35
|
for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
|
|
@@ -163,6 +166,9 @@ function normalizeDynamicRenderer(value) {
|
|
|
163
166
|
function withBranches(runtime) {
|
|
164
167
|
return branchesEnabled = 1, runtime;
|
|
165
168
|
}
|
|
169
|
+
function withDynamicHtml(runtime) {
|
|
170
|
+
return dynamicHtmlEnabled = 1, runtime;
|
|
171
|
+
}
|
|
166
172
|
function _hoist_read_error() {}
|
|
167
173
|
function _assert_hoist(value) {}
|
|
168
174
|
//#endregion
|
|
@@ -541,7 +547,7 @@ function init(runtimeId = "M") {
|
|
|
541
547
|
for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + lastToken, singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
|
|
542
548
|
if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
|
|
543
549
|
for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
|
|
544
|
-
branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "
|
|
550
|
+
branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "(" && (branch.a = startVisit);
|
|
545
551
|
} else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, forEach(curBranchScopes, (scope) => scope._ ??= visitScope), curBranchScopes = branchScopesStack.pop()), startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.K = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
|
|
546
552
|
for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
|
|
547
553
|
for (; j && deferredOwners[j - 1].L > branchId;) {
|
|
@@ -570,7 +576,7 @@ function init(runtimeId = "M") {
|
|
|
570
576
|
}
|
|
571
577
|
}
|
|
572
578
|
return resumes.splice(0, i), i;
|
|
573
|
-
}, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, embedAnchor;
|
|
579
|
+
}, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, htmlStart, embedAnchor;
|
|
574
580
|
return serializeContext._ = registeredValues, render.m = (effects) => {
|
|
575
581
|
if (processResumes(render.r, effects), readyIds && render.b) for (let progress = 1; progress;) {
|
|
576
582
|
progress = 0;
|
|
@@ -580,10 +586,7 @@ function init(runtimeId = "M") {
|
|
|
580
586
|
}
|
|
581
587
|
}
|
|
582
588
|
let retained = 0;
|
|
583
|
-
for (visit of visits = render.v)
|
|
584
|
-
let prev = visit.previousSibling;
|
|
585
|
-
visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
|
|
586
|
-
} else branchesEnabled ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && (visits[retained++] = visit);
|
|
589
|
+
for (visit of visits = render.v) lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), dynamicHtmlEnabled && visitType > "%" && visitType <= "'" ? visitType === "&" ? htmlStart = visit : (visitScope[nextToken()] = htmlStart, visitScope["H" + lastToken] = visit) : branchesEnabled && visitType > "'" ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && visitType > "%" ? visits[retained++] = visit : visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
|
|
587
590
|
return embedRenders && !embedAnchor && visit && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]), visits.length = retained, effects;
|
|
588
591
|
}, render.w = () => {
|
|
589
592
|
walk(), runResumeEffects(render);
|
|
@@ -775,10 +778,6 @@ function _attrs_script(scope, nodeAccessor) {
|
|
|
775
778
|
controllableScripts[scope["F" + nodeAccessor]]?.(scope, nodeAccessor);
|
|
776
779
|
for (let name in events) _on(el, name, events[name]);
|
|
777
780
|
}
|
|
778
|
-
function _html(scope, value, accessor) {
|
|
779
|
-
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
780
|
-
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
|
|
781
|
-
}
|
|
782
781
|
function normalizeClientRender(value) {
|
|
783
782
|
let renderer = normalizeDynamicRenderer(value);
|
|
784
783
|
if (renderer && renderer.a) return renderer;
|
|
@@ -4,7 +4,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
4
4
|
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
5
5
|
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
6
6
|
return str;
|
|
7
|
-
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
|
|
7
|
+
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
|
|
8
8
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
9
9
|
}), runRender = (render) => {
|
|
10
10
|
(!branchesEnabled || render.b.F?.H !== 0) && render.c(render.b, render.d);
|
|
@@ -26,7 +26,10 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
26
26
|
if (currentNode.firstChild) return currentNode = currentNode.firstChild;
|
|
27
27
|
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
28
28
|
walkNextSibling();
|
|
29
|
-
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {},
|
|
29
|
+
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
|
|
30
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
31
|
+
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
|
|
32
|
+
}), R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
30
33
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
31
34
|
let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
|
|
32
35
|
for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
|
|
@@ -163,6 +166,9 @@ function normalizeDynamicRenderer(value) {
|
|
|
163
166
|
function withBranches(runtime) {
|
|
164
167
|
return branchesEnabled = 1, runtime;
|
|
165
168
|
}
|
|
169
|
+
function withDynamicHtml(runtime) {
|
|
170
|
+
return dynamicHtmlEnabled = 1, runtime;
|
|
171
|
+
}
|
|
166
172
|
function _hoist_read_error() {}
|
|
167
173
|
function _assert_hoist(value) {}
|
|
168
174
|
//#endregion
|
|
@@ -541,7 +547,7 @@ function init(runtimeId = "M") {
|
|
|
541
547
|
for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + lastToken, singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
|
|
542
548
|
if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
|
|
543
549
|
for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
|
|
544
|
-
branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "
|
|
550
|
+
branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "(" && (branch.a = startVisit);
|
|
545
551
|
} else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, forEach(curBranchScopes, (scope) => scope._ ??= visitScope), curBranchScopes = branchScopesStack.pop()), startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.K = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
|
|
546
552
|
for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
|
|
547
553
|
for (; j && deferredOwners[j - 1].L > branchId;) {
|
|
@@ -570,7 +576,7 @@ function init(runtimeId = "M") {
|
|
|
570
576
|
}
|
|
571
577
|
}
|
|
572
578
|
return resumes.splice(0, i), i;
|
|
573
|
-
}, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, embedAnchor;
|
|
579
|
+
}, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, htmlStart, embedAnchor;
|
|
574
580
|
return serializeContext._ = registeredValues, render.m = (effects) => {
|
|
575
581
|
if (processResumes(render.r, effects), readyIds && render.b) for (let progress = 1; progress;) {
|
|
576
582
|
progress = 0;
|
|
@@ -580,10 +586,7 @@ function init(runtimeId = "M") {
|
|
|
580
586
|
}
|
|
581
587
|
}
|
|
582
588
|
let retained = 0;
|
|
583
|
-
for (visit of visits = render.v)
|
|
584
|
-
let prev = visit.previousSibling;
|
|
585
|
-
visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
|
|
586
|
-
} else branchesEnabled ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && (visits[retained++] = visit);
|
|
589
|
+
for (visit of visits = render.v) lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), dynamicHtmlEnabled && visitType > "%" && visitType <= "'" ? visitType === "&" ? htmlStart = visit : (visitScope[nextToken()] = htmlStart, visitScope["H" + lastToken] = visit) : branchesEnabled && visitType > "'" ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && visitType > "%" ? visits[retained++] = visit : visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
|
|
587
590
|
return embedRenders && !embedAnchor && visit && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]), visits.length = retained, effects;
|
|
588
591
|
}, render.w = () => {
|
|
589
592
|
walk(), runResumeEffects(render);
|
|
@@ -775,10 +778,6 @@ function _attrs_script(scope, nodeAccessor) {
|
|
|
775
778
|
controllableScripts[scope["F" + nodeAccessor]]?.(scope, nodeAccessor);
|
|
776
779
|
for (let name in events) _on(el, name, events[name]);
|
|
777
780
|
}
|
|
778
|
-
function _html(scope, value, accessor) {
|
|
779
|
-
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
780
|
-
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
|
|
781
|
-
}
|
|
782
781
|
function normalizeClientRender(value) {
|
|
783
782
|
let renderer = normalizeDynamicRenderer(value);
|
|
784
783
|
if (renderer && renderer.a) return renderer;
|
package/dist/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
1
|
+
let require_control_flow = require("./dom-DprILxYO.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
2
2
|
require_control_flow.yt($global.runtimeId);
|
|
3
3
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
4
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
package/dist/dom.mjs
CHANGED
|
@@ -94,7 +94,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
94
94
|
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
|
|
95
95
|
};
|
|
96
96
|
});
|
|
97
|
-
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as run, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as forIn, ct as toInsertNode, d as _show, dn as forUntil, dt as _content_resume, et as _html, f as _try, fn as _assert_hoist, ft as createAndSetupBranch, g as renderCatch, gt as _resume, h as patchDynamicTag, hn as decodeAccessor, ht as _el, i as _dynamic_tag_content, in as queueEffect, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as forOf, lt as _content, mn as _call, mt as setupBranch, n as _await_promise, nn as prepareEffects, nt as _style_rule_item, o as _for_of, on as runEffects, ot as _to_text, p as addAwaitCounter, pn as _hoist_read_error, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rn as queueAsyncRender, rt as _style_shell, s as _for_to, sn as runId, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forTo, ut as _content_closures, v as _attr_details_or_dialog_open_default, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yt as init, zt as _or } from "./dom-
|
|
97
|
+
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as run, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as forIn, ct as toInsertNode, d as _show, dn as forUntil, dt as _content_resume, et as _html, f as _try, fn as _assert_hoist, ft as createAndSetupBranch, g as renderCatch, gt as _resume, h as patchDynamicTag, hn as decodeAccessor, ht as _el, i as _dynamic_tag_content, in as queueEffect, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as forOf, lt as _content, mn as _call, mt as setupBranch, n as _await_promise, nn as prepareEffects, nt as _style_rule_item, o as _for_of, on as runEffects, ot as _to_text, p as addAwaitCounter, pn as _hoist_read_error, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rn as queueAsyncRender, rt as _style_shell, s as _for_to, sn as runId, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forTo, ut as _content_closures, v as _attr_details_or_dialog_open_default, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yt as init, zt as _or } from "./dom-BbknkVDz.mjs";
|
|
98
98
|
//#region src/common/attr-tag.ts
|
|
99
99
|
function attrTag(attrs) {
|
|
100
100
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -47,7 +47,8 @@ export declare function _hoist(scopeId: number, id: string): {
|
|
|
47
47
|
[Symbol.iterator]: typeof _hoist_read_error;
|
|
48
48
|
};
|
|
49
49
|
export declare function _el_resume(scopeId: number, accessor: Accessor, shouldResume?: number): string;
|
|
50
|
-
export declare function
|
|
50
|
+
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
51
|
+
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
51
52
|
export declare function _resume_branch(scopeId: number): void;
|
|
52
53
|
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, serializeReason?: number): void;
|
|
53
54
|
export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export { _escape, _escape_comment, _escape_script, _escape_style, _escape_style_
|
|
|
7
7
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
8
|
export { forIn, forOf, forTo, forUntil } from "./html/for";
|
|
9
9
|
export { _template } from "./html/template";
|
|
10
|
-
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _scope_with_id, _script,
|
|
10
|
+
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _text_resume, _subscribe, _trailers, _try, _var, $global, } from "./html/writer";
|
package/dist/html.js
CHANGED
|
@@ -262,7 +262,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
|
-
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("
|
|
265
|
+
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
266
266
|
})(), result = _el(branchId, "_e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
@@ -1349,10 +1349,21 @@ function _hoist(scopeId, id) {
|
|
|
1349
1349
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1350
1350
|
if (shouldResume === 0) return "";
|
|
1351
1351
|
let { state } = $chunk.boundary;
|
|
1352
|
-
return state.needsMainRuntime = !0, state.mark("
|
|
1352
|
+
return state.needsMainRuntime = !0, state.mark("$", scopeId + " " + accessor);
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return
|
|
1354
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
1355
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
1356
|
+
}
|
|
1357
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
1358
|
+
let html = _unescaped(val);
|
|
1359
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
1360
|
+
let { state } = $chunk.boundary;
|
|
1361
|
+
return state.needsMainRuntime = !0, state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
1362
|
+
}
|
|
1363
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
1364
|
+
if (shouldResume === 0) return text;
|
|
1365
|
+
let { state } = $chunk.boundary;
|
|
1366
|
+
return state.needsMainRuntime = !0, text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
1356
1367
|
}
|
|
1357
1368
|
function _resume_branch(scopeId) {
|
|
1358
1369
|
let branchId = $chunk.context?.[kBranchId];
|
|
@@ -2260,4 +2271,4 @@ exports.$global = $global, exports._assert_hoist = _assert_hoist, exports._attr
|
|
|
2260
2271
|
get: function() {
|
|
2261
2272
|
return _dynamic_tag;
|
|
2262
2273
|
}
|
|
2263
|
-
}), 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._escape_style_value = _escape_style_value, 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._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports.
|
|
2274
|
+
}), 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._escape_style_value = _escape_style_value, 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._html_resume = _html_resume, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._serialize_guard = _serialize_guard, exports._serialize_if = _serialize_if, exports._set_serialize_reason = _set_serialize_reason, exports._show_end = _show_end, exports._show_start = _show_start, exports._style_html = _style_html, exports._subscribe = _subscribe, exports._template = _template, exports._text_resume = _text_resume, exports._textarea_value = _textarea_value, 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.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;
|
package/dist/html.mjs
CHANGED
|
@@ -262,7 +262,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
|
-
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("
|
|
265
|
+
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
266
266
|
})(), result = _el(branchId, "_e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
@@ -1348,10 +1348,21 @@ function _hoist(scopeId, id) {
|
|
|
1348
1348
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1349
1349
|
if (shouldResume === 0) return "";
|
|
1350
1350
|
let { state } = $chunk.boundary;
|
|
1351
|
-
return state.needsMainRuntime = !0, state.mark("
|
|
1351
|
+
return state.needsMainRuntime = !0, state.mark("$", scopeId + " " + accessor);
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1353
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
1354
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
1355
|
+
}
|
|
1356
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
1357
|
+
let html = _unescaped(val);
|
|
1358
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
1359
|
+
let { state } = $chunk.boundary;
|
|
1360
|
+
return state.needsMainRuntime = !0, state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
1361
|
+
}
|
|
1362
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
1363
|
+
if (shouldResume === 0) return text;
|
|
1364
|
+
let { state } = $chunk.boundary;
|
|
1365
|
+
return state.needsMainRuntime = !0, text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
1355
1366
|
}
|
|
1356
1367
|
function _resume_branch(scopeId) {
|
|
1357
1368
|
let branchId = $chunk.context?.[kBranchId];
|
|
@@ -2255,4 +2266,4 @@ function drainClassFunctions($global, writeScope) {
|
|
|
2255
2266
|
}
|
|
2256
2267
|
function NOOP() {}
|
|
2257
2268
|
//#endregion
|
|
2258
|
-
export { $global, _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, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _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, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script,
|
|
2269
|
+
export { $global, _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, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _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_resume, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _style_html, _subscribe, _template, _text_resume, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
|
package/dist/translator/index.js
CHANGED
|
@@ -9015,7 +9015,10 @@ function assertHasBody(tag) {
|
|
|
9015
9015
|
function assertHasValueAttribute(tag) {
|
|
9016
9016
|
const { node } = tag;
|
|
9017
9017
|
const [valueAttr] = node.attributes;
|
|
9018
|
-
if (!_marko_compiler.types.isMarkoAttribute(valueAttr) || !(valueAttr.default || valueAttr.name === "value"))
|
|
9018
|
+
if (!_marko_compiler.types.isMarkoAttribute(valueAttr) || !(valueAttr.default || valueAttr.name === "value")) {
|
|
9019
|
+
const wrongName = _marko_compiler.types.isMarkoAttribute(valueAttr) && valueAttr.name;
|
|
9020
|
+
throw (wrongName ? tag.get("attributes")[0] : tag.get("name")).buildCodeFrameError(`The [\`<${getTagName(tag)}>\` tag](https://markojs.com/docs/reference/core-tag#show) requires the [\`value=\` attribute](https://markojs.com/docs/reference/language#shorthand-value).${wrongName ? ` Use \`<${getTagName(tag)}=condition>\` instead of \`<${getTagName(tag)} ${wrongName}=condition>\`.` : ""}`);
|
|
9021
|
+
}
|
|
9019
9022
|
if (node.attributes.length > 1) throw tag.get("name").buildCodeFrameError(`The [\`<${getTagName(tag)}>\` tag](https://markojs.com/docs/reference/core-tag#show) only supports the [\`value=\` attribute](https://markojs.com/docs/reference/language#shorthand-value).`);
|
|
9020
9023
|
}
|
|
9021
9024
|
//#endregion
|
|
@@ -9714,14 +9717,11 @@ function translateExit(placeholder) {
|
|
|
9714
9717
|
const section = getSection(placeholder);
|
|
9715
9718
|
const siblingText = extra[kSiblingText];
|
|
9716
9719
|
const markerSerializeReason = nodeBinding && getSerializeReason(section, nodeBinding);
|
|
9717
|
-
if (isHTML
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
}
|
|
9721
|
-
|
|
9722
|
-
write`${method === "_escape" ? buildEscapedTextExpression(value) : callRuntime(method, value)}`;
|
|
9723
|
-
if (nodeBinding) markNode(placeholder, nodeBinding, markerSerializeReason);
|
|
9724
|
-
} else addStatement("render", section, valueExtra.referencedBindings, _marko_compiler.types.expressionStatement(method === "_text" ? callRuntime("_text", createScopeReadExpression(nodeBinding), value) : callRuntime("_html", scopeIdentifier, value, getScopeAccessorLiteral(nodeBinding))), true);
|
|
9720
|
+
if (isHTML) if (markerSerializeReason) {
|
|
9721
|
+
const guard = getSerializeGuard(section, markerSerializeReason, true);
|
|
9722
|
+
write`${callRuntime(node.escape ? "_text_resume" : "_html_resume", getScopeIdIdentifier(section), getScopeAccessorLiteral(nodeBinding), value, siblingText === 1 ? guard ? _marko_compiler.types.binaryExpression("*", guard, _marko_compiler.types.numericLiteral(2)) : _marko_compiler.types.numericLiteral(2) : guard)}`;
|
|
9723
|
+
} else write`${method === "_escape" ? buildEscapedTextExpression(value) : callRuntime(method, value)}`;
|
|
9724
|
+
else addStatement("render", section, valueExtra.referencedBindings, _marko_compiler.types.expressionStatement(method === "_text" ? callRuntime("_text", createScopeReadExpression(nodeBinding), value) : callRuntime("_html", scopeIdentifier, value, getScopeAccessorLiteral(nodeBinding))), true);
|
|
9725
9725
|
}
|
|
9726
9726
|
placeholder.remove();
|
|
9727
9727
|
}
|
|
@@ -9745,13 +9745,8 @@ function buildEscapedTextExpression(value) {
|
|
|
9745
9745
|
default: return callRuntime("_escape", value);
|
|
9746
9746
|
}
|
|
9747
9747
|
}
|
|
9748
|
-
function writeSeparator(write, section, reason) {
|
|
9749
|
-
if (reason === true || reason.state) write`<!>`;
|
|
9750
|
-
else write`${callRuntime("_sep", getSerializeGuard(section, reason, true))}`;
|
|
9751
|
-
}
|
|
9752
9748
|
function analyzeSiblingText(placeholder) {
|
|
9753
9749
|
const placeholderExtra = placeholder.node.extra;
|
|
9754
|
-
let hasNodeBefore = false;
|
|
9755
9750
|
let prev = placeholder.getPrevSibling();
|
|
9756
9751
|
let prevParent = placeholder.parentPath;
|
|
9757
9752
|
for (;;) {
|
|
@@ -9767,10 +9762,7 @@ function analyzeSiblingText(placeholder) {
|
|
|
9767
9762
|
const contentType = getNodeContentType(prev, "endType");
|
|
9768
9763
|
if (contentType === null) prev = prev.getPrevSibling();
|
|
9769
9764
|
else if (contentType === 4 || contentType === 1 || contentType === 2) return placeholderExtra[kSiblingText] = 1;
|
|
9770
|
-
else
|
|
9771
|
-
hasNodeBefore = true;
|
|
9772
|
-
break;
|
|
9773
|
-
}
|
|
9765
|
+
else break;
|
|
9774
9766
|
}
|
|
9775
9767
|
if (!prev.node && prevParent.isProgram()) return placeholderExtra[kSiblingText] = 1;
|
|
9776
9768
|
let next = placeholder.getNextSibling();
|
|
@@ -9791,7 +9783,7 @@ function analyzeSiblingText(placeholder) {
|
|
|
9791
9783
|
else break;
|
|
9792
9784
|
}
|
|
9793
9785
|
if (!next.node && nextParent.isProgram()) return placeholderExtra[kSiblingText] = 2;
|
|
9794
|
-
return placeholderExtra[kSiblingText] =
|
|
9786
|
+
return placeholderExtra[kSiblingText] = 0;
|
|
9795
9787
|
}
|
|
9796
9788
|
function getInlinedBodyTag(parent) {
|
|
9797
9789
|
if (parent.isMarkoTagBody()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.47",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"marko": "
|
|
61
|
-
"
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.3.47",
|
|
61
|
+
"marko": "5.39.38"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|