@swisspost/design-system-components 10.0.0-next.46 → 10.0.0-next.48

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 (270) hide show
  1. package/dist/cjs/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
  2. package/dist/cjs/index-CpDyH7Ww.js +8 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-Din0le0Q.js → package-CZyXYkIN.js} +1 -1
  5. package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
  6. package/dist/cjs/post-avatar.cjs.entry.js +91 -54
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +32 -7
  8. package/dist/cjs/post-banner.cjs.entry.js +31 -35
  9. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/post-card-control.cjs.entry.js +3 -3
  12. package/dist/cjs/post-closebutton_15.cjs.entry.js +39 -8
  13. package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
  14. package/dist/cjs/post-components.cjs.js +1 -1
  15. package/dist/cjs/post-footer.cjs.entry.js +1 -1
  16. package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
  17. package/dist/cjs/post-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/post-rating.cjs.entry.js +1 -1
  19. package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
  20. package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
  21. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  22. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
  23. package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
  24. package/dist/collection/animations/slide-and-fade.js +25 -0
  25. package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
  26. package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
  27. package/dist/collection/components/post-avatar/post-avatar.js +91 -58
  28. package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -1
  29. package/dist/collection/components/post-back-to-top/post-back-to-top.js +5 -5
  30. package/dist/collection/components/post-banner/post-banner.css +1 -1
  31. package/dist/collection/components/post-banner/post-banner.js +41 -81
  32. package/dist/collection/components/post-card-control/post-card-control.js +8 -8
  33. package/dist/collection/components/post-closebutton/post-closebutton.js +9 -1
  34. package/dist/collection/components/post-menu/post-menu.js +4 -1
  35. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +1 -1
  36. package/dist/collection/components/post-tabs/post-tabs.js +3 -3
  37. package/dist/collection/utils/event-from.js +2 -2
  38. package/dist/components/{p-8U5GFtQP.js → event-from.js} +2 -2
  39. package/dist/components/get-root.js +15 -0
  40. package/dist/components/index.d.ts +73 -0
  41. package/dist/components/index.js +36 -2315
  42. package/dist/components/package.js +3 -0
  43. package/dist/components/post-accordion-item.js +1 -1
  44. package/dist/components/post-accordion-item2.js +113 -0
  45. package/dist/components/post-accordion.js +1 -1
  46. package/dist/components/post-accordion2.js +138 -0
  47. package/dist/components/post-avatar.js +99 -62
  48. package/dist/components/post-back-to-top.js +37 -13
  49. package/dist/components/post-banner.js +39 -51
  50. package/dist/components/post-breadcrumb-item.js +1 -1
  51. package/dist/components/post-breadcrumb-item2.js +79 -0
  52. package/dist/components/post-breadcrumbs.js +13 -14
  53. package/dist/components/post-card-control.js +10 -11
  54. package/dist/components/post-closebutton.js +13 -6
  55. package/dist/components/post-collapsible-trigger.js +1 -1
  56. package/dist/components/post-collapsible-trigger2.js +135 -0
  57. package/dist/components/post-collapsible.js +1 -1
  58. package/dist/components/post-collapsible2.js +110 -0
  59. package/dist/components/post-footer.js +10 -11
  60. package/dist/components/post-header.js +30 -8
  61. package/dist/components/post-icon.js +1 -1
  62. package/dist/components/post-icon2.js +153 -0
  63. package/dist/components/post-language-option.js +8 -9
  64. package/dist/components/post-language-switch.js +12 -13
  65. package/dist/components/post-linkarea.js +3 -4
  66. package/dist/components/post-list-item.js +3 -4
  67. package/dist/components/post-list.js +4 -5
  68. package/dist/components/post-logo.js +5 -6
  69. package/dist/components/post-mainnavigation.js +4 -5
  70. package/dist/components/post-megadropdown-trigger.js +6 -7
  71. package/dist/components/post-megadropdown.js +7 -8
  72. package/dist/components/post-menu-item.js +1 -1
  73. package/dist/components/post-menu-item2.js +30 -0
  74. package/dist/components/post-menu-trigger.js +1 -1
  75. package/dist/components/post-menu-trigger2.js +110 -0
  76. package/dist/components/post-menu.js +1 -1
  77. package/dist/components/post-menu2.js +222 -0
  78. package/dist/components/post-popover.js +6 -7
  79. package/dist/components/post-popovercontainer.js +1 -1
  80. package/dist/components/post-popovercontainer2.js +3018 -0
  81. package/dist/components/post-rating.js +8 -9
  82. package/dist/components/post-tab-header.js +6 -7
  83. package/dist/components/post-tab-panel.js +6 -7
  84. package/dist/components/post-tabs.js +7 -8
  85. package/dist/components/post-togglebutton.js +3 -4
  86. package/dist/components/post-tooltip-trigger.js +6 -7
  87. package/dist/components/post-tooltip.js +6 -7
  88. package/dist/components/react/index.d.ts +33 -0
  89. package/dist/components/react/index.js +2315 -0
  90. package/dist/components/react/p-0Ltezq5O.js +3 -0
  91. package/dist/components/{p-C8YtuR96.js → react/p-38PqL5iD.js} +1 -1
  92. package/dist/components/react/p-BLchVpF6.js +14 -0
  93. package/dist/components/react/p-C35MCWIp.js +35 -0
  94. package/dist/components/{p-Dg6sSnLv.js → react/p-CGsAj6ij.js} +1 -1
  95. package/dist/components/react/p-CJ80BZ06.js +178 -0
  96. package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
  97. package/dist/components/react/p-C_2k3G1c.js +264 -0
  98. package/dist/components/{p-D1Ldeko3.js → react/p-Ce7jgYmK.js} +2 -2
  99. package/dist/components/{p-DNnYEFO6.js → react/p-CiYSngKM.js} +7 -7
  100. package/dist/components/{p-Cpy7mEQb.js → react/p-Da5wbVP8.js} +1 -1
  101. package/dist/components/{p-9rHPmDn6.js → react/p-Dq9F2i7n.js} +2 -2
  102. package/dist/components/{p-jLh9Y0sO.js → react/p-DzYquz3e.js} +2 -2
  103. package/dist/components/{p-C1i4rB_c.js → react/p-JHuJA2Lv.js} +4 -4
  104. package/dist/components/react/p-SbIC4aZX.js +11 -0
  105. package/dist/components/{p-Cd5RHPSU.js → react/p-Tg0GNTZM.js} +2 -2
  106. package/dist/{esm/event-from-8U5GFtQP.js → components/react/p-kraHE1r3.js} +2 -2
  107. package/dist/components/{p-DQE6fqIb.js → react/p-q8Fvf8A0.js} +1 -1
  108. package/dist/components/react/p-r4txK0AC.js +3 -0
  109. package/dist/components/react/post-accordion-item.d.ts +11 -0
  110. package/dist/components/react/post-accordion-item.js +6 -0
  111. package/dist/components/react/post-accordion.d.ts +11 -0
  112. package/dist/components/react/post-accordion.js +6 -0
  113. package/dist/components/react/post-avatar.d.ts +11 -0
  114. package/dist/components/react/post-avatar.js +226 -0
  115. package/dist/components/react/post-back-to-top.d.ts +11 -0
  116. package/dist/components/react/post-back-to-top.js +145 -0
  117. package/dist/components/react/post-banner.d.ts +11 -0
  118. package/dist/components/react/post-banner.js +99 -0
  119. package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
  120. package/dist/components/react/post-breadcrumb-item.js +6 -0
  121. package/dist/components/react/post-breadcrumbs.d.ts +11 -0
  122. package/dist/components/react/post-breadcrumbs.js +187 -0
  123. package/dist/components/react/post-card-control.d.ts +11 -0
  124. package/dist/components/react/post-card-control.js +327 -0
  125. package/dist/components/react/post-closebutton.d.ts +11 -0
  126. package/dist/components/react/post-closebutton.js +50 -0
  127. package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
  128. package/dist/components/react/post-collapsible-trigger.js +6 -0
  129. package/dist/components/react/post-collapsible.d.ts +11 -0
  130. package/dist/components/react/post-collapsible.js +6 -0
  131. package/dist/components/react/post-footer.d.ts +11 -0
  132. package/dist/components/react/post-footer.js +117 -0
  133. package/dist/components/react/post-header.d.ts +11 -0
  134. package/dist/components/react/post-header.js +333 -0
  135. package/dist/components/react/post-icon.d.ts +11 -0
  136. package/dist/components/react/post-icon.js +6 -0
  137. package/dist/components/react/post-language-option.d.ts +11 -0
  138. package/dist/components/react/post-language-option.js +101 -0
  139. package/dist/components/react/post-language-switch.d.ts +11 -0
  140. package/dist/components/react/post-language-switch.js +159 -0
  141. package/dist/components/react/post-linkarea.d.ts +11 -0
  142. package/dist/components/react/post-linkarea.js +46 -0
  143. package/dist/components/react/post-list-item.d.ts +11 -0
  144. package/dist/components/react/post-list-item.js +39 -0
  145. package/dist/components/react/post-list.d.ts +11 -0
  146. package/dist/components/react/post-list.js +62 -0
  147. package/dist/components/react/post-logo.d.ts +11 -0
  148. package/dist/components/react/post-logo.js +59 -0
  149. package/dist/components/react/post-mainnavigation.d.ts +11 -0
  150. package/dist/components/react/post-mainnavigation.js +181 -0
  151. package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
  152. package/dist/components/react/post-megadropdown-trigger.js +137 -0
  153. package/dist/components/react/post-megadropdown.d.ts +11 -0
  154. package/dist/components/react/post-megadropdown.js +197 -0
  155. package/dist/components/react/post-menu-item.d.ts +11 -0
  156. package/dist/components/react/post-menu-item.js +6 -0
  157. package/dist/components/react/post-menu-trigger.d.ts +11 -0
  158. package/dist/components/react/post-menu-trigger.js +6 -0
  159. package/dist/components/react/post-menu.d.ts +11 -0
  160. package/dist/components/react/post-menu.js +6 -0
  161. package/dist/components/react/post-popover.d.ts +11 -0
  162. package/dist/components/react/post-popover.js +189 -0
  163. package/dist/components/react/post-popovercontainer.d.ts +11 -0
  164. package/dist/components/react/post-popovercontainer.js +6 -0
  165. package/dist/components/react/post-rating.d.ts +11 -0
  166. package/dist/components/react/post-rating.js +153 -0
  167. package/dist/components/react/post-tab-header.d.ts +11 -0
  168. package/dist/components/react/post-tab-header.js +53 -0
  169. package/dist/components/react/post-tab-panel.d.ts +11 -0
  170. package/dist/components/react/post-tab-panel.js +55 -0
  171. package/dist/components/react/post-tabs.d.ts +11 -0
  172. package/dist/components/react/post-tabs.js +197 -0
  173. package/dist/components/react/post-togglebutton.d.ts +11 -0
  174. package/dist/components/react/post-togglebutton.js +57 -0
  175. package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
  176. package/dist/components/react/post-tooltip-trigger.js +5223 -0
  177. package/dist/components/react/post-tooltip.d.ts +11 -0
  178. package/dist/components/react/post-tooltip.js +115 -0
  179. package/dist/components/switch-variants.js +3 -0
  180. package/dist/docs.json +43 -76
  181. package/dist/esm/event-from-kraHE1r3.js +105 -0
  182. package/dist/esm/index-C8a0ddDa.js +8 -8
  183. package/dist/esm/index-VmK3ABCB.js +88 -0
  184. package/dist/esm/loader.js +1 -1
  185. package/dist/esm/package-0Ltezq5O.js +3 -0
  186. package/dist/esm/post-accordion_2.entry.js +5 -5
  187. package/dist/esm/post-avatar.entry.js +92 -55
  188. package/dist/esm/post-back-to-top.entry.js +33 -8
  189. package/dist/esm/post-banner.entry.js +32 -36
  190. package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
  191. package/dist/esm/post-breadcrumbs.entry.js +2 -2
  192. package/dist/esm/post-card-control.entry.js +4 -4
  193. package/dist/esm/post-closebutton_15.entry.js +38 -7
  194. package/dist/esm/post-collapsible_2.entry.js +3 -3
  195. package/dist/esm/post-components.js +1 -1
  196. package/dist/esm/post-footer.entry.js +2 -2
  197. package/dist/esm/post-linkarea.entry.js +1 -1
  198. package/dist/esm/post-popover.entry.js +2 -2
  199. package/dist/esm/post-rating.entry.js +2 -2
  200. package/dist/esm/post-tab-header.entry.js +2 -2
  201. package/dist/esm/post-tab-panel.entry.js +2 -2
  202. package/dist/esm/post-tabs.entry.js +2 -2
  203. package/dist/esm/post-tooltip-trigger.entry.js +2 -2
  204. package/dist/esm/post-tooltip.entry.js +2 -2
  205. package/dist/loader/cdn.js +1 -0
  206. package/dist/loader/index.cjs.js +1 -0
  207. package/{loader → dist/loader}/index.d.ts +1 -1
  208. package/dist/loader/index.es2017.js +1 -0
  209. package/{loader → dist/loader}/index.js +1 -1
  210. package/dist/post-components/p-0Ltezq5O.js +1 -0
  211. package/dist/post-components/{p-eddb07df.entry.js → p-16772417.entry.js} +1 -1
  212. package/dist/post-components/{p-1dee733a.entry.js → p-38d3d441.entry.js} +1 -1
  213. package/dist/post-components/{p-470750be.entry.js → p-3c71f590.entry.js} +1 -1
  214. package/dist/post-components/p-40f21542.entry.js +1 -0
  215. package/dist/post-components/{p-30f12b7c.entry.js → p-4243cdd1.entry.js} +1 -1
  216. package/dist/post-components/p-4c18cb8c.entry.js +1 -0
  217. package/dist/post-components/{p-7819009b.entry.js → p-51dc7647.entry.js} +1 -1
  218. package/dist/post-components/{p-80bad606.entry.js → p-6777e505.entry.js} +1 -1
  219. package/dist/post-components/{p-7689015e.entry.js → p-6add880f.entry.js} +1 -1
  220. package/dist/post-components/{p-74a9aafc.entry.js → p-8363fedb.entry.js} +1 -1
  221. package/dist/post-components/p-83998038.entry.js +1 -0
  222. package/dist/post-components/{p-cb937e6b.entry.js → p-85bb1b5e.entry.js} +1 -1
  223. package/dist/post-components/{p-a0a1cab6.entry.js → p-8f4d8685.entry.js} +1 -1
  224. package/dist/post-components/{p-a69c874a.entry.js → p-95ad536d.entry.js} +1 -1
  225. package/dist/post-components/{p-3789cf50.entry.js → p-9d806e89.entry.js} +1 -1
  226. package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
  227. package/dist/post-components/p-aad86320.entry.js +1 -0
  228. package/dist/post-components/p-c3e38acf.entry.js +1 -0
  229. package/dist/post-components/{p-ba13450e.entry.js → p-d61bb2ff.entry.js} +1 -1
  230. package/dist/post-components/p-kraHE1r3.js +1 -0
  231. package/dist/post-components/post-components.esm.js +1 -1
  232. package/dist/types/animations/slide-and-fade.d.ts +2 -0
  233. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
  234. package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
  235. package/dist/types/components/post-avatar/post-avatar.d.ts +14 -11
  236. package/dist/types/components/post-banner/post-banner.d.ts +6 -14
  237. package/dist/types/components/post-card-control/post-card-control.d.ts +7 -7
  238. package/dist/types/components/post-closebutton/post-closebutton.d.ts +2 -0
  239. package/dist/types/components/post-menu/post-menu.d.ts +3 -0
  240. package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
  241. package/dist/types/components.d.ts +9 -27
  242. package/dist/types/utils/component-on-ready.d.ts +2 -2
  243. package/hydrate/index.js +208 -142
  244. package/hydrate/index.mjs +208 -142
  245. package/package.json +20 -10
  246. package/dist/cjs/slide-CbBL7A8w.js +0 -28
  247. package/dist/components/p-7hVD-I9l.js +0 -3
  248. package/dist/components/p-BuLMaH5t.js +0 -25
  249. package/dist/esm/package-7hVD-I9l.js +0 -3
  250. package/dist/esm/slide-BuLMaH5t.js +0 -25
  251. package/dist/post-components/p-26730afe.entry.js +0 -1
  252. package/dist/post-components/p-2d3fb75c.entry.js +0 -1
  253. package/dist/post-components/p-2ed74834.entry.js +0 -1
  254. package/dist/post-components/p-7hVD-I9l.js +0 -1
  255. package/dist/post-components/p-8U5GFtQP.js +0 -1
  256. package/dist/post-components/p-BuLMaH5t.js +0 -1
  257. package/dist/post-components/p-cb5af9d8.entry.js +0 -1
  258. package/dist/post-components/p-ea9ae6b7.entry.js +0 -1
  259. package/loader/cdn.js +0 -1
  260. package/loader/index.cjs.js +0 -1
  261. package/loader/index.es2017.js +0 -1
  262. /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
  263. /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
  264. /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
  265. /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
  266. /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
  267. /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
  268. /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
  269. /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
  270. /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
