@paperless/core 0.1.0-alpha.281 → 0.1.0-alpha.282

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 (399) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/build/p-07f28695.entry.js +1 -0
  3. package/dist/build/p-105940d9.entry.js +1 -0
  4. package/dist/build/p-12f5c483.entry.js +1 -0
  5. package/dist/build/{p-ad147b1b.entry.js → p-1ba7cadc.entry.js} +1 -1
  6. package/dist/build/{p-7b9cfce0.entry.js → p-1c0ec278.entry.js} +1 -1
  7. package/dist/build/{p-858f7490.entry.js → p-29388966.entry.js} +1 -1
  8. package/dist/build/p-2e47afc7.entry.js +1 -0
  9. package/dist/build/p-35c1d905.entry.js +1 -0
  10. package/dist/build/{p-c11282d2.entry.js → p-3946e0a3.entry.js} +1 -1
  11. package/dist/build/p-39e63e42.entry.js +1 -0
  12. package/dist/{paperless/p-7e40c097.entry.js → build/p-48fd3cac.entry.js} +1 -1
  13. package/dist/build/p-529ccaf7.entry.js +1 -0
  14. package/dist/{paperless/p-c6201d0d.entry.js → build/p-530ddb38.entry.js} +1 -1
  15. package/dist/build/p-56c90fca.entry.js +1 -0
  16. package/dist/build/p-5e574eab.entry.js +1 -0
  17. package/dist/build/p-62d49606.entry.js +1 -0
  18. package/dist/build/p-63de1c3d.entry.js +1 -0
  19. package/dist/build/p-644e6762.entry.js +1 -0
  20. package/dist/build/p-6cc16633.entry.js +1 -0
  21. package/dist/build/p-700b5ce6.entry.js +1 -0
  22. package/dist/build/{p-600a2f21.entry.js → p-7df6230f.entry.js} +1 -1
  23. package/dist/build/p-8f4ba2d4.entry.js +1 -0
  24. package/dist/build/p-91d032b2.entry.js +1 -0
  25. package/dist/build/{p-4588a510.entry.js → p-9315c1e2.entry.js} +1 -1
  26. package/dist/build/p-98e3dcd7.entry.js +1 -0
  27. package/dist/build/p-9f273f07.entry.js +1 -0
  28. package/dist/build/{p-52ab1f62.entry.js → p-ac5a17c4.entry.js} +1 -1
  29. package/dist/build/p-b3363052.entry.js +1 -0
  30. package/dist/build/p-b4af4b21.entry.js +1 -0
  31. package/dist/build/p-b8dd503c.entry.js +1 -0
  32. package/dist/build/p-c2da342f.entry.js +1 -0
  33. package/dist/build/p-c9f2fa8f.js +2 -0
  34. package/dist/{paperless/p-93476bf3.entry.js → build/p-d2cf5ab2.entry.js} +1 -1
  35. package/dist/build/p-d3eb4901.entry.js +1 -0
  36. package/dist/build/p-dbb409ab.entry.js +1 -0
  37. package/dist/build/{p-44d46765.entry.js → p-f499f696.entry.js} +1 -1
  38. package/dist/build/p-f86fcdf4.js +1 -0
  39. package/dist/build/p-fa3216a5.entry.js +1 -0
  40. package/dist/build/paperless.css +1 -392
  41. package/dist/build/paperless.esm.js +1 -1
  42. package/dist/cjs/{index-cf92051a.js → index-195002a8.js} +454 -269
  43. package/dist/cjs/loader.cjs.js +3 -3
  44. package/dist/cjs/p-accordion.cjs.entry.js +2 -10
  45. package/dist/cjs/p-avatar-group.cjs.entry.js +3 -2
  46. package/dist/cjs/p-avatar.cjs.entry.js +5 -8
  47. package/dist/cjs/p-backdrop.cjs.entry.js +4 -9
  48. package/dist/cjs/p-button_3.cjs.entry.js +14 -51
  49. package/dist/cjs/p-card-body.cjs.entry.js +1 -4
  50. package/dist/cjs/p-card-container.cjs.entry.js +2 -8
  51. package/dist/cjs/p-card-header.cjs.entry.js +2 -4
  52. package/dist/cjs/p-content-slider.cjs.entry.js +5 -16
  53. package/dist/cjs/p-counter.cjs.entry.js +2 -8
  54. package/dist/cjs/p-divider.cjs.entry.js +2 -2
  55. package/dist/cjs/p-drawer-body_3.cjs.entry.js +6 -11
  56. package/dist/cjs/p-drawer.cjs.entry.js +18 -18
  57. package/dist/cjs/p-dropdown_3.cjs.entry.js +8 -36
  58. package/dist/cjs/p-helper_2.cjs.entry.js +5 -26
  59. package/dist/cjs/p-illustration_6.cjs.entry.js +31 -82
  60. package/dist/cjs/p-info-panel.cjs.entry.js +3 -7
  61. package/dist/cjs/p-input-group_4.cjs.entry.js +20 -32
  62. package/dist/cjs/p-layout.cjs.entry.js +2 -5
  63. package/dist/cjs/p-modal-body_4.cjs.entry.js +7 -15
  64. package/dist/cjs/p-modal.cjs.entry.js +19 -28
  65. package/dist/cjs/p-navbar.cjs.entry.js +2 -8
  66. package/dist/cjs/p-navigation-item.cjs.entry.js +6 -5
  67. package/dist/cjs/p-page-size-select_3.cjs.entry.js +7 -42
  68. package/dist/cjs/p-profile.cjs.entry.js +2 -8
  69. package/dist/cjs/p-select.cjs.entry.js +12 -29
  70. package/dist/cjs/p-slider-indicator.cjs.entry.js +1 -4
  71. package/dist/cjs/p-status.cjs.entry.js +4 -4
  72. package/dist/cjs/p-stepper-item_2.cjs.entry.js +3 -21
  73. package/dist/cjs/p-stepper.cjs.entry.js +1 -7
  74. package/dist/cjs/p-tab-group.cjs.entry.js +1 -1
  75. package/dist/cjs/p-tab-item.cjs.entry.js +1 -4
  76. package/dist/cjs/p-table-column.cjs.entry.js +3 -13
  77. package/dist/cjs/p-table.cjs.entry.js +12 -57
  78. package/dist/cjs/p-toast-container.cjs.entry.js +2 -5
  79. package/dist/cjs/p-toast.cjs.entry.js +6 -11
  80. package/dist/cjs/paperless.cjs.js +3 -3
  81. package/dist/cjs/{popper-e0c4ed4c.js → popper-d7a0f999.js} +60 -49
  82. package/dist/collection/collection-manifest.json +2 -2
  83. package/dist/collection/components/atoms/avatar/avatar.component.css +1 -27
  84. package/dist/collection/components/atoms/avatar/avatar.component.js +97 -91
  85. package/dist/collection/components/atoms/avatar-group/avatar-group.component.css +1 -18
  86. package/dist/collection/components/atoms/avatar-group/avatar-group.component.js +36 -31
  87. package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -16
  88. package/dist/collection/components/atoms/backdrop/backdrop.component.js +98 -76
  89. package/dist/collection/components/atoms/button/button.component.css +1 -131
  90. package/dist/collection/components/atoms/button/button.component.js +300 -319
  91. package/dist/collection/components/atoms/card-body/card-body.component.css +1 -9
  92. package/dist/collection/components/atoms/card-body/card-body.component.js +34 -32
  93. package/dist/collection/components/atoms/card-container/card-container.component.css +1 -17
  94. package/dist/collection/components/atoms/card-container/card-container.component.js +51 -52
  95. package/dist/collection/components/atoms/card-header/card-header.component.css +1 -17
  96. package/dist/collection/components/atoms/card-header/card-header.component.js +51 -51
  97. package/dist/collection/components/atoms/counter/counter.component.css +1 -30
  98. package/dist/collection/components/atoms/counter/counter.component.js +51 -52
  99. package/dist/collection/components/atoms/divider/divider.component.css +1 -10
  100. package/dist/collection/components/atoms/divider/divider.component.js +12 -11
  101. package/dist/collection/components/atoms/drawer-body/drawer-body.component.css +1 -5
  102. package/dist/collection/components/atoms/drawer-body/drawer-body.component.js +34 -32
  103. package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -7
  104. package/dist/collection/components/atoms/drawer-container/drawer-container.component.js +37 -9
  105. package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -10
  106. package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +54 -51
  107. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -8
  108. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +34 -32
  109. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -16
  110. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +72 -74
  111. package/dist/collection/components/atoms/helper/helper.component.css +1 -7
  112. package/dist/collection/components/atoms/helper/helper.component.js +38 -39
  113. package/dist/collection/components/atoms/icon/icon.component.css +1 -1
  114. package/dist/collection/components/atoms/icon/icon.component.js +98 -100
  115. package/dist/collection/components/atoms/illustration/illustration.component.js +28 -23
  116. package/dist/collection/components/atoms/info-panel/info-panel.component.css +1 -28
  117. package/dist/collection/components/atoms/info-panel/info-panel.component.js +85 -89
  118. package/dist/collection/components/atoms/label/label.component.css +1 -101
  119. package/dist/collection/components/atoms/label/label.component.js +149 -156
  120. package/dist/collection/components/atoms/layout/layout.component.css +1 -73
  121. package/dist/collection/components/atoms/layout/layout.component.js +34 -38
  122. package/dist/collection/components/atoms/loader/loader.component.css +1 -52
  123. package/dist/collection/components/atoms/loader/loader.component.js +108 -113
  124. package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -7
  125. package/dist/collection/components/atoms/modal-body/modal-body.component.js +34 -32
  126. package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -6
  127. package/dist/collection/components/atoms/modal-container/modal-container.component.js +52 -31
  128. package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -4
  129. package/dist/collection/components/atoms/modal-footer/modal-footer.component.js +12 -10
  130. package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -7
  131. package/dist/collection/components/atoms/modal-header/modal-header.component.js +54 -52
  132. package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -16
  133. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +34 -32
  134. package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -6
  135. package/dist/collection/components/atoms/segment-container/segment-container.component.js +12 -9
  136. package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -17
  137. package/dist/collection/components/atoms/segment-item/segment-item.component.js +96 -90
  138. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -7
  139. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js +33 -30
  140. package/dist/collection/components/atoms/status/status.component.css +1 -16
  141. package/dist/collection/components/atoms/status/status.component.js +97 -93
  142. package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -59
  143. package/dist/collection/components/atoms/stepper-item/stepper-item.component.js +85 -94
  144. package/dist/collection/components/atoms/stepper-line/stepper-line.component.css +1 -18
  145. package/dist/collection/components/atoms/stepper-line/stepper-line.component.js +50 -50
  146. package/dist/collection/components/atoms/tab-group/tab-group.component.css +1 -9
  147. package/dist/collection/components/atoms/tab-group/tab-group.component.js +12 -11
  148. package/dist/collection/components/atoms/tab-item/tab-item.component.css +1 -10
  149. package/dist/collection/components/atoms/tab-item/tab-item.component.js +34 -32
  150. package/dist/collection/components/atoms/table-container/table-container.component.css +1 -5
  151. package/dist/collection/components/atoms/table-container/table-container.component.js +12 -9
  152. package/dist/collection/components/atoms/toast-container/toast-container.component.css +1 -27
  153. package/dist/collection/components/atoms/toast-container/toast-container.component.js +34 -32
  154. package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -43
  155. package/dist/collection/components/atoms/tooltip/tooltip.component.js +184 -197
  156. package/dist/collection/components/helpers/table-column/table-column.component.js +128 -135
  157. package/dist/collection/components/molecules/accordion/accordion.component.css +1 -3
  158. package/dist/collection/components/molecules/accordion/accordion.component.js +102 -108
  159. package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -44
  160. package/dist/collection/components/molecules/content-slider/content-slider.component.js +119 -125
  161. package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -12
  162. package/dist/collection/components/molecules/dropdown/dropdown.component.js +194 -206
  163. package/dist/collection/components/molecules/input-group/input-group.component.css +1 -324
  164. package/dist/collection/components/molecules/input-group/input-group.component.js +276 -281
  165. package/dist/collection/components/molecules/navigation-item/navigation-item.component.css +1 -22
  166. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +106 -104
  167. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +161 -180
  168. package/dist/collection/components/molecules/pagination/pagination.component.css +1 -3
  169. package/dist/collection/components/molecules/pagination/pagination.component.js +116 -114
  170. package/dist/collection/components/molecules/profile/profile.component.css +1 -60
  171. package/dist/collection/components/molecules/profile/profile.component.js +57 -63
  172. package/dist/collection/components/molecules/select/select.component.css +1 -6
  173. package/dist/collection/components/molecules/select/select.component.js +418 -426
  174. package/dist/collection/components/molecules/stepper/stepper.component.css +1 -12
  175. package/dist/collection/components/molecules/stepper/stepper.component.js +50 -50
  176. package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -3
  177. package/dist/collection/components/molecules/table-cell/table-cell.component.js +160 -156
  178. package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -30
  179. package/dist/collection/components/molecules/table-footer/table-footer.component.js +219 -233
  180. package/dist/collection/components/molecules/table-header/table-header.component.css +1 -16
  181. package/dist/collection/components/molecules/table-header/table-header.component.js +296 -321
  182. package/dist/collection/components/molecules/table-row/table-row.component.css +1 -21
  183. package/dist/collection/components/molecules/table-row/table-row.component.js +51 -54
  184. package/dist/collection/components/molecules/toast/toast.component.css +1 -23
  185. package/dist/collection/components/molecules/toast/toast.component.js +168 -169
  186. package/dist/collection/components/organisms/drawer/drawer.component.js +147 -128
  187. package/dist/collection/components/organisms/modal/modal.component.js +206 -197
  188. package/dist/collection/components/organisms/navbar/navbar.component.css +1 -53
  189. package/dist/collection/components/organisms/navbar/navbar.component.js +71 -81
  190. package/dist/collection/components/organisms/table/table.component.css +1 -3
  191. package/dist/collection/components/organisms/table/table.component.js +828 -869
  192. package/dist/collection/tailwind/animation.js +64 -4
  193. package/dist/components/backdrop.component.js +5 -9
  194. package/dist/components/button.component.js +6 -28
  195. package/dist/components/counter.component.js +1 -7
  196. package/dist/components/divider.component.js +1 -1
  197. package/dist/components/drawer-body.component.js +1 -4
  198. package/dist/components/drawer-container.component.js +6 -3
  199. package/dist/components/drawer-header.component.js +1 -4
  200. package/dist/components/dropdown-menu-container.component.js +1 -4
  201. package/dist/components/dropdown-menu-item.component.js +2 -7
  202. package/dist/components/dropdown.component.js +3 -23
  203. package/dist/components/helper.component.js +1 -4
  204. package/dist/components/icon.component.js +2 -10
  205. package/dist/components/illustration.component.js +1 -0
  206. package/dist/components/input-group.component.js +10 -13
  207. package/dist/components/label.component.js +4 -13
  208. package/dist/components/loader.component.js +5 -12
  209. package/dist/components/modal-body.component.js +1 -4
  210. package/dist/components/modal-container.component.js +5 -6
  211. package/dist/components/modal-footer.component.js +1 -1
  212. package/dist/components/modal-header.component.js +1 -4
  213. package/dist/components/p-accordion.js +1 -9
  214. package/dist/components/p-avatar-group.js +2 -1
  215. package/dist/components/p-avatar.js +4 -7
  216. package/dist/components/p-card-body.js +0 -3
  217. package/dist/components/p-card-container.js +1 -7
  218. package/dist/components/p-card-header.js +1 -3
  219. package/dist/components/p-content-slider.js +4 -15
  220. package/dist/components/p-drawer.js +19 -18
  221. package/dist/components/p-info-panel.js +2 -6
  222. package/dist/components/p-layout.js +1 -4
  223. package/dist/components/p-modal.js +20 -28
  224. package/dist/components/p-navbar.js +1 -7
  225. package/dist/components/p-navigation-item.js +5 -4
  226. package/dist/components/p-profile.js +1 -7
  227. package/dist/components/p-select.js +11 -28
  228. package/dist/components/p-status.js +3 -3
  229. package/dist/components/p-stepper.js +0 -6
  230. package/dist/components/p-tab-item.js +0 -3
  231. package/dist/components/p-table-column.js +2 -12
  232. package/dist/components/p-table.js +11 -56
  233. package/dist/components/p-toast-container.js +1 -4
  234. package/dist/components/p-toast.js +5 -10
  235. package/dist/components/page-size-select.component.js +0 -24
  236. package/dist/components/pagination-item.component.js +1 -4
  237. package/dist/components/pagination.component.js +5 -13
  238. package/dist/components/popper.js +60 -49
  239. package/dist/components/segment-container.component.js +1 -1
  240. package/dist/components/segment-item.component.js +4 -4
  241. package/dist/components/slider-indicator.component.js +0 -3
  242. package/dist/components/stepper-item.component.js +1 -13
  243. package/dist/components/stepper-line.component.js +1 -7
  244. package/dist/components/table-cell.component.js +7 -7
  245. package/dist/components/table-container.component.js +1 -1
  246. package/dist/components/table-footer.component.js +2 -25
  247. package/dist/components/table-header.component.js +11 -33
  248. package/dist/components/table-row.component.js +1 -7
  249. package/dist/components/tooltip.component.js +2 -20
  250. package/dist/esm/{index-7c99f044.js → index-8170b4fb.js} +454 -269
  251. package/dist/esm/loader.js +3 -3
  252. package/dist/esm/p-accordion.entry.js +2 -10
  253. package/dist/esm/p-avatar-group.entry.js +3 -2
  254. package/dist/esm/p-avatar.entry.js +5 -8
  255. package/dist/esm/p-backdrop.entry.js +4 -9
  256. package/dist/esm/p-button_3.entry.js +14 -51
  257. package/dist/esm/p-card-body.entry.js +1 -4
  258. package/dist/esm/p-card-container.entry.js +2 -8
  259. package/dist/esm/p-card-header.entry.js +2 -4
  260. package/dist/esm/p-content-slider.entry.js +5 -16
  261. package/dist/esm/p-counter.entry.js +2 -8
  262. package/dist/esm/p-divider.entry.js +2 -2
  263. package/dist/esm/p-drawer-body_3.entry.js +6 -11
  264. package/dist/esm/p-drawer.entry.js +18 -18
  265. package/dist/esm/p-dropdown_3.entry.js +8 -36
  266. package/dist/esm/p-helper_2.entry.js +5 -26
  267. package/dist/esm/p-illustration_6.entry.js +31 -82
  268. package/dist/esm/p-info-panel.entry.js +3 -7
  269. package/dist/esm/p-input-group_4.entry.js +20 -32
  270. package/dist/esm/p-layout.entry.js +2 -5
  271. package/dist/esm/p-modal-body_4.entry.js +7 -15
  272. package/dist/esm/p-modal.entry.js +19 -28
  273. package/dist/esm/p-navbar.entry.js +2 -8
  274. package/dist/esm/p-navigation-item.entry.js +6 -5
  275. package/dist/esm/p-page-size-select_3.entry.js +7 -42
  276. package/dist/esm/p-profile.entry.js +2 -8
  277. package/dist/esm/p-select.entry.js +12 -29
  278. package/dist/esm/p-slider-indicator.entry.js +1 -4
  279. package/dist/esm/p-status.entry.js +4 -4
  280. package/dist/esm/p-stepper-item_2.entry.js +3 -21
  281. package/dist/esm/p-stepper.entry.js +1 -7
  282. package/dist/esm/p-tab-group.entry.js +1 -1
  283. package/dist/esm/p-tab-item.entry.js +1 -4
  284. package/dist/esm/p-table-column.entry.js +3 -13
  285. package/dist/esm/p-table.entry.js +12 -57
  286. package/dist/esm/p-toast-container.entry.js +2 -5
  287. package/dist/esm/p-toast.entry.js +6 -11
  288. package/dist/esm/paperless.js +3 -3
  289. package/dist/esm/polyfills/css-shim.js +1 -1
  290. package/dist/esm/{popper-41c6f9cd.js → popper-42db9fbd.js} +60 -49
  291. package/dist/index.html +1 -1
  292. package/dist/paperless/p-07f28695.entry.js +1 -0
  293. package/dist/paperless/p-105940d9.entry.js +1 -0
  294. package/dist/paperless/p-12f5c483.entry.js +1 -0
  295. package/dist/paperless/{p-ad147b1b.entry.js → p-1ba7cadc.entry.js} +1 -1
  296. package/dist/paperless/{p-7b9cfce0.entry.js → p-1c0ec278.entry.js} +1 -1
  297. package/dist/paperless/{p-858f7490.entry.js → p-29388966.entry.js} +1 -1
  298. package/dist/paperless/p-2e47afc7.entry.js +1 -0
  299. package/dist/paperless/p-35c1d905.entry.js +1 -0
  300. package/dist/paperless/{p-c11282d2.entry.js → p-3946e0a3.entry.js} +1 -1
  301. package/dist/paperless/p-39e63e42.entry.js +1 -0
  302. package/dist/{build/p-7e40c097.entry.js → paperless/p-48fd3cac.entry.js} +1 -1
  303. package/dist/paperless/p-529ccaf7.entry.js +1 -0
  304. package/dist/{build/p-c6201d0d.entry.js → paperless/p-530ddb38.entry.js} +1 -1
  305. package/dist/paperless/p-56c90fca.entry.js +1 -0
  306. package/dist/paperless/p-5e574eab.entry.js +1 -0
  307. package/dist/paperless/p-62d49606.entry.js +1 -0
  308. package/dist/paperless/p-63de1c3d.entry.js +1 -0
  309. package/dist/paperless/p-644e6762.entry.js +1 -0
  310. package/dist/paperless/p-6cc16633.entry.js +1 -0
  311. package/dist/paperless/p-700b5ce6.entry.js +1 -0
  312. package/dist/paperless/{p-600a2f21.entry.js → p-7df6230f.entry.js} +1 -1
  313. package/dist/paperless/p-8f4ba2d4.entry.js +1 -0
  314. package/dist/paperless/p-91d032b2.entry.js +1 -0
  315. package/dist/paperless/{p-4588a510.entry.js → p-9315c1e2.entry.js} +1 -1
  316. package/dist/paperless/p-98e3dcd7.entry.js +1 -0
  317. package/dist/paperless/p-9f273f07.entry.js +1 -0
  318. package/dist/paperless/{p-52ab1f62.entry.js → p-ac5a17c4.entry.js} +1 -1
  319. package/dist/paperless/p-b3363052.entry.js +1 -0
  320. package/dist/paperless/p-b4af4b21.entry.js +1 -0
  321. package/dist/paperless/p-b8dd503c.entry.js +1 -0
  322. package/dist/paperless/p-c2da342f.entry.js +1 -0
  323. package/dist/paperless/p-c9f2fa8f.js +2 -0
  324. package/dist/{build/p-93476bf3.entry.js → paperless/p-d2cf5ab2.entry.js} +1 -1
  325. package/dist/paperless/p-d3eb4901.entry.js +1 -0
  326. package/dist/paperless/p-dbb409ab.entry.js +1 -0
  327. package/dist/paperless/{p-44d46765.entry.js → p-f499f696.entry.js} +1 -1
  328. package/dist/paperless/p-f86fcdf4.js +1 -0
  329. package/dist/paperless/p-fa3216a5.entry.js +1 -0
  330. package/dist/paperless/paperless.css +678 -886
  331. package/dist/paperless/paperless.esm.js +1 -1
  332. package/dist/sw.js +1 -1
  333. package/dist/sw.js.map +1 -1
  334. package/dist/tailwind/animation.js +64 -4
  335. package/dist/types/components/atoms/backdrop/backdrop.component.d.ts +4 -0
  336. package/dist/types/components/atoms/drawer-container/drawer-container.component.d.ts +4 -0
  337. package/dist/types/components/atoms/modal-container/modal-container.component.d.ts +4 -0
  338. package/dist/types/components/organisms/drawer/drawer.component.d.ts +7 -1
  339. package/dist/types/components/organisms/modal/modal.component.d.ts +7 -1
  340. package/dist/types/components.d.ts +34 -2
  341. package/dist/types/stencil-public-runtime.d.ts +20 -4
  342. package/dist/{workbox-5fe694da.js → workbox-5b279812.js} +2 -2
  343. package/dist/{workbox-5fe694da.js.map → workbox-5b279812.js.map} +1 -1
  344. package/loader/package.json +1 -0
  345. package/package.json +2 -2
  346. package/dist/build/p-055b40ad.entry.js +0 -1
  347. package/dist/build/p-06899ffb.entry.js +0 -1
  348. package/dist/build/p-0818aeaa.entry.js +0 -1
  349. package/dist/build/p-08cd459b.entry.js +0 -1
  350. package/dist/build/p-13bb4d79.entry.js +0 -1
  351. package/dist/build/p-150aadaf.entry.js +0 -1
  352. package/dist/build/p-15d13147.entry.js +0 -1
  353. package/dist/build/p-197075c9.entry.js +0 -1
  354. package/dist/build/p-2a005223.entry.js +0 -1
  355. package/dist/build/p-3180c96e.entry.js +0 -1
  356. package/dist/build/p-337ad423.entry.js +0 -1
  357. package/dist/build/p-41588819.entry.js +0 -1
  358. package/dist/build/p-58dd41be.entry.js +0 -1
  359. package/dist/build/p-5a71d6ae.entry.js +0 -1
  360. package/dist/build/p-7e9a866e.entry.js +0 -1
  361. package/dist/build/p-8614bd10.entry.js +0 -1
  362. package/dist/build/p-86a6c56a.entry.js +0 -1
  363. package/dist/build/p-8f179b0d.entry.js +0 -1
  364. package/dist/build/p-a7086ffa.js +0 -1
  365. package/dist/build/p-b99f2f60.entry.js +0 -1
  366. package/dist/build/p-be2a7816.entry.js +0 -1
  367. package/dist/build/p-c4110c09.entry.js +0 -1
  368. package/dist/build/p-c7bebafd.entry.js +0 -1
  369. package/dist/build/p-d17b038f.entry.js +0 -1
  370. package/dist/build/p-d9c1fe13.js +0 -2
  371. package/dist/build/p-db69c965.entry.js +0 -1
  372. package/dist/build/p-ed78ef52.entry.js +0 -1
  373. package/dist/paperless/p-055b40ad.entry.js +0 -1
  374. package/dist/paperless/p-06899ffb.entry.js +0 -1
  375. package/dist/paperless/p-0818aeaa.entry.js +0 -1
  376. package/dist/paperless/p-08cd459b.entry.js +0 -1
  377. package/dist/paperless/p-13bb4d79.entry.js +0 -1
  378. package/dist/paperless/p-150aadaf.entry.js +0 -1
  379. package/dist/paperless/p-15d13147.entry.js +0 -1
  380. package/dist/paperless/p-197075c9.entry.js +0 -1
  381. package/dist/paperless/p-2a005223.entry.js +0 -1
  382. package/dist/paperless/p-3180c96e.entry.js +0 -1
  383. package/dist/paperless/p-337ad423.entry.js +0 -1
  384. package/dist/paperless/p-41588819.entry.js +0 -1
  385. package/dist/paperless/p-58dd41be.entry.js +0 -1
  386. package/dist/paperless/p-5a71d6ae.entry.js +0 -1
  387. package/dist/paperless/p-7e9a866e.entry.js +0 -1
  388. package/dist/paperless/p-8614bd10.entry.js +0 -1
  389. package/dist/paperless/p-86a6c56a.entry.js +0 -1
  390. package/dist/paperless/p-8f179b0d.entry.js +0 -1
  391. package/dist/paperless/p-a7086ffa.js +0 -1
  392. package/dist/paperless/p-b99f2f60.entry.js +0 -1
  393. package/dist/paperless/p-be2a7816.entry.js +0 -1
  394. package/dist/paperless/p-c4110c09.entry.js +0 -1
  395. package/dist/paperless/p-c7bebafd.entry.js +0 -1
  396. package/dist/paperless/p-d17b038f.entry.js +0 -1
  397. package/dist/paperless/p-d9c1fe13.js +0 -2
  398. package/dist/paperless/p-db69c965.entry.js +0 -1
  399. package/dist/paperless/p-ed78ef52.entry.js +0 -1
