taggedjs 2.5.8 → 2.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/bundle.js +281 -238
  2. package/bundle.js.map +1 -1
  3. package/js/TemplaterResult.class.js.map +1 -1
  4. package/js/index.d.ts +1 -0
  5. package/js/interpolations/interpolateContentTemplates.d.ts +1 -1
  6. package/js/interpolations/interpolateContentTemplates.js +10 -12
  7. package/js/interpolations/interpolateContentTemplates.js.map +1 -1
  8. package/js/interpolations/interpolateElement.d.ts +1 -3
  9. package/js/interpolations/interpolateElement.js +5 -4
  10. package/js/interpolations/interpolateElement.js.map +1 -1
  11. package/js/interpolations/interpolateTemplate.d.ts +2 -5
  12. package/js/interpolations/interpolateTemplate.js +8 -12
  13. package/js/interpolations/interpolateTemplate.js.map +1 -1
  14. package/js/isInstance.d.ts +1 -1
  15. package/js/isInstance.js +4 -3
  16. package/js/isInstance.js.map +1 -1
  17. package/js/tag/Tag.class.d.ts +1 -2
  18. package/js/tag/Tag.class.js.map +1 -1
  19. package/js/tag/TagSupport.class.d.ts +0 -1
  20. package/js/tag/TagSupport.class.js +12 -17
  21. package/js/tag/TagSupport.class.js.map +1 -1
  22. package/js/tag/checkDestroyPrevious.function.d.ts +3 -2
  23. package/js/tag/checkDestroyPrevious.function.js +18 -8
  24. package/js/tag/checkDestroyPrevious.function.js.map +1 -1
  25. package/js/tag/tag.js.map +1 -1
  26. package/js/tag/tagElement.d.ts +7 -0
  27. package/js/tag/tagElement.js +8 -4
  28. package/js/tag/tagElement.js.map +1 -1
  29. package/js/tag/update/processFirstSubject.utils.d.ts +34 -0
  30. package/js/tag/update/processFirstSubject.utils.js +48 -0
  31. package/js/tag/update/processFirstSubject.utils.js.map +1 -0
  32. package/js/tag/update/processFirstSubjectValue.function.d.ts +7 -0
  33. package/js/tag/update/processFirstSubjectValue.function.js +31 -0
  34. package/js/tag/update/processFirstSubjectValue.function.js.map +1 -0
  35. package/js/tag/update/processNewValue.function.d.ts +2 -2
  36. package/js/tag/update/processNewValue.function.js +16 -24
  37. package/js/tag/update/processNewValue.function.js.map +1 -1
  38. package/js/tag/update/processRegularValue.function.d.ts +2 -0
  39. package/js/tag/update/processRegularValue.function.js +17 -2
  40. package/js/tag/update/processRegularValue.function.js.map +1 -1
  41. package/js/tag/update/processSubjectComponent.function.d.ts +0 -1
  42. package/js/tag/update/processSubjectComponent.function.js +1 -1
  43. package/js/tag/update/processSubjectComponent.function.js.map +1 -1
  44. package/js/tag/update/processSubjectValue.function.d.ts +3 -23
  45. package/js/tag/update/processSubjectValue.function.js +1 -25
  46. package/js/tag/update/processSubjectValue.function.js.map +1 -1
  47. package/js/tag/update/processTag.function.js +0 -1
  48. package/js/tag/update/processTag.function.js.map +1 -1
  49. package/js/tag/update/processTagArray.d.ts +0 -1
  50. package/js/tag/update/processTagArray.js +1 -2
  51. package/js/tag/update/processTagArray.js.map +1 -1
  52. package/js/tag/update/processTagResult.function.d.ts +1 -2
  53. package/js/tag/update/processTagResult.function.js +3 -4
  54. package/js/tag/update/processTagResult.function.js.map +1 -1
  55. package/js/tag/update/updateContextItem.function.d.ts +1 -1
  56. package/js/tag/update/updateExistingTagComponent.function.js +0 -2
  57. package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
  58. package/js/tag/update/updateExistingValue.function.d.ts +1 -1
  59. package/js/tag/update/updateExistingValue.function.js +36 -47
  60. package/js/tag/update/updateExistingValue.function.js.map +1 -1
  61. package/js/updateBeforeTemplate.function.d.ts +5 -1
  62. package/js/updateBeforeTemplate.function.js +10 -7
  63. package/js/updateBeforeTemplate.function.js.map +1 -1
  64. package/package.json +1 -1
  65. package/js/Clones.type.d.ts +0 -3
  66. package/js/Clones.type.js +0 -2
  67. package/js/Clones.type.js.map +0 -1
  68. package/js/ElementTargetEvent.interface.d.ts +0 -6
  69. package/js/ElementTargetEvent.interface.js +0 -2
  70. package/js/ElementTargetEvent.interface.js.map +0 -1
  71. package/js/Tag.class.d.ts +0 -37
  72. package/js/Tag.class.js +0 -21
  73. package/js/Tag.class.js.map +0 -1
  74. package/js/Tag.utils.d.ts +0 -17
  75. package/js/Tag.utils.js +0 -6
  76. package/js/Tag.utils.js.map +0 -1
  77. package/js/TagSupport.class.d.ts +0 -58
  78. package/js/TagSupport.class.js +0 -309
  79. package/js/TagSupport.class.js.map +0 -1
  80. package/js/afterInterpolateElement.function.d.ts +0 -4
  81. package/js/afterInterpolateElement.function.js +0 -14
  82. package/js/afterInterpolateElement.function.js.map +0 -1
  83. package/js/bindSubjectCallback.function.d.ts +0 -7
  84. package/js/bindSubjectCallback.function.js +0 -41
  85. package/js/bindSubjectCallback.function.js.map +0 -1
  86. package/js/checkDestroyPrevious.function.d.ts +0 -8
  87. package/js/checkDestroyPrevious.function.js +0 -83
  88. package/js/checkDestroyPrevious.function.js.map +0 -1
  89. package/js/cloneValueArray.function.d.ts +0 -2
  90. package/js/cloneValueArray.function.js +0 -19
  91. package/js/cloneValueArray.function.js.map +0 -1
  92. package/js/destroy.support.d.ts +0 -6
  93. package/js/destroy.support.js +0 -10
  94. package/js/destroy.support.js.map +0 -1
  95. package/js/destroyTag.function.d.ts +0 -4
  96. package/js/destroyTag.function.js +0 -12
  97. package/js/destroyTag.function.js.map +0 -1
  98. package/js/elementDestroyCheck.function.d.ts +0 -3
  99. package/js/elementDestroyCheck.function.js +0 -17
  100. package/js/elementDestroyCheck.function.js.map +0 -1
  101. package/js/elementInitCheck.d.ts +0 -2
  102. package/js/elementInitCheck.js +0 -18
  103. package/js/elementInitCheck.js.map +0 -1
  104. package/js/getCallback.d.ts +0 -3
  105. package/js/getCallback.js +0 -51
  106. package/js/getCallback.js.map +0 -1
  107. package/js/hasTagSupportChanged.function.d.ts +0 -7
  108. package/js/hasTagSupportChanged.function.js +0 -70
  109. package/js/hasTagSupportChanged.function.js.map +0 -1
  110. package/js/html.d.ts +0 -2
  111. package/js/html.js +0 -5
  112. package/js/html.js.map +0 -1
  113. package/js/inputAttribute.d.ts +0 -1
  114. package/js/inputAttribute.js +0 -19
  115. package/js/inputAttribute.js.map +0 -1
  116. package/js/interpolateAttributes.d.ts +0 -3
  117. package/js/interpolateAttributes.js +0 -20
  118. package/js/interpolateAttributes.js.map +0 -1
  119. package/js/interpolateContentTemplates.d.ts +0 -9
  120. package/js/interpolateContentTemplates.js +0 -42
  121. package/js/interpolateContentTemplates.js.map +0 -1
  122. package/js/interpolateElement.d.ts +0 -13
  123. package/js/interpolateElement.js +0 -36
  124. package/js/interpolateElement.js.map +0 -1
  125. package/js/interpolateTemplate.d.ts +0 -31
  126. package/js/interpolateTemplate.js +0 -89
  127. package/js/interpolateTemplate.js.map +0 -1
  128. package/js/interpolations.d.ts +0 -7
  129. package/js/interpolations.js +0 -18
  130. package/js/interpolations.js.map +0 -1
  131. package/js/isLikeTags.function.d.ts +0 -5
  132. package/js/isLikeTags.function.js +0 -42
  133. package/js/isLikeTags.function.js.map +0 -1
  134. package/js/onDestroy.d.ts +0 -2
  135. package/js/onDestroy.js +0 -17
  136. package/js/onDestroy.js.map +0 -1
  137. package/js/onInit.d.ts +0 -2
  138. package/js/onInit.js +0 -17
  139. package/js/onInit.js.map +0 -1
  140. package/js/processAttribute.function.d.ts +0 -4
  141. package/js/processAttribute.function.js +0 -122
  142. package/js/processAttribute.function.js.map +0 -1
  143. package/js/processNewValue.function.d.ts +0 -3
  144. package/js/processNewValue.function.js +0 -43
  145. package/js/processNewValue.function.js.map +0 -1
  146. package/js/processRegularValue.function.d.ts +0 -5
  147. package/js/processRegularValue.function.js +0 -15
  148. package/js/processRegularValue.function.js.map +0 -1
  149. package/js/processSubjectComponent.function.d.ts +0 -9
  150. package/js/processSubjectComponent.function.js +0 -35
  151. package/js/processSubjectComponent.function.js.map +0 -1
  152. package/js/processSubjectValue.function.d.ts +0 -25
  153. package/js/processSubjectValue.function.js +0 -55
  154. package/js/processSubjectValue.function.js.map +0 -1
  155. package/js/processTag.function.d.ts +0 -11
  156. package/js/processTag.function.js +0 -43
  157. package/js/processTag.function.js.map +0 -1
  158. package/js/processTagArray.d.ts +0 -23
  159. package/js/processTagArray.js +0 -120
  160. package/js/processTagArray.js.map +0 -1
  161. package/js/processTagResult.function.d.ts +0 -11
  162. package/js/processTagResult.function.js +0 -30
  163. package/js/processTagResult.function.js.map +0 -1
  164. package/js/propState.function.d.ts +0 -2
  165. package/js/propState.function.js +0 -3
  166. package/js/propState.function.js.map +0 -1
  167. package/js/provider.utils.d.ts +0 -2
  168. package/js/provider.utils.js +0 -45
  169. package/js/provider.utils.js.map +0 -1
  170. package/js/providers.d.ts +0 -18
  171. package/js/providers.js +0 -86
  172. package/js/providers.js.map +0 -1
  173. package/js/renderExistingTag.function.d.ts +0 -7
  174. package/js/renderExistingTag.function.js +0 -32
  175. package/js/renderExistingTag.function.js.map +0 -1
  176. package/js/renderSubjectComponent.function.d.ts +0 -3
  177. package/js/renderSubjectComponent.function.js +0 -14
  178. package/js/renderSubjectComponent.function.js.map +0 -1
  179. package/js/renderTagOnly.function.d.ts +0 -4
  180. package/js/renderTagOnly.function.js +0 -39
  181. package/js/renderTagOnly.function.js.map +0 -1
  182. package/js/renderTagSupport.function.d.ts +0 -4
  183. package/js/renderTagSupport.function.js +0 -37
  184. package/js/renderTagSupport.function.js.map +0 -1
  185. package/js/renderWithSupport.function.d.ts +0 -5
  186. package/js/renderWithSupport.function.js +0 -31
  187. package/js/renderWithSupport.function.js.map +0 -1
  188. package/js/scanTextAreaValue.function.d.ts +0 -2
  189. package/js/scanTextAreaValue.function.js +0 -16
  190. package/js/scanTextAreaValue.function.js.map +0 -1
  191. package/js/set.function.d.ts +0 -24
  192. package/js/set.function.js +0 -116
  193. package/js/set.function.js.map +0 -1
  194. package/js/setLet.function.d.ts +0 -3
  195. package/js/setLet.function.js +0 -42
  196. package/js/setLet.function.js.map +0 -1
  197. package/js/setProp.function.d.ts +0 -3
  198. package/js/setProp.function.js +0 -37
  199. package/js/setProp.function.js.map +0 -1
  200. package/js/setTagPlaceholder.function.d.ts +0 -2
  201. package/js/setTagPlaceholder.function.js +0 -8
  202. package/js/setTagPlaceholder.function.js.map +0 -1
  203. package/js/setUse.function.d.ts +0 -23
  204. package/js/setUse.function.js +0 -14
  205. package/js/setUse.function.js.map +0 -1
  206. package/js/state/getCallback.d.ts +0 -3
  207. package/js/state/getCallback.js +0 -51
  208. package/js/state/getCallback.js.map +0 -1
  209. package/js/state/setProp.function.d.ts +0 -3
  210. package/js/state/setProp.function.js +0 -37
  211. package/js/state/setProp.function.js.map +0 -1
  212. package/js/tag/updates/processNewValue.function.d.ts +0 -3
  213. package/js/tag/updates/processNewValue.function.js +0 -43
  214. package/js/tag/updates/processNewValue.function.js.map +0 -1
  215. package/js/tag.d.ts +0 -21
  216. package/js/tag.js +0 -121
  217. package/js/tag.js.map +0 -1
  218. package/js/tagElement.d.ts +0 -9
  219. package/js/tagElement.js +0 -55
  220. package/js/tagElement.js.map +0 -1
  221. package/js/tagRunner.d.ts +0 -6
  222. package/js/tagRunner.js +0 -30
  223. package/js/tagRunner.js.map +0 -1
  224. package/js/updateContextItem.function.d.ts +0 -3
  225. package/js/updateContextItem.function.js +0 -42
  226. package/js/updateContextItem.function.js.map +0 -1
  227. package/js/updateExistingTagComponent.function.d.ts +0 -5
  228. package/js/updateExistingTagComponent.function.js +0 -108
  229. package/js/updateExistingTagComponent.function.js.map +0 -1
  230. package/js/updateExistingValue.function.d.ts +0 -4
  231. package/js/updateExistingValue.function.js +0 -135
  232. package/js/updateExistingValue.function.js.map +0 -1
  233. package/js/watch.function.d.ts +0 -3
  234. package/js/watch.function.js +0 -20
  235. package/js/watch.function.js.map +0 -1
  236. /package/js/{Errors.d.ts → errors.d.ts} +0 -0
  237. /package/js/{Errors.js → errors.js} +0 -0
  238. /package/js/{Errors.js.map → errors.js.map} +0 -0
  239. /package/js/subject/{Subject.utils.d.ts → subject.utils.d.ts} +0 -0
  240. /package/js/subject/{Subject.utils.js → subject.utils.js} +0 -0
  241. /package/js/subject/{Subject.utils.js.map → subject.utils.js.map} +0 -0
