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
@@ -8,8 +8,8 @@ var addComponentRootToKeyedElements =
8
8
  componentsUtil.ap_;
9
9
  var normalizeComponentKey = componentsUtil.aD_;
10
10
  var VElement = require("../vdom").b__;
11
- var virtualizeElement = VElement.bN_;
12
- var morphAttrs = VElement.bO_;
11
+ var virtualizeElement = VElement.bM_;
12
+ var morphAttrs = VElement.bN_;
13
13
  var eventDelegation = require("../../components/event-delegation");
14
14
  var fragment = require("./fragment");
15
15
  var helpers = require("./helpers");
@@ -21,11 +21,11 @@ var detachedByDOMNode = domData.af_;
21
21
 
22
22
  var insertBefore = helpers.aF_;
23
23
  var insertAfter = helpers.aG_;
24
- var nextSibling = helpers.bS_;
24
+ var nextSibling = helpers.bR_;
25
25
  var firstChild = helpers._r_;
26
26
  var removeChild = helpers.aH_;
27
27
  var createFragmentNode = fragment.ao_;
28
- var beginFragmentNode = fragment.bZ_;
28
+ var beginFragmentNode = fragment.bY_;
29
29
 
30
30
  var ELEMENT_NODE = 1;
31
31
  var TEXT_NODE = 3;
@@ -43,7 +43,7 @@ function isAutoKey(key) {
43
43
  }
44
44
 
45
45
  function compareNodeNames(fromEl, toEl) {
46
- return fromEl.bH_ === toEl.bH_;
46
+ return fromEl.bG_ === toEl.bG_;
47
47
  }
48
48
 
49
49
  function caseInsensitiveCompare(a, b) {
@@ -56,7 +56,7 @@ function onNodeAdded(node, componentsContext) {
56
56
  }
57
57
  }
58
58
 
59
- function morphdom(fromNode, toNode, doc, componentsContext) {
59
+ function morphdom(fromNode, toNode, host, componentsContext) {
60
60
  var globalComponentsContext;
61
61
  var isHydrate = false;
62
62
  var keySequences = Object.create(null);
@@ -74,12 +74,12 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
74
74
  ownerComponent,
75
75
  parentComponent)
76
76
  {
77
- var realNode = vNode.by_(doc, parentEl.namespaceURI);
77
+ var realNode = vNode.bx_(host, parentEl.namespaceURI);
78
78
  insertBefore(realNode, referenceEl, parentEl);
79
79
 
80
80
  if (
81
- vNode.bB_ === ELEMENT_NODE ||
82
- vNode.bB_ === FRAGMENT_NODE)
81
+ vNode.bA_ === ELEMENT_NODE ||
82
+ vNode.bA_ === FRAGMENT_NODE)
83
83
  {
84
84
  if (key) {
85
85
  keysByDOMNode.set(realNode, key);
@@ -88,7 +88,7 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
88
88
  realNode;
89
89
  }
90
90
 
91
- if (vNode.bH_ !== "textarea") {
91
+ if (vNode.bG_ !== "textarea") {
92
92
  morphChildren(realNode, vNode, parentComponent);
93
93
  }
94
94
 
@@ -162,9 +162,9 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
162
162
  var fromComponent;
163
163
 
164
164
  outer: while (curToNodeChild) {
165
- toNextSibling = curToNodeChild.bS_;
166
- curToNodeType = curToNodeChild.bB_;
167
- curToNodeKey = curToNodeChild.bA_;
165
+ toNextSibling = curToNodeChild.bR_;
166
+ curToNodeType = curToNodeChild.bA_;
167
+ curToNodeKey = curToNodeChild.bz_;
168
168
 
169
169
  // Skip <!doctype>
170
170
  if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
@@ -315,11 +315,11 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
315
315
  curToNodeChild.n_ ||
316
316
  caseInsensitiveCompare(
317
317
  curFromNodeChild.nodeName,
318
- curToNodeChild.bH_ || "")))
318
+ curToNodeChild.bG_ || "")))
319
319
 
320
320
  {
321
321
  curVFromNodeChild = virtualizeElement(curFromNodeChild);
322
- curVFromNodeChild.bH_ = curToNodeChild.bH_;
322
+ curVFromNodeChild.bG_ = curToNodeChild.bG_;
323
323
  keysByDOMNode.set(curFromNodeChild, curToNodeKey);
324
324
  referenceComponent.k_[curToNodeKey] =
325
325
  curFromNodeChild;
@@ -339,7 +339,7 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
339
339
  curFromNodeChild = fromNextSibling;
340
340
  continue;
341
341
  } else if (
342
- curToNodeChild.bB_ === FRAGMENT_NODE &&
342
+ curToNodeChild.bA_ === FRAGMENT_NODE &&
343
343
  curFromNodeChild.nodeType === COMMENT_NODE)
344
344
  {
345
345
  var content = curFromNodeChild.nodeValue;
@@ -419,7 +419,7 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
419
419
 
420
420
  if (
421
421
  toNextSibling &&
422
- toNextSibling.bA_ === curFromNodeKey)
422
+ toNextSibling.bz_ === curFromNodeKey)
423
423
  {
424
424
  // Single element swap
425
425
 
@@ -524,18 +524,18 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
524
524
 
525
525
  if (
526
526
  caseInsensitiveCompare(
527
- curVFromNodeChild.bH_,
528
- curToNodeChild.bH_))
527
+ curVFromNodeChild.bG_,
528
+ curToNodeChild.bG_))
529
529
 
530
530
  {
531
- curVFromNodeChild.bH_ = curToNodeChild.bH_;
531
+ curVFromNodeChild.bG_ = curToNodeChild.bG_;
532
532
  }
533
533
  } else {
534
534
  // Skip over nodes that don't look like ours...
535
535
  curFromNodeChild = fromNextSibling;
536
536
  continue;
537
537
  }
538
- } else if (curFromNodeKey = curVFromNodeChild.bA_) {
538
+ } else if (curFromNodeKey = curVFromNodeChild.bz_) {
539
539
  // We have a keyed element here but our target VDOM node
540
540
  // is not keyed so this not doesn't belong
541
541
  isCompatible = false;
@@ -569,14 +569,14 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
569
569
  isHydrate === true &&
570
570
  toNextSibling &&
571
571
  curFromNodeType === TEXT_NODE &&
572
- toNextSibling.bB_ === TEXT_NODE)
572
+ toNextSibling.bA_ === TEXT_NODE)
573
573
  {
574
574
  fromNextSibling = curFromNodeChild.splitText(
575
- curToNodeChild.bU_.length);
575
+ curToNodeChild.bT_.length);
576
576
 
577
577
  }
578
- if (curFromNodeChild.nodeValue !== curToNodeChild.bU_) {
579
- curFromNodeChild.nodeValue = curToNodeChild.bU_;
578
+ if (curFromNodeChild.nodeValue !== curToNodeChild.bT_) {
579
+ curFromNodeChild.nodeValue = curToNodeChild.bT_;
580
580
  }
581
581
  }
582
582
  }
@@ -610,10 +610,10 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
610
610
  }
611
611
 
612
612
  // We have processed all of the "to nodes".