@@ -1,5 +1,13 @@
1
1
  const NAMESPACE = 'paperless';
2
2
 
3
+ /**
4
+ * Virtual DOM patching algorithm based on Snabbdom by
5
+ * Simon Friis Vindum (@paldepind)
6
+ * Licensed under the MIT License
7
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
+ *
9
+ * Modified for Stencil's renderer and slot projection
10
+ */
3
11
  let scopeId;
4
12
  let contentRef;
5
13
  let hostTagName;
@@ -8,66 +16,6 @@ let checkSlotFallbackVisibility = false;
8
16
  let checkSlotRelocate = false;
9
17
  let isSvgMode = false;
10
18
  let queuePending = false;
11
- const win = typeof window !== 'undefined' ? window : {};
12
- const doc = win.document || { head: {} };
13
- const plt = {
14
- $flags$: 0,
15
- $resourcesUrl$: '',
16
- jmp: (h) => h(),
17
- raf: (h) => requestAnimationFrame(h),
18
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
19
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
20
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
21
- };
22
- const promiseResolve = (v) => Promise.resolve(v);
23
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
24
- try {
25
- new CSSStyleSheet();
26
- return typeof new CSSStyleSheet().replaceSync === 'function';
27
- }
28
- catch (e) { }
29
- return false;
30
- })()
31
- ;
32
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
33
- if (listeners) {
34
- listeners.map(([flags, name, method]) => {
35
- const target = getHostListenerTarget(elm, flags) ;
36
- const handler = hostListenerProxy(hostRef, method);
37
- const opts = hostListenerOpts(flags);
38
- plt.ael(target, name, handler, opts);
39
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
40
- });
41
- }
42
- };
43
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
44
- try {
45
- {
46
- if (hostRef.$flags$ & 256 /* isListenReady */) {
47
- // instance is ready, let's call it's member method for this event
48
- hostRef.$lazyInstance$[methodName](ev);
49
- }
50
- else {
51
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
52
- }
53
- }
54
- }
55
- catch (e) {
56
- consoleError(e);
57
- }
58
- };
59
- const getHostListenerTarget = (elm, flags) => {
60
- if (flags & 4 /* TargetDocument */)
61
- return doc;
62
- if (flags & 8 /* TargetWindow */)
63
- return win;
64
- if (flags & 16 /* TargetBody */)
65
- return doc.body;
66
- return elm;
67
- };
68
- // prettier-ignore
69
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
70
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
71
19
  const createTime = (fnName, tagName = '') => {
72
20
  {
73
21
  return () => {
@@ -82,76 +30,7 @@ const uniqueTime = (key, measureText) => {
82
30
  };
83
31
  }
84
32
  };
85
- const rootAppliedStyles = new WeakMap();
86
- const registerStyle = (scopeId, cssText, allowCS) => {
87
- let style = styles.get(scopeId);
88
- if (supportsConstructableStylesheets && allowCS) {
89
- style = (style || new CSSStyleSheet());
90
- if (typeof style === 'string') {
91
- style = cssText;
92
- }
93
- else {
94
- style.replaceSync(cssText);
95
- }
96
- }
97
- else {
98
- style = cssText;
99
- }
100
- styles.set(scopeId, style);
101
- };
102
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
103
- let scopeId = getScopeId(cmpMeta);
104
- const style = styles.get(scopeId);
105
- // if an element is NOT connected then getRootNode() will return the wrong root node
106
- // so the fallback is to always use the document for the root node in those cases
107
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
108
- if (style) {
109
- if (typeof style === 'string') {
110
- styleContainerNode = styleContainerNode.head || styleContainerNode;
111
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
112
- let styleElm;
113
- if (!appliedStyles) {
114
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
115
- }
116
- if (!appliedStyles.has(scopeId)) {
117
- {
118
- {
119
- styleElm = doc.createElement('style');
120
- styleElm.innerHTML = style;
121
- }
122
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
123
- }
124
- if (appliedStyles) {
125
- appliedStyles.add(scopeId);
126
- }
127
- }
128
- }
129
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
130
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
131
- }
132
- }
133
- return scopeId;
134
- };
135
- const attachStyles = (hostRef) => {
136
- const cmpMeta = hostRef.$cmpMeta$;
137
- const elm = hostRef.$hostElement$;
138
- const flags = cmpMeta.$flags$;
139
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
140
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
141
- if (flags & 10 /* needsScopedEncapsulation */) {
142
- // only required when we're NOT using native shadow dom (slot)
143
- // or this browser doesn't support native shadow dom
144
- // and this host element was NOT created with SSR
145
- // let's pick out the inner content for slot projection
146
- // create a node to represent where the original
147
- // content was first placed, which is useful later on
148
- // DOM WRITE!!
149
- elm['s-sc'] = scopeId;
150
- elm.classList.add(scopeId + '-h');
151
- }
152
- endAttachStyles();
153
- };
154
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
33
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
155
34
  /**
156
35
  * Default style mode id
157
36
  */