package/bundle.js CHANGED
@@ -514,25 +514,23 @@ __webpack_require__.r(__webpack_exports__);
514
514
  /* harmony export */ });
515
515
  /* harmony import */ var _interpolateTemplate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interpolateTemplate */ "./ts/interpolations/interpolateTemplate.ts");
516
516
 
517
- function interpolateContentTemplates(element, context, tagSupport, options, children) {
518
- if (!children || element.tagName === 'TEMPLATE') {
519
- return { clones: [], tagComponents: [] }; // done
520
- }
517
+ function interpolateContentTemplates(context, tagSupport, options, children) {
521
518
  // counting for animation stagger computing
522
519
  const counts = options.counts;
523
520
  const clones = [];
524
521
  const tagComponents = [];
525
- const childArray = new Array(...children);
526
- childArray.forEach(child => {
522
+ const childLength = children.length;
523
+ for (let index = childLength - 1; index >= 0; --index) {
524
+ const child = children[index];
527
525
  const { clones: nextClones, tagComponent } = (0,_interpolateTemplate__WEBPACK_IMPORTED_MODULE_0__.interpolateTemplate)(child, context, tagSupport, counts, options);
528
526
  clones.push(...nextClones);
529
527
  if (tagComponent) {
530
528
  tagComponents.push(tagComponent);
531
- return;
529
+ continue;
532
530
  }
533
531
  if (child.children) {
534
- const nextKids = new Array(...child.children);
535
- nextKids.forEach((subChild, index) => {
532
+ for (let index = child.children.length - 1; index >= 0; --index) {
533
+ const subChild = child.children[index];
536
534
  // IF <template end /> its a variable to be processed
537
535
  if (isRenderEndTemplate(subChild)) {
538
536
  const { tagComponent } = (0,_interpolateTemplate__WEBPACK_IMPORTED_MODULE_0__.interpolateTemplate)(subChild, context, tagSupport, counts, options);
@@ -540,12 +538,12 @@ function interpolateContentTemplates(element, context, tagSupport, options, chil
540
538
  tagComponents.push(tagComponent);
541
539
  }
542
540
  }
543
- const { clones: nextClones, tagComponents: nextTagComponent } = interpolateContentTemplates(subChild, context, tagSupport, options, subChild.children);
541
+ const { clones: nextClones, tagComponents: nextTagComponent } = interpolateContentTemplates(context, tagSupport, options, subChild.children);
544
542
  clones.push(...nextClones);
545
543
  tagComponents.push(...nextTagComponent);
546
- });
544
+ }
547
545
  }
548
- });
546
+ }
549
547
  return { clones, tagComponents };
550
548
  }
551
549
  function isRenderEndTemplate(child) {
@@ -587,21 +585,22 @@ interpolatedTemplates, ownerSupport, options) {
587
585
  const template = container.children[0];
588
586
  const children = template.content.children;
589
587
  if (result.keys.length) {
590
- const { clones: nextClones, tagComponents: nextTagComponents } = (0,_interpolateContentTemplates__WEBPACK_IMPORTED_MODULE_2__.interpolateContentTemplates)(container, context, ownerSupport, options, children);
588
+ const { clones: nextClones, tagComponents: nextTagComponents } = (0,_interpolateContentTemplates__WEBPACK_IMPORTED_MODULE_2__.interpolateContentTemplates)(context, ownerSupport, options, children);
591
589
  clones.push(...nextClones);
592
590
  tagComponents.push(...nextTagComponents);
593
591
  }
594
- (0,_interpolateAttributes__WEBPACK_IMPORTED_MODULE_0__.interpolateAttributes)(container, context, ownerSupport);
592
+ (0,_interpolateAttributes__WEBPACK_IMPORTED_MODULE_0__.interpolateAttributes)(template, context, ownerSupport);
595
593
  processChildrenAttributes(children, context, ownerSupport);
596
594
  return { clones, tagComponents };
597
595
  }
598
596
  function processChildrenAttributes(children, context, ownerSupport) {
599
- new Array(...children).forEach(child => {
597
+ for (let index = children.length - 1; index >= 0; --index) {
598
+ const child = children[index];
600
599
  (0,_interpolateAttributes__WEBPACK_IMPORTED_MODULE_0__.interpolateAttributes)(child, context, ownerSupport);
601
600
  if (child.children) {
602
601
  processChildrenAttributes(child.children, context, ownerSupport);
603
602
  }
604
- });
603
+ }
605
604
  }
606
605
  function interpolateString(string) {
607
606
  const result = (0,_interpolations__WEBPACK_IMPORTED_MODULE_1__.interpolateToTemplates)(string);
@@ -626,7 +625,7 @@ __webpack_require__.r(__webpack_exports__);
626
625
  /* harmony export */ });
