@microsoft/sp-adaptive-card-extension-base 1.23.2 → 1.24.0-beta.2

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 (514) hide show
  1. package/dist/eeec822e-c28a-46b4-affc-7058e4c1aa80.manifest.json +137 -142
  2. package/dist/index-internal-beta.d.ts +2 -6
  3. package/dist/index-internal-public.d.ts +2 -6
  4. package/dist/index-internal.d.ts +193 -28
  5. package/dist/index.d.ts +2 -2
  6. package/dist/sp-adaptive-card-extension-base_default_be5d2a76104ab20a7df3.js +1 -0
  7. package/dist/sp-adaptive-card-extension-base_en-us_daf5e5154e82492eea26.js +1 -0
  8. package/dist/sp-adaptive-card-extension-base_qps-ploc_3f63afdd6f59d8592622.js +1 -0
  9. package/dist/sp-adaptive-card-extension-base_qps-ploca_0bc9525a6a1a759b7d4f.js +1 -0
  10. package/dist/tsdoc-metadata.json +1 -1
  11. package/lib-commonjs/AdaptiveCardExtensionContext.js +66 -99
  12. package/lib-commonjs/AdaptiveCardExtensionHost.js +52 -60
  13. package/lib-commonjs/AdaptiveCardExtensionLoader.js +90 -97
  14. package/lib-commonjs/BaseAdaptiveCardExtension.js +941 -1138
  15. package/lib-commonjs/ac-template/basicL1Template.js +19 -14
  16. package/lib-commonjs/ac-template/basicL1TemplateSelectAction.js +19 -14
  17. package/lib-commonjs/ac-template/common/Constants.js +13 -5
  18. package/lib-commonjs/ac-template/common/CustomElements.js +63 -51
  19. package/lib-commonjs/ac-template/imageL1Template.js +19 -14
  20. package/lib-commonjs/ac-template/imageL1TemplateSelectAction.js +19 -14
  21. package/lib-commonjs/ac-template/index.js +37 -15
  22. package/lib-commonjs/ac-template/primaryTextL1Template.js +22 -15
  23. package/lib-commonjs/ac-template/primaryTextL1TemplateSelectAction.js +22 -15
  24. package/lib-commonjs/ac-template/searchL1Template.js +21 -20
  25. package/lib-commonjs/ac-template/textInputL1Template.js +38 -39
  26. package/lib-commonjs/ac-template/util/actionButtonHelper.js +76 -78
  27. package/lib-commonjs/ac-template/util/getCardRenderParameters.js +109 -119
  28. package/lib-commonjs/actionShim/AdaptiveCardExtensionActionShim.js +86 -100
  29. package/lib-commonjs/actionShim/IActionShimProvider.js +5 -2
  30. package/lib-commonjs/actionShim/getOnBeforeActionArguments.js +30 -29
  31. package/lib-commonjs/caching/CacheManager.js +40 -35
  32. package/lib-commonjs/caching/IAdaptiveCardExtensionCacheObject.js +5 -2
  33. package/lib-commonjs/caching/ICacheSettings.js +5 -2
  34. package/lib-commonjs/caching/ICachedLoadParameters.js +11 -4
  35. package/lib-commonjs/caching/cache/ACEMySiteCacheManager.js +88 -90
  36. package/lib-commonjs/caching/cache/BaseAdaptiveCardExtensionCache.js +21 -24
  37. package/lib-commonjs/caching/cache/IAdaptiveCardExtensionCache.js +5 -2
  38. package/lib-commonjs/caching/cache/LocalStorageACECache.js +56 -64
  39. package/lib-commonjs/common/Flights.js +27 -16
  40. package/lib-commonjs/common/Killswitches.js +143 -150
  41. package/lib-commonjs/components/BarChartComponent.js +68 -72
  42. package/lib-commonjs/components/BaseComponent.js +15 -15
  43. package/lib-commonjs/components/CardBarComponent.js +15 -9
  44. package/lib-commonjs/components/CardButtonComponent.js +26 -23
  45. package/lib-commonjs/components/DataVisualizationComponent.js +30 -19
  46. package/lib-commonjs/components/ICardButtonBase.js +5 -2
  47. package/lib-commonjs/components/LineChartComponent.js +28 -22
  48. package/lib-commonjs/components/PieChartComponent.js +69 -44
  49. package/lib-commonjs/components/PoweredByComponent.js +15 -9
  50. package/lib-commonjs/components/PromptsSetComponent.js +15 -9
  51. package/lib-commonjs/components/SearchBoxComponent.js +15 -9
  52. package/lib-commonjs/components/SearchFooterComponent.js +15 -6
  53. package/lib-commonjs/components/TextComponent.js +15 -9
  54. package/lib-commonjs/components/TextInputComponent.js +15 -9
  55. package/lib-commonjs/index.js +201 -91
  56. package/lib-commonjs/interfaces/CardActionType.js +5 -2
  57. package/lib-commonjs/interfaces/IActionArguments.js +5 -2
  58. package/lib-commonjs/interfaces/IAdaptiveCardExtension.js +5 -2
  59. package/lib-commonjs/interfaces/IAdaptiveCardExtensionData.js +5 -2
  60. package/lib-commonjs/interfaces/IAdaptiveCardExtensionImage.js +12 -3
  61. package/lib-commonjs/interfaces/IAdaptiveCardExtensionLoadContext.js +5 -2
  62. package/lib-commonjs/interfaces/IAdaptiveCardExtensionPropertiesMetadata.js +5 -2
  63. package/lib-commonjs/interfaces/IAdaptiveCardRenderParameters.js +5 -2
  64. package/lib-commonjs/interfaces/IBaseCardParameters.js +10 -3
  65. package/lib-commonjs/interfaces/ICardButton.js +5 -2
  66. package/lib-commonjs/interfaces/ICardRenderParameters.js +5 -2
  67. package/lib-commonjs/interfaces/IFocusParameters.js +6 -4
  68. package/lib-commonjs/interfaces/IGetLocationActionTypes.js +5 -2
  69. package/lib-commonjs/interfaces/IHostContext.js +13 -3
  70. package/lib-commonjs/interfaces/ILocation.js +6 -4
  71. package/lib-commonjs/interfaces/INotificationTypes.js +5 -2
  72. package/lib-commonjs/interfaces/IOnBeforeActionArguments.js +5 -2
  73. package/lib-commonjs/interfaces/IQuickViewRenderParameters.js +5 -2
  74. package/lib-commonjs/interfaces/ISPFxAdaptiveCard.js +5 -2
  75. package/lib-commonjs/interfaces/ISelectMediaActionTypes.js +13 -10
  76. package/lib-commonjs/interfaces/ISelectionActionTemplateAdaptiveCard.js +5 -2
  77. package/lib-commonjs/interfaces/IShowLocationActionTypes.js +5 -2
  78. package/lib-commonjs/interfaces/InternalTypes.js +9 -3
  79. package/lib-commonjs/isolation/IsolatedAdaptiveCardExtensionService.js +396 -399
  80. package/lib-commonjs/isolation/RenderArgumentsUtils.js +99 -86
  81. package/lib-commonjs/isolation/interfaces/IBot.js +6 -4
  82. package/lib-commonjs/isolation/interfaces/IIsolatedAction.js +5 -2
  83. package/lib-commonjs/isolation/interfaces/IIsolatedListener.js +5 -2
  84. package/lib-commonjs/isolation/interfaces/IIsolatedServiceCallbackParameters.js +5 -2
  85. package/lib-commonjs/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.js +5 -2
  86. package/lib-commonjs/isolation/interfaces/IRenderIsolatedQuickViewParameters.js +13 -3
  87. package/lib-commonjs/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.js +5 -2
  88. package/lib-commonjs/isolation/interfaces/IsolatedServiceMessageEvent.js +5 -2
  89. package/lib-commonjs/test-api/AdaptiveCardExtensionTestWrapper.js +95 -123
  90. package/lib-commonjs/test-api/MockAdaptiveCardExtensionManifestInstance.js +22 -11
  91. package/lib-commonjs/test-api/index.js +12 -5
  92. package/lib-commonjs/utilities/StringHelper.js +13 -10
  93. package/lib-commonjs/views/base/BaseView.js +46 -76
  94. package/lib-commonjs/views/card/BaseBasicCardView.js +37 -52
  95. package/lib-commonjs/views/card/BaseCardView.js +56 -81
  96. package/lib-commonjs/views/card/BaseComponentsCardView.js +41 -39
  97. package/lib-commonjs/views/card/BaseImageCardView.js +38 -54
  98. package/lib-commonjs/views/card/BasePrimaryTextCardView.js +37 -54
  99. package/lib-commonjs/views/card/BaseTemplateCardView.js +47 -67
  100. package/lib-commonjs/views/card/DefaultCardView.js +24 -29
  101. package/lib-commonjs/views/card/parameters/BaseParameters.js +5 -2
  102. package/lib-commonjs/views/card/parameters/CardViewParametersProcessors.js +26 -31
  103. package/lib-commonjs/views/card/parameters/DataVisualizationParameters.js +75 -76
  104. package/lib-commonjs/views/card/parameters/FocusedParameters.js +53 -35
  105. package/lib-commonjs/views/card/parameters/GenericTemplates.js +87 -70
  106. package/lib-commonjs/views/interfaces/IAdaptiveCardExtensionActionView.js +5 -2
  107. package/lib-commonjs/views/interfaces/IAdaptiveCardExtensionDataView.js +5 -2
  108. package/lib-commonjs/views/interfaces/INavigationBarProperties.js +5 -2
  109. package/lib-commonjs/views/interfaces/IViewNavigator.js +5 -2
  110. package/lib-commonjs/views/navigator/QuickViewNavigator.js +22 -28
  111. package/lib-commonjs/views/navigator/ViewNavigator.js +138 -193
  112. package/lib-commonjs/views/navigator/ViewRegistry.js +25 -26
  113. package/lib-commonjs/views/quickView/BaseAdaptiveCardQuickView.js +64 -88
  114. package/lib-commonjs/views/quickView/BaseQuickView.js +32 -46
  115. package/lib-commonjs/views/quickView/BaseWebQuickView.js +47 -59
  116. package/{lib → lib-dts}/AdaptiveCardExtensionContext.d.ts +1 -5
  117. package/{lib → lib-dts}/BaseAdaptiveCardExtension.d.ts +2 -1
  118. package/lib-esm/AdaptiveCardExtensionContext.js +67 -0
  119. package/lib-esm/AdaptiveCardExtensionHost.js +65 -0
  120. package/{lib → lib-esm}/AdaptiveCardExtensionLoader.js +56 -74
  121. package/lib-esm/BaseAdaptiveCardExtension.js +1237 -0
  122. package/{lib → lib-esm}/ac-template/basicL1Template.js +6 -4
  123. package/{lib → lib-esm}/ac-template/basicL1TemplateSelectAction.js +6 -4
  124. package/{lib → lib-esm}/ac-template/common/Constants.js +3 -2
  125. package/{lib → lib-esm}/ac-template/common/CustomElements.js +26 -30
  126. package/{lib → lib-esm}/ac-template/imageL1Template.js +6 -4
  127. package/{lib → lib-esm}/ac-template/imageL1TemplateSelectAction.js +6 -4
  128. package/{lib → lib-esm}/ac-template/index.js +2 -1
  129. package/{lib → lib-esm}/ac-template/primaryTextL1Template.js +10 -5
  130. package/{lib → lib-esm}/ac-template/primaryTextL1TemplateSelectAction.js +10 -5
  131. package/{lib → lib-esm}/ac-template/searchL1Template.js +7 -7
  132. package/{lib → lib-esm}/ac-template/textInputL1Template.js +10 -13
  133. package/{lib → lib-esm}/ac-template/util/actionButtonHelper.js +45 -57
  134. package/{lib → lib-esm}/ac-template/util/getCardRenderParameters.js +75 -92
  135. package/{lib → lib-esm}/actionShim/AdaptiveCardExtensionActionShim.js +74 -87
  136. package/lib-esm/actionShim/IActionShimProvider.js +7 -0
  137. package/{lib → lib-esm}/actionShim/getOnBeforeActionArguments.js +22 -25
  138. package/lib-esm/caching/CacheManager.js +55 -0
  139. package/lib-esm/caching/IAdaptiveCardExtensionCacheObject.js +7 -0
  140. package/lib-esm/caching/ICacheSettings.js +5 -0
  141. package/{lib → lib-esm}/caching/ICachedLoadParameters.js +2 -1
  142. package/lib-esm/caching/cache/ACEMySiteCacheManager.js +130 -0
  143. package/{lib → lib-esm}/caching/cache/BaseAdaptiveCardExtensionCache.js +10 -16
  144. package/lib-esm/caching/cache/IAdaptiveCardExtensionCache.js +7 -0
  145. package/lib-esm/caching/cache/LocalStorageACECache.js +73 -0
  146. package/{lib → lib-esm}/common/Flights.js +6 -8
  147. package/{lib → lib-esm}/common/Killswitches.js +37 -105
  148. package/lib-esm/components/BarChartComponent.js +112 -0
  149. package/{lib → lib-esm}/components/BaseComponent.js +8 -4
  150. package/lib-esm/components/CardBarComponent.js +10 -0
  151. package/{lib → lib-esm}/components/CardButtonComponent.js +9 -9
  152. package/lib-esm/components/DataVisualizationComponent.js +26 -0
  153. package/lib-esm/components/ICardButtonBase.js +7 -0
  154. package/lib-esm/components/LineChartComponent.js +29 -0
  155. package/lib-esm/components/PieChartComponent.js +115 -0
  156. package/lib-esm/components/PoweredByComponent.js +10 -0
  157. package/lib-esm/components/PromptsSetComponent.js +10 -0
  158. package/lib-esm/components/SearchBoxComponent.js +10 -0
  159. package/lib-esm/components/SearchFooterComponent.js +8 -0
  160. package/lib-esm/components/TextComponent.js +10 -0
  161. package/lib-esm/components/TextInputComponent.js +10 -0
  162. package/{lib → lib-esm}/index.js +3 -3
  163. package/lib-esm/interfaces/CardActionType.js +5 -0
  164. package/lib-esm/interfaces/IActionArguments.js +7 -0
  165. package/lib-esm/interfaces/IAdaptiveCardExtension.js +7 -0
  166. package/lib-esm/interfaces/IAdaptiveCardExtensionData.js +5 -0
  167. package/lib-esm/interfaces/IAdaptiveCardExtensionImage.js +15 -0
  168. package/lib-esm/interfaces/IAdaptiveCardExtensionLoadContext.js +5 -0
  169. package/lib-esm/interfaces/IAdaptiveCardExtensionPropertiesMetadata.js +7 -0
  170. package/lib-esm/interfaces/IAdaptiveCardRenderParameters.js +5 -0
  171. package/lib-esm/interfaces/IBaseCardParameters.js +11 -0
  172. package/lib-esm/interfaces/ICardButton.js +6 -0
  173. package/lib-esm/interfaces/ICardRenderParameters.js +6 -0
  174. package/{lib → lib-esm}/interfaces/IFocusParameters.js +3 -3
  175. package/lib-esm/interfaces/IGetLocationActionTypes.js +7 -0
  176. package/lib-esm/interfaces/IHostContext.js +15 -0
  177. package/lib-esm/interfaces/ILocation.js +6 -0
  178. package/lib-esm/interfaces/INotificationTypes.js +9 -0
  179. package/lib-esm/interfaces/IOnBeforeActionArguments.js +7 -0
  180. package/lib-esm/interfaces/IQuickViewRenderParameters.js +5 -0
  181. package/lib-esm/interfaces/ISPFxAdaptiveCard.js +7 -0
  182. package/{lib → lib-esm}/interfaces/ISelectMediaActionTypes.js +3 -7
  183. package/lib-esm/interfaces/ISelectionActionTemplateAdaptiveCard.js +5 -0
  184. package/lib-esm/interfaces/IShowLocationActionTypes.js +9 -0
  185. package/lib-esm/interfaces/InternalTypes.js +6 -0
  186. package/lib-esm/isolation/IsolatedAdaptiveCardExtensionService.js +505 -0
  187. package/{lib → lib-esm}/isolation/RenderArgumentsUtils.js +79 -71
  188. package/{lib → lib-esm}/isolation/interfaces/IBot.js +3 -3
  189. package/lib-esm/isolation/interfaces/IIsolatedAction.js +5 -0
  190. package/lib-esm/isolation/interfaces/IIsolatedListener.js +7 -0
  191. package/lib-esm/isolation/interfaces/IIsolatedServiceCallbackParameters.js +5 -0
  192. package/lib-esm/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.js +7 -0
  193. package/lib-esm/isolation/interfaces/IRenderIsolatedQuickViewParameters.js +10 -0
  194. package/lib-esm/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.js +5 -0
  195. package/lib-esm/isolation/interfaces/IsolatedServiceMessageEvent.js +5 -0
  196. package/lib-esm/test-api/AdaptiveCardExtensionTestWrapper.js +125 -0
  197. package/{lib → lib-esm}/test-api/MockAdaptiveCardExtensionManifestInstance.js +12 -8
  198. package/{lib → lib-esm}/test-api/index.js +2 -1
  199. package/lib-esm/utilities/StringHelper.js +8 -0
  200. package/lib-esm/views/base/BaseView.js +47 -0
  201. package/lib-esm/views/card/BaseBasicCardView.js +51 -0
  202. package/lib-esm/views/card/BaseCardView.js +59 -0
  203. package/lib-esm/views/card/BaseComponentsCardView.js +43 -0
  204. package/{lib → lib-esm}/views/card/BaseImageCardView.js +24 -36
  205. package/{lib → lib-esm}/views/card/BasePrimaryTextCardView.js +23 -35
  206. package/lib-esm/views/card/BaseTemplateCardView.js +65 -0
  207. package/lib-esm/views/card/DefaultCardView.js +19 -0
  208. package/lib-esm/views/card/parameters/BaseParameters.js +7 -0
  209. package/lib-esm/views/card/parameters/CardViewParametersProcessors.js +30 -0
  210. package/{lib → lib-esm}/views/card/parameters/DataVisualizationParameters.js +41 -35
  211. package/lib-esm/views/card/parameters/FocusedParameters.js +58 -0
  212. package/{lib → lib-esm}/views/card/parameters/GenericTemplates.js +59 -34
  213. package/lib-esm/views/interfaces/IAdaptiveCardExtensionActionView.js +7 -0
  214. package/lib-esm/views/interfaces/IAdaptiveCardExtensionDataView.js +7 -0
  215. package/lib-esm/views/interfaces/INavigationBarProperties.js +5 -0
  216. package/lib-esm/views/interfaces/IViewNavigator.js +5 -0
  217. package/lib-esm/views/navigator/QuickViewNavigator.js +22 -0
  218. package/lib-esm/views/navigator/ViewNavigator.js +174 -0
  219. package/lib-esm/views/navigator/ViewRegistry.js +26 -0
  220. package/lib-esm/views/quickView/BaseAdaptiveCardQuickView.js +65 -0
  221. package/lib-esm/views/quickView/BaseQuickView.js +28 -0
  222. package/lib-esm/views/quickView/BaseWebQuickView.js +49 -0
  223. package/package.json +53 -18
  224. package/dist/index.js +0 -8
  225. package/dist/sp-adaptive-card-extension-base_default_80cb284b0ce5185f01a3.js +0 -1
  226. package/dist/sp-adaptive-card-extension-base_en-us_f42ce38c47d8423e6856.js +0 -1
  227. package/dist/sp-adaptive-card-extension-base_qps-ploc_256d38b669b67722cc35.js +0 -1
  228. package/dist/sp-adaptive-card-extension-base_qps-ploca_d709c1c8a8609f16e251.js +0 -1
  229. package/dist/test-api/AdaptiveCardExtensionTestWrapper.js +0 -155
  230. package/dist/test-api/MockAdaptiveCardExtensionManifestInstance.js +0 -23
  231. package/dist/test-api/index.js +0 -6
  232. package/lib/AdaptiveCardExtensionContext.d.ts.map +0 -1
  233. package/lib/AdaptiveCardExtensionContext.js +0 -103
  234. package/lib/AdaptiveCardExtensionHost.d.ts.map +0 -1
  235. package/lib/AdaptiveCardExtensionHost.js +0 -76
  236. package/lib/AdaptiveCardExtensionLoader.d.ts.map +0 -1
  237. package/lib/BaseAdaptiveCardExtension.d.ts.map +0 -1
  238. package/lib/BaseAdaptiveCardExtension.js +0 -1433
  239. package/lib/ac-template/basicL1Template.d.ts.map +0 -1
  240. package/lib/ac-template/basicL1TemplateSelectAction.d.ts.map +0 -1
  241. package/lib/ac-template/common/Constants.d.ts.map +0 -1
  242. package/lib/ac-template/common/CustomElements.d.ts.map +0 -1
  243. package/lib/ac-template/imageL1Template.d.ts.map +0 -1
  244. package/lib/ac-template/imageL1TemplateSelectAction.d.ts.map +0 -1
  245. package/lib/ac-template/index.d.ts.map +0 -1
  246. package/lib/ac-template/primaryTextL1Template.d.ts.map +0 -1
  247. package/lib/ac-template/primaryTextL1TemplateSelectAction.d.ts.map +0 -1
  248. package/lib/ac-template/searchL1Template.d.ts.map +0 -1
  249. package/lib/ac-template/textInputL1Template.d.ts.map +0 -1
  250. package/lib/ac-template/util/actionButtonHelper.d.ts.map +0 -1
  251. package/lib/ac-template/util/getCardRenderParameters.d.ts.map +0 -1
  252. package/lib/actionShim/AdaptiveCardExtensionActionShim.d.ts.map +0 -1
  253. package/lib/actionShim/IActionShimProvider.d.ts.map +0 -1
  254. package/lib/actionShim/IActionShimProvider.js +0 -2
  255. package/lib/actionShim/getOnBeforeActionArguments.d.ts.map +0 -1
  256. package/lib/caching/CacheManager.d.ts.map +0 -1
  257. package/lib/caching/CacheManager.js +0 -57
  258. package/lib/caching/IAdaptiveCardExtensionCacheObject.d.ts.map +0 -1
  259. package/lib/caching/IAdaptiveCardExtensionCacheObject.js +0 -2
  260. package/lib/caching/ICacheSettings.d.ts.map +0 -1
  261. package/lib/caching/ICacheSettings.js +0 -2
  262. package/lib/caching/ICachedLoadParameters.d.ts.map +0 -1
  263. package/lib/caching/cache/ACEMySiteCacheManager.d.ts.map +0 -1
  264. package/lib/caching/cache/ACEMySiteCacheManager.js +0 -135
  265. package/lib/caching/cache/BaseAdaptiveCardExtensionCache.d.ts.map +0 -1
  266. package/lib/caching/cache/IAdaptiveCardExtensionCache.d.ts.map +0 -1
  267. package/lib/caching/cache/IAdaptiveCardExtensionCache.js +0 -2
  268. package/lib/caching/cache/LocalStorageACECache.d.ts.map +0 -1
  269. package/lib/caching/cache/LocalStorageACECache.js +0 -84
  270. package/lib/common/Flights.d.ts.map +0 -1
  271. package/lib/common/Killswitches.d.ts.map +0 -1
  272. package/lib/components/BarChartComponent.d.ts.map +0 -1
  273. package/lib/components/BarChartComponent.js +0 -125
  274. package/lib/components/BaseComponent.d.ts.map +0 -1
  275. package/lib/components/CardBarComponent.d.ts.map +0 -1
  276. package/lib/components/CardBarComponent.js +0 -8
  277. package/lib/components/CardButtonComponent.d.ts.map +0 -1
  278. package/lib/components/DataVisualizationComponent.d.ts.map +0 -1
  279. package/lib/components/DataVisualizationComponent.js +0 -24
  280. package/lib/components/ICardButtonBase.d.ts.map +0 -1
  281. package/lib/components/ICardButtonBase.js +0 -2
  282. package/lib/components/LineChartComponent.d.ts.map +0 -1
  283. package/lib/components/LineChartComponent.js +0 -32
  284. package/lib/components/PieChartComponent.d.ts.map +0 -1
  285. package/lib/components/PieChartComponent.js +0 -99
  286. package/lib/components/PoweredByComponent.d.ts.map +0 -1
  287. package/lib/components/PoweredByComponent.js +0 -8
  288. package/lib/components/PromptsSetComponent.d.ts.map +0 -1
  289. package/lib/components/PromptsSetComponent.js +0 -8
  290. package/lib/components/SearchBoxComponent.d.ts.map +0 -1
  291. package/lib/components/SearchBoxComponent.js +0 -8
  292. package/lib/components/SearchFooterComponent.d.ts.map +0 -1
  293. package/lib/components/SearchFooterComponent.js +0 -5
  294. package/lib/components/TextComponent.d.ts.map +0 -1
  295. package/lib/components/TextComponent.js +0 -8
  296. package/lib/components/TextInputComponent.d.ts.map +0 -1
  297. package/lib/components/TextInputComponent.js +0 -8
  298. package/lib/index.d.ts.map +0 -1
  299. package/lib/interfaces/CardActionType.d.ts.map +0 -1
  300. package/lib/interfaces/CardActionType.js +0 -2
  301. package/lib/interfaces/IActionArguments.d.ts.map +0 -1
  302. package/lib/interfaces/IActionArguments.js +0 -2
  303. package/lib/interfaces/IAdaptiveCardExtension.d.ts.map +0 -1
  304. package/lib/interfaces/IAdaptiveCardExtension.js +0 -2
  305. package/lib/interfaces/IAdaptiveCardExtensionData.d.ts.map +0 -1
  306. package/lib/interfaces/IAdaptiveCardExtensionData.js +0 -2
  307. package/lib/interfaces/IAdaptiveCardExtensionImage.d.ts.map +0 -1
  308. package/lib/interfaces/IAdaptiveCardExtensionImage.js +0 -2
  309. package/lib/interfaces/IAdaptiveCardExtensionLoadContext.d.ts.map +0 -1
  310. package/lib/interfaces/IAdaptiveCardExtensionLoadContext.js +0 -2
  311. package/lib/interfaces/IAdaptiveCardExtensionPropertiesMetadata.d.ts.map +0 -1
  312. package/lib/interfaces/IAdaptiveCardExtensionPropertiesMetadata.js +0 -2
  313. package/lib/interfaces/IAdaptiveCardRenderParameters.d.ts.map +0 -1
  314. package/lib/interfaces/IAdaptiveCardRenderParameters.js +0 -2
  315. package/lib/interfaces/IBaseCardParameters.d.ts.map +0 -1
  316. package/lib/interfaces/IBaseCardParameters.js +0 -2
  317. package/lib/interfaces/ICardButton.d.ts.map +0 -1
  318. package/lib/interfaces/ICardButton.js +0 -2
  319. package/lib/interfaces/ICardRenderParameters.d.ts.map +0 -1
  320. package/lib/interfaces/ICardRenderParameters.js +0 -2
  321. package/lib/interfaces/IFocusParameters.d.ts.map +0 -1
  322. package/lib/interfaces/IGetLocationActionTypes.d.ts.map +0 -1
  323. package/lib/interfaces/IGetLocationActionTypes.js +0 -2
  324. package/lib/interfaces/IHostContext.d.ts.map +0 -1
  325. package/lib/interfaces/IHostContext.js +0 -2
  326. package/lib/interfaces/ILocation.d.ts.map +0 -1
  327. package/lib/interfaces/ILocation.js +0 -6
  328. package/lib/interfaces/INotificationTypes.d.ts.map +0 -1
  329. package/lib/interfaces/INotificationTypes.js +0 -2
  330. package/lib/interfaces/IOnBeforeActionArguments.d.ts.map +0 -1
  331. package/lib/interfaces/IOnBeforeActionArguments.js +0 -2
  332. package/lib/interfaces/IQuickViewRenderParameters.d.ts.map +0 -1
  333. package/lib/interfaces/IQuickViewRenderParameters.js +0 -2
  334. package/lib/interfaces/ISPFxAdaptiveCard.d.ts.map +0 -1
  335. package/lib/interfaces/ISPFxAdaptiveCard.js +0 -2
  336. package/lib/interfaces/ISelectMediaActionTypes.d.ts.map +0 -1
  337. package/lib/interfaces/ISelectionActionTemplateAdaptiveCard.d.ts.map +0 -1
  338. package/lib/interfaces/ISelectionActionTemplateAdaptiveCard.js +0 -2
  339. package/lib/interfaces/IShowLocationActionTypes.d.ts.map +0 -1
  340. package/lib/interfaces/IShowLocationActionTypes.js +0 -2
  341. package/lib/interfaces/InternalTypes.d.ts.map +0 -1
  342. package/lib/interfaces/InternalTypes.js +0 -2
  343. package/lib/isolation/IsolatedAdaptiveCardExtensionService.d.ts.map +0 -1
  344. package/lib/isolation/IsolatedAdaptiveCardExtensionService.js +0 -513
  345. package/lib/isolation/RenderArgumentsUtils.d.ts.map +0 -1
  346. package/lib/isolation/interfaces/IBot.d.ts.map +0 -1
  347. package/lib/isolation/interfaces/IIsolatedAction.d.ts.map +0 -1
  348. package/lib/isolation/interfaces/IIsolatedAction.js +0 -2
  349. package/lib/isolation/interfaces/IIsolatedListener.d.ts.map +0 -1
  350. package/lib/isolation/interfaces/IIsolatedListener.js +0 -2
  351. package/lib/isolation/interfaces/IIsolatedServiceCallbackParameters.d.ts.map +0 -1
  352. package/lib/isolation/interfaces/IIsolatedServiceCallbackParameters.js +0 -2
  353. package/lib/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.d.ts.map +0 -1
  354. package/lib/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.js +0 -2
  355. package/lib/isolation/interfaces/IRenderIsolatedQuickViewParameters.d.ts.map +0 -1
  356. package/lib/isolation/interfaces/IRenderIsolatedQuickViewParameters.js +0 -2
  357. package/lib/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.d.ts.map +0 -1
  358. package/lib/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.js +0 -2
  359. package/lib/isolation/interfaces/IsolatedServiceMessageEvent.d.ts.map +0 -1
  360. package/lib/isolation/interfaces/IsolatedServiceMessageEvent.js +0 -2
  361. package/lib/test-api/AdaptiveCardExtensionTestWrapper.d.ts.map +0 -1
  362. package/lib/test-api/AdaptiveCardExtensionTestWrapper.js +0 -152
  363. package/lib/test-api/MockAdaptiveCardExtensionManifestInstance.d.ts.map +0 -1
  364. package/lib/test-api/index.d.ts.map +0 -1
  365. package/lib/utilities/StringHelper.d.ts.map +0 -1
  366. package/lib/utilities/StringHelper.js +0 -11
  367. package/lib/views/base/BaseView.d.ts.map +0 -1
  368. package/lib/views/base/BaseView.js +0 -77
  369. package/lib/views/card/BaseBasicCardView.d.ts.map +0 -1
  370. package/lib/views/card/BaseBasicCardView.js +0 -63
  371. package/lib/views/card/BaseCardView.d.ts.map +0 -1
  372. package/lib/views/card/BaseCardView.js +0 -84
  373. package/lib/views/card/BaseComponentsCardView.d.ts.map +0 -1
  374. package/lib/views/card/BaseComponentsCardView.js +0 -44
  375. package/lib/views/card/BaseImageCardView.d.ts.map +0 -1
  376. package/lib/views/card/BasePrimaryTextCardView.d.ts.map +0 -1
  377. package/lib/views/card/BaseTemplateCardView.d.ts.map +0 -1
  378. package/lib/views/card/BaseTemplateCardView.js +0 -85
  379. package/lib/views/card/DefaultCardView.d.ts.map +0 -1
  380. package/lib/views/card/DefaultCardView.js +0 -29
  381. package/lib/views/card/parameters/BaseParameters.d.ts.map +0 -1
  382. package/lib/views/card/parameters/BaseParameters.js +0 -2
  383. package/lib/views/card/parameters/CardViewParametersProcessors.d.ts.map +0 -1
  384. package/lib/views/card/parameters/CardViewParametersProcessors.js +0 -37
  385. package/lib/views/card/parameters/DataVisualizationParameters.d.ts.map +0 -1
  386. package/lib/views/card/parameters/FocusedParameters.d.ts.map +0 -1
  387. package/lib/views/card/parameters/FocusedParameters.js +0 -43
  388. package/lib/views/card/parameters/GenericTemplates.d.ts.map +0 -1
  389. package/lib/views/interfaces/IAdaptiveCardExtensionActionView.d.ts.map +0 -1
  390. package/lib/views/interfaces/IAdaptiveCardExtensionActionView.js +0 -2
  391. package/lib/views/interfaces/IAdaptiveCardExtensionDataView.d.ts.map +0 -1
  392. package/lib/views/interfaces/IAdaptiveCardExtensionDataView.js +0 -2
  393. package/lib/views/interfaces/INavigationBarProperties.d.ts.map +0 -1
  394. package/lib/views/interfaces/INavigationBarProperties.js +0 -2
  395. package/lib/views/interfaces/IViewNavigator.d.ts.map +0 -1
  396. package/lib/views/interfaces/IViewNavigator.js +0 -2
  397. package/lib/views/navigator/QuickViewNavigator.d.ts.map +0 -1
  398. package/lib/views/navigator/QuickViewNavigator.js +0 -29
  399. package/lib/views/navigator/ViewNavigator.d.ts.map +0 -1
  400. package/lib/views/navigator/ViewNavigator.js +0 -233
  401. package/lib/views/navigator/ViewRegistry.d.ts.map +0 -1
  402. package/lib/views/navigator/ViewRegistry.js +0 -32
  403. package/lib/views/quickView/BaseAdaptiveCardQuickView.d.ts.map +0 -1
  404. package/lib/views/quickView/BaseAdaptiveCardQuickView.js +0 -90
  405. package/lib/views/quickView/BaseQuickView.d.ts.map +0 -1
  406. package/lib/views/quickView/BaseQuickView.js +0 -45
  407. package/lib/views/quickView/BaseWebQuickView.d.ts.map +0 -1
  408. package/lib/views/quickView/BaseWebQuickView.js +0 -64
  409. /package/{lib → lib-dts}/AdaptiveCardExtensionHost.d.ts +0 -0
  410. /package/{lib → lib-dts}/AdaptiveCardExtensionLoader.d.ts +0 -0
  411. /package/{lib → lib-dts}/ac-template/basicL1Template.d.ts +0 -0
  412. /package/{lib → lib-dts}/ac-template/basicL1TemplateSelectAction.d.ts +0 -0
  413. /package/{lib → lib-dts}/ac-template/common/Constants.d.ts +0 -0
  414. /package/{lib → lib-dts}/ac-template/common/CustomElements.d.ts +0 -0
  415. /package/{lib → lib-dts}/ac-template/imageL1Template.d.ts +0 -0
  416. /package/{lib → lib-dts}/ac-template/imageL1TemplateSelectAction.d.ts +0 -0
  417. /package/{lib → lib-dts}/ac-template/index.d.ts +0 -0
  418. /package/{lib → lib-dts}/ac-template/primaryTextL1Template.d.ts +0 -0
  419. /package/{lib → lib-dts}/ac-template/primaryTextL1TemplateSelectAction.d.ts +0 -0
  420. /package/{lib → lib-dts}/ac-template/searchL1Template.d.ts +0 -0
  421. /package/{lib → lib-dts}/ac-template/textInputL1Template.d.ts +0 -0
  422. /package/{lib → lib-dts}/ac-template/util/actionButtonHelper.d.ts +0 -0
  423. /package/{lib → lib-dts}/ac-template/util/getCardRenderParameters.d.ts +0 -0
  424. /package/{lib → lib-dts}/actionShim/AdaptiveCardExtensionActionShim.d.ts +0 -0
  425. /package/{lib → lib-dts}/actionShim/IActionShimProvider.d.ts +0 -0
  426. /package/{lib → lib-dts}/actionShim/getOnBeforeActionArguments.d.ts +0 -0
  427. /package/{lib → lib-dts}/caching/CacheManager.d.ts +0 -0
  428. /package/{lib → lib-dts}/caching/IAdaptiveCardExtensionCacheObject.d.ts +0 -0
  429. /package/{lib → lib-dts}/caching/ICacheSettings.d.ts +0 -0
  430. /package/{lib → lib-dts}/caching/ICachedLoadParameters.d.ts +0 -0
  431. /package/{lib → lib-dts}/caching/cache/ACEMySiteCacheManager.d.ts +0 -0
  432. /package/{lib → lib-dts}/caching/cache/BaseAdaptiveCardExtensionCache.d.ts +0 -0
  433. /package/{lib → lib-dts}/caching/cache/IAdaptiveCardExtensionCache.d.ts +0 -0
  434. /package/{lib → lib-dts}/caching/cache/LocalStorageACECache.d.ts +0 -0
  435. /package/{lib → lib-dts}/common/Flights.d.ts +0 -0
  436. /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
  437. /package/{lib → lib-dts}/components/BarChartComponent.d.ts +0 -0
  438. /package/{lib → lib-dts}/components/BaseComponent.d.ts +0 -0
  439. /package/{lib → lib-dts}/components/CardBarComponent.d.ts +0 -0
  440. /package/{lib → lib-dts}/components/CardButtonComponent.d.ts +0 -0
  441. /package/{lib → lib-dts}/components/DataVisualizationComponent.d.ts +0 -0
  442. /package/{lib → lib-dts}/components/ICardButtonBase.d.ts +0 -0
  443. /package/{lib → lib-dts}/components/LineChartComponent.d.ts +0 -0
  444. /package/{lib → lib-dts}/components/PieChartComponent.d.ts +0 -0
  445. /package/{lib → lib-dts}/components/PoweredByComponent.d.ts +0 -0
  446. /package/{lib → lib-dts}/components/PromptsSetComponent.d.ts +0 -0
  447. /package/{lib → lib-dts}/components/SearchBoxComponent.d.ts +0 -0
  448. /package/{lib → lib-dts}/components/SearchFooterComponent.d.ts +0 -0
  449. /package/{lib → lib-dts}/components/TextComponent.d.ts +0 -0
  450. /package/{lib → lib-dts}/components/TextInputComponent.d.ts +0 -0
  451. /package/{lib → lib-dts}/index.d.ts +0 -0
  452. /package/{lib → lib-dts}/interfaces/CardActionType.d.ts +0 -0
  453. /package/{lib → lib-dts}/interfaces/IActionArguments.d.ts +0 -0
  454. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtension.d.ts +0 -0
  455. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionData.d.ts +0 -0
  456. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionImage.d.ts +0 -0
  457. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionLoadContext.d.ts +0 -0
  458. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionPropertiesMetadata.d.ts +0 -0
  459. /package/{lib → lib-dts}/interfaces/IAdaptiveCardRenderParameters.d.ts +0 -0
  460. /package/{lib → lib-dts}/interfaces/IBaseCardParameters.d.ts +0 -0
  461. /package/{lib → lib-dts}/interfaces/ICardButton.d.ts +0 -0
  462. /package/{lib → lib-dts}/interfaces/ICardRenderParameters.d.ts +0 -0
  463. /package/{lib → lib-dts}/interfaces/IFocusParameters.d.ts +0 -0
  464. /package/{lib → lib-dts}/interfaces/IGetLocationActionTypes.d.ts +0 -0
  465. /package/{lib → lib-dts}/interfaces/IHostContext.d.ts +0 -0
  466. /package/{lib → lib-dts}/interfaces/ILocation.d.ts +0 -0
  467. /package/{lib → lib-dts}/interfaces/INotificationTypes.d.ts +0 -0
  468. /package/{lib → lib-dts}/interfaces/IOnBeforeActionArguments.d.ts +0 -0
  469. /package/{lib → lib-dts}/interfaces/IQuickViewRenderParameters.d.ts +0 -0
  470. /package/{lib → lib-dts}/interfaces/ISPFxAdaptiveCard.d.ts +0 -0
  471. /package/{lib → lib-dts}/interfaces/ISelectMediaActionTypes.d.ts +0 -0
  472. /package/{lib → lib-dts}/interfaces/ISelectionActionTemplateAdaptiveCard.d.ts +0 -0
  473. /package/{lib → lib-dts}/interfaces/IShowLocationActionTypes.d.ts +0 -0
  474. /package/{lib → lib-dts}/interfaces/InternalTypes.d.ts +0 -0
  475. /package/{lib → lib-dts}/isolation/IsolatedAdaptiveCardExtensionService.d.ts +0 -0
  476. /package/{lib → lib-dts}/isolation/RenderArgumentsUtils.d.ts +0 -0
  477. /package/{lib → lib-dts}/isolation/interfaces/IBot.d.ts +0 -0
  478. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedAction.d.ts +0 -0
  479. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedListener.d.ts +0 -0
  480. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedServiceCallbackParameters.d.ts +0 -0
  481. /package/{lib → lib-dts}/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.d.ts +0 -0
  482. /package/{lib → lib-dts}/isolation/interfaces/IRenderIsolatedQuickViewParameters.d.ts +0 -0
  483. /package/{lib → lib-dts}/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.d.ts +0 -0
  484. /package/{lib → lib-dts}/isolation/interfaces/IsolatedServiceMessageEvent.d.ts +0 -0
  485. /package/{lib → lib-dts}/loc/Strings.resx.d.ts +0 -0
  486. /package/{lib → lib-dts}/test-api/AdaptiveCardExtensionTestWrapper.d.ts +0 -0
  487. /package/{lib → lib-dts}/test-api/MockAdaptiveCardExtensionManifestInstance.d.ts +0 -0
  488. /package/{lib → lib-dts}/test-api/index.d.ts +0 -0
  489. /package/{lib → lib-dts}/utilities/StringHelper.d.ts +0 -0
  490. /package/{lib → lib-dts}/views/base/BaseView.d.ts +0 -0
  491. /package/{lib → lib-dts}/views/card/BaseBasicCardView.d.ts +0 -0
  492. /package/{lib → lib-dts}/views/card/BaseCardView.d.ts +0 -0
  493. /package/{lib → lib-dts}/views/card/BaseComponentsCardView.d.ts +0 -0
  494. /package/{lib → lib-dts}/views/card/BaseImageCardView.d.ts +0 -0
  495. /package/{lib → lib-dts}/views/card/BasePrimaryTextCardView.d.ts +0 -0
  496. /package/{lib → lib-dts}/views/card/BaseTemplateCardView.d.ts +0 -0
  497. /package/{lib → lib-dts}/views/card/DefaultCardView.d.ts +0 -0
  498. /package/{lib → lib-dts}/views/card/parameters/BaseParameters.d.ts +0 -0
  499. /package/{lib → lib-dts}/views/card/parameters/CardViewParametersProcessors.d.ts +0 -0
  500. /package/{lib → lib-dts}/views/card/parameters/DataVisualizationParameters.d.ts +0 -0
  501. /package/{lib → lib-dts}/views/card/parameters/FocusedParameters.d.ts +0 -0
  502. /package/{lib → lib-dts}/views/card/parameters/GenericTemplates.d.ts +0 -0
  503. /package/{lib → lib-dts}/views/interfaces/IAdaptiveCardExtensionActionView.d.ts +0 -0
  504. /package/{lib → lib-dts}/views/interfaces/IAdaptiveCardExtensionDataView.d.ts +0 -0
  505. /package/{lib → lib-dts}/views/interfaces/INavigationBarProperties.d.ts +0 -0
  506. /package/{lib → lib-dts}/views/interfaces/IViewNavigator.d.ts +0 -0
  507. /package/{lib → lib-dts}/views/navigator/QuickViewNavigator.d.ts +0 -0
  508. /package/{lib → lib-dts}/views/navigator/ViewNavigator.d.ts +0 -0
  509. /package/{lib → lib-dts}/views/navigator/ViewRegistry.d.ts +0 -0
  510. /package/{lib → lib-dts}/views/quickView/BaseAdaptiveCardQuickView.d.ts +0 -0
  511. /package/{lib → lib-dts}/views/quickView/BaseQuickView.d.ts +0 -0
  512. /package/{lib → lib-dts}/views/quickView/BaseWebQuickView.d.ts +0 -0
  513. /package/{lib → lib-esm}/loc/Strings.resx.json +0 -0
  514. /package/{lib → lib-esm}/sp-adaptive-card-base.manifest.json +0 -0
