marko 5.33.1 → 5.33.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/runtime/helpers/tags-compat-dom.js +7 -7
- package/dist/runtime/helpers/tags-compat-html.js +7 -7
- package/dist/runtime/vdom/VElement.js +1 -1
- package/dist/runtime/vdom/VNode.js +1 -2
- package/dist/runtime/vdom/morphdom/index.js +2 -4
- package/package.json +1 -1
- package/src/runtime/helpers/tags-compat-dom.js +4 -4
- package/src/runtime/helpers/tags-compat-html.js +5 -5
- package/src/runtime/vdom/VElement.js +1 -1
- package/src/runtime/vdom/VNode.js +1 -2
- package/src/runtime/vdom/morphdom/index.js +2 -4
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
"use strict";const { _i_ } = require("@internal/components-util");
|
2
|
+
const { R_ } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const {
|
5
5
|
prepare,
|
@@ -14,13 +14,13 @@ const {
|
|
14
14
|
// eslint-disable-next-line no-constant-condition
|
15
15
|
"@marko/runtime-tags/dom"
|
16
16
|
);
|
17
|
-
const { _i_ } = require("@internal/components-util");
|
18
17
|
const defineComponent = require("../components/defineComponent");
|
19
18
|
const { r: registerComponent } = require("../components/registry");
|
20
19
|
const createRenderer = require("../components/renderer");
|
21
20
|
const defaultCreateOut = require("../createOut");
|
22
21
|
const morphdom = require("../vdom/morphdom");
|
23
|
-
const
|
22
|
+
const { _h_ } = require("../vdom/morphdom/fragment");
|
23
|
+
const dynamicTag = require("./dynamic-tag");
|
24
24
|
|
25
25
|
dynamicTag.bk_ = function tagsToVdom(
|
26
26
|
tagsRenderer,
|
@@ -43,7 +43,7 @@ const TagsCompat = createRenderer(
|
|
43
43
|
function (_, out, componentDef, component) {
|
44
44
|
let existing = false;
|
45
45
|
const isHydrate =
|
46
|
-
|
46
|
+
R_(out).o_._W_;
|
47
47
|
const input = Array.isArray(_.i) ? _.i : [_.i];
|
48
48
|
const tagsRenderer = resolveRegistered(_.r);
|
49
49
|
const args = tagsRenderer.bm_;
|
@@ -153,7 +153,7 @@ function create5to6Renderer(renderer, hasAttrs) {
|
|
153
153
|
},
|
154
154
|
bl_() {
|
155
155
|
const realFragment = document.createDocumentFragment();
|
156
|
-
|
156
|
+
_h_(null, null, realFragment);
|
157
157
|
return realFragment;
|
158
158
|
},
|
159
159
|
bs_: 1,
|
@@ -182,7 +182,7 @@ function renderAndMorph(scope, renderer, renderBody, input) {
|
|
182
182
|
}
|
183
183
|
const host = scope.bp_;
|
184
184
|
const existingComponent = scope.marko5Component;
|
185
|
-
const componentsContext =
|
185
|
+
const componentsContext = R_(out);
|
186
186
|
const globalComponentsContext = componentsContext.o_;
|
187
187
|
let customEvents;
|
188
188
|
globalComponentsContext.ax_ = existingComponent;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
"use strict";const initComponentsTag = require("../../core-tags/components/init-components-tag");
|
2
|
+
const { R_ } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const tagsAPI = require(
|
5
5
|
// eslint-disable-next-line no-constant-condition
|
@@ -28,7 +28,7 @@ const FN_TO_JSON = function () {
|
|
28
28
|
};
|
29
29
|
|
30
30
|
const isMarko6 = (fn) => !!fn.bt_;
|
31
|
-
const isMarko5 = (fn) => !fn.bt_;
|
31
|
+
const isMarko5 = (fn) => !fn.bt_;
|
32
32
|
|
33
33
|
dynamicTag5.bk_ = function tagsToVdom(
|
34
34
|
tagsRenderer,
|
@@ -115,7 +115,7 @@ patchDynamicTag(
|
|
115
115
|
renderBody5(out, input, ...args);
|
116
116
|
}
|
117
117
|
|
118
|
-
const componentsContext =
|
118
|
+
const componentsContext = R_(out);
|
119
119
|
const component = componentsContext.b_[0];
|
120
120
|
if (component) {
|
121
121
|
component.r_.U_ = customEvents;
|
@@ -124,7 +124,7 @@ patchDynamicTag(
|
|
124
124
|
});
|
125
125
|
}
|
126
126
|
|
127
|
-
(
|
127
|
+
initComponentsTag({}, out);
|
128
128
|
|
129
129
|
let async;
|
130
130
|
out.once("finish", (result) => {
|
@@ -154,7 +154,7 @@ function dummyCreate5to6Renderer() {}
|
|
154
154
|
|
155
155
|
register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
|
156
156
|
|
157
|
-
function serialized5to6(renderer, id) {
|
157
|
+
exports.serialized5to6 = function serialized5to6(renderer, id) {
|
158
158
|
const dummyRenderer = () => {};
|
159
159
|
register(dummyRenderer, id);
|
160
160
|
return makeSerializable(renderer, (s) =>
|
@@ -164,4 +164,4 @@ function serialized5to6(renderer, id) {
|
|
164
164
|
value(dummyRenderer).
|
165
165
|
code(",!0)")
|
166
166
|
);
|
167
|
-
}
|
167
|
+
};
|
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
|
700
|
-
|
701
|
-
if (oldValue !== newValue) {
|
702
|
-
fromEl.value = newValue;
|
699
|
+
if (toEl.ci_ !== vFromEl.ci_) {
|
700
|
+
fromEl.value = toEl.ci_;
|
703
701
|
}
|
704
702
|
} else {
|
705
703
|
morphChildren(fromEl, toEl, parentComponent);
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const { ___componentLookup } = require("@internal/components-util");
|
2
|
+
const { ___getComponentsContext } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const {
|
5
5
|
prepare,
|
@@ -14,15 +14,15 @@ const {
|
|
14
14
|
// eslint-disable-next-line no-constant-condition
|
15
15
|
"MARKO_DEBUG" ? "@marko/runtime-tags/debug/dom" : "@marko/runtime-tags/dom",
|
16
16
|
);
|
17
|
-
const { ___componentLookup } = require("@internal/components-util");
|
18
17
|
const defineComponent = require("../components/defineComponent");
|
19
18
|
const { r: registerComponent } = require("../components/registry");
|
20
19
|
const createRenderer = require("../components/renderer");
|
21
20
|
const defaultCreateOut = require("../createOut");
|
22
21
|
const morphdom = require("../vdom/morphdom");
|
22
|
+
const { ___createFragmentNode } = require("../vdom/morphdom/fragment");
|
23
23
|
const dynamicTag = require("./dynamic-tag");
|
24
24
|
|
25
|
-
|
25
|
+
dynamicTag.___runtimeCompat = function tagsToVdom(
|
26
26
|
tagsRenderer,
|
27
27
|
renderBody,
|
28
28
|
args,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const initComponentsTag = require("../../core-tags/components/init-components-tag");
|
2
|
+
const { ___getComponentsContext } = require("../components/ComponentsContext");
|
3
3
|
|
4
4
|
const tagsAPI = require(
|
5
5
|
// eslint-disable-next-line no-constant-condition
|
@@ -30,7 +30,7 @@ const FN_TO_JSON = function () {
|
|
30
30
|
const isMarko6 = (fn) => !!fn.___isTagsAPI;
|
31
31
|
const isMarko5 = (fn) => !fn.___isTagsAPI;
|
32
32
|
|
33
|
-
|
33
|
+
dynamicTag5.___runtimeCompat = function tagsToVdom(
|
34
34
|
tagsRenderer,
|
35
35
|
renderBody,
|
36
36
|
args,
|
@@ -154,7 +154,7 @@ function dummyCreate5to6Renderer() {}
|
|
154
154
|
|
155
155
|
register(dummyCreate5to6Renderer, "@marko/tags-compat-5-to-6");
|
156
156
|
|
157
|
-
|
157
|
+
exports.serialized5to6 = function serialized5to6(renderer, id) {
|
158
158
|
const dummyRenderer = () => {};
|
159
159
|
register(dummyRenderer, id);
|
160
160
|
return makeSerializable(renderer, (s) =>
|
@@ -164,4 +164,4 @@ export function serialized5to6(renderer, id) {
|
|
164
164
|
.value(dummyRenderer)
|
165
165
|
.code(",!0)"),
|
166
166
|
);
|
167
|
-
}
|
167
|
+
};
|
@@ -116,7 +116,7 @@ function VElement(
|
|
116
116
|
this.___attributes = attrs || EMPTY_OBJECT;
|
117
117
|
this.___properties = props || EMPTY_OBJECT;
|
118
118
|
this.___nodeName = tagName;
|
119
|
-
this.___valueInternal =
|
119
|
+
this.___valueInternal = "";
|
120
120
|
this.___constId = constId;
|
121
121
|
this.___preserve = false;
|
122
122
|
this.___preserveBody = false;
|
@@ -50,8 +50,7 @@ VNode.prototype = {
|
|
50
50
|
|
51
51
|
if (this.___nodeName === "textarea") {
|
52
52
|
if (child.___Text) {
|
53
|
-
|
54
|
-
this.___valueInternal = (this.___valueInternal || "") + childValue;
|
53
|
+
this.___valueInternal += child.___nodeValue;
|
55
54
|
} else {
|
56
55
|
throw TypeError();
|
57
56
|
}
|
@@ -696,10 +696,8 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
696
696
|
}
|
697
697
|
|
698
698
|
if (nodeName === "textarea") {
|
699
|
-
|
700
|
-
|
701
|
-
if (oldValue !== newValue) {
|
702
|
-
fromEl.value = newValue;
|
699
|
+
if (toEl.___valueInternal !== vFromEl.___valueInternal) {
|
700
|
+
fromEl.value = toEl.___valueInternal;
|
703
701
|
}
|
704
702
|
} else {
|
705
703
|
morphChildren(fromEl, toEl, parentComponent);
|