marko 4.25.0 → 4.26.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/bin/markoc.js +18 -18
- package/dist/compiler/CompileContext.js +3 -8
- package/dist/core-tags/components/init-components-tag.js +1 -52
- package/dist/core-tags/components/package.json +1 -3
- package/dist/core-tags/components/preferred-script-location-tag.js +2 -2
- package/dist/core-tags/components/preserve-tag.js +1 -27
- package/dist/core-tags/core/await/AsyncValue.js +20 -20
- package/dist/core-tags/core/await/renderer.js +11 -12
- package/dist/core-tags/core/await/reorderer-renderer.js +11 -6
- package/dist/index.js +1 -39
- package/dist/node-require/index.js +11 -0
- package/dist/node_modules/@internal/components-beginComponent/index-browser.js +12 -0
- package/dist/{runtime/components/beginComponent.js → node_modules/@internal/components-beginComponent/index.js} +14 -14
- package/dist/node_modules/@internal/components-beginComponent/package.json +11 -0
- package/dist/{runtime/components/legacy/defineWidget-legacy-browser.js → node_modules/@internal/components-define-widget-legacy/index-browser.js} +47 -47
- package/dist/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/dist/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/dist/node_modules/@internal/components-endComponent/index.js +11 -0
- package/dist/node_modules/@internal/components-endComponent/package.json +11 -0
- package/dist/node_modules/@internal/components-entry/index-browser.js +9 -0
- package/dist/node_modules/@internal/components-entry/index.js +285 -0
- package/dist/node_modules/@internal/components-entry/package.json +11 -0
- package/dist/{runtime/components/legacy → node_modules/@internal/components-entry-legacy}/index-browser.js +14 -15
- package/dist/node_modules/@internal/components-entry-legacy/index.js +14 -0
- package/dist/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/dist/{runtime/components/init-components-browser.js → node_modules/@internal/components-registry/index-browser.js} +180 -79
- package/dist/node_modules/@internal/components-registry/index.js +34 -0
- package/dist/node_modules/@internal/components-registry/package.json +11 -0
- package/dist/{runtime/components/util-browser.js → node_modules/@internal/components-util/index-browser.js} +23 -24
- package/dist/{runtime/components/util.js → node_modules/@internal/components-util/index.js} +10 -12
- package/dist/node_modules/@internal/components-util/package.json +11 -0
- package/dist/node_modules/@internal/create-readable/index-browser.js +25 -0
- package/dist/node_modules/@internal/create-readable/index.js +52 -0
- package/dist/node_modules/@internal/create-readable/package.json +11 -0
- package/dist/node_modules/@internal/init-components-tag/index.js +52 -0
- package/dist/node_modules/@internal/init-components-tag/package.json +11 -0
- package/dist/{loader/index-default.js → node_modules/@internal/loader/index.js} +1 -1
- package/dist/node_modules/@internal/loader/package.json +11 -0
- package/dist/{core-tags/components/preserve-tag-browser.js → node_modules/@internal/preserve-tag/index-browser.js} +8 -8
- package/dist/node_modules/@internal/preserve-tag/index.js +27 -0
- package/dist/node_modules/@internal/preserve-tag/package.json +11 -0
- package/dist/node_modules/@internal/set-immediate/index-browser.js +17 -0
- package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -0
- package/dist/node_modules/@internal/set-immediate/index.js +2 -0
- package/dist/node_modules/@internal/set-immediate/package.json +11 -0
- package/dist/runtime/RenderResult.js +24 -19
- package/dist/runtime/components/Component.js +154 -151
- package/dist/runtime/components/ComponentDef.js +28 -28
- package/dist/runtime/components/ComponentsContext.js +19 -19
- package/dist/runtime/components/GlobalComponentsContext.js +4 -4
- package/dist/runtime/components/KeySequence.js +3 -3
- package/dist/runtime/components/ServerComponent.js +13 -13
- package/dist/runtime/components/State.js +28 -28
- package/dist/runtime/components/attach-detach.js +9 -9
- package/dist/runtime/components/defineComponent.js +5 -5
- package/dist/runtime/components/dom-data.js +6 -6
- package/dist/runtime/components/event-delegation.js +15 -16
- package/dist/runtime/components/index.js +1 -285
- package/dist/runtime/components/legacy/browser.json +1 -1
- package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
- package/dist/runtime/components/legacy/defineRenderer-legacy.js +18 -19
- package/dist/runtime/components/legacy/defineWidget-legacy.js +1 -18
- package/dist/runtime/components/legacy/dependencies/html.js +1 -1
- package/dist/runtime/components/legacy/dependencies/index.js +9 -9
- package/dist/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
- package/dist/runtime/components/legacy/index.js +1 -14
- package/dist/runtime/components/legacy/renderer-legacy.js +43 -43
- package/dist/runtime/components/registry.js +1 -34
- package/dist/runtime/components/renderer.js +38 -38
- package/dist/runtime/components/update-manager.js +10 -10
- package/dist/runtime/createOut.js +1 -1
- package/dist/runtime/dom-insert.js +6 -6
- package/dist/runtime/helpers/_change-case.js +2 -2
- package/dist/runtime/helpers/assign.js +3 -2
- package/dist/runtime/helpers/dynamic-tag.js +14 -16
- package/dist/runtime/helpers/load-template.js +1 -1
- package/dist/runtime/helpers/merge.js +3 -1
- package/dist/runtime/helpers/style-value.js +2 -2
- package/dist/runtime/html/AsyncStream.js +61 -52
- package/dist/runtime/html/BufferedWriter.js +5 -1
- package/dist/runtime/html/StringWriter.js +7 -3
- package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
- package/dist/runtime/html/helpers/attr.js +4 -4
- package/dist/runtime/html/helpers/attrs.js +3 -3
- package/dist/runtime/html/helpers/data-marko.js +4 -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/props-script.js +1 -1
- package/dist/runtime/html/index.js +15 -12
- package/dist/runtime/renderable.js +5 -5
- package/dist/runtime/vdom/AsyncVDOMBuilder.js +102 -103
- 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 +55 -54
- package/dist/runtime/vdom/VFragment.js +9 -9
- package/dist/runtime/vdom/VNode.js +30 -30
- package/dist/runtime/vdom/VText.js +7 -7
- package/dist/runtime/vdom/helpers/v-element.js +1 -1
- package/dist/runtime/vdom/helpers/v-text.js +1 -1
- package/dist/runtime/vdom/index.js +12 -22
- package/dist/runtime/vdom/morphdom/fragment.js +5 -5
- package/dist/runtime/vdom/morphdom/helpers.js +3 -3
- package/dist/runtime/vdom/morphdom/index.js +72 -68
- package/dist/runtime/vdom/morphdom/specialElHandlers.js +8 -8
- package/dist/runtime/vdom/preserve-attrs.js +1 -1
- package/dist/runtime/vdom/vdom.js +19 -21
- package/docs/body-content.md +2 -2
- package/docs/class-components.md +3 -3
- package/docs/express.md +1 -1
- package/docs/lasso.md +3 -6
- package/docs/marko-v4.md +5 -5
- package/docs/redux.md +1 -1
- package/docs/server-side-rendering.md +2 -2
- package/docs/why-is-marko-fast.md +2 -10
- package/package.json +1 -1
- package/src/browser-refresh.js +2 -2
- package/src/compiler/CodeWriter.js +1 -3
- package/src/compiler/CompileContext.js +3 -8
- package/src/compiler/Compiler.js +4 -4
- package/src/compiler/HtmlJsParser.js +1 -1
- package/src/compiler/Migrator.js +1 -1
- package/src/compiler/Parser.js +3 -3
- package/src/compiler/ast/CustomTag.js +9 -11
- package/src/compiler/ast/HtmlAttribute/html/generateCode.js +2 -2
- package/src/compiler/ast/HtmlAttribute/index.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js +1 -1
- package/src/compiler/ast/HtmlElement/vdom/generateCode.js +1 -1
- package/src/compiler/ast/TemplateRoot.js +1 -1
- package/src/compiler/ast/Text/html/generateCode.js +3 -3
- package/src/compiler/ast/Text/vdom/generateCode.js +1 -1
- package/src/compiler/index.js +4 -4
- package/src/compiler/modules.js +4 -4
- package/src/compiler/util/finger-print.js +1 -1
- package/src/compiler/util/parseExpression.js +1 -1
- package/src/compiler/util/parseStatement.js +1 -1
- package/src/compiler/util/removeDashes.js +1 -1
- package/src/compiler/util/safeVarName.js +1 -1
- package/src/compiler/util/tokenizer.js +1 -1
- package/src/core-tags/cache/cached-fragment-tag-transformer.js +1 -1
- package/src/core-tags/cache/cached-fragment-tag.js +4 -4
- package/src/core-tags/cache/default-cache-manager.js +3 -3
- package/src/core-tags/components/TransformHelper/ComponentArgsCompiler.js +1 -1
- package/src/core-tags/components/TransformHelper/convertToComponent.js +1 -1
- package/src/core-tags/components/TransformHelper/handleComponentPreserveAttrs.js +1 -1
- package/src/core-tags/components/init-components-tag.js +1 -54
- package/src/core-tags/components/package.json +1 -3
- package/src/core-tags/components/preferred-script-location-tag.js +1 -1
- package/src/core-tags/components/preserve-tag.js +1 -27
- package/src/core-tags/components/util/getTransformHelper.js +1 -1
- package/src/core-tags/core/await/AsyncValue.js +3 -3
- package/src/core-tags/core/await/noop-render.js +1 -1
- package/src/core-tags/core/await/renderer.js +8 -7
- package/src/core-tags/core/await/reorderer-renderer.js +35 -14
- package/src/core-tags/core/await/transformer.js +1 -1
- package/src/core-tags/core/core-transformer.js +2 -2
- package/src/core-tags/migrate/all-tags/index.js +1 -1
- package/src/core-tags/migrate/all-templates/index.js +1 -1
- package/src/core-tags/migrate/include-tag.js +3 -2
- package/src/core-tags/migrate/util/parseFor.js +3 -2
- package/src/core-tags/migrate/util/printJS.js +1 -1
- package/src/defineRenderer.js +1 -1
- package/src/express.js +1 -1
- package/src/hot-reload.js +5 -5
- package/src/index.js +1 -41
- package/src/legacy-helpers/notEmpty.js +1 -1
- package/src/node-require/index.js +12 -1
- package/src/{runtime/components/beginComponent-browser.js → node_modules/@internal/components-beginComponent/index-browser.js} +1 -1
- package/src/{runtime/components/beginComponent.js → node_modules/@internal/components-beginComponent/index.js} +2 -2
- package/src/node_modules/@internal/components-beginComponent/package.json +11 -0
- package/src/{runtime/components/legacy/defineWidget-legacy-browser.js → node_modules/@internal/components-define-widget-legacy/index-browser.js} +21 -23
- package/src/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
- package/src/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
- package/src/{runtime/components/endComponent.js → node_modules/@internal/components-endComponent/index.js} +1 -1
- package/src/node_modules/@internal/components-endComponent/package.json +11 -0
- package/src/node_modules/@internal/components-entry/index-browser.js +9 -0
- package/src/node_modules/@internal/components-entry/index.js +301 -0
- package/src/node_modules/@internal/components-entry/package.json +11 -0
- package/src/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
- package/src/node_modules/@internal/components-entry-legacy/index.js +15 -0
- package/src/node_modules/@internal/components-entry-legacy/package.json +11 -0
- package/src/{runtime/components/init-components-browser.js → node_modules/@internal/components-registry/index-browser.js} +240 -75
- package/src/node_modules/@internal/components-registry/index.js +44 -0
- package/src/node_modules/@internal/components-registry/package.json +11 -0
- package/src/{runtime/components/util-browser.js → node_modules/@internal/components-util/index-browser.js} +11 -10
- package/src/{runtime/components/util.js → node_modules/@internal/components-util/index.js} +0 -2
- package/src/node_modules/@internal/components-util/package.json +11 -0
- package/src/node_modules/@internal/create-readable/index-browser.js +30 -0
- package/src/node_modules/@internal/create-readable/index.js +57 -0
- package/src/node_modules/@internal/create-readable/package.json +11 -0
- package/src/node_modules/@internal/init-components-tag/index.js +54 -0
- package/src/node_modules/@internal/init-components-tag/package.json +11 -0
- package/src/{loader/index-default.js → node_modules/@internal/loader/index.js} +2 -2
- package/src/node_modules/@internal/loader/package.json +11 -0
- package/src/node_modules/@internal/preserve-tag/index.js +27 -0
- package/src/node_modules/@internal/preserve-tag/package.json +11 -0
- package/src/node_modules/@internal/set-immediate/index-browser.js +17 -0
- package/src/node_modules/@internal/set-immediate/index-worker.js +2 -0
- package/src/node_modules/@internal/set-immediate/index.js +2 -0
- package/src/node_modules/@internal/set-immediate/package.json +11 -0
- package/src/runtime/RenderResult.js +20 -18
- package/src/runtime/components/Component.js +44 -41
- package/src/runtime/components/ComponentDef.js +9 -9
- package/src/runtime/components/ComponentsContext.js +4 -5
- package/src/runtime/components/GlobalComponentsContext.js +2 -1
- package/src/runtime/components/KeySequence.js +1 -1
- package/src/runtime/components/State.js +6 -6
- package/src/runtime/components/attach-detach.js +4 -4
- package/src/runtime/components/defineComponent.js +1 -1
- package/src/runtime/components/event-delegation.js +10 -10
- package/src/runtime/components/index.js +1 -301
- package/src/runtime/components/jquery.js +2 -2
- package/src/runtime/components/legacy/browser.json +1 -1
- package/src/runtime/components/legacy/defineRenderer-legacy.js +5 -6
- package/src/runtime/components/legacy/defineWidget-legacy.js +1 -18
- package/src/runtime/components/legacy/dependencies/html.js +1 -1
- package/src/runtime/components/legacy/dependencies/index.js +3 -3
- package/src/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
- package/src/runtime/components/legacy/index.js +1 -15
- package/src/runtime/components/legacy/renderer-legacy.js +7 -7
- package/src/runtime/components/ready.js +2 -2
- package/src/runtime/components/registry.js +1 -44
- package/src/runtime/components/renderer.js +4 -4
- package/src/runtime/components/update-manager.js +1 -1
- package/src/runtime/dom-insert.js +8 -8
- package/src/runtime/helpers/_weak-map.js +2 -2
- package/src/runtime/helpers/assign.js +3 -1
- package/src/runtime/helpers/bind-component.js +2 -2
- package/src/runtime/helpers/dynamic-tag.js +2 -4
- package/src/runtime/helpers/for-in.js +1 -1
- package/src/runtime/helpers/load-nested-tag.js +1 -1
- package/src/runtime/helpers/load-template.js +1 -1
- package/src/runtime/helpers/merge.js +3 -1
- package/src/runtime/helpers/noop.js +1 -1
- package/src/runtime/helpers/style-value.js +1 -1
- package/src/runtime/helpers/to-string.js +1 -1
- package/src/runtime/html/AsyncStream.js +90 -76
- package/src/runtime/html/BufferedWriter.js +6 -2
- package/src/runtime/html/StringWriter.js +15 -9
- package/src/runtime/html/helpers/attrs.js +3 -3
- package/src/runtime/html/helpers/data-marko.js +0 -2
- package/src/runtime/html/helpers/escape-quotes.js +1 -1
- package/src/runtime/html/helpers/escape-xml.js +1 -1
- package/src/runtime/html/index.js +23 -13
- package/src/runtime/queueMicrotask.js +2 -2
- package/src/runtime/renderable.js +9 -9
- package/src/runtime/vdom/AsyncVDOMBuilder.js +46 -51
- package/src/runtime/vdom/VComment.js +3 -3
- package/src/runtime/vdom/VDocumentFragment.js +3 -3
- package/src/runtime/vdom/VElement.js +17 -13
- package/src/runtime/vdom/VFragment.js +1 -1
- package/src/runtime/vdom/VNode.js +2 -2
- package/src/runtime/vdom/VText.js +3 -3
- package/src/runtime/vdom/helpers/attrs.js +1 -1
- package/src/runtime/vdom/helpers/const.js +2 -2
- package/src/runtime/vdom/helpers/v-element.js +1 -1
- package/src/runtime/vdom/helpers/v-text.js +1 -1
- package/src/runtime/vdom/index.js +21 -23
- package/src/runtime/vdom/morphdom/fragment.js +8 -7
- package/src/runtime/vdom/morphdom/index.js +19 -9
- package/src/runtime/vdom/morphdom/specialElHandlers.js +6 -6
- package/src/runtime/vdom/parse-html.js +4 -4
- package/src/runtime/vdom/preserve-attrs.js +1 -1
- package/src/runtime/vdom/vdom.js +5 -7
- package/src/taglib/taglib-finder/index.js +1 -1
- package/src/taglib/taglib-loader/Tag.js +5 -5
- package/src/taglib/taglib-loader/Taglib.js +2 -2
- package/src/taglib/taglib-loader/json-file-reader.js +1 -1
- package/src/taglib/taglib-loader/loadAttributeFromProps.js +1 -1
- package/src/taglib/taglib-loader/loadTagFromProps.js +5 -6
- package/src/taglib/taglib-loader/tag-def-from-code.js +2 -1
- package/src/taglib/taglib-lookup/TaglibLookup.js +2 -2
- package/src/taglib/taglib-lookup/index.js +1 -1
- package/dist/core-tags/core/await/client-reorder-browser.js +0 -1
- package/dist/core-tags/core/await/client-reorder-runtime.min.js +0 -5
- package/dist/core-tags/core/await/client-reorder.js +0 -11
- package/dist/core-tags/core/await/package.json +0 -6
- package/dist/index-browser.js +0 -4
- package/dist/loader/index.js +0 -7
- package/dist/loader/package.json +0 -5
- package/dist/node-require/index-browser.js +0 -1
- package/dist/package.json +0 -5
- package/dist/runtime/components/beginComponent-browser.js +0 -12
- package/dist/runtime/components/endComponent.js +0 -11
- package/dist/runtime/components/index-browser.js +0 -14
- package/dist/runtime/components/init-components.js +0 -1
- package/dist/runtime/components/legacy/package.json +0 -6
- package/dist/runtime/components/package.json +0 -12
- package/dist/runtime/components/registry-browser.js +0 -73
- package/dist/runtime/html/Template.js +0 -63
- package/dist/runtime/package.json +0 -5
- package/dist/runtime/setImmediate.js +0 -19
- package/src/core-tags/core/await/client-reorder-browser.js +0 -1
- package/src/core-tags/core/await/client-reorder-runtime.min.js +0 -1
- package/src/core-tags/core/await/client-reorder.js +0 -14
- package/src/core-tags/core/await/package.json +0 -6
- package/src/index-browser.js +0 -3
- package/src/loader/index.js +0 -7
- package/src/loader/package.json +0 -5
- package/src/node-require/index-browser.js +0 -1
- package/src/package.json +0 -5
- package/src/runtime/components/index-browser.js +0 -15
- package/src/runtime/components/init-components.js +0 -1
- package/src/runtime/components/legacy/index-browser.js +0 -73
- package/src/runtime/components/legacy/package.json +0 -6
- package/src/runtime/components/package.json +0 -12
- package/src/runtime/components/registry-browser.js +0 -103
- package/src/runtime/html/Template.js +0 -62
- package/src/runtime/package.json +0 -5
- package/src/runtime/setImmediate.js +0 -21
- /package/dist/{runtime/components/endComponent-browser.js → node_modules/@internal/components-endComponent/index-browser.js} +0 -0
- /package/dist/{core-tags/components/init-components-tag-browser.js → node_modules/@internal/init-components-tag/index-browser.js} +0 -0
- /package/dist/{loader → node_modules/@internal/loader}/index-browser.js +0 -0
- /package/src/{runtime/components/endComponent-browser.js → node_modules/@internal/components-endComponent/index-browser.js} +0 -0
- /package/src/{core-tags/components/init-components-tag-browser.js → node_modules/@internal/init-components-tag/index-browser.js} +0 -0
- /package/src/{loader → node_modules/@internal/loader}/index-browser.js +0 -0
- /package/src/{core-tags/components/preserve-tag-browser.js → node_modules/@internal/preserve-tag/index-browser.js} +0 -0
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var complain;
|
|
4
4
|
var domData = require("../components/dom-data");
|
|
5
|
-
var componentsUtil = require("
|
|
6
|
-
var vElementByDOMNode = domData.
|
|
5
|
+
var componentsUtil = require("@internal/components-util");
|
|
6
|
+
var vElementByDOMNode = domData._L_;
|
|
7
7
|
var VNode = require("./VNode");
|
|
8
8
|
var inherit = require("raptor-util/inherit");
|
|
9
9
|
var ATTR_XLINK_HREF = "xlink:href";
|
|
10
10
|
var xmlnsRegExp = /^xmlns(:|$)/;
|
|
11
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11
12
|
var NS_XLINK = "http://www.w3.org/1999/xlink";
|
|
12
13
|
var NS_HTML = "http://www.w3.org/1999/xhtml";
|
|
13
14
|
var NS_MATH = "http://www.w3.org/1998/Math/MathML";
|
|
@@ -46,7 +47,7 @@ function convertAttrValue(type, value) {
|
|
|
46
47
|
|
|
47
48
|
function assign(a, b) {
|
|
48
49
|
for (var key in b) {
|
|
49
|
-
if (
|
|
50
|
+
if (hasOwnProperty.call(b, key)) {
|
|
50
51
|
a[key] = b[key];
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -69,21 +70,21 @@ function removeAttribute(el, namespaceURI, name) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
function VElementClone(other) {
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
73
|
+
this.cb_ = other.cb_;
|
|
74
|
+
this.bZ_ = null;
|
|
75
|
+
this.c__ = null;
|
|
75
76
|
|
|
76
|
-
this.bS_ = other.bS_;
|
|
77
|
-
this.bX_ = other.bX_;
|
|
78
|
-
this.aV_ = other.aV_;
|
|
79
77
|
this.bY_ = other.bY_;
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
78
|
+
this.cc_ = other.cc_;
|
|
79
|
+
this._P_ = other._P_;
|
|
80
|
+
this.cd_ = other.cd_;
|
|
81
|
+
this.x_ = other.x_;
|
|
82
|
+
this.ce_ = other.ce_;
|
|
83
|
+
this.cf_ = other.cf_;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
function VElement(tagName, attrs, key, ownerComponent, childCount, flags, props) {
|
|
86
|
-
this.
|
|
87
|
+
this.bV_(childCount, ownerComponent);
|
|
87
88
|
|
|
88
89
|
var constId;
|
|
89
90
|
|
|
@@ -91,19 +92,19 @@ function VElement(tagName, attrs, key, ownerComponent, childCount, flags, props)
|
|
|
91
92
|
constId = props.i;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
95
|
+
this.bY_ = key;
|
|
96
|
+
this.x_ = flags || 0;
|
|
97
|
+
this.cc_ = attrs || EMPTY_OBJECT;
|
|
98
|
+
this._P_ = props || EMPTY_OBJECT;
|
|
99
|
+
this.cd_ = tagName;
|
|
100
|
+
this.ce_ = null;
|
|
101
|
+
this.cf_ = constId;
|
|
102
|
+
this.ae_ = false;
|
|
103
|
+
this.ad_ = false;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
VElement.prototype = {
|
|
106
|
-
|
|
107
|
+
bX_: 1,
|
|
107
108
|
|
|
108
109
|
__: function () {
|
|
109
110
|
return new VElementClone(this);
|
|
@@ -117,10 +118,10 @@ VElement.prototype = {
|
|
|
117
118
|
* @param {int|null} childCount The number of child nodes (or `null` if not known)
|
|
118
119
|
*/
|
|
119
120
|
e: function (tagName, attrs, key, ownerComponent, childCount, flags, props) {
|
|
120
|
-
var child = this.
|
|
121
|
+
var child = this.bO_(new VElement(tagName, attrs, key, ownerComponent, childCount, flags, props));
|
|
121
122
|
|
|
122
123
|
if (childCount === 0) {
|
|
123
|
-
return this.
|
|
124
|
+
return this.cg_();
|
|
124
125
|
} else {
|
|
125
126
|
return child;
|
|
126
127
|
}
|
|
@@ -134,18 +135,18 @@ VElement.prototype = {
|
|
|
134
135
|
*/
|
|
135
136
|
n: function (node, ownerComponent) {
|
|
136
137
|
node = node.__();
|
|
137
|
-
node.
|
|
138
|
-
this.
|
|
139
|
-
return this.
|
|
138
|
+
node._N_ = ownerComponent;
|
|
139
|
+
this.bO_(node);
|
|
140
|
+
return this.cg_();
|
|
140
141
|
},
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
var tagName = this.
|
|
144
|
-
var attributes = this.
|
|
143
|
+
bU_: function (host, parentNamespaceURI) {
|
|
144
|
+
var tagName = this.cd_;
|
|
145
|
+
var attributes = this.cc_;
|
|
145
146
|
var namespaceURI = DEFAULT_NS[tagName] || parentNamespaceURI || NS_HTML;
|
|
146
147
|
|
|
147
|
-
var flags = this.
|
|
148
|
-
var el =
|
|
148
|
+
var flags = this.x_;
|
|
149
|
+
var el = (host.ownerDocument || host).createElementNS(namespaceURI, tagName);
|
|
149
150
|
|
|
150
151
|
if (flags & FLAG_CUSTOM_ELEMENT) {
|
|
151
152
|
assign(el, attributes);
|
|
@@ -171,7 +172,7 @@ VElement.prototype = {
|
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
if (tagName === "textarea") {
|
|
174
|
-
el.defaultValue = el.value = this.
|
|
175
|
+
el.defaultValue = el.value = this.g_;
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
|
|
@@ -180,11 +181,11 @@ VElement.prototype = {
|
|
|
180
181
|
return el;
|
|
181
182
|
},
|
|
182
183
|
|
|
183
|
-
|
|
184
|
+
ch_: function (name) {
|
|
184
185
|
// We don't care about the namespaces since the there
|
|
185
186
|
// is no chance that attributes with the same name will have
|
|
186
187
|
// different namespaces
|
|
187
|
-
var value = this.
|
|
188
|
+
var value = this.cc_[name];
|
|
188
189
|
return value != null && value !== false;
|
|
189
190
|
}
|
|
190
191
|
};
|
|
@@ -196,23 +197,23 @@ var proto = VElementClone.prototype = VElement.prototype;
|
|
|
196
197
|
["checked", "selected", "disabled"].forEach(function (name) {
|
|
197
198
|
defineProperty(proto, name, {
|
|
198
199
|
get: function () {
|
|
199
|
-
var value = this.
|
|
200
|
+
var value = this.cc_[name];
|
|
200
201
|
return value !== false && value != null;
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
});
|
|
204
205
|
|
|
205
|
-
defineProperty(proto, "
|
|
206
|
+
defineProperty(proto, "g_", {
|
|
206
207
|
get: function () {
|
|
207
|
-
var value = this.
|
|
208
|
+
var value = this.ce_;
|
|
208
209
|
if (value == null) {
|
|
209
|
-
value = this.
|
|
210
|
+
value = this.cc_.value;
|
|
210
211
|
}
|
|
211
|
-
return value != null && value !== false ? value + "" : this.
|
|
212
|
+
return value != null && value !== false ? value + "" : this.cc_.type === "checkbox" || this.cc_.type === "radio" ? "on" : "";
|
|
212
213
|
}
|
|
213
214
|
});
|
|
214
215
|
|
|
215
|
-
VElement.
|
|
216
|
+
VElement.ci_ = function (attrs) {
|
|
216
217
|
// By default this static method is a no-op, but if there are any
|
|
217
218
|
// compiled components that have "no-update" attributes then
|
|
218
219
|
// `preserve-attrs.js` will be imported and this method will be replaced
|
|
@@ -234,7 +235,7 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
234
235
|
var attrName = attr.name;
|
|
235
236
|
if (!xmlnsRegExp.test(attrName)) {
|
|
236
237
|
if (attrName === "data-marko") {
|
|
237
|
-
props = componentsUtil.
|
|
238
|
+
props = componentsUtil._r_(node);
|
|
238
239
|
} else if (attr.namespaceURI === NS_XLINK) {
|
|
239
240
|
attrs[ATTR_XLINK_HREF] = attr.value;
|
|
240
241
|
} else {
|
|
@@ -255,8 +256,8 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
255
256
|
, 0 /*flags*/
|
|
256
257
|
, props);
|
|
257
258
|
|
|
258
|
-
if (vdomEl.
|
|
259
|
-
vdomEl.
|
|
259
|
+
if (vdomEl.cd_ === "textarea") {
|
|
260
|
+
vdomEl.ce_ = node.value;
|
|
260
261
|
} else if (virtualizeChildNodes) {
|
|
261
262
|
virtualizeChildNodes(node, vdomEl, ownerComponent);
|
|
262
263
|
}
|
|
@@ -264,18 +265,18 @@ function virtualizeElement(node, virtualizeChildNodes, ownerComponent) {
|
|
|
264
265
|
return vdomEl;
|
|
265
266
|
}
|
|
266
267
|
|
|
267
|
-
VElement.
|
|
268
|
+
VElement.cj_ = virtualizeElement;
|
|
268
269
|
|
|
269
|
-
VElement.
|
|
270
|
-
var removePreservedAttributes = VElement.
|
|
270
|
+
VElement.ck_ = function (fromEl, vFromEl, toEl) {
|
|
271
|
+
var removePreservedAttributes = VElement.ci_;
|
|
271
272
|
|
|
272
|
-
var fromFlags = vFromEl.
|
|
273
|
-
var toFlags = toEl.
|
|
273
|
+
var fromFlags = vFromEl.x_;
|
|
274
|
+
var toFlags = toEl.x_;
|
|
274
275
|
|
|
275
276
|
vElementByDOMNode.set(fromEl, toEl);
|
|
276
277
|
|
|
277
|
-
var attrs = toEl.
|
|
278
|
-
var props = toEl.
|
|
278
|
+
var attrs = toEl.cc_;
|
|
279
|
+
var props = toEl._P_;
|
|
279
280
|
|
|
280
281
|
if (toFlags & FLAG_CUSTOM_ELEMENT) {
|
|
281
282
|
return assign(fromEl, attrs);
|
|
@@ -291,7 +292,7 @@ VElement.ce_ = function (fromEl, vFromEl, toEl) {
|
|
|
291
292
|
// real VElement node will not have the expando property
|
|
292
293
|
// so we build the attribute map from the expando property
|
|
293
294
|
|
|
294
|
-
var oldAttrs = vFromEl.
|
|
295
|
+
var oldAttrs = vFromEl.cc_;
|
|
295
296
|
|
|
296
297
|
if (oldAttrs) {
|
|
297
298
|
if (oldAttrs === attrs) {
|
|
@@ -363,7 +364,7 @@ VElement.ce_ = function (fromEl, vFromEl, toEl) {
|
|
|
363
364
|
// was not a virtualized node (i.e., a node that was not rendered by a
|
|
364
365
|
// Marko template, but rather a node that was created from an HTML
|
|
365
366
|
// string or a real DOM node).
|
|
366
|
-
if (toEl.
|
|
367
|
+
if (toEl.bY_ === null || fromFlags & FLAG_SPREAD_ATTRS) {
|
|
367
368
|
for (attrName in oldAttrs) {
|
|
368
369
|
if (!(attrName in attrs)) {
|
|
369
370
|
if (attrName === ATTR_XLINK_HREF) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var domData = require("../components/dom-data");
|
|
2
|
-
var keysByDOMNode = domData.
|
|
3
|
-
var vElementByDOMNode = domData.
|
|
2
|
+
var keysByDOMNode = domData._K_;
|
|
3
|
+
var vElementByDOMNode = domData._L_;
|
|
4
4
|
var VNode = require("./VNode");
|
|
5
5
|
var inherit = require("raptor-util/inherit");
|
|
6
|
-
var createFragmentNode = require("./morphdom/fragment").
|
|
6
|
+
var createFragmentNode = require("./morphdom/fragment")._m_;
|
|
7
7
|
|
|
8
8
|
function VFragment(key, ownerComponent, preserve) {
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
9
|
+
this.bV_(null /* childCount */, ownerComponent);
|
|
10
|
+
this.bY_ = key;
|
|
11
|
+
this.ae_ = preserve;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
VFragment.prototype = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
bX_: 12,
|
|
16
|
+
bU_: function () {
|
|
17
17
|
var fragment = createFragmentNode();
|
|
18
|
-
keysByDOMNode.set(fragment, this.
|
|
18
|
+
keysByDOMNode.set(fragment, this.bY_);
|
|
19
19
|
vElementByDOMNode.set(fragment, this);
|
|
20
20
|
return fragment;
|
|
21
21
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
function VNode() {}
|
|
3
3
|
|
|
4
4
|
VNode.prototype = {
|
|
5
|
-
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
5
|
+
bV_: function (finalChildCount, ownerComponent) {
|
|
6
|
+
this.cl_ = finalChildCount;
|
|
7
|
+
this.cm_ = 0;
|
|
8
|
+
this.cb_ = null;
|
|
9
|
+
this.cn_ = null;
|
|
10
|
+
this.bZ_ = null;
|
|
11
|
+
this.c__ = null;
|
|
12
|
+
this._N_ = ownerComponent;
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
get a_() {
|
|
16
|
-
var firstChild = this.
|
|
16
|
+
var firstChild = this.cb_;
|
|
17
17
|
|
|
18
|
-
if (firstChild && firstChild.
|
|
18
|
+
if (firstChild && firstChild.ca_) {
|
|
19
19
|
var nestedFirstChild = firstChild.a_;
|
|
20
20
|
// The first child is a DocumentFragment node.
|
|
21
21
|
// If the DocumentFragment node has a first child then we will return that.
|
|
@@ -28,16 +28,16 @@ VNode.prototype = {
|
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
get b_() {
|
|
31
|
-
var nextSibling = this.
|
|
31
|
+
var nextSibling = this.c__;
|
|
32
32
|
|
|
33
33
|
if (nextSibling) {
|
|
34
|
-
if (nextSibling.
|
|
34
|
+
if (nextSibling.ca_) {
|
|
35
35
|
var firstChild = nextSibling.a_;
|
|
36
36
|
return firstChild || nextSibling.b_;
|
|
37
37
|
}
|
|
38
38
|
} else {
|
|
39
|
-
var parentNode = this.
|
|
40
|
-
if (parentNode && parentNode.
|
|
39
|
+
var parentNode = this.bZ_;
|
|
40
|
+
if (parentNode && parentNode.ca_) {
|
|
41
41
|
return parentNode.b_;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -45,38 +45,38 @@ VNode.prototype = {
|
|
|
45
45
|
return nextSibling;
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
this.
|
|
48
|
+
bO_: function (child) {
|
|
49
|
+
this.cm_++;
|
|
50
50
|
|
|
51
|
-
if (this.
|
|
52
|
-
if (child.
|
|
53
|
-
var childValue = child.
|
|
54
|
-
this.
|
|
55
|
-
} else if (child.
|
|
56
|
-
this.
|
|
51
|
+
if (this.cd_ === "textarea") {
|
|
52
|
+
if (child.co_) {
|
|
53
|
+
var childValue = child.bW_;
|
|
54
|
+
this.ce_ = (this.ce_ || "") + childValue;
|
|
55
|
+
} else if (child.ae_ || child.ad_) {
|
|
56
|
+
this.cp_ = true;
|
|
57
57
|
} else {
|
|
58
58
|
throw TypeError();
|
|
59
59
|
}
|
|
60
60
|
} else {
|
|
61
|
-
var lastChild = this.
|
|
61
|
+
var lastChild = this.cn_;
|
|
62
62
|
|
|
63
|
-
child.
|
|
63
|
+
child.bZ_ = this;
|
|
64
64
|
|
|
65
65
|
if (lastChild) {
|
|
66
|
-
lastChild.
|
|
66
|
+
lastChild.c__ = child;
|
|
67
67
|
} else {
|
|
68
|
-
this.
|
|
68
|
+
this.cb_ = child;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
this.
|
|
71
|
+
this.cn_ = child;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return child;
|
|
75
75
|
},
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
if (this.
|
|
79
|
-
return this.
|
|
77
|
+
cg_: function finishChild() {
|
|
78
|
+
if (this.cm_ === this.cl_ && this.bZ_) {
|
|
79
|
+
return this.bZ_.cg_();
|
|
80
80
|
} else {
|
|
81
81
|
return this;
|
|
82
82
|
}
|
|
@@ -2,21 +2,21 @@ var VNode = require("./VNode");
|
|
|
2
2
|
var inherit = require("raptor-util/inherit");
|
|
3
3
|
|
|
4
4
|
function VText(value, ownerComponent) {
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
5
|
+
this.bV_(-1 /* no children */, ownerComponent);
|
|
6
|
+
this.bW_ = value;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
VText.prototype = {
|
|
10
|
-
|
|
10
|
+
co_: true,
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
bX_: 3,
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
return
|
|
14
|
+
bU_: function (host) {
|
|
15
|
+
return (host.ownerDocument || host).createTextNode(this.bW_);
|
|
16
16
|
},
|
|
17
17
|
|
|
18
18
|
__: function () {
|
|
19
|
-
return new VText(this.
|
|
19
|
+
return new VText(this.bW_);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var VElement = require("../vdom").
|
|
3
|
+
var VElement = require("../vdom").bw_;
|
|
4
4
|
|
|
5
5
|
module.exports = function (tagName, attrs, key, component, childCount, flags, props) {
|
|
6
6
|
return new VElement(tagName, attrs, key, component, childCount, flags, props);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// that are available in every template
|
|
7
|
-
var AsyncVDOMBuilder = require("./AsyncVDOMBuilder");
|
|
8
|
-
var makeRenderable = require("../renderable");
|
|
3
|
+
typeof window === "object" && (window.Marko = {
|
|
4
|
+
Component: function () {}
|
|
5
|
+
});
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* Method is for internal usage only. This method
|
|
@@ -13,27 +10,20 @@ var makeRenderable = require("../renderable");
|
|
|
13
10
|
* it is used to create a new Template instance.
|
|
14
11
|
* @private
|
|
15
12
|
*/
|
|
16
|
-
exports.t = function createTemplate(
|
|
17
|
-
return new Template(
|
|
13
|
+
exports.t = function createTemplate(typeName) {
|
|
14
|
+
return new Template(typeName);
|
|
18
15
|
};
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
exports.Template = Template;
|
|
18
|
+
function Template(typeName, func) {
|
|
19
|
+
this.path = typeName;
|
|
22
20
|
this._ = func;
|
|
23
21
|
this.meta = undefined;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
var AsyncVDOMBuilder = require("./AsyncVDOMBuilder");
|
|
25
|
+
require("../createOut").bf_(Template.prototype.createOut = function createOut(globalData, parent, parentOut) {
|
|
27
26
|
return new AsyncVDOMBuilder(globalData, parent, parentOut);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var Template_prototype = Template.prototype = {
|
|
31
|
-
createOut: createOut
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
makeRenderable(Template_prototype);
|
|
35
|
-
|
|
36
|
-
exports.Template = Template;
|
|
37
|
-
exports.bo_ = createOut;
|
|
27
|
+
});
|
|
38
28
|
|
|
39
|
-
require("../
|
|
29
|
+
require("../renderable")(Template.prototype);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var helpers = require("./helpers");
|
|
2
|
-
var insertBefore = helpers.
|
|
2
|
+
var insertBefore = helpers.bg_;
|
|
3
3
|
|
|
4
4
|
var fragmentPrototype = {
|
|
5
5
|
nodeType: 12,
|
|
@@ -66,12 +66,12 @@ function createFragmentNode(startNode, nextNode, parentNode) {
|
|
|
66
66
|
|
|
67
67
|
function beginFragmentNode(startNode, parentNode) {
|
|
68
68
|
var fragment = createFragmentNode(startNode, null, parentNode);
|
|
69
|
-
fragment.
|
|
70
|
-
fragment.
|
|
69
|
+
fragment.cq_ = function (nextNode) {
|
|
70
|
+
fragment.cq_ = null;
|
|
71
71
|
insertBefore(fragment.endNode, nextNode, parentNode || startNode.parentNode);
|
|
72
72
|
};
|
|
73
73
|
return fragment;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
76
|
+
exports._m_ = createFragmentNode;
|
|
77
|
+
exports.cr_ = beginFragmentNode;
|
|
@@ -27,8 +27,8 @@ function removeChild(node) {
|
|
|
27
27
|
if (node.remove) node.remove();else node.parentNode.removeChild(node);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
30
|
+
exports.bg_ = insertBefore;
|
|
31
|
+
exports.bh_ = insertAfter;
|
|
32
32
|
exports.b_ = nextSibling;
|
|
33
33
|
exports.a_ = firstChild;
|
|
34
|
-
exports.
|
|
34
|
+
exports.bi_ = removeChild;
|