@@ -284,6 +163,149 @@ const convertToPrivate = (node) => {
284
163
  vnode.$name$ = node.vname;
285
164
  return vnode;
286
165
  };
166
+ /**
167
+ * Parse a new property value for a given property type.
168
+ *
169
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
170
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
171
+ * 1. `any`, the type given to `propValue` in the function signature
172
+ * 2. the type stored from `propType`.
173
+ *
174
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
175
+ *
176
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
177
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
178
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
179
+ * ```tsx
180
+ * <my-cmp prop-val={0}></my-cmp>
181
+ * ```
182
+ *
183
+ * HTML prop values on the other hand, will always a string
184
+ *
185
+ * @param propValue the new value to coerce to some type
186
+ * @param propType the type of the prop, expressed as a binary number
187
+ * @returns the parsed/coerced value
188
+ */
189
+ const parsePropertyValue = (propValue, propType) => {
190
+ // ensure this value is of the correct prop type
191
+ if (propValue != null && !isComplexType(propValue)) {
192
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
193
+ // per the HTML spec, any string value means it is a boolean true value
194
+ // but we'll cheat here and say that the string "false" is the boolean false
195
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
196
+ }
197
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
198
+ // force it to be a number
199
+ return parseFloat(propValue);
200
+ }
201
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
202
+ // could have been passed as a number or boolean
203
+ // but we still want it as a string
204
+ return String(propValue);
205
+ }
206
+ // redundant return here for better minification
207
+ return propValue;
208
+ }
209
+ // not sure exactly what type we want
210
+ // so no need to change to a different type
211
+ return propValue;
212
+ };
213
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
214
+ const createEvent = (ref, name, flags) => {
215
+ const elm = getElement(ref);
216
+ return {
217
+ emit: (detail) => {
218
+ return emitEvent(elm, name, {
219
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
220
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
221
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
222
+ detail,
223
+ });
224
+ },
225
+ };
226
+ };
227
+ /**
228
+ * Helper function to create & dispatch a custom Event on a provided target
229
+ * @param elm the target of the Event
230
+ * @param name the name to give the custom Event
231
+ * @param opts options for configuring a custom Event
232
+ * @returns the custom Event
233
+ */
234
+ const emitEvent = (elm, name, opts) => {
235
+ const ev = plt.ce(name, opts);
236
+ elm.dispatchEvent(ev);
237
+ return ev;
238
+ };
239
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
240
+ const registerStyle = (scopeId, cssText, allowCS) => {
241
+ let style = styles.get(scopeId);
242
+ if (supportsConstructableStylesheets && allowCS) {
243
+ style = (style || new CSSStyleSheet());
244
+ if (typeof style === 'string') {
245
+ style = cssText;
246
+ }
247
+ else {
248
+ style.replaceSync(cssText);
249
+ }
250
+ }
251
+ else {
252
+ style = cssText;
253
+ }
254
+ styles.set(scopeId, style);
255
+ };
256
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
257
+ let scopeId = getScopeId(cmpMeta);
258
+ const style = styles.get(scopeId);
259
+ // if an element is NOT connected then getRootNode() will return the wrong root node
260
+ // so the fallback is to always use the document for the root node in those cases
261
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
262
+ if (style) {
263
+ if (typeof style === 'string') {
264
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
265
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
266
+ let styleElm;
267
+ if (!appliedStyles) {
268
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
269
+ }
270
+ if (!appliedStyles.has(scopeId)) {
271
+ {
272
+ {
273
+ styleElm = doc.createElement('style');
274
+ styleElm.innerHTML = style;
275
+ }
276
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
277
+ }
278
+ if (appliedStyles) {
279
+ appliedStyles.add(scopeId);
280
+ }
281
+ }
282
+ }
283
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
284
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
285
+ }
286
+ }
287
+ return scopeId;
288
+ };
289
+ const attachStyles = (hostRef) => {
290
+ const cmpMeta = hostRef.$cmpMeta$;
291
+ const elm = hostRef.$hostElement$;
292
+ const flags = cmpMeta.$flags$;
293
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
294
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
295
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
296
+ // only required when we're NOT using native shadow dom (slot)
297
+ // or this browser doesn't support native shadow dom
298
+ // and this host element was NOT created with SSR
299
+ // let's pick out the inner content for slot projection
300
+ // create a node to represent where the original
301
+ // content was first placed, which is useful later on
302
+ // DOM WRITE!!
303
+ elm['s-sc'] = scopeId;
304
+ elm.classList.add(scopeId + '-h');
305
+ }
306
+ endAttachStyles();
307
+ };
308
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
287
309
  /**
288
310
  * Production setAccessor() function based on Preact by
289
311
  * Jason Miller (@developit)
@@ -401,7 +423,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
401
423
  }
402
424
  }
403
425
  }
404
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
426
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
405
427
  newValue = newValue === true ? '' : newValue;
406
428
  {
407
429
  elm.setAttribute(memberName, newValue);
@@ -416,7 +438,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
416
438
  // if the element passed in is a shadow root, which is a document fragment
417
439
  // then we want to be adding attrs/props to the shadow root's "host" element
418
440
  // if it's not a shadow root, then we add attrs/props to the same element
419
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
441
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
420
442
  ? newVnode.$elm$.host
421
443
  : newVnode.$elm$;
422
444
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -434,6 +456,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
434
456
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
435
457
  }
436
458
  };
459
+ /**
460
+ * Create a DOM Node corresponding to one of the children of a given VNode.
461
+ *
462
+ * @param oldParentVNode the parent VNode from the previous render
463
+ * @param newParentVNode the parent VNode from the current render
464
+ * @param childIndex the index of the VNode, in the _new_ parent node's
465
+ * children, for which we will create a new DOM node
466
+ * @param parentElm the parent DOM node which our new node will be a child of
467
+ * @returns the newly created node
468
+ */
437
469
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
438
470
  // tslint:disable-next-line: prefer-const
