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 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 ? `${name}:${value2 && typeof value2 === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
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) {
@@ -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 ? `${name}:${value2 && typeof value2 === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
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,
@@ -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 ? `${name}:${value && typeof value === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
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
- const branchId = peekNextScopeId();
2094
- $chunk.writeHTML(
2095
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
2096
- );
2097
- content(promise);
2098
- writeScope(scopeId, {
2099
- ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
2100
- });
2101
- $chunk.writeHTML(
2102
- $chunk.boundary.state.mark(
2103
- "]" /* BranchEnd */,
2104
- scopeId + " " + accessor
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
- const branchId = peekNextScopeId();
2124
- $chunk.writeHTML(
2125
- $chunk.boundary.state.mark(
2126
- "[" /* BranchStart */,
2127
- branchId + ""
2128
- )
2129
- );
2130
- content(value);
2131
- boundary.state.serializer.writeAssign(
2132
- writeScope(branchId, {}),
2133
- ensureScopeWithId(scopeId),
2134
- "ConditionalScope:" /* ConditionalScope */ + accessor
2135
- );
2136
- $chunk.writeHTML(
2137
- $chunk.boundary.state.mark(
2138
- "]" /* BranchEnd */,
2139
- scopeId + " " + accessor
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() {
@@ -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 ? `${name}:${value && typeof value === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
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
- const branchId = peekNextScopeId();
2009
- $chunk.writeHTML(
2010
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
2011
- );
2012
- content(promise);
2013
- writeScope(scopeId, {
2014
- ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
2015
- });
2016
- $chunk.writeHTML(
2017
- $chunk.boundary.state.mark(
2018
- "]" /* BranchEnd */,
2019
- scopeId + " " + accessor
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
- const branchId = peekNextScopeId();
2039
- $chunk.writeHTML(
2040
- $chunk.boundary.state.mark(
2041
- "[" /* BranchStart */,
2042
- branchId + ""
2043
- )
2044
- );
2045
- content(value);
2046
- boundary.state.serializer.writeAssign(
2047
- writeScope(branchId, {}),
2048
- ensureScopeWithId(scopeId),
2049
- "ConditionalScope:" /* ConditionalScope */ + accessor
2050
- );
2051
- $chunk.writeHTML(
2052
- $chunk.boundary.state.mark(
2053
- "]" /* BranchEnd */,
2054
- scopeId + " " + accessor
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, styleItemValue, textContent, } from "./dom/dom";
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 ? `${name}:${value2 && typeof value2 == "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
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 ? `${name}:${value2 && typeof value2 == "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
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,
@@ -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 ? `${name}:${value && typeof value == "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
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
- let branchId = peekNextScopeId();
1355
- $chunk.writeHTML(
1356
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
1357
- ), content(promise), writeScope(scopeId, {
1358
- ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1359
- }), $chunk.writeHTML(
1360
- $chunk.boundary.state.mark(
1361
- "]" /* BranchEnd */,
1362
- scopeId + " " + accessor
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
- let branchId = peekNextScopeId();
1372
- $chunk.writeHTML(
1373
- $chunk.boundary.state.mark(
1374
- "[" /* BranchStart */,
1375
- branchId + ""
1376
- )
1377
- ), content(value), boundary.state.serializer.writeAssign(
1378
- writeScope(branchId, {}),
1379
- ensureScopeWithId(scopeId),
1380
- "d" /* ConditionalScope */ + accessor
1381
- ), $chunk.writeHTML(
1382
- $chunk.boundary.state.mark(
1383
- "]" /* BranchEnd */,
1384
- scopeId + " " + accessor
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
- ), this.lastEffect = registryId;
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.effects = state.resumes = "", this.html = html, this.scripts = scripts, 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 ? `${name}:${value && typeof value == "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
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
- let branchId = peekNextScopeId();
1273
- $chunk.writeHTML(
1274
- $chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
1275
- ), content(promise), writeScope(scopeId, {
1276
- ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1277
- }), $chunk.writeHTML(
1278
- $chunk.boundary.state.mark(
1279
- "]" /* BranchEnd */,
1280
- scopeId + " " + accessor
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
- let branchId = peekNextScopeId();
1290
- $chunk.writeHTML(
1291
- $chunk.boundary.state.mark(
1292
- "[" /* BranchStart */,
1293
- branchId + ""
1294
- )
1295
- ), content(value), boundary.state.serializer.writeAssign(
1296
- writeScope(branchId, {}),
1297
- ensureScopeWithId(scopeId),
1298
- "d" /* ConditionalScope */ + accessor
1299
- ), $chunk.writeHTML(
1300
- $chunk.boundary.state.mark(
1301
- "]" /* BranchEnd */,
1302
- scopeId + " " + accessor
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
- ), this.lastEffect = registryId;
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.effects = state.resumes = "", this.html = html, this.scripts = scripts, 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();
@@ -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 ? `${name2}:${value && typeof value === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name2) ? value + "px" : value}` : "";
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](computed)}`;
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
- name2 === "style" && css_px_props_default.has(name2) ? callRuntime("styleItemValue", value2) : value2
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(scopeIdentifier, visitAccessor, true),
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(scopeIdentifier, visitAccessor, true),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.6",
3
+ "version": "6.0.8",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -1,2 +0,0 @@
1
- declare const _default: Set<string>;
2
- export default _default;