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