439
471
  const newVNode = newParentVNode.$children$[childIndex];
@@ -451,23 +483,23 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
451
483
  }
452
484
  newVNode.$flags$ |= newVNode.$children$
453
485
  ? // slot element has fallback content
454
- 2 /* isSlotFallback */
486
+ 2 /* VNODE_FLAGS.isSlotFallback */
455
487
  : // slot element does not have fallback content
456
- 1 /* isSlotReference */;
488
+ 1 /* VNODE_FLAGS.isSlotReference */;
457
489
  }
458
490
  }
459
491
  if (newVNode.$text$ !== null) {
460
492
  // create text node
461
493
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
462
494
  }
463
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
495
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
464
496
  // create a slot reference node
465
497
  elm = newVNode.$elm$ =
466
498
  doc.createTextNode('');
467
499
  }
468
500
  else {
469
501
  // create element
470
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
502
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
471
503
  ? 'slot-fb'
472
504
  : newVNode.$tag$));
473
505
  // add css classes, attrs, props, listeners, etc.
@@ -493,7 +525,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
493
525
  }
494
526
  {
495
527
  elm['s-hn'] = hostTagName;
496
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
528
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
497
529
  // remember the content reference comment
498
530
  elm['s-sr'] = true;
499
531
  // remember the content reference comment
@@ -512,7 +544,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
512
544
  return elm;
513
545
  };