627
626
  /* harmony import */ var _tag_Tag_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tag/Tag.class */ "./ts/tag/Tag.class.ts");
628
627
  /* harmony import */ var _elementInitCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elementInitCheck */ "./ts/interpolations/elementInitCheck.ts");
629
- /* harmony import */ var _tag_update_processSubjectValue_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tag/update/processSubjectValue.function */ "./ts/tag/update/processSubjectValue.function.ts");
628
+ /* harmony import */ var _tag_update_processFirstSubjectValue_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tag/update/processFirstSubjectValue.function */ "./ts/tag/update/processFirstSubjectValue.function.ts");
630
629
  /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../isInstance */ "./ts/isInstance.ts");
631
630
  /* harmony import */ var _scanTextAreaValue_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scanTextAreaValue.function */ "./ts/interpolations/scanTextAreaValue.function.ts");
632
631
  /* harmony import */ var _tag_update_updateExistingValue_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tag/update/updateExistingValue.function */ "./ts/tag/update/updateExistingValue.function.ts");
@@ -666,12 +665,10 @@ options) {
666
665
  }
667
666
  };
668
667
  }
669
- let isForceElement = options.forceElement;
670
- subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts, { isForceElement });
668
+ subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts);
671
669
  return { clones };
672
670
  }