613
- if (fromNode.bY_) {
613
+ if (fromNode.bX_) {
614
614
  // If we are in an unfinished fragment, we have reached the end of the nodes
615
615
  // we were matching up and need to end the fragment
616
- fromNode.bY_(curFromNodeChild);
616
+ fromNode.bX_(curFromNodeChild);
617
617
  } else {
618
618
  // If curFromNodeChild is non-null then we still have some from nodes
619
619
  // left over that need to be removed
@@ -653,10 +653,10 @@ function morphdom(fromNode, toNode, doc, componentsContext) {
653
653
  }
654
654
 
655
655
  function morphEl(fromEl, vFromEl, toEl, parentComponent) {
656
- var nodeName = toEl.bH_;
656
+ var nodeName = toEl.bG_;
657
657
 
658
- var constId = toEl.bJ_;
659
- if (constId !== undefined && vFromEl.bJ_ === constId) {
658
+ var constId = toEl.bI_;
659
+ if (constId !== undefined && vFromEl.bI_ === constId) {
660
660
  return;
661
661
  }
662
662
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtime/vdom/morphdom/index.js"],"names":["specialElHandlers","require","KeySequence","componentsUtil","existingComponentLookup","destroyNodeRecursive","addComponentRootToKeyedElements","normalizeComponentKey","VElement","virtualizeElement","morphAttrs","eventDelegation","fragment","helpers","domData","keysByDOMNode","componentByDOMNode","vElementByDOMNode","detachedByDOMNode","insertBefore","insertAfter","nextSibling","firstChild","removeChild","createFragmentNode","beginFragmentNode","ELEMENT_NODE","TEXT_NODE","COMMENT_NODE","COMPONENT_NODE","FRAGMENT_NODE","DOCTYPE_NODE","isAutoKey","key","compareNodeNames","fromEl","toEl","caseInsensitiveCompare","a","b","toLowerCase","onNodeAdded","node","componentsContext","nodeType","morphdom","fromNode","toNode","doc","globalComponentsContext","isHydrate","keySequences","Object","create","insertVirtualNodeBefore","vNode","referenceEl","parentEl","ownerComponent","parentComponent","realNode","namespaceURI","set","morphChildren","insertVirtualComponentBefore","vComponent","referenceNode","referenceNodeParentEl","component","rootNode","id","morphComponent","detachedNodes","detachNode","parentNode","push","destroyComponent","destroy","curFromNodeChild","curToNodeChild","curToNodeKey","curFromNodeKey","curToNodeType","fromNextSibling","toNextSibling","matchingFromEl","matchingFromComponent","curVFromNodeChild","fromComponent","outer","referenceComponent","undefined","get","curToNodeKeyOriginal","morphEl","nodeName","content","nodeValue","endNode","depth","indexOf","curFromNodeType","isCompatible","splitText","length","fragmentBoundary","vFromEl","constId","specialElHandler","forEach","detachedFromComponent","componentToDestroy","module","exports"],"mappings":"AAAA;AACA,IAAIA,iBAAiB,GAAGC,OAAO,CAAC,qBAAD,CAA/B;AACA,IAAIC,WAAW,GAAGD,OAAO,CAAC,8BAAD,CAAzB;AACA,IAAIE,cAAc,GAAGF,OAAO,CAAC,uBAAD,CAA5B;AACA,IAAIG,uBAAuB,GAAGD,cAAc,GAA5C;AACA,IAAIE,oBAAoB,GAAGF,cAAc,GAAzC;AACA,I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BAAJ,EAAwB;AACtBA,QAAAA,kBAAkB,CAAClC,OAAnB;AACD,OAFD,MAEO,IAAInC,IAAI,CAACgC,UAAT,EAAqB;AAC1BrE,QAAAA,oBAAoB;AAClBqC,QAAAA,IADkB;AAElBoE,QAAAA,qBAAqB,KAAK,IAA1B,IAAkCA,qBAFhB,CAApB;;;AAKA,YAAInG,eAAe,IAAf,CAAoC+B,IAApC,KAA6C,KAAjD,EAAwD;AACtDnB,UAAAA,WAAW,CAACmB,IAAD,CAAX;AACD;AACF;AACF;AACF,GApBD;;AAsBA;;;;AAID;;AAEDsE,MAAM,CAACC,OAAP,GAAiBpE,QAAjB","sourcesContent":["\"use strict\";\nvar specialElHandlers = require(\"./specialElHandlers\");\nvar KeySequence = require(\"../../components/KeySequence\");\nvar componentsUtil = require(\"../../components/util\");\nvar existingComponentLookup = componentsUtil.___componentLookup;\nvar destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;\nvar addComponentRootToKeyedElements =\n componentsUtil.___addComponentRootToKeyedElements;\nvar normalizeComponentKey = componentsUtil.___normalizeComponentKey;\nvar VElement = require(\"../vdom\").___VElement;\nvar virtualizeElement = VElement.___virtualize;\nvar morphAttrs = VElement.___morphAttrs;\nvar eventDelegation = require(\"../../components/event-delegation\");\nvar fragment = require(\"./fragment\");\nvar helpers = require(\"./helpers\");\nvar domData = require(\"../../components/dom-data\");\nvar keysByDOMNode = domData.___keyByDOMNode;\nvar componentByDOMNode = domData.___componentByDOMNode;\nvar vElementByDOMNode = domData.___vElementByDOMNode;\nvar detachedByDOMNode = domData.___detachedByDOMNode;\n\nvar insertBefore = helpers.___insertBefore;\nvar insertAfter = helpers.___insertAfter;\nvar nextSibling = helpers.___nextSibling;\nvar firstChild = helpers.___firstChild;\nvar removeChild = helpers.___removeChild;\nvar createFragmentNode = fragment.___createFragmentNode;\nvar beginFragmentNode = fragment.___beginFragmentNode;\n\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar COMPONENT_NODE = 2;\nvar FRAGMENT_NODE = 12;\nvar DOCTYPE_NODE = 10;\n\n// var FLAG_SIMPLE_ATTRS = 1;\n// var FLAG_CUSTOM_ELEMENT = 2;\n// var FLAG_SPREAD_ATTRS = 4;\n\nfunction isAutoKey(key) {\n return key[0] !== \"@\";\n}\n\nfunction compareNodeNames(fromEl, toEl) {\n return fromEl.___nodeName === toEl.___nodeName;\n}\n\nfunction caseInsensitiveCompare(a, b) {\n return a.toLowerCase() === b.toLowerCase();\n}\n\nfunction onNodeAdded(node, componentsContext) {\n if (node.nodeType === ELEMENT_NODE) {\n eventDelegation.___handleNodeAttach(node, componentsContext);\n }\n}\n\nfunction morphdom(fromNode, toNode, doc, componentsContext) {\n var globalComponentsContext;\n var isHydrate = false;\n var keySequences = Object.create(null);\n\n if (componentsContext) {\n globalComponentsContext = componentsContext.___globalContext;\n isHydrate = globalComponentsContext.___isHydrate;\n }\n\n function insertVirtualNodeBefore(\n vNode,\n key,\n referenceEl,\n parentEl,\n ownerComponent,\n parentComponent\n ) {\n var realNode = vNode.___actualize(doc, parentEl.namespaceURI);\n insertBefore(realNode, referenceEl, parentEl);\n\n if (\n vNode.___nodeType === ELEMENT_NODE ||\n vNode.___nodeType === FRAGMENT_NODE\n ) {\n if (key) {\n keysByDOMNode.set(realNode, key);\n (isAutoKey(key) ? parentComponent : ownerComponent).___keyedElements[\n key\n ] = realNode;\n }\n\n if (vNode.___nodeName !== \"textarea\") {\n morphChildren(realNode, vNode, parentComponent);\n }\n\n onNodeAdded(realNode, componentsContext);\n }\n }\n\n function insertVirtualComponentBefore(\n vComponent,\n referenceNode,\n referenceNodeParentEl,\n component,\n key,\n ownerComponent,\n parentComponent\n ) {\n var rootNode = (component.___rootNode = insertBefore(\n createFragmentNode(),\n referenceNode,\n referenceNodeParentEl\n ));\n componentByDOMNode.set(rootNode, component);\n\n if (key && ownerComponent) {\n key = normalizeComponentKey(key, parentComponent.id);\n addComponentRootToKeyedElements(\n ownerComponent.___keyedElements,\n key,\n rootNode,\n component.id\n );\n keysByDOMNode.set(rootNode, key);\n }\n\n morphComponent(component, vComponent);\n }\n\n function morphComponent(component, vComponent) {\n morphChildren(component.___rootNode, vComponent, component);\n }\n\n var detachedNodes = [];\n\n function detachNode(node, parentNode, ownerComponent) {\n if (node.nodeType === ELEMENT_NODE || node.nodeType === FRAGMENT_NODE) {\n detachedNodes.push(node);\n detachedByDOMNode.set(node, ownerComponent || true);\n } else {\n destroyNodeRecursive(node);\n removeChild(node);\n }\n }\n\n function destroyComponent(component) {\n component.destroy();\n }\n\n function morphChildren(fromNode, toNode, parentComponent) {\n var curFromNodeChild = firstChild(fromNode);\n var curToNodeChild = toNode.___firstChild;\n\n var curToNodeKey;\n var curFromNodeKey;\n var curToNodeType;\n\n var fromNextSibling;\n var toNextSibling;\n var matchingFromEl;\n var matchingFromComponent;\n var curVFromNodeChild;\n var fromComponent;\n\n outer: while (curToNodeChild) {\n toNextSibling = curToNodeChild.___nextSibling;\n curToNodeType = curToNodeChild.___nodeType;\n curToNodeKey = curToNodeChild.___key;\n\n // Skip <!doctype>\n if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {\n curFromNodeChild = nextSibling(curFromNodeChild);\n }\n\n var ownerComponent = curToNodeChild.___ownerComponent || parentComponent;\n var referenceComponent;\n\n if (curToNodeType === COMPONENT_NODE) {\n var component = curToNodeChild.___component;\n if (\n (matchingFromComponent = existingComponentLookup[component.id]) ===\n undefined\n ) {\n if (isHydrate === true) {\n var rootNode = beginFragmentNode(curFromNodeChild, fromNode);\n component.___rootNode = rootNode;\n componentByDOMNode.set(rootNode, component);\n\n if (ownerComponent && curToNodeKey) {\n curToNodeKey = normalizeComponentKey(\n curToNodeKey,\n parentComponent.id\n );\n addComponentRootToKeyedElements(\n ownerComponent.___keyedElements,\n curToNodeKey,\n rootNode,\n component.id\n );\n\n keysByDOMNode.set(rootNode, curToNodeKey);\n }\n\n morphComponent(component, curToNodeChild);\n\n curFromNodeChild = nextSibling(rootNode);\n } else {\n insertVirtualComponentBefore(\n curToNodeChild,\n curFromNodeChild,\n fromNode,\n component,\n curToNodeKey,\n ownerComponent,\n parentComponent\n );\n }\n } else {\n if (matchingFromComponent.___rootNode !== curFromNodeChild) {\n if (\n curFromNodeChild &&\n (fromComponent = componentByDOMNode.get(curFromNodeChild)) &&\n globalComponentsContext.___renderedComponentsById[\n fromComponent.id\n ] === undefined\n ) {\n // The component associated with the current real DOM node was not rendered\n // so we should just remove it out of the real DOM by destroying it\n curFromNodeChild = nextSibling(fromComponent.___rootNode);\n destroyComponent(fromComponent);\n continue;\n }\n\n // We need to move the existing component into\n // the correct location\n insertBefore(\n matchingFromComponent.___rootNode,\n curFromNodeChild,\n fromNode\n );\n } else {\n curFromNodeChild =\n curFromNodeChild && nextSibling(curFromNodeChild);\n }\n\n if (!curToNodeChild.___preserve) {\n morphComponent(component, curToNodeChild);\n }\n }\n\n curToNodeChild = toNextSibling;\n continue;\n } else if (curToNodeKey) {\n curVFromNodeChild = undefined;\n curFromNodeKey = undefined;\n var curToNodeKeyOriginal = curToNodeKey;\n\n if (isAutoKey(curToNodeKey)) {\n if (ownerComponent !== parentComponent) {\n curToNodeKey += \":\" + ownerComponent.id;\n }\n referenceComponent = parentComponent;\n } else {\n referenceComponent = ownerComponent;\n }\n\n // We have a keyed element. This is the fast path for matching\n // up elements\n curToNodeKey = (\n keySequences[referenceComponent.id] ||\n (keySequences[referenceComponent.id] = new KeySequence())\n ).___nextKey(curToNodeKey);\n\n if (curFromNodeChild) {\n curFromNodeKey = keysByDOMNode.get(curFromNodeChild);\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n fromNextSibling = nextSibling(curFromNodeChild);\n }\n\n if (curFromNodeKey === curToNodeKey) {\n // Elements line up. Now we just have to make sure they are compatible\n if (!curToNodeChild.___preserve) {\n // We just skip over the fromNode if it is preserved\n\n if (compareNodeNames(curToNodeChild, curVFromNodeChild)) {\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n } else {\n // Remove the old node\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n\n // Incompatible nodes. Just move the target VNode into the DOM at this position\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n }\n }\n } else {\n matchingFromEl = referenceComponent.___keyedElements[curToNodeKey];\n if (\n matchingFromEl === undefined ||\n matchingFromEl === curFromNodeChild\n ) {\n if (isHydrate === true && curFromNodeChild) {\n if (\n curFromNodeChild.nodeType === ELEMENT_NODE &&\n (curToNodeChild.___preserve ||\n caseInsensitiveCompare(\n curFromNodeChild.nodeName,\n curToNodeChild.___nodeName || \"\"\n ))\n ) {\n curVFromNodeChild = virtualizeElement(curFromNodeChild);\n curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;\n keysByDOMNode.set(curFromNodeChild, curToNodeKey);\n referenceComponent.___keyedElements[curToNodeKey] =\n curFromNodeChild;\n\n if (curToNodeChild.___preserve) {\n vElementByDOMNode.set(curFromNodeChild, curVFromNodeChild);\n } else {\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue;\n } else if (\n curToNodeChild.___nodeType === FRAGMENT_NODE &&\n curFromNodeChild.nodeType === COMMENT_NODE\n ) {\n var content = curFromNodeChild.nodeValue;\n if (content == \"F#\" + curToNodeKeyOriginal) {\n var endNode = curFromNodeChild.nextSibling;\n var depth = 0;\n var nodeValue;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (endNode.nodeType === COMMENT_NODE) {\n nodeValue = endNode.nodeValue;\n if (nodeValue === \"F/\") {\n if (depth === 0) {\n break;\n } else {\n depth--;\n }\n } else if (nodeValue.indexOf(\"F#\") === 0) {\n depth++;\n }\n }\n endNode = endNode.nextSibling;\n }\n\n var fragment = createFragmentNode(\n curFromNodeChild,\n endNode.nextSibling,\n fromNode\n );\n keysByDOMNode.set(fragment, curToNodeKey);\n vElementByDOMNode.set(fragment, curToNodeChild);\n referenceComponent.___keyedElements[curToNodeKey] = fragment;\n removeChild(curFromNodeChild);\n removeChild(endNode);\n\n if (!curToNodeChild.___preserve) {\n morphChildren(fragment, curToNodeChild, parentComponent);\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fragment.nextSibling;\n continue;\n }\n }\n }\n\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n fromNextSibling = curFromNodeChild;\n } else {\n if (detachedByDOMNode.get(matchingFromEl) !== undefined) {\n detachedByDOMNode.set(matchingFromEl, undefined);\n }\n\n if (!curToNodeChild.___preserve) {\n curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);\n\n if (compareNodeNames(curVFromNodeChild, curToNodeChild)) {\n if (fromNextSibling === matchingFromEl) {\n // Single element removal:\n // A <-> A\n // B <-> C <-- We are here\n // C D\n // D\n //\n // Single element swap:\n // A <-> A\n // B <-> C <-- We are here\n // C B\n\n if (\n toNextSibling &&\n toNextSibling.___key === curFromNodeKey\n ) {\n // Single element swap\n\n // We want to stay on the current real DOM node\n fromNextSibling = curFromNodeChild;\n\n // But move the matching element into place\n insertBefore(matchingFromEl, curFromNodeChild, fromNode);\n } else {\n // Single element removal\n\n // We need to remove the current real DOM node\n // and the matching real DOM node will fall into\n // place. We will continue diffing with next sibling\n // after the real DOM node that just fell into place\n fromNextSibling = nextSibling(fromNextSibling);\n\n if (curFromNodeChild) {\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n }\n }\n } else {\n // A <-> A\n // B <-> D <-- We are here\n // C\n // D\n\n // We need to move the matching node into place\n insertAfter(matchingFromEl, curFromNodeChild, fromNode);\n\n if (curFromNodeChild) {\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n }\n }\n\n morphEl(\n matchingFromEl,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n } else {\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n detachNode(matchingFromEl, fromNode, ownerComponent);\n }\n } else {\n // preserve the node\n // but still we need to diff the current from node\n insertBefore(matchingFromEl, curFromNodeChild, fromNode);\n fromNextSibling = curFromNodeChild;\n }\n }\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue;\n }\n\n // The know the target node is not a VComponent node and we know\n // it is also not a preserve node. Let's now match up the HTML\n // element, text node, comment, etc.\n while (curFromNodeChild) {\n fromNextSibling = nextSibling(curFromNodeChild);\n\n if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {\n // The current \"to\" element is not associated with a component,\n // but the current \"from\" element is associated with a component\n\n // Even if we destroy the current component in the original\n // DOM or not, we still need to skip over it since it is\n // not compatible with the current \"to\" node\n curFromNodeChild = fromNextSibling;\n\n if (\n !globalComponentsContext.___renderedComponentsById[fromComponent.id]\n ) {\n destroyComponent(fromComponent);\n }\n\n continue; // Move to the next \"from\" node\n }\n\n var curFromNodeType = curFromNodeChild.nodeType;\n\n var isCompatible = undefined;\n\n if (curFromNodeType === curToNodeType) {\n if (curFromNodeType === ELEMENT_NODE) {\n // Both nodes being compared are Element nodes\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n if (curVFromNodeChild === undefined) {\n if (isHydrate === true) {\n curVFromNodeChild = virtualizeElement(curFromNodeChild);\n\n if (\n caseInsensitiveCompare(\n curVFromNodeChild.___nodeName,\n curToNodeChild.___nodeName\n )\n ) {\n curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;\n }\n } else {\n // Skip over nodes that don't look like ours...\n curFromNodeChild = fromNextSibling;\n continue;\n }\n } else if ((curFromNodeKey = curVFromNodeChild.___key)) {\n // We have a keyed element here but our target VDOM node\n // is not keyed so this not doesn't belong\n isCompatible = false;\n }\n\n isCompatible =\n isCompatible !== false &&\n compareNodeNames(curVFromNodeChild, curToNodeChild) === true;\n\n if (isCompatible === true) {\n // We found compatible DOM elements so transform\n // the current \"from\" node to match the current\n // target DOM node.\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n }\n } else if (\n curFromNodeType === TEXT_NODE ||\n curFromNodeType === COMMENT_NODE\n ) {\n // Both nodes being compared are Text or Comment nodes\n isCompatible = true;\n // Simply update nodeValue on the original node to\n // change the text value\n\n if (\n isHydrate === true &&\n toNextSibling &&\n curFromNodeType === TEXT_NODE &&\n toNextSibling.___nodeType === TEXT_NODE\n ) {\n fromNextSibling = curFromNodeChild.splitText(\n curToNodeChild.___nodeValue.length\n );\n }\n if (curFromNodeChild.nodeValue !== curToNodeChild.___nodeValue) {\n curFromNodeChild.nodeValue = curToNodeChild.___nodeValue;\n }\n }\n }\n\n if (isCompatible === true) {\n // Advance both the \"to\" child and the \"from\" child since we found a match\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n curFromNodeChild = fromNextSibling;\n } // END: while (curFromNodeChild)\n\n // If we got this far then we did not find a candidate match for\n // our \"to node\" and we exhausted all of the children \"from\"\n // nodes. Therefore, we will just append the current \"to\" node\n // to the end\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n }\n\n // We have processed all of the \"to nodes\".\n if (fromNode.___finishFragment) {\n // If we are in an unfinished fragment, we have reached the end of the nodes\n // we were matching up and need to end the fragment\n fromNode.___finishFragment(curFromNodeChild);\n } else {\n // If curFromNodeChild is non-null then we still have some from nodes\n // left over that need to be removed\n var fragmentBoundary =\n fromNode.nodeType === FRAGMENT_NODE ? fromNode.endNode : null;\n\n while (curFromNodeChild && curFromNodeChild !== fragmentBoundary) {\n fromNextSibling = nextSibling(curFromNodeChild);\n\n if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {\n curFromNodeChild = fromNextSibling;\n if (\n !globalComponentsContext.___renderedComponentsById[fromComponent.id]\n ) {\n destroyComponent(fromComponent);\n }\n continue;\n }\n\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n curFromNodeKey = keysByDOMNode.get(fromNode);\n\n // For transcluded content, we need to check if the element belongs to a different component\n // context than the current component and ensure it gets removed from its key index.\n if (!curFromNodeKey || isAutoKey(curFromNodeKey)) {\n referenceComponent = parentComponent;\n } else {\n referenceComponent =\n curVFromNodeChild && curVFromNodeChild.___ownerComponent;\n }\n\n detachNode(curFromNodeChild, fromNode, referenceComponent);\n\n curFromNodeChild = fromNextSibling;\n }\n }\n }\n\n function morphEl(fromEl, vFromEl, toEl, parentComponent) {\n var nodeName = toEl.___nodeName;\n\n var constId = toEl.___constId;\n if (constId !== undefined && vFromEl.___constId === constId) {\n return;\n }\n\n morphAttrs(fromEl, vFromEl, toEl);\n\n if (toEl.___preserveBody) {\n return;\n }\n\n if (nodeName !== \"textarea\") {\n morphChildren(fromEl, toEl, parentComponent);\n }\n\n var specialElHandler = specialElHandlers[nodeName];\n if (specialElHandler !== undefined) {\n specialElHandler(fromEl, toEl);\n }\n } // END: morphEl(...)\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n componentsUtil.___stopDOMManipulationWarning();\n }\n\n morphChildren(fromNode, toNode, toNode.___component);\n\n detachedNodes.forEach(function (node) {\n var detachedFromComponent = detachedByDOMNode.get(node);\n\n if (detachedFromComponent !== undefined) {\n detachedByDOMNode.set(node, undefined);\n\n var componentToDestroy = componentByDOMNode.get(node);\n if (componentToDestroy) {\n componentToDestroy.destroy();\n } else if (node.parentNode) {\n destroyNodeRecursive(\n node,\n detachedFromComponent !== true && detachedFromComponent\n );\n\n if (eventDelegation.___handleNodeDetach(node) != false) {\n removeChild(node);\n }\n }\n }\n });\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n componentsUtil.___startDOMManipulationWarning();\n }\n}\n\nmodule.exports = morphdom;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/runtime/vdom/morphdom/index.js"],"names":["specialElHandlers","require","KeySequence","componentsUtil","existingComponentLookup","destroyNodeRecursive","addComponentRootToKeyedElements","normalizeComponentKey","VElement","virtualizeElement","morphAttrs","eventDelegation","fragment","helpers","domData","keysByDOMNode","componentByDOMNode","vElementByDOMNode","detachedByDOMNode","insertBefore","insertAfter","nextSibling","firstChild","removeChild","createFragmentNode","beginFragmentNode","ELEMENT_NODE","TEXT_NODE","COMMENT_NODE","COMPONENT_NODE","FRAGMENT_NODE","DOCTYPE_NODE","isAutoKey","key","compareNodeNames","fromEl","toEl","caseInsensitiveCompare","a","b","toLowerCase","onNodeAdded","node","componentsContext","nodeType","morphdom","fromNode","toNode","host","globalComponentsContext","isHydrate","keySequences","Object","create","insertVirtualNodeBefore","vNode","referenceEl","parentEl","ownerComponent","parentComponent","realNode","namespaceURI","set","morphChildren","insertVirtualComponentBefore","vComponent","referenceNode","referenceNodeParentEl","component","rootNode","id","morphComponent","detachedNodes","detachNode","parentNode","push","destroyComponent","destroy","curFromNodeChild","curToNodeChild","curToNodeKey","curFromNodeKey","curToNodeType","fromNextSibling","toNextSibling","matchingFromEl","matchingFromComponent","curVFromNodeChild","fromComponent","outer","referenceComponent","undefined","get","curToNodeKeyOriginal","morphEl","nodeName","content","nodeValue","endNode","depth","indexOf","curFromNodeType","isCompatible","splitText","length","fragmentBoundary","vFromEl","constId","specialElHandler","forEach","detachedFromComponent","componentToDestroy","module","exports"],"mappings":"AAAA;AACA,IAAIA,iBAAiB,GAAGC,OAAO,CAAC,qBAAD,CAA/B;AACA,IAAIC,WAAW,GAAGD,OAAO,CAAC,8BAAD,CAAzB;AACA,IAAIE,cAAc,GAAGF,OAAO,CAAC,uBAAD,CAA5B;AACA,IAAIG,uBAAuB,GAAGD,cAAc,G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CAAC4E,GAAnB,CAAuBlD,IAAvB,CAAzB;AACA,UAAIqE,kBAAJ,EAAwB;AACtBA,QAAAA,kBAAkB,CAAClC,OAAnB;AACD,OAFD,MAEO,IAAInC,IAAI,CAACgC,UAAT,EAAqB;AAC1BrE,QAAAA,oBAAoB;AAClBqC,QAAAA,IADkB;AAElBoE,QAAAA,qBAAqB,KAAK,IAA1B,IAAkCA,qBAFhB,CAApB;;;AAKA,YAAInG,eAAe,IAAf,CAAoC+B,IAApC,KAA6C,KAAjD,EAAwD;AACtDnB,UAAAA,WAAW,CAACmB,IAAD,CAAX;AACD;AACF;AACF;AACF,GApBD;;AAsBA;;;;AAID;;AAEDsE,MAAM,CAACC,OAAP,GAAiBpE,QAAjB","sourcesContent":["\"use strict\";\nvar specialElHandlers = require(\"./specialElHandlers\");\nvar KeySequence = require(\"../../components/KeySequence\");\nvar componentsUtil = require(\"../../components/util\");\nvar existingComponentLookup = componentsUtil.___componentLookup;\nvar destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;\nvar addComponentRootToKeyedElements =\n componentsUtil.___addComponentRootToKeyedElements;\nvar normalizeComponentKey = componentsUtil.___normalizeComponentKey;\nvar VElement = require(\"../vdom\").___VElement;\nvar virtualizeElement = VElement.___virtualize;\nvar morphAttrs = VElement.___morphAttrs;\nvar eventDelegation = require(\"../../components/event-delegation\");\nvar fragment = require(\"./fragment\");\nvar helpers = require(\"./helpers\");\nvar domData = require(\"../../components/dom-data\");\nvar keysByDOMNode = domData.___keyByDOMNode;\nvar componentByDOMNode = domData.___componentByDOMNode;\nvar vElementByDOMNode = domData.___vElementByDOMNode;\nvar detachedByDOMNode = domData.___detachedByDOMNode;\n\nvar insertBefore = helpers.___insertBefore;\nvar insertAfter = helpers.___insertAfter;\nvar nextSibling = helpers.___nextSibling;\nvar firstChild = helpers.___firstChild;\nvar removeChild = helpers.___removeChild;\nvar createFragmentNode = fragment.___createFragmentNode;\nvar beginFragmentNode = fragment.___beginFragmentNode;\n\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar COMPONENT_NODE = 2;\nvar FRAGMENT_NODE = 12;\nvar DOCTYPE_NODE = 10;\n\n// var FLAG_SIMPLE_ATTRS = 1;\n// var FLAG_CUSTOM_ELEMENT = 2;\n// var FLAG_SPREAD_ATTRS = 4;\n\nfunction isAutoKey(key) {\n return key[0] !== \"@\";\n}\n\nfunction compareNodeNames(fromEl, toEl) {\n return fromEl.___nodeName === toEl.___nodeName;\n}\n\nfunction caseInsensitiveCompare(a, b) {\n return a.toLowerCase() === b.toLowerCase();\n}\n\nfunction onNodeAdded(node, componentsContext) {\n if (node.nodeType === ELEMENT_NODE) {\n eventDelegation.___handleNodeAttach(node, componentsContext);\n }\n}\n\nfunction morphdom(fromNode, toNode, host, componentsContext) {\n var globalComponentsContext;\n var isHydrate = false;\n var keySequences = Object.create(null);\n\n if (componentsContext) {\n globalComponentsContext = componentsContext.___globalContext;\n isHydrate = globalComponentsContext.___isHydrate;\n }\n\n function insertVirtualNodeBefore(\n vNode,\n key,\n referenceEl,\n parentEl,\n ownerComponent,\n parentComponent\n ) {\n var realNode = vNode.___actualize(host, parentEl.namespaceURI);\n insertBefore(realNode, referenceEl, parentEl);\n\n if (\n vNode.___nodeType === ELEMENT_NODE ||\n vNode.___nodeType === FRAGMENT_NODE\n ) {\n if (key) {\n keysByDOMNode.set(realNode, key);\n (isAutoKey(key) ? parentComponent : ownerComponent).___keyedElements[\n key\n ] = realNode;\n }\n\n if (vNode.___nodeName !== \"textarea\") {\n morphChildren(realNode, vNode, parentComponent);\n }\n\n onNodeAdded(realNode, componentsContext);\n }\n }\n\n function insertVirtualComponentBefore(\n vComponent,\n referenceNode,\n referenceNodeParentEl,\n component,\n key,\n ownerComponent,\n parentComponent\n ) {\n var rootNode = (component.___rootNode = insertBefore(\n createFragmentNode(),\n referenceNode,\n referenceNodeParentEl\n ));\n componentByDOMNode.set(rootNode, component);\n\n if (key && ownerComponent) {\n key = normalizeComponentKey(key, parentComponent.id);\n addComponentRootToKeyedElements(\n ownerComponent.___keyedElements,\n key,\n rootNode,\n component.id\n );\n keysByDOMNode.set(rootNode, key);\n }\n\n morphComponent(component, vComponent);\n }\n\n function morphComponent(component, vComponent) {\n morphChildren(component.___rootNode, vComponent, component);\n }\n\n var detachedNodes = [];\n\n function detachNode(node, parentNode, ownerComponent) {\n if (node.nodeType === ELEMENT_NODE || node.nodeType === FRAGMENT_NODE) {\n detachedNodes.push(node);\n detachedByDOMNode.set(node, ownerComponent || true);\n } else {\n destroyNodeRecursive(node);\n removeChild(node);\n }\n }\n\n function destroyComponent(component) {\n component.destroy();\n }\n\n function morphChildren(fromNode, toNode, parentComponent) {\n var curFromNodeChild = firstChild(fromNode);\n var curToNodeChild = toNode.___firstChild;\n\n var curToNodeKey;\n var curFromNodeKey;\n var curToNodeType;\n\n var fromNextSibling;\n var toNextSibling;\n var matchingFromEl;\n var matchingFromComponent;\n var curVFromNodeChild;\n var fromComponent;\n\n outer: while (curToNodeChild) {\n toNextSibling = curToNodeChild.___nextSibling;\n curToNodeType = curToNodeChild.___nodeType;\n curToNodeKey = curToNodeChild.___key;\n\n // Skip <!doctype>\n if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {\n curFromNodeChild = nextSibling(curFromNodeChild);\n }\n\n var ownerComponent = curToNodeChild.___ownerComponent || parentComponent;\n var referenceComponent;\n\n if (curToNodeType === COMPONENT_NODE) {\n var component = curToNodeChild.___component;\n if (\n (matchingFromComponent = existingComponentLookup[component.id]) ===\n undefined\n ) {\n if (isHydrate === true) {\n var rootNode = beginFragmentNode(curFromNodeChild, fromNode);\n component.___rootNode = rootNode;\n componentByDOMNode.set(rootNode, component);\n\n if (ownerComponent && curToNodeKey) {\n curToNodeKey = normalizeComponentKey(\n curToNodeKey,\n parentComponent.id\n );\n addComponentRootToKeyedElements(\n ownerComponent.___keyedElements,\n curToNodeKey,\n rootNode,\n component.id\n );\n\n keysByDOMNode.set(rootNode, curToNodeKey);\n }\n\n morphComponent(component, curToNodeChild);\n\n curFromNodeChild = nextSibling(rootNode);\n } else {\n insertVirtualComponentBefore(\n curToNodeChild,\n curFromNodeChild,\n fromNode,\n component,\n curToNodeKey,\n ownerComponent,\n parentComponent\n );\n }\n } else {\n if (matchingFromComponent.___rootNode !== curFromNodeChild) {\n if (\n curFromNodeChild &&\n (fromComponent = componentByDOMNode.get(curFromNodeChild)) &&\n globalComponentsContext.___renderedComponentsById[\n fromComponent.id\n ] === undefined\n ) {\n // The component associated with the current real DOM node was not rendered\n // so we should just remove it out of the real DOM by destroying it\n curFromNodeChild = nextSibling(fromComponent.___rootNode);\n destroyComponent(fromComponent);\n continue;\n }\n\n // We need to move the existing component into\n // the correct location\n insertBefore(\n matchingFromComponent.___rootNode,\n curFromNodeChild,\n fromNode\n );\n } else {\n curFromNodeChild =\n curFromNodeChild && nextSibling(curFromNodeChild);\n }\n\n if (!curToNodeChild.___preserve) {\n morphComponent(component, curToNodeChild);\n }\n }\n\n curToNodeChild = toNextSibling;\n continue;\n } else if (curToNodeKey) {\n curVFromNodeChild = undefined;\n curFromNodeKey = undefined;\n var curToNodeKeyOriginal = curToNodeKey;\n\n if (isAutoKey(curToNodeKey)) {\n if (ownerComponent !== parentComponent) {\n curToNodeKey += \":\" + ownerComponent.id;\n }\n referenceComponent = parentComponent;\n } else {\n referenceComponent = ownerComponent;\n }\n\n // We have a keyed element. This is the fast path for matching\n // up elements\n curToNodeKey = (\n keySequences[referenceComponent.id] ||\n (keySequences[referenceComponent.id] = new KeySequence())\n ).___nextKey(curToNodeKey);\n\n if (curFromNodeChild) {\n curFromNodeKey = keysByDOMNode.get(curFromNodeChild);\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n fromNextSibling = nextSibling(curFromNodeChild);\n }\n\n if (curFromNodeKey === curToNodeKey) {\n // Elements line up. Now we just have to make sure they are compatible\n if (!curToNodeChild.___preserve) {\n // We just skip over the fromNode if it is preserved\n\n if (compareNodeNames(curToNodeChild, curVFromNodeChild)) {\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n } else {\n // Remove the old node\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n\n // Incompatible nodes. Just move the target VNode into the DOM at this position\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n }\n }\n } else {\n matchingFromEl = referenceComponent.___keyedElements[curToNodeKey];\n if (\n matchingFromEl === undefined ||\n matchingFromEl === curFromNodeChild\n ) {\n if (isHydrate === true && curFromNodeChild) {\n if (\n curFromNodeChild.nodeType === ELEMENT_NODE &&\n (curToNodeChild.___preserve ||\n caseInsensitiveCompare(\n curFromNodeChild.nodeName,\n curToNodeChild.___nodeName || \"\"\n ))\n ) {\n curVFromNodeChild = virtualizeElement(curFromNodeChild);\n curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;\n keysByDOMNode.set(curFromNodeChild, curToNodeKey);\n referenceComponent.___keyedElements[curToNodeKey] =\n curFromNodeChild;\n\n if (curToNodeChild.___preserve) {\n vElementByDOMNode.set(curFromNodeChild, curVFromNodeChild);\n } else {\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue;\n } else if (\n curToNodeChild.___nodeType === FRAGMENT_NODE &&\n curFromNodeChild.nodeType === COMMENT_NODE\n ) {\n var content = curFromNodeChild.nodeValue;\n if (content == \"F#\" + curToNodeKeyOriginal) {\n var endNode = curFromNodeChild.nextSibling;\n var depth = 0;\n var nodeValue;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (endNode.nodeType === COMMENT_NODE) {\n nodeValue = endNode.nodeValue;\n if (nodeValue === \"F/\") {\n if (depth === 0) {\n break;\n } else {\n depth--;\n }\n } else if (nodeValue.indexOf(\"F#\") === 0) {\n depth++;\n }\n }\n endNode = endNode.nextSibling;\n }\n\n var fragment = createFragmentNode(\n curFromNodeChild,\n endNode.nextSibling,\n fromNode\n );\n keysByDOMNode.set(fragment, curToNodeKey);\n vElementByDOMNode.set(fragment, curToNodeChild);\n referenceComponent.___keyedElements[curToNodeKey] = fragment;\n removeChild(curFromNodeChild);\n removeChild(endNode);\n\n if (!curToNodeChild.___preserve) {\n morphChildren(fragment, curToNodeChild, parentComponent);\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fragment.nextSibling;\n continue;\n }\n }\n }\n\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n fromNextSibling = curFromNodeChild;\n } else {\n if (detachedByDOMNode.get(matchingFromEl) !== undefined) {\n detachedByDOMNode.set(matchingFromEl, undefined);\n }\n\n if (!curToNodeChild.___preserve) {\n curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);\n\n if (compareNodeNames(curVFromNodeChild, curToNodeChild)) {\n if (fromNextSibling === matchingFromEl) {\n // Single element removal:\n // A <-> A\n // B <-> C <-- We are here\n // C D\n // D\n //\n // Single element swap:\n // A <-> A\n // B <-> C <-- We are here\n // C B\n\n if (\n toNextSibling &&\n toNextSibling.___key === curFromNodeKey\n ) {\n // Single element swap\n\n // We want to stay on the current real DOM node\n fromNextSibling = curFromNodeChild;\n\n // But move the matching element into place\n insertBefore(matchingFromEl, curFromNodeChild, fromNode);\n } else {\n // Single element removal\n\n // We need to remove the current real DOM node\n // and the matching real DOM node will fall into\n // place. We will continue diffing with next sibling\n // after the real DOM node that just fell into place\n fromNextSibling = nextSibling(fromNextSibling);\n\n if (curFromNodeChild) {\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n }\n }\n } else {\n // A <-> A\n // B <-> D <-- We are here\n // C\n // D\n\n // We need to move the matching node into place\n insertAfter(matchingFromEl, curFromNodeChild, fromNode);\n\n if (curFromNodeChild) {\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n }\n }\n\n morphEl(\n matchingFromEl,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n } else {\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n detachNode(matchingFromEl, fromNode, ownerComponent);\n }\n } else {\n // preserve the node\n // but still we need to diff the current from node\n insertBefore(matchingFromEl, curFromNodeChild, fromNode);\n fromNextSibling = curFromNodeChild;\n }\n }\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue;\n }\n\n // The know the target node is not a VComponent node and we know\n // it is also not a preserve node. Let's now match up the HTML\n // element, text node, comment, etc.\n while (curFromNodeChild) {\n fromNextSibling = nextSibling(curFromNodeChild);\n\n if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {\n // The current \"to\" element is not associated with a component,\n // but the current \"from\" element is associated with a component\n\n // Even if we destroy the current component in the original\n // DOM or not, we still need to skip over it since it is\n // not compatible with the current \"to\" node\n curFromNodeChild = fromNextSibling;\n\n if (\n !globalComponentsContext.___renderedComponentsById[fromComponent.id]\n ) {\n destroyComponent(fromComponent);\n }\n\n continue; // Move to the next \"from\" node\n }\n\n var curFromNodeType = curFromNodeChild.nodeType;\n\n var isCompatible = undefined;\n\n if (curFromNodeType === curToNodeType) {\n if (curFromNodeType === ELEMENT_NODE) {\n // Both nodes being compared are Element nodes\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n if (curVFromNodeChild === undefined) {\n if (isHydrate === true) {\n curVFromNodeChild = virtualizeElement(curFromNodeChild);\n\n if (\n caseInsensitiveCompare(\n curVFromNodeChild.___nodeName,\n curToNodeChild.___nodeName\n )\n ) {\n curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;\n }\n } else {\n // Skip over nodes that don't look like ours...\n curFromNodeChild = fromNextSibling;\n continue;\n }\n } else if ((curFromNodeKey = curVFromNodeChild.___key)) {\n // We have a keyed element here but our target VDOM node\n // is not keyed so this not doesn't belong\n isCompatible = false;\n }\n\n isCompatible =\n isCompatible !== false &&\n compareNodeNames(curVFromNodeChild, curToNodeChild) === true;\n\n if (isCompatible === true) {\n // We found compatible DOM elements so transform\n // the current \"from\" node to match the current\n // target DOM node.\n morphEl(\n curFromNodeChild,\n curVFromNodeChild,\n curToNodeChild,\n parentComponent\n );\n }\n } else if (\n curFromNodeType === TEXT_NODE ||\n curFromNodeType === COMMENT_NODE\n ) {\n // Both nodes being compared are Text or Comment nodes\n isCompatible = true;\n // Simply update nodeValue on the original node to\n // change the text value\n\n if (\n isHydrate === true &&\n toNextSibling &&\n curFromNodeType === TEXT_NODE &&\n toNextSibling.___nodeType === TEXT_NODE\n ) {\n fromNextSibling = curFromNodeChild.splitText(\n curToNodeChild.___nodeValue.length\n );\n }\n if (curFromNodeChild.nodeValue !== curToNodeChild.___nodeValue) {\n curFromNodeChild.nodeValue = curToNodeChild.___nodeValue;\n }\n }\n }\n\n if (isCompatible === true) {\n // Advance both the \"to\" child and the \"from\" child since we found a match\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n detachNode(curFromNodeChild, fromNode, ownerComponent);\n curFromNodeChild = fromNextSibling;\n } // END: while (curFromNodeChild)\n\n // If we got this far then we did not find a candidate match for\n // our \"to node\" and we exhausted all of the children \"from\"\n // nodes. Therefore, we will just append the current \"to\" node\n // to the end\n insertVirtualNodeBefore(\n curToNodeChild,\n curToNodeKey,\n curFromNodeChild,\n fromNode,\n ownerComponent,\n parentComponent\n );\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n }\n\n // We have processed all of the \"to nodes\".\n if (fromNode.___finishFragment) {\n // If we are in an unfinished fragment, we have reached the end of the nodes\n // we were matching up and need to end the fragment\n fromNode.___finishFragment(curFromNodeChild);\n } else {\n // If curFromNodeChild is non-null then we still have some from nodes\n // left over that need to be removed\n var fragmentBoundary =\n fromNode.nodeType === FRAGMENT_NODE ? fromNode.endNode : null;\n\n while (curFromNodeChild && curFromNodeChild !== fragmentBoundary) {\n fromNextSibling = nextSibling(curFromNodeChild);\n\n if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {\n curFromNodeChild = fromNextSibling;\n if (\n !globalComponentsContext.___renderedComponentsById[fromComponent.id]\n ) {\n destroyComponent(fromComponent);\n }\n continue;\n }\n\n curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);\n curFromNodeKey = keysByDOMNode.get(fromNode);\n\n // For transcluded content, we need to check if the element belongs to a different component\n // context than the current component and ensure it gets removed from its key index.\n if (!curFromNodeKey || isAutoKey(curFromNodeKey)) {\n referenceComponent = parentComponent;\n } else {\n referenceComponent =\n curVFromNodeChild && curVFromNodeChild.___ownerComponent;\n }\n\n detachNode(curFromNodeChild, fromNode, referenceComponent);\n\n curFromNodeChild = fromNextSibling;\n }\n }\n }\n\n function morphEl(fromEl, vFromEl, toEl, parentComponent) {\n var nodeName = toEl.___nodeName;\n\n var constId = toEl.___constId;\n if (constId !== undefined && vFromEl.___constId === constId) {\n return;\n }\n\n morphAttrs(fromEl, vFromEl, toEl);\n\n if (toEl.___preserveBody) {\n return;\n }\n\n if (nodeName !== \"textarea\") {\n morphChildren(fromEl, toEl, parentComponent);\n }\n\n var specialElHandler = specialElHandlers[nodeName];\n if (specialElHandler !== undefined) {\n specialElHandler(fromEl, toEl);\n }\n } // END: morphEl(...)\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n componentsUtil.___stopDOMManipulationWarning(host);\n }\n\n morphChildren(fromNode, toNode, toNode.___component);\n\n detachedNodes.forEach(function (node) {\n var detachedFromComponent = detachedByDOMNode.get(node);\n\n if (detachedFromComponent !== undefined) {\n detachedByDOMNode.set(node, undefined);\n\n var componentToDestroy = componentByDOMNode.get(node);\n if (componentToDestroy) {\n componentToDestroy.destroy();\n } else if (node.parentNode) {\n destroyNodeRecursive(\n node,\n detachedFromComponent !== true && detachedFromComponent\n );\n\n if (eventDelegation.___handleNodeDetach(node) != false) {\n removeChild(node);\n }\n }\n }\n });\n\n // eslint-disable-next-line no-constant-condition\n if (\"MARKO_DEBUG\") {\n componentsUtil.___startDOMManipulationWarning(host);\n }\n}\n\nmodule.exports = morphdom;\n"],"file":"index.js"}
@@ -13,13 +13,13 @@ function forEachOption(el, fn, i) {
13
13
  var curChild = el._r_;
14
14
 
15
15
  while (curChild) {
16
- if (curChild.bH_ === "option") {
16
+ if (curChild.bG_ === "option") {
17
17
  fn(curChild, ++i);
18
18
  } else {
19
19
  i = forEachOption(curChild, fn, i);
20
20
  }
21
21
 
22
- curChild = curChild.bS_;
22
+ curChild = curChild.bR_;
23
23
  }
24
24
 
25
25
  return i;
@@ -52,13 +52,13 @@ SpecialElHandlers.prototype = {
52
52
  fromEl.value = toEl.q_;
53
53
  }
54
54
 
55
- if (fromEl.hasAttribute("value") && !toEl.bL_("value")) {
55
+ if (fromEl.hasAttribute("value") && !toEl.bK_("value")) {
56
56
  fromEl.removeAttribute("value");
57
57
  }
58
58
  },
59
59
 
60
60
  textarea: function (fromEl, toEl) {
61
- if (toEl.bV_) {
61
+ if (toEl.bU_) {
62
62
  return;
63
63
  }
64
64
 
@@ -84,12 +84,12 @@ SpecialElHandlers.prototype = {
84
84
  }
85
85
  },
86
86
  select: function (fromEl, toEl) {
87
- if (!toEl.bL_("multiple")) {
87
+ if (!toEl.bK_("multiple")) {
88
88
  var selected = 0;
89
89
  forEachOption(
90
90
  toEl,
91
91
  function (option, i) {
92
- if (option.bL_("selected")) {
92
+ if (option.bK_("selected")) {
93
93
  selected = i;
94
94
  }
95
95
  },
@@ -12,5 +12,5 @@ function removePreservedAttributes(attrs, props) {
12
12
  return attrs;
13
13
  }
14
14
 
15
- require("./VElement").bM_ = removePreservedAttributes;
15
+ require("./VElement").bL_ = removePreservedAttributes;
16
16
  //# sourceMappingURL=preserve-attrs.js.map
@@ -6,13 +6,12 @@ var VComponent = require("./VComponent");
6
6
  var VFragment = require("./VFragment");
7
7
  var parseHTML = require("./parse-html");
8
8
 
9
- var defaultDocument = typeof document != "undefined" && document;
10
9
  var specialHtmlRegexp = /[&<]/;
11
10
 
12
11
  function virtualizeChildNodes(node, vdomParent, ownerComponent) {
13
12
  var curChild = node.firstChild;
14
13
  while (curChild) {
15
- vdomParent.br_(virtualize(curChild, ownerComponent));
14
+ vdomParent.bq_(virtualize(curChild, ownerComponent));
16
15
  curChild = curChild.nextSibling;
17
16
  }
18
17
  }
@@ -20,7 +19,7 @@ function virtualizeChildNodes(node, vdomParent, ownerComponent) {
20
19
  function virtualize(node, ownerComponent) {
21
20
  switch (node.nodeType) {
22
21
  case 1:
23
- return VElement.bN_(node, virtualizeChildNodes, ownerComponent);
22
+ return VElement.bM_(node, virtualizeChildNodes, ownerComponent);
24
23
  case 3:
25
24
  return new VText(node.nodeValue, ownerComponent);
26
25
  case 11:
@@ -30,7 +29,7 @@ function virtualize(node, ownerComponent) {
30
29
 
31
30
  }
32
31
 
33
- function virtualizeHTML(html, doc, ownerComponent) {
32
+ function virtualizeHTML(html, ownerComponent) {
34
33
  if (!specialHtmlRegexp.test(html)) {
35
34
  return new VText(html, ownerComponent);
36
35
  }
@@ -39,7 +38,7 @@ function virtualizeHTML(html, doc, ownerComponent) {
39
38
  var curChild = parseHTML(html);
40
39
 
41
40
  while (curChild) {
42
- vdomFragment.br_(virtualize(curChild, ownerComponent));
41
+ vdomFragment.bq_(virtualize(curChild, ownerComponent));
43
42
  curChild = curChild.nextSibling;
44
43
  }
45
44
 
@@ -61,17 +60,17 @@ Node_prototype.t = function (value) {
61
60
  value = "";
62
61
  } else if (type === "object") {
63
62
  if (value.toHTML) {
64
- vdomNode = virtualizeHTML(value.toHTML(), document);
63
+ vdomNode = virtualizeHTML(value.toHTML());
65
64
  }
66
65
  }
67
66
  }
68
67
 
69
- this.br_(vdomNode || new VText(value.toString()));
70
- return this.bK_();
68
+ this.bq_(vdomNode || new VText(value.toString()));
69
+ return this.bJ_();
71
70
  };
72
71
 
73
- Node_prototype.bw_ = function () {
74
- return this.br_(new VDocumentFragment());
72
+ Node_prototype.bv_ = function () {
73
+ return this.bq_(new VDocumentFragment());
75
74
  };
76
75
 
77
76
  exports.ba_ = VDocumentFragment;
@@ -79,7 +78,6 @@ exports.b__ = VElement;
79
78
  exports.bb_ = VText;
80
79
  exports.bc_ = VComponent;
81
80
  exports.bd_ = VFragment;
82
- exports.bN_ = virtualize;
81
+ exports.bM_ = virtualize;
83
82
  exports.be_ = virtualizeHTML;
84
- exports.bf_ = defaultDocument;
85
83
  //# sourceMappingURL=vdom.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/vdom/vdom.js"],"names":["VNode","require","VDocumentFragment","VElement","VText","VComponent","VFragment","parseHTML","defaultDocument","document","specialHtmlRegexp","virtualizeChildNodes","node","vdomParent","ownerComponent","curChild","firstChild","virtualize","nextSibling","nodeType","nodeValue","vdomDocFragment","virtualizeHTML","html","doc","test","vdomFragment","Node_prototype","prototype","t","value","type","vdomNode","toHTML","toString","exports"],"mappings":"aAAA,IAAIA,KAAK,GAAGC,OAAO,CAAC,SAAD,CAAnB;AACA,IAAIC,iBAAiB,GAAGD,OAAO,CAAC,qBAAD,CAA/B;AACA,IAAIE,QAAQ,GAAGF,OAAO,CAAC,YAAD,CAAtB;AACA,IAAIG,KAAK,GAAGH,OAAO,CAAC,SAAD,CAAnB;AACA,IAAII,UAAU,GAAGJ,OAAO,CAAC,cAAD,CAAxB;AACA,IAAIK,SAAS,GAAGL,OAAO,CAAC,aAAD,CAAvB;AACA,IAAIM,SAAS,GAAGN,OAAO,CAAC,cAAD,CAAvB;;AAEA,IAAIO,eAAe,GAAG,OAAOC,QAAP,IAAmB,WAAnB,IAAkCA,QAAxD;AACA,IAAIC,iBAAiB,GAAG,MAAxB;;AAEA,SAASC,oBAAT,CAA8BC,IAA9B,EAAoCC,UAApC,EAAgDC,cAAhD,EAAgE;AAC9D,MAAIC,QAAQ,GAAGH,IAAI,CAACI,UAApB;AACA,SAAOD,QA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A,MAAIE,QAAJ;;AAEA,MAAID,IAAI,KAAK,QAAb,EAAuB;AACrB,QAAID,KAAK,IAAI,IAAb,EAAmB;AACjBA,MAAAA,KAAK,GAAG,EAAR;AACD,KAFD,MAEO,IAAIC,IAAI,KAAK,QAAb,EAAuB;AAC5B,UAAID,KAAK,CAACG,MAAV,EAAkB;AAChBD,QAAAA,QAAQ,GAAGV,cAAc,CAACQ,KAAK,CAACG,MAAN,EAAD,EAAiBxB,QAAjB,CAAzB;AACD;AACF;AACF;;AAED,WAAoBuB,QAAQ,IAAI,IAAI5B,KAAJ,CAAU0B,KAAK,CAACI,QAAN,EAAV,CAAhC;AACA,SAAO,UAAP;AACD,CAhBD;;AAkBAP,cAAc,IAAd,GAA2C,YAAY;AACrD,SAAO,SAAoB,IAAIzB,iBAAJ,EAApB,CAAP;AACD,CAFD;;AAIAiC,OAAO,IAAP,GAA+BjC,iBAA/B;AACAiC,OAAO,IAAP,GAAsBhC,QAAtB;AACAgC,OAAO,IAAP,GAAmB/B,KAAnB;AACA+B,OAAO,IAAP,GAAwB9B,UAAxB;AACA8B,OAAO,IAAP,GAAuB7B,SAAvB;AACA6B,OAAO,IAAP,GAAwBlB,UAAxB;AACAkB,OAAO,IAAP,GAA4Bb,cAA5B;AACAa,OAAO,IAAP,GAA6B3B,eAA7B","sourcesContent":["var VNode = require(\"./VNode\");\nvar VDocumentFragment = require(\"./VDocumentFragment\");\nvar VElement = require(\"./VElement\");\nvar VText = require(\"./VText\");\nvar VComponent = require(\"./VComponent\");\nvar VFragment = require(\"./VFragment\");\nvar parseHTML = require(\"./parse-html\");\n\nvar defaultDocument = typeof document != \"undefined\" && document;\nvar specialHtmlRegexp = /[&<]/;\n\nfunction virtualizeChildNodes(node, vdomParent, ownerComponent) {\n var curChild = node.firstChild;\n while (curChild) {\n vdomParent.___appendChild(virtualize(curChild, ownerComponent));\n curChild = curChild.nextSibling;\n }\n}\n\nfunction virtualize(node, ownerComponent) {\n switch (node.nodeType) {\n case 1:\n return VElement.___virtualize(node, virtualizeChildNodes, ownerComponent);\n case 3:\n return new VText(node.nodeValue, ownerComponent);\n case 11:\n var vdomDocFragment = new VDocumentFragment();\n virtualizeChildNodes(node, vdomDocFragment, ownerComponent);\n return vdomDocFragment;\n }\n}\n\nfunction virtualizeHTML(html, doc, ownerComponent) {\n if (!specialHtmlRegexp.test(html)) {\n return new VText(html, ownerComponent);\n }\n\n var vdomFragment = new VDocumentFragment();\n var curChild = parseHTML(html);\n\n while (curChild) {\n vdomFragment.___appendChild(virtualize(curChild, ownerComponent));\n curChild = curChild.nextSibling;\n }\n\n return vdomFragment;\n}\n\nvar Node_prototype = VNode.prototype;\n\n/**\n * Shorthand method for creating and appending a Text node with a given value\n * @param {String} value The text value for the new Text node\n */\nNode_prototype.t = function (value) {\n var type = typeof value;\n var vdomNode;\n\n if (type !== \"string\") {\n if (value == null) {\n value = \"\";\n } else if (type === \"object\") {\n if (value.toHTML) {\n vdomNode = virtualizeHTML(value.toHTML(), document);\n }\n }\n }\n\n this.___appendChild(vdomNode || new VText(value.toString()));\n return this.___finishChild();\n};\n\nNode_prototype.___appendDocumentFragment = function () {\n return this.___appendChild(new VDocumentFragment());\n};\n\nexports.___VDocumentFragment = VDocumentFragment;\nexports.___VElement = VElement;\nexports.___VText = VText;\nexports.___VComponent = VComponent;\nexports.___VFragment = VFragment;\nexports.___virtualize = virtualize;\nexports.___virtualizeHTML = virtualizeHTML;\nexports.___defaultDocument = defaultDocument;\n"],"file":"vdom.js"}
1
+ {"version":3,"sources":["../../../src/runtime/vdom/vdom.js"],"names":["VNode","require","VDocumentFragment","VElement","VText","VComponent","VFragment","parseHTML","specialHtmlRegexp","virtualizeChildNodes","node","vdomParent","ownerComponent","curChild","firstChild","virtualize","nextSibling","nodeType","nodeValue","vdomDocFragment","virtualizeHTML","html","test","vdomFragment","Node_prototype","prototype","t","value","type","vdomNode","toHTML","toString","exports"],"mappings":"aAAA,IAAIA,KAAK,GAAGC,OAAO,CAAC,SAAD,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esContent":["var VNode = require(\"./VNode\");\nvar VDocumentFragment = require(\"./VDocumentFragment\");\nvar VElement = require(\"./VElement\");\nvar VText = require(\"./VText\");\nvar VComponent = require(\"./VComponent\");\nvar VFragment = require(\"./VFragment\");\nvar parseHTML = require(\"./parse-html\");\n\nvar specialHtmlRegexp = /[&<]/;\n\nfunction virtualizeChildNodes(node, vdomParent, ownerComponent) {\n var curChild = node.firstChild;\n while (curChild) {\n vdomParent.___appendChild(virtualize(curChild, ownerComponent));\n curChild = curChild.nextSibling;\n }\n}\n\nfunction virtualize(node, ownerComponent) {\n switch (node.nodeType) {\n case 1:\n return VElement.___virtualize(node, virtualizeChildNodes, ownerComponent);\n case 3:\n return new VText(node.nodeValue, ownerComponent);\n case 11:\n var vdomDocFragment = new VDocumentFragment();\n virtualizeChildNodes(node, vdomDocFragment, ownerComponent);\n return vdomDocFragment;\n }\n}\n\nfunction virtualizeHTML(html, ownerComponent) {\n if (!specialHtmlRegexp.test(html)) {\n return new VText(html, ownerComponent);\n }\n\n var vdomFragment = new VDocumentFragment();\n var curChild = parseHTML(html);\n\n while (curChild) {\n vdomFragment.___appendChild(virtualize(curChild, ownerComponent));\n curChild = curChild.nextSibling;\n }\n\n return vdomFragment;\n}\n\nvar Node_prototype = VNode.prototype;\n\n/**\n * Shorthand method for creating and appending a Text node with a given value\n * @param {String} value The text value for the new Text node\n */\nNode_prototype.t = function (value) {\n var type = typeof value;\n var vdomNode;\n\n if (type !== \"string\") {\n if (value == null) {\n value = \"\";\n } else if (type === \"object\") {\n if (value.toHTML) {\n vdomNode = virtualizeHTML(value.toHTML());\n }\n }\n }\n\n this.___appendChild(vdomNode || new VText(value.toString()));\n return this.___finishChild();\n};\n\nNode_prototype.___appendDocumentFragment = function () {\n return this.___appendChild(new VDocumentFragment());\n};\n\nexports.___VDocumentFragment = VDocumentFragment;\nexports.___VElement = VElement;\nexports.___VText = VText;\nexports.___VComponent = VComponent;\nexports.___VFragment = VFragment;\nexports.___virtualize = virtualize;\nexports.___virtualizeHTML = virtualizeHTML;\n"],"file":"vdom.js"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.16.1",
3
+ "version": "5.17.3",
4
4
  "license": "MIT",
5
5
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
6
6
  "dependencies": {
7
- "@marko/compiler": "^5.16.1",
8
- "@marko/translator-default": "^5.16.1",
7
+ "@marko/compiler": "^5.17.3",
8
+ "@marko/translator-default": "^5.17.3",
9
9
  "app-module-path": "^2.2.0",
10
10
  "argly": "^1.2.0",
11
11
  "browser-refresh-client": "1.1.4",
@@ -72,5 +72,5 @@
72
72
  "index.js",
73
73
  "node-require.js"
74
74
  ],
75
- "gitHead": "85ef55427a385bf25a559d286f0124f358fa50df"
75
+ "gitHead": "f2bb822be6e9b86c13223fba283f056748fe64c4"
76
76
  }
@@ -1,6 +1,12 @@
1
1
  var domInsert = require("./dom-insert");
2
2
  var complain = "MARKO_DEBUG" && require("complain");
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.___components;
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.___out;
45
51
  var componentsContext = out.___components;
46
52
  if (componentsContext) {
47
- this.___components = componentsContext.___initComponents(doc);
53
+ this.___components = componentsContext.___initComponents(host);
48
54
  } else {
49
55
  this.___components = null;
50
56
  }
51
57
 
52
58
  return this;
53
59
  },
54
- getNode: function (doc) {
55
- return this.___out.___getNode(doc);
60
+ getNode: function (host) {
61
+ return this.___out.___getNode(host);
56
62
  },
57
63
  getOutput: function () {
58
64
  return this.___out.___getOutput();
@@ -60,7 +66,7 @@ var proto = (RenderResult.prototype = {
60
66
  toString: function () {
61
67
  return this.___out.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
  );