marko 6.0.6 → 6.0.8
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/debug/dom.js +1 -5
- package/dist/debug/dom.mjs +1 -5
- package/dist/debug/html.js +46 -37
- package/dist/debug/html.mjs +46 -37
- package/dist/dom/dom.d.ts +0 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +1 -5
- package/dist/dom.mjs +1 -5
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +39 -32
- package/dist/html.mjs +39 -32
- package/dist/translator/index.js +18 -72
- package/package.json +1 -1
- package/dist/translator/util/css-px-props.d.ts +0 -2
package/dist/debug/dom.js
CHANGED
@@ -82,7 +82,6 @@ __export(dom_exports, {
|
|
82
82
|
state: () => state,
|
83
83
|
styleAttr: () => styleAttr,
|
84
84
|
styleItem: () => styleItem,
|
85
|
-
styleItemValue: () => styleItemValue,
|
86
85
|
styleItems: () => styleItems,
|
87
86
|
tagVarSignal: () => tagVarSignal,
|
88
87
|
tagVarSignalChange: () => tagVarSignalChange,
|
@@ -148,7 +147,7 @@ function styleValue(styleValue2) {
|
|
148
147
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
149
148
|
}
|
150
149
|
function stringifyStyleObject(name, value2) {
|
151
|
-
return value2 || value2 === 0 ?
|
150
|
+
return value2 || value2 === 0 ? name + ":" + value2 : "";
|
152
151
|
}
|
153
152
|
function toDelimitedString(val, delimiter, stringify) {
|
154
153
|
let str = "";
|
@@ -753,9 +752,6 @@ function styleItems(element, items) {
|
|
753
752
|
function styleItem(element, name, value2) {
|
754
753
|
element.style.setProperty(name, value2 || value2 === 0 ? value2 + "" : "");
|
755
754
|
}
|
756
|
-
function styleItemValue(value2) {
|
757
|
-
return value2 && typeof value2 === "number" ? value2 + "px" : value2;
|
758
|
-
}
|
759
755
|
function data(node, value2) {
|
760
756
|
const normalizedValue = normalizeString(value2);
|
761
757
|
if (node.data !== normalizedValue) {
|
package/dist/debug/dom.mjs
CHANGED
@@ -55,7 +55,7 @@ function styleValue(styleValue2) {
|
|
55
55
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
56
56
|
}
|
57
57
|
function stringifyStyleObject(name, value2) {
|
58
|
-
return value2 || value2 === 0 ?
|
58
|
+
return value2 || value2 === 0 ? name + ":" + value2 : "";
|
59
59
|
}
|
60
60
|
function toDelimitedString(val, delimiter, stringify) {
|
61
61
|
let str = "";
|
@@ -660,9 +660,6 @@ function styleItems(element, items) {
|
|
660
660
|
function styleItem(element, name, value2) {
|
661
661
|
element.style.setProperty(name, value2 || value2 === 0 ? value2 + "" : "");
|
662
662
|
}
|
663
|
-
function styleItemValue(value2) {
|
664
|
-
return value2 && typeof value2 === "number" ? value2 + "px" : value2;
|
665
|
-
}
|
666
663
|
function data(node, value2) {
|
667
664
|
const normalizedValue = normalizeString(value2);
|
668
665
|
if (node.data !== normalizedValue) {
|
@@ -2278,7 +2275,6 @@ export {
|
|
2278
2275
|
state,
|
2279
2276
|
styleAttr,
|
2280
2277
|
styleItem,
|
2281
|
-
styleItemValue,
|
2282
2278
|
styleItems,
|
2283
2279
|
tagVarSignal,
|
2284
2280
|
tagVarSignalChange,
|
package/dist/debug/html.js
CHANGED
@@ -118,7 +118,7 @@ function styleValue(styleValue2) {
|
|
118
118
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
119
119
|
}
|
120
120
|
function stringifyStyleObject(name, value) {
|
121
|
-
return value || value === 0 ?
|
121
|
+
return value || value === 0 ? name + ":" + value : "";
|
122
122
|
}
|
123
123
|
function toDelimitedString(val, delimiter, stringify) {
|
124
124
|
let str = "";
|
@@ -2088,22 +2088,27 @@ function ensureScopeWithId(scopeId) {
|
|
2088
2088
|
function $global() {
|
2089
2089
|
return $chunk.boundary.state.$global;
|
2090
2090
|
}
|
2091
|
-
function fork(scopeId, accessor, promise, content) {
|
2091
|
+
function fork(scopeId, accessor, promise, content, serializeMarker) {
|
2092
|
+
const resumeMarker = serializeMarker !== 0;
|
2092
2093
|
if (!isPromise(promise)) {
|
2093
|
-
|
2094
|
-
|
2095
|
-
$chunk.
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
$chunk.
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2094
|
+
if (resumeMarker) {
|
2095
|
+
const branchId = peekNextScopeId();
|
2096
|
+
$chunk.writeHTML(
|
2097
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
2098
|
+
);
|
2099
|
+
content(promise);
|
2100
|
+
writeScope(scopeId, {
|
2101
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
2102
|
+
});
|
2103
|
+
$chunk.writeHTML(
|
2104
|
+
$chunk.boundary.state.mark(
|
2105
|
+
"]" /* BranchEnd */,
|
2106
|
+
scopeId + " " + accessor
|
2107
|
+
)
|
2108
|
+
);
|
2109
|
+
} else {
|
2110
|
+
content(promise);
|
2111
|
+
}
|
2107
2112
|
return;
|
2108
2113
|
}
|
2109
2114
|
const chunk = $chunk;
|
@@ -2120,25 +2125,29 @@ function fork(scopeId, accessor, promise, content) {
|
|
2120
2125
|
chunk.async = false;
|
2121
2126
|
if (!boundary.signal.aborted) {
|
2122
2127
|
chunk.render(() => {
|
2123
|
-
|
2124
|
-
|
2125
|
-
$chunk.
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
$chunk.
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2128
|
+
if (resumeMarker) {
|
2129
|
+
const branchId = peekNextScopeId();
|
2130
|
+
$chunk.writeHTML(
|
2131
|
+
$chunk.boundary.state.mark(
|
2132
|
+
"[" /* BranchStart */,
|
2133
|
+
branchId + ""
|
2134
|
+
)
|
2135
|
+
);
|
2136
|
+
content(value);
|
2137
|
+
boundary.state.serializer.writeAssign(
|
2138
|
+
writeScope(branchId, {}),
|
2139
|
+
ensureScopeWithId(scopeId),
|
2140
|
+
"ConditionalScope:" /* ConditionalScope */ + accessor
|
2141
|
+
);
|
2142
|
+
$chunk.writeHTML(
|
2143
|
+
$chunk.boundary.state.mark(
|
2144
|
+
"]" /* BranchEnd */,
|
2145
|
+
scopeId + " " + accessor
|
2146
|
+
)
|
2147
|
+
);
|
2148
|
+
} else {
|
2149
|
+
content(value);
|
2150
|
+
}
|
2142
2151
|
});
|
2143
2152
|
boundary.endAsync(chunk);
|
2144
2153
|
}
|
@@ -2376,12 +2385,12 @@ var Chunk = class {
|
|
2376
2385
|
if (this.lastEffect === registryId) {
|
2377
2386
|
this.effects += "," + scopeId;
|
2378
2387
|
} else {
|
2388
|
+
this.lastEffect = registryId;
|
2379
2389
|
this.effects = concatEffects(
|
2380
2390
|
this.effects,
|
2381
2391
|
'"' + registryId + '",' + scopeId
|
2382
2392
|
);
|
2383
2393
|
}
|
2384
|
-
this.lastEffect = registryId;
|
2385
2394
|
}
|
2386
2395
|
writeScript(script) {
|
2387
2396
|
this.scripts = concatScripts(this.scripts, script);
|
@@ -2545,9 +2554,9 @@ var Chunk = class {
|
|
2545
2554
|
if (hasWalk) {
|
2546
2555
|
scripts = concatScripts(scripts, runtimePrefix + ".w()");
|
2547
2556
|
}
|
2548
|
-
this.effects = state.resumes = "";
|
2549
2557
|
this.html = html;
|
2550
2558
|
this.scripts = scripts;
|
2559
|
+
this.effects = this.lastEffect = state.resumes = "";
|
2551
2560
|
return this;
|
2552
2561
|
}
|
2553
2562
|
flushHTML() {
|
package/dist/debug/html.mjs
CHANGED
@@ -33,7 +33,7 @@ function styleValue(styleValue2) {
|
|
33
33
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
34
34
|
}
|
35
35
|
function stringifyStyleObject(name, value) {
|
36
|
-
return value || value === 0 ?
|
36
|
+
return value || value === 0 ? name + ":" + value : "";
|
37
37
|
}
|
38
38
|
function toDelimitedString(val, delimiter, stringify) {
|
39
39
|
let str = "";
|
@@ -2003,22 +2003,27 @@ function ensureScopeWithId(scopeId) {
|
|
2003
2003
|
function $global() {
|
2004
2004
|
return $chunk.boundary.state.$global;
|
2005
2005
|
}
|
2006
|
-
function fork(scopeId, accessor, promise, content) {
|
2006
|
+
function fork(scopeId, accessor, promise, content, serializeMarker) {
|
2007
|
+
const resumeMarker = serializeMarker !== 0;
|
2007
2008
|
if (!isPromise(promise)) {
|
2008
|
-
|
2009
|
-
|
2010
|
-
$chunk.
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
$chunk.
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2009
|
+
if (resumeMarker) {
|
2010
|
+
const branchId = peekNextScopeId();
|
2011
|
+
$chunk.writeHTML(
|
2012
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
2013
|
+
);
|
2014
|
+
content(promise);
|
2015
|
+
writeScope(scopeId, {
|
2016
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
2017
|
+
});
|
2018
|
+
$chunk.writeHTML(
|
2019
|
+
$chunk.boundary.state.mark(
|
2020
|
+
"]" /* BranchEnd */,
|
2021
|
+
scopeId + " " + accessor
|
2022
|
+
)
|
2023
|
+
);
|
2024
|
+
} else {
|
2025
|
+
content(promise);
|
2026
|
+
}
|
2022
2027
|
return;
|
2023
2028
|
}
|
2024
2029
|
const chunk = $chunk;
|
@@ -2035,25 +2040,29 @@ function fork(scopeId, accessor, promise, content) {
|
|
2035
2040
|
chunk.async = false;
|
2036
2041
|
if (!boundary.signal.aborted) {
|
2037
2042
|
chunk.render(() => {
|
2038
|
-
|
2039
|
-
|
2040
|
-
$chunk.
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
$chunk.
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2043
|
+
if (resumeMarker) {
|
2044
|
+
const branchId = peekNextScopeId();
|
2045
|
+
$chunk.writeHTML(
|
2046
|
+
$chunk.boundary.state.mark(
|
2047
|
+
"[" /* BranchStart */,
|
2048
|
+
branchId + ""
|
2049
|
+
)
|
2050
|
+
);
|
2051
|
+
content(value);
|
2052
|
+
boundary.state.serializer.writeAssign(
|
2053
|
+
writeScope(branchId, {}),
|
2054
|
+
ensureScopeWithId(scopeId),
|
2055
|
+
"ConditionalScope:" /* ConditionalScope */ + accessor
|
2056
|
+
);
|
2057
|
+
$chunk.writeHTML(
|
2058
|
+
$chunk.boundary.state.mark(
|
2059
|
+
"]" /* BranchEnd */,
|
2060
|
+
scopeId + " " + accessor
|
2061
|
+
)
|
2062
|
+
);
|
2063
|
+
} else {
|
2064
|
+
content(value);
|
2065
|
+
}
|
2057
2066
|
});
|
2058
2067
|
boundary.endAsync(chunk);
|
2059
2068
|
}
|
@@ -2291,12 +2300,12 @@ var Chunk = class {
|
|
2291
2300
|
if (this.lastEffect === registryId) {
|
2292
2301
|
this.effects += "," + scopeId;
|
2293
2302
|
} else {
|
2303
|
+
this.lastEffect = registryId;
|
2294
2304
|
this.effects = concatEffects(
|
2295
2305
|
this.effects,
|
2296
2306
|
'"' + registryId + '",' + scopeId
|
2297
2307
|
);
|
2298
2308
|
}
|
2299
|
-
this.lastEffect = registryId;
|
2300
2309
|
}
|
2301
2310
|
writeScript(script) {
|
2302
2311
|
this.scripts = concatScripts(this.scripts, script);
|
@@ -2460,9 +2469,9 @@ var Chunk = class {
|
|
2460
2469
|
if (hasWalk) {
|
2461
2470
|
scripts = concatScripts(scripts, runtimePrefix + ".w()");
|
2462
2471
|
}
|
2463
|
-
this.effects = state.resumes = "";
|
2464
2472
|
this.html = html;
|
2465
2473
|
this.scripts = scripts;
|
2474
|
+
this.effects = this.lastEffect = state.resumes = "";
|
2466
2475
|
return this;
|
2467
2476
|
}
|
2468
2477
|
flushHTML() {
|
package/dist/dom/dom.d.ts
CHANGED
@@ -7,7 +7,6 @@ export declare function classItem(element: Element, name: string, value: unknown
|
|
7
7
|
export declare function styleAttr(element: Element, value: unknown): void;
|
8
8
|
export declare function styleItems(element: HTMLElement, items: Record<string, unknown>): void;
|
9
9
|
export declare function styleItem(element: HTMLElement, name: string, value: unknown): void;
|
10
|
-
export declare function styleItemValue(value: unknown): unknown;
|
11
10
|
export declare function data(node: Text | Comment, value: unknown): void;
|
12
11
|
export declare function textContent(node: ParentNode, value: unknown): void;
|
13
12
|
export declare function attrs(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>): void;
|
package/dist/dom.d.ts
CHANGED
@@ -4,7 +4,7 @@ export { getAbortSignal, resetAbortSignal } from "./dom/abort-signal";
|
|
4
4
|
export { compat } from "./dom/compat";
|
5
5
|
export { awaitTag, conditional, createTry, dynamicTag, loopIn, loopOf, loopTo, } from "./dom/control-flow";
|
6
6
|
export { controllable_detailsOrDialog_open, controllable_detailsOrDialog_open_effect, controllable_input_checked, controllable_input_checked_effect, controllable_input_checkedValue, controllable_input_checkedValue_effect, controllable_input_value, controllable_input_value_effect, controllable_select_value, controllable_select_value_effect, controllable_textarea_value, controllable_textarea_value_effect, } from "./dom/controllable";
|
7
|
-
export { attr, attrs, attrsEvents, classAttr, classItem, classItems, data, html, lifecycle, partialAttrs, props, styleAttr, styleItem, styleItems,
|
7
|
+
export { attr, attrs, attrsEvents, classAttr, classItem, classItems, data, html, lifecycle, partialAttrs, props, styleAttr, styleItem, styleItems, textContent, } from "./dom/dom";
|
8
8
|
export { on } from "./dom/event";
|
9
9
|
export { enableCatch, run } from "./dom/queue";
|
10
10
|
export { createContent, createRenderer, registerContent } from "./dom/renderer";
|
package/dist/dom.js
CHANGED
@@ -79,7 +79,6 @@ __export(dom_exports, {
|
|
79
79
|
state: () => state,
|
80
80
|
styleAttr: () => styleAttr,
|
81
81
|
styleItem: () => styleItem,
|
82
|
-
styleItemValue: () => styleItemValue,
|
83
82
|
styleItems: () => styleItems,
|
84
83
|
tagVarSignal: () => tagVarSignal,
|
85
84
|
tagVarSignalChange: () => tagVarSignalChange,
|
@@ -129,7 +128,7 @@ function styleValue(styleValue2) {
|
|
129
128
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
130
129
|
}
|
131
130
|
function stringifyStyleObject(name, value2) {
|
132
|
-
return value2 || value2 === 0 ?
|
131
|
+
return value2 || value2 === 0 ? name + ":" + value2 : "";
|
133
132
|
}
|
134
133
|
function toDelimitedString(val, delimiter, stringify) {
|
135
134
|
let str = "", sep = "", part;
|
@@ -528,9 +527,6 @@ function styleItems(element, items) {
|
|
528
527
|
function styleItem(element, name, value2) {
|
529
528
|
element.style.setProperty(name, value2 || value2 === 0 ? value2 + "" : "");
|
530
529
|
}
|
531
|
-
function styleItemValue(value2) {
|
532
|
-
return value2 && typeof value2 == "number" ? value2 + "px" : value2;
|
533
|
-
}
|
534
530
|
function data(node, value2) {
|
535
531
|
let normalizedValue = normalizeString(value2);
|
536
532
|
node.data !== normalizedValue && (node.data = normalizedValue);
|
package/dist/dom.mjs
CHANGED
@@ -39,7 +39,7 @@ function styleValue(styleValue2) {
|
|
39
39
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
40
40
|
}
|
41
41
|
function stringifyStyleObject(name, value2) {
|
42
|
-
return value2 || value2 === 0 ?
|
42
|
+
return value2 || value2 === 0 ? name + ":" + value2 : "";
|
43
43
|
}
|
44
44
|
function toDelimitedString(val, delimiter, stringify) {
|
45
45
|
let str = "", sep = "", part;
|
@@ -438,9 +438,6 @@ function styleItems(element, items) {
|
|
438
438
|
function styleItem(element, name, value2) {
|
439
439
|
element.style.setProperty(name, value2 || value2 === 0 ? value2 + "" : "");
|
440
440
|
}
|
441
|
-
function styleItemValue(value2) {
|
442
|
-
return value2 && typeof value2 == "number" ? value2 + "px" : value2;
|
443
|
-
}
|
444
441
|
function data(node, value2) {
|
445
442
|
let normalizedValue = normalizeString(value2);
|
446
443
|
node.data !== normalizedValue && (node.data = normalizedValue);
|
@@ -1511,7 +1508,6 @@ export {
|
|
1511
1508
|
state,
|
1512
1509
|
styleAttr,
|
1513
1510
|
styleItem,
|
1514
|
-
styleItemValue,
|
1515
1511
|
styleItems,
|
1516
1512
|
tagVarSignal,
|
1517
1513
|
tagVarSignalChange,
|
package/dist/html/writer.d.ts
CHANGED
@@ -51,7 +51,7 @@ export declare function $global(): $Global & {
|
|
51
51
|
renderId: string;
|
52
52
|
runtimeId: string;
|
53
53
|
};
|
54
|
-
export declare function fork<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void): void;
|
54
|
+
export declare function fork<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void, serializeMarker?: 0 | 1): void;
|
55
55
|
export declare function tryContent(scopeId: number, accessor: Accessor, content: () => void, input: {
|
56
56
|
placeholder?: {
|
57
57
|
content?(): void;
|
package/dist/html.js
CHANGED
@@ -103,7 +103,7 @@ function styleValue(styleValue2) {
|
|
103
103
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
104
104
|
}
|
105
105
|
function stringifyStyleObject(name, value) {
|
106
|
-
return value || value === 0 ?
|
106
|
+
return value || value === 0 ? name + ":" + value : "";
|
107
107
|
}
|
108
108
|
function toDelimitedString(val, delimiter, stringify) {
|
109
109
|
let str = "", sep = "", part;
|
@@ -1349,41 +1349,48 @@ function ensureScopeWithId(scopeId) {
|
|
1349
1349
|
function $global() {
|
1350
1350
|
return $chunk.boundary.state.$global;
|
1351
1351
|
}
|
1352
|
-
function fork(scopeId, accessor, promise, content) {
|
1352
|
+
function fork(scopeId, accessor, promise, content, serializeMarker) {
|
1353
|
+
let resumeMarker = serializeMarker !== 0;
|
1353
1354
|
if (!isPromise(promise)) {
|
1354
|
-
|
1355
|
-
|
1356
|
-
$chunk.
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
$chunk.
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1355
|
+
if (resumeMarker) {
|
1356
|
+
let branchId = peekNextScopeId();
|
1357
|
+
$chunk.writeHTML(
|
1358
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1359
|
+
), content(promise), writeScope(scopeId, {
|
1360
|
+
["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1361
|
+
}), $chunk.writeHTML(
|
1362
|
+
$chunk.boundary.state.mark(
|
1363
|
+
"]" /* BranchEnd */,
|
1364
|
+
scopeId + " " + accessor
|
1365
|
+
)
|
1366
|
+
);
|
1367
|
+
} else
|
1368
|
+
content(promise);
|
1365
1369
|
return;
|
1366
1370
|
}
|
1367
1371
|
let chunk = $chunk, { boundary } = chunk;
|
1368
1372
|
chunk.next = $chunk = new Chunk(boundary, chunk.next, chunk.context), chunk.async = !0, chunk.context?.[kPendingContexts] && (chunk.context = { ...chunk.context, [kPendingContexts]: 0 }), boundary.startAsync(), promise.then(
|
1369
1373
|
(value) => {
|
1370
1374
|
chunk.async && (chunk.async = !1, boundary.signal.aborted || (chunk.render(() => {
|
1371
|
-
|
1372
|
-
|
1373
|
-
$chunk.
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
$chunk.
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1375
|
+
if (resumeMarker) {
|
1376
|
+
let branchId = peekNextScopeId();
|
1377
|
+
$chunk.writeHTML(
|
1378
|
+
$chunk.boundary.state.mark(
|
1379
|
+
"[" /* BranchStart */,
|
1380
|
+
branchId + ""
|
1381
|
+
)
|
1382
|
+
), content(value), boundary.state.serializer.writeAssign(
|
1383
|
+
writeScope(branchId, {}),
|
1384
|
+
ensureScopeWithId(scopeId),
|
1385
|
+
"d" /* ConditionalScope */ + accessor
|
1386
|
+
), $chunk.writeHTML(
|
1387
|
+
$chunk.boundary.state.mark(
|
1388
|
+
"]" /* BranchEnd */,
|
1389
|
+
scopeId + " " + accessor
|
1390
|
+
)
|
1391
|
+
);
|
1392
|
+
} else
|
1393
|
+
content(value);
|
1387
1394
|
}), boundary.endAsync(chunk)));
|
1388
1395
|
},
|
1389
1396
|
(err) => {
|
@@ -1530,10 +1537,10 @@ var State2 = class {
|
|
1530
1537
|
this.html += html;
|
1531
1538
|
}
|
1532
1539
|
writeEffect(scopeId, registryId) {
|
1533
|
-
this.lastEffect === registryId ? this.effects += "," + scopeId : this.effects = concatEffects(
|
1540
|
+
this.lastEffect === registryId ? this.effects += "," + scopeId : (this.lastEffect = registryId, this.effects = concatEffects(
|
1534
1541
|
this.effects,
|
1535
1542
|
'"' + registryId + '",' + scopeId
|
1536
|
-
)
|
1543
|
+
));
|
1537
1544
|
}
|
1538
1545
|
writeScript(script) {
|
1539
1546
|
this.scripts = concatScripts(this.scripts, script);
|
@@ -1621,7 +1628,7 @@ var State2 = class {
|
|
1621
1628
|
}
|
1622
1629
|
state.writeReorders = null;
|
1623
1630
|
}
|
1624
|
-
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), this.
|
1631
|
+
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), this.html = html, this.scripts = scripts, this.effects = this.lastEffect = state.resumes = "", this;
|
1625
1632
|
}
|
1626
1633
|
flushHTML() {
|
1627
1634
|
this.flushScript();
|
package/dist/html.mjs
CHANGED
@@ -21,7 +21,7 @@ function styleValue(styleValue2) {
|
|
21
21
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
22
22
|
}
|
23
23
|
function stringifyStyleObject(name, value) {
|
24
|
-
return value || value === 0 ?
|
24
|
+
return value || value === 0 ? name + ":" + value : "";
|
25
25
|
}
|
26
26
|
function toDelimitedString(val, delimiter, stringify) {
|
27
27
|
let str = "", sep = "", part;
|
@@ -1267,41 +1267,48 @@ function ensureScopeWithId(scopeId) {
|
|
1267
1267
|
function $global() {
|
1268
1268
|
return $chunk.boundary.state.$global;
|
1269
1269
|
}
|
1270
|
-
function fork(scopeId, accessor, promise, content) {
|
1270
|
+
function fork(scopeId, accessor, promise, content, serializeMarker) {
|
1271
|
+
let resumeMarker = serializeMarker !== 0;
|
1271
1272
|
if (!isPromise(promise)) {
|
1272
|
-
|
1273
|
-
|
1274
|
-
$chunk.
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
$chunk.
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1273
|
+
if (resumeMarker) {
|
1274
|
+
let branchId = peekNextScopeId();
|
1275
|
+
$chunk.writeHTML(
|
1276
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1277
|
+
), content(promise), writeScope(scopeId, {
|
1278
|
+
["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1279
|
+
}), $chunk.writeHTML(
|
1280
|
+
$chunk.boundary.state.mark(
|
1281
|
+
"]" /* BranchEnd */,
|
1282
|
+
scopeId + " " + accessor
|
1283
|
+
)
|
1284
|
+
);
|
1285
|
+
} else
|
1286
|
+
content(promise);
|
1283
1287
|
return;
|
1284
1288
|
}
|
1285
1289
|
let chunk = $chunk, { boundary } = chunk;
|
1286
1290
|
chunk.next = $chunk = new Chunk(boundary, chunk.next, chunk.context), chunk.async = !0, chunk.context?.[kPendingContexts] && (chunk.context = { ...chunk.context, [kPendingContexts]: 0 }), boundary.startAsync(), promise.then(
|
1287
1291
|
(value) => {
|
1288
1292
|
chunk.async && (chunk.async = !1, boundary.signal.aborted || (chunk.render(() => {
|
1289
|
-
|
1290
|
-
|
1291
|
-
$chunk.
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
$chunk.
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1293
|
+
if (resumeMarker) {
|
1294
|
+
let branchId = peekNextScopeId();
|
1295
|
+
$chunk.writeHTML(
|
1296
|
+
$chunk.boundary.state.mark(
|
1297
|
+
"[" /* BranchStart */,
|
1298
|
+
branchId + ""
|
1299
|
+
)
|
1300
|
+
), content(value), boundary.state.serializer.writeAssign(
|
1301
|
+
writeScope(branchId, {}),
|
1302
|
+
ensureScopeWithId(scopeId),
|
1303
|
+
"d" /* ConditionalScope */ + accessor
|
1304
|
+
), $chunk.writeHTML(
|
1305
|
+
$chunk.boundary.state.mark(
|
1306
|
+
"]" /* BranchEnd */,
|
1307
|
+
scopeId + " " + accessor
|
1308
|
+
)
|
1309
|
+
);
|
1310
|
+
} else
|
1311
|
+
content(value);
|
1305
1312
|
}), boundary.endAsync(chunk)));
|
1306
1313
|
},
|
1307
1314
|
(err) => {
|
@@ -1448,10 +1455,10 @@ var State2 = class {
|
|
1448
1455
|
this.html += html;
|
1449
1456
|
}
|
1450
1457
|
writeEffect(scopeId, registryId) {
|
1451
|
-
this.lastEffect === registryId ? this.effects += "," + scopeId : this.effects = concatEffects(
|
1458
|
+
this.lastEffect === registryId ? this.effects += "," + scopeId : (this.lastEffect = registryId, this.effects = concatEffects(
|
1452
1459
|
this.effects,
|
1453
1460
|
'"' + registryId + '",' + scopeId
|
1454
|
-
)
|
1461
|
+
));
|
1455
1462
|
}
|
1456
1463
|
writeScript(script) {
|
1457
1464
|
this.scripts = concatScripts(this.scripts, script);
|
@@ -1539,7 +1546,7 @@ var State2 = class {
|
|
1539
1546
|
}
|
1540
1547
|
state.writeReorders = null;
|
1541
1548
|
}
|
1542
|
-
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), this.
|
1549
|
+
return hasWalk && (scripts = concatScripts(scripts, runtimePrefix + ".w()")), this.html = html, this.scripts = scripts, this.effects = this.lastEffect = state.resumes = "", this;
|
1543
1550
|
}
|
1544
1551
|
flushHTML() {
|
1545
1552
|
this.flushScript();
|
package/dist/translator/index.js
CHANGED
@@ -1009,7 +1009,7 @@ function styleValue(styleValue2) {
|
|
1009
1009
|
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
1010
1010
|
}
|
1011
1011
|
function stringifyStyleObject(name2, value) {
|
1012
|
-
return value || value === 0 ?
|
1012
|
+
return value || value === 0 ? name2 + ":" + value : "";
|
1013
1013
|
}
|
1014
1014
|
function toDelimitedString(val, delimiter, stringify) {
|
1015
1015
|
let str = "";
|
@@ -5265,6 +5265,8 @@ var await_default = {
|
|
5265
5265
|
const nodeRef2 = tagExtra[kDOMBinding];
|
5266
5266
|
const tagBody = tag.get("body");
|
5267
5267
|
const section = getSection(tag);
|
5268
|
+
const bodySection = getSectionForBody(tagBody);
|
5269
|
+
const serializeReason = bodySection && getSectionSerializeReason(bodySection);
|
5268
5270
|
flushInto(tag);
|
5269
5271
|
writeHTMLResumeStatements(tagBody);
|
5270
5272
|
tag.replaceWith(
|
@@ -5277,7 +5279,8 @@ var await_default = {
|
|
5277
5279
|
import_compiler25.types.arrowFunctionExpression(
|
5278
5280
|
node.body.params,
|
5279
5281
|
toFirstExpressionOrBlock(node.body.body)
|
5280
|
-
)
|
5282
|
+
),
|
5283
|
+
!serializeReason ? import_compiler25.types.numericLiteral(0) : serializeReason === true ? void 0 : getSerializeGuard(serializeReason)
|
5281
5284
|
)
|
5282
5285
|
)
|
5283
5286
|
)[0].skip();
|
@@ -5623,66 +5626,6 @@ var import_babel_utils24 = require("@marko/compiler/babel-utils");
|
|
5623
5626
|
// src/translator/visitors/tag/native-tag.ts
|
5624
5627
|
var import_compiler31 = require("@marko/compiler");
|
5625
5628
|
var import_babel_utils23 = require("@marko/compiler/babel-utils");
|
5626
|
-
|
5627
|
-
// src/translator/util/css-px-props.ts
|
5628
|
-
var css_px_props_default = /* @__PURE__ */ new Set([
|
5629
|
-
"background-size",
|
5630
|
-
"baseline-shift",
|
5631
|
-
"border-bottom-left-radius",
|
5632
|
-
"border-bottom-right-radius",
|
5633
|
-
"border-bottom-width",
|
5634
|
-
"border-left-width",
|
5635
|
-
"border-right-width",
|
5636
|
-
"border-top-left-radius",
|
5637
|
-
"border-top-right-radius",
|
5638
|
-
"border-top-width",
|
5639
|
-
"bottom",
|
5640
|
-
"column-gap",
|
5641
|
-
"column-rule-width",
|
5642
|
-
"column-width",
|
5643
|
-
"cx",
|
5644
|
-
"cy",
|
5645
|
-
"flex-basis",
|
5646
|
-
"font-size",
|
5647
|
-
"grid-auto-columns",
|
5648
|
-
"grid-auto-rows",
|
5649
|
-
"height",
|
5650
|
-
"left",
|
5651
|
-
"letter-spacing",
|
5652
|
-
"margin-bottom",
|
5653
|
-
"margin-left",
|
5654
|
-
"margin-right",
|
5655
|
-
"margin-top",
|
5656
|
-
"max-height",
|
5657
|
-
"max-width",
|
5658
|
-
"min-height",
|
5659
|
-
"min-width",
|
5660
|
-
"offset-distance",
|
5661
|
-
"outline-offset",
|
5662
|
-
"outline-width",
|
5663
|
-
"padding-bottom",
|
5664
|
-
"padding-left",
|
5665
|
-
"padding-right",
|
5666
|
-
"padding-top",
|
5667
|
-
"perspective",
|
5668
|
-
"r",
|
5669
|
-
"right",
|
5670
|
-
"row-gap",
|
5671
|
-
"rx",
|
5672
|
-
"ry",
|
5673
|
-
"shape-margin",
|
5674
|
-
"stroke-dashoffset",
|
5675
|
-
"stroke-width",
|
5676
|
-
"text-indent",
|
5677
|
-
"top",
|
5678
|
-
"vertical-align",
|
5679
|
-
"width",
|
5680
|
-
"word-spacing",
|
5681
|
-
"x",
|
5682
|
-
"y"
|
5683
|
-
]);
|
5684
|
-
|
5685
|
-
// src/translator/visitors/tag/native-tag.ts
|
5686
5629
|
var kNativeTagBinding = Symbol("native tag binding");
|
5687
5630
|
var kSkipMark = Symbol("skip native tag mark");
|
5688
5631
|
var kGetterId = Symbol("node getter id");
|
@@ -6149,7 +6092,7 @@ var native_tag_default = {
|
|
6149
6092
|
);
|
6150
6093
|
} else {
|
6151
6094
|
if (meta.staticItems) {
|
6152
|
-
write2`${getHTMLRuntime()[helper](
|
6095
|
+
write2`${getHTMLRuntime()[helper](meta.staticItems)}`;
|
6153
6096
|
}
|
6154
6097
|
if (meta.dynamicValues) {
|
6155
6098
|
const keys = Object.keys(meta.dynamicValues);
|
@@ -6161,7 +6104,7 @@ var native_tag_default = {
|
|
6161
6104
|
`${name2}Item`,
|
6162
6105
|
nodeExpr,
|
6163
6106
|
import_compiler31.types.stringLiteral(key),
|
6164
|
-
|
6107
|
+
value2
|
6165
6108
|
)
|
6166
6109
|
);
|
6167
6110
|
} else {
|
@@ -6169,10 +6112,7 @@ var native_tag_default = {
|
|
6169
6112
|
for (const key of keys) {
|
6170
6113
|
const value2 = meta.dynamicValues[key];
|
6171
6114
|
props.push(
|
6172
|
-
import_compiler31.types.objectProperty(
|
6173
|
-
toPropertyName(key),
|
6174
|
-
name2 === "style" && css_px_props_default.has(name2) ? callRuntime("styleItemValue", value2) : value2
|
6175
|
-
)
|
6115
|
+
import_compiler31.types.objectProperty(toPropertyName(key), value2)
|
6176
6116
|
);
|
6177
6117
|
}
|
6178
6118
|
stmt = import_compiler31.types.expressionStatement(
|
@@ -7842,7 +7782,6 @@ var html_script_default = {
|
|
7842
7782
|
const tagExtra = tag.node.extra;
|
7843
7783
|
const nodeBinding = tagExtra[kNodeBinding2];
|
7844
7784
|
const write2 = writeTo(tag);
|
7845
|
-
const visitAccessor = getScopeAccessorLiteral(nodeBinding);
|
7846
7785
|
if (isOutputHTML()) {
|
7847
7786
|
for (const child of tag.node.body.body) {
|
7848
7787
|
if (import_compiler38.types.isMarkoText(child)) {
|
@@ -7877,7 +7816,11 @@ var html_script_default = {
|
|
7877
7816
|
import_compiler38.types.expressionStatement(
|
7878
7817
|
callRuntime(
|
7879
7818
|
"textContent",
|
7880
|
-
import_compiler38.types.memberExpression(
|
7819
|
+
import_compiler38.types.memberExpression(
|
7820
|
+
scopeIdentifier,
|
7821
|
+
getScopeAccessorLiteral(nodeBinding),
|
7822
|
+
true
|
7823
|
+
),
|
7881
7824
|
import_compiler38.types.templateLiteral(templateQuasis, templateExpressions)
|
7882
7825
|
)
|
7883
7826
|
)
|
@@ -8254,7 +8197,6 @@ var html_style_default = {
|
|
8254
8197
|
const tagExtra = tag.node.extra;
|
8255
8198
|
const nodeBinding = tagExtra[kNodeBinding3];
|
8256
8199
|
const write2 = writeTo(tag);
|
8257
|
-
const visitAccessor = getScopeAccessorLiteral(nodeBinding);
|
8258
8200
|
if (isOutputHTML()) {
|
8259
8201
|
for (const child of tag.node.body.body) {
|
8260
8202
|
if (import_compiler39.types.isMarkoText(child)) {
|
@@ -8289,7 +8231,11 @@ var html_style_default = {
|
|
8289
8231
|
import_compiler39.types.expressionStatement(
|
8290
8232
|
callRuntime(
|
8291
8233
|
"textContent",
|
8292
|
-
import_compiler39.types.memberExpression(
|
8234
|
+
import_compiler39.types.memberExpression(
|
8235
|
+
scopeIdentifier,
|
8236
|
+
getScopeAccessorLiteral(nodeBinding),
|
8237
|
+
true
|
8238
|
+
),
|
8293
8239
|
import_compiler39.types.templateLiteral(templateQuasis, templateExpressions)
|
8294
8240
|
)
|
8295
8241
|
)
|
package/package.json
CHANGED