673
- function subscribeToTemplate(insertBefore, subject, ownerSupport, counts, // used for animation stagger computing
674
- { isForceElement }) {
671
+ function subscribeToTemplate(insertBefore, subject, ownerSupport, counts) {
675
672
  let called = false;
676
673
  const onValue = (value) => {
677
674
  if (called) {
@@ -679,13 +676,9 @@ function subscribeToTemplate(insertBefore, subject, ownerSupport, counts, // use
679
676
  return;
680
677
  }
681
678
  const templater = value;
682
- (0,_tag_update_processSubjectValue_function__WEBPACK_IMPORTED_MODULE_2__.processSubjectValue)(templater, subject, insertBefore, ownerSupport, {
679
+ (0,_tag_update_processFirstSubjectValue_function__WEBPACK_IMPORTED_MODULE_2__.processFirstSubjectValue)(templater, subject, insertBefore, ownerSupport, {
683
680
  counts: { ...counts },
684
- forceElement: isForceElement,
685
681
  });
686
- if (isForceElement) {
687
- isForceElement = false; // only can happen once
688
- }
689
682
  called = true;
690
683
  };
691
684
  let mutatingCallback = onValue;
@@ -716,13 +709,15 @@ function afterElmBuild(elm, options, context, ownerSupport) {
716
709
  let diff = options.counts.added;
717
710
  diff = (0,_elementInitCheck__WEBPACK_IMPORTED_MODULE_1__.elementInitCheck)(elm, options.counts) - diff;
718
711
  if (elm.children) {
719
- new Array(...elm.children).forEach((child, index) => {
712
+ const children = elm.children;
713
+ for (let index = children.length - 1; index >= 0; --index) {
714
+ const child = children[index];
720
715
  const subOptions = {
721
716
  ...options,
722
717
  counts: options.counts,
723
718
  };
724
719
  return afterElmBuild(child, subOptions, context, ownerSupport);
725
- });
720
+ }
726
721
  }
727
722
  }
728
723
 
@@ -944,9 +939,6 @@ __webpack_require__.r(__webpack_exports__);
944
939
  /* harmony export */ isTagComponent: () => (/* binding */ isTagComponent),
945
940
  /* harmony export */ isTagTemplater: () => (/* binding */ isTagTemplater)
946
941
  /* harmony export */ });
947
- function isTagComponent(value) {
948
- return value?.wrapper?.parentWrap.original instanceof Function;
949
- }
950
942
  function isTag(value) {
951
943
  return isTagTemplater(value) || isTagClass(value);
952
944
  }
@@ -954,6 +946,10 @@ function isTagTemplater(value) {
954
946
  const templater = value;
955
947
  return templater?.isTemplater === true && templater.wrapper === undefined;
956
948
  }
949
+ // TODO: whats the difference between isTagClass and isTagComponent
950
+ function isTagComponent(value) {
951
+ return value?.wrapper?.parentWrap.original instanceof Function;
952
+ }
957
953
  function isTagClass(value) {
958
954
  const templater = value;
959
955
  return templater?.isTagClass === true;
@@ -2327,7 +2323,6 @@ class BaseTagSupport {
2327
2323
  appElement; // only seen on this.getAppTagSupport().appElement
2328
2324
  strings;
2329
2325
  values;
2330
- lastTemplateString = undefined; // used to compare templates for updates
2331
2326
  propsConfig;
2332
2327
  // stays with current render
2333
2328
  memory = {
@@ -2362,7 +2357,6 @@ class BaseTagSupport {
2362
2357
  }
2363
2358
  /** Function that kicks off actually putting tags down as HTML elements */
2364
2359
  buildBeforeElement(insertBefore, options = {
2365
- forceElement: false,
2366
2360
  counts: { added: 0, removed: 0 },
2367
2361
  }) {
2368
2362
  const subject = this.subject;
@@ -2378,22 +2372,20 @@ class BaseTagSupport {
2378
2372
  this.hasLiveElements = true;
2379
2373
  const context = this.update();
2380
2374
  const template = this.getTemplate();
2381
- const isForceElement = options.forceElement;
2382
- const elementContainer = document.createElement('div');
2383
- elementContainer.id = 'tag-temp-holder';
2384
- // render content with a first child that we can know is our first element
2385
- elementContainer.innerHTML = `<template id="temp-template-tag-wrap">${template.string}</template>`;
2375
+ const elementContainer = document.createDocumentFragment();
2376
+ const tempDraw = document.createElement('template');
2377
+ tempDraw.innerHTML = template.string;
2378
+ elementContainer.appendChild(tempDraw);
2386
2379
  // Search/replace innerHTML variables but don't interpolate tag components just yet
2387
2380
  const { tagComponents } = (0,_interpolations_interpolateElement__WEBPACK_IMPORTED_MODULE_11__.interpolateElement)(elementContainer, context, template, this, // ownerSupport,
2388
2381
  {
2389
- forceElement: options.forceElement,
2390
2382
  counts: options.counts
2391
2383
  });
2392
2384
  (0,_interpolations_afterInterpolateElement_function__WEBPACK_IMPORTED_MODULE_13__.afterInterpolateElement)(elementContainer, placeholderElm, this, // ownerSupport
2393
2385
  context, options);
2394
2386
  // Any tag components that were found should be processed AFTER the owner processes its elements. Avoid double processing of elements attributes like (oninit)=${}
2395
2387
  tagComponents.forEach(tagComponent => {
2396
- (0,_interpolations_interpolateTemplate__WEBPACK_IMPORTED_MODULE_12__.subscribeToTemplate)(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts, { isForceElement });
2388
+ (0,_interpolations_interpolateTemplate__WEBPACK_IMPORTED_MODULE_12__.subscribeToTemplate)(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts);
2397
2389
  (0,_interpolations_afterInterpolateElement_function__WEBPACK_IMPORTED_MODULE_13__.afterInterpolateElement)(elementContainer, tagComponent.insertBefore, tagComponent.ownerSupport, context, options);
2398
2390
  });
2399
2391
  }
@@ -2408,7 +2400,6 @@ class BaseTagSupport {
2408
2400
  return trimString;
2409
2401
  }).join('');
2410
2402
  const interpolation = (0,_interpolations_interpolateElement__WEBPACK_IMPORTED_MODULE_11__.interpolateString)(string);
2411
- this.lastTemplateString = interpolation.string;
2412
2403
  return {
2413
2404
  interpolation,
2414
2405
  string: interpolation.string,
@@ -2425,19 +2416,19 @@ class BaseTagSupport {
2425
2416
  const strings = this.strings || thisTag.strings;
2426
2417
  const values = this.values || thisTag.values;
2427
2418
  strings.map((_string, index) => {
2428
- const variableName = _Tag_class__WEBPACK_IMPORTED_MODULE_0__.variablePrefix + index;
2429
2419
  const hasValue = values.length > index;
2420
+ if (!hasValue) {
2421
+ return;
2422
+ }
2423
+ const variableName = _Tag_class__WEBPACK_IMPORTED_MODULE_0__.variablePrefix + index;
2430
2424
  const value = values[index];
2431
2425
  // is something already there?
2432
2426
  const exists = variableName in context;
2433
2427
  if (exists) {
2434
2428
  return (0,_update_updateContextItem_function__WEBPACK_IMPORTED_MODULE_8__.updateContextItem)(context, variableName, value);
2435
2429
  }
2436
- if (!hasValue) {
2437
- return;
2438
- }
2439
2430
  // 🆕 First time values below
2440
- context[variableName] = (0,_update_processNewValue_function__WEBPACK_IMPORTED_MODULE_9__.processNewValue)(hasValue, value, this);
2431
+ context[variableName] = (0,_update_processNewValue_function__WEBPACK_IMPORTED_MODULE_9__.processNewValue)(value, this);
2441
2432
  });
2442
2433
  return context;
2443
2434
  }
@@ -2468,6 +2459,7 @@ class TagSupport extends BaseTagSupport {
2468
2459
  if (firstDestroy && (0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagComponent)(this.templater)) {
2469
2460
  (0,_tagRunner__WEBPACK_IMPORTED_MODULE_5__.runBeforeDestroy)(this, this);
2470
2461
  }
2462
+ this.destroySubscriptions();
2471
2463
  // signify immediately child has been deleted (looked for during event processing)
2472
2464
  childTags.forEach(child => {
2473
2465
  const subGlobal = child.global;
@@ -2487,7 +2479,6 @@ class TagSupport extends BaseTagSupport {
2487
2479
  }
2488
2480
  }
2489
2481
  }
2490
- this.destroySubscriptions();
2491
2482
  let mainPromise;
2492
2483
  if (this.ownerTagSupport) {
2493
2484
  this.ownerTagSupport.childTags = this.ownerTagSupport.childTags.filter(child => child !== this);
@@ -2533,6 +2524,7 @@ class TagSupport extends BaseTagSupport {
2533
2524
  const oldClones = [...this.clones];
2534
2525
  this.clones.length = 0; // tag maybe used for something else
2535
2526
  const promises = oldClones.map(clone => this.checkCloneRemoval(clone, stagger)).filter(x => x); // only return promises
2527
+ // check subjects that may have clones attached to them
2536
2528
  const oldContext = this.global.context;
2537
2529
  Object.values(oldContext).forEach(value => {
2538
2530
  const clone = value.clone;
@@ -2591,7 +2583,6 @@ class TagSupport extends BaseTagSupport {
2591
2583
  const newSupport = (0,_render_renderSubjectComponent_function__WEBPACK_IMPORTED_MODULE_14__.renderSubjectComponent)(this.subject, this, this.ownerTagSupport);
2592
2584
  await this.destroy();
2593
2585
  newSupport.buildBeforeElement(this.global.insertBefore, {
2594
- forceElement: true,
2595
2586
  counts: { added: 0, removed: 0 },
2596
2587
  });
2597
2588
  return newSupport;
@@ -2622,6 +2613,7 @@ __webpack_require__.r(__webpack_exports__);
2622
2613
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2623
2614
  /* harmony export */ checkDestroyPrevious: () => (/* binding */ checkDestroyPrevious),
2624
2615
  /* harmony export */ destroyArrayTag: () => (/* binding */ destroyArrayTag),
2616
+ /* harmony export */ isSimpleType: () => (/* binding */ isSimpleType),
2625
2617
  /* harmony export */ restoreTagMarker: () => (/* binding */ restoreTagMarker)
2626
2618
  /* harmony export */ });
2627
2619
  /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isInstance */ "./ts/isInstance.ts");
@@ -2634,6 +2626,21 @@ __webpack_require__.r(__webpack_exports__);
2634
2626
 
2635
2627
  function checkDestroyPrevious(subject, // existing.value is the old value
2636
2628
  newValue, insertBefore) {
2629
+ const displaySubject = subject;
2630
+ const hasLastValue = 'lastValue' in displaySubject;
2631
+ const lastValue = displaySubject.lastValue; // TODO: we maybe able to use displaySubject.value and remove concept of lastValue
2632
+ // was simple value but now something bigger
2633
+ if (hasLastValue && lastValue !== newValue) {
2634
+ const newType = typeof (newValue);
2635
+ if (isSimpleType(newType) && typeof (lastValue) === newType) {
2636
+ return false;
2637
+ }
2638
+ if (newValue instanceof Function && lastValue instanceof Function) {
2639
+ return false;
2640
+ }
2641
+ destroySimpleValue(insertBefore, displaySubject);
2642
+ return 'changed-simple-value';
2643
+ }
2637
2644
  const arraySubject = subject;
2638
2645
  const wasArray = arraySubject.lastArray;
2639
2646
  // no longer an array
@@ -2672,16 +2679,11 @@ newValue, insertBefore) {
2672
2679
  (0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagMemory)(lastSupport);
2673
2680
  return 'different-tag';
2674
2681
  }
2675
- const displaySubject = subject;
2676
- const hasLastValue = 'lastValue' in displaySubject;
2677
- const lastValue = displaySubject.lastValue; // TODO: we maybe able to use displaySubject.value and remove concept of lastValue
2678
- // was simple value but now something bigger
2679
- if (hasLastValue && lastValue !== newValue) {
2680
- destroySimpleValue(insertBefore, displaySubject);
2681
- return 'changed-simple-value';
2682
- }
2683
2682
  return false;
2684
2683
  }
2684
+ function isSimpleType(value) {
2685
+ return ['string', 'number', 'boolean'].includes(value);
2686
+ }
2685
2687
  function destroyArrayTag(tagSupport, counts) {
2686
2688
  (0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagSupportPast)(tagSupport);
2687
2689
  tagSupport.destroy({
@@ -3472,9 +3474,14 @@ __webpack_require__.r(__webpack_exports__);
3472
3474
 
3473
3475
 
3474
3476
  const appElements = [];
3475
- function tagElement(
3476
- // app: TagComponent, // (...args: unknown[]) => TemplaterResult,
3477
- app, // (...args: unknown[]) => TemplaterResult,
3477
+ /**
3478
+ *
3479
+ * @param app taggedjs tag
3480
+ * @param element HTMLElement
3481
+ * @param props object
3482
+ * @returns
3483
+ */
3484
+ function tagElement(app, // (...args: unknown[]) => TemplaterResult,
3478
3485
  element, props) {
3479
3486
  const appElmIndex = appElements.findIndex(appElm => appElm.element === element);
3480
3487
  if (appElmIndex >= 0) {
@@ -3517,7 +3524,6 @@ function runWrapper(templater) {
3517
3524
  let newSupport = {};
3518
3525
  const subject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_2__.ValueSubject(newSupport);
3519
3526
  newSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__.BaseTagSupport(templater, subject);
3520
- // newSupport.ownerTagSupport = newSupport
3521
3527
  subject.set(templater);
3522
3528
  subject.tagSupport = newSupport;
3523
3529
  (0,_tagRunner__WEBPACK_IMPORTED_MODULE_1__.runBeforeRender)(newSupport, undefined);
@@ -3576,6 +3582,119 @@ function runBeforeDestroy(tagSupport, ownerTagSupport) {
3576
3582
  }
3577
3583
 
3578
3584
 
3585
+ /***/ }),
3586
+
3587
+ /***/ "./ts/tag/update/processFirstSubject.utils.ts":
3588
+ /*!****************************************************!*\
3589
+ !*** ./ts/tag/update/processFirstSubject.utils.ts ***!
3590
+ \****************************************************/
3591
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3592
+
3593
+ __webpack_require__.r(__webpack_exports__);
3594
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3595
+ /* harmony export */ ValueTypes: () => (/* binding */ ValueTypes),
3596
+ /* harmony export */ getValueType: () => (/* binding */ getValueType)
3597
+ /* harmony export */ });
3598
+ /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../isInstance */ "./ts/isInstance.ts");
3599
+ /* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../checkDestroyPrevious.function */ "./ts/tag/checkDestroyPrevious.function.ts");
3600
+
3601
+
3602
+ var ValueTypes;
3603
+ (function (ValueTypes) {
3604
+ ValueTypes["unknown"] = "unknown";
3605
+ ValueTypes["tag"] = "tag";
3606
+ ValueTypes["templater"] = "templater";
3607
+ ValueTypes["tagArray"] = "tag-array";
3608
+ ValueTypes["tagComponent"] = "tag-component";
3609
+ ValueTypes["subject"] = "subject";
3610
+ ValueTypes["date"] = "date";
3611
+ ValueTypes["string"] = "string";
3612
+ ValueTypes["boolean"] = "boolean";
3613
+ ValueTypes["function"] = "function";
3614
+ ValueTypes["undefined"] = "undefined";
3615
+ })(ValueTypes || (ValueTypes = {}));
3616
+ function getValueType(value) {
3617
+ if (value === undefined || value === null) {
3618
+ return ValueTypes.undefined;
3619
+ }
3620
+ if (value instanceof Date) {
3621
+ return ValueTypes.date;
3622
+ }
3623
+ if (value instanceof Function) {
3624
+ return ValueTypes.function;
3625
+ }
3626
+ const type = typeof (value);
3627
+ if ((0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_1__.isSimpleType)(type)) {
3628
+ return type;
3629
+ }
3630
+ if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagComponent)(value)) {
3631
+ return ValueTypes.tagComponent;
3632
+ }
3633
+ if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagTemplater)(value)) {
3634
+ return ValueTypes.templater;
3635
+ }
3636
+ if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagClass)(value)) {
3637
+ return ValueTypes.tag;
3638
+ }
3639
+ if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isTagArray)(value)) {
3640
+ return ValueTypes.tagArray;
3641
+ }
3642
+ if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_0__.isSubjectInstance)(value)) {
3643
+ return ValueTypes.subject;
3644
+ }
3645
+ return ValueTypes.unknown;
3646
+ }
3647
+
3648
+
3649
+ /***/ }),
3650
+
3651
+ /***/ "./ts/tag/update/processFirstSubjectValue.function.ts":
3652
+ /*!************************************************************!*\
3653
+ !*** ./ts/tag/update/processFirstSubjectValue.function.ts ***!
3654
+ \************************************************************/
3655
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3656
+
3657
+ __webpack_require__.r(__webpack_exports__);
3658
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3659
+ /* harmony export */ processFirstSubjectValue: () => (/* binding */ processFirstSubjectValue)
3660
+ /* harmony export */ });
3661
+ /* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/tag/update/processSubjectComponent.function.ts");
3662
+ /* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processTagArray */ "./ts/tag/update/processTagArray.ts");
3663
+ /* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/tag/update/processRegularValue.function.ts");
3664
+ /* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processTag.function */ "./ts/tag/update/processTag.function.ts");
3665
+ /* harmony import */ var _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processFirstSubject.utils */ "./ts/tag/update/processFirstSubject.utils.ts");
3666
+
3667
+
3668
+
3669
+
3670
+
3671
+ function processFirstSubjectValue(value, subject, // could be tag via result.tag
3672
+ insertBefore, // <template end interpolate /> (will be removed)
3673
+ ownerSupport, // owner
3674
+ options) {
3675
+ const valueType = (0,_processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__.getValueType)(value);
3676
+ switch (valueType) {
3677
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__.ValueTypes.templater:
3678
+ (0,_processTag_function__WEBPACK_IMPORTED_MODULE_3__.processTag)(value, insertBefore, ownerSupport, subject);
3679
+ return;
3680
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__.ValueTypes.tag:
3681
+ const tag = value;
3682
+ let templater = tag.templater;
3683
+ if (!templater) {
3684
+ templater = (0,_processTag_function__WEBPACK_IMPORTED_MODULE_3__.tagFakeTemplater)(tag);
3685
+ }
3686
+ (0,_processTag_function__WEBPACK_IMPORTED_MODULE_3__.processTag)(templater, insertBefore, ownerSupport, subject);
3687
+ return;
3688
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__.ValueTypes.tagArray:
3689
+ return (0,_processTagArray__WEBPACK_IMPORTED_MODULE_1__.processTagArray)(subject, value, insertBefore, ownerSupport, options);
3690
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_4__.ValueTypes.tagComponent:
3691
+ (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__.processSubjectComponent)(value, subject, insertBefore, ownerSupport, options);
3692
+ return;
3693
+ }
3694
+ (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_2__.processFirstRegularValue)(value, subject, insertBefore);
3695
+ }
3696
+
3697
+
3579
3698
  /***/ }),