@@ -1,503 +1,304 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseAdaptiveCardExtension = void 0;
4
- var tslib_1 = require("tslib");
5
- var sp_component_base_1 = require("@microsoft/sp-component-base");
6
- var sp_core_library_1 = require("@microsoft/sp-core-library");
7
- var sp_lodash_subset_1 = require("@microsoft/sp-lodash-subset");
8
- var sp_diagnostics_1 = require("@microsoft/sp-diagnostics");
9
- var sp_component_base_2 = require("@microsoft/sp-component-base");
10
- var getCardRenderParameters_1 = require("./ac-template/util/getCardRenderParameters");
11
- var CacheManager_1 = require("./caching/CacheManager");
12
- var Flights_1 = require("./common/Flights");
13
- var BaseView_1 = require("./views/base/BaseView");
14
- var BaseCardView_1 = require("./views/card/BaseCardView");
15
- var DefaultCardView_1 = require("./views/card/DefaultCardView");
16
- var QuickViewNavigator_1 = require("./views/navigator/QuickViewNavigator");
17
- var ViewNavigator_1 = require("./views/navigator/ViewNavigator");
18
- var sp_telemetry_1 = require("@msinternal/sp-telemetry");
19
- var Killswitches_1 = require("./common/Killswitches");
20
- var LocalStorageACECache_1 = require("./caching/cache/LocalStorageACECache");
21
- var BaseQuickView_1 = require("./views/quickView/BaseQuickView");
22
- var AdaptiveCardExtensionLoader_1 = require("./AdaptiveCardExtensionLoader");
23
- var VivaConnectionsAnalyticsEngagementEvents_1 = require("@msinternal/odsp-analytics/lib/VivaConnectionsAnalytics/VivaConnectionsAnalyticsEngagementEvents");
24
- var DEFAULT_CARD_SIZE = 'Medium';
25
- var DEFAULT_VIEW_ID = '_InternalDefaultCardView';
26
- var DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME = 15000; // 15 seconds
27
- var UPDATED_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME = 10000; // 10 seconds
28
- var VIVA_CONNECTIONS_APP_ID = 'd2c6f111-ffad-42a0-b65e-ee00425598aa';
29
- var VIVA_CONNECTIONS_NAME = 'MEE';
30
- var ADAPTIVECARDEXTENSION_COMPONENTEVENT = 'AdaptiveCardExtension.ComponentEvent';
31
- /* eslint-disable @typescript-eslint/member-ordering */ // Disable for this file so we can group public/internal APIs together
32
- /**
33
- * Base class for Adaptive Card Extensions.
34
- *
35
- * @remarks Adaptive Card Extensions must inherit from this class.
36
- *
37
- * @public
38
- */
39
- var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
40
- tslib_1.__extends(BaseAdaptiveCardExtension, _super);
41
- function BaseAdaptiveCardExtension() {
42
- var _this = _super.call(this) || this;
43
- _this._isLoggedRenderPerf = false;
44
- // Set to true after onInit is called by the loader
45
- _this._isInitialized = false;
46
- _this._isInitializedWithLKG = false;
47
- /**
48
- * Not over-engineering now, but we can change the type to number in future if we want to support nested beginUpdate...endUpdate.
49
- */
50
- _this._isUpdating = false;
51
- // #endregion
52
- // #region Private
53
- _this._getCard = function (updateOnlyData) {
54
- try {
55
- return (0, getCardRenderParameters_1.getCardRenderParameters)(_this.cardNavigator._currentView instanceof BaseCardView_1.BaseCardView
56
- ? _this.cardNavigator._currentView
57
- : _this.cardNavigator._currentView.view, _this.cardSize, _this.context.deviceContext, updateOnlyData ? _this._ACRenderArgs.card.template : undefined, _this.iconProperty, _this.title, _this.manifest, _this.instanceId, _this.cardNavigator.currentId);
58
- }
59
- catch (error) {
60
- _this.context._host.onError(error.toString());
61
- throw error;
62
- }
63
- };
64
- _this._assignAndRenderWebQuickView = function (domElement) {
65
- var _a;
66
- var currentView = _this.quickViewNavigator._currentView instanceof BaseQuickView_1.BaseQuickView
67
- ? _this.quickViewNavigator._currentView
68
- : (_a = _this.quickViewNavigator._currentView) === null || _a === void 0 ? void 0 : _a.view;
69
- var monitor = new sp_diagnostics_1._QosMonitor('ACE.WebQuickView.Render');
70
- try {
71
- if (currentView === undefined || currentView._viewType === 'AdaptiveCardQuickView') {
72
- monitor.writeExpectedFailure('IncorrectQVType', undefined, {
73
- viewType: currentView._viewType
74
- });
75
- return;
76
- }
77
- currentView._setDomElement(domElement);
78
- currentView.render();
79
- monitor.writeSuccess();
80
- }
81
- catch (err) {
82
- monitor.writeUnexpectedFailure('FailedToRender', err);
83
- }
84
- };
85
- /**
86
- * Quick view navigator will modify the stack when navigating between different quick views.
87
- * Bind currentView argument to the function when using this method.
88
- */
89
- _this._disposeWebQuickView = function (currentView) {
90
- var monitor = new sp_diagnostics_1._QosMonitor('ACE.WebQuickView.Dispose');
91
- try {
92
- if (currentView === undefined || currentView._viewType === 'AdaptiveCardQuickView') {
93
- monitor.writeExpectedFailure('IncorrectQVType', undefined, {
94
- viewType: currentView._viewType
95
- });
96
- return;
97
- }
98
- currentView.dispose();
99
- // remove dom element after view has been disposed.
100
- currentView._setDomElement(undefined);
101
- monitor.writeSuccess();
102
- }
103
- catch (err) {
104
- monitor.writeUnexpectedFailure('FailedToDispose', err);
105
- }
106
- };
107
- _this._onViewInitialized = function (view) {
108
- _this._initializeCardView(view);
109
- };
110
- _this._onQuickViewInitialized = function (view) {
111
- _this._initializeBaseView(view);
112
- };
113
- _this._navigatorCallback = function (skipUpdate) {
114
- if (!skipUpdate) {
115
- _this.update(_this._renderType);
116
- }
117
- };
118
- _this._closeQuickViewCallback = function () {
119
- _this.context._host.requestRenderTypeChange('Card', _this.instanceId);
120
- };
121
- _this._cardSize = DEFAULT_CARD_SIZE;
122
- _this._renderType = 'Card';
123
- _this._isVisible = true;
124
- _this._urlParams = new URLSearchParams(window.location.search);
125
- return _this;
126
- }
127
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "cardNavigator", {
128
- // #region Getters
129
- /**
130
- * The {@link ViewNavigator} for the Card view.
131
- *
132
- * @readonly
133
- */
134
- get: function () {
135
- if (!this._cardNavigator) {
136
- this._cardNavigator = this._initializeCardNavigator();
137
- }
138
- return this._cardNavigator;
139
- },
140
- enumerable: false,
141
- configurable: true
142
- });
143
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "cardSize", {
144
- /**
145
- * The current {@link CardSize}.
146
- *
147
- * @readonly
148
- */
149
- get: function () {
150
- return this._cardSize;
151
- },
152
- enumerable: false,
153
- configurable: true
154
- });
155
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "dataVersion", {
156
- /**
157
- * The value of this property is stored in the serialized data of the Adaptive Card Extension. It can be used to
158
- * manage versioning of the Adaptive Card Extension.
159
- *
160
- * @remarks The default version is 1.0.
161
- *
162
- * @readonly
163
- */
164
- get: function () {
165
- return sp_core_library_1.Version.parse('1.0');
166
- },
167
- enumerable: false,
168
- configurable: true
169
- });
170
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "description", {
171
- /**
172
- * The description of the Adaptive Card Extension defined in the manifest.
173
- *
174
- * @readonly
175
- */
176
- get: function () {
177
- return this._description;
178
- },
179
- enumerable: false,
180
- configurable: true
181
- });
182
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "displayMode", {
183
- /**
184
- * The current {@link @microsoft/sp-core-library#DisplayMode}.
185
- *
186
- * @readonly
187
- */
188
- get: function () {
189
- return this._displayMode;
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "properties", {
195
- /**
196
- * The custom, persisted properties of the Adaptive Card Extension.
197
- *
198
- * @readonly
199
- */
200
- get: function () {
201
- return this._properties;
202
- },
203
- enumerable: false,
204
- configurable: true
205
- });
206
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "siteId", {
207
- /**
208
- * The current site id.
209
- *
210
- * @internal
211
- * @readonly
212
- */
213
- get: function () {
214
- return this.context.pageContext.site.id.toString();
215
- },
216
- enumerable: false,
217
- configurable: true
218
- });
219
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "itemId", {
220
- /**
221
- * The current item id.
222
- *
223
- * @internal
224
- * @readonly
225
- */
226
- get: function () {
227
- var _a;
228
- return (_a = this.context.pageContext.listItem) === null || _a === void 0 ? void 0 : _a.uniqueId;
229
- },
230
- enumerable: false,
231
- configurable: true
232
- });
233
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "mySiteCacheEnabled", {
234
- /**
235
- * Whether the my site cache is enabled
236
- *
237
- * @internal
238
- * @readonly
239
- */
240
- get: function () {
241
- return (0, Flights_1.isAdaptiveCardExtensionMySiteCacheEnabled)();
242
- },
243
- enumerable: false,
244
- configurable: true
245
- });
246
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "quickViewNavigator", {
247
- /**
248
- * {@link QuickViewNavigator} is a {@link ViewNavigator} for the Quick view.
249
- *
250
- * @readonly
251
- */
252
- get: function () {
253
- if (!this._quickViewNavigator) {
254
- this._quickViewNavigator = this._initializeQuickViewNavigator();
255
- }
256
- return this._quickViewNavigator;
257
- },
258
- enumerable: false,
259
- configurable: true
260
- });
261
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "renderedFromPersistedData", {
262
- /**
263
- * Indicates whether the Adaptive Card Extension was rendered from persisted data or
264
- * initialized from a default state.
265
- *
266
- * @readonly
267
- */
268
- get: function () {
269
- return this._renderedFromPersistedData;
270
- },
271
- enumerable: false,
272
- configurable: true
273
- });
274
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "renderedOnce", {
275
- /**
276
- * Indicates whether the Adaptive Card Extension has initially rendered.
277
- *
278
- * @readonly
279
- */
280
- get: function () {
281
- return this._renderedOnce;
282
- },
283
- enumerable: false,
284
- configurable: true
285
- });
286
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "renderType", {
287
- /**
288
- * The current {@link RenderType}.
289
- *
290
- * @readonly
291
- */
292
- get: function () {
293
- return this._renderType;
294
- },
295
- enumerable: false,
296
- configurable: true
297
- });
298
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "propertiesMetadata", {
299
- /**
300
- * This property defines metadata for the Adaptive Card Extension property bag. The metadata can help SharePoint understand
301
- * the content of the properties better and perform relevant services on the data.
302
- *
303
- * @remarks See {@link IAdaptiveCardExtensionPropertiesMetadata} for more information about how to define metadata.
304
- *
305
- * @virtual
306
- */
307
- get: function () {
308
- return undefined;
309
- },
310
- enumerable: false,
311
- configurable: true
312
- });
313
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "isRenderAsync", {
314
- /**
315
- * Indicates whether the ACE is rendering in async mode.
316
- *
317
- * @remarks
318
- * If the ACE overrides this field to return true, then it needs to call renderCompleted API after the ACE finishes initializing.
319
- *
320
- * The default value is false.
321
- *
322
- * @beta
323
- */
324
- get: function () {
325
- return false;
326
- },
327
- enumerable: false,
328
- configurable: true
329
- });
330
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "state", {
331
- /**
332
- * Gets the custom state of the Adaptive Card Extension.
333
- *
334
- * @remarks This property is automatically shared across registered Views.
335
- *
336
- * @remarks This property can only be initialized once, and should be done in the constructor or {@link onInit}.
337
- *
338
- * @remarks If this property is not initialized, {@link BaseAdaptiveCardExtension.setState} cannot be called.
339
- *
340
- * @remarks This property should not be directly updated. Please use {@link BaseAdaptiveCardExtension.setState} to update the state after initialization.
341
- *
342
- * @readonly
343
- */
344
- get: function () {
345
- return this._state;
346
- },
347
- set: function (initialState) {
348
- if (this._state) {
349
- throw new Error('state can only be initialized once');
350
- }
351
- this._state = initialState;
352
- },
353
- enumerable: false,
354
- configurable: true
355
- });
356
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "title", {
357
- // #endregion
358
- // #region Public Virtual Methods
359
- /**
360
- * This value is displayed in Card and Quick view unless it is explicitly overridden by the Views.
361
- * It is also displayed as the Property Pane title.
362
- *
363
- * @remarks By default, this will return the title defined in the manifest.
364
- *
365
- * @virtual
366
- */
367
- get: function () {
368
- return this._title;
369
- },
370
- enumerable: false,
371
- configurable: true
372
- });
373
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "_aceLoadExtraData", {
374
- /**
375
- * Extra properties initialized in the specific card used for when card is loaded telemetry.
376
- *
377
- * @internal
378
- * @virtual
379
- */
380
- get: function () {
381
- return {};
382
- },
383
- enumerable: false,
384
- configurable: true
385
- });
386
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "_cardActionEngagementExtraData", {
387
- /**
388
- * Extra properties initialized in the specific card used for the action engagement telemetry.
389
- *
390
- * @internal
391
- * @virtual
392
- */
393
- get: function () {
394
- return {};
395
- },
396
- enumerable: false,
397
- configurable: true
398
- });
399
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "iconProperty", {
400
- /**
401
- * The icon url used to render an icon on the Card view.
402
- *
403
- * @remarks By default, this will return the iconImageUrl defined in the manifest.
404
- *
405
- * @virtual
406
- */
407
- get: function () {
408
- return this._iconProperty;
409
- },
410
- enumerable: false,
411
- configurable: true
412
- });
413
- /**
414
- * Get the Property Pane configuration for this Adaptive Card Extension. If an Adaptive Card Extension
415
- * wants to use the Property Pane, then this method must be overriden.
416
- *
417
- * @remarks Property Pane resources can be defer loaded to reduce bundle size. See {@link BaseAdaptiveCardExtension.loadPropertyPaneResources}.
418
- *
419
- * @virtual
420
- */
421
- BaseAdaptiveCardExtension.prototype.getPropertyPaneConfiguration = function () {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "BaseAdaptiveCardExtension", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return BaseAdaptiveCardExtension;
9
+ }
10
+ });
11
+ const _spcomponentbase = require("@microsoft/sp-component-base");
12
+ const _spcorelibrary = require("@microsoft/sp-core-library");
13
+ const _splodashsubset = require("@microsoft/sp-lodash-subset");
14
+ const _spdiagnostics = require("@microsoft/sp-diagnostics");
15
+ const _getCardRenderParameters = require("./ac-template/util/getCardRenderParameters");
16
+ const _CacheManager = require("./caching/CacheManager");
17
+ const _Flights = require("./common/Flights");
18
+ const _BaseView = require("./views/base/BaseView");
19
+ const _BaseCardView = require("./views/card/BaseCardView");
20
+ const _DefaultCardView = require("./views/card/DefaultCardView");
21
+ const _QuickViewNavigator = require("./views/navigator/QuickViewNavigator");
22
+ const _ViewNavigator = require("./views/navigator/ViewNavigator");
23
+ const _sptelemetry = require("@msinternal/sp-telemetry");
24
+ const _Killswitches = require("./common/Killswitches");
25
+ const _LocalStorageACECache = require("./caching/cache/LocalStorageACECache");
26
+ const _BaseQuickView = require("./views/quickView/BaseQuickView");
27
+ const _AdaptiveCardExtensionLoader = require("./AdaptiveCardExtensionLoader");
28
+ const _VivaConnectionsAnalyticsEngagementEvents = require("@msinternal/odsp-analytics/lib/VivaConnectionsAnalytics/VivaConnectionsAnalyticsEngagementEvents");
29
+ const DEFAULT_CARD_SIZE = 'Medium';
30
+ const DEFAULT_VIEW_ID = '_InternalDefaultCardView';
31
+ const DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME = 15000; // 15 seconds
32
+ const UPDATED_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME = 10000; // 10 seconds
33
+ const VIVA_CONNECTIONS_APP_ID = 'd2c6f111-ffad-42a0-b65e-ee00425598aa';
34
+ const VIVA_CONNECTIONS_NAME = 'MEE';
35
+ const ADAPTIVECARDEXTENSION_COMPONENTEVENT = 'AdaptiveCardExtension.ComponentEvent';
36
+ class BaseAdaptiveCardExtension extends _spcomponentbase.BaseComponent {
37
+ // #region Getters
38
+ /**
39
+ * The {@link ViewNavigator} for the Card view.
40
+ *
41
+ * @readonly
42
+ */ get cardNavigator() {
43
+ if (!this._cardNavigator) {
44
+ this._cardNavigator = this._initializeCardNavigator();
45
+ }
46
+ return this._cardNavigator;
47
+ }
48
+ /**
49
+ * The current {@link CardSize}.
50
+ *
51
+ * @readonly
52
+ */ get cardSize() {
53
+ return this._cardSize;
54
+ }
55
+ /**
56
+ * The value of this property is stored in the serialized data of the Adaptive Card Extension. It can be used to
57
+ * manage versioning of the Adaptive Card Extension.
58
+ *
59
+ * @remarks The default version is 1.0.
60
+ *
61
+ * @readonly
62
+ */ get dataVersion() {
63
+ return _spcorelibrary.Version.parse('1.0');
64
+ }
65
+ /**
66
+ * The description of the Adaptive Card Extension defined in the manifest.
67
+ *
68
+ * @readonly
69
+ */ get description() {
70
+ return this._description;
71
+ }
72
+ /**
73
+ * The current {@link @microsoft/sp-core-library#DisplayMode}.
74
+ *
75
+ * @readonly
76
+ */ get displayMode() {
77
+ return this._displayMode;
78
+ }
79
+ /**
80
+ * The custom, persisted properties of the Adaptive Card Extension.
81
+ *
82
+ * @readonly
83
+ */ get properties() {
84
+ return this._properties;
85
+ }
86
+ /**
87
+ * The current site id.
88
+ *
89
+ * @internal
90
+ * @readonly
91
+ */ get siteId() {
92
+ return this.context.pageContext.site.id.toString();
93
+ }
94
+ /**
95
+ * The current item id.
96
+ *
97
+ * @internal
98
+ * @readonly
99
+ */ get itemId() {
100
+ return this.context.pageContext.listItem?.uniqueId;
101
+ }
102
+ /**
103
+ * Whether the my site cache is enabled
104
+ *
105
+ * @internal
106
+ * @readonly
107
+ */ get mySiteCacheEnabled() {
108
+ return (0, _Flights.isAdaptiveCardExtensionMySiteCacheEnabled)();
109
+ }
110
+ /**
111
+ * {@link QuickViewNavigator} is a {@link ViewNavigator} for the Quick view.
112
+ *
113
+ * @readonly
114
+ */ get quickViewNavigator() {
115
+ if (!this._quickViewNavigator) {
116
+ this._quickViewNavigator = this._initializeQuickViewNavigator();
117
+ }
118
+ return this._quickViewNavigator;
119
+ }
120
+ /**
121
+ * Indicates whether the Adaptive Card Extension was rendered from persisted data or
122
+ * initialized from a default state.
123
+ *
124
+ * @readonly
125
+ */ get renderedFromPersistedData() {
126
+ return this._renderedFromPersistedData;
127
+ }
128
+ /**
129
+ * Indicates whether the Adaptive Card Extension has initially rendered.
130
+ *
131
+ * @readonly
132
+ */ get renderedOnce() {
133
+ return this._renderedOnce;
134
+ }
135
+ /**
136
+ * The current {@link RenderType}.
137
+ *
138
+ * @readonly
139
+ */ get renderType() {
140
+ return this._renderType;
141
+ }
142
+ /**
143
+ * This property defines metadata for the Adaptive Card Extension property bag. The metadata can help SharePoint understand
144
+ * the content of the properties better and perform relevant services on the data.
145
+ *
146
+ * @remarks See {@link IAdaptiveCardExtensionPropertiesMetadata} for more information about how to define metadata.
147
+ *
148
+ * @virtual
149
+ */ get propertiesMetadata() {
150
+ return undefined;
151
+ }
152
+ /**
153
+ * Indicates whether the ACE is rendering in async mode.
154
+ *
155
+ * @remarks
156
+ * If the ACE overrides this field to return true, then it needs to call renderCompleted API after the ACE finishes initializing.
157
+ *
158
+ * The default value is false.
159
+ *
160
+ * @beta
161
+ */ get isRenderAsync() {
162
+ return false;
163
+ }
164
+ /**
165
+ * Gets the custom state of the Adaptive Card Extension.
166
+ *
167
+ * @remarks This property is automatically shared across registered Views.
168
+ *
169
+ * @remarks This property can only be initialized once, and should be done in the constructor or {@link onInit}.
170
+ *
171
+ * @remarks If this property is not initialized, {@link BaseAdaptiveCardExtension.setState} cannot be called.
172
+ *
173
+ * @remarks This property should not be directly updated. Please use {@link BaseAdaptiveCardExtension.setState} to update the state after initialization.
174
+ *
175
+ * @readonly
176
+ */ get state() {
177
+ return this._state;
178
+ }
179
+ set state(initialState) {
180
+ if (this._state) {
181
+ throw new Error('state can only be initialized once');
182
+ }
183
+ this._state = initialState;
184
+ }
185
+ // #endregion
186
+ // #region Public Virtual Methods
187
+ /**
188
+ * This value is displayed in Card and Quick view unless it is explicitly overridden by the Views.
189
+ * It is also displayed as the Property Pane title.
190
+ *
191
+ * @remarks By default, this will return the title defined in the manifest.
192
+ *
193
+ * @virtual
194
+ */ get title() {
195
+ return this._title;
196
+ }
197
+ /**
198
+ * Extra properties initialized in the specific card used for when card is loaded telemetry.
199
+ *
200
+ * @internal
201
+ * @virtual
202
+ */ get _aceLoadExtraData() {
203
+ return {};
204
+ }
205
+ /**
206
+ * Extra properties initialized in the specific card used for the action engagement telemetry.
207
+ *
208
+ * @internal
209
+ * @virtual
210
+ */ get _cardActionEngagementExtraData() {
211
+ return {};
212
+ }
213
+ /**
214
+ * The icon url used to render an icon on the Card view.
215
+ *
216
+ * @remarks By default, this will return the iconImageUrl defined in the manifest.
217
+ *
218
+ * @virtual
219
+ */ get iconProperty() {
220
+ return this._iconProperty;
221
+ }
222
+ /**
223
+ * Get the Property Pane configuration for this Adaptive Card Extension. If an Adaptive Card Extension
224
+ * wants to use the Property Pane, then this method must be overriden.
225
+ *
226
+ * @remarks Property Pane resources can be defer loaded to reduce bundle size. See {@link BaseAdaptiveCardExtension.loadPropertyPaneResources}.
227
+ *
228
+ * @virtual
229
+ */ getPropertyPaneConfiguration() {
422
230
  return {
423
231
  pages: []
424
232
  };
425
- };
426
- /**
427
- * API to enable asynchronous loading of Property Pane related resources of the Adaptive Card Extension.
428
- *
429
- * @remarks No Property Pane APIs will be called before this method resolves.
430
- *
431
- * @remarks No Property Pane events will be raised until this method resolves except for `PropertyPaneConfigurationComplete`,
432
- * which can be used to clean up any pending resources.
433
- *
434
- * @virtual
435
- */
436
- BaseAdaptiveCardExtension.prototype.loadPropertyPaneResources = function () {
233
+ }
234
+ /**
235
+ * API to enable asynchronous loading of Property Pane related resources of the Adaptive Card Extension.
236
+ *
237
+ * @remarks No Property Pane APIs will be called before this method resolves.
238
+ *
239
+ * @remarks No Property Pane events will be raised until this method resolves except for `PropertyPaneConfigurationComplete`,
240
+ * which can be used to clean up any pending resources.
241
+ *
242
+ * @virtual
243
+ */ loadPropertyPaneResources() {
437
244
  return Promise.resolve();
438
- };
439
- /**
440
- * Override the default cache settings.
441
- *
442
- * @beta
443
- * @virtual
444
- */
445
- BaseAdaptiveCardExtension.prototype.getCacheSettings = function () {
245
+ }
246
+ /**
247
+ * Override the default cache settings.
248
+ *
249
+ * @beta
250
+ * @virtual
251
+ */ getCacheSettings() {
446
252
  return {};
447
- };
448
- /**
449
- * This virtual method returns a subset of the state object that will be cached by the client.
450
- *
451
- * @remarks If not overriden, this will return an empty object.
452
- * @param state - A shallow clone of the AdaptiveCardExtension state object.
453
- *
454
- * @beta
455
- * @virtual
456
- */
457
- BaseAdaptiveCardExtension.prototype.getCachedState = function (state) {
253
+ }
254
+ /**
255
+ * This virtual method returns a subset of the state object that will be cached by the client.
256
+ *
257
+ * @remarks If not overriden, this will return an empty object.
258
+ * @param state - A shallow clone of the AdaptiveCardExtension state object.
259
+ *
260
+ * @beta
261
+ * @virtual
262
+ */ getCachedState(state) {
458
263
  return {};
459
- };
460
- /**
461
- * Lifecycle method called when a notification is received for this Adaptive Card Extension.
462
- *
463
- * @remarks If the notification should be handled by this Adaptive Card Extension then a registered quick view id
464
- * should be returned. Otherwise, returning undefined will result in the next, if any, Adaptive Card Extension
465
- * to potentially handle the notification event.
466
- *
467
- * @remarks Only one Adaptive Card Extension can handle a notification event. If the event is handled,
468
- * then propagation is finished.
469
- *
470
- * @param notificationArguments - The {@link INotificationArguments} for the current notification event.
471
- *
472
- * @returns A registered quick view id to open or undefined.
473
- *
474
- * @beta
475
- * @virtual
476
- */
477
- BaseAdaptiveCardExtension.prototype.onNotificationReceived = function (notificationArguments) {
264
+ }
265
+ /**
266
+ * Lifecycle method called when a notification is received for this Adaptive Card Extension.
267
+ *
268
+ * @remarks If the notification should be handled by this Adaptive Card Extension then a registered quick view id
269
+ * should be returned. Otherwise, returning undefined will result in the next, if any, Adaptive Card Extension
270
+ * to potentially handle the notification event.
271
+ *
272
+ * @remarks Only one Adaptive Card Extension can handle a notification event. If the event is handled,
273
+ * then propagation is finished.
274
+ *
275
+ * @param notificationArguments - The {@link INotificationArguments} for the current notification event.
276
+ *
277
+ * @returns A registered quick view id to open or undefined.
278
+ *
279
+ * @beta
280
+ * @virtual
281
+ */ onNotificationReceived(notificationArguments) {
478
282
  return undefined;
479
- };
480
- /**
481
- * Lifecycle method called before Action is passed to {@link IAdaptiveCardExtensionActionView.onAction}.
482
- *
483
- * @param action - {@link IOnBeforeActionArguments} for the current action.
484
- *
485
- * @remarks This method is not intended to be used to cancel the action or to change the flow.
486
- *
487
- * @virtual
488
- * @public
489
- */
490
- BaseAdaptiveCardExtension.prototype.onBeforeAction = function (action) {
491
- /* EMPTY BLOCK */
492
- };
493
- /**
494
- * Internal onBeforeAction method used to consolidate methods that need to run across platforms.
495
- * @param action - {@link IOnBeforeActionArguments} for the current action.
496
- *
497
- * @internal
498
- */
499
- BaseAdaptiveCardExtension.prototype._onBeforeAction = function (action, location, mobileSessionId, mobileBootType, componentName) {
500
- if ((0, Killswitches_1.isSupportActionExecuteKSActivated)() && action.type === 'Execute') {
283
+ }
284
+ /**
285
+ * Lifecycle method called before Action is passed to {@link IAdaptiveCardExtensionActionView.onAction}.
286
+ *
287
+ * @param action - {@link IOnBeforeActionArguments} for the current action.
288
+ *
289
+ * @remarks This method is not intended to be used to cancel the action or to change the flow.
290
+ *
291
+ * @virtual
292
+ * @public
293
+ */ onBeforeAction(action) {
294
+ /* EMPTY BLOCK */ }
295
+ /**
296
+ * Internal onBeforeAction method used to consolidate methods that need to run across platforms.
297
+ * @param action - {@link IOnBeforeActionArguments} for the current action.
298
+ *
299
+ * @internal
300
+ */ _onBeforeAction(action, location, mobileSessionId, mobileBootType, componentName) {
301
+ if ((0, _Killswitches.isSupportActionExecuteKSActivated)() && action.type === 'Execute') {
501
302
  return;
502
303
  }
503
304
  this._logCardActionEngagement(action.type, location, mobileSessionId, mobileBootType, componentName);
@@ -508,368 +309,324 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
508
309
  this._beginUpdate();
509
310
  try {
510
311
  this.onBeforeAction(action);
511
- }
512
- finally {
312
+ } finally{
513
313
  this._endUpdate();
514
314
  }
515
- };
516
- /**
517
- * Pass the action arguments onto the current view to handle.
518
- *
519
- * @param action - The {@link IBaseActionArguments} for the current event.
520
- *
521
- * @internal
522
- */
523
- BaseAdaptiveCardExtension.prototype._internalOnAction = function (action) {
524
- var currentView =
525
- // Once the isKeyboardFocusViewNavChangesKSActivated KS is graduated, all the type checks for `_currentView instanceof BaseView` can be removed.
526
- this.navigator._currentView instanceof BaseView_1.BaseView
527
- ? this.navigator._currentView
528
- : this.navigator._currentView.view;
315
+ }
316
+ /**
317
+ * Pass the action arguments onto the current view to handle.
318
+ *
319
+ * @param action - The {@link IBaseActionArguments} for the current event.
320
+ *
321
+ * @internal
322
+ */ _internalOnAction(action) {
323
+ const currentView = // Once the isKeyboardFocusViewNavChangesKSActivated KS is graduated, all the type checks for `_currentView instanceof BaseView` can be removed.
324
+ this.navigator._currentView instanceof _BaseView.BaseView ? this.navigator._currentView : this.navigator._currentView.view;
529
325
  if (currentView && currentView.onAction) {
530
- if ((0, Killswitches_1.isSupportActionExecuteKSActivated)() && action.type === 'Execute') {
326
+ if ((0, _Killswitches.isSupportActionExecuteKSActivated)() && action.type === 'Execute') {
531
327
  // when killswitched is pulled for Action.Execute do not pass action to the view.
532
328
  return;
533
329
  }
534
330
  currentView.onAction(action);
535
- }
536
- else {
331
+ } else {
537
332
  // logging error. We're expecting IAdaptiveCardExtensionActionView
538
- var error = new Error('_internalOnAction is called for non-actionable ACE view');
333
+ const error = new Error('_internalOnAction is called for non-actionable ACE view');
539
334
  this._logInternalOnActionError(error, 'internalOnActionFailure');
540
335
  throw error;
541
336
  }
542
- };
543
- /**
544
- * Pass the action error arguments onto the current view to handle.
545
- *
546
- * @param actionError - The {@link IBaseActionErrorArguments} for the current event.
547
- *
548
- * @internal
549
- */
550
- BaseAdaptiveCardExtension.prototype._internalOnActionError = function (actionError) {
551
- var currentView = this.navigator._currentView instanceof BaseView_1.BaseView
552
- ? this.navigator._currentView
553
- : this.navigator._currentView.view;
337
+ }
338
+ /**
339
+ * Pass the action error arguments onto the current view to handle.
340
+ *
341
+ * @param actionError - The {@link IBaseActionErrorArguments} for the current event.
342
+ *
343
+ * @internal
344
+ */ _internalOnActionError(actionError) {
345
+ const currentView = this.navigator._currentView instanceof _BaseView.BaseView ? this.navigator._currentView : this.navigator._currentView.view;
554
346
  if (currentView && currentView.onActionError) {
555
347
  currentView.onActionError(actionError);
556
- }
557
- else {
348
+ } else {
558
349
  // logging error. We're expecting IAdaptiveCardExtensionActionView
559
- var error = new Error('_internalOnActionError is called for non-actionable ACE view');
350
+ const error = new Error('_internalOnActionError is called for non-actionable ACE view');
560
351
  this._logInternalOnActionError(error, 'internalOnActionErrorFailure');
561
352
  throw error;
562
353
  }
563
- };
564
- /**
565
- * Lifecycle method called before serialization.
566
- *
567
- * @virtual
568
- */
569
- BaseAdaptiveCardExtension.prototype.onBeforeSerialize = function () {
570
- /* EMPTY BLOCK */
571
- };
572
- /**
573
- * Lifecycle method called after the Adaptive Card Extension's properties have been
574
- * updated by a source other than the property pane (except for isolated Adaptive Card Extensions).
575
- *
576
- * @remarks For isolated Adaptive Card Extensions, this lifecycle is invoked instead
577
- * of `onPropertyPaneFieldChanged`.
578
- *
579
- * @param prevProperties - The Adaptive Card Extension properties before the update.
580
- *
581
- * @virtual
582
- */
583
- BaseAdaptiveCardExtension.prototype.onAfterPropertiesUpdatedExternally = function (prevProperties) {
584
- /* EMPTY BLOCK */
585
- };
586
- /**
587
- * Lifecycle method called before the property bag is populated with the deserialized property object.
588
- *
589
- * @remarks
590
- * The default implementation is a no-op. An Adaptive Card Extension developer can override this API if the deserialized object
591
- * does not fully reflect the initial state of the property bag. This gives the Adaptive Card Extension developer a chance to
592
- * populate the property bag right after the data is deserialized to an object.
593
- *
594
- * An important scenario to use deserialize is upgrading. An upgraded Adaptive Card Extension may load the data
595
- * that was serialized by an older version of the Adaptive Card Extension that supported a different schema of the property bag,
596
- * resulting the deserialized object to be incosistent with the current schema of the property bag. The developer
597
- * can use `onAfterDeserialize` to check the dataVersion and fix the property bag.
598
- *
599
- * @param deserializedProperties - The object deserialized from the stored data. Note that the schema of this object
600
- * is not necessarily consistent with the current property bag, because the serialization could have been done by
601
- * an older version of the Adaptive Card Extension
602
- * @param dataVersion - The data version of the stored data being deserialized. You can use this value to determine
603
- * if the data was serialized by an older Adaptive Card Extension. Adaptive Card Extensions can define their data version
604
- * by overriding the dataVersion property.
605
- *
606
- * @returns The property bag of the Adaptive Card Extension
607
- *
608
- * @virtual
609
- */
610
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
611
- BaseAdaptiveCardExtension.prototype.onAfterDeserialize = function (deserializedProperties, dataVersion) {
354
+ }
355
+ /**
356
+ * Lifecycle method called before serialization.
357
+ *
358
+ * @virtual
359
+ */ onBeforeSerialize() {
360
+ /* EMPTY BLOCK */ }
361
+ /**
362
+ * Lifecycle method called after the Adaptive Card Extension's properties have been
363
+ * updated by a source other than the property pane (except for isolated Adaptive Card Extensions).
364
+ *
365
+ * @remarks For isolated Adaptive Card Extensions, this lifecycle is invoked instead
366
+ * of `onPropertyPaneFieldChanged`.
367
+ *
368
+ * @param prevProperties - The Adaptive Card Extension properties before the update.
369
+ *
370
+ * @virtual
371
+ */ onAfterPropertiesUpdatedExternally(prevProperties) {
372
+ /* EMPTY BLOCK */ }
373
+ /**
374
+ * Lifecycle method called before the property bag is populated with the deserialized property object.
375
+ *
376
+ * @remarks
377
+ * The default implementation is a no-op. An Adaptive Card Extension developer can override this API if the deserialized object
378
+ * does not fully reflect the initial state of the property bag. This gives the Adaptive Card Extension developer a chance to
379
+ * populate the property bag right after the data is deserialized to an object.
380
+ *
381
+ * An important scenario to use deserialize is upgrading. An upgraded Adaptive Card Extension may load the data
382
+ * that was serialized by an older version of the Adaptive Card Extension that supported a different schema of the property bag,
383
+ * resulting the deserialized object to be incosistent with the current schema of the property bag. The developer
384
+ * can use `onAfterDeserialize` to check the dataVersion and fix the property bag.
385
+ *
386
+ * @param deserializedProperties - The object deserialized from the stored data. Note that the schema of this object
387
+ * is not necessarily consistent with the current property bag, because the serialization could have been done by
388
+ * an older version of the Adaptive Card Extension
389
+ * @param dataVersion - The data version of the stored data being deserialized. You can use this value to determine
390
+ * if the data was serialized by an older Adaptive Card Extension. Adaptive Card Extensions can define their data version
391
+ * by overriding the dataVersion property.
392
+ *
393
+ * @returns The property bag of the Adaptive Card Extension
394
+ *
395
+ * @virtual
396
+ */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
397
+ onAfterDeserialize(deserializedProperties, dataVersion) {
612
398
  return deserializedProperties;
613
- };
614
- /**
615
- * Lifecycle method called after the {@link @microsoft/sp-core-library#DisplayMode} changed.
616
- *
617
- * @virtual
618
- *
619
- * @param oldDisplayMode - The old display mode.
620
- */
621
- BaseAdaptiveCardExtension.prototype.onDisplayModeChanged = function (oldDisplayMode) {
622
- /* EMPTY BLOCK */
623
- };
624
- /**
625
- * Lifecycle method called before disposing the Adaptive Card Extension.
626
- *
627
- * @virtual
628
- */
629
- BaseAdaptiveCardExtension.prototype.onDispose = function () {
630
- // noop
631
- };
632
- /**
633
- * Lifecycle method called during initialization.
634
- *
635
- * @remarks Asynchronous data fetches should be started during this lifecycle. Rendering can either be dependent on the result
636
- * or, if resolved immediately, a fetching data state can be rendered.
637
- *
638
- * @param cachedLoadParameters - Parameters containing the cached state object (see {@link BaseAdaptiveCardExtension.getCachedState}), which can be used to rehydrate the AdaptiveCardExtension.
639
- * If undefined, the AdaptiveCardExtension was not cached or the cache expired.
640
- *
641
- * @alpha
642
- * @virtual
643
- */
644
- BaseAdaptiveCardExtension.prototype.onInit = function (cachedLoadParameters) {
399
+ }
400
+ /**
401
+ * Lifecycle method called after the {@link @microsoft/sp-core-library#DisplayMode} changed.
402
+ *
403
+ * @virtual
404
+ *
405
+ * @param oldDisplayMode - The old display mode.
406
+ */ onDisplayModeChanged(oldDisplayMode) {
407
+ /* EMPTY BLOCK */ }
408
+ /**
409
+ * Lifecycle method called before disposing the Adaptive Card Extension.
410
+ *
411
+ * @virtual
412
+ */ onDispose() {
413
+ // noop
414
+ }
415
+ /**
416
+ * Lifecycle method called during initialization.
417
+ *
418
+ * @remarks Asynchronous data fetches should be started during this lifecycle. Rendering can either be dependent on the result
419
+ * or, if resolved immediately, a fetching data state can be rendered.
420
+ *
421
+ * @param cachedLoadParameters - Parameters containing the cached state object (see {@link BaseAdaptiveCardExtension.getCachedState}), which can be used to rehydrate the AdaptiveCardExtension.
422
+ * If undefined, the AdaptiveCardExtension was not cached or the cache expired.
423
+ *
424
+ * @alpha
425
+ * @virtual
426
+ */ onInit(cachedLoadParameters) {
645
427
  return Promise.resolve();
646
- };
647
- /**
648
- * @internal
649
- */
650
- BaseAdaptiveCardExtension.prototype._initializeCardNavigator = function () {
651
- return new ViewNavigator_1.ViewNavigator(this._navigatorCallback, this._onViewInitialized);
652
- };
653
- /**
654
- * @internal
655
- */
656
- BaseAdaptiveCardExtension.prototype._initializeQuickViewNavigator = function () {
657
- return new QuickViewNavigator_1.QuickViewNavigator(this._navigatorCallback, this._onQuickViewInitialized, this._closeQuickViewCallback);
658
- };
659
- /**
660
- * Lifecycle method called when a Property Pane field is changed.
661
- *
662
- * @remarks This is invoked for reactive Property Panes.
663
- *
664
- * @param propertyPath - JSON path of the property in the property bag.
665
- * In the case of custom field, if no target property is provided then a custom value is assigned,
666
- * which will be in the form of `__CustomField_<key provided when the custom field is created>`.
667
- * @param oldValue - Old value of the property.
668
- * This value could be undefined/empty in the case of custom field.
669
- * @param newValue - New value of the property.
670
- * This value could be undefined/empty in the case of custom field.
671
- *
672
- * @virtual
673
- */
674
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
675
- BaseAdaptiveCardExtension.prototype.onPropertyPaneFieldChanged = function (propertyPath, oldValue, newValue) {
676
- /* noop */
677
- };
678
- /**
679
- * Lifecycle method called when the {@link RenderType} changes.
680
- *
681
- * @param oldRenderType - The previous {@link RenderType}.
682
- *
683
- * @virtual
684
- */
685
- BaseAdaptiveCardExtension.prototype.onRenderTypeChanged = function (oldRenderType) {
686
- /* EMPTY BLOCK */
687
- };
688
- /**
689
- * The id of the initial Card view.
690
- *
691
- * @remarks A Card view with this id must be registered with {@link cardNavigator} before rendering.
692
- *
693
- * @remarks By default, this returns undefined and will render a default Card view.
694
- *
695
- * @virtual
696
- */
697
- BaseAdaptiveCardExtension.prototype.renderCard = function () {
428
+ }
429
+ /**
430
+ * @internal
431
+ */ _initializeCardNavigator() {
432
+ return new _ViewNavigator.ViewNavigator(this._navigatorCallback, this._onViewInitialized);
433
+ }
434
+ /**
435
+ * @internal
436
+ */ _initializeQuickViewNavigator() {
437
+ return new _QuickViewNavigator.QuickViewNavigator(this._navigatorCallback, this._onQuickViewInitialized, this._closeQuickViewCallback);
438
+ }
439
+ /**
440
+ * Lifecycle method called when a Property Pane field is changed.
441
+ *
442
+ * @remarks This is invoked for reactive Property Panes.
443
+ *
444
+ * @param propertyPath - JSON path of the property in the property bag.
445
+ * In the case of custom field, if no target property is provided then a custom value is assigned,
446
+ * which will be in the form of `__CustomField_<key provided when the custom field is created>`.
447
+ * @param oldValue - Old value of the property.
448
+ * This value could be undefined/empty in the case of custom field.
449
+ * @param newValue - New value of the property.
450
+ * This value could be undefined/empty in the case of custom field.
451
+ *
452
+ * @virtual
453
+ */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
454
+ onPropertyPaneFieldChanged(propertyPath, oldValue, newValue) {
455
+ /* noop */ }
456
+ /**
457
+ * Lifecycle method called when the {@link RenderType} changes.
458
+ *
459
+ * @param oldRenderType - The previous {@link RenderType}.
460
+ *
461
+ * @virtual
462
+ */ onRenderTypeChanged(oldRenderType) {
463
+ /* EMPTY BLOCK */ }
464
+ /**
465
+ * The id of the initial Card view.
466
+ *
467
+ * @remarks A Card view with this id must be registered with {@link cardNavigator} before rendering.
468
+ *
469
+ * @remarks By default, this returns undefined and will render a default Card view.
470
+ *
471
+ * @virtual
472
+ */ renderCard() {
698
473
  return undefined;
699
- };
700
- /**
701
- * Provide Property Pane groups that will appear above the framework-level properties such as card size.
702
- *
703
- * @virtual
704
- * @internal
705
- */
706
- BaseAdaptiveCardExtension.prototype._getPreFrameworkPropertyPaneConfiguration = function () {
474
+ }
475
+ /**
476
+ * Provide Property Pane groups that will appear above the framework-level properties such as card size.
477
+ *
478
+ * @virtual
479
+ * @internal
480
+ */ _getPreFrameworkPropertyPaneConfiguration() {
707
481
  return [];
708
- };
709
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "_isFrameworkPropertyPaneEnabled", {
710
- /**
711
- * Whether the framework will add property pane groups (e.g., cardSize)
712
- *
713
- * @virtual
714
- * @internal
715
- */
716
- get: function () {
717
- return true;
718
- },
719
- enumerable: false,
720
- configurable: true
721
- });
722
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "isVisible", {
723
- // #endregion
724
- // #region Public APIs
725
- /**
726
- * Sets the visibility of the Adaptive Card Extension and re-render
727
- *
728
- * @remarks This method should be called after a card view has been registered.
729
- * Otherwise visibility change will not be applied to the Adaptive Card.
730
- *
731
- * @readonly
732
- */
733
- get: function () {
734
- return this._isVisible;
735
- },
736
- set: function (value) {
737
- this._isVisible = value;
738
- if (this._isInitialized &&
739
- (this.cardNavigator._getRegistrySize() > 0 || this.cardNavigator._currentView instanceof BaseCardView_1.BaseCardView
740
- ? this.cardNavigator._currentView
741
- : this.cardNavigator._currentView.view)) {
742
- this.context._host.onVisibilityChanged(this._getRenderArguments(this.renderType));
743
- }
744
- },
745
- enumerable: false,
746
- configurable: true
747
- });
748
- /**
749
- * Lifecycle method that signifies ACE has finished loading.
750
- * When this API is called, performance data will be generated.
751
- * Depending on `didUpdate` parameter, end marker for the rendering lifecycle can change.
752
- * If an ACE received LKG data and does NOT need to update, render is completed when LKG is used.
753
- * If an ACE received LKG data and DOES need to update, render is completed when new render arguments are used.
754
- * If an ACE does not receive LKG data, render is completed when new render arguments are used.
755
- *
756
- * @param didUpdate - boolean value indicating if ACE has updated.
757
- *
758
- * @beta
759
- */
760
- BaseAdaptiveCardExtension.prototype.renderCompleted = function (didUpdate) {
482
+ }
483
+ /**
484
+ * Whether the framework will add property pane groups (e.g., cardSize)
485
+ *
486
+ * @virtual
487
+ * @internal
488
+ */ get _isFrameworkPropertyPaneEnabled() {
489
+ return true;
490
+ }
491
+ // #endregion
492
+ // #region Public APIs
493
+ /**
494
+ * Sets the visibility of the Adaptive Card Extension and re-render
495
+ *
496
+ * @remarks This method should be called after a card view has been registered.
497
+ * Otherwise visibility change will not be applied to the Adaptive Card.
498
+ *
499
+ * @readonly
500
+ */ get isVisible() {
501
+ return this._isVisible;
502
+ }
503
+ set isVisible(value) {
504
+ this._isVisible = value;
505
+ if (this._isInitialized && (this.cardNavigator._getRegistrySize() > 0 || this.cardNavigator._currentView instanceof _BaseCardView.BaseCardView ? this.cardNavigator._currentView : this.cardNavigator._currentView.view)) {
506
+ this.context._host.onVisibilityChanged(this._getRenderArguments(this.renderType));
507
+ }
508
+ }
509
+ /**
510
+ * Lifecycle method that signifies ACE has finished loading.
511
+ * When this API is called, performance data will be generated.
512
+ * Depending on `didUpdate` parameter, end marker for the rendering lifecycle can change.
513
+ * If an ACE received LKG data and does NOT need to update, render is completed when LKG is used.
514
+ * If an ACE received LKG data and DOES need to update, render is completed when new render arguments are used.
515
+ * If an ACE does not receive LKG data, render is completed when new render arguments are used.
516
+ *
517
+ * @param didUpdate - boolean value indicating if ACE has updated.
518
+ *
519
+ * @beta
520
+ */ renderCompleted(didUpdate) {
761
521
  if (this._renderCompletedPromiseResolver) {
762
522
  this._renderCompletedPromiseResolver(didUpdate);
763
523
  }
764
- };
765
- BaseAdaptiveCardExtension.prototype._endMarkForRenderComplete = function (didUpdate, didTimeOut) {
766
- var monitor = new sp_diagnostics_1._QosMonitor("AdaptiveCardExtension.RenderCompleted");
524
+ }
525
+ _endMarkForRenderComplete(didUpdate, didTimeOut) {
526
+ const monitor = new _spdiagnostics._QosMonitor(`AdaptiveCardExtension.RenderCompleted`);
767
527
  if (!this._isLoggedRenderPerf) {
768
528
  if (didUpdate) {
769
529
  if (didTimeOut) {
770
- sp_telemetry_1._PerformanceLogger.endFailureForComponent(this._perfTagName, 'TimeOut', undefined /** Error */, undefined /** Result Type */, !(0, Killswitches_1.isAddVetoForACEKSActivated)() ? AdaptiveCardExtensionLoader_1.ASHA_ACE_LOAD_FAILURE : undefined);
530
+ _sptelemetry._PerformanceLogger.endFailureForComponent(this._perfTagName, 'TimeOut', undefined /** Error */ , undefined /** Result Type */ , !(0, _Killswitches.isAddVetoForACEKSActivated)() ? _AdaptiveCardExtensionLoader.ASHA_ACE_LOAD_FAILURE : undefined);
531
+ } else {
532
+ _sptelemetry._PerformanceLogger.endMarkForComponent(this._perfTagName);
771
533
  }
772
- else {
773
- sp_telemetry_1._PerformanceLogger.endMarkForComponent(this._perfTagName);
774
- }
775
- }
776
- else {
534
+ } else {
777
535
  // this._lkgRenderTime will be defined if this.isRenderAsync is equal to true
778
- sp_telemetry_1._PerformanceLogger.endMarkForComponentWithTimestamp(this._perfTagName, this._lkgRenderTime);
536
+ _sptelemetry._PerformanceLogger.endMarkForComponentWithTimestamp(this._perfTagName, this._lkgRenderTime);
779
537
  }
780
538
  this._isLoggedRenderPerf = true;
781
539
  }
782
- var aceLoadData = sp_component_base_2._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
783
- var extraData = tslib_1.__assign(tslib_1.__assign({}, aceLoadData), { isInternal: this.manifest.isInternal || false, isInitializedWithLKG: this._isInitializedWithLKG, didTimeOut: didTimeOut, didUpdate: didUpdate, displayMode: this.displayMode });
540
+ const aceLoadData = _spcomponentbase._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
541
+ const extraData = {
542
+ ...aceLoadData,
543
+ isInternal: this.manifest.isInternal || false,
544
+ isInitializedWithLKG: this._isInitializedWithLKG,
545
+ didTimeOut: didTimeOut,
546
+ didUpdate: didUpdate,
547
+ displayMode: this.displayMode
548
+ };
784
549
  if (didTimeOut) {
785
550
  monitor.writeUnexpectedFailure('', undefined, extraData);
786
- }
787
- else {
551
+ } else {
788
552
  monitor.writeSuccess(extraData);
789
553
  }
790
554
  this.context._host.onRenderCompleted(this.instanceId, didUpdate);
791
555
  this._clearRenderCompletedGuardTimer();
792
- };
793
- BaseAdaptiveCardExtension.prototype._resolveRenderCompleted = function () {
794
- var _this = this;
795
- this._renderCompletedPromise.then(function (didUpdate) {
796
- _this._endMarkForRenderComplete(didUpdate, false);
797
- }).catch(function () {
798
- _this._endMarkForRenderComplete(true, true);
556
+ }
557
+ _resolveRenderCompleted() {
558
+ this._renderCompletedPromise.then((didUpdate)=>{
559
+ this._endMarkForRenderComplete(didUpdate, false);
560
+ }).catch(()=>{
561
+ this._endMarkForRenderComplete(true, true);
799
562
  });
800
- };
801
- /**
802
- * Update the state of the Adaptive Card Extension and re-render.
803
- *
804
- * @remarks Calling {@link BaseAdaptiveCardExtension.setState} without a new state will trigger the code path to re-render with current state.
805
- * However, this does not guarantee a re-render. Re-render will only occur if either state or content of view template has changed.
806
- *
807
- * @remarks {@link BaseAdaptiveCardExtension.state} must have been initialized before calling {@link BaseAdaptiveCardExtension.setState}.
808
- *
809
- * @param newState - The new state to set.
810
- */
811
- BaseAdaptiveCardExtension.prototype.setState = function (newState) {
563
+ }
564
+ /**
565
+ * Update the state of the Adaptive Card Extension and re-render.
566
+ *
567
+ * @remarks Calling {@link BaseAdaptiveCardExtension.setState} without a new state will trigger the code path to re-render with current state.
568
+ * However, this does not guarantee a re-render. Re-render will only occur if either state or content of view template has changed.
569
+ *
570
+ * @remarks {@link BaseAdaptiveCardExtension.state} must have been initialized before calling {@link BaseAdaptiveCardExtension.setState}.
571
+ *
572
+ * @param newState - The new state to set.
573
+ */ setState(newState) {
812
574
  this._internalSetState(newState, true);
813
- };
814
- /**
815
- * @param newState - The new state to set.
816
- * @param isUpdate - Boolean to trigger a re-render of the ACE. By default ACE will update and re-render.
817
- *
818
- * @internal
819
- */
820
- BaseAdaptiveCardExtension.prototype._internalSetState = function (newState, isUpdate) {
821
- if (isUpdate === void 0) { isUpdate = true; }
575
+ }
576
+ /**
577
+ * @param newState - The new state to set.
578
+ * @param isUpdate - Boolean to trigger a re-render of the ACE. By default ACE will update and re-render.
579
+ *
580
+ * @internal
581
+ */ _internalSetState(newState, isUpdate = true) {
822
582
  if (!this._state) {
823
583
  throw new Error('state must be initialized before calling setState');
824
584
  }
825
585
  if (newState) {
826
- this._state = tslib_1.__assign(tslib_1.__assign({}, this.state), (0, sp_lodash_subset_1.cloneDeep)(newState));
586
+ this._state = {
587
+ ...this.state,
588
+ ...(0, _splodashsubset.cloneDeep)(newState)
589
+ };
827
590
  this.cardNavigator._forEach(this._onViewInitialized);
828
591
  this.quickViewNavigator._forEach(this._onQuickViewInitialized);
829
592
  }
830
593
  if (this._isInitialized && !this._isUpdating && isUpdate) {
831
594
  this.context._host.update(this._getRenderArguments(this._renderType));
832
595
  }
833
- };
834
- /**
835
- * Template updating with data updates is equivalent to creating a new card.
836
- * Unlike data updates, we require the disposal of the old card template factory to create a new renderer
837
- *
838
- * @deprecated Use `setState` instead
839
- * @internal
840
- *
841
- * @param renderTypeToUpdate - RenderType
842
- */
843
- BaseAdaptiveCardExtension.prototype.update = function (renderTypeToUpdate, updateOnlyData) {
844
- if (updateOnlyData === void 0) { updateOnlyData = false; }
845
- var card = this._getRenderArguments(renderTypeToUpdate, updateOnlyData);
596
+ }
597
+ /**
598
+ * Template updating with data updates is equivalent to creating a new card.
599
+ * Unlike data updates, we require the disposal of the old card template factory to create a new renderer
600
+ *
601
+ * @deprecated Use `setState` instead
602
+ * @internal
603
+ *
604
+ * @param renderTypeToUpdate - RenderType
605
+ */ update(renderTypeToUpdate, updateOnlyData = false) {
606
+ const card = this._getRenderArguments(renderTypeToUpdate, updateOnlyData);
846
607
  this.context._host.update(card);
847
- };
608
+ }
848
609
  // #endregion
849
610
  // #region Internal APIs
850
611
  /**
851
- * If this._cardObject is undefined create a new object and assign it.
852
- * Otherwise update the existing this._cardObject according to RenderType
853
- * @param renderTypeToUpdate - RenderType
854
- *
855
- * @internal
856
- */
857
- BaseAdaptiveCardExtension.prototype._getRenderArguments = function (renderTypeToUpdate, updateOnlyData, initialViewId) {
858
- var _this = this;
859
- var _a;
860
- if (updateOnlyData === void 0) { updateOnlyData = false; }
861
- var monitor = new sp_diagnostics_1._QosMonitor("AdaptiveCardExtension.GetRenderArguments.".concat(renderTypeToUpdate));
612
+ * If this._cardObject is undefined create a new object and assign it.
613
+ * Otherwise update the existing this._cardObject according to RenderType
614
+ * @param renderTypeToUpdate - RenderType
615
+ *
616
+ * @internal
617
+ */ _getRenderArguments(renderTypeToUpdate, updateOnlyData = false, initialViewId) {
618
+ const monitor = new _spdiagnostics._QosMonitor(`AdaptiveCardExtension.GetRenderArguments.${renderTypeToUpdate}`);
862
619
  try {
863
620
  if (!this._isInitialized) {
864
621
  monitor.writeUnexpectedFailure('ACE is not initialized');
865
- throw new Error("".concat(this.context.manifest.alias, " is not initialized"));
622
+ throw new Error(`${this.context.manifest.alias} is not initialized`);
866
623
  }
867
624
  this._setRenderType(renderTypeToUpdate, initialViewId);
868
625
  if (renderTypeToUpdate === 'Card' && this.cardNavigator.size === 0) {
869
- var initialCardId = this.renderCard();
626
+ let initialCardId = this.renderCard();
870
627
  if (!initialCardId) {
871
628
  initialCardId = DEFAULT_VIEW_ID;
872
- this.cardNavigator.register(initialCardId, function () { return new DefaultCardView_1.DefaultCardView(_this.description); });
629
+ this.cardNavigator.register(initialCardId, ()=>new _DefaultCardView.DefaultCardView(this.description));
873
630
  }
874
631
  this.cardNavigator.push(initialCardId, true);
875
632
  }
@@ -881,45 +638,50 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
881
638
  lastUpdatedType: renderTypeToUpdate,
882
639
  quickLook: renderTypeToUpdate === 'QuickView' ? this._getQuickView(updateOnlyData) : undefined
883
640
  };
884
- }
885
- else {
641
+ } else {
886
642
  this._updateRenderArgs(renderTypeToUpdate, updateOnlyData);
887
643
  }
888
- if (
889
- /**
890
- * When graduating isIsolatedAdaptiveCardExtensionWebPropertyPaneWorkAroundKSActivated only leave this.displayMode check.
891
- * This is a workaround when load ACE WP in isolation to render the property pane. We need to update LKG to keep data consistent after editing.
892
- * owner: joyi
893
- */
894
- ((!(0, Killswitches_1.isIsolatedAdaptiveCardExtensionWebPropertyPaneWorkAroundKSActivated)() &&
895
- !!this.context.manifest.isolatedDomain) ||
896
- this.displayMode === sp_core_library_1.DisplayMode.Read) &&
897
- renderTypeToUpdate === 'Card') {
898
- var cacheObject = (_a = this._cacheManager) === null || _a === void 0 ? void 0 : _a.save(this._cacheKey, this.instanceId, this.cardNavigator._currentView instanceof BaseCardView_1.BaseCardView
899
- ? this.cardNavigator._currentView
900
- : this.cardNavigator._currentView.view, this._ACRenderArgs, this.cardNavigator.viewStack.map(function (cvItem) { return (typeof cvItem === 'string' ? cvItem : cvItem.id); }), this.getCachedState(tslib_1.__assign({}, this._state)), this.manifest, this.cardNavigator.currentId);
644
+ if (/**
645
+ * When graduating isIsolatedAdaptiveCardExtensionWebPropertyPaneWorkAroundKSActivated only leave this.displayMode check.
646
+ * This is a workaround when load ACE WP in isolation to render the property pane. We need to update LKG to keep data consistent after editing.
647
+ * owner: joyi
648
+ */ (!(0, _Killswitches.isIsolatedAdaptiveCardExtensionWebPropertyPaneWorkAroundKSActivated)() && !!this.context.manifest.isolatedDomain || this.displayMode === _spcorelibrary.DisplayMode.Read) && renderTypeToUpdate === 'Card') {
649
+ const cacheObject = this._cacheManager?.save(this._cacheKey, this.instanceId, this.cardNavigator._currentView instanceof _BaseCardView.BaseCardView ? this.cardNavigator._currentView : this.cardNavigator._currentView.view, this._ACRenderArgs, this.cardNavigator.viewStack.map((cvItem)=>typeof cvItem === 'string' ? cvItem : cvItem.id), this.getCachedState({
650
+ ...this._state
651
+ }), this.manifest, this.cardNavigator.currentId);
901
652
  this._ACRenderArgs.cacheObject = cacheObject;
902
653
  }
903
- var extraData = void 0;
654
+ let extraData;
904
655
  if (!this._isLoggedRenderPerf && !this.isRenderAsync) {
905
- sp_telemetry_1._PerformanceLogger.endMarkForComponent(this._perfTagName);
906
- extraData = sp_component_base_2._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
656
+ _sptelemetry._PerformanceLogger.endMarkForComponent(this._perfTagName);
657
+ extraData = _spcomponentbase._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
907
658
  this._isLoggedRenderPerf = true;
908
659
  this.context._host.onRenderCompleted(this.instanceId, true);
909
660
  }
910
- extraData = tslib_1.__assign(tslib_1.__assign({}, extraData), { isInternal: this.manifest.isInternal || false, displayMode: this.displayMode });
661
+ extraData = {
662
+ ...extraData,
663
+ isInternal: this.manifest.isInternal || false,
664
+ displayMode: this.displayMode
665
+ };
911
666
  monitor.writeSuccess(extraData);
912
- }
913
- catch (err) {
914
- var extraData = void 0;
667
+ } catch (err) {
668
+ let extraData;
915
669
  if (!this._isLoggedRenderPerf) {
916
- sp_telemetry_1._PerformanceLogger.endFailureForComponent(this._perfTagName, 'Render', err, undefined /** Result Type */, !(0, Killswitches_1.isAddVetoForACEKSActivated)() ? AdaptiveCardExtensionLoader_1.ASHA_ACE_LOAD_FAILURE : undefined);
917
- extraData = sp_component_base_2._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
670
+ _sptelemetry._PerformanceLogger.endFailureForComponent(this._perfTagName, 'Render', err, undefined /** Result Type */ , !(0, _Killswitches.isAddVetoForACEKSActivated)() ? _AdaptiveCardExtensionLoader.ASHA_ACE_LOAD_FAILURE : undefined);
671
+ extraData = _spcomponentbase._WebPartLoadDataCollector.collect(this.context.manifest, this._perfTagName, this.context.pageContext);
918
672
  this._isLoggedRenderPerf = true;
919
673
  this.context._host.onRenderCompleted(this.instanceId, true);
920
674
  }
921
- monitor.writeUnexpectedFailure('failedGetRenderArguments', err, tslib_1.__assign(tslib_1.__assign({}, extraData), { alias: this.context.manifest.alias, deviceContext: this.context.deviceContext, instanceId: this.instanceId, isInternal: this.manifest.isInternal || false, manifestId: this.context.manifest.id, displayMode: this.displayMode }));
922
- if (this.manifest.isInternal && this.displayMode === sp_core_library_1.DisplayMode.Edit) {
675
+ monitor.writeUnexpectedFailure('failedGetRenderArguments', err, {
676
+ ...extraData,
677
+ alias: this.context.manifest.alias,
678
+ deviceContext: this.context.deviceContext,
679
+ instanceId: this.instanceId,
680
+ isInternal: this.manifest.isInternal || false,
681
+ manifestId: this.context.manifest.id,
682
+ displayMode: this.displayMode
683
+ });
684
+ if (this.manifest.isInternal && this.displayMode === _spcorelibrary.DisplayMode.Edit) {
923
685
  // log to ASHA edit customer promise for 1P card view in edit mode.
924
686
  // note: all actions are blocked in edit mode, thus only card view is available.
925
687
  this.context._logEditCustomerPromiseFailure(this.manifest.alias, err.message, 'AdaptiveCardExtensionGetRenderArgumentsFailed');
@@ -928,39 +690,31 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
928
690
  throw err;
929
691
  }
930
692
  return this._ACRenderArgs;
931
- };
693
+ }
932
694
  /**
933
- * @internal
934
- */
935
- BaseAdaptiveCardExtension.prototype._propertiesMetadata = function () {
695
+ * @internal
696
+ */ _propertiesMetadata() {
936
697
  return this.propertiesMetadata;
937
- };
698
+ }
938
699
  /**
939
- * @internal
940
- */
941
- BaseAdaptiveCardExtension.prototype._getPropertyPaneConfiguration = function () {
700
+ * @internal
701
+ */ _getPropertyPaneConfiguration() {
942
702
  return this.getPropertyPaneConfiguration();
943
- };
944
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "navigator", {
945
- /**
946
- * The current {@link ViewNavigator}.
947
- *
948
- * @remarks If the current {@link BaseAdaptiveCardExtension.renderType} is `Card`
949
- * then returns {@link BaseAdaptiveCardExtension.cardNavigator}.
950
- *
951
- * @remarks If the current {@link BaseAdaptiveCardExtension.renderType} is `QuickView`
952
- * then returns {@link BaseAdaptiveCardExtension.quickViewNavigator}.
953
- */
954
- get: function () {
955
- return this.renderType === 'Card' ? this.cardNavigator : this.quickViewNavigator;
956
- },
957
- enumerable: false,
958
- configurable: true
959
- });
960
- /**
961
- * @internal
962
- */
963
- BaseAdaptiveCardExtension.prototype._internalDeserialize = function (data) {
703
+ }
704
+ /**
705
+ * The current {@link ViewNavigator}.
706
+ *
707
+ * @remarks If the current {@link BaseAdaptiveCardExtension.renderType} is `Card`
708
+ * then returns {@link BaseAdaptiveCardExtension.cardNavigator}.
709
+ *
710
+ * @remarks If the current {@link BaseAdaptiveCardExtension.renderType} is `QuickView`
711
+ * then returns {@link BaseAdaptiveCardExtension.quickViewNavigator}.
712
+ */ get navigator() {
713
+ return this.renderType === 'Card' ? this.cardNavigator : this.quickViewNavigator;
714
+ }
715
+ /**
716
+ * @internal
717
+ */ _internalDeserialize(data) {
964
718
  if (data.title) {
965
719
  this._title = data.title;
966
720
  }
@@ -974,19 +728,18 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
974
728
  this._cardSize = data.cardSize;
975
729
  }
976
730
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
977
- var deserializedProperties = data.properties;
731
+ const deserializedProperties = data.properties;
978
732
  if (this.renderedFromPersistedData) {
979
- sp_component_base_1._PropertyMetadataProcessor.reInstateServerProcessedData(this.propertiesMetadata, deserializedProperties, data.serverProcessedContent);
733
+ _spcomponentbase._PropertyMetadataProcessor.reInstateServerProcessedData(this.propertiesMetadata, deserializedProperties, data.serverProcessedContent);
980
734
  // Unset the server processed content to avoid duplicated process in BaseWebPart.
981
735
  data.serverProcessedContent = undefined;
982
736
  }
983
737
  if (this._properties) {
984
738
  // For isolated ACEs we need to keep the same reference for the lifecycle of the ACE
985
739
  Object.assign(this._properties, deserializedProperties);
986
- }
987
- else {
740
+ } else {
988
741
  // When this is called when the ACE is first created using a preconfigured entry, data.dataVersion could be undefined
989
- this._properties = this.onAfterDeserialize(deserializedProperties, data.dataVersion ? sp_core_library_1.Version.parse(data.dataVersion) : this.dataVersion);
742
+ this._properties = this.onAfterDeserialize(deserializedProperties, data.dataVersion ? _spcorelibrary.Version.parse(data.dataVersion) : this.dataVersion);
990
743
  }
991
744
  if (this.isRenderAsync) {
992
745
  this._startRenderCompletedGuardTimer();
@@ -994,88 +747,80 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
994
747
  this._cacheKey = this._generateCacheKey(data.dashboardWebPartInstanceId);
995
748
  this._instanceIdForLogs = data.instanceIdForLogs ? data.instanceIdForLogs : data.instanceId;
996
749
  this._dashboardUniqueId = data.dashboardUniqueId;
997
- };
750
+ }
998
751
  /**
999
- * @internal
1000
- */
1001
- BaseAdaptiveCardExtension.prototype._internalInitialize = function (context, addedFromPersistedData, initialDisplayMode, tagName, isInitializedWithLKG, appHostType) {
1002
- var _this = this;
1003
- _super.prototype._initializeContext.call(this, context);
752
+ * @internal
753
+ */ _internalInitialize(context, addedFromPersistedData, initialDisplayMode, tagName, isInitializedWithLKG, appHostType) {
754
+ super._initializeContext(context);
1004
755
  this._displayMode = initialDisplayMode;
1005
756
  this._renderedOnce = false;
1006
757
  this._renderedFromPersistedData = addedFromPersistedData;
1007
- this._cacheManager = new CacheManager_1.CacheManager(this.context, function () { return _this.cardSize; }, function () { return _this.iconProperty; }, function () { return _this.title; }, this._onViewInitialized, this.getCacheSettings());
758
+ this._cacheManager = new _CacheManager.CacheManager(this.context, ()=>this.cardSize, ()=>this.iconProperty, ()=>this.title, this._onViewInitialized, this.getCacheSettings());
1008
759
  this._perfTagName = tagName;
1009
760
  this._isInitializedWithLKG = isInitializedWithLKG;
1010
- if (!(0, Killswitches_1.isAddAppHostTypeToCardActionKSActivated)()) {
761
+ if (!(0, _Killswitches.isAddAppHostTypeToCardActionKSActivated)()) {
1011
762
  this._appHostType = appHostType;
1012
763
  }
1013
- };
1014
- /**
1015
- * Internal API to switch the Adaptive Card Extension's display mode.
1016
- *
1017
- * The AdaptiveCardExtensionWebPart, in its method of the same name, calls this method.
1018
- *
1019
- * @param newDisplayMode - the new DisplayMode of the Web Part hosting this Adaptive Card Extension.
1020
- *
1021
- * @internal
1022
- */
1023
- BaseAdaptiveCardExtension.prototype._internalSetDisplayMode = function (newDisplayMode) {
764
+ }
765
+ /**
766
+ * Internal API to switch the Adaptive Card Extension's display mode.
767
+ *
768
+ * The AdaptiveCardExtensionWebPart, in its method of the same name, calls this method.
769
+ *
770
+ * @param newDisplayMode - the new DisplayMode of the Web Part hosting this Adaptive Card Extension.
771
+ *
772
+ * @internal
773
+ */ _internalSetDisplayMode(newDisplayMode) {
1024
774
  if (this._displayMode !== newDisplayMode) {
1025
- var oldDisplayMode = this._displayMode;
775
+ const oldDisplayMode = this._displayMode;
1026
776
  this._displayMode = newDisplayMode;
1027
777
  this.onDisplayModeChanged(oldDisplayMode);
1028
778
  }
1029
- };
779
+ }
1030
780
  /**
1031
- * API to enable asynchronous loading of property pane related resources of a web part.
1032
- *
1033
- * @internal
1034
- */
1035
- BaseAdaptiveCardExtension.prototype._loadPropertyPaneResources = function () {
781
+ * API to enable asynchronous loading of property pane related resources of a web part.
782
+ *
783
+ * @internal
784
+ */ _loadPropertyPaneResources() {
1036
785
  return this.loadPropertyPaneResources();
1037
- };
1038
- /**
1039
- * Invoked from the AdaptiveCardExtensionWebPart's `onPropertyPaneFieldChanged` implementation.
1040
- *
1041
- * @param propertyPath - property to update.
1042
- * @param oldValue - old value.
1043
- * @param newValue - new value.
1044
- *
1045
- * @internal
1046
- */
1047
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1048
- BaseAdaptiveCardExtension.prototype._onPropertyPaneFieldChanged = function (propertyPath, oldValue, newValue) {
1049
- if (!(0, sp_lodash_subset_1.isEqual)(oldValue, newValue)) {
786
+ }
787
+ /**
788
+ * Invoked from the AdaptiveCardExtensionWebPart's `onPropertyPaneFieldChanged` implementation.
789
+ *
790
+ * @param propertyPath - property to update.
791
+ * @param oldValue - old value.
792
+ * @param newValue - new value.
793
+ *
794
+ * @internal
795
+ */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
796
+ _onPropertyPaneFieldChanged(propertyPath, oldValue, newValue) {
797
+ if (!(0, _splodashsubset.isEqual)(oldValue, newValue)) {
1050
798
  this._updateProperty(propertyPath, newValue);
1051
799
  this.onPropertyPaneFieldChanged(propertyPath, oldValue, newValue);
1052
800
  }
1053
- };
801
+ }
1054
802
  /**
1055
- * @internal
1056
- */
1057
- BaseAdaptiveCardExtension.prototype._renderCompleted = function () {
803
+ * @internal
804
+ */ _renderCompleted() {
1058
805
  this._renderedOnce = true;
1059
- };
806
+ }
1060
807
  /**
1061
- * @internal
1062
- */
1063
- BaseAdaptiveCardExtension.prototype._internalOnAfterInit = function () {
808
+ * @internal
809
+ */ _internalOnAfterInit() {
1064
810
  this._isInitialized = true;
1065
811
  if (this.isRenderAsync) {
1066
812
  // If LKG cache exists the host would have rendered it while the ACE was initializing.
1067
813
  // Capture this._lkgRenderTime after async rendering ACE is initialized.
1068
- this._lkgRenderTime = sp_telemetry_1._PerformanceLogger.now();
814
+ this._lkgRenderTime = _sptelemetry._PerformanceLogger.now();
1069
815
  }
1070
- };
816
+ }
1071
817
  /**
1072
- * Return the persisted content of Adaptive Card Extension.
1073
- *
1074
- * @internal
1075
- */
1076
- BaseAdaptiveCardExtension.prototype._internalSerialize = function () {
818
+ * Return the persisted content of Adaptive Card Extension.
819
+ *
820
+ * @internal
821
+ */ _internalSerialize() {
1077
822
  this.onBeforeSerialize();
1078
- var aceData = {
823
+ const aceData = {
1079
824
  dataVersion: this.dataVersion.toString(),
1080
825
  id: this.componentId,
1081
826
  instanceId: this.instanceId,
@@ -1085,20 +830,19 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
1085
830
  iconProperty: this.iconProperty,
1086
831
  cardSize: this._cardSize
1087
832
  };
1088
- if (!(0, Killswitches_1.isSerializeConnectedTeamsAppIdKSActivated)()) {
833
+ if (!(0, _Killswitches.isSerializeConnectedTeamsAppIdKSActivated)()) {
1089
834
  aceData.connectedTeamsAppId = this.manifest.connectedTeamsAppId;
1090
835
  }
1091
836
  return aceData;
1092
- };
1093
- /**
1094
- * Internal API called by the AdaptiveCardExtensionWebPart / Bridge to inform the AdaptiveCardExtension that the RenderType has changed
1095
- * This API calls the onRenderTypeChanged event method
1096
- *
1097
- * @internal
1098
- */
1099
- BaseAdaptiveCardExtension.prototype._setRenderType = function (newRenderType, initialViewId) {
837
+ }
838
+ /**
839
+ * Internal API called by the AdaptiveCardExtensionWebPart / Bridge to inform the AdaptiveCardExtension that the RenderType has changed
840
+ * This API calls the onRenderTypeChanged event method
841
+ *
842
+ * @internal
843
+ */ _setRenderType(newRenderType, initialViewId) {
1100
844
  if (this._renderType !== newRenderType) {
1101
- var oldRenderType = this._renderType;
845
+ const oldRenderType = this._renderType;
1102
846
  // When the Quick view closes, clear the view stack
1103
847
  if (oldRenderType === 'QuickView') {
1104
848
  this.quickViewNavigator._clear();
@@ -1112,157 +856,138 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
1112
856
  this._renderType = newRenderType;
1113
857
  this.onRenderTypeChanged(oldRenderType);
1114
858
  }
1115
- };
1116
- /**
1117
- * This function updates property pane configurable fields on base adaptive card extension
1118
- *
1119
- * @param path - property pane path that specifies which field to update
1120
- * @param value - new value to update the field with
1121
- *
1122
- * @internal
1123
- */
1124
- BaseAdaptiveCardExtension.prototype._updateConfigurableFields = function (path, value) {
1125
- switch (path) {
859
+ }
860
+ /**
861
+ * This function updates property pane configurable fields on base adaptive card extension
862
+ *
863
+ * @param path - property pane path that specifies which field to update
864
+ * @param value - new value to update the field with
865
+ *
866
+ * @internal
867
+ */ _updateConfigurableFields(path, value) {
868
+ switch(path){
1126
869
  case 'cardSize':
1127
870
  this._cardSize = value;
1128
871
  break;
1129
872
  }
1130
- };
1131
- /**
1132
- * Tracks Adaptive Card Extension card action.
1133
- *
1134
- * @param actionType - Type of action performed
1135
- * @param location - See {@link @microsoft/sp-webpart-base#IWebPartManagerContext.PageHostLayoutType}.
1136
- * @param mobileSessionId - mobile session id
1137
- * @param mobileBootType - mobile boot type
1138
- *
1139
- * @internal
1140
- */
1141
- BaseAdaptiveCardExtension.prototype._logCardActionEngagement = function (actionType, location, mobileSessionId, mobileBootType, componentName) {
1142
- var engagementData = this._getBaseEngagementData(location, !(0, Killswitches_1.isSurfaceOnBeforeActionKSActivated)()
1143
- ? this.renderType
1144
- : actionType === 'QuickView'
1145
- ? 'Card'
1146
- : this.renderType, mobileSessionId, mobileBootType);
1147
- engagementData.name = VivaConnectionsAnalyticsEngagementEvents_1.ADAPTIVECARDEXTENSION_CARDACTION;
873
+ }
874
+ /**
875
+ * Tracks Adaptive Card Extension card action.
876
+ *
877
+ * @param actionType - Type of action performed
878
+ * @param location - See {@link @microsoft/sp-webpart-base#IWebPartManagerContext.PageHostLayoutType}.
879
+ * @param mobileSessionId - mobile session id
880
+ * @param mobileBootType - mobile boot type
881
+ *
882
+ * @internal
883
+ */ _logCardActionEngagement(actionType, location, mobileSessionId, mobileBootType, componentName) {
884
+ const engagementData = this._getBaseEngagementData(location, !(0, _Killswitches.isSurfaceOnBeforeActionKSActivated)() ? this.renderType : actionType === 'QuickView' ? 'Card' : this.renderType, mobileSessionId, mobileBootType);
885
+ engagementData.name = _VivaConnectionsAnalyticsEngagementEvents.ADAPTIVECARDEXTENSION_CARDACTION;
1148
886
  engagementData.isIntentional = true;
1149
- var loggedActionType = actionType;
887
+ let loggedActionType = actionType;
1150
888
  if (actionType === 'ExternalLink') {
1151
889
  loggedActionType = 'OpenUrl';
1152
- }
1153
- else if (!(0, Killswitches_1.isLogExecuteAsSubmitActionKSActivated)() && actionType === 'Execute') {
890
+ } else if (!(0, _Killswitches.isLogExecuteAsSubmitActionKSActivated)() && actionType === 'Execute') {
1154
891
  loggedActionType = 'Submit';
1155
892
  }
1156
893
  engagementData.extraData.actionType = loggedActionType;
1157
894
  engagementData.extraData.componentName = componentName;
1158
895
  this._logEngagement(engagementData);
1159
- };
1160
- /**
1161
- * Tracks Adaptive Card Extension components' events, such as text input onChange.
1162
- *
1163
- * @param componentName - Name of the component (unique name of the component)
1164
- * @param eventName - Name of the event
1165
- * @param location - See {@link @microsoft/sp-webpart-base#IWebPartManagerContext.PageHostLayoutType}.
1166
- * @param mobileSessionId - mobile session id
1167
- * @param mobileBootType - mobile boot type
1168
- *
1169
- * @internal
1170
- */
1171
- BaseAdaptiveCardExtension.prototype._logCardComponentEventEngagement = function (componentName, eventName, location, mobileSessionId, mobileBootType) {
1172
- var _a, _b, _c, _d;
1173
- var engagementData = this._getBaseEngagementData(location, 'Card', mobileSessionId, mobileBootType);
896
+ }
897
+ /**
898
+ * Tracks Adaptive Card Extension components' events, such as text input onChange.
899
+ *
900
+ * @param componentName - Name of the component (unique name of the component)
901
+ * @param eventName - Name of the event
902
+ * @param location - See {@link @microsoft/sp-webpart-base#IWebPartManagerContext.PageHostLayoutType}.
903
+ * @param mobileSessionId - mobile session id
904
+ * @param mobileBootType - mobile boot type
905
+ *
906
+ * @internal
907
+ */ _logCardComponentEventEngagement(componentName, eventName, location, mobileSessionId, mobileBootType) {
908
+ const engagementData = this._getBaseEngagementData(location, 'Card', mobileSessionId, mobileBootType);
1174
909
  engagementData.name = ADAPTIVECARDEXTENSION_COMPONENTEVENT;
1175
910
  engagementData.isIntentional = true;
1176
911
  engagementData.extraData.componentName = componentName;
1177
912
  engagementData.extraData.eventName = eventName;
1178
- engagementData.extraData.isCurrentSiteAHomeSite =
1179
- (_b = (_a = this.context.pageContext) === null || _a === void 0 ? void 0 : _a.legacyPageContext) === null || _b === void 0 ? void 0 : _b.isCurrentSiteAHomeSite;
1180
- engagementData.extraData.isCurrentSiteAVivaBackendSite =
1181
- (_d = (_c = this.context.pageContext) === null || _c === void 0 ? void 0 : _c.legacyPageContext) === null || _d === void 0 ? void 0 : _d.isCurrentSiteAVivaBackendSite;
913
+ engagementData.extraData.isCurrentSiteAHomeSite = this.context.pageContext?.legacyPageContext?.isCurrentSiteAHomeSite;
914
+ engagementData.extraData.isCurrentSiteAVivaBackendSite = this.context.pageContext?.legacyPageContext?.isCurrentSiteAVivaBackendSite;
1182
915
  this._logEngagement(engagementData);
1183
- };
916
+ }
1184
917
  /**
1185
- * @internal
1186
- */
1187
- BaseAdaptiveCardExtension.prototype._initializeCardView = function (view) {
1188
- var _this = this;
918
+ * @internal
919
+ */ _initializeCardView(view) {
1189
920
  this._initializeBaseView(view);
1190
- view._getCardSize = function () { return _this.cardSize; };
1191
- };
921
+ view._getCardSize = ()=>this.cardSize;
922
+ }
1192
923
  /**
1193
- * @internal
1194
- */
1195
- BaseAdaptiveCardExtension.prototype._initializeBaseView = function (view) {
924
+ * @internal
925
+ */ _initializeBaseView(view) {
1196
926
  view._state = this.state;
1197
927
  view._ace = this;
1198
928
  view._properties = this.properties;
1199
929
  view._context = this.context;
1200
- };
1201
- Object.defineProperty(BaseAdaptiveCardExtension.prototype, "_disableReactivePropertyChanges", {
1202
- /**
1203
- *
1204
- * @internal
1205
- * @returns boolean representing whether ACE should have nonreactive property pane
1206
- *
1207
- */
1208
- get: function () {
1209
- return false;
1210
- },
1211
- enumerable: false,
1212
- configurable: true
1213
- });
1214
- /**
1215
- *
1216
- * @internal
1217
- * @returns promise of generic properties of ACE
1218
- * Used when ACE utilizes a nonreactive property pane and has to apply changes asynchronously
1219
- */
1220
- BaseAdaptiveCardExtension.prototype._onPropertyPaneChangesApplied = function () {
930
+ }
931
+ /**
932
+ *
933
+ * @internal
934
+ * @returns boolean representing whether ACE should have nonreactive property pane
935
+ *
936
+ */ get _disableReactivePropertyChanges() {
937
+ return false;
938
+ }
939
+ /**
940
+ *
941
+ * @internal
942
+ * @returns promise of generic properties of ACE
943
+ * Used when ACE utilizes a nonreactive property pane and has to apply changes asynchronously
944
+ */ _onPropertyPaneChangesApplied() {
1221
945
  return Promise.resolve();
1222
- };
1223
- /**
1224
- *
1225
- * @internal
1226
- * Method that is called once property changes were applied asynchronously
1227
- * Used with a nonreactive property pane
1228
- */
1229
- BaseAdaptiveCardExtension.prototype._onAfterPropertyPaneChangesApplied = function () {
1230
- //empty block
1231
- };
1232
- /**
1233
- * Returns the AdaptiveCard payload (template and data), as well as the top PageBar's configuration properties
1234
- *
1235
- * @param updateOnlyData - boolean
1236
- */
1237
- BaseAdaptiveCardExtension.prototype._getQuickView = function (updateOnlyData) {
1238
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
946
+ }
947
+ /**
948
+ *
949
+ * @internal
950
+ * Method that is called once property changes were applied asynchronously
951
+ * Used with a nonreactive property pane
952
+ */ _onAfterPropertyPaneChangesApplied() {
953
+ //empty block
954
+ }
955
+ /**
956
+ * Returns the AdaptiveCard payload (template and data), as well as the top PageBar's configuration properties
957
+ *
958
+ * @param updateOnlyData - boolean
959
+ */ _getQuickView(updateOnlyData) {
1239
960
  if (this.quickViewNavigator.size === 0) {
1240
961
  return undefined;
1241
962
  }
1242
- var currentView = this.quickViewNavigator._currentView instanceof BaseQuickView_1.BaseQuickView
1243
- ? this.quickViewNavigator._currentView
1244
- : (_a = this.quickViewNavigator._currentView) === null || _a === void 0 ? void 0 : _a.view;
963
+ const currentView = this.quickViewNavigator._currentView instanceof _BaseQuickView.BaseQuickView ? this.quickViewNavigator._currentView : this.quickViewNavigator._currentView?.view;
1245
964
  if (currentView === undefined) {
1246
965
  return undefined;
1247
966
  }
1248
- var viewType = currentView._viewType;
967
+ const viewType = currentView._viewType;
1249
968
  if (this._previousQuickViewId !== this.quickViewNavigator.currentId) {
1250
- sp_diagnostics_1._EngagementLogger.log({
969
+ _spdiagnostics._EngagementLogger.log({
1251
970
  name: 'AdaptiveCardExtension.QuickView',
1252
971
  isIntentional: true,
1253
- siteId: (_c = (_b = this.context.pageContext) === null || _b === void 0 ? void 0 : _b.site) === null || _c === void 0 ? void 0 : _c.id.toString(),
1254
- webId: (_e = (_d = this.context.pageContext) === null || _d === void 0 ? void 0 : _d.web) === null || _e === void 0 ? void 0 : _e.id.toString(),
1255
- extraData: tslib_1.__assign({ alias: this.manifest.alias, appHostType: this._appHostType, correlationId: (_h = (_g = (_f = this.context.pageContext) === null || _f === void 0 ? void 0 : _f.site) === null || _g === void 0 ? void 0 : _g.correlationId) === null || _h === void 0 ? void 0 : _h.toString(), deviceContext: this.context.deviceContext, instanceId: this._instanceIdForLogs, quickViewType: viewType, tenantId: (_l = (_k = (_j = this.context.pageContext) === null || _j === void 0 ? void 0 : _j.aadInfo) === null || _k === void 0 ? void 0 : _k.tenantId) === null || _l === void 0 ? void 0 : _l.toString().toLowerCase() }, (!(0, Killswitches_1.isLogBotIdAndTeamsConnectedAppIdKSActivated)()
1256
- ? {
1257
- botId: (_m = this.manifest.properties) === null || _m === void 0 ? void 0 : _m.botId,
1258
- connectedTeamsAppId: this.manifest
1259
- .connectedTeamsAppId
1260
- }
1261
- : {}))
972
+ siteId: this.context.pageContext?.site?.id.toString(),
973
+ webId: this.context.pageContext?.web?.id.toString(),
974
+ extraData: {
975
+ alias: this.manifest.alias,
976
+ appHostType: this._appHostType,
977
+ correlationId: this.context.pageContext?.site?.correlationId?.toString(),
978
+ deviceContext: this.context.deviceContext,
979
+ instanceId: this._instanceIdForLogs,
980
+ quickViewType: viewType,
981
+ tenantId: this.context.pageContext?.aadInfo?.tenantId?.toString().toLowerCase(),
982
+ ...!(0, _Killswitches.isLogBotIdAndTeamsConnectedAppIdKSActivated)() ? {
983
+ botId: this.manifest.properties?.botId,
984
+ connectedTeamsAppId: this.manifest.connectedTeamsAppId
985
+ } : {}
986
+ }
1262
987
  });
1263
988
  }
1264
989
  this._previousQuickViewId = this.quickViewNavigator.currentId;
1265
- var pageBarProperties = {
990
+ const pageBarProperties = {
1266
991
  externalLink: currentView.externalLink,
1267
992
  leftNavigationButtonType: this.quickViewNavigator.size > 1 ? 'Back' : 'Close',
1268
993
  title: currentView.title
@@ -1271,89 +996,80 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
1271
996
  return {
1272
997
  render: this._assignAndRenderWebQuickView,
1273
998
  dispose: this._disposeWebQuickView.bind(this, currentView),
1274
- pageBarProperties: pageBarProperties,
999
+ pageBarProperties,
1275
1000
  viewId: this.quickViewNavigator.currentId,
1276
1001
  viewStackSize: this.quickViewNavigator.size,
1277
1002
  quickViewType: 'WebQuickView'
1278
1003
  };
1279
- }
1280
- else {
1281
- var acQuickView = currentView;
1282
- var focusParameters = acQuickView.focusParameters;
1283
- if (!(this.quickViewNavigator._currentView instanceof BaseQuickView_1.BaseQuickView)) {
1284
- focusParameters =
1285
- acQuickView.focusParameters !== undefined
1286
- ? tslib_1.__assign(tslib_1.__assign({}, acQuickView.focusParameters), { _lastFocusedElement: this.quickViewNavigator._currentView.focusElement }) : {
1287
- focusTarget: undefined,
1288
- _lastFocusedElement: this.quickViewNavigator._currentView.focusElement
1289
- };
1004
+ } else {
1005
+ const acQuickView = currentView;
1006
+ let focusParameters = acQuickView.focusParameters;
1007
+ if (!(this.quickViewNavigator._currentView instanceof _BaseQuickView.BaseQuickView)) {
1008
+ focusParameters = acQuickView.focusParameters !== undefined ? {
1009
+ ...acQuickView.focusParameters,
1010
+ _lastFocusedElement: this.quickViewNavigator._currentView.focusElement
1011
+ } : {
1012
+ focusTarget: undefined,
1013
+ _lastFocusedElement: this.quickViewNavigator._currentView.focusElement
1014
+ };
1290
1015
  }
1291
1016
  return {
1292
1017
  data: acQuickView.data,
1293
- template: updateOnlyData
1294
- ? this._ACRenderArgs.quickLook.template
1295
- : acQuickView.template,
1296
- pageBarProperties: pageBarProperties,
1018
+ template: updateOnlyData ? this._ACRenderArgs.quickLook.template : acQuickView.template,
1019
+ pageBarProperties,
1297
1020
  viewId: this.quickViewNavigator.currentId,
1298
1021
  viewStackSize: this.quickViewNavigator.size,
1299
1022
  focusParameters: focusParameters,
1300
1023
  quickViewType: 'AdaptiveCardQuickView'
1301
1024
  };
1302
1025
  }
1303
- };
1304
- /**
1305
- * Updates this._cardObject fields according to type given
1306
- * If RenderType is
1307
- * 'L1' then call getL1 will be invoked. This will be used internally to support first time render
1308
- * 'L2' and updateOnlyData == false, then getL2Template and getL2Data will be invoked
1309
- * 'L2' and updateOnlyData == true, then getL2Data will be invoked and the last known template will be reused
1310
- * @param renderTypeToUpdate - RenderType
1311
- * @param updateOnlyData - boolean
1312
- */
1313
- BaseAdaptiveCardExtension.prototype._updateRenderArgs = function (renderTypeToUpdate, updateOnlyData) {
1026
+ }
1027
+ /**
1028
+ * Updates this._cardObject fields according to type given
1029
+ * If RenderType is
1030
+ * 'L1' then call getL1 will be invoked. This will be used internally to support first time render
1031
+ * 'L2' and updateOnlyData == false, then getL2Template and getL2Data will be invoked
1032
+ * 'L2' and updateOnlyData == true, then getL2Data will be invoked and the last known template will be reused
1033
+ * @param renderTypeToUpdate - RenderType
1034
+ * @param updateOnlyData - boolean
1035
+ */ _updateRenderArgs(renderTypeToUpdate, updateOnlyData) {
1314
1036
  this._ACRenderArgs.lastUpdatedType = renderTypeToUpdate;
1315
1037
  this._ACRenderArgs.isVisible = this._isVisible;
1316
- if ((0, Killswitches_1.isDashboardCardDeeplinkingKSActivated)() || (0, Killswitches_1.isUpdateCardViewForQVRenderTypeKSActivated)()) {
1038
+ if ((0, _Killswitches.isDashboardCardDeeplinkingKSActivated)() || (0, _Killswitches.isUpdateCardViewForQVRenderTypeKSActivated)()) {
1317
1039
  if (renderTypeToUpdate === 'Card') {
1318
1040
  this._ACRenderArgs.card = this._getCard(updateOnlyData);
1319
- }
1320
- else {
1041
+ } else {
1321
1042
  this._ACRenderArgs.quickLook = this._getQuickView(updateOnlyData);
1322
1043
  }
1323
- }
1324
- else {
1044
+ } else {
1325
1045
  this._ACRenderArgs.card = this._getCard(updateOnlyData);
1326
1046
  if (renderTypeToUpdate === 'QuickView') {
1327
1047
  this._ACRenderArgs.quickLook = this._getQuickView(updateOnlyData);
1328
1048
  }
1329
1049
  }
1330
- };
1331
- BaseAdaptiveCardExtension.prototype._updateProperty = function (path, value) {
1332
- (0, sp_lodash_subset_1.update)(this._properties, path, function () { return value; });
1333
- };
1334
- /**
1335
- * Start renderComplete guard timer.
1336
- * If renderComplete API is not called within DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME seconds,
1337
- * it will automatically invoke renderComplete as a time out.
1338
- *
1339
- * Note: Timer guard exist because BaseClientSideWebpart have a 30 second timer guard.
1340
- * This accounts for isolated ace scenario where it has to create the isolated domain and load the ace in it.
1341
- *
1342
- */
1343
- BaseAdaptiveCardExtension.prototype._startRenderCompletedGuardTimer = function () {
1344
- var _this = this;
1345
- this._renderCompletedPromise = new Promise(function (resolve, reject) {
1346
- _this._renderCompletedPromiseResolver = resolve;
1347
- _this._renderCompletedPromiseRejector = reject;
1050
+ }
1051
+ _updateProperty(path, value) {
1052
+ (0, _splodashsubset.update)(this._properties, path, ()=>value);
1053
+ }
1054
+ /**
1055
+ * Start renderComplete guard timer.
1056
+ * If renderComplete API is not called within DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME seconds,
1057
+ * it will automatically invoke renderComplete as a time out.
1058
+ *
1059
+ * Note: Timer guard exist because BaseClientSideWebpart have a 30 second timer guard.
1060
+ * This accounts for isolated ace scenario where it has to create the isolated domain and load the ace in it.
1061
+ *
1062
+ */ _startRenderCompletedGuardTimer() {
1063
+ this._renderCompletedPromise = new Promise((resolve, reject)=>{
1064
+ this._renderCompletedPromiseResolver = resolve;
1065
+ this._renderCompletedPromiseRejector = reject;
1348
1066
  });
1349
- this._renderCompletedGuardTimer = window.setTimeout(function () {
1350
- _this._renderCompletedPromiseRejector();
1351
- }, !(0, Killswitches_1.isReduceRenderTimeoutKSActivated)()
1352
- ? UPDATED_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME
1353
- : DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME);
1067
+ this._renderCompletedGuardTimer = window.setTimeout(()=>{
1068
+ this._renderCompletedPromiseRejector();
1069
+ }, !(0, _Killswitches.isReduceRenderTimeoutKSActivated)() ? UPDATED_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME : DEFAULT_ASYNC_RENDER_COMPLETED_TIMEOUT_TIME);
1354
1070
  this._resolveRenderCompleted();
1355
- };
1356
- BaseAdaptiveCardExtension.prototype._clearRenderCompletedGuardTimer = function () {
1071
+ }
1072
+ _clearRenderCompletedGuardTimer() {
1357
1073
  if (this._renderCompletedGuardTimer) {
1358
1074
  window.clearTimeout(this._renderCompletedGuardTimer);
1359
1075
  this._renderCompletedGuardTimer = undefined;
@@ -1361,19 +1077,16 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
1361
1077
  this._renderCompletedPromiseRejector = undefined;
1362
1078
  this._renderCompletedPromise = undefined;
1363
1079
  }
1364
- };
1365
- BaseAdaptiveCardExtension.prototype._generateCacheKey = function (dashboardWebPartInstanceId) {
1366
- if (!this.mySiteCacheEnabled ||
1367
- this.context.deviceContext === 'Mobile' ||
1368
- this.context.manifest.isolatedDomain) {
1369
- return LocalStorageACECache_1.LocalStorageACECache.getKey(this.siteId, this.itemId);
1370
- }
1371
- else {
1372
- return dashboardWebPartInstanceId !== null && dashboardWebPartInstanceId !== void 0 ? dashboardWebPartInstanceId : this.instanceId;
1080
+ }
1081
+ _generateCacheKey(dashboardWebPartInstanceId) {
1082
+ if (!this.mySiteCacheEnabled || this.context.deviceContext === 'Mobile' || this.context.manifest.isolatedDomain) {
1083
+ return _LocalStorageACECache.LocalStorageACECache.getKey(this.siteId, this.itemId);
1084
+ } else {
1085
+ return dashboardWebPartInstanceId ?? this.instanceId;
1373
1086
  }
1374
- };
1375
- BaseAdaptiveCardExtension.prototype._logInternalOnActionError = function (error, failureTag) {
1376
- var qosMonitor = new sp_diagnostics_1._QosMonitor('AdaptiveCardExtension._internalOnAction');
1087
+ }
1088
+ _logInternalOnActionError(error, failureTag) {
1089
+ const qosMonitor = new _spdiagnostics._QosMonitor('AdaptiveCardExtension._internalOnAction');
1377
1090
  qosMonitor.writeUnexpectedFailure(failureTag, error, {
1378
1091
  alias: this.context.manifest.alias,
1379
1092
  deviceContext: this.context.deviceContext,
@@ -1382,55 +1095,145 @@ var BaseAdaptiveCardExtension = /** @class */ (function (_super) {
1382
1095
  manifestId: this.context.manifest.id,
1383
1096
  displayMode: this.displayMode
1384
1097
  });
1385
- };
1386
- BaseAdaptiveCardExtension.prototype._beginUpdate = function () {
1098
+ }
1099
+ _beginUpdate() {
1387
1100
  this._isUpdating = true;
1388
- };
1389
- BaseAdaptiveCardExtension.prototype._endUpdate = function () {
1101
+ }
1102
+ _endUpdate() {
1390
1103
  this._isUpdating = false;
1391
- };
1392
- BaseAdaptiveCardExtension.prototype._getBaseEngagementData = function (location, renderType, mobileSessionId, mobileBootType) {
1393
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1394
- var cardPositionData = {};
1104
+ }
1105
+ _getBaseEngagementData(location, renderType, mobileSessionId, mobileBootType) {
1106
+ const cardPositionData = {};
1395
1107
  if (this.context._getPositionOnPage) {
1396
- var cardPositionInfo = this.context._getPositionOnPage();
1108
+ const cardPositionInfo = this.context._getPositionOnPage();
1397
1109
  if (cardPositionInfo) {
1398
1110
  cardPositionData.cardPosition = cardPositionInfo.componentOrder;
1399
1111
  cardPositionData.NumberOfCardsAudienceTargeted = cardPositionInfo.numberOfSectionComponents;
1400
1112
  }
1401
1113
  }
1402
- var listItemUniqueId;
1403
- if (!(0, Flights_1.isEnableDashboardUniqueIdInEngagementLogsEnabled)()) {
1404
- listItemUniqueId = this._urlParams.get('id')
1405
- ? this._urlParams.get('id')
1406
- : (_a = this.context.pageContext.listItem) === null || _a === void 0 ? void 0 : _a.id;
1407
- }
1408
- else {
1114
+ let listItemUniqueId;
1115
+ if (!(0, _Flights.isEnableDashboardUniqueIdInEngagementLogsEnabled)()) {
1116
+ listItemUniqueId = this._urlParams.get('id') ? this._urlParams.get('id') : this.context.pageContext.listItem?.id;
1117
+ } else {
1409
1118
  // Dashboard.aspx SP page -- this.context.pageContext.listItem?.uniqueId
1410
1119
  // vivahome.aspx && VC dashboard webpart -- this._dashboardUniqueId, injected via dashboard webpart
1411
- listItemUniqueId = this._dashboardUniqueId || ((_b = this.context.pageContext.listItem) === null || _b === void 0 ? void 0 : _b.uniqueId) || '';
1120
+ listItemUniqueId = this._dashboardUniqueId || this.context.pageContext.listItem?.uniqueId || '';
1412
1121
  }
1413
1122
  return {
1414
- siteId: (_d = (_c = this.context.pageContext) === null || _c === void 0 ? void 0 : _c.site) === null || _d === void 0 ? void 0 : _d.id.toString(),
1415
- webId: (_f = (_e = this.context.pageContext) === null || _e === void 0 ? void 0 : _e.web) === null || _f === void 0 ? void 0 : _f.id.toString(),
1416
- extraData: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ alias: this.manifest.alias, appHostType: this._appHostType, cardSize: this.cardSize, componentDeveloperName: this.manifest.componentDeveloperName, correlationId: (_j = (_h = (_g = this.context.pageContext) === null || _g === void 0 ? void 0 : _g.site) === null || _h === void 0 ? void 0 : _h.correlationId) === null || _j === void 0 ? void 0 : _j.toString(), deviceContext: this.context.deviceContext, eventSchemaVersion: 10, isInternal: this.manifest.isInternal || false, instanceId: this._instanceIdForLogs, listId: this._urlParams.get('dashboardListID')
1417
- ? this._urlParams.get('dashboardListID')
1418
- : (_k = this.context.pageContext.list) === null || _k === void 0 ? void 0 : _k.id.toString(), listItemUniqueId: listItemUniqueId, manifestId: this.manifest.id, mobileSessionId: mobileSessionId, mobileBootType: mobileBootType, mpnId: this.manifest.mpnId, renderType: renderType, tenantId: (_o = (_m = (_l = this.context.pageContext) === null || _l === void 0 ? void 0 : _l.aadInfo) === null || _m === void 0 ? void 0 : _m.tenantId) === null || _o === void 0 ? void 0 : _o.toString().toLowerCase(), vivaConnectionsAppId: VIVA_CONNECTIONS_APP_ID, vivaConnectionsName: VIVA_CONNECTIONS_NAME, workLoad: location, isCurrentSiteAHomeSite: (_q = (_p = this.context.pageContext) === null || _p === void 0 ? void 0 : _p.legacyPageContext) === null || _q === void 0 ? void 0 : _q.isCurrentSiteAHomeSite, isCurrentSiteAVivaBackendSite: (_s = (_r = this.context.pageContext) === null || _r === void 0 ? void 0 : _r.legacyPageContext) === null || _s === void 0 ? void 0 : _s.isCurrentSiteAVivaBackendSite, templateType: this.cardNavigator._currentView instanceof BaseCardView_1.BaseCardView
1419
- ? this.cardNavigator._currentView._templateType
1420
- : this.cardNavigator._currentView.view._templateType }, cardPositionData), (!(0, Killswitches_1.isLogEngagementExtraDataKSActivated)() ? this._cardActionEngagementExtraData : {})), (!(0, Killswitches_1.isLogBotIdAndTeamsConnectedAppIdKSActivated)()
1421
- ? {
1422
- botId: (_t = this.manifest.properties) === null || _t === void 0 ? void 0 : _t.botId,
1423
- connectedTeamsAppId: this.manifest
1424
- .connectedTeamsAppId
1123
+ siteId: this.context.pageContext?.site?.id.toString(),
1124
+ webId: this.context.pageContext?.web?.id.toString(),
1125
+ extraData: {
1126
+ alias: this.manifest.alias,
1127
+ appHostType: this._appHostType,
1128
+ cardSize: this.cardSize,
1129
+ componentDeveloperName: this.manifest.componentDeveloperName,
1130
+ correlationId: this.context.pageContext?.site?.correlationId?.toString(),
1131
+ deviceContext: this.context.deviceContext,
1132
+ eventSchemaVersion: 10,
1133
+ isInternal: this.manifest.isInternal || false,
1134
+ instanceId: this._instanceIdForLogs,
1135
+ listId: this._urlParams.get('dashboardListID') ? this._urlParams.get('dashboardListID') : this.context.pageContext.list?.id.toString(),
1136
+ listItemUniqueId: listItemUniqueId,
1137
+ manifestId: this.manifest.id,
1138
+ mobileSessionId: mobileSessionId,
1139
+ mobileBootType: mobileBootType,
1140
+ mpnId: this.manifest.mpnId,
1141
+ renderType: renderType,
1142
+ tenantId: this.context.pageContext?.aadInfo?.tenantId?.toString().toLowerCase(),
1143
+ vivaConnectionsAppId: VIVA_CONNECTIONS_APP_ID,
1144
+ vivaConnectionsName: VIVA_CONNECTIONS_NAME,
1145
+ workLoad: location,
1146
+ isCurrentSiteAHomeSite: this.context.pageContext?.legacyPageContext?.isCurrentSiteAHomeSite,
1147
+ isCurrentSiteAVivaBackendSite: this.context.pageContext?.legacyPageContext?.isCurrentSiteAVivaBackendSite,
1148
+ templateType: this.cardNavigator._currentView instanceof _BaseCardView.BaseCardView ? this.cardNavigator._currentView._templateType : this.cardNavigator._currentView.view._templateType,
1149
+ ...cardPositionData,
1150
+ ...!(0, _Killswitches.isLogEngagementExtraDataKSActivated)() ? this._cardActionEngagementExtraData : {},
1151
+ ...!(0, _Killswitches.isLogBotIdAndTeamsConnectedAppIdKSActivated)() ? {
1152
+ botId: this.manifest.properties?.botId,
1153
+ connectedTeamsAppId: this.manifest.connectedTeamsAppId
1154
+ } : {}
1155
+ }
1156
+ };
1157
+ }
1158
+ _logEngagement(engagementData) {
1159
+ _spdiagnostics._EngagementLogger.log(engagementData);
1160
+ }
1161
+ constructor(){
1162
+ super();
1163
+ this._isLoggedRenderPerf = false;
1164
+ // Set to true after onInit is called by the loader
1165
+ this._isInitialized = false;
1166
+ this._isInitializedWithLKG = false;
1167
+ /**
1168
+ * Not over-engineering now, but we can change the type to number in future if we want to support nested beginUpdate...endUpdate.
1169
+ */ this._isUpdating = false;
1170
+ // #endregion
1171
+ // #region Private
1172
+ this._getCard = (updateOnlyData)=>{
1173
+ try {
1174
+ return (0, _getCardRenderParameters.getCardRenderParameters)(this.cardNavigator._currentView instanceof _BaseCardView.BaseCardView ? this.cardNavigator._currentView : this.cardNavigator._currentView.view, this.cardSize, this.context.deviceContext, updateOnlyData ? this._ACRenderArgs.card.template : undefined, this.iconProperty, this.title, this.manifest, this.instanceId, this.cardNavigator.currentId);
1175
+ } catch (error) {
1176
+ this.context._host.onError(error.toString());
1177
+ throw error;
1178
+ }
1179
+ };
1180
+ this._assignAndRenderWebQuickView = (domElement)=>{
1181
+ const currentView = this.quickViewNavigator._currentView instanceof _BaseQuickView.BaseQuickView ? this.quickViewNavigator._currentView : this.quickViewNavigator._currentView?.view;
1182
+ const monitor = new _spdiagnostics._QosMonitor('ACE.WebQuickView.Render');
1183
+ try {
1184
+ if (currentView === undefined || currentView._viewType === 'AdaptiveCardQuickView') {
1185
+ monitor.writeExpectedFailure('IncorrectQVType', undefined, {
1186
+ viewType: currentView._viewType
1187
+ });
1188
+ return;
1189
+ }
1190
+ currentView._setDomElement(domElement);
1191
+ currentView.render();
1192
+ monitor.writeSuccess();
1193
+ } catch (err) {
1194
+ monitor.writeUnexpectedFailure('FailedToRender', err);
1195
+ }
1196
+ };
1197
+ /**
1198
+ * Quick view navigator will modify the stack when navigating between different quick views.
1199
+ * Bind currentView argument to the function when using this method.
1200
+ */ this._disposeWebQuickView = (currentView)=>{
1201
+ const monitor = new _spdiagnostics._QosMonitor('ACE.WebQuickView.Dispose');
1202
+ try {
1203
+ if (currentView === undefined || currentView._viewType === 'AdaptiveCardQuickView') {
1204
+ monitor.writeExpectedFailure('IncorrectQVType', undefined, {
1205
+ viewType: currentView._viewType
1206
+ });
1207
+ return;
1425
1208
  }
1426
- : {}))
1209
+ currentView.dispose();
1210
+ // remove dom element after view has been disposed.
1211
+ currentView._setDomElement(undefined);
1212
+ monitor.writeSuccess();
1213
+ } catch (err) {
1214
+ monitor.writeUnexpectedFailure('FailedToDispose', err);
1215
+ }
1216
+ };
1217
+ this._onViewInitialized = (view)=>{
1218
+ this._initializeCardView(view);
1427
1219
  };
1428
- };
1429
- BaseAdaptiveCardExtension.prototype._logEngagement = function (engagementData) {
1430
- sp_diagnostics_1._EngagementLogger.log(engagementData);
1431
- };
1432
- return BaseAdaptiveCardExtension;
1433
- }(sp_component_base_1.BaseComponent));
1434
- exports.BaseAdaptiveCardExtension = BaseAdaptiveCardExtension;
1435
- (0, sp_core_library_1._ES5CompatibleClass)(BaseAdaptiveCardExtension);
1436
- //# sourceMappingURL=BaseAdaptiveCardExtension.js.map
1220
+ this._onQuickViewInitialized = (view)=>{
1221
+ this._initializeBaseView(view);
1222
+ };
1223
+ this._navigatorCallback = (skipUpdate)=>{
1224
+ if (!skipUpdate) {
1225
+ this.update(this._renderType);
1226
+ }
1227
+ };
1228
+ this._closeQuickViewCallback = ()=>{
1229
+ this.context._host.requestRenderTypeChange('Card', this.instanceId);
1230
+ };
1231
+ this._cardSize = DEFAULT_CARD_SIZE;
1232
+ this._renderType = 'Card';
1233
+ this._isVisible = true;
1234
+ this._urlParams = new URLSearchParams(window.location.search);
1235
+ }
1236
+ }
1237
+ (0, _spcorelibrary._ES5CompatibleClass)(BaseAdaptiveCardExtension);
1238
+
1239
+ //# sourceMappingURL=./BaseAdaptiveCardExtension.js.map