marko 5.36.4 → 5.37.0
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/compiler/index.js +11 -11
- package/dist/core-tags/components/init-components-tag.js +4 -4
- package/dist/core-tags/components/preferred-script-location-tag.js +2 -2
- package/dist/core-tags/core/__flush_here_and_after__.js +1 -1
- package/dist/core-tags/core/await/AsyncValue.js +21 -21
- package/dist/core-tags/core/await/renderer.js +24 -24
- package/dist/core-tags/core/await/reorderer-renderer.js +6 -6
- package/dist/node-require/browser-refresh.js +18 -1
- package/dist/node-require/index.js +7 -7
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +5 -5
- package/dist/node_modules/@internal/components-beginComponent/index.js +12 -12
- package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +99 -99
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +3 -3
- package/dist/node_modules/@internal/components-endComponent/index.js +3 -3
- package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
- package/dist/node_modules/@internal/components-entry/index.js +29 -29
- package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +13 -13
- package/dist/node_modules/@internal/components-entry-legacy/index.js +1 -1
- package/dist/node_modules/@internal/components-registry/index-browser.js +102 -102
- package/dist/node_modules/@internal/components-registry/index.js +2 -2
- package/dist/node_modules/@internal/components-util/index-browser.js +20 -20
- package/dist/node_modules/@internal/components-util/index.js +24 -20
- package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
- package/dist/node_modules/@internal/create-readable/index.js +9 -9
- package/dist/node_modules/@internal/preserve-tag/index-browser.js +8 -8
- package/dist/node_modules/@internal/preserve-tag/index.js +6 -6
- package/dist/node_modules/@internal/set-immediate/index-browser.js +2 -2
- package/dist/node_modules/@internal/set-immediate/index-worker.js +3 -3
- package/dist/node_modules/@internal/set-immediate/index.js +3 -3
- package/dist/runtime/RenderResult.js +24 -24
- package/dist/runtime/components/Component.js +163 -163
- package/dist/runtime/components/ComponentDef.js +34 -34
- package/dist/runtime/components/ComponentsContext.js +20 -20
- package/dist/runtime/components/GlobalComponentsContext.js +4 -4
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +17 -17
- package/dist/runtime/components/State.js +28 -28
- package/dist/runtime/components/attach-detach.js +8 -8
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +6 -6
- package/dist/runtime/components/event-delegation.js +10 -10
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +25 -25
- package/dist/runtime/components/legacy/dependencies/index.js +10 -10
- package/dist/runtime/components/legacy/renderer-legacy.js +56 -56
- package/dist/runtime/components/renderer.js +45 -45
- package/dist/runtime/components/update-manager.js +4 -4
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +5 -5
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/dynamic-tag.js +33 -33
- package/dist/runtime/helpers/render-tag.js +1 -1
- package/dist/runtime/helpers/serialize-noop.js +2 -2
- package/dist/runtime/helpers/style-value.js +1 -1
- package/dist/runtime/helpers/tags-compat/runtime-dom.js +35 -35
- package/dist/runtime/helpers/tags-compat/runtime-html.js +16 -16
- package/dist/runtime/html/AsyncStream.js +28 -28
- package/dist/runtime/html/BufferedWriter.js +2 -2
- package/dist/runtime/html/StringWriter.js +2 -2
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +11 -11
- package/dist/runtime/html/helpers/attrs.js +6 -6
- package/dist/runtime/html/helpers/data-marko.js +6 -6
- package/dist/runtime/html/helpers/escape-quotes.js +2 -2
- package/dist/runtime/html/helpers/escape-xml.js +1 -1
- package/dist/runtime/html/helpers/merge-attrs.js +11 -11
- package/dist/runtime/html/helpers/props-script.js +1 -1
- package/dist/runtime/html/index.js +2 -2
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +100 -100
- package/dist/runtime/vdom/VComment.js +7 -7
- package/dist/runtime/vdom/VComponent.js +5 -5
- package/dist/runtime/vdom/VDocumentFragment.js +8 -8
- package/dist/runtime/vdom/VElement.js +52 -52
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +34 -34
- package/dist/runtime/vdom/VText.js +8 -8
- package/dist/runtime/vdom/helpers/attrs.js +6 -6
- package/dist/runtime/vdom/helpers/const-element.js +3 -3
- package/dist/runtime/vdom/hot-reload.js +20 -20
- package/dist/runtime/vdom/index.js +2 -2
- package/dist/runtime/vdom/morphdom/fragment.js +10 -10
- package/dist/runtime/vdom/morphdom/helpers.js +5 -5
- package/dist/runtime/vdom/morphdom/index.js +81 -81
- package/dist/runtime/vdom/vdom.js +15 -15
- package/dist/taglib/index.js +7 -7
- package/dist/translator/cdata/index.js +15 -0
- package/dist/translator/cdata/index[html].js +15 -0
- package/dist/translator/cdata/index[vdom].js +12 -0
- package/dist/translator/class.js +65 -0
- package/dist/translator/comment/index.js +15 -0
- package/dist/translator/comment/index[html].js +17 -0
- package/dist/translator/comment/index[vdom].js +3 -0
- package/dist/translator/declaration/index.js +15 -0
- package/dist/translator/declaration/index[html].js +12 -0
- package/dist/translator/declaration/index[vdom].js +3 -0
- package/dist/translator/document-type/index.js +15 -0
- package/dist/translator/document-type/index[html].js +12 -0
- package/dist/translator/document-type/index[vdom].js +3 -0
- package/dist/translator/index.js +551 -0
- package/dist/translator/placeholder/index.js +15 -0
- package/dist/translator/placeholder/index[html].js +93 -0
- package/dist/translator/placeholder/index[vdom].js +22 -0
- package/dist/translator/scriptlet.js +4 -0
- package/dist/translator/tag/attribute/directives/class.js +42 -0
- package/dist/translator/tag/attribute/directives/index.js +15 -0
- package/dist/translator/tag/attribute/directives/no-update-body-if.js +15 -0
- package/dist/translator/tag/attribute/directives/no-update-body.js +10 -0
- package/dist/translator/tag/attribute/directives/no-update-if.js +12 -0
- package/dist/translator/tag/attribute/directives/no-update.js +48 -0
- package/dist/translator/tag/attribute/directives/style.js +42 -0
- package/dist/translator/tag/attribute/index.js +150 -0
- package/dist/translator/tag/attribute/modifiers/index.js +7 -0
- package/dist/translator/tag/attribute/modifiers/no-update.js +14 -0
- package/dist/translator/tag/attribute/modifiers/scoped.js +23 -0
- package/dist/translator/tag/attribute-tag.js +149 -0
- package/dist/translator/tag/custom-tag.js +146 -0
- package/dist/translator/tag/dynamic-tag.js +74 -0
- package/dist/translator/tag/index.js +287 -0
- package/dist/translator/tag/macro-tag.js +7 -0
- package/dist/translator/tag/native-tag.js +27 -0
- package/dist/translator/tag/native-tag[html]/attributes.js +151 -0
- package/dist/translator/tag/native-tag[html]/index.js +221 -0
- package/dist/translator/tag/native-tag[vdom]/attributes.js +105 -0
- package/dist/translator/tag/native-tag[vdom]/index.js +189 -0
- package/dist/translator/tag/util.js +246 -0
- package/dist/translator/taglib/core/conditional/translate-else-if.js +20 -0
- package/dist/translator/taglib/core/conditional/translate-else.js +20 -0
- package/dist/translator/taglib/core/conditional/translate-if.js +8 -0
- package/dist/translator/taglib/core/conditional/util.js +41 -0
- package/dist/translator/taglib/core/index.js +474 -0
- package/dist/translator/taglib/core/macro/parse.js +17 -0
- package/dist/translator/taglib/core/macro/translate.js +48 -0
- package/dist/translator/taglib/core/parse-class.js +79 -0
- package/dist/translator/taglib/core/parse-export.js +14 -0
- package/dist/translator/taglib/core/parse-import.js +14 -0
- package/dist/translator/taglib/core/parse-module-code.js +18 -0
- package/dist/translator/taglib/core/parse-static.js +18 -0
- package/dist/translator/taglib/core/transform-style.js +66 -0
- package/dist/translator/taglib/core/translate-await.js +41 -0
- package/dist/translator/taglib/core/translate-body.js +17 -0
- package/dist/translator/taglib/core/translate-for.js +156 -0
- package/dist/translator/taglib/core/translate-html-comment.js +52 -0
- package/dist/translator/taglib/core/translate-include-content.js +53 -0
- package/dist/translator/taglib/core/translate-server-only.js +5 -0
- package/dist/translator/taglib/core/translate-while.js +32 -0
- package/dist/translator/taglib/index.js +6 -0
- package/dist/translator/taglib/migrate/all-templates.js +46 -0
- package/dist/translator/taglib/migrate/index.js +5 -0
- package/dist/translator/text/index.js +10 -0
- package/dist/translator/text/index[html].js +12 -0
- package/dist/translator/text/index[vdom].js +20 -0
- package/dist/translator/util/add-dependencies.js +329 -0
- package/dist/translator/util/escape-regexp.js +4 -0
- package/dist/translator/util/get-component-files.js +86 -0
- package/dist/translator/util/html-out-write.js +15 -0
- package/dist/translator/util/key-manager.js +176 -0
- package/dist/translator/util/optimize-html-writes.js +52 -0
- package/dist/translator/util/optimize-vdom-create.js +164 -0
- package/dist/translator/util/plugin-hooks.js +22 -0
- package/dist/translator/util/runtime-flags.js +3 -0
- package/dist/translator/util/vdom-out-write.js +10 -0
- package/dist/translator/util/with-previous-location.js +6 -0
- package/package.json +7 -4
- package/src/taglib/index.js +2 -2
- package/src/translator/cdata/index.js +15 -0
- package/src/translator/cdata/index[html].js +15 -0
- package/src/translator/cdata/index[vdom].js +12 -0
- package/src/translator/class.js +65 -0
- package/src/translator/comment/index.js +15 -0
- package/src/translator/comment/index[html].js +17 -0
- package/src/translator/comment/index[vdom].js +3 -0
- package/src/translator/declaration/index.js +15 -0
- package/src/translator/declaration/index[html].js +12 -0
- package/src/translator/declaration/index[vdom].js +3 -0
- package/src/translator/document-type/index.js +15 -0
- package/src/translator/document-type/index[html].js +12 -0
- package/src/translator/document-type/index[vdom].js +3 -0
- package/src/translator/index.js +551 -0
- package/src/translator/placeholder/index.js +15 -0
- package/src/translator/placeholder/index[html].js +93 -0
- package/src/translator/placeholder/index[vdom].js +22 -0
- package/src/translator/scriptlet.js +4 -0
- package/src/translator/tag/attribute/directives/class.js +42 -0
- package/src/translator/tag/attribute/directives/index.js +15 -0
- package/src/translator/tag/attribute/directives/no-update-body-if.js +15 -0
- package/src/translator/tag/attribute/directives/no-update-body.js +10 -0
- package/src/translator/tag/attribute/directives/no-update-if.js +12 -0
- package/src/translator/tag/attribute/directives/no-update.js +48 -0
- package/src/translator/tag/attribute/directives/style.js +42 -0
- package/src/translator/tag/attribute/index.js +150 -0
- package/src/translator/tag/attribute/modifiers/index.js +7 -0
- package/src/translator/tag/attribute/modifiers/no-update.js +14 -0
- package/src/translator/tag/attribute/modifiers/scoped.js +23 -0
- package/src/translator/tag/attribute-tag.js +149 -0
- package/src/translator/tag/custom-tag.js +146 -0
- package/src/translator/tag/dynamic-tag.js +74 -0
- package/src/translator/tag/index.js +287 -0
- package/src/translator/tag/macro-tag.js +7 -0
- package/src/translator/tag/native-tag.js +27 -0
- package/src/translator/tag/native-tag[html]/attributes.js +151 -0
- package/src/translator/tag/native-tag[html]/index.js +221 -0
- package/src/translator/tag/native-tag[vdom]/attributes.js +105 -0
- package/src/translator/tag/native-tag[vdom]/index.js +189 -0
- package/src/translator/tag/util.js +246 -0
- package/src/translator/taglib/core/conditional/translate-else-if.js +20 -0
- package/src/translator/taglib/core/conditional/translate-else.js +20 -0
- package/src/translator/taglib/core/conditional/translate-if.js +8 -0
- package/src/translator/taglib/core/conditional/util.js +41 -0
- package/src/translator/taglib/core/index.js +474 -0
- package/src/translator/taglib/core/macro/parse.js +17 -0
- package/src/translator/taglib/core/macro/translate.js +48 -0
- package/src/translator/taglib/core/parse-class.js +79 -0
- package/src/translator/taglib/core/parse-export.js +14 -0
- package/src/translator/taglib/core/parse-import.js +14 -0
- package/src/translator/taglib/core/parse-module-code.js +18 -0
- package/src/translator/taglib/core/parse-static.js +18 -0
- package/src/translator/taglib/core/transform-style.js +66 -0
- package/src/translator/taglib/core/translate-await.js +41 -0
- package/src/translator/taglib/core/translate-body.js +17 -0
- package/src/translator/taglib/core/translate-for.js +156 -0
- package/src/translator/taglib/core/translate-html-comment.js +52 -0
- package/src/translator/taglib/core/translate-include-content.js +53 -0
- package/src/translator/taglib/core/translate-server-only.js +5 -0
- package/src/translator/taglib/core/translate-while.js +32 -0
- package/src/translator/taglib/index.js +7 -0
- package/src/translator/taglib/migrate/all-templates.js +46 -0
- package/src/translator/taglib/migrate/index.js +5 -0
- package/src/translator/text/index.js +10 -0
- package/src/translator/text/index[html].js +12 -0
- package/src/translator/text/index[vdom].js +20 -0
- package/src/translator/util/add-dependencies.js +329 -0
- package/src/translator/util/escape-regexp.js +4 -0
- package/src/translator/util/get-component-files.js +86 -0
- package/src/translator/util/html-out-write.js +15 -0
- package/src/translator/util/key-manager.js +176 -0
- package/src/translator/util/optimize-html-writes.js +52 -0
- package/src/translator/util/optimize-vdom-create.js +164 -0
- package/src/translator/util/plugin-hooks.js +22 -0
- package/src/translator/util/runtime-flags.js +3 -0
- package/src/translator/util/vdom-out-write.js +10 -0
- package/src/translator/util/with-previous-location.js +6 -0
- package/translator/index.d.ts +7 -0
- package/translator/package.json +5 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";var extend = require("raptor-util/extend");
|
|
2
2
|
var componentsUtil = require("@internal/components-util");
|
|
3
|
-
var destroyComponentForNode = componentsUtil.
|
|
4
|
-
var destroyNodeRecursive = componentsUtil.
|
|
3
|
+
var destroyComponentForNode = componentsUtil.___destroyComponentForNode;
|
|
4
|
+
var destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;
|
|
5
5
|
var helpers = require("./vdom/morphdom/helpers");
|
|
6
6
|
|
|
7
|
-
var insertBefore = helpers.
|
|
8
|
-
var insertAfter = helpers.
|
|
9
|
-
var removeChild = helpers.
|
|
7
|
+
var insertBefore = helpers.___insertBefore;
|
|
8
|
+
var insertAfter = helpers.___insertAfter;
|
|
9
|
+
var removeChild = helpers.___removeChild;
|
|
10
10
|
|
|
11
11
|
function resolveEl(el) {
|
|
12
12
|
if (typeof el == "string") {
|
|
@@ -6,7 +6,7 @@ var dashToCamelLookup = Object.create(null);
|
|
|
6
6
|
/**
|
|
7
7
|
* Helper for converting camelCase to dash-case.
|
|
8
8
|
*/
|
|
9
|
-
exports.
|
|
9
|
+
exports.___camelToDashCase = function camelToDashCase(name) {
|
|
10
10
|
var nameDashed = camelToDashLookup[name];
|
|
11
11
|
if (!nameDashed) {
|
|
12
12
|
nameDashed = camelToDashLookup[name] = name.
|
|
@@ -24,7 +24,7 @@ exports.bj_ = function camelToDashCase(name) {
|
|
|
24
24
|
/**
|
|
25
25
|
* Helper for converting dash-case to camelCase.
|
|
26
26
|
*/
|
|
27
|
-
exports.
|
|
27
|
+
exports.___dashToCamelCase = function dashToCamelCase(name) {
|
|
28
28
|
var nameCamel = dashToCamelLookup[name];
|
|
29
29
|
if (!nameCamel) {
|
|
30
30
|
nameCamel = dashToCamelLookup[name] = name.replace(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line no-constant-binary-expression
|
|
4
|
-
|
|
4
|
+
var complain = "MARKO_DEBUG" && require("complain");
|
|
5
5
|
var ComponentDef = require("../components/ComponentDef");
|
|
6
6
|
var ComponentsContext = require("../components/ComponentsContext");
|
|
7
7
|
var serializeNOOP = require("../helpers/serialize-noop");
|
|
8
|
-
var w10NOOP = serializeNOOP.
|
|
9
|
-
var w10ToJSON = serializeNOOP.
|
|
8
|
+
var w10NOOP = serializeNOOP.___noop;
|
|
9
|
+
var w10ToJSON = serializeNOOP.___toJSON;
|
|
10
10
|
var changeCase = require("./_change-case");
|
|
11
|
-
var getComponentsContext = ComponentsContext.
|
|
11
|
+
var getComponentsContext = ComponentsContext.___getComponentsContext;
|
|
12
12
|
|
|
13
13
|
var FLAG_WILL_RERENDER_IN_BROWSER = 1;
|
|
14
14
|
// var FLAG_HAS_RENDER_BODY = 2;
|
|
@@ -34,10 +34,10 @@ customEvents)
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
var attrs = getAttrs && getAttrs();
|
|
37
|
-
var component = componentDef && componentDef.
|
|
37
|
+
var component = componentDef && componentDef.___component;
|
|
38
38
|
if (typeof tag === "string") {
|
|
39
39
|
if (renderBody) {
|
|
40
|
-
out.
|
|
40
|
+
out.___beginElementDynamic(
|
|
41
41
|
tag,
|
|
42
42
|
attrs,
|
|
43
43
|
key,
|
|
@@ -45,9 +45,9 @@ customEvents)
|
|
|
45
45
|
addEvents(componentDef, customEvents, props)
|
|
46
46
|
);
|
|
47
47
|
renderBody(out);
|
|
48
|
-
out.
|
|
48
|
+
out.___endElement();
|
|
49
49
|
} else {
|
|
50
|
-
out.
|
|
50
|
+
out.___elementDynamic(
|
|
51
51
|
tag,
|
|
52
52
|
attrs,
|
|
53
53
|
key,
|
|
@@ -71,16 +71,16 @@ customEvents)
|
|
|
71
71
|
var render = tag && tag.renderBody || tag;
|
|
72
72
|
|
|
73
73
|
// eslint-disable-next-line no-constant-condition
|
|
74
|
+
if ("MARKO_DEBUG") {
|
|
75
|
+
if (tag.renderer && tag.renderer.renderer) {
|
|
76
|
+
complain(
|
|
77
|
+
"An object with a 'renderer' was passed to the dynamic tag, but renderer was another template."
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
74
81
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (dynamicTag.bo_) {
|
|
83
|
-
renderer = dynamicTag.bo_(
|
|
82
|
+
if (dynamicTag.___runtimeCompat) {
|
|
83
|
+
renderer = dynamicTag.___runtimeCompat(
|
|
84
84
|
renderer,
|
|
85
85
|
render,
|
|
86
86
|
args,
|
|
@@ -91,31 +91,31 @@ customEvents)
|
|
|
91
91
|
if (renderer) {
|
|
92
92
|
out.c(componentDef, key, customEvents);
|
|
93
93
|
renderer(attrs, out);
|
|
94
|
-
out.
|
|
94
|
+
out.___assignedComponentDef = null;
|
|
95
95
|
} else {
|
|
96
96
|
var isFn = typeof render === "function";
|
|
97
97
|
|
|
98
98
|
// eslint-disable-next-line no-constant-condition
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
if ("MARKO_DEBUG") {
|
|
100
|
+
if (render.safeHTML || render.toHTML) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
"Using `<include(x)/>` or the `<${dynamic}/>` tags with a `{ safeHTML: ... }` object is no longer supported. Use the unescaped text placeholder syntax instead."
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
106
|
if (isFn) {
|
|
107
|
-
var flags = componentDef ? componentDef.
|
|
107
|
+
var flags = componentDef ? componentDef.___flags : 0;
|
|
108
108
|
var willRerender = flags & FLAG_WILL_RERENDER_IN_BROWSER;
|
|
109
109
|
var isW10NOOP = render === w10NOOP;
|
|
110
110
|
var preserve = IS_SERVER ? willRerender : isW10NOOP;
|
|
111
111
|
out.bf(key, component, preserve);
|
|
112
112
|
if (!isW10NOOP && isFn) {
|
|
113
113
|
var componentsContext = getComponentsContext(out);
|
|
114
|
-
var parentComponentDef = componentsContext.
|
|
115
|
-
var globalContext = componentsContext.
|
|
116
|
-
componentsContext.
|
|
114
|
+
var parentComponentDef = componentsContext.___componentDef;
|
|
115
|
+
var globalContext = componentsContext.___globalContext;
|
|
116
|
+
componentsContext.___componentDef = new ComponentDef(
|
|
117
117
|
component,
|
|
118
|
-
parentComponentDef.id + "-" + parentComponentDef.
|
|
118
|
+
parentComponentDef.id + "-" + parentComponentDef.___nextKey(key),
|
|
119
119
|
globalContext
|
|
120
120
|
);
|
|
121
121
|
render.toJSON = w10ToJSON;
|
|
@@ -126,7 +126,7 @@ customEvents)
|
|
|
126
126
|
render(out, attrs);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
componentsContext.
|
|
129
|
+
componentsContext.___componentDef = parentComponentDef;
|
|
130
130
|
}
|
|
131
131
|
out.ef();
|
|
132
132
|
} else {
|
|
@@ -140,7 +140,7 @@ customEvents)
|
|
|
140
140
|
component,
|
|
141
141
|
IS_SERVER &&
|
|
142
142
|
componentDef &&
|
|
143
|
-
componentDef.
|
|
143
|
+
componentDef.___flags & FLAG_WILL_RERENDER_IN_BROWSER
|
|
144
144
|
);
|
|
145
145
|
renderBody(out);
|
|
146
146
|
out.ef();
|
|
@@ -151,7 +151,7 @@ function attrsToCamelCase(attrs) {
|
|
|
151
151
|
var result = {};
|
|
152
152
|
|
|
153
153
|
for (var key in attrs) {
|
|
154
|
-
result[changeCase.
|
|
154
|
+
result[changeCase.___dashToCamelCase(key)] = attrs[key];
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
return result;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";const {
|
|
1
|
+
"use strict";const { ___componentLookup } = require("@internal/components-util");
|
|
2
2
|
const {
|
|
3
|
-
|
|
3
|
+
___getComponentsContext
|
|
4
4
|
} = require("../../components/ComponentsContext");
|
|
5
5
|
const defineComponent = require("../../components/defineComponent");
|
|
6
6
|
const { r: registerComponent } = require("../../components/registry");
|
|
7
7
|
const createRenderer = require("../../components/renderer");
|
|
8
8
|
const defaultCreateOut = require("../../createOut");
|
|
9
9
|
const morphdom = require("../../vdom/morphdom");
|
|
10
|
-
const {
|
|
10
|
+
const { ___createFragmentNode } = require("../../vdom/morphdom/fragment");
|
|
11
11
|
const dynamicTag = require("../dynamic-tag");
|
|
12
12
|
|
|
13
13
|
exports.p = function (domCompat) {
|
|
14
|
-
dynamicTag.
|
|
14
|
+
dynamicTag.___runtimeCompat = function tagsToVdom(
|
|
15
15
|
renderer,
|
|
16
16
|
renderBody,
|
|
17
17
|
args,
|
|
@@ -38,18 +38,18 @@ exports.p = function (domCompat) {
|
|
|
38
38
|
const tagsRenderer = domCompat.resolveRegistered(_.r, global);
|
|
39
39
|
const newNode = domCompat.render(out, component, tagsRenderer, input);
|
|
40
40
|
|
|
41
|
-
out.bf(out.
|
|
41
|
+
out.bf(out.___assignedKey, component, !newNode);
|
|
42
42
|
if (newNode) {
|
|
43
|
-
out.node({
|
|
43
|
+
out.node({ ___actualize: () => newNode });
|
|
44
44
|
}
|
|
45
45
|
out.ef();
|
|
46
46
|
},
|
|
47
47
|
// eslint-disable-next-line no-constant-condition
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
"MARKO_DEBUG" ?
|
|
49
|
+
{
|
|
50
|
+
t: TagsCompatId,
|
|
51
|
+
d: true
|
|
52
|
+
} :
|
|
53
53
|
{
|
|
54
54
|
t: TagsCompatId
|
|
55
55
|
},
|
|
@@ -103,12 +103,12 @@ exports.p = function (domCompat) {
|
|
|
103
103
|
if (!newRenderer) {
|
|
104
104
|
const { Component } = renderer;
|
|
105
105
|
if (Component) {
|
|
106
|
-
const setCustomEvents = Component.prototype.
|
|
107
|
-
Component.prototype.
|
|
106
|
+
const setCustomEvents = Component.prototype.___setCustomEvents;
|
|
107
|
+
Component.prototype.___setCustomEvents = function (
|
|
108
108
|
customEvents,
|
|
109
109
|
scopeId)
|
|
110
110
|
{
|
|
111
|
-
const global = this.
|
|
111
|
+
const global = this.___global;
|
|
112
112
|
for (const customEvent of customEvents) {
|
|
113
113
|
customEvent[1] = domCompat.resolveRegistered(
|
|
114
114
|
customEvent[1],
|
|
@@ -127,7 +127,7 @@ exports.p = function (domCompat) {
|
|
|
127
127
|
},
|
|
128
128
|
() => {
|
|
129
129
|
const realFragment = document.createDocumentFragment();
|
|
130
|
-
|
|
130
|
+
___createFragmentNode(null, null, realFragment);
|
|
131
131
|
return realFragment;
|
|
132
132
|
},
|
|
133
133
|
(scope, input) => {
|
|
@@ -150,17 +150,17 @@ exports.p = function (domCompat) {
|
|
|
150
150
|
let host = domCompat.getStartNode(scope);
|
|
151
151
|
let rootNode = host.fragment;
|
|
152
152
|
if (!rootNode) {
|
|
153
|
-
const component = scope.
|
|
154
|
-
|
|
155
|
-
rootNode = component.
|
|
153
|
+
const component = scope.___marko5Component =
|
|
154
|
+
___componentLookup[scope.m5c];
|
|
155
|
+
rootNode = component.___rootNode;
|
|
156
156
|
host = rootNode.startNode;
|
|
157
157
|
domCompat.setScopeNodes(host, rootNode.endNode);
|
|
158
158
|
}
|
|
159
|
-
const existingComponent = scope.
|
|
160
|
-
const componentsContext =
|
|
161
|
-
const globalComponentsContext = componentsContext.
|
|
159
|
+
const existingComponent = scope.___marko5Component;
|
|
160
|
+
const componentsContext = ___getComponentsContext(out);
|
|
161
|
+
const globalComponentsContext = componentsContext.___globalContext;
|
|
162
162
|
let customEvents;
|
|
163
|
-
globalComponentsContext.
|
|
163
|
+
globalComponentsContext.___rerenderComponent = existingComponent;
|
|
164
164
|
out.sync();
|
|
165
165
|
if (renderer) {
|
|
166
166
|
const [rawInput] = input;
|
|
@@ -185,16 +185,16 @@ exports.p = function (domCompat) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
domCompat.queueEffect(scope, () => {
|
|
188
|
-
const targetNode = out.
|
|
188
|
+
const targetNode = out.___getOutput().___firstChild;
|
|
189
189
|
morphdom(rootNode, targetNode, host, componentsContext);
|
|
190
|
-
const componentDefs = componentsContext.
|
|
190
|
+
const componentDefs = componentsContext.___initComponents(
|
|
191
191
|
getRootNode(host)
|
|
192
192
|
);
|
|
193
|
-
const component = componentDefs[0].
|
|
194
|
-
component.
|
|
195
|
-
component.
|
|
196
|
-
component.
|
|
197
|
-
scope.
|
|
193
|
+
const component = componentDefs[0].___component;
|
|
194
|
+
component.___rootNode = rootNode;
|
|
195
|
+
component.___input = input[0];
|
|
196
|
+
component.___customEvents = customEvents;
|
|
197
|
+
scope.___marko5Component = component;
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
|
|
@@ -219,12 +219,12 @@ exports.p = function (domCompat) {
|
|
|
219
219
|
);
|
|
220
220
|
},
|
|
221
221
|
// eslint-disable-next-line no-constant-condition
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
"MARKO_DEBUG" ?
|
|
223
|
+
{
|
|
224
|
+
t: RenderBodyComponentId,
|
|
225
|
+
i: true,
|
|
226
|
+
d: true
|
|
227
|
+
} :
|
|
228
228
|
{
|
|
229
229
|
t: RenderBodyComponentId,
|
|
230
230
|
i: true
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";const initComponentsTag = require("../../../core-tags/components/init-components-tag");
|
|
2
2
|
const {
|
|
3
|
-
|
|
3
|
+
___getComponentsContext
|
|
4
4
|
} = require("../../components/ComponentsContext");
|
|
5
5
|
const createRenderer = require("../../components/renderer");
|
|
6
6
|
const defaultCreateOut = require("../../createOut");
|
|
7
7
|
const dynamicTag5 = require("../dynamic-tag");
|
|
8
8
|
|
|
9
9
|
exports.p = function (htmlCompat) {
|
|
10
|
-
const isMarko6 = (fn) => !!fn.
|
|
11
|
-
const isMarko5 = (fn) => !fn.
|
|
10
|
+
const isMarko6 = (fn) => !!fn.___isTagsAPI;
|
|
11
|
+
const isMarko5 = (fn) => !fn.___isTagsAPI;
|
|
12
12
|
const writeHTML = (result) => {
|
|
13
13
|
const state = result.out._state;
|
|
14
14
|
const writer = state.writer;
|
|
15
|
-
state.events.emit("
|
|
15
|
+
state.events.emit("___toString", writer);
|
|
16
16
|
htmlCompat.writeScript(writer._scripts);
|
|
17
17
|
htmlCompat.write(writer._content);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
dynamicTag5.
|
|
20
|
+
dynamicTag5.___runtimeCompat = function tagsToVdom(
|
|
21
21
|
tagsRenderer,
|
|
22
22
|
renderBody,
|
|
23
23
|
args)
|
|
@@ -45,17 +45,17 @@ exports.p = function (htmlCompat) {
|
|
|
45
45
|
const input = _.i;
|
|
46
46
|
const tagsRenderer = _.r;
|
|
47
47
|
const willRerender = componentDef._wrr;
|
|
48
|
-
out.bf(out.
|
|
48
|
+
out.bf(out.___assignedKey, component, willRerender);
|
|
49
49
|
htmlCompat.render(tagsRenderer, willRerender, out, component, input);
|
|
50
50
|
out.ef();
|
|
51
51
|
},
|
|
52
52
|
// eslint-disable-next-line no-constant-condition
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
"MARKO_DEBUG" ?
|
|
54
|
+
{
|
|
55
|
+
t: TagsCompatId,
|
|
56
|
+
i: true,
|
|
57
|
+
d: true
|
|
58
|
+
} :
|
|
59
59
|
{
|
|
60
60
|
t: TagsCompatId,
|
|
61
61
|
i: true
|
|
@@ -101,10 +101,10 @@ exports.p = function (htmlCompat) {
|
|
|
101
101
|
renderBody5(out, input, ...args);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
const componentsContext =
|
|
105
|
-
const component = componentsContext.
|
|
104
|
+
const componentsContext = ___getComponentsContext(out);
|
|
105
|
+
const component = componentsContext.___components[0];
|
|
106
106
|
if (component) {
|
|
107
|
-
component.
|
|
107
|
+
component.___component.___customEvents = customEvents;
|
|
108
108
|
htmlCompat.writeSetScopeForComponent(component.id);
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -127,7 +127,7 @@ exports.p = function (htmlCompat) {
|
|
|
127
127
|
};
|
|
128
128
|
},
|
|
129
129
|
function createRenderer(renderFn) {
|
|
130
|
-
renderFn.
|
|
130
|
+
renderFn.___isTagsAPI = true;
|
|
131
131
|
return renderFn;
|
|
132
132
|
}
|
|
133
133
|
);
|
|
@@ -9,7 +9,7 @@ var markoAttr = require("./helpers/data-marko");
|
|
|
9
9
|
var escapeXmlHelper = require("./helpers/escape-xml");
|
|
10
10
|
var StringWriter = require("./StringWriter");
|
|
11
11
|
var escapeXmlOrNullish = escapeXmlHelper.x;
|
|
12
|
-
var escapeXmlString = escapeXmlHelper.
|
|
12
|
+
var escapeXmlString = escapeXmlHelper.___escapeXML;
|
|
13
13
|
var missingSetTimeout = typeof setTimeout !== "function";
|
|
14
14
|
|
|
15
15
|
function noop() {}
|
|
@@ -100,12 +100,12 @@ function AsyncStream(global, writer, parentOut) {
|
|
|
100
100
|
|
|
101
101
|
this._elStack = undefined; // Array
|
|
102
102
|
|
|
103
|
-
this.
|
|
103
|
+
this.___components = null; // ComponentsContext
|
|
104
104
|
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
105
|
+
this.___assignedComponentDef = null;
|
|
106
|
+
this.___assignedKey = null;
|
|
107
|
+
this.___assignedCustomEvents = null;
|
|
108
|
+
this.___isLast = false;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
AsyncStream.DEFAULT_TIMEOUT = 10000;
|
|
@@ -125,12 +125,12 @@ AsyncStream.enableAsyncStackTrace = function () {
|
|
|
125
125
|
|
|
126
126
|
var proto = AsyncStream.prototype = {
|
|
127
127
|
constructor: AsyncStream,
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
___host: typeof document === "object" && document,
|
|
129
|
+
___isOut: true,
|
|
130
130
|
|
|
131
131
|
[Symbol.asyncIterator]() {
|
|
132
|
-
if (this.
|
|
133
|
-
return this.
|
|
132
|
+
if (this.___iterator) {
|
|
133
|
+
return this.___iterator;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
const originalWriter = this._state.writer;
|
|
@@ -221,7 +221,7 @@ var proto = AsyncStream.prototype = {
|
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
return this.
|
|
224
|
+
return this.___iterator = {
|
|
225
225
|
next: iteratorNextFn,
|
|
226
226
|
return: iteratorReturnFn,
|
|
227
227
|
throw: iteratorReturnFn,
|
|
@@ -253,7 +253,7 @@ var proto = AsyncStream.prototype = {
|
|
|
253
253
|
return this;
|
|
254
254
|
},
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
___getOutput: function () {
|
|
257
257
|
return this._state.writer.toString();
|
|
258
258
|
},
|
|
259
259
|
|
|
@@ -261,14 +261,14 @@ var proto = AsyncStream.prototype = {
|
|
|
261
261
|
* Legacy...
|
|
262
262
|
*/
|
|
263
263
|
getOutput: function () {
|
|
264
|
-
return this.
|
|
264
|
+
return this.___getOutput();
|
|
265
265
|
},
|
|
266
266
|
|
|
267
267
|
toString: function () {
|
|
268
268
|
return this._state.writer.toString();
|
|
269
269
|
},
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
___getResult: function () {
|
|
272
272
|
this._result = this._result || new RenderResult(this);
|
|
273
273
|
return this._result;
|
|
274
274
|
},
|
|
@@ -319,7 +319,7 @@ var proto = AsyncStream.prototype = {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
this._lastCount++;
|
|
322
|
-
newStream.
|
|
322
|
+
newStream.___isLast = true;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
name = options.name;
|
|
@@ -367,7 +367,7 @@ var proto = AsyncStream.prototype = {
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
if (state.events !== state.stream) {
|
|
370
|
-
state.events.emit("finish", this.
|
|
370
|
+
state.events.emit("finish", this.___getResult());
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
373
|
|
|
@@ -439,7 +439,7 @@ var proto = AsyncStream.prototype = {
|
|
|
439
439
|
parentOut._handleChildDone(this);
|
|
440
440
|
}
|
|
441
441
|
} else {
|
|
442
|
-
if (childOut.
|
|
442
|
+
if (childOut.___isLast) {
|
|
443
443
|
this._lastCount--;
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -480,7 +480,7 @@ var proto = AsyncStream.prototype = {
|
|
|
480
480
|
var state = this._state;
|
|
481
481
|
|
|
482
482
|
if (event === "finish" && state.finished === true) {
|
|
483
|
-
callback(this.
|
|
483
|
+
callback(this.___getResult());
|
|
484
484
|
} else if (event === "last") {
|
|
485
485
|
this.onLast(callback);
|
|
486
486
|
} else {
|
|
@@ -494,7 +494,7 @@ var proto = AsyncStream.prototype = {
|
|
|
494
494
|
var state = this._state;
|
|
495
495
|
|
|
496
496
|
if (event === "finish" && state.finished === true) {
|
|
497
|
-
callback(this.
|
|
497
|
+
callback(this.___getResult());
|
|
498
498
|
} else if (event === "last") {
|
|
499
499
|
this.onLast(callback);
|
|
500
500
|
} else {
|
|
@@ -619,7 +619,7 @@ var proto = AsyncStream.prototype = {
|
|
|
619
619
|
return newOut;
|
|
620
620
|
},
|
|
621
621
|
|
|
622
|
-
|
|
622
|
+
___elementDynamic: function (
|
|
623
623
|
tagName,
|
|
624
624
|
elementAttrs,
|
|
625
625
|
key,
|
|
@@ -658,7 +658,7 @@ var proto = AsyncStream.prototype = {
|
|
|
658
658
|
this.write(str);
|
|
659
659
|
},
|
|
660
660
|
|
|
661
|
-
|
|
661
|
+
___beginElementDynamic: function (
|
|
662
662
|
name,
|
|
663
663
|
elementAttrs,
|
|
664
664
|
key,
|
|
@@ -724,14 +724,14 @@ var proto = AsyncStream.prototype = {
|
|
|
724
724
|
}
|
|
725
725
|
},
|
|
726
726
|
|
|
727
|
-
|
|
727
|
+
___getNode: function (host) {
|
|
728
728
|
var node = this._node;
|
|
729
729
|
|
|
730
730
|
if (!node) {
|
|
731
731
|
var nextEl;
|
|
732
732
|
var fragment;
|
|
733
|
-
var html = this.
|
|
734
|
-
if (!host) host = this.
|
|
733
|
+
var html = this.___getOutput();
|
|
734
|
+
if (!host) host = this.___host;
|
|
735
735
|
var doc = host.ownerDocument || host;
|
|
736
736
|
|
|
737
737
|
if (html) {
|
|
@@ -776,15 +776,15 @@ var proto = AsyncStream.prototype = {
|
|
|
776
776
|
},
|
|
777
777
|
|
|
778
778
|
c: function (componentDef, key, customEvents) {
|
|
779
|
-
this.
|
|
780
|
-
this.
|
|
781
|
-
this.
|
|
779
|
+
this.___assignedComponentDef = componentDef;
|
|
780
|
+
this.___assignedKey = key;
|
|
781
|
+
this.___assignedCustomEvents = customEvents;
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
784
|
|
|
785
785
|
// alias:
|
|
786
786
|
proto.w = proto.write;
|
|
787
|
-
proto.
|
|
787
|
+
proto.___endElement = proto.endElement;
|
|
788
788
|
|
|
789
789
|
module.exports = AsyncStream;
|
|
790
790
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const immediate = require("@internal/set-immediate");
|
|
4
|
-
const setImmediate = immediate.
|
|
5
|
-
const clearImmediate = immediate.
|
|
4
|
+
const setImmediate = immediate.___setImmediate;
|
|
5
|
+
const clearImmediate = immediate.___clearImmediate;
|
|
6
6
|
const StringWriter = require("./StringWriter");
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var escapeDoubleQuotes =
|
|
4
|
-
require("./helpers/escape-quotes").
|
|
4
|
+
require("./helpers/escape-quotes").___escapeDoubleQuotes;
|
|
5
5
|
|
|
6
6
|
function StringWriter() {
|
|
7
7
|
this._content = "";
|
|
@@ -56,7 +56,7 @@ StringWriter.prototype = {
|
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
toString: function () {
|
|
59
|
-
this.state.events.emit("
|
|
59
|
+
this.state.events.emit("___toString", this);
|
|
60
60
|
let str = this._content;
|
|
61
61
|
if (this._scripts) {
|
|
62
62
|
const outGlobal = this.state.root.global;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var attrHelper = require("./attr");
|
|
3
|
-
var notEmptyAttr = attrHelper.
|
|
4
|
-
var isEmptyAttrValue = attrHelper.
|
|
3
|
+
var notEmptyAttr = attrHelper.___notEmptyAttr;
|
|
4
|
+
var isEmptyAttrValue = attrHelper.___isEmptyAttrValue;
|
|
5
5
|
var classHelper = require("./class-attr");
|
|
6
6
|
var styleHelper = require("./style-attr");
|
|
7
7
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var escapeQuoteHelpers = require("./escape-quotes");
|
|
4
|
-
var escapeDoubleQuotes = escapeQuoteHelpers.
|
|
5
|
-
var escapeSingleQuotes = escapeQuoteHelpers.
|
|
4
|
+
var escapeDoubleQuotes = escapeQuoteHelpers.___escapeDoubleQuotes;
|
|
5
|
+
var escapeSingleQuotes = escapeQuoteHelpers.___escapeSingleQuotes;
|
|
6
6
|
// eslint-disable-next-line no-constant-binary-expression
|
|
7
|
-
|
|
7
|
+
var complain = "MARKO_DEBUG" && require("complain");
|
|
8
8
|
|
|
9
9
|
module.exports = maybeEmptyAttr;
|
|
10
10
|
|
|
11
|
-
maybeEmptyAttr.
|
|
12
|
-
maybeEmptyAttr.
|
|
11
|
+
maybeEmptyAttr.___notEmptyAttr = notEmptyAttr;
|
|
12
|
+
maybeEmptyAttr.___isEmptyAttrValue = isEmpty;
|
|
13
13
|
|
|
14
14
|
function maybeEmptyAttr(name, value) {
|
|
15
15
|
if (isEmpty(value)) {
|
|
@@ -32,12 +32,12 @@ function notEmptyAttr(name, value) {
|
|
|
32
32
|
case Object.prototype.toString:
|
|
33
33
|
case Array.prototype.toString:
|
|
34
34
|
// eslint-disable-next-line no-constant-condition
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
if ("MARKO_DEBUG") {
|
|
36
|
+
complain(
|
|
37
|
+
"Relying on JSON.stringify for attribute values is deprecated, in future versions of Marko these will be cast to strings instead.",
|
|
38
|
+
{ locationIndex: 2 }
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
41
|
|
|
42
42
|
return " " + name + singleQuote(JSON.stringify(value), 2);
|
|
43
43
|
case RegExp.prototype.toString:
|