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

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 (515) 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_3244d02b3778010294cf.js +1 -0
  7. package/dist/sp-adaptive-card-extension-base_en-us_987c6062d9d49260a8cc.js +1 -0
  8. package/dist/sp-adaptive-card-extension-base_qps-ploc_f8efb6a31b8313b3c091.js +1 -0
  9. package/dist/sp-adaptive-card-extension-base_qps-ploca_b3fb73be69b8f5f0f748.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 +22 -17
  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 +391 -400
  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 → lib-dts}/common/Flights.d.ts +0 -1
  119. package/{lib → lib-dts}/isolation/IsolatedAdaptiveCardExtensionService.d.ts +1 -1
  120. package/{lib → lib-dts}/loc/Strings.resx.d.ts +2 -1
  121. package/lib-esm/AdaptiveCardExtensionContext.js +67 -0
  122. package/lib-esm/AdaptiveCardExtensionHost.js +65 -0
  123. package/{lib → lib-esm}/AdaptiveCardExtensionLoader.js +56 -74
  124. package/lib-esm/BaseAdaptiveCardExtension.js +1237 -0
  125. package/{lib → lib-esm}/ac-template/basicL1Template.js +6 -4
  126. package/{lib → lib-esm}/ac-template/basicL1TemplateSelectAction.js +6 -4
  127. package/{lib → lib-esm}/ac-template/common/Constants.js +3 -2
  128. package/{lib → lib-esm}/ac-template/common/CustomElements.js +26 -30
  129. package/{lib → lib-esm}/ac-template/imageL1Template.js +6 -4
  130. package/{lib → lib-esm}/ac-template/imageL1TemplateSelectAction.js +6 -4
  131. package/{lib → lib-esm}/ac-template/index.js +2 -1
  132. package/{lib → lib-esm}/ac-template/primaryTextL1Template.js +10 -5
  133. package/{lib → lib-esm}/ac-template/primaryTextL1TemplateSelectAction.js +10 -5
  134. package/{lib → lib-esm}/ac-template/searchL1Template.js +7 -7
  135. package/{lib → lib-esm}/ac-template/textInputL1Template.js +10 -13
  136. package/{lib → lib-esm}/ac-template/util/actionButtonHelper.js +45 -57
  137. package/{lib → lib-esm}/ac-template/util/getCardRenderParameters.js +75 -92
  138. package/{lib → lib-esm}/actionShim/AdaptiveCardExtensionActionShim.js +74 -87
  139. package/lib-esm/actionShim/IActionShimProvider.js +7 -0
  140. package/{lib → lib-esm}/actionShim/getOnBeforeActionArguments.js +22 -25
  141. package/lib-esm/caching/CacheManager.js +55 -0
  142. package/lib-esm/caching/IAdaptiveCardExtensionCacheObject.js +7 -0
  143. package/lib-esm/caching/ICacheSettings.js +5 -0
  144. package/{lib → lib-esm}/caching/ICachedLoadParameters.js +2 -1
  145. package/lib-esm/caching/cache/ACEMySiteCacheManager.js +130 -0
  146. package/{lib → lib-esm}/caching/cache/BaseAdaptiveCardExtensionCache.js +10 -16
  147. package/lib-esm/caching/cache/IAdaptiveCardExtensionCache.js +7 -0
  148. package/lib-esm/caching/cache/LocalStorageACECache.js +73 -0
  149. package/lib-esm/common/Flights.js +12 -0
  150. package/{lib → lib-esm}/common/Killswitches.js +37 -105
  151. package/lib-esm/components/BarChartComponent.js +112 -0
  152. package/{lib → lib-esm}/components/BaseComponent.js +8 -4
  153. package/lib-esm/components/CardBarComponent.js +10 -0
  154. package/{lib → lib-esm}/components/CardButtonComponent.js +9 -9
  155. package/lib-esm/components/DataVisualizationComponent.js +26 -0
  156. package/lib-esm/components/ICardButtonBase.js +7 -0
  157. package/lib-esm/components/LineChartComponent.js +29 -0
  158. package/lib-esm/components/PieChartComponent.js +115 -0
  159. package/lib-esm/components/PoweredByComponent.js +10 -0
  160. package/lib-esm/components/PromptsSetComponent.js +10 -0
  161. package/lib-esm/components/SearchBoxComponent.js +10 -0
  162. package/lib-esm/components/SearchFooterComponent.js +8 -0
  163. package/lib-esm/components/TextComponent.js +10 -0
  164. package/lib-esm/components/TextInputComponent.js +10 -0
  165. package/{lib → lib-esm}/index.js +3 -3
  166. package/lib-esm/interfaces/CardActionType.js +5 -0
  167. package/lib-esm/interfaces/IActionArguments.js +7 -0
  168. package/lib-esm/interfaces/IAdaptiveCardExtension.js +7 -0
  169. package/lib-esm/interfaces/IAdaptiveCardExtensionData.js +5 -0
  170. package/lib-esm/interfaces/IAdaptiveCardExtensionImage.js +15 -0
  171. package/lib-esm/interfaces/IAdaptiveCardExtensionLoadContext.js +5 -0
  172. package/lib-esm/interfaces/IAdaptiveCardExtensionPropertiesMetadata.js +7 -0
  173. package/lib-esm/interfaces/IAdaptiveCardRenderParameters.js +5 -0
  174. package/lib-esm/interfaces/IBaseCardParameters.js +11 -0
  175. package/lib-esm/interfaces/ICardButton.js +6 -0
  176. package/lib-esm/interfaces/ICardRenderParameters.js +6 -0
  177. package/{lib → lib-esm}/interfaces/IFocusParameters.js +3 -3
  178. package/lib-esm/interfaces/IGetLocationActionTypes.js +7 -0
  179. package/lib-esm/interfaces/IHostContext.js +15 -0
  180. package/lib-esm/interfaces/ILocation.js +6 -0
  181. package/lib-esm/interfaces/INotificationTypes.js +9 -0
  182. package/lib-esm/interfaces/IOnBeforeActionArguments.js +7 -0
  183. package/lib-esm/interfaces/IQuickViewRenderParameters.js +5 -0
  184. package/lib-esm/interfaces/ISPFxAdaptiveCard.js +7 -0
  185. package/{lib → lib-esm}/interfaces/ISelectMediaActionTypes.js +3 -7
  186. package/lib-esm/interfaces/ISelectionActionTemplateAdaptiveCard.js +5 -0
  187. package/lib-esm/interfaces/IShowLocationActionTypes.js +9 -0
  188. package/lib-esm/interfaces/InternalTypes.js +6 -0
  189. package/lib-esm/isolation/IsolatedAdaptiveCardExtensionService.js +499 -0
  190. package/{lib → lib-esm}/isolation/RenderArgumentsUtils.js +79 -71
  191. package/{lib → lib-esm}/isolation/interfaces/IBot.js +3 -3
  192. package/lib-esm/isolation/interfaces/IIsolatedAction.js +5 -0
  193. package/lib-esm/isolation/interfaces/IIsolatedListener.js +7 -0
  194. package/lib-esm/isolation/interfaces/IIsolatedServiceCallbackParameters.js +5 -0
  195. package/lib-esm/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.js +7 -0
  196. package/lib-esm/isolation/interfaces/IRenderIsolatedQuickViewParameters.js +10 -0
  197. package/lib-esm/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.js +5 -0
  198. package/lib-esm/isolation/interfaces/IsolatedServiceMessageEvent.js +5 -0
  199. package/lib-esm/test-api/AdaptiveCardExtensionTestWrapper.js +125 -0
  200. package/{lib → lib-esm}/test-api/MockAdaptiveCardExtensionManifestInstance.js +12 -8
  201. package/{lib → lib-esm}/test-api/index.js +2 -1
  202. package/lib-esm/utilities/StringHelper.js +8 -0
  203. package/lib-esm/views/base/BaseView.js +47 -0
  204. package/lib-esm/views/card/BaseBasicCardView.js +51 -0
  205. package/lib-esm/views/card/BaseCardView.js +59 -0
  206. package/lib-esm/views/card/BaseComponentsCardView.js +43 -0
  207. package/{lib → lib-esm}/views/card/BaseImageCardView.js +24 -36
  208. package/{lib → lib-esm}/views/card/BasePrimaryTextCardView.js +23 -35
  209. package/lib-esm/views/card/BaseTemplateCardView.js +65 -0
  210. package/lib-esm/views/card/DefaultCardView.js +19 -0
  211. package/lib-esm/views/card/parameters/BaseParameters.js +7 -0
  212. package/lib-esm/views/card/parameters/CardViewParametersProcessors.js +30 -0
  213. package/{lib → lib-esm}/views/card/parameters/DataVisualizationParameters.js +41 -35
  214. package/lib-esm/views/card/parameters/FocusedParameters.js +58 -0
  215. package/{lib → lib-esm}/views/card/parameters/GenericTemplates.js +59 -34
  216. package/lib-esm/views/interfaces/IAdaptiveCardExtensionActionView.js +7 -0
  217. package/lib-esm/views/interfaces/IAdaptiveCardExtensionDataView.js +7 -0
  218. package/lib-esm/views/interfaces/INavigationBarProperties.js +5 -0
  219. package/lib-esm/views/interfaces/IViewNavigator.js +5 -0
  220. package/lib-esm/views/navigator/QuickViewNavigator.js +22 -0
  221. package/lib-esm/views/navigator/ViewNavigator.js +174 -0
  222. package/lib-esm/views/navigator/ViewRegistry.js +26 -0
  223. package/lib-esm/views/quickView/BaseAdaptiveCardQuickView.js +65 -0
  224. package/lib-esm/views/quickView/BaseQuickView.js +28 -0
  225. package/lib-esm/views/quickView/BaseWebQuickView.js +49 -0
  226. package/package.json +53 -18
  227. package/dist/index.js +0 -8
  228. package/dist/sp-adaptive-card-extension-base_default_80cb284b0ce5185f01a3.js +0 -1
  229. package/dist/sp-adaptive-card-extension-base_en-us_f42ce38c47d8423e6856.js +0 -1
  230. package/dist/sp-adaptive-card-extension-base_qps-ploc_256d38b669b67722cc35.js +0 -1
  231. package/dist/sp-adaptive-card-extension-base_qps-ploca_d709c1c8a8609f16e251.js +0 -1
  232. package/dist/test-api/AdaptiveCardExtensionTestWrapper.js +0 -155
  233. package/dist/test-api/MockAdaptiveCardExtensionManifestInstance.js +0 -23
  234. package/dist/test-api/index.js +0 -6
  235. package/lib/AdaptiveCardExtensionContext.d.ts.map +0 -1
  236. package/lib/AdaptiveCardExtensionContext.js +0 -103
  237. package/lib/AdaptiveCardExtensionHost.d.ts.map +0 -1
  238. package/lib/AdaptiveCardExtensionHost.js +0 -76
  239. package/lib/AdaptiveCardExtensionLoader.d.ts.map +0 -1
  240. package/lib/BaseAdaptiveCardExtension.d.ts.map +0 -1
  241. package/lib/BaseAdaptiveCardExtension.js +0 -1433
  242. package/lib/ac-template/basicL1Template.d.ts.map +0 -1
  243. package/lib/ac-template/basicL1TemplateSelectAction.d.ts.map +0 -1
  244. package/lib/ac-template/common/Constants.d.ts.map +0 -1
  245. package/lib/ac-template/common/CustomElements.d.ts.map +0 -1
  246. package/lib/ac-template/imageL1Template.d.ts.map +0 -1
  247. package/lib/ac-template/imageL1TemplateSelectAction.d.ts.map +0 -1
  248. package/lib/ac-template/index.d.ts.map +0 -1
  249. package/lib/ac-template/primaryTextL1Template.d.ts.map +0 -1
  250. package/lib/ac-template/primaryTextL1TemplateSelectAction.d.ts.map +0 -1
  251. package/lib/ac-template/searchL1Template.d.ts.map +0 -1
  252. package/lib/ac-template/textInputL1Template.d.ts.map +0 -1
  253. package/lib/ac-template/util/actionButtonHelper.d.ts.map +0 -1
  254. package/lib/ac-template/util/getCardRenderParameters.d.ts.map +0 -1
  255. package/lib/actionShim/AdaptiveCardExtensionActionShim.d.ts.map +0 -1
  256. package/lib/actionShim/IActionShimProvider.d.ts.map +0 -1
  257. package/lib/actionShim/IActionShimProvider.js +0 -2
  258. package/lib/actionShim/getOnBeforeActionArguments.d.ts.map +0 -1
  259. package/lib/caching/CacheManager.d.ts.map +0 -1
  260. package/lib/caching/CacheManager.js +0 -57
  261. package/lib/caching/IAdaptiveCardExtensionCacheObject.d.ts.map +0 -1
  262. package/lib/caching/IAdaptiveCardExtensionCacheObject.js +0 -2
  263. package/lib/caching/ICacheSettings.d.ts.map +0 -1
  264. package/lib/caching/ICacheSettings.js +0 -2
  265. package/lib/caching/ICachedLoadParameters.d.ts.map +0 -1
  266. package/lib/caching/cache/ACEMySiteCacheManager.d.ts.map +0 -1
  267. package/lib/caching/cache/ACEMySiteCacheManager.js +0 -135
  268. package/lib/caching/cache/BaseAdaptiveCardExtensionCache.d.ts.map +0 -1
  269. package/lib/caching/cache/IAdaptiveCardExtensionCache.d.ts.map +0 -1
  270. package/lib/caching/cache/IAdaptiveCardExtensionCache.js +0 -2
  271. package/lib/caching/cache/LocalStorageACECache.d.ts.map +0 -1
  272. package/lib/caching/cache/LocalStorageACECache.js +0 -84
  273. package/lib/common/Flights.d.ts.map +0 -1
  274. package/lib/common/Flights.js +0 -17
  275. package/lib/common/Killswitches.d.ts.map +0 -1
  276. package/lib/components/BarChartComponent.d.ts.map +0 -1
  277. package/lib/components/BarChartComponent.js +0 -125
  278. package/lib/components/BaseComponent.d.ts.map +0 -1
  279. package/lib/components/CardBarComponent.d.ts.map +0 -1
  280. package/lib/components/CardBarComponent.js +0 -8
  281. package/lib/components/CardButtonComponent.d.ts.map +0 -1
  282. package/lib/components/DataVisualizationComponent.d.ts.map +0 -1
  283. package/lib/components/DataVisualizationComponent.js +0 -24
  284. package/lib/components/ICardButtonBase.d.ts.map +0 -1
  285. package/lib/components/ICardButtonBase.js +0 -2
  286. package/lib/components/LineChartComponent.d.ts.map +0 -1
  287. package/lib/components/LineChartComponent.js +0 -32
  288. package/lib/components/PieChartComponent.d.ts.map +0 -1
  289. package/lib/components/PieChartComponent.js +0 -99
  290. package/lib/components/PoweredByComponent.d.ts.map +0 -1
  291. package/lib/components/PoweredByComponent.js +0 -8
  292. package/lib/components/PromptsSetComponent.d.ts.map +0 -1
  293. package/lib/components/PromptsSetComponent.js +0 -8
  294. package/lib/components/SearchBoxComponent.d.ts.map +0 -1
  295. package/lib/components/SearchBoxComponent.js +0 -8
  296. package/lib/components/SearchFooterComponent.d.ts.map +0 -1
  297. package/lib/components/SearchFooterComponent.js +0 -5
  298. package/lib/components/TextComponent.d.ts.map +0 -1
  299. package/lib/components/TextComponent.js +0 -8
  300. package/lib/components/TextInputComponent.d.ts.map +0 -1
  301. package/lib/components/TextInputComponent.js +0 -8
  302. package/lib/index.d.ts.map +0 -1
  303. package/lib/interfaces/CardActionType.d.ts.map +0 -1
  304. package/lib/interfaces/CardActionType.js +0 -2
  305. package/lib/interfaces/IActionArguments.d.ts.map +0 -1
  306. package/lib/interfaces/IActionArguments.js +0 -2
  307. package/lib/interfaces/IAdaptiveCardExtension.d.ts.map +0 -1
  308. package/lib/interfaces/IAdaptiveCardExtension.js +0 -2
  309. package/lib/interfaces/IAdaptiveCardExtensionData.d.ts.map +0 -1
  310. package/lib/interfaces/IAdaptiveCardExtensionData.js +0 -2
  311. package/lib/interfaces/IAdaptiveCardExtensionImage.d.ts.map +0 -1
  312. package/lib/interfaces/IAdaptiveCardExtensionImage.js +0 -2
  313. package/lib/interfaces/IAdaptiveCardExtensionLoadContext.d.ts.map +0 -1
  314. package/lib/interfaces/IAdaptiveCardExtensionLoadContext.js +0 -2
  315. package/lib/interfaces/IAdaptiveCardExtensionPropertiesMetadata.d.ts.map +0 -1
  316. package/lib/interfaces/IAdaptiveCardExtensionPropertiesMetadata.js +0 -2
  317. package/lib/interfaces/IAdaptiveCardRenderParameters.d.ts.map +0 -1
  318. package/lib/interfaces/IAdaptiveCardRenderParameters.js +0 -2
  319. package/lib/interfaces/IBaseCardParameters.d.ts.map +0 -1
  320. package/lib/interfaces/IBaseCardParameters.js +0 -2
  321. package/lib/interfaces/ICardButton.d.ts.map +0 -1
  322. package/lib/interfaces/ICardButton.js +0 -2
  323. package/lib/interfaces/ICardRenderParameters.d.ts.map +0 -1
  324. package/lib/interfaces/ICardRenderParameters.js +0 -2
  325. package/lib/interfaces/IFocusParameters.d.ts.map +0 -1
  326. package/lib/interfaces/IGetLocationActionTypes.d.ts.map +0 -1
  327. package/lib/interfaces/IGetLocationActionTypes.js +0 -2
  328. package/lib/interfaces/IHostContext.d.ts.map +0 -1
  329. package/lib/interfaces/IHostContext.js +0 -2
  330. package/lib/interfaces/ILocation.d.ts.map +0 -1
  331. package/lib/interfaces/ILocation.js +0 -6
  332. package/lib/interfaces/INotificationTypes.d.ts.map +0 -1
  333. package/lib/interfaces/INotificationTypes.js +0 -2
  334. package/lib/interfaces/IOnBeforeActionArguments.d.ts.map +0 -1
  335. package/lib/interfaces/IOnBeforeActionArguments.js +0 -2
  336. package/lib/interfaces/IQuickViewRenderParameters.d.ts.map +0 -1
  337. package/lib/interfaces/IQuickViewRenderParameters.js +0 -2
  338. package/lib/interfaces/ISPFxAdaptiveCard.d.ts.map +0 -1
  339. package/lib/interfaces/ISPFxAdaptiveCard.js +0 -2
  340. package/lib/interfaces/ISelectMediaActionTypes.d.ts.map +0 -1
  341. package/lib/interfaces/ISelectionActionTemplateAdaptiveCard.d.ts.map +0 -1
  342. package/lib/interfaces/ISelectionActionTemplateAdaptiveCard.js +0 -2
  343. package/lib/interfaces/IShowLocationActionTypes.d.ts.map +0 -1
  344. package/lib/interfaces/IShowLocationActionTypes.js +0 -2
  345. package/lib/interfaces/InternalTypes.d.ts.map +0 -1
  346. package/lib/interfaces/InternalTypes.js +0 -2
  347. package/lib/isolation/IsolatedAdaptiveCardExtensionService.d.ts.map +0 -1
  348. package/lib/isolation/IsolatedAdaptiveCardExtensionService.js +0 -513
  349. package/lib/isolation/RenderArgumentsUtils.d.ts.map +0 -1
  350. package/lib/isolation/interfaces/IBot.d.ts.map +0 -1
  351. package/lib/isolation/interfaces/IIsolatedAction.d.ts.map +0 -1
  352. package/lib/isolation/interfaces/IIsolatedAction.js +0 -2
  353. package/lib/isolation/interfaces/IIsolatedListener.d.ts.map +0 -1
  354. package/lib/isolation/interfaces/IIsolatedListener.js +0 -2
  355. package/lib/isolation/interfaces/IIsolatedServiceCallbackParameters.d.ts.map +0 -1
  356. package/lib/isolation/interfaces/IIsolatedServiceCallbackParameters.js +0 -2
  357. package/lib/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.d.ts.map +0 -1
  358. package/lib/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.js +0 -2
  359. package/lib/isolation/interfaces/IRenderIsolatedQuickViewParameters.d.ts.map +0 -1
  360. package/lib/isolation/interfaces/IRenderIsolatedQuickViewParameters.js +0 -2
  361. package/lib/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.d.ts.map +0 -1
  362. package/lib/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.js +0 -2
  363. package/lib/isolation/interfaces/IsolatedServiceMessageEvent.d.ts.map +0 -1
  364. package/lib/isolation/interfaces/IsolatedServiceMessageEvent.js +0 -2
  365. package/lib/test-api/AdaptiveCardExtensionTestWrapper.d.ts.map +0 -1
  366. package/lib/test-api/AdaptiveCardExtensionTestWrapper.js +0 -152
  367. package/lib/test-api/MockAdaptiveCardExtensionManifestInstance.d.ts.map +0 -1
  368. package/lib/test-api/index.d.ts.map +0 -1
  369. package/lib/utilities/StringHelper.d.ts.map +0 -1
  370. package/lib/utilities/StringHelper.js +0 -11
  371. package/lib/views/base/BaseView.d.ts.map +0 -1
  372. package/lib/views/base/BaseView.js +0 -77
  373. package/lib/views/card/BaseBasicCardView.d.ts.map +0 -1
  374. package/lib/views/card/BaseBasicCardView.js +0 -63
  375. package/lib/views/card/BaseCardView.d.ts.map +0 -1
  376. package/lib/views/card/BaseCardView.js +0 -84
  377. package/lib/views/card/BaseComponentsCardView.d.ts.map +0 -1
  378. package/lib/views/card/BaseComponentsCardView.js +0 -44
  379. package/lib/views/card/BaseImageCardView.d.ts.map +0 -1
  380. package/lib/views/card/BasePrimaryTextCardView.d.ts.map +0 -1
  381. package/lib/views/card/BaseTemplateCardView.d.ts.map +0 -1
  382. package/lib/views/card/BaseTemplateCardView.js +0 -85
  383. package/lib/views/card/DefaultCardView.d.ts.map +0 -1
  384. package/lib/views/card/DefaultCardView.js +0 -29
  385. package/lib/views/card/parameters/BaseParameters.d.ts.map +0 -1
  386. package/lib/views/card/parameters/BaseParameters.js +0 -2
  387. package/lib/views/card/parameters/CardViewParametersProcessors.d.ts.map +0 -1
  388. package/lib/views/card/parameters/CardViewParametersProcessors.js +0 -37
  389. package/lib/views/card/parameters/DataVisualizationParameters.d.ts.map +0 -1
  390. package/lib/views/card/parameters/FocusedParameters.d.ts.map +0 -1
  391. package/lib/views/card/parameters/FocusedParameters.js +0 -43
  392. package/lib/views/card/parameters/GenericTemplates.d.ts.map +0 -1
  393. package/lib/views/interfaces/IAdaptiveCardExtensionActionView.d.ts.map +0 -1
  394. package/lib/views/interfaces/IAdaptiveCardExtensionActionView.js +0 -2
  395. package/lib/views/interfaces/IAdaptiveCardExtensionDataView.d.ts.map +0 -1
  396. package/lib/views/interfaces/IAdaptiveCardExtensionDataView.js +0 -2
  397. package/lib/views/interfaces/INavigationBarProperties.d.ts.map +0 -1
  398. package/lib/views/interfaces/INavigationBarProperties.js +0 -2
  399. package/lib/views/interfaces/IViewNavigator.d.ts.map +0 -1
  400. package/lib/views/interfaces/IViewNavigator.js +0 -2
  401. package/lib/views/navigator/QuickViewNavigator.d.ts.map +0 -1
  402. package/lib/views/navigator/QuickViewNavigator.js +0 -29
  403. package/lib/views/navigator/ViewNavigator.d.ts.map +0 -1
  404. package/lib/views/navigator/ViewNavigator.js +0 -233
  405. package/lib/views/navigator/ViewRegistry.d.ts.map +0 -1
  406. package/lib/views/navigator/ViewRegistry.js +0 -32
  407. package/lib/views/quickView/BaseAdaptiveCardQuickView.d.ts.map +0 -1
  408. package/lib/views/quickView/BaseAdaptiveCardQuickView.js +0 -90
  409. package/lib/views/quickView/BaseQuickView.d.ts.map +0 -1
  410. package/lib/views/quickView/BaseQuickView.js +0 -45
  411. package/lib/views/quickView/BaseWebQuickView.d.ts.map +0 -1
  412. package/lib/views/quickView/BaseWebQuickView.js +0 -64
  413. /package/{lib → lib-dts}/AdaptiveCardExtensionHost.d.ts +0 -0
  414. /package/{lib → lib-dts}/AdaptiveCardExtensionLoader.d.ts +0 -0
  415. /package/{lib → lib-dts}/ac-template/basicL1Template.d.ts +0 -0
  416. /package/{lib → lib-dts}/ac-template/basicL1TemplateSelectAction.d.ts +0 -0
  417. /package/{lib → lib-dts}/ac-template/common/Constants.d.ts +0 -0
  418. /package/{lib → lib-dts}/ac-template/common/CustomElements.d.ts +0 -0
  419. /package/{lib → lib-dts}/ac-template/imageL1Template.d.ts +0 -0
  420. /package/{lib → lib-dts}/ac-template/imageL1TemplateSelectAction.d.ts +0 -0
  421. /package/{lib → lib-dts}/ac-template/index.d.ts +0 -0
  422. /package/{lib → lib-dts}/ac-template/primaryTextL1Template.d.ts +0 -0
  423. /package/{lib → lib-dts}/ac-template/primaryTextL1TemplateSelectAction.d.ts +0 -0
  424. /package/{lib → lib-dts}/ac-template/searchL1Template.d.ts +0 -0
  425. /package/{lib → lib-dts}/ac-template/textInputL1Template.d.ts +0 -0
  426. /package/{lib → lib-dts}/ac-template/util/actionButtonHelper.d.ts +0 -0
  427. /package/{lib → lib-dts}/ac-template/util/getCardRenderParameters.d.ts +0 -0
  428. /package/{lib → lib-dts}/actionShim/AdaptiveCardExtensionActionShim.d.ts +0 -0
  429. /package/{lib → lib-dts}/actionShim/IActionShimProvider.d.ts +0 -0
  430. /package/{lib → lib-dts}/actionShim/getOnBeforeActionArguments.d.ts +0 -0
  431. /package/{lib → lib-dts}/caching/CacheManager.d.ts +0 -0
  432. /package/{lib → lib-dts}/caching/IAdaptiveCardExtensionCacheObject.d.ts +0 -0
  433. /package/{lib → lib-dts}/caching/ICacheSettings.d.ts +0 -0
  434. /package/{lib → lib-dts}/caching/ICachedLoadParameters.d.ts +0 -0
  435. /package/{lib → lib-dts}/caching/cache/ACEMySiteCacheManager.d.ts +0 -0
  436. /package/{lib → lib-dts}/caching/cache/BaseAdaptiveCardExtensionCache.d.ts +0 -0
  437. /package/{lib → lib-dts}/caching/cache/IAdaptiveCardExtensionCache.d.ts +0 -0
  438. /package/{lib → lib-dts}/caching/cache/LocalStorageACECache.d.ts +0 -0
  439. /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
  440. /package/{lib → lib-dts}/components/BarChartComponent.d.ts +0 -0
  441. /package/{lib → lib-dts}/components/BaseComponent.d.ts +0 -0
  442. /package/{lib → lib-dts}/components/CardBarComponent.d.ts +0 -0
  443. /package/{lib → lib-dts}/components/CardButtonComponent.d.ts +0 -0
  444. /package/{lib → lib-dts}/components/DataVisualizationComponent.d.ts +0 -0
  445. /package/{lib → lib-dts}/components/ICardButtonBase.d.ts +0 -0
  446. /package/{lib → lib-dts}/components/LineChartComponent.d.ts +0 -0
  447. /package/{lib → lib-dts}/components/PieChartComponent.d.ts +0 -0
  448. /package/{lib → lib-dts}/components/PoweredByComponent.d.ts +0 -0
  449. /package/{lib → lib-dts}/components/PromptsSetComponent.d.ts +0 -0
  450. /package/{lib → lib-dts}/components/SearchBoxComponent.d.ts +0 -0
  451. /package/{lib → lib-dts}/components/SearchFooterComponent.d.ts +0 -0
  452. /package/{lib → lib-dts}/components/TextComponent.d.ts +0 -0
  453. /package/{lib → lib-dts}/components/TextInputComponent.d.ts +0 -0
  454. /package/{lib → lib-dts}/index.d.ts +0 -0
  455. /package/{lib → lib-dts}/interfaces/CardActionType.d.ts +0 -0
  456. /package/{lib → lib-dts}/interfaces/IActionArguments.d.ts +0 -0
  457. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtension.d.ts +0 -0
  458. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionData.d.ts +0 -0
  459. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionImage.d.ts +0 -0
  460. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionLoadContext.d.ts +0 -0
  461. /package/{lib → lib-dts}/interfaces/IAdaptiveCardExtensionPropertiesMetadata.d.ts +0 -0
  462. /package/{lib → lib-dts}/interfaces/IAdaptiveCardRenderParameters.d.ts +0 -0
  463. /package/{lib → lib-dts}/interfaces/IBaseCardParameters.d.ts +0 -0
  464. /package/{lib → lib-dts}/interfaces/ICardButton.d.ts +0 -0
  465. /package/{lib → lib-dts}/interfaces/ICardRenderParameters.d.ts +0 -0
  466. /package/{lib → lib-dts}/interfaces/IFocusParameters.d.ts +0 -0
  467. /package/{lib → lib-dts}/interfaces/IGetLocationActionTypes.d.ts +0 -0
  468. /package/{lib → lib-dts}/interfaces/IHostContext.d.ts +0 -0
  469. /package/{lib → lib-dts}/interfaces/ILocation.d.ts +0 -0
  470. /package/{lib → lib-dts}/interfaces/INotificationTypes.d.ts +0 -0
  471. /package/{lib → lib-dts}/interfaces/IOnBeforeActionArguments.d.ts +0 -0
  472. /package/{lib → lib-dts}/interfaces/IQuickViewRenderParameters.d.ts +0 -0
  473. /package/{lib → lib-dts}/interfaces/ISPFxAdaptiveCard.d.ts +0 -0
  474. /package/{lib → lib-dts}/interfaces/ISelectMediaActionTypes.d.ts +0 -0
  475. /package/{lib → lib-dts}/interfaces/ISelectionActionTemplateAdaptiveCard.d.ts +0 -0
  476. /package/{lib → lib-dts}/interfaces/IShowLocationActionTypes.d.ts +0 -0
  477. /package/{lib → lib-dts}/interfaces/InternalTypes.d.ts +0 -0
  478. /package/{lib → lib-dts}/isolation/RenderArgumentsUtils.d.ts +0 -0
  479. /package/{lib → lib-dts}/isolation/interfaces/IBot.d.ts +0 -0
  480. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedAction.d.ts +0 -0
  481. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedListener.d.ts +0 -0
  482. /package/{lib → lib-dts}/isolation/interfaces/IIsolatedServiceCallbackParameters.d.ts +0 -0
  483. /package/{lib → lib-dts}/isolation/interfaces/ILoadIsolatedAdaptiveCardExtensionParameters.d.ts +0 -0
  484. /package/{lib → lib-dts}/isolation/interfaces/IRenderIsolatedQuickViewParameters.d.ts +0 -0
  485. /package/{lib → lib-dts}/isolation/interfaces/IsolatedAdaptiveCardExtensionApplicationMessageEvent.d.ts +0 -0
  486. /package/{lib → lib-dts}/isolation/interfaces/IsolatedServiceMessageEvent.d.ts +0 -0
  487. /package/{lib → lib-dts}/test-api/AdaptiveCardExtensionTestWrapper.d.ts +0 -0
  488. /package/{lib → lib-dts}/test-api/MockAdaptiveCardExtensionManifestInstance.d.ts +0 -0
  489. /package/{lib → lib-dts}/test-api/index.d.ts +0 -0
  490. /package/{lib → lib-dts}/utilities/StringHelper.d.ts +0 -0
  491. /package/{lib → lib-dts}/views/base/BaseView.d.ts +0 -0
  492. /package/{lib → lib-dts}/views/card/BaseBasicCardView.d.ts +0 -0
  493. /package/{lib → lib-dts}/views/card/BaseCardView.d.ts +0 -0
  494. /package/{lib → lib-dts}/views/card/BaseComponentsCardView.d.ts +0 -0
  495. /package/{lib → lib-dts}/views/card/BaseImageCardView.d.ts +0 -0
  496. /package/{lib → lib-dts}/views/card/BasePrimaryTextCardView.d.ts +0 -0
  497. /package/{lib → lib-dts}/views/card/BaseTemplateCardView.d.ts +0 -0
  498. /package/{lib → lib-dts}/views/card/DefaultCardView.d.ts +0 -0
  499. /package/{lib → lib-dts}/views/card/parameters/BaseParameters.d.ts +0 -0
  500. /package/{lib → lib-dts}/views/card/parameters/CardViewParametersProcessors.d.ts +0 -0
  501. /package/{lib → lib-dts}/views/card/parameters/DataVisualizationParameters.d.ts +0 -0
  502. /package/{lib → lib-dts}/views/card/parameters/FocusedParameters.d.ts +0 -0
  503. /package/{lib → lib-dts}/views/card/parameters/GenericTemplates.d.ts +0 -0
  504. /package/{lib → lib-dts}/views/interfaces/IAdaptiveCardExtensionActionView.d.ts +0 -0
  505. /package/{lib → lib-dts}/views/interfaces/IAdaptiveCardExtensionDataView.d.ts +0 -0
  506. /package/{lib → lib-dts}/views/interfaces/INavigationBarProperties.d.ts +0 -0
  507. /package/{lib → lib-dts}/views/interfaces/IViewNavigator.d.ts +0 -0
  508. /package/{lib → lib-dts}/views/navigator/QuickViewNavigator.d.ts +0 -0
  509. /package/{lib → lib-dts}/views/navigator/ViewNavigator.d.ts +0 -0
  510. /package/{lib → lib-dts}/views/navigator/ViewRegistry.d.ts +0 -0
  511. /package/{lib → lib-dts}/views/quickView/BaseAdaptiveCardQuickView.d.ts +0 -0
  512. /package/{lib → lib-dts}/views/quickView/BaseQuickView.d.ts +0 -0
  513. /package/{lib → lib-dts}/views/quickView/BaseWebQuickView.d.ts +0 -0
  514. /package/{lib → lib-esm}/loc/Strings.resx.json +0 -0
  515. /package/{lib → lib-esm}/sp-adaptive-card-base.manifest.json +0 -0