3580
3699
 
3581
3700
  /***/ "./ts/tag/update/processNewValue.function.ts":
@@ -3589,35 +3708,27 @@ __webpack_require__.r(__webpack_exports__);
3589
3708
  /* harmony export */ processNewValue: () => (/* binding */ processNewValue)
3590
3709
  /* harmony export */ });
3591
3710
  /* harmony import */ var _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../subject/ValueSubject */ "./ts/subject/ValueSubject.ts");
3592
- /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../isInstance */ "./ts/isInstance.ts");
3593
- /* harmony import */ var _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../TemplaterResult.class */ "./ts/TemplaterResult.class.ts");
3594
- /* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../TagSupport.class */ "./ts/tag/TagSupport.class.ts");
3711
+ /* harmony import */ var _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../TemplaterResult.class */ "./ts/TemplaterResult.class.ts");
3712
+ /* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../TagSupport.class */ "./ts/tag/TagSupport.class.ts");
3713
+ /* harmony import */ var _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processFirstSubject.utils */ "./ts/tag/update/processFirstSubject.utils.ts");
3595
3714
 
3596
3715
 
3597
3716
 
3598
3717
 
3599
- function processNewValue(hasValue, value, ownerSupport) {
3600
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagComponent)(value)) {
3601
- const tagSubject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
3602
- return tagSubject;
3603
- }
3604
- if (value instanceof Function) {
3605
- return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
3606
- }
3607
- if (!hasValue) {
3608
- return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(undefined);
3609
- }
3610
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagTemplater)(value)) {
3611
- const templater = value;
3612
- const tag = templater.tag;
3613
- return processNewTag(tag, ownerSupport);
3614
- }
3615
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagClass)(value)) {
3616
- return processNewTag(value, ownerSupport);
3617
- }
3618
- // is already a value subject?
3619
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isSubjectInstance)(value)) {
3620
- return value;
3718
+ function processNewValue(value, ownerSupport) {
3719
+ const valueType = (0,_processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.getValueType)(value);
3720
+ switch (valueType) {
3721
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.tagComponent:
3722
+ const tagSubject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
3723
+ return tagSubject;
3724
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.templater:
3725
+ const templater = value;
3726
+ const tag = templater.tag;
3727
+ return processNewTag(tag, ownerSupport);
3728
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.tag:
3729
+ return processNewTag(value, ownerSupport);
3730
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.subject:
3731
+ return value;
3621
3732
  }
3622
3733
  return new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(value);
3623
3734
  }
@@ -3625,12 +3736,12 @@ function processNewTag(value, ownerSupport) {
3625
3736
  const tag = value;
3626
3737
  let templater = tag.templater;
3627
3738
  if (!templater) {
3628
- templater = new _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_2__.TemplaterResult([]);
3739
+ templater = new _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_1__.TemplaterResult([]);
3629
3740
  templater.tag = tag;
3630
3741
  tag.templater = templater;
3631
3742
  }
3632
3743
  const subject = new _subject_ValueSubject__WEBPACK_IMPORTED_MODULE_0__.ValueSubject(templater);
3633
- const tagSupport = subject.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_3__.TagSupport(templater, ownerSupport, subject);
3744
+ subject.tagSupport = new _TagSupport_class__WEBPACK_IMPORTED_MODULE_2__.TagSupport(templater, ownerSupport, subject);
3634
3745
  return subject;
3635
3746
  }
3636
3747
 
@@ -3645,6 +3756,7 @@ function processNewTag(value, ownerSupport) {
3645
3756
 
3646
3757
  __webpack_require__.r(__webpack_exports__);
3647
3758
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3759
+ /* harmony export */ processFirstRegularValue: () => (/* binding */ processFirstRegularValue),
3648
3760
  /* harmony export */ processRegularValue: () => (/* binding */ processRegularValue)
3649
3761
  /* harmony export */ });
