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