@@ -1,217 +1,38 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IsolatedAdaptiveCardExtensionService = void 0;
4
- var sp_component_base_1 = require("@microsoft/sp-component-base");
5
- var sp_core_library_1 = require("@microsoft/sp-core-library");
6
- var sp_diagnostics_1 = require("@microsoft/sp-diagnostics");
7
- var sp_http_base_1 = require("@microsoft/sp-http-base");
8
- var sp_page_context_1 = require("@microsoft/sp-page-context");
9
- var sp_telemetry_1 = require("@msinternal/sp-telemetry");
10
- var Flights_1 = require("../common/Flights");
11
- var Killswitches_1 = require("../common/Killswitches");
12
- var TIMEOUT_INTERVAL = 15000;
13
- var EMBEDDED_PAGE_CONTAINER = 'embedded-page-container';
14
- /**
15
- * @internal
16
- */
17
- var IsolatedAdaptiveCardExtensionService = /** @class */ (function () {
18
- function IsolatedAdaptiveCardExtensionService(serviceScope) {
19
- var _this = this;
20
- this._callbackCache = new Map();
21
- this._isolatedFrames = new Map();
22
- this._isolatedListeners = new Map();
23
- this._handleIframeTimeout = function (isolatedFrameKey, isVCD1P) {
24
- var frame = _this._isolatedFrames.get(isolatedFrameKey);
25
- var frameMonitor = frame.frameMonitor, retryMonitor = frame.retryMonitor, tokenMonitor = frame.tokenMonitor;
26
- /*
27
- * There is a rare case the iframe is running into a "reset connection" error. This is because the
28
- * client/server is unable to communicate for an unknown reason. When we run into this, we will attempt to refresh the iframe once.
29
- */
30
- if (frame.retryCount < 1) {
31
- frame.retryCount += 1;
32
- frame.retryMonitor = _this._createRetryMonitor();
33
- // Use a shorter interval for the retry, this would put the retry around ~P95
34
- frame.timeoutId = setTimeout(function () { return _this._handleIframeTimeout(isolatedFrameKey, isVCD1P); }, TIMEOUT_INTERVAL - 500);
35
- return;
36
- }
37
- else if (retryMonitor) {
38
- retryMonitor.writeUnexpectedFailure('reloadFailed');
39
- }
40
- /*
41
- * If this timeout has been executed then the isolated ACE application
42
- * did not send the `Ready` message to the host applicaton. By checking if
43
- * the `tokenMonitor` exists we can verify whether framedteamslogon even requested
44
- * a token. If it doesn't exist, then we assume we are stuck in the MSAL interactive flow.
45
- * This would be unexpected in Teams but is a known issue in browsers with ITP or 3P
46
- * cookies blocked.
47
- */
48
- if (frameMonitor && !frameMonitor.hasEnded) {
49
- try {
50
- if (tokenMonitor) {
51
- frameMonitor.writeUnexpectedFailure('tokenTimeout');
52
- if (!tokenMonitor.hasEnded) {
53
- tokenMonitor.writeUnexpectedFailure('timeout');
54
- }
55
- }
56
- else {
57
- if (isVCD1P) {
58
- // We should never hit this, but adding for completeness
59
- frameMonitor.writeUnexpectedFailure('authorizeTimeout');
60
- }
61
- else {
62
- frameMonitor.writeExpectedFailure('authorizeTimeout');
63
- }
64
- }
65
- }
66
- catch (e) {
67
- frameMonitor.writeUnexpectedFailure('unexpectedFailure', e);
68
- }
69
- }
70
- };
71
- /**
72
- * Message handler for isolated domain iframes.
73
- *
74
- * @param message - {@link _IsolatedAdaptiveCardExtensionApplicationMessageEvent}
75
- */
76
- this._handleIsolatedApplicationMessage = function (message) {
77
- var data = message.data;
78
- if (data.messageType === 'applicationMessage') {
79
- var instanceId = data.instanceId, kind = data.kind;
80
- switch (kind) {
81
- case 'Card':
82
- _this._invokeCallback(instanceId, {
83
- aceData: data.aceData,
84
- card: data.card,
85
- cacheObject: data.cacheObject,
86
- type: kind
87
- });
88
- break;
89
- case 'CloseQuickView':
90
- var qvFrame = _this._isolatedFrames.get(new URL(message.origin).hostname);
91
- if (qvFrame) {
92
- qvFrame.iframe.hidden = true;
93
- }
94
- break;
95
- case 'Error':
96
- _this._invokeCallback(instanceId, { error: data.error, type: kind });
97
- break;
98
- case 'OpenQuickView':
99
- var frame = _this._isolatedFrames.get(new URL(message.origin).hostname);
100
- if (frame) {
101
- frame.iframe.hidden = false;
102
- }
103
- break;
104
- case 'OpenUrl':
105
- _this._invokeCallback(instanceId, { type: kind, url: data.url });
106
- break;
107
- case 'LocationRequest':
108
- _this._invokeCallback(instanceId, { type: kind });
109
- break;
110
- case 'RenderCompleted':
111
- _this._invokeCallback(instanceId, { type: kind, didUpdate: data.didUpdate });
112
- break;
113
- case 'Ready':
114
- /*
115
- * Once we get this message from the isolated ACE application, we know it has been loaded
116
- * and we can start sending messages to the isolated frame.
117
- */
118
- var isolatedFrame = _this._isolatedFrames.get(new URL(message.origin).hostname);
119
- if (isolatedFrame) {
120
- if (isolatedFrame.retryMonitor) {
121
- isolatedFrame.retryMonitor.writeSuccess();
122
- }
123
- clearTimeout(isolatedFrame.timeoutId);
124
- isolatedFrame.frameMonitor.writeSuccess();
125
- isolatedFrame.isReady = true;
126
- for (var _i = 0, _a = isolatedFrame.messageQueue; _i < _a.length; _i++) {
127
- var _b = _a[_i], id = _b[0], msg = _b[1];
128
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
- _this._sendMessage(_this._getIsolatedFrame(id), id, msg);
130
- }
131
- isolatedFrame.messageQueue = [];
132
- }
133
- break;
134
- case 'OBOTokenRequest':
135
- var applicationId = data.applicationId, claims = data.claims;
136
- _this._getAuthToken(applicationId, claims, message.origin);
137
- break;
138
- case 'PropertyPaneConfiguration':
139
- _this._invokeCallback(instanceId, {
140
- propertyPaneConfiguration: data.propertyPaneConfiguration,
141
- type: kind
142
- });
143
- break;
144
- default:
145
- _this._logError("Unexpected message: ".concat(JSON.stringify(message.data)));
146
- break;
147
- }
148
- }
149
- else if (data.messageType === 'bridgeMessage' && data.bridgeAction === 'onTokenRequested') {
150
- /*
151
- * When we load in Teams, we use framedteamslogon to ensure the isolated app iframe has a valid cookie.
152
- * If it doesn't then framedteamslogon will request a token from the host app to use to call the
153
- * /Authenticate API, which will set a new session cookie on the iframe and then redirect to the isolated
154
- * ACE applicaton.
155
- */
156
- var monitor_1 = _this._createTokenRequestMonitor();
157
- var applicationId = data.applicationId, claims = data.claims;
158
- var isolatedFrame_1 = _this._isolatedFrames.get(new URL(message.origin).hostname);
159
- if (!isolatedFrame_1) {
160
- monitor_1.writeUnexpectedFailure('missingIsolatedFrame');
161
- return;
162
- }
163
- isolatedFrame_1.tokenMonitor = monitor_1;
164
- var configurableTokenProvider = sp_http_base_1._AadTokenProviders.configurable;
165
- if (!configurableTokenProvider._oboThirdPartyTokenCallback) {
166
- monitor_1.writeUnexpectedFailure('missingThirdPartyTokenCallback');
167
- return;
168
- }
169
- try {
170
- configurableTokenProvider._oboThirdPartyTokenCallback(applicationId, claims)
171
- .then(function (token) {
172
- if (!isolatedFrame_1.iframe.contentWindow) {
173
- throw new Error('missingContentWindow');
174
- }
175
- isolatedFrame_1.iframe.contentWindow.postMessage({ token: token, messageType: 'dashboardMessage', kind: 'Token' }, '*');
176
- monitor_1.writeSuccess();
177
- })
178
- .catch(function (e) {
179
- monitor_1.writeUnexpectedFailure('oboThirdPartyTokenCallbackError', e);
180
- });
181
- }
182
- catch (e) {
183
- /*
184
- * This is to account for an exception when calling the `_oboThirdPartyTokenCallback`.
185
- * We've seen in the past where it unexpectedly returned `undefined` causing the Promise
186
- * chain to never be executed.
187
- */
188
- monitor_1.writeUnexpectedFailure('unexpectedException', e);
189
- }
190
- }
191
- };
192
- this._serviceScope = serviceScope;
193
- window.addEventListener('message', this._handleIsolatedApplicationMessage);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "IsolatedAdaptiveCardExtensionService", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return IsolatedAdaptiveCardExtensionService;
194
9
  }
195
- Object.defineProperty(IsolatedAdaptiveCardExtensionService.prototype, "_pageContext", {
196
- /**
197
- * @internal
198
- */
199
- get: function () {
200
- if (!this._pContext) {
201
- // Since this service can be autocreated, we must consume services after autocreation has finished
202
- this._pContext = this._serviceScope.consume(sp_page_context_1.PageContext.serviceKey);
203
- }
204
- return this._pContext;
205
- },
206
- enumerable: false,
207
- configurable: true
208
- });
209
- IsolatedAdaptiveCardExtensionService.prototype.disposeEntry = function (instanceId, isolatedDomain) {
10
+ });
11
+ const _spcomponentbase = require("@microsoft/sp-component-base");
12
+ const _spcorelibrary = require("@microsoft/sp-core-library");
13
+ const _spdiagnostics = require("@microsoft/sp-diagnostics");
14
+ const _sphttpbase = require("@microsoft/sp-http-base");
15
+ const _sppagecontext = require("@microsoft/sp-page-context");
16
+ const _sptelemetry = require("@msinternal/sp-telemetry");
17
+ const _Killswitches = require("../common/Killswitches");
18
+ const TIMEOUT_INTERVAL = 15000;
19
+ const EMBEDDED_PAGE_CONTAINER = 'embedded-page-container';
20
+ class IsolatedAdaptiveCardExtensionService {
21
+ /**
22
+ * @internal
23
+ */ get _pageContext() {
24
+ if (!this._pContext) {
25
+ // Since this service can be autocreated, we must consume services after autocreation has finished
26
+ this._pContext = this._serviceScope.consume(_sppagecontext.PageContext.serviceKey);
27
+ }
28
+ return this._pContext;
29
+ }
30
+ disposeEntry(instanceId, isolatedDomain) {
210
31
  this._isolatedListeners.delete(instanceId);
211
- if (!(0, Killswitches_1.isRemoveIsolatedDomainOnDisposeKSActivated)()) {
32
+ if (!(0, _Killswitches.isRemoveIsolatedDomainOnDisposeKSActivated)()) {
212
33
  this._callbackCache.delete(instanceId);
213
34
  // reduce the number of Isolated ACEs tied to a isolated domain
214
- var frame = this._isolatedFrames.get(isolatedDomain);
35
+ const frame = this._isolatedFrames.get(isolatedDomain);
215
36
  if (frame) {
216
37
  frame.childInstanceIds.delete(instanceId);
217
38
  // remove the isolated domain when there is no isolated aces depending on it.
@@ -221,34 +42,31 @@ var IsolatedAdaptiveCardExtensionService = /** @class */ (function () {
221
42
  }
222
43
  }
223
44
  }
224
- };
45
+ }
225
46
  /**
226
- * Load an isolated Adaptive Card Extension.
227
- *
228
- * @remarks Only loads one iframe per isolated domain.
229
- *
230
- * @param args - {@link _ILoadIsolatedAdaptiveCardExtensionParameters}
231
- */
232
- IsolatedAdaptiveCardExtensionService.prototype.load = function (args) {
233
- var _this = this;
234
- var callback = args.callback, instanceId = args.instanceId, listenerId = args.listenerId;
47
+ * Load an isolated Adaptive Card Extension.
48
+ *
49
+ * @remarks Only loads one iframe per isolated domain.
50
+ *
51
+ * @param args - {@link _ILoadIsolatedAdaptiveCardExtensionParameters}
52
+ */ load(args) {
53
+ const { callback, instanceId, listenerId } = args;
235
54
  // Normalize the domain since we are using it as dictionary keys
236
- var isolatedDomain = args.isolatedDomain.toLowerCase();
237
- var isolatedFrame = this._isolatedFrames.get(isolatedDomain);
55
+ const isolatedDomain = args.isolatedDomain.toLowerCase();
56
+ let isolatedFrame = this._isolatedFrames.get(isolatedDomain);
238
57
  if (!isolatedFrame) {
239
- var monitor = this._createLoadMonitor();
240
- var iframe = document.createElement('iframe');
58
+ const monitor = this._createLoadMonitor();
59
+ const iframe = document.createElement('iframe');
241
60
  // to fix isTeamsHosted in Teams 2.1 and in old Teams isBrowserHosted check
242
- if (!(0, Killswitches_1.isFixIframeNameKSActive)() && window.name === EMBEDDED_PAGE_CONTAINER) {
61
+ if (!(0, _Killswitches.isFixIframeNameKSActive)() && window.name === EMBEDDED_PAGE_CONTAINER) {
243
62
  iframe.name = EMBEDDED_PAGE_CONTAINER;
244
63
  }
245
- var isVCD1P_1 = sp_core_library_1._BrowserUtilities.isTeams1PVivaDesktopHosted();
246
- iframe.src = this._configureIframeSrc(isolatedDomain, args, isVCD1P_1);
64
+ const isVCD1P = _spcorelibrary._BrowserUtilities.isTeams1PVivaDesktopHosted();
65
+ iframe.src = this._configureIframeSrc(isolatedDomain, args);
247
66
  /*
248
- * Initialize the iframe as hidden and full screen.
249
- * This effectively sets up the isolated iframe as an overlay over the application.
250
- */
251
- iframe.hidden = true;
67
+ * Initialize the iframe as hidden and full screen.
68
+ * This effectively sets up the isolated iframe as an overlay over the application.
69
+ */ iframe.hidden = true;
252
70
  iframe.scrolling = 'no';
253
71
  iframe.style.overflow = 'hidden';
254
72
  iframe.style.height = '100%';
@@ -261,256 +79,429 @@ var IsolatedAdaptiveCardExtensionService = /** @class */ (function () {
261
79
  iframe.setAttribute('allow', 'geolocation');
262
80
  iframe.setAttribute('data-automation-id', 'isolated_ACE_iframe');
263
81
  document.body.appendChild(iframe);
264
- var isolatedFrameKey_1 = isolatedDomain.toLowerCase();
82
+ const isolatedFrameKey = isolatedDomain.toLowerCase();
265
83
  isolatedFrame = {
266
- iframe: iframe,
84
+ iframe,
267
85
  frameMonitor: monitor,
268
86
  isReady: false,
269
87
  messageQueue: [],
270
88
  retryCount: 0,
271
89
  childInstanceIds: new Set()
272
90
  };
273
- isolatedFrame.timeoutId = setTimeout(function () {
274
- _this._handleIframeTimeout(isolatedFrameKey_1, isVCD1P_1);
91
+ isolatedFrame.timeoutId = setTimeout(()=>{
92
+ this._handleIframeTimeout(isolatedFrameKey, isVCD1P);
275
93
  }, TIMEOUT_INTERVAL);
276
- this._isolatedFrames.set(isolatedFrameKey_1, isolatedFrame);
94
+ this._isolatedFrames.set(isolatedFrameKey, isolatedFrame);
277
95
  }
278
- if (!(0, Killswitches_1.isRemoveIsolatedDomainOnDisposeKSActivated)()) {
96
+ if (!(0, _Killswitches.isRemoveIsolatedDomainOnDisposeKSActivated)()) {
279
97
  isolatedFrame.childInstanceIds.add(instanceId);
280
98
  }
281
- var entry = this._isolatedListeners.get(instanceId);
99
+ const entry = this._isolatedListeners.get(instanceId);
282
100
  if (!entry) {
283
- var listenerEntry = this._createIsolatedListenerEntry(isolatedDomain, isolatedFrame.iframe, args);
101
+ const listenerEntry = this._createIsolatedListenerEntry(isolatedDomain, isolatedFrame.iframe, args);
284
102
  this._isolatedListeners.set(instanceId, listenerEntry);
285
- }
286
- else if (!entry.listeners.get(listenerId)) {
287
- entry.listeners.set(listenerId, { callback: callback });
103
+ } else if (!entry.listeners.get(listenerId)) {
104
+ entry.listeners.set(listenerId, {
105
+ callback
106
+ });
288
107
  }
289
108
  // When we are creating a new isolated ACE during authoring, we need to tell the isolated app to initialize a new ACE instance.
290
109
  if (!args.isRenderedFromPersistedData) {
291
110
  this.sendInitialize(args);
292
- }
293
- else {
111
+ } else {
294
112
  this._handleRenderingFromPersistedData(args);
295
113
  }
296
114
  // If the ACE has previously loaded, then send the latest data to the listener.
297
115
  // Otherwise, when the isolated domain iframe has loaded we will automatically notify the listener.
298
- var callbackArgs = this._callbackCache.get(instanceId);
116
+ const callbackArgs = this._callbackCache.get(instanceId);
299
117
  if (callbackArgs) {
300
118
  this._invokeCallback(instanceId, callbackArgs, listenerId);
301
119
  }
302
- };
120
+ }
303
121
  /**
304
- * Display the iframe with the ACE quick view.
305
- *
306
- * @param args - {@link _IRenderIsolatedQuickViewParameters}
307
- */
308
- IsolatedAdaptiveCardExtensionService.prototype.renderQuickView = function (args) {
309
- var instanceId = args.instanceId, isSelectAction = args.isSelectAction, listenerId = args.listenerId, pageTheme = args.pageTheme, targetRect = args.targetRect, theme = args.theme, viewId = args.viewId;
122
+ * Display the iframe with the ACE quick view.
123
+ *
124
+ * @param args - {@link _IRenderIsolatedQuickViewParameters}
125
+ */ renderQuickView(args) {
126
+ const { instanceId, isSelectAction, listenerId, pageTheme, targetRect, theme, viewId } = args;
310
127
  this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
311
128
  serviceAction: 'Action',
312
129
  action: {
313
- action: { type: 'QuickView', isSelectAction: isSelectAction, pageTheme: pageTheme, targetRect: targetRect, theme: theme, viewId: viewId },
314
- instanceId: instanceId,
315
- listenerId: listenerId
130
+ action: {
131
+ type: 'QuickView',
132
+ isSelectAction,
133
+ pageTheme,
134
+ targetRect,
135
+ theme,
136
+ viewId
137
+ },
138
+ instanceId,
139
+ listenerId
316
140
  }
317
141
  });
318
- };
319
- IsolatedAdaptiveCardExtensionService.prototype.setDisplayMode = function (displayMode) {
320
- // not implemented
321
- };
322
- IsolatedAdaptiveCardExtensionService.prototype.setRenderType = function (newRenderType) {
323
- // not implemented
324
- };
142
+ }
143
+ setDisplayMode(displayMode) {
144
+ // not implemented
145
+ }
146
+ setRenderType(newRenderType) {
147
+ // not implemented
148
+ }
325
149
  /**
326
- * Send an action to an isolated ACE.
327
- *
328
- * @param action - {@link _IIsolatedAction}
329
- */
330
- IsolatedAdaptiveCardExtensionService.prototype.sendAction = function (action) {
331
- var instanceId = action.instanceId;
332
- this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, { serviceAction: 'Action', action: action });
333
- };
150
+ * Send an action to an isolated ACE.
151
+ *
152
+ * @param action - {@link _IIsolatedAction}
153
+ */ sendAction(action) {
154
+ const { instanceId } = action;
155
+ this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
156
+ serviceAction: 'Action',
157
+ action
158
+ });
159
+ }
334
160
  /**
335
- * Send an action to ACE onBeforeAction in an isolated domain.
336
- *
337
- * @param action - {@link _IIsolatedOnBeforeAction}
338
- */
339
- IsolatedAdaptiveCardExtensionService.prototype.sendOnBeforeAction = function (action) {
340
- var instanceId = action.instanceId;
161
+ * Send an action to ACE onBeforeAction in an isolated domain.
162
+ *
163
+ * @param action - {@link _IIsolatedOnBeforeAction}
164
+ */ sendOnBeforeAction(action) {
165
+ const { instanceId } = action;
341
166
  this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
342
167
  serviceAction: 'OnBeforeAction',
343
- action: action
168
+ action
344
169
  });
345
- };
346
- IsolatedAdaptiveCardExtensionService.prototype.sendInitialize = function (args) {
347
- var instanceId = args.instanceId, manifestId = args.manifestId;
170
+ }
171
+ sendInitialize(args) {
172
+ const { instanceId, manifestId } = args;
348
173
  this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
349
174
  serviceAction: 'Initialize',
350
- instanceId: instanceId,
351
- manifestId: manifestId
175
+ instanceId,
176
+ manifestId
352
177
  });
353
- };
354
- IsolatedAdaptiveCardExtensionService.prototype.updateACEData = function (instanceId, aceData) {
178
+ }
179
+ updateACEData(instanceId, aceData) {
355
180
  if (this._isolatedListeners.has(instanceId)) {
356
181
  this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
357
- aceData: aceData,
358
- instanceId: instanceId,
182
+ aceData,
183
+ instanceId,
359
184
  serviceAction: 'UpdateACEData'
360
185
  });
361
186
  }