@@ -9,7 +9,7 @@
9
9
  * @returns true if the event should be processed, false otherwise
10
10
  */
11
11
  function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
12
- if (!(event instanceof CustomEvent && event.target instanceof HTMLElement))
12
+ if (!(event instanceof Event && event.target instanceof HTMLElement))
13
13
  return false;
14
14
  const eventTarget = event.target;
15
15
  if (eventTarget.localName !== tag)
@@ -40,7 +40,7 @@ function EventFrom(tag, option = { ignoreNestedComponents: true }) {
40
40
  };
41
41
  }
42
42
  else {
43
- // Creates a hidden storage property for the original method using a
43
+ // Creates a hidden storage property for the original method using a
44
44
  // modified key format (__[property]_original) to avoid naming conflicts
45
45
  const privateKey = `__${propertyKey}_original`;
46
46
  // Create hidden storage for original method
@@ -114,14 +114,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
114
114
  }
115
115
  switch(bundleId) {
116
116
 
117
- case 'post-avatar.cjs':
118
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
119
- /* webpackMode: "lazy" */
120
- './post-avatar.cjs.entry.js')); }).then(processMod, consoleError);
121
- case 'post-back-to-top.cjs':
122
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
123
- /* webpackMode: "lazy" */
124
- './post-back-to-top.cjs.entry.js')); }).then(processMod, consoleError);
125
117
  case 'post-card-control.cjs':
