marko 5.16.1 → 5.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/dist/runtime/RenderResult.js +13 -11
  2. package/dist/runtime/RenderResult.js.map +1 -1
  3. package/dist/runtime/components/Component.js +2 -2
  4. package/dist/runtime/components/Component.js.map +1 -1
  5. package/dist/runtime/components/ComponentsContext.js +2 -2
  6. package/dist/runtime/components/ComponentsContext.js.map +1 -1
  7. package/dist/runtime/components/event-delegation.js +8 -8
  8. package/dist/runtime/components/event-delegation.js.map +1 -1
  9. package/dist/runtime/components/init-components/index-browser.js +22 -24
  10. package/dist/runtime/components/init-components/index-browser.js.map +1 -1
  11. package/dist/runtime/components/registry/index-browser.js +2 -2
  12. package/dist/runtime/components/registry/index-browser.js.map +1 -1
  13. package/dist/runtime/components/util/index-browser.js +4 -3
  14. package/dist/runtime/components/util/index-browser.js.map +1 -1
  15. package/dist/runtime/html/AsyncStream.js +8 -10
  16. package/dist/runtime/html/AsyncStream.js.map +1 -1
  17. package/dist/runtime/vdom/AsyncVDOMBuilder.js +65 -70
  18. package/dist/runtime/vdom/AsyncVDOMBuilder.js.map +1 -1
  19. package/dist/runtime/vdom/VComponent.js +3 -3
  20. package/dist/runtime/vdom/VDocumentFragment.js +7 -7
  21. package/dist/runtime/vdom/VDocumentFragment.js.map +1 -1
  22. package/dist/runtime/vdom/VElement.js +42 -39
  23. package/dist/runtime/vdom/VElement.js.map +1 -1
  24. package/dist/runtime/vdom/VFragment.js +5 -5
  25. package/dist/runtime/vdom/VNode.js +31 -31
  26. package/dist/runtime/vdom/VText.js +8 -8
  27. package/dist/runtime/vdom/VText.js.map +1 -1
  28. package/dist/runtime/vdom/hot-reload.js +5 -5
  29. package/dist/runtime/vdom/hot-reload.js.map +1 -1
  30. package/dist/runtime/vdom/morphdom/fragment.js +3 -3
  31. package/dist/runtime/vdom/morphdom/helpers.js +1 -1
  32. package/dist/runtime/vdom/morphdom/index.js +30 -30
  33. package/dist/runtime/vdom/morphdom/index.js.map +1 -1
  34. package/dist/runtime/vdom/morphdom/specialElHandlers.js +6 -6
  35. package/dist/runtime/vdom/preserve-attrs.js +1 -1
  36. package/dist/runtime/vdom/vdom.js +10 -12
  37. package/dist/runtime/vdom/vdom.js.map +1 -1
  38. package/package.json +4 -4
  39. package/src/runtime/RenderResult.js +13 -11
  40. package/src/runtime/components/Component.js +5 -5
  41. package/src/runtime/components/ComponentsContext.js +2 -2
  42. package/src/runtime/components/event-delegation.js +6 -6
  43. package/src/runtime/components/init-components/index-browser.js +23 -25
  44. package/src/runtime/components/registry/index-browser.js +3 -3
  45. package/src/runtime/components/util/index-browser.js +8 -7
  46. package/src/runtime/html/AsyncStream.js +8 -10
  47. package/src/runtime/vdom/AsyncVDOMBuilder.js +9 -14
  48. package/src/runtime/vdom/VDocumentFragment.js +2 -2
  49. package/src/runtime/vdom/VElement.js +5 -2
  50. package/src/runtime/vdom/VText.js +2 -2
  51. package/src/runtime/vdom/hot-reload.js +1 -1
  52. package/src/runtime/vdom/morphdom/index.js +4 -4
  53. package/src/runtime/vdom/vdom.js +2 -4
@@ -1,6 +1,12 @@
1
1
  "use strict";var domInsert = require("./dom-insert");
2
2
 
3
3
 
