marko 6.0.7 → 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 +1 -1
- package/dist/debug/html.mjs +1 -1
- 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.js +1 -1
- package/dist/html.mjs +1 -1
- package/dist/translator/index.js +14 -71
- 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 = "";
|
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 = "";
|
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.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;
|
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;
|
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 = "";
|
@@ -5626,66 +5626,6 @@ var import_babel_utils24 = require("@marko/compiler/babel-utils");
|
|
5626
5626
|
// src/translator/visitors/tag/native-tag.ts
|
5627
5627
|
var import_compiler31 = require("@marko/compiler");
|
5628
5628
|
var import_babel_utils23 = require("@marko/compiler/babel-utils");
|
5629
|
-
|
5630
|
-
// src/translator/util/css-px-props.ts
|
5631
|
-
var css_px_props_default = /* @__PURE__ */ new Set([
|
5632
|
-
"background-size",
|
5633
|
-
"baseline-shift",
|
5634
|
-
"border-bottom-left-radius",
|
5635
|
-
"border-bottom-right-radius",
|
5636
|
-
"border-bottom-width",
|
5637
|
-
"border-left-width",
|
5638
|
-
"border-right-width",
|
5639
|
-
"border-top-left-radius",
|
5640
|
-
"border-top-right-radius",
|
5641
|
-
"border-top-width",
|
5642
|
-
"bottom",
|
5643
|
-
"column-gap",
|
5644
|
-
"column-rule-width",
|
5645
|
-
"column-width",
|
5646
|
-
"cx",
|
5647
|
-
"cy",
|
5648
|
-
"flex-basis",
|
5649
|
-
"font-size",
|
5650
|
-
"grid-auto-columns",
|
5651
|
-
"grid-auto-rows",
|
5652
|
-
"height",
|
5653
|
-
"left",
|
5654
|
-
"letter-spacing",
|
5655
|
-
"margin-bottom",
|
5656
|
-
"margin-left",
|
5657
|
-
"margin-right",
|
5658
|
-
"margin-top",
|
5659
|
-
"max-height",
|
5660
|
-
"max-width",
|
5661
|
-
"min-height",
|
5662
|
-
"min-width",
|
5663
|
-
"offset-distance",
|
5664
|
-
"outline-offset",
|
5665
|
-
"outline-width",
|
5666
|
-
"padding-bottom",
|
5667
|
-
"padding-left",
|
5668
|
-
"padding-right",
|
5669
|
-
"padding-top",
|
5670
|
-
"perspective",
|
5671
|
-
"r",
|
5672
|
-
"right",
|
5673
|
-
"row-gap",
|
5674
|
-
"rx",
|
5675
|
-
"ry",
|
5676
|
-
"shape-margin",
|
5677
|
-
"stroke-dashoffset",
|
5678
|
-
"stroke-width",
|
5679
|
-
"text-indent",
|
5680
|
-
"top",
|
5681
|
-
"vertical-align",
|
5682
|
-
"width",
|
5683
|
-
"word-spacing",
|
5684
|
-
"x",
|
5685
|
-
"y"
|
5686
|
-
]);
|
5687
|
-
|
5688
|
-
// src/translator/visitors/tag/native-tag.ts
|
5689
5629
|
var kNativeTagBinding = Symbol("native tag binding");
|
5690
5630
|
var kSkipMark = Symbol("skip native tag mark");
|
5691
5631
|
var kGetterId = Symbol("node getter id");
|
@@ -6152,7 +6092,7 @@ var native_tag_default = {
|
|
6152
6092
|
);
|
6153
6093
|
} else {
|
6154
6094
|
if (meta.staticItems) {
|
6155
|
-
write2`${getHTMLRuntime()[helper](
|
6095
|
+
write2`${getHTMLRuntime()[helper](meta.staticItems)}`;
|
6156
6096
|
}
|
6157
6097
|
if (meta.dynamicValues) {
|
6158
6098
|
const keys = Object.keys(meta.dynamicValues);
|
@@ -6164,7 +6104,7 @@ var native_tag_default = {
|
|
6164
6104
|
`${name2}Item`,
|
6165
6105
|
nodeExpr,
|
6166
6106
|
import_compiler31.types.stringLiteral(key),
|
6167
|
-
|
6107
|
+
value2
|
6168
6108
|
)
|
6169
6109
|
);
|
6170
6110
|
} else {
|
@@ -6172,10 +6112,7 @@ var native_tag_default = {
|
|
6172
6112
|
for (const key of keys) {
|
6173
6113
|
const value2 = meta.dynamicValues[key];
|
6174
6114
|
props.push(
|
6175
|
-
import_compiler31.types.objectProperty(
|
6176
|
-
toPropertyName(key),
|
6177
|
-
name2 === "style" && css_px_props_default.has(name2) ? callRuntime("styleItemValue", value2) : value2
|
6178
|
-
)
|
6115
|
+
import_compiler31.types.objectProperty(toPropertyName(key), value2)
|
6179
6116
|
);
|
6180
6117
|
}
|
6181
6118
|
stmt = import_compiler31.types.expressionStatement(
|
@@ -7845,7 +7782,6 @@ var html_script_default = {
|
|
7845
7782
|
const tagExtra = tag.node.extra;
|
7846
7783
|
const nodeBinding = tagExtra[kNodeBinding2];
|
7847
7784
|
const write2 = writeTo(tag);
|
7848
|
-
const visitAccessor = getScopeAccessorLiteral(nodeBinding);
|
7849
7785
|
if (isOutputHTML()) {
|
7850
7786
|
for (const child of tag.node.body.body) {
|
7851
7787
|
if (import_compiler38.types.isMarkoText(child)) {
|
@@ -7880,7 +7816,11 @@ var html_script_default = {
|
|
7880
7816
|
import_compiler38.types.expressionStatement(
|
7881
7817
|
callRuntime(
|
7882
7818
|
"textContent",
|
7883
|
-
import_compiler38.types.memberExpression(
|
7819
|
+
import_compiler38.types.memberExpression(
|
7820
|
+
scopeIdentifier,
|
7821
|
+
getScopeAccessorLiteral(nodeBinding),
|
7822
|
+
true
|
7823
|
+
),
|
7884
7824
|
import_compiler38.types.templateLiteral(templateQuasis, templateExpressions)
|
7885
7825
|
)
|
7886
7826
|
)
|
@@ -8257,7 +8197,6 @@ var html_style_default = {
|
|
8257
8197
|
const tagExtra = tag.node.extra;
|
8258
8198
|
const nodeBinding = tagExtra[kNodeBinding3];
|
8259
8199
|
const write2 = writeTo(tag);
|
8260
|
-
const visitAccessor = getScopeAccessorLiteral(nodeBinding);
|
8261
8200
|
if (isOutputHTML()) {
|
8262
8201
|
for (const child of tag.node.body.body) {
|
8263
8202
|
if (import_compiler39.types.isMarkoText(child)) {
|
@@ -8292,7 +8231,11 @@ var html_style_default = {
|
|
8292
8231
|
import_compiler39.types.expressionStatement(
|
8293
8232
|
callRuntime(
|
8294
8233
|
"textContent",
|
8295
|
-
import_compiler39.types.memberExpression(
|
8234
|
+
import_compiler39.types.memberExpression(
|
8235
|
+
scopeIdentifier,
|
8236
|
+
getScopeAccessorLiteral(nodeBinding),
|
8237
|
+
true
|
8238
|
+
),
|
8296
8239
|
import_compiler39.types.templateLiteral(templateQuasis, templateExpressions)
|
8297
8240
|
)
|
8298
8241
|
)
|
package/package.json
CHANGED