362
- };
363
- IsolatedAdaptiveCardExtensionService.prototype.handleLocationRequest = function (instanceId, location, locationError) {
187
+ }
188
+ handleLocationRequest(instanceId, location, locationError) {
364
189
  this._sendMessage(this._getIsolatedFrame(instanceId), instanceId, {
365
- location: location,
366
- locationError: locationError,
367
- instanceId: instanceId,
190
+ location,
191
+ locationError,
192
+ instanceId,
368
193
  serviceAction: 'LocationResponse'
369
194
  });
370
- };
371
- IsolatedAdaptiveCardExtensionService.prototype._createLoadMonitor = function () {
372
- return new sp_diagnostics_1._QosMonitor('IsolatedAdaptiveCardExtensionService.load');
373
- };
374
- IsolatedAdaptiveCardExtensionService.prototype._createRetryMonitor = function () {
375
- return new sp_diagnostics_1._QosMonitor('IsolatedAdaptiveCardExtension.iframeReload');
376
- };
377
- IsolatedAdaptiveCardExtensionService.prototype._createTokenRequestMonitor = function () {
378
- return new sp_diagnostics_1._QosMonitor('IsolatedAdaptiveCardExtensionService.onTokenRequested');
379
- };
380
- IsolatedAdaptiveCardExtensionService.prototype._createGetAuthTokenMonitor = function () {
381
- return new sp_diagnostics_1._QosMonitor('IsolatedAdaptiveCardExtensionService._getAuthToken');
382
- };
383
- IsolatedAdaptiveCardExtensionService.prototype._configureDestUrlParams = function (loadArgs) {
384
- var dashboardListId = loadArgs.dashboardListId, itemId = loadArgs.itemId;
385
- var destUrlParams = new URLSearchParams(window.location.search);
195
+ }
196
+ _createLoadMonitor() {
197
+ return new _spdiagnostics._QosMonitor('IsolatedAdaptiveCardExtensionService.load');
198
+ }
199
+ _createRetryMonitor() {
200
+ return new _spdiagnostics._QosMonitor('IsolatedAdaptiveCardExtension.iframeReload');
201
+ }
202
+ _createTokenRequestMonitor() {
203
+ return new _spdiagnostics._QosMonitor('IsolatedAdaptiveCardExtensionService.onTokenRequested');
204
+ }
205
+ _createGetAuthTokenMonitor() {
206
+ return new _spdiagnostics._QosMonitor('IsolatedAdaptiveCardExtensionService._getAuthToken');
207
+ }
208
+ _configureDestUrlParams(loadArgs) {
209
+ const { dashboardListId, itemId } = loadArgs;
210
+ const destUrlParams = new URLSearchParams(window.location.search);
386
211
  destUrlParams.append('dashboardListID', dashboardListId);
387
212
  destUrlParams.append('id', itemId);
388
- if (sp_telemetry_1._SPPerfExperiment.getVariantAndTrackExperiment(sp_telemetry_1._PerformanceExperiment.WEXOOPIF) === 1) {
213
+ if (_sptelemetry._SPPerfExperiment.getVariantAndTrackExperiment(_sptelemetry._PerformanceExperiment.WEXOOPIF) === 1) {
389
214
  destUrlParams.append('OOPIF', '1');
390
215
  }
391
- destUrlParams.append('deviceContext', sp_core_library_1._BrowserUtilities.isTeams1PVivaDesktopHosted() ? 'TeamsDesktop' : 'WebView');
216
+ destUrlParams.append('deviceContext', _spcorelibrary._BrowserUtilities.isTeams1PVivaDesktopHosted() ? 'TeamsDesktop' : 'WebView');
392
217
  destUrlParams.append('parentWindowOrigin', window.location.origin);
393
218
  return destUrlParams;
394
- };
395
- IsolatedAdaptiveCardExtensionService.prototype._configureIframeSrc = function (isolatedDomain, loadArgs, isVCD1P) {
396
- var serverRelativeUrl = this._pageContext.site.serverRelativeUrl;
397
- var destBaseUrl = serverRelativeUrl === '/' ? '' : serverRelativeUrl;
398
- var isolatedUrlBase = (0, sp_component_base_1._ensureIsolatedDomainUrl)(isolatedDomain, this._pageContext.web.absoluteUrl);
399
- var destUrlParams = this._configureDestUrlParams(loadArgs);
400
- var serviceDestinationEndpoint = loadArgs.serviceDestinationEndpoint;
401
- var layoutPage = !(0, Killswitches_1.isTargetBotDriveAceAspxKSActivated)() && serviceDestinationEndpoint !== undefined
402
- ? serviceDestinationEndpoint
403
- : 'adaptivecardextensions.aspx';
404
- var destUrl = "/_layouts/15/".concat(layoutPage, "?").concat(destUrlParams.toString());
405
- if (sp_core_library_1._BrowserUtilities.isUsingSecureBroker()) {
406
- return "".concat(isolatedUrlBase, "/_layouts/15/brokerlogon.aspx?spfx=true&").concat(sp_core_library_1._BROKER_IN_USE_KEY, "=true&dest=").concat(encodeURIComponent(isolatedUrlBase + destUrl));
407
- }
408
- else if (isVCD1P && (0, Flights_1.isFramedTeamsLogonEnabled)()) {
409
- // Use framedteamslogon.aspx for scenarios where cookie auth doesn't work e.g. Teams, Safari, etc.
410
- return "".concat(isolatedUrlBase, "/_layouts/15/framedteamslogon.aspx?spfx=true&dest=").concat(encodeURIComponent(destBaseUrl + destUrl));
411
- }
412
- else {
219
+ }
220
+ _configureIframeSrc(isolatedDomain, loadArgs) {
221
+ const isolatedUrlBase = (0, _spcomponentbase._ensureIsolatedDomainUrl)(isolatedDomain, this._pageContext.web.absoluteUrl);
222
+ const destUrlParams = this._configureDestUrlParams(loadArgs);
223
+ const { serviceDestinationEndpoint } = loadArgs;
224
+ const layoutPage = !(0, _Killswitches.isTargetBotDriveAceAspxKSActivated)() && serviceDestinationEndpoint !== undefined ? serviceDestinationEndpoint : 'adaptivecardextensions.aspx';
225
+ const destUrl = `/_layouts/15/${layoutPage}?${destUrlParams.toString()}`;
226
+ if (_spcorelibrary._BrowserUtilities.isUsingSecureBroker()) {
227
+ return `${isolatedUrlBase}/_layouts/15/brokerlogon.aspx?spfx=true&${_spcorelibrary._BROKER_IN_USE_KEY}=true&dest=${encodeURIComponent(isolatedUrlBase + destUrl)}`;
228
+ } else {
413
229
  return isolatedUrlBase + destUrl;
414
230
  }
415
- };
416
- IsolatedAdaptiveCardExtensionService.prototype._createIsolatedListenerEntry = function (isolatedDomain, iframe, args) {
417
- var listenerId = args.listenerId, callback = args.callback, manifestId = args.manifestId;
231
+ }
232
+ _createIsolatedListenerEntry(isolatedDomain, iframe, args) {
233
+ const { listenerId, callback, manifestId } = args;
418
234
  return {
419
- isolatedDomain: isolatedDomain,
235
+ isolatedDomain,
420
236
  iframe: iframe,
421
- listeners: new Map([[listenerId, { callback: callback }]]),
422
- manifestId: manifestId
237
+ listeners: new Map([
238
+ [
239
+ listenerId,
240
+ {
241
+ callback
242
+ }
243
+ ]
244
+ ]),
245
+ manifestId
423
246
  };
424
- };
425
- IsolatedAdaptiveCardExtensionService.prototype._handleRenderingFromPersistedData = function (args) {
426
- // not implemented
427
- };
247
+ }
248
+ _handleRenderingFromPersistedData(args) {
249
+ // not implemented
250
+ }
428
251
  /**
429
- * @internal
430
- * @param instanceId - string
431
- * @returns IIsolatedFrame instance
432
- */
433
- IsolatedAdaptiveCardExtensionService.prototype._getIsolatedFrame = function (instanceId) {
434
- var entry = this._isolatedListeners.get(instanceId);
252
+ * @internal
253
+ * @param instanceId - string
254
+ * @returns IIsolatedFrame instance
255
+ */ _getIsolatedFrame(instanceId) {
256
+ const entry = this._isolatedListeners.get(instanceId);
435
257
  return entry ? this._isolatedFrames.get(entry.isolatedDomain) : undefined;
436
- };
437
- IsolatedAdaptiveCardExtensionService.prototype._sendMessage = function (isolatedFrame, instanceId, message) {
258
+ }
259
+ _sendMessage(isolatedFrame, instanceId, message) {
438
260
  if (isolatedFrame) {
439
261
  this._postOrQueueMessage(isolatedFrame, message, instanceId);
262
+ } else {
263
+ this._logError(`No entry for ${instanceId}`);
440
264
  }
441
- else {
442
- this._logError("No entry for ".concat(instanceId));
443
- }
444
- };
265
+ }
445
266
  /**
446
- * Notify listeners of a change with the ACE;
447
- *
448
- * @param instanceId - ACE instance.
449
- * @param args - {@link _IsolatedServiceCallbackParameters}
450
- * @param listenerId - Optional. If provided, only invoke the callback for this listener.
451
- */
452
- IsolatedAdaptiveCardExtensionService.prototype._invokeCallback = function (instanceId, args, listenerId) {
453
- var _a;
454
- var entry = this._isolatedListeners.get(instanceId);
267
+ * Notify listeners of a change with the ACE;
268
+ *
269
+ * @param instanceId - ACE instance.
270
+ * @param args - {@link _IsolatedServiceCallbackParameters}
271
+ * @param listenerId - Optional. If provided, only invoke the callback for this listener.
272
+ */ _invokeCallback(instanceId, args, listenerId) {
273
+ const entry = this._isolatedListeners.get(instanceId);
455
274
  this._callbackCache.set(instanceId, args);
456
275
  if (entry) {
457
276
  if (listenerId) {
458
- (_a = entry.listeners.get(listenerId)) === null || _a === void 0 ? void 0 : _a.callback(args);
459
- }
460
- else {
461
- entry.listeners.forEach(function (listener) { return listener.callback(args); });
277
+ entry.listeners.get(listenerId)?.callback(args);
278
+ } else {
279
+ entry.listeners.forEach((listener)=>listener.callback(args));
462
280
  }
281
+ } else {
282
+ this._logError(`No entry for ${instanceId}`);
463
283
  }
464
- else {
465
- this._logError("No entry for ".concat(instanceId));
466
- }
467
- };
284
+ }
468
285
  /**
469
- * Trace log an error.
470
- *
471
- * @param errorMessage - Message to create a new `Error` object.
472
- */
473
- IsolatedAdaptiveCardExtensionService.prototype._logError = function (errorMessage) {
474
- sp_diagnostics_1._TraceLogger.logError(IsolatedAdaptiveCardExtensionService._logSource, new Error(errorMessage));
475
- };
476
- IsolatedAdaptiveCardExtensionService.prototype._getAuthToken = function (applicationId, claims, origin) {
477
- var _this = this;
478
- var qosMonitor = this._createGetAuthTokenMonitor();
479
- var configurableTokenProvider = sp_http_base_1._AadTokenProviders.configurable;
286
+ * Trace log an error.
287
+ *
288
+ * @param errorMessage - Message to create a new `Error` object.
289
+ */ _logError(errorMessage) {
290
+ _spdiagnostics._TraceLogger.logError(IsolatedAdaptiveCardExtensionService._logSource, new Error(errorMessage));
291
+ }
292
+ _getAuthToken(applicationId, claims, origin) {
293
+ const qosMonitor = this._createGetAuthTokenMonitor();
294
+ const configurableTokenProvider = _sphttpbase._AadTokenProviders.configurable;
480
295
  if (!configurableTokenProvider._oboThirdPartyTokenCallback) {
481
296
  qosMonitor.writeUnexpectedFailure('oboThirdPartTokenCallbackUndefined');
482
297
  this._logError('Unexpected message: oboThirdPartyTokenCallback is not defined.');
483
298
  return;
484
299
  }
485
- configurableTokenProvider._oboThirdPartyTokenCallback(applicationId, claims)
486
- .then(function (token) {
487
- var originURL = new URL(origin);
488
- var isolatedFrame = _this._isolatedFrames.get(originURL.hostname);
489
- _this._sendMessage(isolatedFrame, '', // instanceId not associated with obo token call back flow.
490
- {
491
- token: token,
492
- applicationId: applicationId,
300
+ configurableTokenProvider._oboThirdPartyTokenCallback(applicationId, claims).then((token)=>{
301
+ const originURL = new URL(origin);
302
+ const isolatedFrame = this._isolatedFrames.get(originURL.hostname);
303
+ this._sendMessage(isolatedFrame, '', {
304
+ token,
305
+ applicationId,
493
306
  serviceAction: 'OBOToken'
494
307
  });
495
308
  qosMonitor.writeSuccess();
496
- })
497
- .catch(function (err) {
309
+ }).catch((err)=>{
498
310
  qosMonitor.writeUnexpectedFailure('oboThirdPartTokenCallbackFailure');
499
- _this._logError("Unexpected message: ".concat(JSON.stringify(err)));
311
+ this._logError(`Unexpected message: ${JSON.stringify(err)}`);
500
312
  });
501
- };
502
- IsolatedAdaptiveCardExtensionService.prototype._postOrQueueMessage = function (isolatedFrame, message, instanceId) {
313
+ }
314
+ _postOrQueueMessage(isolatedFrame, message, instanceId) {
503
315
  if (isolatedFrame.isReady) {
504
316
  message.messageType = 'serviceMessage';
505
317
  isolatedFrame.iframe.contentWindow.postMessage(message, '*');
318
+ } else {
319
+ isolatedFrame.messageQueue.push([
320
+ instanceId,
321
+ message
322
+ ]);
506
323
  }
507
- else {
508
- isolatedFrame.messageQueue.push([instanceId, message]);
509
- }
510
- };
511
- IsolatedAdaptiveCardExtensionService.serviceKey = sp_core_library_1.ServiceKey.create('sp-adaptive-card-extension-base::IsolatedAdaptiveCardExtensionService', IsolatedAdaptiveCardExtensionService);
512
- IsolatedAdaptiveCardExtensionService._logSource = { id: 'IsolatedAdaptiveCardExtensionService' };
513
- return IsolatedAdaptiveCardExtensionService;
514
- }());
515
- exports.IsolatedAdaptiveCardExtensionService = IsolatedAdaptiveCardExtensionService;
516
- //# sourceMappingURL=IsolatedAdaptiveCardExtensionService.js.map
324
+ }
325
+ constructor(serviceScope){
326
+ this._callbackCache = new Map();
327
+ this._isolatedFrames = new Map();
328
+ this._isolatedListeners = new Map();
329
+ this._handleIframeTimeout = (isolatedFrameKey, isVCD1P)=>{
330
+ const frame = this._isolatedFrames.get(isolatedFrameKey);
331
+ const { frameMonitor, retryMonitor, tokenMonitor } = frame;
332
+ /*
333
+ * There is a rare case the iframe is running into a "reset connection" error. This is because the
334
+ * client/server is unable to communicate for an unknown reason. When we run into this, we will attempt to refresh the iframe once.
335
+ */ if (frame.retryCount < 1) {
336
+ frame.retryCount += 1;
337
+ frame.retryMonitor = this._createRetryMonitor();
338
+ // Use a shorter interval for the retry, this would put the retry around ~P95
339
+ frame.timeoutId = setTimeout(()=>this._handleIframeTimeout(isolatedFrameKey, isVCD1P), TIMEOUT_INTERVAL - 500);
340
+ return;
341
+ } else if (retryMonitor) {
342
+ retryMonitor.writeUnexpectedFailure('reloadFailed');
343
+ }
344
+ /*
345
+ * If this timeout has been executed then the isolated ACE application
346
+ * did not send the `Ready` message to the host applicaton. By checking if
347
+ * the `tokenMonitor` exists we can verify whether framedteamslogon even requested
348
+ * a token. If it doesn't exist, then we assume we are stuck in the MSAL interactive flow.
349
+ * This would be unexpected in Teams but is a known issue in browsers with ITP or 3P
350
+ * cookies blocked.
351
+ */ if (frameMonitor && !frameMonitor.hasEnded) {
352
+ try {
353
+ if (tokenMonitor) {
354
+ frameMonitor.writeUnexpectedFailure('tokenTimeout');
355
+ if (!tokenMonitor.hasEnded) {
356
+ tokenMonitor.writeUnexpectedFailure('timeout');
357
+ }
358
+ } else {
359
+ if (isVCD1P) {
360
+ // We should never hit this, but adding for completeness
361
+ frameMonitor.writeUnexpectedFailure('authorizeTimeout');
362
+ } else {
363
+ frameMonitor.writeExpectedFailure('authorizeTimeout');
364
+ }
365
+ }
366
+ } catch (e) {
367
+ frameMonitor.writeUnexpectedFailure('unexpectedFailure', e);
368
+ }
369
+ }
370
+ };
371
+ /**
372
+ * Message handler for isolated domain iframes.
373
+ *
374
+ * @param message - {@link _IsolatedAdaptiveCardExtensionApplicationMessageEvent}
375
+ */ this._handleIsolatedApplicationMessage = (message)=>{
376
+ const { data } = message;
377
+ if (data.messageType === 'applicationMessage') {
378
+ const { instanceId, kind } = data;
379
+ switch(kind){
380
+ case 'Card':
381
+ this._invokeCallback(instanceId, {
382
+ aceData: data.aceData,
383
+ card: data.card,
384
+ cacheObject: data.cacheObject,
385
+ type: kind
386
+ });
387
+ break;
388
+ case 'CloseQuickView':
389
+ const qvFrame = this._isolatedFrames.get(new URL(message.origin).hostname);
390
+ if (qvFrame) {
391
+ qvFrame.iframe.hidden = true;
392
+ }
393
+ break;
394
+ case 'Error':
395
+ this._invokeCallback(instanceId, {
396
+ error: data.error,
397
+ type: kind
398
+ });
399
+ break;
400
+ case 'OpenQuickView':
401
+ const frame = this._isolatedFrames.get(new URL(message.origin).hostname);
402
+ if (frame) {
403
+ frame.iframe.hidden = false;
404
+ }
405
+ break;
406
+ case 'OpenUrl':
407
+ this._invokeCallback(instanceId, {
408
+ type: kind,
409
+ url: data.url
410
+ });
411
+ break;
412
+ case 'LocationRequest':
413
+ this._invokeCallback(instanceId, {
414
+ type: kind
415
+ });
416
+ break;
417
+ case 'RenderCompleted':
418
+ this._invokeCallback(instanceId, {
419
+ type: kind,
420
+ didUpdate: data.didUpdate
421
+ });
422
+ break;
423
+ case 'Ready':
424
+ /*
425
+ * Once we get this message from the isolated ACE application, we know it has been loaded
426
+ * and we can start sending messages to the isolated frame.
427
+ */ const isolatedFrame = this._isolatedFrames.get(new URL(message.origin).hostname);
428
+ if (isolatedFrame) {
429
+ if (isolatedFrame.retryMonitor) {
430
+ isolatedFrame.retryMonitor.writeSuccess();
431
+ }
432
+ clearTimeout(isolatedFrame.timeoutId);
433
+ isolatedFrame.frameMonitor.writeSuccess();
434
+ isolatedFrame.isReady = true;
435
+ for (const [id, msg] of isolatedFrame.messageQueue){
436
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
437
+ this._sendMessage(this._getIsolatedFrame(id), id, msg);
438
+ }
439
+ isolatedFrame.messageQueue = [];
440
+ }
441
+ break;
442
+ case 'OBOTokenRequest':
443
+ const { applicationId, claims } = data;
444
+ this._getAuthToken(applicationId, claims, message.origin);
445
+ break;
446
+ case 'PropertyPaneConfiguration':
447
+ this._invokeCallback(instanceId, {
448
+ propertyPaneConfiguration: data.propertyPaneConfiguration,
449
+ type: kind
450
+ });
451
+ break;
452
+ default:
453
+ this._logError(`Unexpected message: ${JSON.stringify(message.data)}`);
454
+ break;
455
+ }
456
+ } else if (data.messageType === 'bridgeMessage' && data.bridgeAction === 'onTokenRequested') {
457
+ /*
458
+ * When we load in Teams, we use framedteamslogon to ensure the isolated app iframe has a valid cookie.
459
+ * If it doesn't then framedteamslogon will request a token from the host app to use to call the
460
+ * /Authenticate API, which will set a new session cookie on the iframe and then redirect to the isolated
461
+ * ACE applicaton.
462
+ */ const monitor = this._createTokenRequestMonitor();
463
+ const { applicationId, claims } = data;
464
+ const isolatedFrame = this._isolatedFrames.get(new URL(message.origin).hostname);
465
+ if (!isolatedFrame) {
466
+ monitor.writeUnexpectedFailure('missingIsolatedFrame');
467
+ return;
468
+ }
469
+ isolatedFrame.tokenMonitor = monitor;
470
+ const configurableTokenProvider = _sphttpbase._AadTokenProviders.configurable;
471
+ if (!configurableTokenProvider._oboThirdPartyTokenCallback) {
472
+ monitor.writeUnexpectedFailure('missingThirdPartyTokenCallback');
473
+ return;
474
+ }
475
+ try {
476
+ configurableTokenProvider._oboThirdPartyTokenCallback(applicationId, claims).then((token)=>{
477
+ if (!isolatedFrame.iframe.contentWindow) {
478
+ throw new Error('missingContentWindow');
479
+ }
480
+ isolatedFrame.iframe.contentWindow.postMessage({
481
+ token,
482
+ messageType: 'dashboardMessage',
483
+ kind: 'Token'
484
+ }, '*');
485
+ monitor.writeSuccess();
486
+ }).catch((e)=>{
487
+ monitor.writeUnexpectedFailure('oboThirdPartyTokenCallbackError', e);
488
+ });
489
+ } catch (e) {
490
+ /*
491
+ * This is to account for an exception when calling the `_oboThirdPartyTokenCallback`.
492
+ * We've seen in the past where it unexpectedly returned `undefined` causing the Promise
493
+ * chain to never be executed.
494
+ */ monitor.writeUnexpectedFailure('unexpectedException', e);
495
+ }
496
+ }
497
+ };
498
+ this._serviceScope = serviceScope;
499
+ window.addEventListener('message', this._handleIsolatedApplicationMessage);
500
+ }
501
+ }
502
+ IsolatedAdaptiveCardExtensionService.serviceKey = _spcorelibrary.ServiceKey.create('sp-adaptive-card-extension-base::IsolatedAdaptiveCardExtensionService', IsolatedAdaptiveCardExtensionService);
503
+ IsolatedAdaptiveCardExtensionService._logSource = {
504
+ id: 'IsolatedAdaptiveCardExtensionService'
505
+ };
506
+
507
+ //# sourceMappingURL=./IsolatedAdaptiveCardExtensionService.js.map