3650
3762
  /* harmony import */ var _updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../updateBeforeTemplate.function */ "./ts/updateBeforeTemplate.function.ts");
@@ -3658,10 +3770,25 @@ insertBefore) {
3658
3770
  return; // no need to update display, its the same
3659
3771
  }
3660
3772
  subject.lastValue = value;
3773
+ const castedValue = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.castTextValue)(value);
3774
+ // replace existing string?
3775
+ const oldClone = subject.clone;
3776
+ if (oldClone) {
3777
+ oldClone.textContent = castedValue;
3778
+ return;
3779
+ }
3661
3780
  // Processing of regular values
3662
- const clone = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.updateBeforeTemplate)(value, before);
3781
+ const clone = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.updateBeforeTemplate)(castedValue, before);
3663
3782
  subject.clone = clone; // remember single element put down, for future updates
3664
3783
  }
3784
+ function processFirstRegularValue(value, subject, // could be tag via subject.tag
3785
+ insertBefore) {
3786
+ subject.lastValue = value;
3787
+ const castedValue = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.castTextValue)(value);
3788
+ // Processing of regular values
3789
+ const clone = (0,_updateBeforeTemplate_function__WEBPACK_IMPORTED_MODULE_0__.updateBeforeTemplate)(castedValue, insertBefore);
3790
+ subject.clone = clone; // remember single element put down, for future updates
3791
+ }
3665
3792
 
3666
3793
 
3667
3794
  /***/ }),
@@ -3704,7 +3831,7 @@ function processSubjectComponent(templater, subject, insertBefore, ownerSupport,
3704
3831
  global.insertBefore = insertBefore;
3705
3832
  const providers = _state__WEBPACK_IMPORTED_MODULE_0__.setUse.memory.providerConfig;
3706
3833
  providers.ownerSupport = ownerSupport;
3707
- const isRender = !reSupport || options.forceElement;
3834
+ const isRender = !reSupport;
3708
3835
  if (isRender) {
3709
3836
  const support = reSupport || tagSupport;
3710
3837
  reSupport = (0,_render_renderSubjectComponent_function__WEBPACK_IMPORTED_MODULE_3__.renderSubjectComponent)(subject, support, ownerSupport);
@@ -3716,79 +3843,6 @@ function processSubjectComponent(templater, subject, insertBefore, ownerSupport,
3716
3843
  }
3717
3844
 
3718
3845
 
3719
- /***/ }),
3720
-
3721
- /***/ "./ts/tag/update/processSubjectValue.function.ts":
3722
- /*!*******************************************************!*\
3723
- !*** ./ts/tag/update/processSubjectValue.function.ts ***!
3724
- \*******************************************************/
3725
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3726
-
3727
- __webpack_require__.r(__webpack_exports__);
3728
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3729
- /* harmony export */ processSubjectValue: () => (/* binding */ processSubjectValue)
3730
- /* harmony export */ });
3731
- /* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/tag/update/processSubjectComponent.function.ts");
3732
- /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../isInstance */ "./ts/isInstance.ts");
3733
- /* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./processTagArray */ "./ts/tag/update/processTagArray.ts");
3734
- /* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/tag/update/processRegularValue.function.ts");
3735
- /* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processTag.function */ "./ts/tag/update/processTag.function.ts");
3736
-
3737
-
3738
-
3739
-
3740
-
3741
- var ValueTypes;
3742
- (function (ValueTypes) {
3743
- ValueTypes["tag"] = "tag";
3744
- ValueTypes["templater"] = "templater";
3745
- ValueTypes["tagArray"] = "tag-array";
3746
- ValueTypes["tagComponent"] = "tag-component";
3747
- ValueTypes["value"] = "value";
3748
- })(ValueTypes || (ValueTypes = {}));
3749
- function getValueType(value) {
3750
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagComponent)(value)) {
3751
- return ValueTypes.tagComponent;
3752
- }
3753
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagTemplater)(value)) {
3754
- return ValueTypes.templater;
3755
- }
3756
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagClass)(value)) {
3757
- return ValueTypes.tag;
3758
- }
3759
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_1__.isTagArray)(value)) {
3760
- return ValueTypes.tagArray;
3761
- }
3762
- return ValueTypes.value;
3763
- }
3764
- // export type ExistingValue = TemplaterResult | Tag[] | TagSupport | Function | Subject<unknown> | RegularValue | Tag
3765
- function processSubjectValue(value, subject, // could be tag via result.tag
3766
- insertBefore, // <template end interpolate /> (will be removed)
3767
- ownerSupport, // owner
3768
- options) {
3769
- const valueType = getValueType(value);
3770
- switch (valueType) {
3771
- case ValueTypes.templater:
3772
- (0,_processTag_function__WEBPACK_IMPORTED_MODULE_4__.processTag)(value, insertBefore, ownerSupport, subject);
3773
- return;
3774
- case ValueTypes.tag:
3775
- const tag = value;
3776
- let templater = tag.templater;
3777
- if (!templater) {
3778
- templater = (0,_processTag_function__WEBPACK_IMPORTED_MODULE_4__.tagFakeTemplater)(tag);
3779
- }
3780
- (0,_processTag_function__WEBPACK_IMPORTED_MODULE_4__.processTag)(templater, insertBefore, ownerSupport, subject);
3781
- return;
3782
- case ValueTypes.tagArray:
3783
- return (0,_processTagArray__WEBPACK_IMPORTED_MODULE_2__.processTagArray)(subject, value, insertBefore, ownerSupport, options);
3784
- case ValueTypes.tagComponent:
3785
- (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_0__.processSubjectComponent)(value, subject, insertBefore, ownerSupport, options);
3786
- return;
3787
- }
3788
- (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_3__.processRegularValue)(value, subject, insertBefore);
3789
- }
3790
-
3791
-
3792
3846
  /***/ }),