514
546
  const putBackInOriginalLocation = (parentElm, recursive) => {
515
- plt.$flags$ |= 1 /* isTmpDisconnected */;
547
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
516
548
  const oldSlotChildNodes = parentElm.childNodes;
517
549
  for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
518
550
  const childNode = oldSlotChildNodes[i];
@@ -533,7 +565,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
533
565
  putBackInOriginalLocation(childNode, recursive);
534
566
  }
535
567
  }
536
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
568
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
537
569
  };
538
570
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
539
571
  let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
@@ -575,6 +607,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
575
607
  }
576
608
  }
577
609
  };
610
+ /**
611
+ * Reconcile the children of a new VNode with the children of an old VNode by
612
+ * traversing the two collections of children, identifying nodes that are
613
+ * conserved or changed, calling out to `patch` to make any necessary
614
+ * updates to the DOM, and rearranging DOM nodes as needed.
615
+ *
616
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
617
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
618
+ * 'windows' by storing start and end indices and references to the
619
+ * corresponding array entries. Initially the two 'windows' are basically equal
620
+ * to the entire array, but we progressively narrow the windows until there are
621
+ * no children left to update by doing the following:
622
+ *
623
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
624
+ * that if we have an initial array like the following we'll end up dealing
625
+ * only with a window bounded by the highlighted elements:
626
+ *
627
+ * [null, null, VNode1 , ... , VNode2, null, null]
628
+ * ^^^^^^ ^^^^^^
629
+ *
630
+ * 2. Check to see if the elements at the head and tail positions are equal
631
+ * across the windows. This will basically detect elements which haven't
632
+ * been added, removed, or changed position, i.e. if you had the following
633
+ * VNode elements (represented as HTML):
634
+ *
635
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
636
+ * newVNode: `<div><p><span>THERE</span></p></div>`
637
+ *
638
+ * Then when comparing the children of the `<div>` tag we check the equality
639
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
640
+ * same tag in the same position, we'd be able to avoid completely
641
+ * re-rendering the subtree under them with a new DOM element and would just
642
+ * call out to `patch` to handle reconciling their children and so on.
643
+ *
644
+ * 3. Check, for both windows, to see if the element at the beginning of the
645
+ * window corresponds to the element at the end of the other window. This is
646
+ * a heuristic which will let us identify _some_ situations in which
647
+ * elements have changed position, for instance it _should_ detect that the
648
+ * children nodes themselves have not changed but merely moved in the
649
+ * following example:
650
+ *
651
+ * oldVNode: `<div><element-one /><element-two /></div>`
652
+ * newVNode: `<div><element-two /><element-one /></div>`
653
+ *
654
+ * If we find cases like this then we also need to move the concrete DOM
655
+ * elements corresponding to the moved children to write the re-order to the
656
+ * DOM.
657
+ *
658
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
659
+ * nodes in the old children which have the same key as the first element in
660
+ * our window on the new children. If we find such a node we handle calling
661
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
662
+ * what we find.
663
+ *
664
+ * Finally, once we've narrowed our 'windows' to the point that either of them
665
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
666
+ * insertion or deletion that needs to happen to get a DOM state that correctly
667
+ * reflects the new child VNodes. If, for instance, after our window on the old
668
+ * children has collapsed we still have more nodes on the new children that
669
+ * we haven't dealt with yet then we need to add them, or if the new children
670
+ * collapse but we still have unhandled _old_ children then we need to make
671
+ * sure the corresponding DOM nodes are removed.
672
+ *
673
+ * @param parentElm the node into which the parent VNode is rendered
674
+ * @param oldCh the old children of the parent node
675
+ * @param newVNode the new VNode which will replace the parent
676
+ * @param newCh the new children of the parent node
677
+ */
578
678
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
579
679
  let oldStartIdx = 0;