126
118
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
127
119
  /* webpackMode: "lazy" */
@@ -150,6 +142,14 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
150
142
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
151
143
  /* webpackMode: "lazy" */
152
144
  './post-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
145
+ case 'post-avatar.cjs':
146
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
147
+ /* webpackMode: "lazy" */
148
+ './post-avatar.cjs.entry.js')); }).then(processMod, consoleError);
149
+ case 'post-back-to-top.cjs':
150
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
151
+ /* webpackMode: "lazy" */
152
+ './post-back-to-top.cjs.entry.js')); }).then(processMod, consoleError);
153
153
  case 'post-banner.cjs':
154
154
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
155
155
  /* webpackMode: "lazy" */
@@ -5,7 +5,7 @@ var index = require('./index-CpDyH7Ww.js');
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await index.globalScripts();
8
- return index.bootstrapLazy([["post-breadcrumbs.cjs",[[1,"post-breadcrumbs",{"homeUrl":[1,"home-url"],"homeText":[1,"home-text"],"breadcrumbItems":[32],"isConcatenated":[32],"lastWindowWidth":[32]},null,{"homeUrl":["validateHomeUrl"],"homeText":["validateHomeText"]}]]],["post-footer.cjs",[[1,"post-footer",{"label":[1],"device":[32],"gridSlotDisplayed":[32]},null,{"label":["validateLabel"]}]]],["post-back-to-top.cjs",[[1,"post-back-to-top",{"label":[513],"belowFold":[32]},null,{"label":["validateLabel"],"belowFold":["watchBelowFold"]}]]],["post-card-control.cjs",[[65,"post-card-control",{"label":[513],"description":[1],"type":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[1028],"validity":[1028],"icon":[1],"focused":[32],"reset":[64],"groupReset":[64]},null,{"label":["validateControlLabel"],"description":["validateControlDescription"],"type":["validateControlType"],"name":["validateControlName"],"value":["validateControlValue"],"icon":["validateControlIcon"],"checked":["updateControlChecked"],"disabled":["updateControlDisabled"]}]]],["post-popover.cjs",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"closeButtonCaption":["validateCloseButtonCaption"]}]]],["post-rating.cjs",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]},null,{"label":["validateLabel"],"stars":["validateStars"],"currentRating":["validateCurrentRating"]}]]],["post-tooltip.cjs",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"animation":[1],"open":[1540],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"]}]]],["post-avatar.cjs",[[1,"post-avatar",{"firstname":[513],"lastname":[1],"userid":[1],"email":[1],"slottedImage":[32],"avatarType":[32],"imageUrl":[32],"imageAlt":[32],"initials":[32]},null,{"firstname":["validateFirstname"],"lastname":["validateLastname"],"userid":["validateUserid"],"email":["validateEmail"]}]]],["post-banner.cjs",[[1,"post-banner",{"dismissible":[4],"dismissLabel":[1,"dismiss-label"],"type":[1],"bannerId":[32],"classes":[32],"hasActions":[32],"hasHeading":[32],"onDismissButtonClick":[32],"dismiss":[64]},null,{"dismissible":["checkDismissible"],"type":["validateType"]}]]],["post-linkarea.cjs",[[1,"post-linkarea"]]],["post-tab-header.cjs",[[1,"post-tab-header",{"panel":[513],"tabId":[32]},null,{"panel":["validateFor"]}]]],["post-tab-panel.cjs",[[1,"post-tab-panel",{"name":[513],"panelId":[32]},null,{"name":["validateName"]}]]],["post-tabs.cjs",[[1,"post-tabs",{"activePanel":[1,"active-panel"],"fullWidth":[516,"full-width"],"show":[64]}]]],["post-tooltip-trigger.cjs",[[1,"post-tooltip-trigger",{"for":[513],"delay":[2]},null,{"for":["validateControlFor"]}]]],["post-collapsible_2.cjs",[[1,"post-collapsible",{"collapsed":[1028],"toggle":[64]},null,{"collapsed":["collapsedChange"]}],[1,"post-collapsible-trigger",{"for":[513],"update":[64]},null,{"for":["validateAriaAttributes"]}]]],["post-closebutton_15.cjs",[[1,"post-language-switch",{"caption":[1],"description":[1],"variant":[1],"activeLang":[32]},[[0,"postChange","handlePostChange"],[0,"postLanguageOptionInitiallyActive","handleInitiallyActive"]],{"caption":["validateCaption"],"description":["validateDescription"],"variant":["validateVariant"]}],[1,"post-closebutton"],[4,"post-mainnavigation",{"canScrollLeft":[32],"canScrollRight":[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]],[1,"post-header",{"device":[32],"hasNavigation":[32],"mobileMenuExtended":[32],"megadropdownOpen":[32],"toggleMobileMenu":[64]},null,{"device":["lockBody"],"mobileMenuExtended":["lockBody"]}],[4,"post-language-option",{"code":[1],"active":[1540],"variant":[1],"name":[1],"url":[1],"select":[64]},null,{"code":["validateCode"],"variant":["validateVariant"],"name":["validateName"],"url":["validateUrl"]}],[4,"post-list",{"titleHidden":[4,"title-hidden"],"horizontal":[516],"titleId":[32]}],[1,"post-list-item"],[1,"post-logo",{"url":[1]},null,{"url":["validateUrl"]}],[4,"post-megadropdown",{"device":[32],"isVisible":[32],"animationClass":[32],"toggle":[64],"show":[64],"hide":[64],"focusFirst":[64]}],[4,"post-megadropdown-trigger",{"for":[1],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[1,"post-togglebutton",{"toggled":[1028]}],[1,"post-menu",{"placement":[1],"isVisible":[32],"toggle":[64],"show":[64],"hide":[64]},null,{"placement":["validatePlacement"]}],[4,"post-menu-trigger",{"for":[513],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[4,"post-popovercontainer",{"placement":[1],"edgeGap":[2,"edge-gap"],"animation":[1],"arrow":[4],"manualClose":[4,"manual-close"],"safeSpace":[513,"safe-space"],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"edgeGap":["validateEdgeGap"],"safeSpace":["validateSafeSpace"]}],[1,"post-icon",{"animation":[1],"base":[1],"flipH":[4,"flip-h"],"flipV":[4,"flip-v"],"name":[513],"rotate":[2],"scale":[2]},null,{"animation":["validateAnimation"],"base":["validateBase"],"name":["validateName"],"rotate":["validateRotate"],"scale":["validateScale"]}]]],["post-accordion_2.cjs",[[1,"post-accordion-item",{"collapsed":[1028],"headingLevel":[2,"heading-level"],"id":[32],"slottedLogo":[32],"toggle":[64]},[[2,"postToggle","onCollapseToggle"]],{"headingLevel":["validateHeadingLevel"]}],[1,"post-accordion",{"headingLevel":[2,"heading-level"],"multiple":[4],"toggle":[64],"expandAll":[64],"collapseAll":[64]},[[0,"postToggle","collapseToggleHandler"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-breadcrumb-item_2.cjs",[[1,"post-breadcrumb-item",{"url":[1],"fullUrl":[32]},null,{"url":["validateUrl"]}],[4,"post-menu-item"]]]], options);
8
+ return index.bootstrapLazy([["post-breadcrumbs.cjs",[[1,"post-breadcrumbs",{"homeUrl":[1,"home-url"],"homeText":[1,"home-text"],"breadcrumbItems":[32],"isConcatenated":[32],"lastWindowWidth":[32]},null,{"homeUrl":["validateHomeUrl"],"homeText":["validateHomeText"]}]]],["post-footer.cjs",[[1,"post-footer",{"label":[1],"device":[32],"gridSlotDisplayed":[32]},null,{"label":["validateLabel"]}]]],["post-back-to-top.cjs",[[1,"post-back-to-top",{"label":[513],"belowFold":[32]},null,{"label":["validateLabel"],"belowFold":["watchBelowFold"]}]]],["post-card-control.cjs",[[65,"post-card-control",{"label":[513],"description":[1],"type":[1],"name":[1],"value":[1],"checked":[1028],"disabled":[1028],"validity":[1028],"icon":[1],"focused":[32],"reset":[64],"groupReset":[64]},null,{"label":["validateControlLabel"],"description":["validateControlDescription"],"type":["validateControlType"],"name":["validateControlName"],"value":["validateControlValue"],"icon":["validateControlIcon"],"checked":["updateControlChecked"],"disabled":["updateControlDisabled"]}]]],["post-popover.cjs",[[1,"post-popover",{"placement":[1],"closeButtonCaption":[1,"close-button-caption"],"arrow":[4],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"closeButtonCaption":["validateCloseButtonCaption"]}]]],["post-rating.cjs",[[1,"post-rating",{"label":[1],"stars":[2],"currentRating":[1026,"current-rating"],"readonly":[4],"hoveredIndex":[32]},null,{"label":["validateLabel"],"stars":["validateStars"],"currentRating":["validateCurrentRating"]}]]],["post-tooltip.cjs",[[1,"post-tooltip",{"placement":[1],"arrow":[4],"animation":[1],"open":[1540],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"]}]]],["post-avatar.cjs",[[1,"post-avatar",{"firstname":[513],"lastname":[1],"userid":[1],"email":[1],"slottedImage":[32],"avatarType":[32],"imageUrl":[32],"imageAlt":[32],"initials":[32],"storageKey":[32]},null,{"firstname":["validateFirstname"],"lastname":["validateLastname"],"userid":["updateUserid"],"email":["updateEmail"]}]]],["post-banner.cjs",[[1,"post-banner",{"type":[513],"hasActions":[32],"dismiss":[64]},[[0,"click","onCloseButtonClick"]],{"type":["validateType"]}]]],["post-linkarea.cjs",[[1,"post-linkarea"]]],["post-tab-header.cjs",[[1,"post-tab-header",{"panel":[513],"tabId":[32]},null,{"panel":["validateFor"]}]]],["post-tab-panel.cjs",[[1,"post-tab-panel",{"name":[513],"panelId":[32]},null,{"name":["validateName"]}]]],["post-tabs.cjs",[[1,"post-tabs",{"activePanel":[1,"active-panel"],"fullWidth":[516,"full-width"],"show":[64]}]]],["post-tooltip-trigger.cjs",[[1,"post-tooltip-trigger",{"for":[513],"delay":[2]},null,{"for":["validateControlFor"]}]]],["post-collapsible_2.cjs",[[1,"post-collapsible",{"collapsed":[1028],"toggle":[64]},null,{"collapsed":["collapsedChange"]}],[1,"post-collapsible-trigger",{"for":[513],"update":[64]},null,{"for":["validateAriaAttributes"]}]]],["post-closebutton_15.cjs",[[1,"post-language-switch",{"caption":[1],"description":[1],"variant":[1],"activeLang":[32]},[[0,"postChange","handlePostChange"],[0,"postLanguageOptionInitiallyActive","handleInitiallyActive"]],{"caption":["validateCaption"],"description":["validateDescription"],"variant":["validateVariant"]}],[1,"post-closebutton"],[4,"post-mainnavigation",{"canScrollLeft":[32],"canScrollRight":[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]],[1,"post-header",{"device":[32],"hasNavigation":[32],"mobileMenuExtended":[32],"megadropdownOpen":[32],"toggleMobileMenu":[64]},null,{"device":["lockBody"],"mobileMenuExtended":["lockBody"]}],[4,"post-language-option",{"code":[1],"active":[1540],"variant":[1],"name":[1],"url":[1],"select":[64]},null,{"code":["validateCode"],"variant":["validateVariant"],"name":["validateName"],"url":["validateUrl"]}],[4,"post-list",{"titleHidden":[4,"title-hidden"],"horizontal":[516],"titleId":[32]}],[1,"post-list-item"],[1,"post-logo",{"url":[1]},null,{"url":["validateUrl"]}],[4,"post-megadropdown",{"device":[32],"isVisible":[32],"animationClass":[32],"toggle":[64],"show":[64],"hide":[64],"focusFirst":[64]}],[4,"post-megadropdown-trigger",{"for":[1],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[1,"post-togglebutton",{"toggled":[1028]}],[1,"post-menu",{"placement":[1],"isVisible":[32],"toggle":[64],"show":[64],"hide":[64]},null,{"placement":["validatePlacement"]}],[4,"post-menu-trigger",{"for":[513],"ariaExpanded":[32]},null,{"for":["validateControlFor"]}],[4,"post-popovercontainer",{"placement":[1],"edgeGap":[2,"edge-gap"],"animation":[1],"arrow":[4],"manualClose":[4,"manual-close"],"safeSpace":[513,"safe-space"],"show":[64],"hide":[64],"toggle":[64]},null,{"placement":["validatePlacement"],"edgeGap":["validateEdgeGap"],"safeSpace":["validateSafeSpace"]}],[1,"post-icon",{"animation":[1],"base":[1],"flipH":[4,"flip-h"],"flipV":[4,"flip-v"],"name":[513],"rotate":[2],"scale":[2]},null,{"animation":["validateAnimation"],"base":["validateBase"],"name":["validateName"],"rotate":["validateRotate"],"scale":["validateScale"]}]]],["post-accordion_2.cjs",[[1,"post-accordion-item",{"collapsed":[1028],"headingLevel":[2,"heading-level"],"id":[32],"slottedLogo":[32],"toggle":[64]},[[2,"postToggle","onCollapseToggle"]],{"headingLevel":["validateHeadingLevel"]}],[1,"post-accordion",{"headingLevel":[2,"heading-level"],"multiple":[4],"toggle":[64],"expandAll":[64],"collapseAll":[64]},[[0,"postToggle","collapseToggleHandler"]],{"headingLevel":["validateHeadingLevel"]}]]],["post-breadcrumb-item_2.cjs",[[1,"post-breadcrumb-item",{"url":[1],"fullUrl":[32]},null,{"url":["validateUrl"]}],[4,"post-menu-item"]]]], options);
9
9
  };
10
10
 
11
11
  exports.setNonce = index.setNonce;
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "10.0.0-next.46";
3
+ const version = "10.0.0-next.48";
4
4
 
5
5
  exports.version = version;
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-CpDyH7Ww.js');
4
- var _package = require('./package-Din0le0Q.js');
4
+ var _package = require('./package-CZyXYkIN.js');
5
5
  var index$1 = require('./index-DtvYdwe1.js');
6
6
  require('./breakpoints-DmZ_BQGo.js');
7
- var eventFrom = require('./event-from-AKK8RQrn.js');
7
+ var eventFrom = require('./event-from-C6kpQwhw.js');
8
8
  var index_browser = require('./index.browser-Doj636JV.js');
9
9
 
10
10
  const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
@@ -164,10 +164,10 @@ const PostAccordionItem = class {
164
164
  render() {
165
165
  const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
166
166
  const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
167
- return (index.h(index.Host, { key: 'd7176f314fa0f907bd5b69555a2f25561f3875cf', id: this.id, "data-version": _package.version }, index.h("div", { key: '978c451798e5bafe38ef57be29818f02ccf49dab', part: "accordion-item", class: "accordion-item" }, index.h("post-collapsible-trigger", { key: '615da8a2ad5fb3c3fd1e5e0c2c8ee9a260a34263', for: `${this.id}--collapse` }, index.h(HeadingTag, { key: '9c270ded36f1e1b1b466ba8c4ca529ab26368d5c', class: "accordion-header", id: `${this.id}--header` }, index.h("button", { key: 'ddf278d1ccf6d78932ae4c6a9617d5852fb73064', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, index.h("span", { key: '3989145bdbe0a313c6ed10220d2089c89688d613', class: {
167
+ return (index.h(index.Host, { key: 'b98847d19894430b6f65130aebf8673a45afd1e6', id: this.id, "data-version": _package.version }, index.h("div", { key: 'f26f9d3a4a1f59db23b4698b321e28e112c3eed0', part: "accordion-item", class: "accordion-item" }, index.h("post-collapsible-trigger", { key: '14bdacce04d67a03655f600feeaeec065e0fc198', for: `${this.id}--collapse` }, index.h(HeadingTag, { key: '7a07a70d172306ce37f8bd0143b21ed7ec0cab8a', class: "accordion-header", id: `${this.id}--header` }, index.h("button", { key: '5ad0698a62df5c4b2c0a77ff622090b20f348e9c', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, index.h("span", { key: '6e5fcb0c9efa8a57e05fd162c72b9c170a8210c6', class: {
168
168
  'logo-container': true,
169
169
  'has-image': !!this.slottedLogo,
170
- } }, index.h("slot", { key: 'dd053bf73234db3bac772bf730003b4f2cc030cb', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), index.h("slot", { key: '9ac06513d55828a9d7a3552aa66c9946fde7c793', name: "header" }), index.h("post-icon", { key: 'fb46c528581e1a149706fd9e124857cc288747f8', name: "2051" })))), index.h("post-collapsible", { key: '996887d6a0098a37dbac8d5edb950900f57d15f7', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, index.h("div", { key: '21fa64a007cf0da4e0c0cf56f5862641d016517a', class: "accordion-body", part: "body" }, index.h("slot", { key: '2a9f7731183e35c37523e079d437612dbda1a01b' }))))));
170
+ } }, index.h("slot", { key: '41a1409f723bf52de893324ce45d4e7f31eb8908', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), index.h("slot", { key: '7186adfe4a4fe67f4dbaeb7569820d0d06c18428', name: "header" }), index.h("post-icon", { key: 'fbfcbdc9947a8c7cf80d861aba3a77be0dff91d1', name: "2051" })))), index.h("post-collapsible", { key: '5de19aab5eb0134b7c3e7f43e5c2da0cb8413908', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, index.h("div", { key: '5112ba8604ea177af4d88033f682c2a4cc6c4ffd', class: "accordion-body", part: "body" }, index.h("slot", { key: 'd70ab76842fced3f7dec812471685071e377bc61' }))))));
171
171
  }
172
172
  get host() { return index.getElement(this); }
173
173
  static get watchers() { return {
@@ -1,17 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-CpDyH7Ww.js');
4
- var _package = require('./package-Din0le0Q.js');
4
+ var _package = require('./package-CZyXYkIN.js');
5
5
  var index$1 = require('./index-DtvYdwe1.js');
6
6
  require('./breakpoints-DmZ_BQGo.js');
7
7
 
8
- const postAvatarCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
9
-
10
8
  // https://docs.gravatar.com/api/avatars/images/
11
9
  const GRAVATAR_DEFAULT = '404';
12
10
  const GRAVATAR_RATING = 'g';
13
11
  const GRAVATAR_SIZE = 80;
14
12
  const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
13
+
14
+ const postAvatarCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
15
+
15
16
  const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
16
17
  var AvatarType;
17
18
  (function (AvatarType) {
@@ -27,6 +28,8 @@ const PostAvatar = class {
27
28
  this.imageUrl = '';
28
29
  this.imageAlt = '';
29
30
  this.initials = '';
31
+ // To handle email or userid updates and reset the storage item
32
+ this.storageKey = '';
30
33
  }
31
34
  validateFirstname() {
32
35
  index$1.checkRequiredAndType(this, 'firstname', 'string');
@@ -34,47 +37,67 @@ const PostAvatar = class {
34
37
  validateLastname() {
35
38
  index$1.checkEmptyOrType(this, 'lastname', 'string');
36
39
  }
37
- validateUserid() {
40
+ updateUserid() {
41
+ this.validateUserId();
42
+ this.getAvatarImage();
43
+ }
44
+ updateEmail() {
45
+ this.validateEmail();
46
+ this.getAvatarImage();
47
+ }
48
+ validateUserId() {
38
49
  index$1.checkEmptyOrType(this, 'userid', 'string');
39
50
  }
40
51
  validateEmail() {
41
52
  if (this.email)
42
53
  index$1.checkEmptyOrPattern(this, 'email', emailPattern);
43
54
  }
44
- async getAvatar() {
45
- if (this.slottedImage !== null) {
46
- this.avatarType = AvatarType.Slotted;
47
- }
48
- else {
49
- let imageLoaded = false;
50
- if (!imageLoaded && this.userid)
55
+ async getAvatarImage() {
56
+ let imageLoaded = false;
57
+ this.slottedImage = this.host.querySelector('img');
58
+ const imageUrl = this.slottedImage?.getAttribute('src');
59
+ if (!imageUrl) {
60
+ if (this.userid) {
51
61
  imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
52
- if (!imageLoaded && this.email)
62
+ }
63
+ if (!imageLoaded && this.email?.match(emailPattern)) {
53
64
  imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
54
- if (!imageLoaded)
55
- this.getAvatarByInitials();
65
+ }
66
+ if (!imageLoaded) {
67
+ this.getAvatarInitials();
68
+ }
69
+ }
70
+ else {
71
+ const slottedImageLoaded = await this.getImageByProp(imageUrl, this.fetchSlottedImage.bind(this));
72
+ if (!slottedImageLoaded) {
73
+ this.slottedImage.style.display = 'none';
74
+ this.getAvatarInitials();
75
+ }
76
+ else {
77
+ this.slottedImage.style.display = 'block';
78
+ }
56
79
  }
57
80
  }
58
81
  async getImageByProp(prop, fetchImage) {
59
82
  if (!prop)
60
83
  return false;
61
- const imageResponse = (await this.getStorageItem(prop)) ?? { ok: false, url: '' };
62
- if (!imageResponse.ok) {
63
- try {
64
- const r = await fetchImage();
65
- imageResponse.ok = r.ok;
66
- imageResponse.url = r.url;
67
- this.imageUrl = imageResponse.url;
68
- this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
69
- this.avatarType = AvatarType.Image;
70
- this.setStorageItem(this.userid, JSON.stringify(imageResponse));
71
- }
72
- catch (error) {
73
- this.removeStorageItem(prop);
74
- console.info(`Loading avatar by type "${AvatarType.Image}" failed.`);
75
- }
84
+ let imageResponse;
85
+ try {
86
+ imageResponse = await fetchImage(prop);
87
+ }
88
+ catch (error) {
89
+ console.info('Loading avatar image failed.', error);
90
+ return false;
91
+ }
92
+ if (!imageResponse?.ok) {
93
+ return false;
94
+ }
95
+ else {
96
+ this.imageUrl = imageResponse.url;
97
+ this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
98
+ this.avatarType = AvatarType.Image;
99
+ return true;
76
100
  }
77
- return imageResponse.ok;
78
101
  }
79
102
  async fetchImageByUserId() {
80
103
  return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
@@ -84,7 +107,10 @@ const PostAvatar = class {
84
107
  const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
85
108
  return await fetch(imageUrl);
86
109
  }
87
- getAvatarByInitials() {
110
+ async fetchSlottedImage(imageUrl) {
111
+ return await fetch(imageUrl, { method: 'HEAD' });
112
+ }
113
+ getAvatarInitials() {
88
114
  this.initials = this.getInitials();
89
115
  this.avatarType = AvatarType.Initials;
90
116
  }
@@ -97,19 +123,6 @@ const PostAvatar = class {
97
123
  .join('')
98
124
  .trim();
99
125
  }
100
- async getStorageItem(keyToken) {
101
- const key = await this.cryptify(keyToken);
102
- const value = window?.sessionStorage?.getItem(key);
103
- return value ? JSON.parse(value) : null;
104
- }
105
- async setStorageItem(keyToken, value) {
106
- const key = await this.cryptify(keyToken);
107
- window?.sessionStorage?.setItem(key, value);
108
- }
109
- async removeStorageItem(keyToken) {
110
- const key = await this.cryptify(keyToken);
111
- window?.sessionStorage?.removeItem(key);
112
- }
113
126
  async cryptify(key) {
114
127
  return await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)).then(buffer => {
115
128
  return Array.from(new Uint8Array(buffer))
@@ -117,18 +130,42 @@ const PostAvatar = class {
117
130
  .join('');
118
131
  });
119
132
  }
120
- onSlotDefaultChange() {
121
- this.slottedImage = this.host.querySelector('img');
122
- this.getAvatar();
133
+ slotChanged() {
134
+ const slot = this.host.shadowRoot.querySelector('slot');
135
+ const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
136
+ assignedNodes.forEach(node => {
137
+ if (node.nodeType === Node.ELEMENT_NODE) {
138
+ const el = node;
139
+ if (el.tagName === 'IMG') {
140
+ this.observeImageSrcChanges(el);
141
+ }
142
+ }
143
+ });
144
+ this.getAvatarImage();
123
145
  }
124
- componentWillRender() {
125
- this.slottedImage = this.host.querySelector('img');
126
- this.getAvatar();
146
+ // Observe the Slotted image src attribute and update the image
147
+ observeImageSrcChanges(img) {
148
+ if (this.slottedImageObserver) {
149
+ this.slottedImageObserver.disconnect();
150
+ }
151
+ this.slottedImageObserver = new MutationObserver(mutations => {
152
+ mutations.forEach(mutation => {
153
+ if (mutation.type === 'attributes' && mutation.attributeName === 'src') {
154
+ this.getAvatarImage();
155
+ }
156
+ });
157
+ });
158
+ this.slottedImageObserver.observe(img, { attributes: true, attributeFilter: ['src'] });
159
+ }
160
+ connectedCallback() {
161
+ //This provides a fallback by showing the initials while the image is still loading or delayed.
162
+ this.getAvatarInitials();
163
+ this.getAvatarImage();
127
164
  }
128
165
  componentDidLoad() {
129
166
  this.validateFirstname();
130
167
  this.validateLastname();
131
- this.validateUserid();
168
+ this.validateUserId();
132
169
  this.validateEmail();
133
170
  }
134
171
  render() {
@@ -140,14 +177,14 @@ const PostAvatar = class {
140
177
  // eslint-disable-next-line @stencil-community/render-returns-host
141
178
  return acc;
142
179
  }, []);
143
- return (index.h(index.Host, { "data-version": _package.version }, index.h("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && index.h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && index.h("div", { class: "initials" }, initials))));
180
+ return (index.h(index.Host, { "data-version": _package.version }, index.h("span", { class: this.avatarType === 'slotted' ? '' : 'd-none' }, index.h("slot", { onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && index.h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && index.h("div", { class: "initials" }, initials)));
144
181
  }
145
182
  get host() { return index.getElement(this); }
146
183
  static get watchers() { return {
147
184
  "firstname": ["validateFirstname"],
148
185
  "lastname": ["validateLastname"],
149
- "userid": ["validateUserid"],
150
- "email": ["validateEmail"]
186
+ "userid": ["updateUserid"],
187
+ "email": ["updateEmail"]
151
188
  }; }
152
189
  };
153
190
  PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
@@ -1,12 +1,37 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-CpDyH7Ww.js');
4
- var slide = require('./slide-CbBL7A8w.js');
5
- var _package = require('./package-Din0le0Q.js');
4
+ var _package = require('./package-CZyXYkIN.js');
6
5
  var index$1 = require('./index-DtvYdwe1.js');
7
6
  require('./breakpoints-DmZ_BQGo.js');
8
7
 
9
- const postBackToTopCss = ":host{--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
8
+ // Define common animation options
9
+ const easing = 'ease';
10
+ const defaultDuration = 500;
11
+ const fill = 'forwards';
12
+ function createSlideFadeAnimation(el, keyframes, duration = defaultDuration) {
13
+ return el.animate(keyframes, {
14
+ duration: duration,
15
+ easing,
16
+ fill,
17
+ });
18
+ }
19
+ function slideUpAndFadeOut(el, translateY = '-100%', duration = defaultDuration) {
20
+ const keyframes = [
21
+ { transform: 'translateY(0)', opacity: '1' },
22
+ { transform: `translateY(${translateY})`, opacity: '0' },
23
+ ];
24
+ return createSlideFadeAnimation(el, keyframes, duration);
25
+ }
26
+ function slideDownAndFadeIn(el, translateY = '-100%', duration = defaultDuration) {
27
+ const keyframes = [
28
+ { transform: `translateY(${translateY})`, opacity: '0' },
29
+ { transform: 'translateY(0)', opacity: '1' },
30
+ ];
31
+ return createSlideFadeAnimation(el, keyframes, duration);
32
+ }
33
+
34
+ const postBackToTopCss = ":host{opacity:0;--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
10
35
 
11
36
  const PostBackToTop = class {
12
37
  constructor(hostRef) {
@@ -25,10 +50,10 @@ const PostBackToTop = class {
25
50
  /*Watch for changes in belowFold to show/hide the back to top button*/
26
51
  watchBelowFold(newValue) {
27
52
  if (newValue) {
28
- slide.slideDown(this.host, this.translateY);
53
+ slideDownAndFadeIn(this.host, this.translateY);
29
54
  }
30
55
  else {
31
- slide.slideUp(this.host, this.translateY);
56
+ slideUpAndFadeOut(this.host, this.translateY);
32
57
  }
33
58
  }
34
59
  scrollToTop() {
@@ -59,7 +84,7 @@ const PostBackToTop = class {
59
84
  parseFloat(positionTop.replace('px', '')) -
60
85
  parseFloat(elevationHeight.replace('px', ''))) + 'px';
61
86
  if (this.belowFold) {
62
- slide.slideDown(this.host, this.translateY);
87
+ slideDownAndFadeIn(this.host, this.translateY);
63
88
  }
64
89
  if (!this.belowFold) {
65
90
  this.host.style.transform = `translateY(${this.translateY})`;
@@ -78,7 +103,7 @@ const PostBackToTop = class {
78
103
  window.removeEventListener('scroll', this.handleScroll);
79
104
  }
80
105
  render() {
81
- return (index.h(index.Host, { key: '7edc6db9d849cf9ce0308a2ac5b2c2f9bc4e47a9', "data-version": _package.version }, index.h("button", { key: '610e81756ce3dd927f55d48beb8cd829b66fc247', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, index.h("post-icon", { key: 'bb1f3cc462de7680361f4cfd04abb1816aebd488', "aria-hidden": "true", name: "3026" }), index.h("span", { key: '4fbd84d78c425140adea5833450cef60af967f5a', class: "visually-hidden" }, this.label))));
106
+ return (index.h(index.Host, { key: '820244e9c039304895d78887000ed986707bf3b1', "data-version": _package.version }, index.h("button", { key: 'c1d38883fbf31c50b2b00e08e6b22cbc6be37adb', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, index.h("post-icon", { key: '3cc57c355a12bf500f368e906d147be10f9014e7', "aria-hidden": "true", name: "3026" }), index.h("span", { key: '134e5c579e2d99d64c25ce21ab538e51520a6dd6', class: "visually-hidden" }, this.label))));
82
107
  }
83
108
  get host() { return index.getElement(this); }
84
109
  static get watchers() { return {