3793
3847
 
3794
3848
  /***/ "./ts/tag/update/processTag.function.ts":
@@ -3822,7 +3876,6 @@ subject) {
3822
3876
  tagSupport.ownerTagSupport = ownerSupport;
3823
3877
  tagSupport.buildBeforeElement(insertBefore, {
3824
3878
  counts: { added: 0, removed: 0 },
3825
- forceElement: true,
3826
3879
  });
3827
3880
  }
3828
3881
  function setupNewTemplater(tagSupport, ownerSupport, subject) {
@@ -3931,7 +3984,6 @@ ownerSupport, options) {
3931
3984
  const details = {
3932
3985
  template: tagSupport.getTemplate().string,
3933
3986
  array: value,
3934
- ownerTagContent: ownerSupport.lastTemplateString,
3935
3987
  };
3936
3988
  const message = 'Use html`...`.key(item) instead of html`...` to template an Array';
3937
3989
  console.error(message, details);
@@ -3976,7 +4028,7 @@ function processAddTagArrayItem(before, tagSupport, index, options, lastArray) {
3976
4028
  const newTempElm = document.createElement('template');
3977
4029
  fragment.appendChild(newTempElm);
3978
4030
  tagSupport.buildBeforeElement(newTempElm, // before,
3979
- { counts, forceElement: options.forceElement });
4031
+ { counts });
3980
4032
  const parent = before.parentNode;
3981
4033
  parent.insertBefore(fragment, before);
3982
4034
  }
@@ -4008,18 +4060,17 @@ __webpack_require__.r(__webpack_exports__);
4008
4060
  /* harmony export */ });
4009
4061
  function processTagResult(tagSupport, subject, // used for recording past and current value
4010
4062
  insertBefore, // <template end interpolate />
4011
- { counts, forceElement, }) {
4063
+ { counts, }) {
4012
4064
  // *if appears we already have seen
4013
4065
  const subjectTag = subject;
4014
4066
  const lastSupport = subjectTag.tagSupport;
4015
- const prevSupport = lastSupport?.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag
4016
- const justUpdate = prevSupport; // && !forceElement
4067
+ const prevSupport = lastSupport?.global.oldest || undefined;
4068
+ const justUpdate = prevSupport;
4017
4069
  if (prevSupport && justUpdate) {
4018
4070
  return processTagResultUpdate(tagSupport, subjectTag, prevSupport);
4019
4071
  }
4020
4072
  tagSupport.buildBeforeElement(insertBefore, {
4021
4073
  counts,
4022
- forceElement,
4023
4074
  });
4024
4075
  }
4025
4076
  function processTagResultUpdate(tagSupport, subject, // used for recording past and current value
@@ -4139,7 +4190,6 @@ subject, insertBefore) {
4139
4190
  const oldestSupport = lastSupport.global.oldest;
4140
4191
  (0,_destroyTag_function__WEBPACK_IMPORTED_MODULE_2__.destroyTagMemory)(oldestSupport);
4141
4192
  return (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_1__.processSubjectComponent)(templater, subject, insertBefore, ownerSupport, {
4142
- forceElement: false,
4143
4193
  counts: { added: 0, removed: 0 },
4144
4194
  });
4145
4195
  }
@@ -4188,7 +4238,6 @@ subject, insertBefore) {
4188
4238
  }
4189
4239
  function buildNewTag(newSupport, oldInsertBefore, oldTagSupport, subject) {
4190
4240
  newSupport.buildBeforeElement(oldInsertBefore, {
4191
- forceElement: true,
4192
4241
  counts: { added: 0, removed: 0 },
4193
4242
  });
4194
4243
  newSupport.global.oldest = newSupport;
@@ -4246,14 +4295,16 @@ __webpack_require__.r(__webpack_exports__);
4246
4295
  /* harmony import */ var _TagSupport_class__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../TagSupport.class */ "./ts/tag/TagSupport.class.ts");
4247
4296
  /* harmony import */ var _TemplaterResult_class__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../TemplaterResult.class */ "./ts/TemplaterResult.class.ts");
4248
4297
  /* harmony import */ var _isInstance__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../isInstance */ "./ts/isInstance.ts");
4249
- /* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processTagArray */ "./ts/tag/update/processTagArray.ts");
4250
- /* harmony import */ var _updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./updateExistingTagComponent.function */ "./ts/tag/update/updateExistingTagComponent.function.ts");
4251
- /* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/tag/update/processRegularValue.function.ts");
4252
- /* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../checkDestroyPrevious.function */ "./ts/tag/checkDestroyPrevious.function.ts");
4253
- /* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/tag/update/processSubjectComponent.function.ts");
4254
- /* harmony import */ var _isLikeTags_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../isLikeTags.function */ "./ts/tag/isLikeTags.function.ts");
4255
- /* harmony import */ var _interpolations_bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../interpolations/bindSubjectCallback.function */ "./ts/interpolations/bindSubjectCallback.function.ts");
4298
+ /* harmony import */ var _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./processFirstSubject.utils */ "./ts/tag/update/processFirstSubject.utils.ts");
4299
+ /* harmony import */ var _processTagArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processTagArray */ "./ts/tag/update/processTagArray.ts");
4300
+ /* harmony import */ var _updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updateExistingTagComponent.function */ "./ts/tag/update/updateExistingTagComponent.function.ts");
4301
+ /* harmony import */ var _processRegularValue_function__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./processRegularValue.function */ "./ts/tag/update/processRegularValue.function.ts");
4302
+ /* harmony import */ var _checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../checkDestroyPrevious.function */ "./ts/tag/checkDestroyPrevious.function.ts");
4303
+ /* harmony import */ var _processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./processSubjectComponent.function */ "./ts/tag/update/processSubjectComponent.function.ts");
4304
+ /* harmony import */ var _isLikeTags_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../isLikeTags.function */ "./ts/tag/isLikeTags.function.ts");
4256
4305
  /* harmony import */ var _processTag_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./processTag.function */ "./ts/tag/update/processTag.function.ts");
4306
+ /* harmony import */ var _setTagPlaceholder_function__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../setTagPlaceholder.function */ "./ts/tag/setTagPlaceholder.function.ts");
4307
+
4257
4308
 
4258
4309
 
4259
4310
 
@@ -4267,10 +4318,10 @@ __webpack_require__.r(__webpack_exports__);
4267
4318
 