4
+ function getRootNode(el) {
5
+ var cur = el;
6
+ while (cur.parentNode) cur = cur.parentNode;
7
+ return cur;
8
+ }
9
+
4
10
  function getComponentDefs(result) {
5
11
  var componentDefs = result.b_;
6
12
 
@@ -40,19 +46,19 @@ var proto = RenderResult.prototype = {
40
46
  return components;
41
47
  },
42
48
 
43
- afterInsert: function (doc) {
49
+ afterInsert: function (host) {
44
50
  var out = this.y_;
45
51
  var componentsContext = out.b_;
46
52
  if (componentsContext) {
47
- this.b_ = componentsContext.z_(doc);
53
+ this.b_ = componentsContext.z_(host);
48
54
  } else {
49
55
  this.b_ = null;
50
56
  }
51
57
 
52
58
  return this;
53
59
  },
54
- getNode: function (doc) {
55
- return this.y_.A_(doc);
60
+ getNode: function (host) {
61
+ return this.y_.A_(host);
56
62
  },
57
63
  getOutput: function () {
58
64
  return this.y_.B_();
@@ -60,7 +66,7 @@ var proto = RenderResult.prototype = {
60
66
  toString: function () {
61
67
  return this.y_.toString();
62
68
  },
63
- document: typeof document != "undefined" && document };
69
+ document: typeof window === "object" && document };
64
70
 
65
71
 
66
72
  Object.defineProperty(proto, "html", {
@@ -97,13 +103,9 @@ Object.defineProperty(proto, "context", {
97
103
  domInsert(
98
104
  proto,
99
105
  function getEl(renderResult, referenceEl) {
100
- return renderResult.getNode(referenceEl.ownerDocument);
106
+ return renderResult.getNode(getRootNode(referenceEl));
101
107
  },
102
108
  function afterInsert(renderResult, referenceEl) {
103
- var isShadow =
104
- typeof ShadowRoot === "function" && referenceEl instanceof ShadowRoot;
105
- return renderResult.afterInsert(
106
- isShadow ? referenceEl : referenceEl.ownerDocument);
107
-
109
+ return renderResult.afterInsert(getRootNode(referenceEl));
108
110
  });
109
111
  //# sourceMappingURL=RenderResult.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/RenderResult.js"],"names":["domInsert","require","getComponentDefs","result","componentDefs","Error","RenderResult","out","undefined","module","exports","proto","prototype","getComponent","getComponents","selector","components","forEach","componentDef","component","push","afterInsert","doc","componentsContext","getNode","getOutput","toString","document","Object","defineProperty","get","getEl","renderResult","referenceEl","ownerDocument","isShadow","ShadowRoot"],"mappings":"aAAA,IAAIA,SAAS,GAAGC,OAAO,CAAC,cAAD,CAAvB;;;AAGA,SAASC,gBAAT,CAA0BC,MAA1B,EAAkC;AAChC,MAAIC,aAAa,GAAGD,MAAM,GAA1B;;AAEA,MAAI,CAACC,aAAL,EAAoB;AAClB,UAAMC,KAAK,CAAC,cAAD,CAAX;AACD;AACD,SAAOD,aAAP;AACD;;AAED,SAASE,YAAT,CAAsBC,GAAtB,EAA2B;AACzB,OAAKA,GAAL,GAAW,UAAcA,GAAzB;AACA,YAAqBC,SAArB;AACD;;AAEDC,MAAM,CAACC,OAAP,GAAiBJ,YAAjB;;AAEA,IAAIK,KAAK,GAAIL,YA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EAA6B,MAA7B,EAAqC;AACnCmB,EAAAA,GAAG,EAAE,YAAY;AACf;;;;;;AAMA,WAAO,KAAKJ,QAAL,EAAP;AACD,GATkC,EAArC;;;AAYAE,MAAM,CAACC,cAAP,CAAsBlB,KAAtB,EAA6B,SAA7B,EAAwC;AACtCmB,EAAAA,GAAG,EAAE,YAAY;AACf;;;;;;AAMA,WAAO,OAAP;AACD,GATqC,EAAxC;;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA9B,SAAS;AACPW,KADO;AAEP,SAASoB,KAAT,CAAeC,YAAf,EAA6BC,WAA7B,EAA0C;AACxC,SAAOD,YAAY,CAACR,OAAb,CAAqBS,WAAW,CAACC,aAAjC,CAAP;AACD,CAJM;AAKP,SAASb,WAAT,CAAqBW,YAArB,EAAmCC,WAAnC,EAAgD;AAC9C,MAAIE,QAAQ;AACV,SAAOC,UAAP,KAAsB,UAAtB,IAAoCH,WAAW,YAAYG,UAD7D;AAEA,SAAOJ,YAAY,CAACX,WAAb;AACLc,EAAAA,QAAQ,GAAGF,WAAH,GAAiBA,WAAW,CAACC,aADhC,CAAP;;AAGD,CAXM,CAAT","sourcesContent":["var domInsert = require(\"./dom-insert\");\nvar complain = \"MARKO_DEBUG\" && require(\"complain\");\n\nfunction getComponentDefs(result) {\n var componentDefs = result.___components;\n\n if (!componentDefs) {\n throw Error(\"No component\");\n }\n return componentDefs;\n}\n\nfunction RenderResult(out) {\n this.out = this.___out = out;\n this.___components = undefined;\n}\n\nmodule.exports = RenderResult;\n\nvar proto = (RenderResult.prototype = {\n getComponent: function () {\n return this.getComponents()[0];\n },\n getComponents: function (selector) {\n if (this.___components === undefined) {\n throw Error(\"Not added to DOM\");\n }\n\n var componentDefs = getComponentDefs(this);\n\n var components = [];\n\n componentDefs.forEach(function (componentDef) {\n var component = componentDef.___component;\n if (!selector || selector(component)) {\n components.push(component);\n }\n });\n\n return components;\n },\n\n afterInsert: function (doc) {\n var out = this.___out;\n var componentsContext = out.___components;\n if (componentsContext) {\n this.___components = componentsContext.___initComponents(doc);\n } else {\n this.___components = null;\n }\n\n return this;\n },\n getNode: function (doc) {\n return this.___out.___getNode(doc);\n },\n getOutput: function () {\n return this.___out.___getOutput();\n },\n toString: function () {\n return this.___out.toString();\n },\n document: typeof document != \"undefined\" && document\n});\n\nObject.defineProperty(proto, \"html\", {\n get: function () {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"html\" property is deprecated. Please use \"toString\" instead.'\n );\n }\n return this.toString();\n }\n});\n\nObject.defineProperty(proto, \"context\", {\n get: function () {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"context\" property is deprecated. Please use \"out\" instead.'\n );\n }\n return this.___out;\n }\n});\n\n// Add all of the following DOM methods to Component.prototype:\n// - appendTo(referenceEl)\n// - replace(referenceEl)\n// - replaceChildrenOf(referenceEl)\n// - insertBefore(referenceEl)\n// - insertAfter(referenceEl)\n// - prependTo(referenceEl)\ndomInsert(\n proto,\n function getEl(renderResult, referenceEl) {\n return renderResult.getNode(referenceEl.ownerDocument);\n },\n function afterInsert(renderResult, referenceEl) {\n var isShadow =\n typeof ShadowRoot === \"function\" && referenceEl instanceof ShadowRoot;\n return renderResult.afterInsert(\n isShadow ? referenceEl : referenceEl.ownerDocument\n );\n }\n);\n"],"file":"RenderResult.js"}
1
+ {"version":3,"sources":["../../src/runtime/RenderResult.js"],"names":["domInsert","require","getRootNode","el","cur","parentNode","getComponentDefs","result","componentDefs","Error","RenderResult","out","undefined","module","exports","proto","prototype","getComponent","getComponents","selector","components","forEach","componentDef","component","push","afterInsert","host","componentsContext","getNode","getOutput","toString","document","window","Object","defineProperty","get","getEl","renderResult","referenceEl"],"mappings":"aAAA,IAAIA,SAAS,GAAGC,OAAO,CAAC,cAAD,CAAvB;;;AAGA,SAASC,WAAT,CAAqBC,EAArB,EAAyB;AACvB,MAAIC,GAAG,GAAGD,EAAV;AACA,SAAOC,GAA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,KAFD,MAEO;AACL,gBAAqB,IAArB;AACD;;AAED,WAAO,IAAP;AACD,GAjCmC;AAkCpCE,EAAAA,OAAO,EAAE,UAAUF,IAAV,EAAgB;AACvB,WAAO,WAAuBA,IAAvB,CAAP;AACD,GApCmC;AAqCpCG,EAAAA,SAAS,EAAE,YAAY;AACrB,WAAO,YAAP;AACD,GAvCmC;AAwCpCC,EAAAA,QAAQ,EAAE,YAAY;AACpB,WAAO,QAAYA,QAAZ,EAAP;AACD,GA1CmC;AA2CpCC,EAAAA,QAAQ,EAAE,OAAOC,MAAP,KAAkB,QAAlB,IAA8BD,QA3CJ,EAAtC;;;AA8CAE,MAAM,CAACC,cAAP,CAAsBnB,KAAtB,EAA6B,MAA7B,EAAqC;AACnCoB,EAAAA,GAAG,EAAE,YAAY;AACf;;;;;;AAMA,WAAO,KAAKL,QAAL,EAAP;AACD,GATkC,EAArC;;;AAYAG,MAAM,CAACC,cAAP,CAAsBnB,KAAtB,EAA6B,SAA7B,EAAwC;AACtCoB,EAAAA,GAAG,EAAE,YAAY;AACf;;;;;;AAMA,WAAO,OAAP;AACD,GATqC,EAAxC;;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACAnC,SAAS;AACPe,KADO;AAEP,SAASqB,KAAT,CAAeC,YAAf,EAA6BC,WAA7B,EAA0C;AACxC,SAAOD,YAAY,CAACT,OAAb,CAAqB1B,WAAW,CAACoC,WAAD,CAAhC,CAAP;AACD,CAJM;AAKP,SAASb,WAAT,CAAqBY,YAArB,EAAmCC,WAAnC,EAAgD;AAC9C,SAAOD,YAAY,CAACZ,WAAb,CAAyBvB,WAAW,CAACoC,WAAD,CAApC,CAAP;AACD,CAPM,CAAT","sourcesContent":["var domInsert = require(\"./dom-insert\");\nvar complain = \"MARKO_DEBUG\" && require(\"complain\");\n\nfunction getRootNode(el) {\n var cur = el;\n while (cur.parentNode) cur = cur.parentNode;\n return cur;\n}\n\nfunction getComponentDefs(result) {\n var componentDefs = result.___components;\n\n if (!componentDefs) {\n throw Error(\"No component\");\n }\n return componentDefs;\n}\n\nfunction RenderResult(out) {\n this.out = this.___out = out;\n this.___components = undefined;\n}\n\nmodule.exports = RenderResult;\n\nvar proto = (RenderResult.prototype = {\n getComponent: function () {\n return this.getComponents()[0];\n },\n getComponents: function (selector) {\n if (this.___components === undefined) {\n throw Error(\"Not added to DOM\");\n }\n\n var componentDefs = getComponentDefs(this);\n\n var components = [];\n\n componentDefs.forEach(function (componentDef) {\n var component = componentDef.___component;\n if (!selector || selector(component)) {\n components.push(component);\n }\n });\n\n return components;\n },\n\n afterInsert: function (host) {\n var out = this.___out;\n var componentsContext = out.___components;\n if (componentsContext) {\n this.___components = componentsContext.___initComponents(host);\n } else {\n this.___components = null;\n }\n\n return this;\n },\n getNode: function (host) {\n return this.___out.___getNode(host);\n },\n getOutput: function () {\n return this.___out.___getOutput();\n },\n toString: function () {\n return this.___out.toString();\n },\n document: typeof window === \"object\" && document\n});\n\nObject.defineProperty(proto, \"html\", {\n get: function () {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"html\" property is deprecated. Please use \"toString\" instead.'\n );\n }\n return this.toString();\n }\n});\n\nObject.defineProperty(proto, \"context\", {\n get: function () {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"context\" property is deprecated. Please use \"out\" instead.'\n );\n }\n return this.___out;\n }\n});\n\n// Add all of the following DOM methods to Component.prototype:\n// - appendTo(referenceEl)\n// - replace(referenceEl)\n// - replaceChildrenOf(referenceEl)\n// - insertBefore(referenceEl)\n// - insertAfter(referenceEl)\n// - prependTo(referenceEl)\ndomInsert(\n proto,\n function getEl(renderResult, referenceEl) {\n return renderResult.getNode(getRootNode(referenceEl));\n },\n function afterInsert(renderResult, referenceEl) {\n return renderResult.afterInsert(getRootNode(referenceEl));\n }\n);\n"],"file":"RenderResult.js"}
@@ -533,7 +533,7 @@ Component.prototype = componentProto = {
533
533
  },
534
534
 
535
535
  _p_: function (input, isHydrate) {
536
- var doc = this.X_;
536
+ var host = this.X_;
537
537
  var globalData = this.S_;
538
538
  var rootNode = this.K_;
539
539
  var renderer = this._n_;
@@ -554,7 +554,7 @@ Component.prototype = componentProto = {
554
554
 
555
555
  var targetNode = out.B_()._r_;
556
556
 
557
- morphdom(rootNode, targetNode, doc, componentsContext);
557
+ morphdom(rootNode, targetNode, host, componentsContext);
558
558
 
559
559
  return result;
560
560
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/components/Component.js"],"names":["domInsert","require","defaultCreateOut","getComponentsContext","componentsUtil","componentLookup","destroyNodeRecursive","EventEmitter","RenderResult","SubscriptionTracker","inherit","updateManager","morphdom","eventDelegation","domData","componentsByDOMNode","keyedElementsByComponentId","CONTEXT_KEY","hasOwnProperty","Object","prototype","slice","Array","COMPONENT_SUBSCRIBE_TO_OPTIONS","NON_COMPONENT_SUBSCRIBE_TO_OPTIONS","addDestroyListener","emit","ELEMENT_NODE","removeListener","removeEventListenerHandle","walkFragments","fragment","node","firstChild","handleCustomEventWithMethodListener","component","targetMethodName","args","extraArgs","push","concat","targetComponent","targetMethod","Error","apply","resolveKeyHelper","key","index","resolveComponentIdHelper","id","processUpdateHandlers","stateChanges","oldState","handlerMethod","handlers","propName","call","handlerMethodName","forEach","handler","propertyName","newValue","oldValue","checkInputChanged","existingComponent","oldInput","newInput","oldKeys","keys","newKeys","len","length","i","componentProto","Component","undefined","ssrKeyedElements","subscribeTo","target","TypeError","subscriptions","subscribeToOptions","eventType","customEvents","isOnce","arguments","getElId","getEl","keyedElement","el","getEls","els","getComponent","rootNode","get","getComponents","lookup","map","filter","Boolean","destroy","root","nodes","parentNode","removeChild","detached","set","removeAllListeners","isDestroyed","state","newState","setState","name","value","k","setStateDirty","replaceState","input","onInput","out","updatedInput","$global","forceUpdate","update","shouldUpdate","self","renderer","afterInsert","isHydrate","doc","globalData","createOut","sync","componentsContext","globalComponentsContext","result","targetNode","remove","eventListenerHandles","scope","finalCustomEvents","customEvent","nodeType","onCreate","onRender","onUpdate","onMount","onDestroy","elId","module","exports"],"mappings":"AAAA;AACA;;;;AAIA,IAAIA,SAAS,GAAGC,OAAO,CAAC,eAAD,CAAvB;AACA,IAAIC,gBAAgB,GAAGD,OAAO,CAAC,cAAD,CAA9B;AACA,IAAIE,oBAAoB;AACtBF,OAAO,CAAC,qBAAD,CAAP,GADF;AAEA,IAAIG,cAAc,GAAGH,OAAO,CAAC,QAAD,CAA5B;AACA,IAAII,eAAe,GAAGD,cAAc,GAApC;AACA,IAAIE,oBAAoB,GAAGF,cAAc,GAAzC;AACA,IAAIG,YAAY,GAAGN,OAAO,CAAC,cAAD,CAA1B;AACA,IAAIO,YAAY,GAAGP,OAAO,CAAC,iBAAD,CAA1B;AACA,IAAIQ,mBAAmB,GAAGR,OAAO,CAAC,kBAAD,CAAjC;AACA,IAAIS,OAAO,GAAGT,OAAO,CAAC,qBAAD,CAArB;AACA,IAAIU,aAAa,GAAGV,OAAO,CAAC,kBAAD,CAA3B;AACA,IAAIW,QAAQ,GAAGX,OAAO,CAAC,kBAAD,CAAtB;AACA,IAAIY,eAAe,GAAGZ,OAAO,CAAC,oBAAD,CAA7B;AACA,IAAIa,OAAO,GAAGb,OAAO,CAAC,YAAD,CAArB;AACA,IAAIc,mBAAmB,GAAGD,OAAO,GAAjC;AACA,IAAIE,0BAA0B,GAAGF,OAAO,GAAxC;AACA,IAAIG,WAAW,GAAG,qBAAlB;;AAEA,IAAIC,cAAc,GAAGC,MAAM,CAACC,SAAP,CAAiBF,cAAtC;AACA,IAAIG,KAAK,GAAGC,KAAK,CAACF,SAAN,CAAgBC,KAA5B;;AAEA,IAAIE,8BAAJ;AACA,IAAIC,kCAAkC,GAAG;AACvCC,EAAAA,kBAAkB,EAAE,KADmB,EAAzC;;;AAIA,IAAIC,IAAI,GAAGnB,YAAY,CAACa,SAAb,CAAuBM,IAAlC;AACA,IAAIC,YAAY,GAAG,CAAnB;;AAEA,SAASC,c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,EAA0B;AACxB,SAAKwB,QAAL,IAAiB,KAAKA,QAAL,CAAc1B,KAAd,EAAqBE,GAArB,CAAjB;AACA,aAAa,QAAb,EAAuBF,KAAvB,EAA8BE,GAA9B;AACD,GApaoC;;AAsarC,MAAcA,GAAd,EAAmB;AACjB,SAAKyB,QAAL,IAAiB,KAAKA,QAAL,CAAczB,GAAd,CAAjB;AACA,aAAa,QAAb,EAAuBA,GAAvB;AACD,GAzaoC;;AA2arC,OAAgB;AACd,SAAK0B,QAAL,IAAiB,KAAKA,QAAL,EAAjB;AACA,aAAa,QAAb;AACD,GA9aoC;;AAgbrC,QAAe;AACb,SAAKC,OAAL,IAAgB,KAAKA,OAAL,EAAhB;AACA,aAAa,OAAb;AACD,GAnboC;;AAqbrC,QAAiB;AACf,SAAKC,SAAL,IAAkB,KAAKA,SAAL,EAAlB;AACA,aAAa,SAAb;AACD,GAxboC,EAAvC;;;AA2bA1E,cAAc,CAAC2E,IAAf,GAAsB3E,cAAc,CAACa,OAArC;AACAb,cAAc,IAAd,GAA2BA,cAAc,CAACkD,MAA1C;AACAlD,cAAc,IAAd,GAA4BA,cAAc,CAAC2B,OAA3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACApG,SAAS;AACPyE,cADO;AAEP,SAASc,KAAT,CAAepD,SAAf,EAA0B;AACxB,SAAOA,SAAS,IAAT,EAAP;AACD,CAJM;AAKP,SAAS4F,WAAT,CAAqB5F,SAArB,EAAgC;AAC9B,SAAOA,SAAP;AACD,CAPM,CAAT;;;AAUAzB,OAAO,CAACgE,SAAD,EAAYnE,YAAZ,CAAP;;AAEA8I,MAAM,CAACC,OAAP,GAAiB5E,SAAjB","sourcesContent":["\"use strict\";\n/* jshint newcap:false */\n\nvar complain = \"MARKO_DEBUG\" && require(\"complain\");\n\nvar domInsert = require(\"../dom-insert\");\nvar defaultCreateOut = require(\"../createOut\");\nvar getComponentsContext =\n require(\"./ComponentsContext\").___getComponentsContext;\nvar componentsUtil = require(\"./util\");\nvar componentLookup = componentsUtil.___componentLookup;\nvar destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;\nvar EventEmitter = require(\"events-light\");\nvar RenderResult = require(\"../RenderResult\");\nvar SubscriptionTracker = require(\"listener-tracker\");\nvar inherit = require(\"raptor-util/inherit\");\nvar updateManager = require(\"./update-manager\");\nvar morphdom = require(\"../vdom/morphdom\");\nvar eventDelegation = require(\"./event-delegation\");\nvar domData = require(\"./dom-data\");\nvar componentsByDOMNode = domData.___componentByDOMNode;\nvar keyedElementsByComponentId = domData.___ssrKeyedElementsByComponentId;\nvar CONTEXT_KEY = \"__subtree_context__\";\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar slice = Array.prototype.slice;\n\nvar COMPONENT_SUBSCRIBE_TO_OPTIONS;\nvar NON_COMPONENT_SUBSCRIBE_TO_OPTIONS = {\n addDestroyListener: false\n};\n\nvar emit = EventEmitter.prototype.emit;\nvar ELEMENT_NODE = 1;\n\nfunction removeListener(removeEventListenerHandle) {\n removeEventListenerHandle();\n}\n\nfunction walkFragments(fragment) {\n var node;\n\n while (fragment) {\n node = fragment.firstChild;\n\n if (!node) {\n break;\n }\n\n fragment = node.fragment;\n }\n\n return node;\n}\n\nfunction handleCustomEventWithMethodListener(\n component,\n targetMethodName,\n args,\n extraArgs\n) {\n // Remove the \"eventType\" argument\n args.push(component);\n\n if (extraArgs) {\n args = extraArgs.concat(args);\n }\n\n var targetComponent = componentLookup[component.___scope];\n var targetMethod =\n typeof targetMethodName === \"function\"\n ? targetMethodName\n : targetComponent[targetMethodName];\n if (!targetMethod) {\n throw Error(\"Method not found: \" + targetMethodName);\n }\n\n targetMethod.apply(targetComponent, args);\n}\n\nfunction resolveKeyHelper(key, index) {\n return index ? key + \"_\" + index : key;\n}\n\nfunction resolveComponentIdHelper(component, key, index) {\n return component.id + \"-\" + resolveKeyHelper(key, index);\n}\n\n/**\n * This method is used to process \"update_<stateName>\" handler functions.\n * If all of the modified state properties have a user provided update handler\n * then a rerender will be bypassed and, instead, the DOM will be updated\n * looping over and invoking the custom update handlers.\n * @return {boolean} Returns true if if the DOM was updated. False, otherwise.\n */\nfunction processUpdateHandlers(component, stateChanges, oldState) {\n var handlerMethod;\n var handlers;\n\n for (var propName in stateChanges) {\n if (hasOwnProperty.call(stateChanges, propName)) {\n var handlerMethodName = \"update_\" + propName;\n\n handlerMethod = component[handlerMethodName];\n if (handlerMethod) {\n (handlers || (handlers = [])).push([propName, handlerMethod]);\n } else {\n // This state change does not have a state handler so return false\n // to force a rerender\n return;\n }\n }\n }\n\n // If we got here then all of the changed state properties have\n // an update handler or there are no state properties that actually\n // changed.\n if (handlers) {\n // Otherwise, there are handlers for all of the changed properties\n // so apply the updates using those handlers\n\n handlers.forEach(function (handler) {\n var propertyName = handler[0];\n handlerMethod = handler[1];\n\n var newValue = stateChanges[propertyName];\n var oldValue = oldState[propertyName];\n handlerMethod.call(component, newValue, oldValue);\n });\n\n component.___emitUpdate();\n component.___reset();\n }\n\n return true;\n}\n\nfunction checkInputChanged(existingComponent, oldInput, newInput) {\n if (oldInput != newInput) {\n if (oldInput == null || newInput == null) {\n return true;\n }\n\n var oldKeys = Object.keys(oldInput);\n var newKeys = Object.keys(newInput);\n var len = oldKeys.length;\n if (len !== newKeys.length) {\n return true;\n }\n\n for (var i = len; i--; ) {\n var key = oldKeys[i];\n if (!(key in newInput && oldInput[key] === newInput[key])) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nvar componentProto;\n\n/**\n * Base component type.\n *\n * NOTE: Any methods that are prefixed with an underscore should be considered private!\n */\nfunction Component(id) {\n EventEmitter.call(this);\n this.id = id;\n this.___state = null;\n this.___rootNode = null;\n this.___subscriptions = null;\n this.___domEventListenerHandles = null;\n this.___bubblingDomEvents = null; // Used to keep track of bubbling DOM events for components rendered on the server\n this.___customEvents = null;\n this.___scope = null;\n this.___renderInput = null;\n this.___input = undefined;\n this.___mounted = false;\n this.___global = undefined;\n this.___destroyed = false;\n this.___updateQueued = false;\n this.___dirty = false;\n this.___settingInput = false;\n this.___document = undefined;\n\n var ssrKeyedElements = keyedElementsByComponentId[id];\n\n if (ssrKeyedElements) {\n this.___keyedElements = ssrKeyedElements;\n delete keyedElementsByComponentId[id];\n } else {\n this.___keyedElements = {};\n }\n}\n\nComponent.prototype = componentProto = {\n ___isComponent: true,\n\n subscribeTo: function (target) {\n if (!target) {\n throw TypeError();\n }\n\n var subscriptions =\n this.___subscriptions ||\n (this.___subscriptions = new SubscriptionTracker());\n\n var subscribeToOptions = target.___isComponent\n ? COMPONENT_SUBSCRIBE_TO_OPTIONS\n : NON_COMPONENT_SUBSCRIBE_TO_OPTIONS;\n\n return subscriptions.subscribeTo(target, subscribeToOptions);\n },\n\n emit: function (eventType) {\n var customEvents = this.___customEvents;\n var target;\n\n if (customEvents && (target = customEvents[eventType])) {\n var targetMethodName = target[0];\n var isOnce = target[1];\n var extraArgs = target[2];\n var args = slice.call(arguments, 1);\n\n handleCustomEventWithMethodListener(\n this,\n targetMethodName,\n args,\n extraArgs\n );\n\n if (isOnce) {\n delete customEvents[eventType];\n }\n }\n\n return emit.apply(this, arguments);\n },\n getElId: function (key, index) {\n if (!key) {\n return this.id;\n }\n return resolveComponentIdHelper(this, key, index);\n },\n getEl: function (key, index) {\n if (key) {\n var keyedElement =\n this.___keyedElements[\"@\" + resolveKeyHelper(key, index)];\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n if (\n keyedElement &&\n keyedElement.nodeType !== 1 /* Node.ELEMENT_NODE */\n ) {\n throw new Error(\n \"Using 'getEl(key)' to get a component instance is not supported, did you mean 'getComponent(key)'?\"\n );\n }\n }\n\n return keyedElement;\n } else {\n return this.el;\n }\n },\n getEls: function (key) {\n key = key + \"[]\";\n\n var els = [];\n var i = 0;\n var el;\n while ((el = this.getEl(key, i))) {\n els.push(el);\n i++;\n }\n return els;\n },\n getComponent: function (key, index) {\n var rootNode = this.___keyedElements[\"@\" + resolveKeyHelper(key, index)];\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n if (/\\[\\]$/.test(key)) {\n throw new Error(\n \"A repeated key[] was passed to getComponent. Use a non-repeating key if there is only one of these components.\"\n );\n }\n }\n\n return rootNode && componentsByDOMNode.get(rootNode);\n },\n getComponents: function (key) {\n var lookup = this.___keyedElements[\"@\" + key + \"[]\"];\n return lookup\n ? Object.keys(lookup)\n .map(function (key) {\n return componentsByDOMNode.get(lookup[key]);\n })\n .filter(Boolean)\n : [];\n },\n destroy: function () {\n if (this.___destroyed) {\n return;\n }\n\n var root = this.___rootNode;\n\n this.___destroyShallow();\n\n var nodes = root.nodes;\n\n nodes.forEach(function (node) {\n destroyNodeRecursive(node);\n\n if (eventDelegation.___handleNodeDetach(node) !== false) {\n node.parentNode.removeChild(node);\n }\n });\n\n root.detached = true;\n\n delete componentLookup[this.id];\n this.___keyedElements = {};\n },\n\n ___destroyShallow: function () {\n if (this.___destroyed) {\n return;\n }\n\n this.___emitDestroy();\n this.___destroyed = true;\n\n componentsByDOMNode.set(this.___rootNode, undefined);\n\n this.___rootNode = null;\n\n // Unsubscribe from all DOM events\n this.___removeDOMEventListeners();\n\n var subscriptions = this.___subscriptions;\n if (subscriptions) {\n subscriptions.removeAllListeners();\n this.___subscriptions = null;\n }\n },\n\n isDestroyed: function () {\n return this.___destroyed;\n },\n get state() {\n return this.___state;\n },\n set state(newState) {\n var state = this.___state;\n if (!state && !newState) {\n return;\n }\n\n if (!state) {\n state = this.___state = new this.___State(this);\n }\n\n state.___replace(newState || {});\n\n if (state.___dirty) {\n this.___queueUpdate();\n }\n\n if (!newState) {\n this.___state = null;\n }\n },\n setState: function (name, value) {\n var state = this.___state;\n\n if (!state) {\n state = this.___state = new this.___State(this);\n }\n if (typeof name == \"object\") {\n // Merge in the new state with the old state\n var newState = name;\n for (var k in newState) {\n if (hasOwnProperty.call(newState, k)) {\n state.___set(k, newState[k], true /* ensure:true */);\n }\n }\n } else {\n state.___set(name, value, true /* ensure:true */);\n }\n },\n\n setStateDirty: function (name, value) {\n var state = this.___state;\n\n if (arguments.length == 1) {\n value = state[name];\n }\n\n state.___set(\n name,\n value,\n true /* ensure:true */,\n true /* forceDirty:true */\n );\n },\n\n replaceState: function (newState) {\n this.___state.___replace(newState);\n },\n\n get input() {\n return this.___input;\n },\n set input(newInput) {\n if (this.___settingInput) {\n this.___input = newInput;\n } else {\n this.___setInput(newInput);\n }\n },\n\n ___setInput: function (newInput, onInput, out) {\n onInput = onInput || this.onInput;\n var updatedInput;\n\n var oldInput = this.___input;\n this.___input = undefined;\n this.___context = (out && out[CONTEXT_KEY]) || this.___context;\n\n if (onInput) {\n // We need to set a flag to preview `this.input = foo` inside\n // onInput causing infinite recursion\n this.___settingInput = true;\n updatedInput = onInput.call(this, newInput || {}, out);\n this.___settingInput = false;\n }\n\n newInput = this.___renderInput = updatedInput || newInput;\n\n if ((this.___dirty = checkInputChanged(this, oldInput, newInput))) {\n this.___queueUpdate();\n }\n\n if (this.___input === undefined) {\n this.___input = newInput;\n if (newInput && newInput.$global) {\n this.___global = newInput.$global;\n }\n }\n\n return newInput;\n },\n\n forceUpdate: function () {\n this.___dirty = true;\n this.___queueUpdate();\n },\n\n ___queueUpdate: function () {\n if (!this.___updateQueued) {\n this.___updateQueued = true;\n updateManager.___queueComponentUpdate(this);\n }\n },\n\n update: function () {\n if (this.___destroyed === true || this.___isDirty === false) {\n return;\n }\n\n var input = this.___input;\n var state = this.___state;\n\n if (this.___dirty === false && state !== null && state.___dirty === true) {\n if (processUpdateHandlers(this, state.___changes, state.___old, state)) {\n state.___dirty = false;\n }\n }\n\n if (this.___isDirty === true) {\n // The UI component is still dirty after process state handlers\n // then we should rerender\n\n if (this.shouldUpdate(input, state) !== false) {\n this.___scheduleRerender();\n }\n }\n\n this.___reset();\n },\n\n get ___isDirty() {\n return (\n this.___dirty === true ||\n (this.___state !== null && this.___state.___dirty === true)\n );\n },\n\n ___reset: function () {\n this.___dirty = false;\n this.___updateQueued = false;\n this.___renderInput = null;\n var state = this.___state;\n if (state) {\n state.___reset();\n }\n },\n\n shouldUpdate: function () {\n return true;\n },\n\n ___scheduleRerender: function () {\n var self = this;\n var renderer = self.___renderer;\n\n if (!renderer) {\n throw TypeError();\n }\n\n var input = this.___renderInput || this.___input;\n\n updateManager.___batchUpdate(function () {\n self.___rerender(input, false).afterInsert(self.___document);\n });\n\n this.___reset();\n },\n\n ___rerender: function (input, isHydrate) {\n var doc = this.___document;\n var globalData = this.___global;\n var rootNode = this.___rootNode;\n var renderer = this.___renderer;\n var createOut = renderer.createOut || defaultCreateOut;\n var out = createOut(globalData);\n out.sync();\n out.___document = this.___document;\n out[CONTEXT_KEY] = this.___context;\n\n var componentsContext = getComponentsContext(out);\n var globalComponentsContext = componentsContext.___globalContext;\n globalComponentsContext.___rerenderComponent = this;\n globalComponentsContext.___isHydrate = isHydrate;\n\n renderer(input, out);\n\n var result = new RenderResult(out);\n\n var targetNode = out.___getOutput().___firstChild;\n\n morphdom(rootNode, targetNode, doc, componentsContext);\n\n return result;\n },\n\n ___detach: function () {\n var root = this.___rootNode;\n root.remove();\n return root;\n },\n\n ___removeDOMEventListeners: function () {\n var eventListenerHandles = this.___domEventListenerHandles;\n if (eventListenerHandles) {\n eventListenerHandles.forEach(removeListener);\n this.___domEventListenerHandles = null;\n }\n },\n\n get ___rawState() {\n var state = this.___state;\n return state && state.___raw;\n },\n\n ___setCustomEvents: function (customEvents, scope) {\n var finalCustomEvents = (this.___customEvents = {});\n this.___scope = scope;\n\n customEvents.forEach(function (customEvent) {\n var eventType = customEvent[0];\n var targetMethodName = customEvent[1];\n var isOnce = customEvent[2];\n var extraArgs = customEvent[3];\n\n if (targetMethodName) {\n finalCustomEvents[eventType] = [targetMethodName, isOnce, extraArgs];\n }\n });\n },\n\n get el() {\n return walkFragments(this.___rootNode);\n },\n\n get els() {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"this.els\" attribute is deprecated. Please use \"this.getEls(key)\" instead.'\n );\n }\n return (this.___rootNode ? this.___rootNode.nodes : []).filter(function (\n el\n ) {\n return el.nodeType === ELEMENT_NODE;\n });\n },\n\n ___emit: emit,\n ___emitCreate(input, out) {\n this.onCreate && this.onCreate(input, out);\n this.___emit(\"create\", input, out);\n },\n\n ___emitRender(out) {\n this.onRender && this.onRender(out);\n this.___emit(\"render\", out);\n },\n\n ___emitUpdate() {\n this.onUpdate && this.onUpdate();\n this.___emit(\"update\");\n },\n\n ___emitMount() {\n this.onMount && this.onMount();\n this.___emit(\"mount\");\n },\n\n ___emitDestroy() {\n this.onDestroy && this.onDestroy();\n this.___emit(\"destroy\");\n }\n};\n\ncomponentProto.elId = componentProto.getElId;\ncomponentProto.___update = componentProto.update;\ncomponentProto.___destroy = componentProto.destroy;\n\n// Add all of the following DOM methods to Component.prototype:\n// - appendTo(referenceEl)\n// - replace(referenceEl)\n// - replaceChildrenOf(referenceEl)\n// - insertBefore(referenceEl)\n// - insertAfter(referenceEl)\n// - prependTo(referenceEl)\ndomInsert(\n componentProto,\n function getEl(component) {\n return component.___detach();\n },\n function afterInsert(component) {\n return component;\n }\n);\n\ninherit(Component, EventEmitter);\n\nmodule.exports = Component;\n"],"file":"Component.js"}
1
+ {"version":3,"sources":["../../../src/runtime/components/Component.js"],"names":["domInsert","require","defaultCreateOut","getComponentsContext","componentsUtil","componentLookup","destroyNodeRecursive","EventEmitter","RenderResult","SubscriptionTracker","inherit","updateManager","morphdom","eventDelegation","domData","componentsByDOMNode","keyedElementsByComponentId","CONTEXT_KEY","hasOwnProperty","Object","prototype","slice","Array","COMPONENT_SUBSCRIBE_TO_OPTIONS","NON_COMPONENT_SUBSCRIBE_TO_OPTIONS","addDestroyListener","emit","ELEMENT_NODE","removeListener","removeEventListenerHandle","walkFragments","fragment","node","firstChild","handleCustomEventWithMethodListener","component","targetMethodName","args","extraArgs","push","concat","targetComponent","targetMethod","Error","apply","resolveKeyHelper","key","index","resolveComponentIdHelper","id","processUpdateHandlers","stateChanges","oldState","handlerMethod","handlers","propName","call","handlerMethodName","forEach","handler","propertyName","newValue","oldValue","checkInputChanged","existingComponent","oldInput","newInput","oldKeys","keys","newKeys","len","length","i","componentProto","Component","undefined","ssrKeyedElements","subscribeTo","target","TypeError","subscriptions","subscribeToOptions","eventType","customEvents","isOnce","arguments","getElId","getEl","keyedElement","el","getEls","els","getComponent","rootNode","get","getComponents","lookup","map","filter","Boolean","destroy","root","nodes","parentNode","removeChild","detached","set","removeAllListeners","isDestroyed","state","newState","setState","name","value","k","setStateDirty","replaceState","input","onInput","out","updatedInput","$global","forceUpdate","update","shouldUpdate","self","renderer","afterInsert","isHydrate","host","globalData","createOut","sync","componentsContext","globalComponentsContext","result","targetNode","remove","eventListenerHandles","scope","finalCustomEvents","customEvent","nodeType","onCreate","onRender","onUpdate","onMount","onDestroy","elId","module","exports"],"mappings":"AAAA;AACA;;;;AAIA,IAAIA,SAAS,GAAGC,OAAO,CAAC,eAAD,CAAvB;AACA,IAAIC,gBAAgB,GAAGD,OAAO,CAAC,cAAD,CAA9B;AACA,IAAIE,oBAAoB;AACtBF,OAAO,CAAC,qBAAD,CAAP,GADF;AAEA,IAAIG,cAAc,GAAGH,OAAO,CAAC,QAAD,CAA5B;AACA,IAAII,eAAe,GAAGD,cAAc,GAApC;AACA,IAAIE,oBAAoB,GAAGF,cAAc,GAAzC;AACA,IAAIG,YAAY,GAAGN,OAAO,CAAC,cAAD,CAA1B;AACA,IAAIO,YAAY,GAAGP,OAAO,CAAC,iBAAD,CAA1B;AACA,IAAIQ,mBAAmB,GAAGR,OAAO,CAAC,kBAAD,CAAjC;AACA,IAAIS,OAAO,GAAGT,OAAO,CAAC,qBAAD,CAArB;AACA,IAAIU,aAAa,GAAGV,OAAO,CAAC,kBAAD,CAA3B;AACA,IAAIW,QAAQ,GAAGX,OAAO,CAAC,kBAAD,CAAtB;AACA,IAAIY,eAAe,GAAGZ,OAAO,CAAC,oBAAD,CAA7B;AACA,IAAIa,OAAO,GAAGb,OAA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AEP,SAASc,KAAT,CAAepD,SAAf,EAA0B;AACxB,SAAOA,SAAS,IAAT,EAAP;AACD,CAJM;AAKP,SAAS4F,WAAT,CAAqB5F,SAArB,EAAgC;AAC9B,SAAOA,SAAP;AACD,CAPM,CAAT;;;AAUAzB,OAAO,CAACgE,SAAD,EAAYnE,YAAZ,CAAP;;AAEA8I,MAAM,CAACC,OAAP,GAAiB5E,SAAjB","sourcesContent":["\"use strict\";\n/* jshint newcap:false */\n\nvar complain = \"MARKO_DEBUG\" && require(\"complain\");\n\nvar domInsert = require(\"../dom-insert\");\nvar defaultCreateOut = require(\"../createOut\");\nvar getComponentsContext =\n require(\"./ComponentsContext\").___getComponentsContext;\nvar componentsUtil = require(\"./util\");\nvar componentLookup = componentsUtil.___componentLookup;\nvar destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;\nvar EventEmitter = require(\"events-light\");\nvar RenderResult = require(\"../RenderResult\");\nvar SubscriptionTracker = require(\"listener-tracker\");\nvar inherit = require(\"raptor-util/inherit\");\nvar updateManager = require(\"./update-manager\");\nvar morphdom = require(\"../vdom/morphdom\");\nvar eventDelegation = require(\"./event-delegation\");\nvar domData = require(\"./dom-data\");\nvar componentsByDOMNode = domData.___componentByDOMNode;\nvar keyedElementsByComponentId = domData.___ssrKeyedElementsByComponentId;\nvar CONTEXT_KEY = \"__subtree_context__\";\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar slice = Array.prototype.slice;\n\nvar COMPONENT_SUBSCRIBE_TO_OPTIONS;\nvar NON_COMPONENT_SUBSCRIBE_TO_OPTIONS = {\n addDestroyListener: false\n};\n\nvar emit = EventEmitter.prototype.emit;\nvar ELEMENT_NODE = 1;\n\nfunction removeListener(removeEventListenerHandle) {\n removeEventListenerHandle();\n}\n\nfunction walkFragments(fragment) {\n var node;\n\n while (fragment) {\n node = fragment.firstChild;\n\n if (!node) {\n break;\n }\n\n fragment = node.fragment;\n }\n\n return node;\n}\n\nfunction handleCustomEventWithMethodListener(\n component,\n targetMethodName,\n args,\n extraArgs\n) {\n // Remove the \"eventType\" argument\n args.push(component);\n\n if (extraArgs) {\n args = extraArgs.concat(args);\n }\n\n var targetComponent = componentLookup[component.___scope];\n var targetMethod =\n typeof targetMethodName === \"function\"\n ? targetMethodName\n : targetComponent[targetMethodName];\n if (!targetMethod) {\n throw Error(\"Method not found: \" + targetMethodName);\n }\n\n targetMethod.apply(targetComponent, args);\n}\n\nfunction resolveKeyHelper(key, index) {\n return index ? key + \"_\" + index : key;\n}\n\nfunction resolveComponentIdHelper(component, key, index) {\n return component.id + \"-\" + resolveKeyHelper(key, index);\n}\n\n/**\n * This method is used to process \"update_<stateName>\" handler functions.\n * If all of the modified state properties have a user provided update handler\n * then a rerender will be bypassed and, instead, the DOM will be updated\n * looping over and invoking the custom update handlers.\n * @return {boolean} Returns true if if the DOM was updated. False, otherwise.\n */\nfunction processUpdateHandlers(component, stateChanges, oldState) {\n var handlerMethod;\n var handlers;\n\n for (var propName in stateChanges) {\n if (hasOwnProperty.call(stateChanges, propName)) {\n var handlerMethodName = \"update_\" + propName;\n\n handlerMethod = component[handlerMethodName];\n if (handlerMethod) {\n (handlers || (handlers = [])).push([propName, handlerMethod]);\n } else {\n // This state change does not have a state handler so return false\n // to force a rerender\n return;\n }\n }\n }\n\n // If we got here then all of the changed state properties have\n // an update handler or there are no state properties that actually\n // changed.\n if (handlers) {\n // Otherwise, there are handlers for all of the changed properties\n // so apply the updates using those handlers\n\n handlers.forEach(function (handler) {\n var propertyName = handler[0];\n handlerMethod = handler[1];\n\n var newValue = stateChanges[propertyName];\n var oldValue = oldState[propertyName];\n handlerMethod.call(component, newValue, oldValue);\n });\n\n component.___emitUpdate();\n component.___reset();\n }\n\n return true;\n}\n\nfunction checkInputChanged(existingComponent, oldInput, newInput) {\n if (oldInput != newInput) {\n if (oldInput == null || newInput == null) {\n return true;\n }\n\n var oldKeys = Object.keys(oldInput);\n var newKeys = Object.keys(newInput);\n var len = oldKeys.length;\n if (len !== newKeys.length) {\n return true;\n }\n\n for (var i = len; i--; ) {\n var key = oldKeys[i];\n if (!(key in newInput && oldInput[key] === newInput[key])) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nvar componentProto;\n\n/**\n * Base component type.\n *\n * NOTE: Any methods that are prefixed with an underscore should be considered private!\n */\nfunction Component(id) {\n EventEmitter.call(this);\n this.id = id;\n this.___state = null;\n this.___rootNode = null;\n this.___subscriptions = null;\n this.___domEventListenerHandles = null;\n this.___bubblingDomEvents = null; // Used to keep track of bubbling DOM events for components rendered on the server\n this.___customEvents = null;\n this.___scope = null;\n this.___renderInput = null;\n this.___input = undefined;\n this.___mounted = false;\n this.___global = undefined;\n this.___destroyed = false;\n this.___updateQueued = false;\n this.___dirty = false;\n this.___settingInput = false;\n this.___host = undefined;\n\n var ssrKeyedElements = keyedElementsByComponentId[id];\n\n if (ssrKeyedElements) {\n this.___keyedElements = ssrKeyedElements;\n delete keyedElementsByComponentId[id];\n } else {\n this.___keyedElements = {};\n }\n}\n\nComponent.prototype = componentProto = {\n ___isComponent: true,\n\n subscribeTo: function (target) {\n if (!target) {\n throw TypeError();\n }\n\n var subscriptions =\n this.___subscriptions ||\n (this.___subscriptions = new SubscriptionTracker());\n\n var subscribeToOptions = target.___isComponent\n ? COMPONENT_SUBSCRIBE_TO_OPTIONS\n : NON_COMPONENT_SUBSCRIBE_TO_OPTIONS;\n\n return subscriptions.subscribeTo(target, subscribeToOptions);\n },\n\n emit: function (eventType) {\n var customEvents = this.___customEvents;\n var target;\n\n if (customEvents && (target = customEvents[eventType])) {\n var targetMethodName = target[0];\n var isOnce = target[1];\n var extraArgs = target[2];\n var args = slice.call(arguments, 1);\n\n handleCustomEventWithMethodListener(\n this,\n targetMethodName,\n args,\n extraArgs\n );\n\n if (isOnce) {\n delete customEvents[eventType];\n }\n }\n\n return emit.apply(this, arguments);\n },\n getElId: function (key, index) {\n if (!key) {\n return this.id;\n }\n return resolveComponentIdHelper(this, key, index);\n },\n getEl: function (key, index) {\n if (key) {\n var keyedElement =\n this.___keyedElements[\"@\" + resolveKeyHelper(key, index)];\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n if (\n keyedElement &&\n keyedElement.nodeType !== 1 /* Node.ELEMENT_NODE */\n ) {\n throw new Error(\n \"Using 'getEl(key)' to get a component instance is not supported, did you mean 'getComponent(key)'?\"\n );\n }\n }\n\n return keyedElement;\n } else {\n return this.el;\n }\n },\n getEls: function (key) {\n key = key + \"[]\";\n\n var els = [];\n var i = 0;\n var el;\n while ((el = this.getEl(key, i))) {\n els.push(el);\n i++;\n }\n return els;\n },\n getComponent: function (key, index) {\n var rootNode = this.___keyedElements[\"@\" + resolveKeyHelper(key, index)];\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n if (/\\[\\]$/.test(key)) {\n throw new Error(\n \"A repeated key[] was passed to getComponent. Use a non-repeating key if there is only one of these components.\"\n );\n }\n }\n\n return rootNode && componentsByDOMNode.get(rootNode);\n },\n getComponents: function (key) {\n var lookup = this.___keyedElements[\"@\" + key + \"[]\"];\n return lookup\n ? Object.keys(lookup)\n .map(function (key) {\n return componentsByDOMNode.get(lookup[key]);\n })\n .filter(Boolean)\n : [];\n },\n destroy: function () {\n if (this.___destroyed) {\n return;\n }\n\n var root = this.___rootNode;\n\n this.___destroyShallow();\n\n var nodes = root.nodes;\n\n nodes.forEach(function (node) {\n destroyNodeRecursive(node);\n\n if (eventDelegation.___handleNodeDetach(node) !== false) {\n node.parentNode.removeChild(node);\n }\n });\n\n root.detached = true;\n\n delete componentLookup[this.id];\n this.___keyedElements = {};\n },\n\n ___destroyShallow: function () {\n if (this.___destroyed) {\n return;\n }\n\n this.___emitDestroy();\n this.___destroyed = true;\n\n componentsByDOMNode.set(this.___rootNode, undefined);\n\n this.___rootNode = null;\n\n // Unsubscribe from all DOM events\n this.___removeDOMEventListeners();\n\n var subscriptions = this.___subscriptions;\n if (subscriptions) {\n subscriptions.removeAllListeners();\n this.___subscriptions = null;\n }\n },\n\n isDestroyed: function () {\n return this.___destroyed;\n },\n get state() {\n return this.___state;\n },\n set state(newState) {\n var state = this.___state;\n if (!state && !newState) {\n return;\n }\n\n if (!state) {\n state = this.___state = new this.___State(this);\n }\n\n state.___replace(newState || {});\n\n if (state.___dirty) {\n this.___queueUpdate();\n }\n\n if (!newState) {\n this.___state = null;\n }\n },\n setState: function (name, value) {\n var state = this.___state;\n\n if (!state) {\n state = this.___state = new this.___State(this);\n }\n if (typeof name == \"object\") {\n // Merge in the new state with the old state\n var newState = name;\n for (var k in newState) {\n if (hasOwnProperty.call(newState, k)) {\n state.___set(k, newState[k], true /* ensure:true */);\n }\n }\n } else {\n state.___set(name, value, true /* ensure:true */);\n }\n },\n\n setStateDirty: function (name, value) {\n var state = this.___state;\n\n if (arguments.length == 1) {\n value = state[name];\n }\n\n state.___set(\n name,\n value,\n true /* ensure:true */,\n true /* forceDirty:true */\n );\n },\n\n replaceState: function (newState) {\n this.___state.___replace(newState);\n },\n\n get input() {\n return this.___input;\n },\n set input(newInput) {\n if (this.___settingInput) {\n this.___input = newInput;\n } else {\n this.___setInput(newInput);\n }\n },\n\n ___setInput: function (newInput, onInput, out) {\n onInput = onInput || this.onInput;\n var updatedInput;\n\n var oldInput = this.___input;\n this.___input = undefined;\n this.___context = (out && out[CONTEXT_KEY]) || this.___context;\n\n if (onInput) {\n // We need to set a flag to preview `this.input = foo` inside\n // onInput causing infinite recursion\n this.___settingInput = true;\n updatedInput = onInput.call(this, newInput || {}, out);\n this.___settingInput = false;\n }\n\n newInput = this.___renderInput = updatedInput || newInput;\n\n if ((this.___dirty = checkInputChanged(this, oldInput, newInput))) {\n this.___queueUpdate();\n }\n\n if (this.___input === undefined) {\n this.___input = newInput;\n if (newInput && newInput.$global) {\n this.___global = newInput.$global;\n }\n }\n\n return newInput;\n },\n\n forceUpdate: function () {\n this.___dirty = true;\n this.___queueUpdate();\n },\n\n ___queueUpdate: function () {\n if (!this.___updateQueued) {\n this.___updateQueued = true;\n updateManager.___queueComponentUpdate(this);\n }\n },\n\n update: function () {\n if (this.___destroyed === true || this.___isDirty === false) {\n return;\n }\n\n var input = this.___input;\n var state = this.___state;\n\n if (this.___dirty === false && state !== null && state.___dirty === true) {\n if (processUpdateHandlers(this, state.___changes, state.___old, state)) {\n state.___dirty = false;\n }\n }\n\n if (this.___isDirty === true) {\n // The UI component is still dirty after process state handlers\n // then we should rerender\n\n if (this.shouldUpdate(input, state) !== false) {\n this.___scheduleRerender();\n }\n }\n\n this.___reset();\n },\n\n get ___isDirty() {\n return (\n this.___dirty === true ||\n (this.___state !== null && this.___state.___dirty === true)\n );\n },\n\n ___reset: function () {\n this.___dirty = false;\n this.___updateQueued = false;\n this.___renderInput = null;\n var state = this.___state;\n if (state) {\n state.___reset();\n }\n },\n\n shouldUpdate: function () {\n return true;\n },\n\n ___scheduleRerender: function () {\n var self = this;\n var renderer = self.___renderer;\n\n if (!renderer) {\n throw TypeError();\n }\n\n var input = this.___renderInput || this.___input;\n\n updateManager.___batchUpdate(function () {\n self.___rerender(input, false).afterInsert(self.___host);\n });\n\n this.___reset();\n },\n\n ___rerender: function (input, isHydrate) {\n var host = this.___host;\n var globalData = this.___global;\n var rootNode = this.___rootNode;\n var renderer = this.___renderer;\n var createOut = renderer.createOut || defaultCreateOut;\n var out = createOut(globalData);\n out.sync();\n out.___host = this.___host;\n out[CONTEXT_KEY] = this.___context;\n\n var componentsContext = getComponentsContext(out);\n var globalComponentsContext = componentsContext.___globalContext;\n globalComponentsContext.___rerenderComponent = this;\n globalComponentsContext.___isHydrate = isHydrate;\n\n renderer(input, out);\n\n var result = new RenderResult(out);\n\n var targetNode = out.___getOutput().___firstChild;\n\n morphdom(rootNode, targetNode, host, componentsContext);\n\n return result;\n },\n\n ___detach: function () {\n var root = this.___rootNode;\n root.remove();\n return root;\n },\n\n ___removeDOMEventListeners: function () {\n var eventListenerHandles = this.___domEventListenerHandles;\n if (eventListenerHandles) {\n eventListenerHandles.forEach(removeListener);\n this.___domEventListenerHandles = null;\n }\n },\n\n get ___rawState() {\n var state = this.___state;\n return state && state.___raw;\n },\n\n ___setCustomEvents: function (customEvents, scope) {\n var finalCustomEvents = (this.___customEvents = {});\n this.___scope = scope;\n\n customEvents.forEach(function (customEvent) {\n var eventType = customEvent[0];\n var targetMethodName = customEvent[1];\n var isOnce = customEvent[2];\n var extraArgs = customEvent[3];\n\n if (targetMethodName) {\n finalCustomEvents[eventType] = [targetMethodName, isOnce, extraArgs];\n }\n });\n },\n\n get el() {\n return walkFragments(this.___rootNode);\n },\n\n get els() {\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n complain(\n 'The \"this.els\" attribute is deprecated. Please use \"this.getEls(key)\" instead.'\n );\n }\n return (this.___rootNode ? this.___rootNode.nodes : []).filter(function (\n el\n ) {\n return el.nodeType === ELEMENT_NODE;\n });\n },\n\n ___emit: emit,\n ___emitCreate(input, out) {\n this.onCreate && this.onCreate(input, out);\n this.___emit(\"create\", input, out);\n },\n\n ___emitRender(out) {\n this.onRender && this.onRender(out);\n this.___emit(\"render\", out);\n },\n\n ___emitUpdate() {\n this.onUpdate && this.onUpdate();\n this.___emit(\"update\");\n },\n\n ___emitMount() {\n this.onMount && this.onMount();\n this.___emit(\"mount\");\n },\n\n ___emitDestroy() {\n this.onDestroy && this.onDestroy();\n this.___emit(\"destroy\");\n }\n};\n\ncomponentProto.elId = componentProto.getElId;\ncomponentProto.___update = componentProto.update;\ncomponentProto.___destroy = componentProto.destroy;\n\n// Add all of the following DOM methods to Component.prototype:\n// - appendTo(referenceEl)\n// - replace(referenceEl)\n// - replaceChildrenOf(referenceEl)\n// - insertBefore(referenceEl)\n// - insertAfter(referenceEl)\n// - prependTo(referenceEl)\ndomInsert(\n componentProto,\n function getEl(component) {\n return component.___detach();\n },\n function afterInsert(component) {\n return component;\n }\n);\n\ninherit(Component, EventEmitter);\n\nmodule.exports = Component;\n"],"file":"Component.js"}
@@ -35,10 +35,10 @@ function ComponentsContext(out, parentComponentsContext) {
35
35
  }
36
36
 
37
37
  ComponentsContext.prototype = {
38
- z_: function (doc) {
38
+ z_: function (host) {
39
39
  var componentDefs = this.b_;
40
40
 
41
- ComponentsContext._R_(componentDefs, doc);
41
+ ComponentsContext._R_(componentDefs, host);
42
42
 
43
43
  this.y_.emit("_S_");
44
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/components/ComponentsContext.js"],"names":["GlobalComponentsContext","require","ComponentsContext","out","parentComponentsContext","globalComponentsContext","componentDef","nestedContextsForParent","push","global","undefined","prototype","doc","componentDefs","emit","getComponentsContext","module","exports"],"mappings":"AAAA;AACA,IAAIA,uBAAuB,GAAGC,OAAO,CAAC,2BAAD,CAArC;;AAEA,SAASC,iBAAT,CAA2BC,GAA3B,EAAgCC,uBAAhC,EAAyD;AACvD,MAAIC,uBAAJ;AACA,MAAIC,YAAJ;;AAEA,MAAIF,uBAAJ,EAA6B;AAC3BC,IAAAA,uBAAuB,GAAGD,uBAAuB,GAAjD;AACAE,IAAAA,YAAY,GAAGF,uBAAuB,GAAtC;;AAEA,QAAIG,uBAAJ;AACA;AACE,MAAEA,uBAAuB,GAAGH,uBAAuB,IAAnD,CADF;AAEE;AACAG,MAAAA,uBAAuB,GAAGH,uBAAuB,IAAvB,GAA4C,EAAtE;AACD;;AAEDG,IAAAA,uBAAuB,CAACC,IAAxB,CAA6B,IAA7B;AACD,GAZD,MAYO;AACLH,IAAAA,uBAAuB,GAAGF,GAAG,CAACM,MAAJ,GAA1B;AACA,QAAIJ,uBAAuB,KAAKK,SAAhC,EAA2C;AACzCP,MAAAA,GAAG,CAACM,MAAJ,MAA2BJ,uBAAuB;AAChD,UAAIL,uBAAJ,CAA4BG,GAA5B,CADF;AAED;AACF;;AAED,YAAwBE,uBAAxB;AACA,YAAqB,EAArB;AACA,YAAcF,GAAd;AACA,YAAuBG,YAAvB;AACA,aAAyBI,SAAzB;AACA;AACEN,EAAAA,uBAAuB,IAAIA,uBAAuB,GADpD;AAED;;AAEDF,iBAAiB,CAACS,SAAlB,GAA8B;AAC5B,MAAmB,UAAUC,GAAV,EAAe;AAChC,QAAIC,aAAa,GAAG,OAApB;;AAEAX,IAAAA,iBAAiB,IAAjB,CAAwCW,aAAxC,EAAuDD,GAAvD;;AAEA,YAAYE,IAAZ;;AAEA;AACA;AACA,YAAYL,MAAZ,MAAmCC,SAAnC;;AAEA,WAAOG,aAAP;AACD,GAb2B,EAA9B;;;AAgBA,SAASE,oBAAT,CAA8BZ,GAA9B,EAAmC;AACjC,SAAOA,GAAG,GAAH,KAAsBA,GAAG,GAAH,GAAoB,IAAID,iBAAJ,CAAsBC,GAAtB,CAA1C,CAAP;AACD;;AAEDa,MAAM,CAACC,OAAP,GAAiBA,OAAO,GAAGf,iBAA3B;;AAEAe,OAAO,GAAP,GAAkCF,oBAAlC","sourcesContent":["\"use strict\";\nvar GlobalComponentsContext = require(\"./GlobalComponentsContext\");\n\nfunction ComponentsContext(out, parentComponentsContext) {\n var globalComponentsContext;\n var componentDef;\n\n if (parentComponentsContext) {\n globalComponentsContext = parentComponentsContext.___globalContext;\n componentDef = parentComponentsContext.___componentDef;\n\n var nestedContextsForParent;\n if (\n !(nestedContextsForParent = parentComponentsContext.___nestedContexts)\n ) {\n nestedContextsForParent = parentComponentsContext.___nestedContexts = [];\n }\n\n nestedContextsForParent.push(this);\n } else {\n globalComponentsContext = out.global.___components;\n if (globalComponentsContext === undefined) {\n out.global.___components = globalComponentsContext =\n new GlobalComponentsContext(out);\n }\n }\n\n this.___globalContext = globalComponentsContext;\n this.___components = [];\n this.___out = out;\n this.___componentDef = componentDef;\n this.___nestedContexts = undefined;\n this.___isPreserved =\n parentComponentsContext && parentComponentsContext.___isPreserved;\n}\n\nComponentsContext.prototype = {\n ___initComponents: function (doc) {\n var componentDefs = this.___components;\n\n ComponentsContext.___initClientRendered(componentDefs, doc);\n\n this.___out.emit(\"___componentsInitialized\");\n\n // Reset things stored in global since global is retained for\n // future renders\n this.___out.global.___components = undefined;\n\n return componentDefs;\n }\n};\n\nfunction getComponentsContext(out) {\n return out.___components || (out.___components = new ComponentsContext(out));\n}\n\nmodule.exports = exports = ComponentsContext;\n\nexports.___getComponentsContext = getComponentsContext;\n"],"file":"ComponentsContext.js"}
1
+ {"version":3,"sources":["../../../src/runtime/components/ComponentsContext.js"],"names":["GlobalComponentsContext","require","ComponentsContext","out","parentComponentsContext","globalComponentsContext","componentDef","nestedContextsForParent","push","global","undefined","prototype","host","componentDefs","emit","getComponentsContext","module","exports"],"mappings":"AAAA;AACA,IAAIA,uBAAuB,GAAGC,OAAO,CAAC,2BAAD,CAArC;;AAEA,SAASC,iBAAT,CAA2BC,GAA3B,EAAgCC,uBAAhC,EAAyD;AACvD,MAAIC,uBAAJ;AACA,MAAIC,YAAJ;;AAEA,MAAIF,uBAAJ,EAA6B;AAC3BC,IAAAA,uBAAuB,GAAGD,uBAAuB,GAAjD;AACAE,IAAAA,YAAY,GAAGF,uBAAuB,GAAtC;;AAEA,QAAIG,uBAAJ;AACA;AACE,MAAEA,uBAAuB,GAAGH,uBAAuB,IAAnD,CADF;AAEE;AACAG,MAAAA,uBAAuB,GAAGH,uBAAuB,IAAvB,GAA4C,EAAtE;AACD;;AAEDG,IAAAA,uBAAuB,CAACC,IAAxB,CAA6B,IAA7B;AACD,GAZD,MAYO;AACLH,IAAAA,uBAAuB,GAAGF,GAAG,CAACM,MAAJ,GAA1B;AACA,QAAIJ,uBAAuB,KAAKK,SAAhC,EAA2C;AACzCP,MAAAA,GAAG,CAACM,MAAJ,MAA2BJ,uBAAuB;AAChD,UAAIL,uBAAJ,CAA4BG,GAA5B,CADF;AAED;AACF;;AAED,YAAwBE,uBAAxB;AACA,YAAqB,EAArB;AACA,YAAcF,GAAd;AACA,YAAuBG,YAAvB;AACA,aAAyBI,SAAzB;AACA;AACEN,EAAAA,uBAAuB,IAAIA,uBAAuB,GADpD;AAED;;AAEDF,iBAAiB,CAACS,SAAlB,GAA8B;AAC5B,MAAmB,UAAUC,IAAV,EAAgB;AACjC,QAAIC,aAAa,GAAG,OAApB;;AAEAX,IAAAA,iBAAiB,IAAjB,CAAwCW,aAAxC,EAAuDD,IAAvD;;AAEA,YAAYE,IAAZ;;AAEA;AACA;AACA,YAAYL,MAAZ,MAAmCC,SAAnC;;AAEA,WAAOG,aAAP;AACD,GAb2B,EAA9B;;;AAgBA,SAASE,oBAAT,CAA8BZ,GAA9B,EAAmC;AACjC,SAAOA,GAAG,GAAH,KAAsBA,GAAG,GAAH,GAAoB,IAAID,iBAAJ,CAAsBC,GAAtB,CAA1C,CAAP;AACD;;AAEDa,MAAM,CAACC,OAAP,GAAiBA,OAAO,GAAGf,iBAA3B;;AAEAe,OAAO,GAAP,GAAkCF,oBAAlC","sourcesContent":["\"use strict\";\nvar GlobalComponentsContext = require(\"./GlobalComponentsContext\");\n\nfunction ComponentsContext(out, parentComponentsContext) {\n var globalComponentsContext;\n var componentDef;\n\n if (parentComponentsContext) {\n globalComponentsContext = parentComponentsContext.___globalContext;\n componentDef = parentComponentsContext.___componentDef;\n\n var nestedContextsForParent;\n if (\n !(nestedContextsForParent = parentComponentsContext.___nestedContexts)\n ) {\n nestedContextsForParent = parentComponentsContext.___nestedContexts = [];\n }\n\n nestedContextsForParent.push(this);\n } else {\n globalComponentsContext = out.global.___components;\n if (globalComponentsContext === undefined) {\n out.global.___components = globalComponentsContext =\n new GlobalComponentsContext(out);\n }\n }\n\n this.___globalContext = globalComponentsContext;\n this.___components = [];\n this.___out = out;\n this.___componentDef = componentDef;\n this.___nestedContexts = undefined;\n this.___isPreserved =\n parentComponentsContext && parentComponentsContext.___isPreserved;\n}\n\nComponentsContext.prototype = {\n ___initComponents: function (host) {\n var componentDefs = this.___components;\n\n ComponentsContext.___initClientRendered(componentDefs, host);\n\n this.___out.emit(\"___componentsInitialized\");\n\n // Reset things stored in global since global is retained for\n // future renders\n this.___out.global.___components = undefined;\n\n return componentDefs;\n }\n};\n\nfunction getComponentsContext(out) {\n return out.___components || (out.___components = new ComponentsContext(out));\n}\n\nmodule.exports = exports = ComponentsContext;\n\nexports.___getComponentsContext = getComponentsContext;\n"],"file":"ComponentsContext.js"}
@@ -72,11 +72,11 @@ function addDelegatedEventHandler(eventType) {
72
72
  }
73
73
  }
74
74
 
75
- function addDelegatedEventHandlerToDoc(eventType, doc) {
76
- var body = doc.body || doc;
77
- var listeners = doc[listenersAttachedKey] = doc[listenersAttachedKey] || {};
75
+ function addDelegatedEventHandlerToHost(eventType, host) {
76
+ var listeners = host[listenersAttachedKey] =
77
+ host[listenersAttachedKey] || {};
78
78
  if (!listeners[eventType]) {
79
- body.addEventListener(
79
+ (host.body || host).addEventListener(
80
80
  eventType,
81
81
  listeners[eventType] = function (event) {
82
82
  var propagationStopped = false;
@@ -99,8 +99,8 @@ function addDelegatedEventHandlerToDoc(eventType, doc) {
99
99
  // `getAttribute` function in IE 11.
100
100
  // See https://github.com/marko-js/marko/issues/796
101
101
  curNode.correspondingUseElement || (
102
-
103
-
102
+ // in some browsers the event target can be a text node
103
+ // one example being dragenter in firefox.
104
104
  curNode.nodeType === TEXT_NODE ? curNode.parentNode : curNode);
105
105
 
106
106
  // Search up the tree looking DOM events mapped to target
@@ -133,9 +133,9 @@ exports.___ = noop;
133
133
  exports._Z_ = delegateEvent;
134
134
  exports.a__ = getEventFromEl;
135
135
  exports._D_ = addDelegatedEventHandler;
136
- exports.an_ = function (doc) {
136
+ exports.an_ = function (host) {
137
137
  Object.keys(delegatedEvents).forEach(function (eventType) {
138
- addDelegatedEventHandlerToDoc(eventType, doc);
138
+ addDelegatedEventHandlerToHost(eventType, host);
139
139
  });
140
140
  };
141
141
  //# sourceMappingURL=event-delegation.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/components/event-delegation.js"],"names":["componentsUtil","require","runtimeId","componentLookup","getMarkoPropsFromEl","TEXT_NODE","listenersAttachedKey","delegatedEvents","getEventFromEl","el","eventName","virtualProps","eventInfo","split","length","parseInt","delegateEvent","node","target","event","targetMethod","targetComponentId","isOnce","extraArgs","targetComponent","targetFunc","Error","apply","concat","call","addDelegatedEventHandler","eventType","addDelegatedEventHandlerToDoc","doc","body","listeners","addEventListener","propagationStopped","oldStopPropagation","stopPropagation","curNode","correspondingUseElement","nodeType","parentNode","propName","getAttribute","noop","exports","Object","keys","forEach"],"mappings":"aAAA,IAAIA,cAAc,GAAGC,OAAO,CAAC,QAAD,CAA5B;AACA,IAAIC,SAAS,GAAGF,cAAc,IAA9B;AACA,IAAIG,eAAe,GAAGH,cAAc,GAApC;AACA,IAAII,mBAAmB,GAAGJ,cAAc,IAAxC;;AAEA,IAAIK,SAAS,GAAG,CAAhB;;AAEA;AACA;AACA,IAAIC,oBAAoB,GAAG,SAASJ,SAApC;AACA,IAAIK,eAAe,GAAG,EAAtB;;AAEA,SAASC,cAAT,CAAwBC,EAAxB,EAA4BC,SAA5B,EAAuC;AACrC,MAAIC,YAAY,GAAGP,mBAAmB,CAACK,EAAD,CAAtC;AACA,MAAIG,SAAS,GAAGD,YAAY,CAACD,SAAD,CAA5B;;AAEA,MAAI,OAAOE,SAAP,KAAqB,QAAzB,EAAmC;AACjCA,IAAAA,SAAS,GAAGA,SAAS,CAACC,KAAV,CAAgB,GAAhB,CAAZ;AACA,QAAID,SAAS,CAAC,CAAD,CAAb,EAAkB;AAChBA,MAAAA,SAAS,CAAC,CAAD,CAAT,GAAeA,SAAS,CAAC,CAAD,CAAT,KAAiB,MAAhC;AACD;AACD,QAAIA,SAAS,CAACE,MAAV,IAAoB,CAAxB,EAA2B;AACzBF,MAAAA,SAAS,CAAC,CAAD,CAAT,GAAeG,QAAQ,CAACH,SAAS,CAAC,CAAD,CAAV,EAAe,EAAf,CAAvB;AACD;AACF;;AAED,SAAOA,SAAP;AACD;;AAED,SAASI,aAAT,CAAuBC,IAAvB,EAA6BP,SAA7B,EAAwCQ,MAAxC,EAAgDC,KAAhD,EAAuD;AACrD,MAAIC,YAAY,GAAGF,MAAM,CAAC,CAAD,CAAz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GAAgB,CAAE;;AAElBC,OAAO,IAAP,GAA8BD,IAA9B;AACAC,OAAO,IAAP,GAA8BD,IAA9B;AACAC,OAAO,IAAP,GAA2B/B,aAA3B;AACA+B,OAAO,IAAP,GAA4BvC,cAA5B;AACAuC,OAAO,IAAP,GAAsCjB,wBAAtC;AACAiB,OAAO,IAAP,GAAkB,UAAUd,GAAV,EAAe;AAC/Be,EAAAA,MAAM,CAACC,IAAP,CAAY1C,eAAZ,EAA6B2C,OAA7B,CAAqC,UAAUnB,SAAV,EAAqB;AACxDC,IAAAA,6BAA6B,CAACD,SAAD,EAAYE,GAAZ,CAA7B;AACD,GAFD;AAGD,CAJD","sourcesContent":["var componentsUtil = require(\"./util\");\nvar runtimeId = componentsUtil.___runtimeId;\nvar componentLookup = componentsUtil.___componentLookup;\nvar getMarkoPropsFromEl = componentsUtil.___getMarkoPropsFromEl;\n\nvar TEXT_NODE = 3;\n\n// We make our best effort to allow multiple marko runtimes to be loaded in the\n// same window. Each marko runtime will get its own unique runtime ID.\nvar listenersAttachedKey = \"$MDE\" + runtimeId;\nvar delegatedEvents = {};\n\nfunction getEventFromEl(el, eventName) {\n var virtualProps = getMarkoPropsFromEl(el);\n var eventInfo = virtualProps[eventName];\n\n if (typeof eventInfo === \"string\") {\n eventInfo = eventInfo.split(\" \");\n if (eventInfo[2]) {\n eventInfo[2] = eventInfo[2] === \"true\";\n }\n if (eventInfo.length == 4) {\n eventInfo[3] = parseInt(eventInfo[3], 10);\n }\n }\n\n return eventInfo;\n}\n\nfunction delegateEvent(node, eventName, target, event) {\n var targetMethod = target[0];\n var targetComponentId = target[1];\n var isOnce = target[2];\n var extraArgs = target[3];\n\n if (isOnce) {\n var virtualProps = getMarkoPropsFromEl(node);\n delete virtualProps[eventName];\n }\n\n var targetComponent = componentLookup[targetComponentId];\n\n if (!targetComponent) {\n return;\n }\n\n var targetFunc =\n typeof targetMethod === \"function\"\n ? targetMethod\n : targetComponent[targetMethod];\n if (!targetFunc) {\n throw Error(\"Method not found: \" + targetMethod);\n }\n\n if (extraArgs != null) {\n if (typeof extraArgs === \"number\") {\n extraArgs = targetComponent.___bubblingDomEvents[extraArgs];\n }\n }\n\n // Invoke the component method\n if (extraArgs) {\n targetFunc.apply(targetComponent, extraArgs.concat(event, node));\n } else {\n targetFunc.call(targetComponent, event, node);\n }\n}\n\nfunction addDelegatedEventHandler(eventType) {\n if (!delegatedEvents[eventType]) {\n delegatedEvents[eventType] = true;\n }\n}\n\nfunction addDelegatedEventHandlerToDoc(eventType, doc) {\n var body = doc.body || doc;\n var listeners = (doc[listenersAttachedKey] = doc[listenersAttachedKey] || {});\n if (!listeners[eventType]) {\n body.addEventListener(\n eventType,\n (listeners[eventType] = function (event) {\n var propagationStopped = false;\n\n // Monkey-patch to fix #97\n var oldStopPropagation = event.stopPropagation;\n\n event.stopPropagation = function () {\n oldStopPropagation.call(event);\n propagationStopped = true;\n };\n\n var curNode = event.target;\n if (!curNode) {\n return;\n }\n\n curNode =\n // event.target of an SVGElementInstance does not have a\n // `getAttribute` function in IE 11.\n // See https://github.com/marko-js/marko/issues/796\n curNode.correspondingUseElement ||\n // in some browsers the event target can be a text node\n // one example being dragenter in firefox.\n (curNode.nodeType === TEXT_NODE ? curNode.parentNode : curNode);\n\n // Search up the tree looking DOM events mapped to target\n // component methods\n var propName = \"on\" + eventType;\n var target;\n\n // Attributes will have the following form:\n // on<event_type>(\"<target_method>|<component_id>\")\n\n do {\n if ((target = getEventFromEl(curNode, propName))) {\n delegateEvent(curNode, propName, target, event);\n\n if (propagationStopped) {\n break;\n }\n }\n } while ((curNode = curNode.parentNode) && curNode.getAttribute);\n }),\n true\n );\n }\n}\n\nfunction noop() {}\n\nexports.___handleNodeAttach = noop;\nexports.___handleNodeDetach = noop;\nexports.___delegateEvent = delegateEvent;\nexports.___getEventFromEl = getEventFromEl;\nexports.___addDelegatedEventHandler = addDelegatedEventHandler;\nexports.___init = function (doc) {\n Object.keys(delegatedEvents).forEach(function (eventType) {\n addDelegatedEventHandlerToDoc(eventType, doc);\n });\n};\n"],"file":"event-delegation.js"}
1
+ {"version":3,"sources":["../../../src/runtime/components/event-delegation.js"],"names":["componentsUtil","require","runtimeId","componentLookup","getMarkoPropsFromEl","TEXT_NODE","listenersAttachedKey","delegatedEvents","getEventFromEl","el","eventName","virtualProps","eventInfo","split","length","parseInt","delegateEvent","node","target","event","targetMethod","targetComponentId","isOnce","extraArgs","targetComponent","targetFunc","Error","apply","concat","call","addDelegatedEventHandler","eventType","addDelegatedEventHandlerToHost","host","listeners","body","addEventListener","propagationStopped","oldStopPropagation","stopPropagation","curNode","correspondingUseElement","nodeType","parentNode","propName","getAttribute","noop","exports","Object","keys","forEach"],"mappings":"aAAA,IAAIA,cAAc,GAAGC,OAAO,CAAC,QAAD,CAA5B;AACA,IAAIC,SAAS,GAAGF,cAAc,IAA9B;AACA,IAAIG,eAAe,GAAGH,cAAc,GAApC;AACA,IAAII,mBAAmB,GAAGJ,cAAc,IAAxC;;AAEA,IAAIK,SAAS,GAAG,CAAhB;;AAEA;AACA;AACA,IAAIC,oBAAoB,GAAG,SAASJ,SAApC;AACA,IAAIK,eAAe,GAAG,EAAtB;;AAEA,SAASC,cAAT,CAAwBC,EAAxB,EAA4BC,SAA5B,EAAuC;AACrC,MAAIC,YAAY,GAAGP,mBAAmB,CAACK,EAAD,CAAtC;AACA,MAAIG,SAAS,GAAGD,YAAY,CAACD,SAAD,CAA5B;;AAEA,MAAI,OAAOE,SAAP,KAAqB,QAAzB,EAAmC;AACjCA,IAAAA,SAAS,GAAGA,SAAS,CAACC,KAAV,CAAgB,GAAhB,CAAZ;AACA,QAAID,SAAS,CAAC,CAAD,CAAb,EAAkB;AAChBA,MAAAA,SAAS,CAAC,CAAD,CAAT,GAAeA,SAAS,CAAC,CAAD,CAAT,KAAiB,MAAhC;AACD;AACD,QAAIA,SAAS,CAACE,MAAV,IAAoB,CAAxB,EAA2B;AACzBF,MAAAA,SAAS,CAAC,CAAD,CAAT,GAAeG,QAAQ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,KAA5B,CAAb;;AAEA,cAAIkB,kBAAJ,EAAwB;AACtB;AACD;AACF;AACF,OARD,QAQS,CAACG,OAAO,GAAGA,OAAO,CAACG,UAAnB,KAAkCH,OAAO,CAACK,YARnD;AASD,KA5CH;AA6CE,QA7CF;;AA+CD;AACF;;AAED,SAASC,IAAT,GAAgB,CAAE;;AAElBC,OAAO,IAAP,GAA8BD,IAA9B;AACAC,OAAO,IAAP,GAA8BD,IAA9B;AACAC,OAAO,IAAP,GAA2B/B,aAA3B;AACA+B,OAAO,IAAP,GAA4BvC,cAA5B;AACAuC,OAAO,IAAP,GAAsCjB,wBAAtC;AACAiB,OAAO,IAAP,GAAkB,UAAUd,IAAV,EAAgB;AAChCe,EAAAA,MAAM,CAACC,IAAP,CAAY1C,eAAZ,EAA6B2C,OAA7B,CAAqC,UAAUnB,SAAV,EAAqB;AACxDC,IAAAA,8BAA8B,CAACD,SAAD,EAAYE,IAAZ,CAA9B;AACD,GAFD;AAGD,CAJD","sourcesContent":["var componentsUtil = require(\"./util\");\nvar runtimeId = componentsUtil.___runtimeId;\nvar componentLookup = componentsUtil.___componentLookup;\nvar getMarkoPropsFromEl = componentsUtil.___getMarkoPropsFromEl;\n\nvar TEXT_NODE = 3;\n\n// We make our best effort to allow multiple marko runtimes to be loaded in the\n// same window. Each marko runtime will get its own unique runtime ID.\nvar listenersAttachedKey = \"$MDE\" + runtimeId;\nvar delegatedEvents = {};\n\nfunction getEventFromEl(el, eventName) {\n var virtualProps = getMarkoPropsFromEl(el);\n var eventInfo = virtualProps[eventName];\n\n if (typeof eventInfo === \"string\") {\n eventInfo = eventInfo.split(\" \");\n if (eventInfo[2]) {\n eventInfo[2] = eventInfo[2] === \"true\";\n }\n if (eventInfo.length == 4) {\n eventInfo[3] = parseInt(eventInfo[3], 10);\n }\n }\n\n return eventInfo;\n}\n\nfunction delegateEvent(node, eventName, target, event) {\n var targetMethod = target[0];\n var targetComponentId = target[1];\n var isOnce = target[2];\n var extraArgs = target[3];\n\n if (isOnce) {\n var virtualProps = getMarkoPropsFromEl(node);\n delete virtualProps[eventName];\n }\n\n var targetComponent = componentLookup[targetComponentId];\n\n if (!targetComponent) {\n return;\n }\n\n var targetFunc =\n typeof targetMethod === \"function\"\n ? targetMethod\n : targetComponent[targetMethod];\n if (!targetFunc) {\n throw Error(\"Method not found: \" + targetMethod);\n }\n\n if (extraArgs != null) {\n if (typeof extraArgs === \"number\") {\n extraArgs = targetComponent.___bubblingDomEvents[extraArgs];\n }\n }\n\n // Invoke the component method\n if (extraArgs) {\n targetFunc.apply(targetComponent, extraArgs.concat(event, node));\n } else {\n targetFunc.call(targetComponent, event, node);\n }\n}\n\nfunction addDelegatedEventHandler(eventType) {\n if (!delegatedEvents[eventType]) {\n delegatedEvents[eventType] = true;\n }\n}\n\nfunction addDelegatedEventHandlerToHost(eventType, host) {\n var listeners = (host[listenersAttachedKey] =\n host[listenersAttachedKey] || {});\n if (!listeners[eventType]) {\n (host.body || host).addEventListener(\n eventType,\n (listeners[eventType] = function (event) {\n var propagationStopped = false;\n\n // Monkey-patch to fix #97\n var oldStopPropagation = event.stopPropagation;\n\n event.stopPropagation = function () {\n oldStopPropagation.call(event);\n propagationStopped = true;\n };\n\n var curNode = event.target;\n if (!curNode) {\n return;\n }\n\n curNode =\n // event.target of an SVGElementInstance does not have a\n // `getAttribute` function in IE 11.\n // See https://github.com/marko-js/marko/issues/796\n curNode.correspondingUseElement ||\n // in some browsers the event target can be a text node\n // one example being dragenter in firefox.\n (curNode.nodeType === TEXT_NODE ? curNode.parentNode : curNode);\n\n // Search up the tree looking DOM events mapped to target\n // component methods\n var propName = \"on\" + eventType;\n var target;\n\n // Attributes will have the following form:\n // on<event_type>(\"<target_method>|<component_id>\")\n\n do {\n if ((target = getEventFromEl(curNode, propName))) {\n delegateEvent(curNode, propName, target, event);\n\n if (propagationStopped) {\n break;\n }\n }\n } while ((curNode = curNode.parentNode) && curNode.getAttribute);\n }),\n true\n );\n }\n}\n\nfunction noop() {}\n\nexports.___handleNodeAttach = noop;\nexports.___handleNodeDetach = noop;\nexports.___delegateEvent = delegateEvent;\nexports.___getEventFromEl = getEventFromEl;\nexports.___addDelegatedEventHandler = addDelegatedEventHandler;\nexports.___init = function (host) {\n Object.keys(delegatedEvents).forEach(function (eventType) {\n addDelegatedEventHandlerToHost(eventType, host);\n });\n};\n"],"file":"event-delegation.js"}
@@ -3,7 +3,6 @@
3
3
  var warp10Finalize = require("warp10/finalize");
4
4
  var eventDelegation = require("../event-delegation");
5
5
  var win = window;
6
- var defaultDocument = document;
7
6
  var createFragmentNode =
8
7
  require("../../vdom/morphdom/fragment").ao_;
9
8
  var componentsUtil = require("../util");
@@ -168,11 +167,11 @@ handles)
168
167
  handles.push(removeListener);
169
168
  }
170
169
 
171
- function initComponent(componentDef, doc) {
170
+ function initComponent(componentDef, host) {
172
171
  var component = componentDef.h_;
173
172
 
174
173
  component.I_();
175
- component.X_ = doc;
174
+ component.X_ = host;
176
175
 
177
176
  var isExisting = componentDef._G_;
178
177
 
@@ -225,12 +224,11 @@ function initComponent(componentDef, doc) {
225
224
  * in the components context (nested components are initialized before ancestor components).
226
225
  * @param {Array<marko-components/lib/ComponentDef>} componentDefs An array of ComponentDef instances
227
226
  */
228
- function initClientRendered(componentDefs, doc) {
227
+ function initClientRendered(componentDefs, host) {
228
+ if (!host) host = document;
229
229
  // Ensure that event handlers to handle delegating events are
230
230
  // always attached before initializing any components
231
- eventDelegation.an_(doc);
232
-
233
- doc = doc || defaultDocument;
231
+ eventDelegation.an_(host);
234
232
  var len = componentDefs.length;
235
233
  var componentDef;
236
234
  var i;
@@ -242,7 +240,7 @@ function initClientRendered(componentDefs, doc) {
242
240
 
243
241
  for (i = len; i--;) {
244
242
  componentDef = componentDefs[i];
245
- initComponent(componentDef, doc);
243
+ initComponent(componentDef, host);
246
244
  }
247
245
  }
248
246
 
@@ -250,7 +248,7 @@ function initClientRendered(componentDefs, doc) {
250
248
  * This method initializes all components that were rendered on the server by iterating over all
251
249
  * of the component IDs.
252
250
  */
253
- function initServerRendered(renderedComponents, doc) {
251
+ function initServerRendered(renderedComponents, host) {
254
252
  var type = typeof renderedComponents;
255
253
  var globalKey = "$";
256
254
  var runtimeId;
@@ -302,10 +300,10 @@ function initServerRendered(renderedComponents, doc) {
302
300
 
303
301
  if (isFromSerializedGlobals) {
304
302
  runtimeId = this.r;
305
- doc = defaultDocument;
303
+ host = document;
306
304
  } else {
307
305
  runtimeId = renderedComponents.r || DEFAULT_RUNTIME_ID;
308
- doc = doc || defaultDocument;
306
+ if (!host) host = document;
309
307
 
310
308
  // eslint-disable-next-line no-constant-condition
311
309
 
@@ -342,8 +340,8 @@ function initServerRendered(renderedComponents, doc) {
342
340
 
343
341
  // Ensure that event handlers to handle delegating events are
344
342
  // always attached before initializing any components
345
- indexServerComponentBoundaries(doc, runtimeId);
346
- eventDelegation.an_(doc);
343
+ indexServerComponentBoundaries(host, runtimeId);
344
+ eventDelegation.an_(host);
347
345
 
348
346
  if (renderedComponents.g) {
349
347
  meta.aq_ = renderedComponents.g;
@@ -362,12 +360,12 @@ function initServerRendered(renderedComponents, doc) {
362
360
  var typeName = meta.ar_[componentDef[1]];
363
361
 
364
362
  return registry.as_(typeName) ?
365
- tryHydrateComponent(componentDef, meta, doc, runtimeId) :
363
+ tryHydrateComponent(componentDef, meta, host, runtimeId) :
366
364
  registry.at_(
367
365
  componentDef,
368
366
  typeName,
369
367
  meta,
370
- doc,
368
+ host,
371
369
  runtimeId);
372
370
 
373
371
  }).
@@ -377,14 +375,14 @@ function initServerRendered(renderedComponents, doc) {
377
375
  return this;
378
376
  }
379
377
 
380
- function tryHydrateComponent(rawDef, meta, doc, runtimeId) {
378
+ function tryHydrateComponent(rawDef, meta, host, runtimeId) {
381
379
  var componentDef = ComponentDef._O_(
382
380
  rawDef,
383
381
  meta.ar_,
384
382
  meta.aq_,
385
383
  registry);
386
384
 
387
- var mount = hydrateComponentAndGetMount(componentDef, doc);
385
+ var mount = hydrateComponentAndGetMount(componentDef, host);
388
386
 
389
387
  if (!mount) {
390
388
  // hydrateComponentAndGetMount will return false if there is not rootNode
@@ -394,11 +392,11 @@ function tryHydrateComponent(rawDef, meta, doc, runtimeId) {
394
392
  deferredDefs.push(componentDef);
395
393
  } else {
396
394
  deferredDefs = [componentDef];
397
- doc.addEventListener("DOMContentLoaded", function () {
398
- indexServerComponentBoundaries(doc, runtimeId);
395
+ document.addEventListener("DOMContentLoaded", function () {
396
+ indexServerComponentBoundaries(host, runtimeId);
399
397
  deferredDefs.
400
398
  map(function (componentDef) {
401
- return hydrateComponentAndGetMount(componentDef, doc);
399
+ return hydrateComponentAndGetMount(componentDef, host);
402
400
  }).
403
401
  reverse().
404
402
  forEach(tryInvoke);
@@ -410,7 +408,7 @@ function tryHydrateComponent(rawDef, meta, doc, runtimeId) {
410
408
  return mount;
411
409
  }
412
410
 
413
- function hydrateComponentAndGetMount(componentDef, doc) {
411
+ function hydrateComponentAndGetMount(componentDef, host) {
414
412
  var componentId = componentDef.id;
415
413
  var component = componentDef.h_;
416
414
  var rootNode = serverComponentRootNodes[componentId];
@@ -423,18 +421,18 @@ function hydrateComponentAndGetMount(componentDef, doc) {
423
421
  componentsByDOMNode.set(rootNode, component);
424
422
 
425
423
  if (componentDef._I_ & FLAG_WILL_RERENDER_IN_BROWSER) {
426
- component.X_ = doc;
424
+ component.X_ = host;
427
425
  renderResult = component._p_(component.Q_, true);
428
426
  trackComponent(componentDef);
429
427
  return function mount() {
430
- renderResult.afterInsert(doc);
428
+ renderResult.afterInsert(host);
431
429
  };
432
430
  } else {
433
431
  trackComponent(componentDef);
434
432
  }
435
433
 
436
434
  return function mount() {
437
- initComponent(componentDef, doc);
435
+ initComponent(componentDef, host);
438
436
  };
439
437
  }
440
438
  }