580
680
  let newStartIdx = 0;
@@ -587,7 +687,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
587
687
  let node;
588
688
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
589
689
  if (oldStartVnode == null) {
590
- // Vnode might have been moved left
690
+ // VNode might have been moved left
591
691
  oldStartVnode = oldCh[++oldStartIdx];
592
692
  }
593
693
  else if (oldEndVnode == null) {
@@ -600,42 +700,102 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
600
700
  newEndVnode = newCh[--newEndIdx];
601
701
  }
602
702
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
703
+ // if the start nodes are the same then we should patch the new VNode
704
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
705
+ // indices to reflect that. We don't need to move any DOM Nodes around
706
+ // since things are matched up in order.
603
707
  patch(oldStartVnode, newStartVnode);
604
708
  oldStartVnode = oldCh[++oldStartIdx];
605
709
  newStartVnode = newCh[++newStartIdx];
606
710
  }
607
711
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
712
+ // likewise, if the end nodes are the same we patch new onto old and
713
+ // decrement our end indices, and also likewise in this case we don't
714
+ // need to move any DOM Nodes.
608
715
  patch(oldEndVnode, newEndVnode);
609
716
  oldEndVnode = oldCh[--oldEndIdx];
610
717
  newEndVnode = newCh[--newEndIdx];
611
718
  }
612
719
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
613
- // Vnode moved right
720
+ // case: "Vnode moved right"
721
+ //
722
+ // We've found that the last node in our window on the new children is
723
+ // the same VNode as the _first_ node in our window on the old children
724
+ // we're dealing with now. Visually, this is the layout of these two
725
+ // nodes:
726
+ //
727
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
728
+ // ^^^^^^^^^^^
729
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
730
+ // ^^^^^^^^^^^^^
731
+ //
732
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
733
+ // and move the DOM element for `oldStartVnode`.
614
734
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
615
735
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
616
736
  }
617
737
  patch(oldStartVnode, newEndVnode);
738
+ // We need to move the element for `oldStartVnode` into a position which
739
+ // will be appropriate for `newEndVnode`. For this we can use
740
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
741
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
742
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
743
+ //
744
+ // <old-start-node />
745
+ // <some-intervening-node />
746
+ // <old-end-node />
747
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
748
+ // <next-sibling />
749
+ //
750
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
751
+ // the node for `oldStartVnode` at the end of the children of
752
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
753
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
754
+ // append it to the children of the parent element.
618
755
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
619
756
  oldStartVnode = oldCh[++oldStartIdx];
620
757
  newEndVnode = newCh[--newEndIdx];
621
758
  }
622
759
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
623
- // Vnode moved left
760
+ // case: "Vnode moved left"
761
+ //
762
+ // We've found that the first node in our window on the new children is
763
+ // the same VNode as the _last_ node in our window on the old children.
764
+ // Visually, this is the layout of these two nodes:
765
+ //
766
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
767
+ // ^^^^^^^^^^^^^
768
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
769
+ // ^^^^^^^^^^^
770
+ //
771
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
772
+ // (which will handle updating any changed attributes, reconciling their
773
+ // children etc) but we also need to move the DOM node to which
774
+ // `oldEndVnode` corresponds.
624
775
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
625
776
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
626
777
  }
627
778
  patch(oldEndVnode, newStartVnode);
779
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
780
+ // the same node, so since we're here we know that they are not. Thus we
781
+ // can move the element for `oldEndVnode` _before_ the element for
782
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
783
+ // future.
628
784
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
629
785
  oldEndVnode = oldCh[--oldEndIdx];
630
786
  newStartVnode = newCh[++newStartIdx];
631
787
  }
632
788
  else {
633
789
  {
634
- // new element
790
+ // We either didn't find an element in the old children that matches
791
+ // the key of the first new child OR the build is not using `key`
792
+ // attributes at all. In either case we need to create a new element
793
+ // for the new node.
635
794
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
636
795
  newStartVnode = newCh[++newStartIdx];
637
796
  }
638
797
  if (node) {
798
+ // if we created a new node then handle inserting it to the DOM
639
799
  {
640
800
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
641
801
  }
@@ -643,18 +803,39 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
643
803
  }
644
804
  }
645
805
  if (oldStartIdx > oldEndIdx) {
806
+ // we have some more new nodes to add which don't match up with old nodes
646
807
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
647
808
  }
648
809
  else if (newStartIdx > newEndIdx) {
810
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
811
+ // in the new array, so lets remove them (which entails cleaning up the
812
+ // relevant DOM nodes)
649
813
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
650
814
  }
651
815
  };