4268
4319
  function updateExistingValue(subject, value, ownerSupport, insertBefore) {
4269
4320
  const subjectTag = subject;
4270
- const isComponent = (0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagComponent)(value);
4271
- (0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_6__.checkDestroyPrevious)(subject, value, insertBefore);
4321
+ const valueType = (0,_processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.getValueType)(value);
4322
+ (0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_7__.checkDestroyPrevious)(subject, value, insertBefore);
4272
4323
  // handle already seen tag components
4273
- if (isComponent) {
4324
+ if (valueType === _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.tagComponent) {
4274
4325
  return prepareUpdateToComponent(value, subjectTag, insertBefore, ownerSupport);
4275
4326
  }
4276
4327
  // was component but no longer
@@ -4279,42 +4330,40 @@ function updateExistingValue(subject, value, ownerSupport, insertBefore) {
4279
4330
  handleStillTag(subject, value, ownerSupport);
4280
4331
  return subjectTag;
4281
4332
  }
4282
- // its another tag array
4283
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagArray)(value)) {
4284
- (0,_processTagArray__WEBPACK_IMPORTED_MODULE_3__.processTagArray)(subject, value, insertBefore, // oldInsertBefore as InsertBefore,
4285
- ownerSupport, { counts: {
4286
- added: 0,
4287
- removed: 0,
4288
- } });
4289
- return subject;
4290
- }
4291
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagTemplater)(value)) {
4292
- (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.processTag)(value, insertBefore, ownerSupport, subjectTag);
4293
- return subjectTag;
4294
- }
4295
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagClass)(value)) {
4296
- const tag = value;
4297
- let templater = tag.templater;
4298
- if (!templater) {
4299
- templater = (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.getFakeTemplater)();
4300
- tag.templater = templater;
4301
- templater.tag = tag;
4302
- }
4303
- (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.processTag)(templater, insertBefore, ownerSupport, subjectTag);
4304
- return subjectTag;
4305
- }
4306
- // we have been given a subject
4307
- if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isSubjectInstance)(value)) {
4308
- return value;
4309
- }
4310
- // now its a function
4311
- if (value instanceof Function) {
4312
- const bound = (0,_interpolations_bindSubjectCallback_function__WEBPACK_IMPORTED_MODULE_9__.bindSubjectCallback)(value, ownerSupport);
4313
- subject.set(bound);
4314
- return subject;
4333
+ switch (valueType) {
4334
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.tagArray:
4335
+ (0,_processTagArray__WEBPACK_IMPORTED_MODULE_4__.processTagArray)(subject, value, insertBefore, // oldInsertBefore as InsertBefore,
4336
+ ownerSupport, { counts: {
4337
+ added: 0,
4338
+ removed: 0,
4339
+ } });
4340
+ return subject;
4341
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.templater:
4342
+ (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.processTag)(value, insertBefore, ownerSupport, subjectTag);
4343
+ return subjectTag;
4344
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.tag:
4345
+ const tag = value;
4346
+ let templater = tag.templater;
4347
+ if (!templater) {
4348
+ templater = (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.getFakeTemplater)();
4349
+ tag.templater = templater;
4350
+ templater.tag = tag;
4351
+ }
4352
+ (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.processTag)(templater, insertBefore, ownerSupport, subjectTag);
4353
+ return subjectTag;
4354
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.subject:
4355
+ return value;
4356
+ // now its a useless function (we don't automatically call functions)
4357
+ case _processFirstSubject_utils__WEBPACK_IMPORTED_MODULE_3__.ValueTypes.function:
4358
+ // const bound = bindSubjectCallback(value as Callback, ownerSupport)
4359
+ // subject.set(bound)
4360
+ if (!subject.clone) {
4361
+ subject.clone = (0,_setTagPlaceholder_function__WEBPACK_IMPORTED_MODULE_11__.swapInsertBefore)(insertBefore);
4362
+ }
4363
+ return subject;
4315
4364
  }
4316
4365
  // This will cause all other values to render
4317
- (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_5__.processRegularValue)(value, subject, insertBefore);
4366
+ (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_6__.processRegularValue)(value, subject, insertBefore);
4318
4367
  return subjectTag;
4319
4368
  }
4320
4369
  function handleStillTag(subject, value, ownerSupport) {
@@ -4334,7 +4383,7 @@ function handleStillTag(subject, value, ownerSupport) {
4334
4383
  if (isClass) {
4335
4384
  valueSupport.global = lastSupport.global;
4336
4385
  }
4337
- const isSameTag = value && (0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_8__.isLikeTags)(lastSupport, valueSupport);
4386
+ const isSameTag = value && (0,_isLikeTags_function__WEBPACK_IMPORTED_MODULE_9__.isLikeTags)(lastSupport, valueSupport);
4338
4387
  if ((0,_isInstance__WEBPACK_IMPORTED_MODULE_2__.isTagTemplater)(value)) {
4339
4388
  (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.setupNewTemplater)(valueSupport, ownerSupport, subject);
4340
4389
  }
@@ -4348,14 +4397,13 @@ function handleStillTag(subject, value, ownerSupport) {
4348
4397
  const insertBefore = global.insertBefore;
4349
4398
  return (0,_processTag_function__WEBPACK_IMPORTED_MODULE_10__.processTag)(templater, insertBefore, ownerSupport, subject);
4350
4399
  }
4351
- return (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_5__.processRegularValue)(value, subject, subject.insertBefore);
4400
+ return (0,_processRegularValue_function__WEBPACK_IMPORTED_MODULE_6__.processRegularValue)(value, subject, subject.insertBefore);
4352
4401
  }
4353
4402
  function prepareUpdateToComponent(templater, subjectTag, insertBefore, ownerSupport) {
4354
4403
  // When last value was not a component
4355
4404
  if (!subjectTag.tagSupport) {
4356
- (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_7__.processSubjectComponent)(templater, subjectTag, insertBefore, // oldInsertBefore as InsertBefore,
4405
+ (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_8__.processSubjectComponent)(templater, subjectTag, insertBefore, // oldInsertBefore as InsertBefore,
4357
4406
  ownerSupport, {
4358
- forceElement: true,
4359
4407
  counts: { added: 0, removed: 0 },
4360
4408
  });
4361
4409
  return subjectTag;
@@ -4365,28 +4413,19 @@ function prepareUpdateToComponent(templater, subjectTag, insertBefore, ownerSupp
4365
4413
  const prevSupport = subjectSup.global.newest;
4366
4414
  if (prevSupport) {
4367
4415
  const newestState = prevSupport.memory.state;
4368
- // tagSupport.memory.state = [...newestState]
4369
4416
  tagSupport.memory.state.length = 0;
4370
4417
  tagSupport.memory.state.push(...newestState);
4371
4418
  }
4372
4419
  else {
4373
- (0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_6__.restoreTagMarker)(subjectSup);
4374
- /*
4375
- const placeholder = subjectSup.global.placeholder
4376
- if(placeholder && !insertBefore.parentNode) {
4377
- insertAfter(insertBefore,placeholder)
4378
- delete subjectSup.global.placeholder
4379
- }
4380
- */
4381
- (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_7__.processSubjectComponent)(templater, subjectTag, insertBefore, ownerSupport, {
4382
- forceElement: true,
4420
+ (0,_checkDestroyPrevious_function__WEBPACK_IMPORTED_MODULE_7__.restoreTagMarker)(subjectSup);
4421
+ (0,_processSubjectComponent_function__WEBPACK_IMPORTED_MODULE_8__.processSubjectComponent)(templater, subjectTag, insertBefore, ownerSupport, {
4383
4422
  counts: { added: 0, removed: 0 },
4384
4423
  });
4385
4424
  return subjectTag;
4386
4425
  }
4387
4426
  tagSupport.global = subjectSup.global;
4388
4427
  subjectTag.tagSupport = tagSupport;
4389
- (0,_updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_4__.updateExistingTagComponent)(ownerSupport, tagSupport, // latest value
4428
+ (0,_updateExistingTagComponent_function__WEBPACK_IMPORTED_MODULE_5__.updateExistingTagComponent)(ownerSupport, tagSupport, // latest value
4390
4429
  subjectTag, insertBefore);
4391
4430
  return subjectTag;
4392
4431
  }
@@ -4402,23 +4441,27 @@ function prepareUpdateToComponent(templater, subjectTag, insertBefore, ownerSupp
4402
4441
 
4403
4442
  __webpack_require__.r(__webpack_exports__);
4404
4443
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4444
+ /* harmony export */ castTextValue: () => (/* binding */ castTextValue),
4405
4445
  /* harmony export */ updateBeforeTemplate: () => (/* binding */ updateBeforeTemplate)
4406
4446
  /* harmony export */ });
4407
4447
  // Function to update the value of x
4408
- function updateBeforeTemplate(value, lastFirstChild) {
4448
+ function updateBeforeTemplate(value, // value should be casted before calling here
4449
+ lastFirstChild) {
4409
4450
  const parent = lastFirstChild.parentNode;
4410
- let castedValue = value;
4411
- // mimic React skipping to display EXCEPT for true does display on page
4412
- if ([undefined, false, null].includes(value)) { // || value === true
4413
- castedValue = '';
4414
- }
4415
4451
  // Insert the new value (never use innerHTML here)
4416
- const textNode = document.createTextNode(castedValue); // never innerHTML
4452
+ const textNode = document.createTextNode(value); // never innerHTML
4417
4453
  parent.insertBefore(textNode, lastFirstChild);
4418
4454
  /* remove existing nodes */
4419
4455
  parent.removeChild(lastFirstChild);
4420
4456
  return textNode;
4421
4457
  }
4458
+ function castTextValue(value) {
4459
+ // mimic React skipping to display EXCEPT for true does display on page
4460
+ if ([undefined, false, null].includes(value)) { // || value === true
4461
+ return '';
4462
+ }
4463
+ return value;
4464
+ }
4422
4465
 
4423
4466
 
4424
4467
  /***/ })