652
- const isSameVnode = (vnode1, vnode2) => {
816
+ /**
817
+ * Compare two VNodes to determine if they are the same
818
+ *
819
+ * **NB**: This function is an equality _heuristic_ based on the available
820
+ * information set on the two VNodes and can be misleading under certain
821
+ * circumstances. In particular, if the two nodes do not have `key` attrs
822
+ * (available under `$key$` on VNodes) then the function falls back on merely
823
+ * checking that they have the same tag.
824
+ *
825
+ * So, in other words, if `key` attrs are not set on VNodes which may be
826
+ * changing order within a `children` array or something along those lines then
827
+ * we could obtain a false positive and then have to do needless re-rendering.
828
+ *
829
+ * @param leftVNode the first VNode to check
830
+ * @param rightVNode the second VNode to check
831
+ * @returns whether they're equal or not
832
+ */
833
+ const isSameVnode = (leftVNode, rightVNode) => {
653
834
  // compare if two vnode to see if they're "technically" the same
654
835
  // need to have the same element tag, and same key to be the same
655
- if (vnode1.$tag$ === vnode2.$tag$) {
656
- if (vnode1.$tag$ === 'slot') {
657
- return vnode1.$name$ === vnode2.$name$;
836
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
837
+ if (leftVNode.$tag$ === 'slot') {
838
+ return leftVNode.$name$ === rightVNode.$name$;
658
839
  }
659
840
  return true;
660
841
  }
@@ -668,6 +849,14 @@ const referenceNode = (node) => {
668
849
  return (node && node['s-ol']) || node;
669
850
  };
670
851
  const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
852
+ /**
853
+ * Handle reconciling an outdated VNode with a new one which corresponds to
854
+ * it. This function handles flushing updates to the DOM and reconciling the
855
+ * children of the two nodes (if any).
856
+ *
857
+ * @param oldVNode an old VNode whose DOM element and children we want to update
858
+ * @param newVNode a new VNode representing an updated version of the old one
859
+ */
671
860
  const patch = (oldVNode, newVNode) => {
672
861
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
673
862
  const oldChildren = oldVNode.$children$;
@@ -676,7 +865,6 @@ const patch = (oldVNode, newVNode) => {
676
865
  const text = newVNode.$text$;
677
866
  let defaultHolder;
678
867
  if (text === null) {
679
- // element node
680
868
  {
681
869
  if (tag === 'slot')
682
870
  ;
@@ -689,6 +877,7 @@ const patch = (oldVNode, newVNode) => {
689
877
  }
690
878
  if (oldChildren !== null && newChildren !== null) {
691
879
  // looks like there's child vnodes for both the old and new vnodes
880
+ // so we need to call `updateChildren` to reconcile them
692
881
  updateChildren(elm, oldChildren, newVNode, newChildren);
693
882
  }
694
883
  else if (newChildren !== null) {
@@ -726,7 +915,7 @@ const updateFallbackSlotVisibility = (elm) => {
726
915
  let nodeType;
727
916
  for (i = 0, ilen = childNodes.length; i < ilen; i++) {
728
917
  childNode = childNodes[i];
729
- if (childNode.nodeType === 1 /* ElementNode */) {
918
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
730
919
  if (childNode['s-sr']) {
731
920
  // this is a slot fallback node
732
921
  // get the slot name for this slot reference node
@@ -738,7 +927,7 @@ const updateFallbackSlotVisibility = (elm) => {
738
927
  nodeType = childNodes[j].nodeType;
739
928
  if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
740
929
  // this sibling node is from a different component OR is a named fallback slot node
741
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
930
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
742
931
  childNode.hidden = true;
743
932
  break;
744
933
  }
@@ -747,8 +936,8 @@ const updateFallbackSlotVisibility = (elm) => {
747
936
  // this is a default fallback slot node
748
937
  // any element or text node (with content)
749
938
  // should hide the default fallback slot node
750
- if (nodeType === 1 /* ElementNode */ ||
751
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
939
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
940
+ (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
752
941
  childNode.hidden = true;
753
942
  break;
754
943
  }
@@ -826,13 +1015,13 @@ const relocateSlotContent = (elm) => {
826
1015
  }
827
1016
  }
828
1017
  }
829
- if (childNode.nodeType === 1 /* ElementNode */) {
1018
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
830
1019
  relocateSlotContent(childNode);
831
1020
  }
832
1021
  }
833
1022
  };
834
1023
  const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
835
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1024
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
836
1025
  if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
837
1026
  return true;
838
1027
  }
@@ -863,7 +1052,7 @@ const renderVdom = (hostRef, renderFnResults) => {
863
1052
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
864
1053
  }
865
1054
  rootVnode.$tag$ = null;
866
- rootVnode.$flags$ |= 4 /* isHost */;
1055
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
867
1056
  hostRef.$vnode$ = rootVnode;
868
1057
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
869
1058
  {
@@ -871,7 +1060,7 @@ const renderVdom = (hostRef, renderFnResults) => {
871
1060
  }
872
1061
  {
873
1062
  contentRef = hostElm['s-cr'];
874
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1063
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
875
1064
  // always reset
876
1065
  checkSlotFallbackVisibility = false;
877
1066
  }
@@ -880,7 +1069,7 @@ const renderVdom = (hostRef, renderFnResults) => {
880
1069
  {
881
1070
  // while we're moving nodes around existing nodes, temporarily disable
882
1071
  // the disconnectCallback from working
883
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1072
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
884
1073
  if (checkSlotRelocate) {
885
1074
  relocateSlotContent(rootVnode.$elm$);
886
1075
  let relocateData;
@@ -938,7 +1127,7 @@ const renderVdom = (hostRef, renderFnResults) => {
938
1127
  }
939
1128
  else {
940
1129
  // this node doesn't have a slot home to go to, so let's hide it
941
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1130
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
942
1131
  nodeToRelocate.hidden = true;
943
1132
  }
944
1133
  }
@@ -949,37 +1138,11 @@ const renderVdom = (hostRef, renderFnResults) => {
949
1138
  }
950
1139
  // done moving nodes around
951
1140
  // allow the disconnect callback to work again
952
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1141
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
953
1142
  // always reset
954
1143
  relocateNodes.length = 0;
955
1144
  }
956
1145
  };
957
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
958
- const createEvent = (ref, name, flags) => {
959
- const elm = getElement(ref);
960
- return {
961
- emit: (detail) => {
962
- return emitEvent(elm, name, {
963
- bubbles: !!(flags & 4 /* Bubbles */),
964
- composed: !!(flags & 2 /* Composed */),
965
- cancelable: !!(flags & 1 /* Cancellable */),
966
- detail,
967
- });
968
- },
969
- };
970
- };
971
- /**
972
- * Helper function to create & dispatch a custom Event on a provided target
973
- * @param elm the target of the Event
974
- * @param name the name to give the custom Event
975
- * @param opts options for configuring a custom Event
976
- * @returns the custom Event
977
- */
978
- const emitEvent = (elm, name, opts) => {
979
- const ev = plt.ce(name, opts);
980
- elm.dispatchEvent(ev);
981
- return ev;
982
- };
983
1146
  const attachToAncestor = (hostRef, ancestorComponent) => {
984
1147
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
985
1148
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -987,10 +1150,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
987
1150
  };
988
1151
  const scheduleUpdate = (hostRef, isInitialLoad) => {
989
1152
  {
990
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1153
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
991
1154
  }
992
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
993
- hostRef.$flags$ |= 512 /* needsRerender */;
1155
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1156
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
994
1157
  return;
995
1158
  }
996
1159
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -1006,7 +1169,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1006
1169
  let promise;
1007
1170
  if (isInitialLoad) {
1008
1171
  {
1009
- hostRef.$flags$ |= 256 /* isListenReady */;
1172
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1010
1173
  if (hostRef.$queuedListeners$) {
1011
1174
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1012
1175
  hostRef.$queuedListeners$ = null;
@@ -1052,7 +1215,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1052
1215
  }
1053
1216
  else {
1054
1217
  Promise.all(childrenPromises).then(postUpdate);
1055
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1218
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1056
1219
  childrenPromises.length = 0;
1057
1220
  }
1058
1221
  }
@@ -1061,10 +1224,10 @@ const callRender = (hostRef, instance, elm) => {
1061
1224
  try {
1062
1225
  instance = instance.render() ;
1063
1226
  {
1064
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1227
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1065
1228
  }
1066
1229
  {
1067
- hostRef.$flags$ |= 2 /* hasRendered */;
1230
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1068
1231
  }
1069
1232
  {
1070
1233
  {
@@ -1091,8 +1254,8 @@ const postUpdateComponent = (hostRef) => {
1091
1254
  {
1092
1255
  safeCall(instance, 'componentDidRender');
1093
1256
  }
1094
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1095
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1257
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1258
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1096
1259
  {
1097
1260
  // DOM WRITE!
1098
1261
  addHydratedFlag(elm);
@@ -1121,10 +1284,10 @@ const postUpdateComponent = (hostRef) => {
1121
1284
  hostRef.$onRenderResolve$();
1122
1285
  hostRef.$onRenderResolve$ = undefined;
1123
1286
  }
1124
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1287
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1125
1288
  nextTick(() => scheduleUpdate(hostRef, false));
1126
1289
  }
1127
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1290
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1128
1291
  }
1129
1292
  // ( •_•)
1130
1293
  // ( •_•)>⌐■-■
@@ -1154,53 +1317,6 @@ const then = (promise, thenFn) => {
1154
1317
  };
1155
1318
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1156
1319
  ;
1157
- /**
1158
- * Parse a new property value for a given property type.
1159
- *
1160
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1161
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1162
- * 1. `any`, the type given to `propValue` in the function signature
1163
- * 2. the type stored from `propType`.
1164
- *
1165
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1166
- *
1167
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1168
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1169
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1170
- * ```tsx
1171
- * <my-cmp prop-val={0}></my-cmp>
1172
- * ```
1173
- *
1174
- * HTML prop values on the other hand, will always a string
1175
- *
1176
- * @param propValue the new value to coerce to some type
1177
- * @param propType the type of the prop, expressed as a binary number
1178
- * @returns the parsed/coerced value
1179
- */
1180
- const parsePropertyValue = (propValue, propType) => {
1181
- // ensure this value is of the correct prop type
1182
- if (propValue != null && !isComplexType(propValue)) {
1183
- if (propType & 4 /* Boolean */) {
1184
- // per the HTML spec, any string value means it is a boolean true value
1185
- // but we'll cheat here and say that the string "false" is the boolean false
1186
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1187
- }
1188
- if (propType & 2 /* Number */) {
1189
- // force it to be a number
1190
- return parseFloat(propValue);
1191
- }
1192
- if (propType & 1 /* String */) {
1193
- // could have been passed as a number or boolean
1194
- // but we still want it as a string
1195
- return String(propValue);
1196
- }
1197
- // redundant return here for better minification
1198
- return propValue;
1199
- }
1200
- // not sure exactly what type we want
1201
- // so no need to change to a different type
1202
- return propValue;
1203
- };
1204
1320
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1205
1321
  const setValue = (ref, propName, newVal, cmpMeta) => {
1206
1322
  // check our new property value against our internal value
@@ -1213,13 +1329,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1213
1329
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1214
1330
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1215
1331
  const didValueChange = newVal !== oldVal && !areBothNaN;
1216
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1332
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1217
1333
  // gadzooks! the property's value has changed!!
1218
1334
  // set our new value!
1219
1335
  hostRef.$instanceValues$.set(propName, newVal);
1220
1336
  if (instance) {
1221
1337
  // get an array of method names of watch functions to call
1222
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1338
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1223
1339
  const watchMethods = cmpMeta.$watchers$[propName];
1224
1340
  if (watchMethods) {
1225
1341
  // this instance is watching for when this property changed
@@ -1234,7 +1350,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1234
1350
  });
1235
1351
  }
1236
1352
  }
1237
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1353
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1238
1354
  if (instance.componentShouldUpdate) {
1239
1355
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1240
1356
  return;
@@ -1249,6 +1365,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1249
1365
  }
1250
1366
  }
1251
1367
  };
1368
+ /**
1369
+ * Attach a series of runtime constructs to a compiled Stencil component
1370
+ * constructor, including getters and setters for the `@Prop` and `@State`
1371
+ * decorators, callbacks for when attributes change, and so on.
1372
+ *
1373
+ * @param Cstr the constructor for a component that we need to process
1374
+ * @param cmpMeta metadata collected previously about the component
1375
+ * @param flags a number used to store a series of bit flags
1376
+ * @returns a reference to the same constructor passed in (but now mutated)
1377
+ */
1252
1378
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1253
1379
  if (cmpMeta.$members$) {
1254
1380
  if (Cstr.watchers) {
@@ -1258,8 +1384,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1258
1384
  const members = Object.entries(cmpMeta.$members$);
1259
1385
  const prototype = Cstr.prototype;
1260
1386
  members.map(([memberName, [memberFlags]]) => {
1261
- if ((memberFlags & 31 /* Prop */ ||
1262
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1387
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1388
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1263
1389
  // proxyComponent - prop
1264
1390
  Object.defineProperty(prototype, memberName, {
1265
1391
  get() {
@@ -1275,7 +1401,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1275
1401
  });
1276
1402
  }
1277
1403
  });
1278
- if ((flags & 1 /* isElementConstructor */)) {
1404
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1279
1405
  const attrNameToPropName = new Map();
1280
1406
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1281
1407
  plt.jmp(() => {
@@ -1331,11 +1457,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1331
1457
  // create an array of attributes to observe
1332
1458
  // and also create a map of html attribute name to js property name
1333
1459
  Cstr.observedAttributes = members
1334
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1460
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1335
1461
  .map(([propName, m]) => {
1336
1462
  const attrName = m[1] || propName;
1337
1463
  attrNameToPropName.set(attrName, propName);
1338
- if (m[0] & 512 /* ReflectAttr */) {
1464
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1339
1465
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1340
1466
  }
1341
1467
  return attrName;
@@ -1346,10 +1472,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1346
1472
  };
1347
1473
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1348
1474
  // initializeComponent
1349
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1475
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1350
1476
  {
1351
1477
  // we haven't initialized this element yet
1352
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1478
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1353
1479
  // lazy loaded components
1354
1480
  // request the component's implementation to be
1355
1481
  // wired up with the host element
@@ -1367,7 +1493,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1367
1493
  {
1368
1494
  cmpMeta.$watchers$ = Cstr.watchers;
1369
1495
  }
1370
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1496
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1371
1497
  Cstr.isProxied = true;
1372
1498
  }
1373
1499
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1375,7 +1501,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1375
1501
  // but let's keep track of when we start and stop
1376
1502
  // so that the getters/setters don't incorrectly step on data
1377
1503
  {
1378
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1504
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1379
1505
  }
1380
1506
  // construct the lazy-loaded component implementation
1381
1507
  // passing the hostRef is very important during
@@ -1388,10 +1514,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1388
1514
  consoleError(e);
1389
1515
  }
1390
1516
  {
1391
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1517
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1392
1518
  }
1393
1519
  {
1394
- hostRef.$flags$ |= 128 /* isWatchReady */;
1520
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1395
1521
  }
1396
1522
  endNewInstance();
1397
1523
  }
@@ -1401,7 +1527,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1401
1527
  const scopeId = getScopeId(cmpMeta);
1402
1528
  if (!styles.has(scopeId)) {
1403
1529
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1404
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1530
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1405
1531
  endRegisterStyles();
1406
1532
  }
1407
1533
  }
@@ -1423,19 +1549,19 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1423
1549
  }
1424
1550
  };
1425
1551
  const connectedCallback = (elm) => {
1426
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1552
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1427
1553
  const hostRef = getHostRef(elm);
1428
1554
  const cmpMeta = hostRef.$cmpMeta$;
1429
1555
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1430
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1556
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1431
1557
  // first time this component has connected
1432
- hostRef.$flags$ |= 1 /* hasConnected */;
1558
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1433
1559
  {
1434
1560
  // initUpdate
1435
1561
  // if the slot polyfill is required we'll need to put some nodes
1436
1562
  // in here to act as original content anchors as we move nodes around
1437
1563
  // host element has been connected to the DOM
1438
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1564
+ if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1439
1565
  setContentReference(elm);
1440
1566
  }
1441
1567
  }
@@ -1458,7 +1584,7 @@ const connectedCallback = (elm) => {
1458
1584
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1459
1585
  if (cmpMeta.$members$) {
1460
1586
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1461
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1587
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1462
1588
  const value = elm[memberName];
1463
1589
  delete elm[memberName];
1464
1590
  elm[memberName] = value;
@@ -1490,7 +1616,7 @@ const setContentReference = (elm) => {
1490
1616
  elm.insertBefore(contentRefElm, elm.firstChild);
1491
1617
  };
1492
1618
  const disconnectedCallback = (elm) => {
1493
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1619
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1494
1620
  const hostRef = getHostRef(elm);
1495
1621
  const instance = hostRef.$lazyInstance$ ;
1496
1622
  {
@@ -1545,7 +1671,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1545
1671
  super(self);
1546
1672
  self = this;
1547
1673
  registerHost(self, cmpMeta);
1548
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1674
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1549
1675
  // this component is using shadow dom
1550
1676
  // and this browser supports shadow dom
1551
1677
  // add the read-only property "shadowRoot" to the host element
@@ -1580,7 +1706,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1580
1706
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1581
1707
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1582
1708
  cmpTags.push(tagName);
1583
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1709
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1584
1710
  }
1585
1711
  });
1586
1712
  });
@@ -1602,7 +1728,45 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1602
1728
  // Fallback appLoad event
1603
1729
  endBootstrap();
1604
1730
  };
1605
- const hostRefs = new WeakMap();
1731
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1732
+ if (listeners) {
1733
+ listeners.map(([flags, name, method]) => {
1734
+ const target = getHostListenerTarget(elm, flags) ;
1735
+ const handler = hostListenerProxy(hostRef, method);
1736
+ const opts = hostListenerOpts(flags);
1737
+ plt.ael(target, name, handler, opts);
1738
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1739
+ });
1740
+ }
1741
+ };
1742
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1743
+ try {
1744
+ {
1745
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1746
+ // instance is ready, let's call it's member method for this event
1747
+ hostRef.$lazyInstance$[methodName](ev);
1748
+ }
1749
+ else {
1750
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1751
+ }
1752
+ }
1753
+ }
1754
+ catch (e) {
1755
+ consoleError(e);
1756
+ }
1757
+ };
1758
+ const getHostListenerTarget = (elm, flags) => {
1759
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1760
+ return doc;
1761
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1762
+ return win;
1763
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1764
+ return doc.body;
1765
+ return elm;
1766
+ };
1767
+ // prettier-ignore
1768
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1769
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1606
1770
  const getHostRef = (ref) => hostRefs.get(ref);
1607
1771
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1608
1772
  const registerHost = (elm, cmpMeta) => {
@@ -1797,14 +1961,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1797
1961
  return importedModule[exportName];
1798
1962
  }, consoleError);
1799
1963
  };
1800
- const styles = new Map();
1964
+ const styles = /*@__PURE__*/ new Map();
1965
+ const win = typeof window !== 'undefined' ? window : {};
1966
+ const doc = win.document || { head: {} };
1967
+ const plt = {
1968
+ $flags$: 0,
1969
+ $resourcesUrl$: '',
1970
+ jmp: (h) => h(),
1971
+ raf: (h) => requestAnimationFrame(h),
1972
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1973
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1974
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1975
+ };
1976
+ const promiseResolve = (v) => Promise.resolve(v);
1977
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1978
+ try {
1979
+ new CSSStyleSheet();
1980
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1981
+ }
1982
+ catch (e) { }
1983
+ return false;
1984
+ })()
1985
+ ;
1801
1986
  const queueDomReads = [];
1802
1987
  const queueDomWrites = [];
1803
1988
  const queueTask = (queue, write) => (cb) => {
1804
1989
  queue.push(cb);
1805
1990
  if (!queuePending) {
1806
1991
  queuePending = true;
1807
- if (write && plt.$flags$ & 4 /* queueSync */) {
1992
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1808
1993
  nextTick(flush);
1809
1994
  }
1810
1995
  else {