@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,130 @@
|
|
|
1
|
+
import { _QosMonitor } from '@microsoft/sp-diagnostics';
|
|
2
|
+
import { _CacheStrategy, _getCacheDataProviderServiceKey } from '@microsoft/sp-http-base';
|
|
3
|
+
import { isSafeCheckUndefinedCacheProviderKSActivated } from '../../common/Killswitches';
|
|
4
|
+
import { BaseAdaptiveCardExtensionCache } from './BaseAdaptiveCardExtensionCache';
|
|
5
|
+
var CacheDataErrorType;
|
|
6
|
+
(function(CacheDataErrorType) {
|
|
7
|
+
CacheDataErrorType[CacheDataErrorType["CacheMissError"] = 100001] = "CacheMissError";
|
|
8
|
+
})(CacheDataErrorType || (CacheDataErrorType = {}));
|
|
9
|
+
/**
|
|
10
|
+
* LKG Cache which uses MySiteCache as its backing store.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/ export class ACEMySiteCacheManager extends BaseAdaptiveCardExtensionCache {
|
|
14
|
+
static instance(serviceScope) {
|
|
15
|
+
if (!ACEMySiteCacheManager._instance) {
|
|
16
|
+
ACEMySiteCacheManager._instance = new ACEMySiteCacheManager(serviceScope);
|
|
17
|
+
}
|
|
18
|
+
return ACEMySiteCacheManager._instance;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Saves an ACECacheEntry to MySiteCache.
|
|
22
|
+
*
|
|
23
|
+
* @param key - dashboard web part instance Id or ACE instance Id
|
|
24
|
+
* @param instanceId - ACE instance Id
|
|
25
|
+
* @param data - cache data that needs to be saved to MySiteCache
|
|
26
|
+
*/ save(key, instanceId, data) {
|
|
27
|
+
const extendedCacheInfo = key !== instanceId ? 'DashboardWebPart' : 'DashboardPage';
|
|
28
|
+
const qosMonitor = new _QosMonitor(`ACEMySiteCache.save.${extendedCacheInfo}`);
|
|
29
|
+
const cacheKey = {
|
|
30
|
+
key
|
|
31
|
+
};
|
|
32
|
+
if (!isSafeCheckUndefinedCacheProviderKSActivated() && !this._cacheProvider) {
|
|
33
|
+
qosMonitor.writeExpectedFailure('cacheProvider is undefined');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!this._cacheEntries[key]) {
|
|
37
|
+
const cacheEntry = {
|
|
38
|
+
[instanceId]: data
|
|
39
|
+
};
|
|
40
|
+
this._cacheEntries[key] = cacheEntry;
|
|
41
|
+
}
|
|
42
|
+
this._cacheEntries[key][instanceId] = data;
|
|
43
|
+
this._cacheProvider?.setData(cacheKey, this._cacheEntries[key], this._getCacheConfig(key)).then((isDataSaved)=>{
|
|
44
|
+
if (isDataSaved) {
|
|
45
|
+
qosMonitor.writeSuccess({
|
|
46
|
+
isDataSaved
|
|
47
|
+
});
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
}
|
|
50
|
+
qosMonitor.writeUnexpectedFailure('dataIsNotSaved');
|
|
51
|
+
}).catch((err)=>{
|
|
52
|
+
qosMonitor.writeUnexpectedFailure('mySiteCacheSetDataFailed', err);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
get(key, instanceId) {
|
|
56
|
+
return super.get(key, instanceId);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetches cached data using the key and instanceId
|
|
60
|
+
*
|
|
61
|
+
* @param key - dashboard web part instance Id or ACE instance Id
|
|
62
|
+
* @param instanceId - ACE instance Id
|
|
63
|
+
* @returns - cached ace data
|
|
64
|
+
*/ getFromSource(key, instanceId) {
|
|
65
|
+
const extendedCacheInfo = key !== instanceId ? 'DashboardWebPart' : 'DashboardPage';
|
|
66
|
+
const qosMonitor = new _QosMonitor(`ACEMySiteCache.getFromSource.${extendedCacheInfo}`);
|
|
67
|
+
const cacheKey = {
|
|
68
|
+
key
|
|
69
|
+
};
|
|
70
|
+
let ensureCache = this._providerPromises.get(key);
|
|
71
|
+
if (!isSafeCheckUndefinedCacheProviderKSActivated() && !this._cacheProvider) {
|
|
72
|
+
qosMonitor.writeExpectedFailure('cacheProvider is undefined');
|
|
73
|
+
return Promise.resolve(undefined);
|
|
74
|
+
}
|
|
75
|
+
if (!ensureCache) {
|
|
76
|
+
ensureCache = this._cacheProvider.getData(cacheKey, this._getCacheConfig(key)).then((cachedData)=>{
|
|
77
|
+
qosMonitor.writeSuccess();
|
|
78
|
+
return cachedData.data;
|
|
79
|
+
}).then((mySiteCacheData)=>{
|
|
80
|
+
this._populateLocalCache(key, mySiteCacheData);
|
|
81
|
+
}).catch((err)=>{
|
|
82
|
+
this._providerPromises.delete(key);
|
|
83
|
+
const extraData = {
|
|
84
|
+
instanceId
|
|
85
|
+
};
|
|
86
|
+
if (err.errorCode === 100001) {
|
|
87
|
+
qosMonitor.writeExpectedFailure('cacheMiss', err, extraData);
|
|
88
|
+
} else {
|
|
89
|
+
qosMonitor.writeUnexpectedFailure('unexpectedError', err, extraData);
|
|
90
|
+
}
|
|
91
|
+
return Promise.reject(err);
|
|
92
|
+
});
|
|
93
|
+
this._providerPromises.set(key, ensureCache);
|
|
94
|
+
}
|
|
95
|
+
return ensureCache.then(()=>this._cacheEntries[key] ? this._cacheEntries[key][instanceId] : undefined);
|
|
96
|
+
}
|
|
97
|
+
_populateLocalCache(key, mySiteCacheData) {
|
|
98
|
+
const instanceIds = Object.keys(mySiteCacheData);
|
|
99
|
+
const cacheEntry = {};
|
|
100
|
+
instanceIds.forEach((instanceId)=>{
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
cacheEntry[instanceId] = mySiteCacheData[instanceId];
|
|
103
|
+
});
|
|
104
|
+
this._cacheEntries[key] = cacheEntry;
|
|
105
|
+
}
|
|
106
|
+
_getCacheConfig(key) {
|
|
107
|
+
return {
|
|
108
|
+
cacheStrategy: _CacheStrategy.CacheAndNetwork,
|
|
109
|
+
expirationDuration: undefined,
|
|
110
|
+
id: key,
|
|
111
|
+
alias: 'ACEMySiteCacheManager',
|
|
112
|
+
extraProps: ACEMySiteCacheManager._cacheExtraProps
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
constructor(serviceScope){
|
|
116
|
+
super();
|
|
117
|
+
this._serviceScope = serviceScope;
|
|
118
|
+
this._cacheEntries = {};
|
|
119
|
+
this._cacheProvider = this._serviceScope.consume(_getCacheDataProviderServiceKey())._provider;
|
|
120
|
+
this._providerPromises = new Map();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
ACEMySiteCacheManager._cacheExtraProps = new Map([
|
|
124
|
+
[
|
|
125
|
+
'onlyMySiteCache',
|
|
126
|
+
true
|
|
127
|
+
]
|
|
128
|
+
]);
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=./ACEMySiteCacheManager.js.map
|
|
@@ -4,32 +4,26 @@ import { isLogACECacheValidityKSActivated } from '../../common/Killswitches';
|
|
|
4
4
|
* Cache used by host to save and retrieve LKG cache objects.
|
|
5
5
|
*
|
|
6
6
|
* @internal
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
BaseAdaptiveCardExtensionCache.prototype.get = function (key, instanceId) {
|
|
12
|
-
return this.getFromSource(key, instanceId).then(function (cacheObject) {
|
|
7
|
+
*/ export class BaseAdaptiveCardExtensionCache {
|
|
8
|
+
get(key, instanceId) {
|
|
9
|
+
return this.getFromSource(key, instanceId).then((cacheObject)=>{
|
|
13
10
|
if (!isLogACECacheValidityKSActivated()) {
|
|
14
|
-
|
|
11
|
+
const monitor = new _QosMonitor('ACECache.Get');
|
|
15
12
|
if (cacheObject && new Date().getTime() < cacheObject.expirationTime) {
|
|
16
13
|
monitor.writeSuccess();
|
|
17
14
|
return cacheObject;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
15
|
+
} else {
|
|
20
16
|
monitor.writeExpectedFailure(!cacheObject ? 'CacheMiss' : 'CacheExpired');
|
|
21
17
|
return undefined;
|
|
22
18
|
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
19
|
+
} else {
|
|
25
20
|
if (cacheObject) {
|
|
26
21
|
return new Date().getTime() < cacheObject.expirationTime ? cacheObject : undefined;
|
|
27
22
|
}
|
|
28
23
|
return undefined;
|
|
29
24
|
}
|
|
30
25
|
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=BaseAdaptiveCardExtensionCache.js.map
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=./BaseAdaptiveCardExtensionCache.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseAdaptiveCardExtensionCache } from './BaseAdaptiveCardExtensionCache';
|
|
2
|
+
import { _QosMonitor } from '@microsoft/sp-diagnostics';
|
|
3
|
+
/**
|
|
4
|
+
* LKG Cache which uses LocalStorage as its backing store.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/ export class LocalStorageACECache extends BaseAdaptiveCardExtensionCache {
|
|
8
|
+
static getKey(siteId, listItemUniqueId) {
|
|
9
|
+
return `AdaptiveCardExtension_LKG_${siteId}_${listItemUniqueId}`;
|
|
10
|
+
}
|
|
11
|
+
static get instance() {
|
|
12
|
+
if (this._instance === undefined) {
|
|
13
|
+
this._instance = new LocalStorageACECache();
|
|
14
|
+
}
|
|
15
|
+
return this._instance;
|
|
16
|
+
}
|
|
17
|
+
save(key, instanceId, cacheObject) {
|
|
18
|
+
const monitor = new _QosMonitor('ACE.LocalStorage.save');
|
|
19
|
+
try {
|
|
20
|
+
const localStorageEntry = this._getLocalStorageEntry(key);
|
|
21
|
+
localStorageEntry.set(instanceId, cacheObject);
|
|
22
|
+
const mapEntriesArray = Array.from(localStorageEntry.entries());
|
|
23
|
+
localStorage.setItem(key, JSON.stringify(mapEntriesArray));
|
|
24
|
+
monitor.writeSuccess();
|
|
25
|
+
} catch (e) {
|
|
26
|
+
const alias = cacheObject.cachedCard.cardProperties.title || '';
|
|
27
|
+
monitor.writeUnexpectedFailure('', e, {
|
|
28
|
+
alias,
|
|
29
|
+
instanceId
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
getFromSource(key, instanceId) {
|
|
34
|
+
const monitor = new _QosMonitor('ACE.LocalStorage.get');
|
|
35
|
+
try {
|
|
36
|
+
const entries = this._getLocalStorageEntry(key);
|
|
37
|
+
const cachedObject = entries.get(instanceId);
|
|
38
|
+
if (cachedObject) {
|
|
39
|
+
monitor.writeSuccess();
|
|
40
|
+
} else {
|
|
41
|
+
monitor.writeExpectedFailure('cacheMiss', undefined, {
|
|
42
|
+
instanceId
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return Promise.resolve(cachedObject);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
monitor.writeUnexpectedFailure('', e, {
|
|
48
|
+
instanceId
|
|
49
|
+
});
|
|
50
|
+
return Promise.resolve(undefined);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
_getLocalStorageEntry(key) {
|
|
54
|
+
const cacheEntry = this._cachedMap.get(key);
|
|
55
|
+
// If already cached in-memory, do not expensive JSON.parse again.
|
|
56
|
+
if (cacheEntry) {
|
|
57
|
+
return cacheEntry;
|
|
58
|
+
}
|
|
59
|
+
// Otherwise, parse LKG JSON string and cache in-memory.
|
|
60
|
+
const cacheString = localStorage.getItem(key);
|
|
61
|
+
const aceLkgMap = cacheString ? new Map(JSON.parse(cacheString)) : new Map();
|
|
62
|
+
this._cachedMap.set(key, aceLkgMap);
|
|
63
|
+
return aceLkgMap;
|
|
64
|
+
}
|
|
65
|
+
constructor(...args){
|
|
66
|
+
super(...args);
|
|
67
|
+
/**
|
|
68
|
+
* In-memory cache to avoid main thread cost of repeatedly parsing ACE LKG cached strings (greater than 50kB).
|
|
69
|
+
*/ this._cachedMap = new Map();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=./LocalStorageACECache.js.map
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { _BrowserUtilities, _SPExperiment, _SPFlight } from '@microsoft/sp-core-library';
|
|
2
2
|
import { isExcludeVivaHomeFromMySiteCacheKSActivated } from './Killswitches';
|
|
3
3
|
export function isFramedTeamsLogonEnabled() {
|
|
4
|
-
return _SPFlight.isEnabled(60128 /* SPPPlatIsolatedACETeamsLogon */);
|
|
4
|
+
return _SPFlight.isEnabled(60128 /* SPPPlatIsolatedACETeamsLogon */ );
|
|
5
5
|
}
|
|
6
6
|
export function isAdaptiveCardExtensionMySiteCacheEnabled() {
|
|
7
|
-
return (
|
|
8
|
-
_SPExperiment.getVariantAndLogExposure(90148 /* ACECacheExperiment */) === 1) &&
|
|
9
|
-
(isExcludeVivaHomeFromMySiteCacheKSActivated() || !_BrowserUtilities.isVivaHome()));
|
|
7
|
+
return (_SPFlight.isEnabled(60399 /* MySiteCache for Adaptive Card Extension WebPart */ ) || _SPExperiment.getVariantAndLogExposure(90148 /* ACECacheExperiment */ ) === 1) && (isExcludeVivaHomeFromMySiteCacheKSActivated() || !_BrowserUtilities.isVivaHome());
|
|
10
8
|
}
|
|
11
9
|
/**
|
|
12
10
|
* @internal
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
return _SPFlight.isEnabled(60236 /* EnableDashboardUniqueIdInEngagementLogs */);
|
|
11
|
+
*/ export function isEnableDashboardUniqueIdInEngagementLogsEnabled() {
|
|
12
|
+
return _SPFlight.isEnabled(60236 /* EnableDashboardUniqueIdInEngagementLogs */ );
|
|
16
13
|
}
|
|
17
|
-
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=./Flights.js.map
|
|
@@ -1,174 +1,106 @@
|
|
|
1
1
|
import { _SPKillSwitch } from '@microsoft/sp-core-library';
|
|
2
2
|
export function isIsolatedAdaptiveCardExtensionWebPropertyPaneWorkAroundKSActivated() {
|
|
3
|
-
return _SPKillSwitch.isActivated('b8c50ded-d048-4eb9-bc41-21190d9d3bbb'
|
|
4
|
-
/* '03/17/2022', 'Work around to enable property pane for isolated ACE web' */
|
|
5
|
-
);
|
|
3
|
+
return _SPKillSwitch.isActivated('b8c50ded-d048-4eb9-bc41-21190d9d3bbb');
|
|
6
4
|
}
|
|
7
5
|
export function isTargetBotDriveAceAspxKSActivated() {
|
|
8
|
-
return _SPKillSwitch.isActivated('e8daf7db-132e-4225-93a4-70cc5fc06bb9'
|
|
9
|
-
/* '04/14/22', 'Target botDriveAce.aspx for Bot Drive ACEs.' */
|
|
10
|
-
);
|
|
6
|
+
return _SPKillSwitch.isActivated('e8daf7db-132e-4225-93a4-70cc5fc06bb9');
|
|
11
7
|
}
|
|
12
8
|
export function isTemplateCloneKSActivated() {
|
|
13
|
-
return _SPKillSwitch.isActivated('9cb880d2-c8c3-4fde-96a0-b29c84ef6edd'
|
|
14
|
-
/* '11/22/23', 'Cloning basic templates before transpiling cardview parameters.' */
|
|
15
|
-
);
|
|
9
|
+
return _SPKillSwitch.isActivated('9cb880d2-c8c3-4fde-96a0-b29c84ef6edd');
|
|
16
10
|
}
|
|
17
11
|
export function isExcludeVivaHomeFromMySiteCacheKSActivated() {
|
|
18
|
-
return _SPKillSwitch.isActivated('5c806b76-07fd-4ea8-afce-10c676a1739e'
|
|
19
|
-
/* '10/11/2022', 'Exclude VivaHome from using ACE MySiteCache.' */
|
|
20
|
-
);
|
|
12
|
+
return _SPKillSwitch.isActivated('5c806b76-07fd-4ea8-afce-10c676a1739e');
|
|
21
13
|
}
|
|
22
14
|
export function isReduceRenderTimeoutKSActivated() {
|
|
23
|
-
return _SPKillSwitch.isActivated('8a4feb2f-ae4e-4174-9be1-0eb0b1371665'
|
|
24
|
-
/* '10/17/2022', 'Reduce default render timeout of ACEs to 10s.' */
|
|
25
|
-
);
|
|
15
|
+
return _SPKillSwitch.isActivated('8a4feb2f-ae4e-4174-9be1-0eb0b1371665');
|
|
26
16
|
}
|
|
27
17
|
export function isLogACECacheValidityKSActivated() {
|
|
28
|
-
return _SPKillSwitch.isActivated('63a9cba3-4d6e-44a7-bdfb-3464aeb6a4a4'
|
|
29
|
-
/* '11/02/2022', 'Logs if ace cache is valid of has invalidated due to time out.' */
|
|
30
|
-
);
|
|
18
|
+
return _SPKillSwitch.isActivated('63a9cba3-4d6e-44a7-bdfb-3464aeb6a4a4');
|
|
31
19
|
}
|
|
32
20
|
export function isAddDefaultImageAltTextKSActivated() {
|
|
33
|
-
return _SPKillSwitch.isActivated('63a9cba3-4d6e-44a7-bdfb-3464aeb6a4a4'
|
|
34
|
-
/* '11/22/2022', 'Adds default alt text for icons and images rendered in the card view.' */
|
|
35
|
-
);
|
|
21
|
+
return _SPKillSwitch.isActivated('63a9cba3-4d6e-44a7-bdfb-3464aeb6a4a4');
|
|
36
22
|
}
|
|
37
23
|
export function isRemoveIsolatedDomainOnDisposeKSActivated() {
|
|
38
|
-
return _SPKillSwitch.isActivated('080770ac-5b8a-4f68-97b3-abf37230c2ce'
|
|
39
|
-
/* '11/23/2022', 'When disposing of an isolated ACE WP, dispose of the isolated frame in the isolated service.' */
|
|
40
|
-
);
|
|
24
|
+
return _SPKillSwitch.isActivated('080770ac-5b8a-4f68-97b3-abf37230c2ce');
|
|
41
25
|
}
|
|
42
26
|
export function isGenerateUniqueButtonIdKSActivated() {
|
|
43
|
-
return _SPKillSwitch.isActivated('aebbeddc-284c-470d-8bd2-98a4d200cb86'
|
|
44
|
-
/* '11/28/2022', 'Use instance id as part of button id to make it unique.' */
|
|
45
|
-
);
|
|
27
|
+
return _SPKillSwitch.isActivated('aebbeddc-284c-470d-8bd2-98a4d200cb86');
|
|
46
28
|
}
|
|
47
29
|
export function isSafeCheckUndefinedCacheProviderKSActivated() {
|
|
48
|
-
return _SPKillSwitch.isActivated('c761d258-674d-4c2c-91ca-37cd43dd78a5'
|
|
49
|
-
/* '12/19/2022', 'In the case ACE MySiteCache cacheProvider is undefined avoid using caching feature.' */
|
|
50
|
-
);
|
|
30
|
+
return _SPKillSwitch.isActivated('c761d258-674d-4c2c-91ca-37cd43dd78a5');
|
|
51
31
|
}
|
|
52
32
|
export function isACECardViewReactEnabledOnSecureBrokerKSActivated() {
|
|
53
|
-
return _SPKillSwitch.isActivated('e0749332-8697-4811-b063-50b25956b1a3'
|
|
54
|
-
/* '01/23/2023', 'Enable ACE card view React on secure broker' */
|
|
55
|
-
);
|
|
33
|
+
return _SPKillSwitch.isActivated('e0749332-8697-4811-b063-50b25956b1a3');
|
|
56
34
|
}
|
|
57
35
|
/**
|
|
58
36
|
* @internal
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
return _SPKillSwitch.isActivated('96512177-c963-43cb-b876-87ee06253a2c'
|
|
62
|
-
/* '03/01/2023', 'Enable onBeforeAction API.' */
|
|
63
|
-
);
|
|
37
|
+
*/ export function isSurfaceOnBeforeActionKSActivated() {
|
|
38
|
+
return _SPKillSwitch.isActivated('96512177-c963-43cb-b876-87ee06253a2c');
|
|
64
39
|
}
|
|
65
40
|
/**
|
|
66
41
|
* @internal
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
return _SPKillSwitch.isActivated('1cc95d27-414e-4c99-9785-d5badd9ec73b'
|
|
70
|
-
/* '07/19/2023', 'Add KS for Disabling of Logging of Viva Connections Events via new logger' */
|
|
71
|
-
);
|
|
42
|
+
*/ export function isDisableVivaConnectionsAnalyticsEventsKSActivated() {
|
|
43
|
+
return _SPKillSwitch.isActivated('1cc95d27-414e-4c99-9785-d5badd9ec73b');
|
|
72
44
|
}
|
|
73
45
|
export function isAddAppHostTypeToCardActionKSActivated() {
|
|
74
|
-
return _SPKillSwitch.isActivated('06dfa773-bc74-41ca-9496-5ebb4afdfd5e'
|
|
75
|
-
/* '04/13/2023', 'Add appHostType to card action engagement logs.' */
|
|
76
|
-
);
|
|
46
|
+
return _SPKillSwitch.isActivated('06dfa773-bc74-41ca-9496-5ebb4afdfd5e');
|
|
77
47
|
}
|
|
78
48
|
export function isLogEngagementExtraDataKSActivated() {
|
|
79
|
-
return _SPKillSwitch.isActivated('4bd7e0a9-c17a-411b-bda8-1e130c7346ec'
|
|
80
|
-
/* '04/13/2023', 'Check for sending engagement extra data coming from the specific card' */
|
|
81
|
-
);
|
|
49
|
+
return _SPKillSwitch.isActivated('4bd7e0a9-c17a-411b-bda8-1e130c7346ec');
|
|
82
50
|
}
|
|
83
51
|
/**
|
|
84
52
|
* @internal
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
return _SPKillSwitch.isActivated('9050e5ae-5e51-4939-9394-7be770d5de93'
|
|
88
|
-
/* '04/20/2023', 'Support Adaptive Card Action.Execute' */
|
|
89
|
-
);
|
|
53
|
+
*/ export function isSupportActionExecuteKSActivated() {
|
|
54
|
+
return _SPKillSwitch.isActivated('9050e5ae-5e51-4939-9394-7be770d5de93');
|
|
90
55
|
}
|
|
91
56
|
export function isAddVetoForACEKSActivated() {
|
|
92
|
-
return _SPKillSwitch.isActivated('01795526-5047-424b-ab23-026e44862189'
|
|
93
|
-
/* '05/23/23', 'Add asha veto for ACEs.' */
|
|
94
|
-
);
|
|
57
|
+
return _SPKillSwitch.isActivated('01795526-5047-424b-ab23-026e44862189');
|
|
95
58
|
}
|
|
96
59
|
export function isFixIframeNameKSActive() {
|
|
97
|
-
return _SPKillSwitch.isActivated('1c48a38c-d3a7-4440-9c3e-58a56a92f5be'
|
|
98
|
-
/* '06/15/23', 'Fix iframe name for isolated card' */
|
|
99
|
-
);
|
|
60
|
+
return _SPKillSwitch.isActivated('1c48a38c-d3a7-4440-9c3e-58a56a92f5be');
|
|
100
61
|
}
|
|
101
62
|
export function isGenerateComponentIdsKSActivated() {
|
|
102
|
-
return _SPKillSwitch.isActivated('d2cb3786-200c-408f-a646-6d091eadc1be'
|
|
103
|
-
/* '08/03/2023', 'Generate component ids' */
|
|
104
|
-
);
|
|
63
|
+
return _SPKillSwitch.isActivated('d2cb3786-200c-408f-a646-6d091eadc1be');
|
|
105
64
|
}
|
|
106
65
|
export function isProvideCardViewIdKSActivated() {
|
|
107
|
-
return _SPKillSwitch.isActivated('f34f1dc6-aefd-4c08-8530-f4ad7e7ad0d4'
|
|
108
|
-
/* '08/02/2023', 'Provide Card View Id' */
|
|
109
|
-
);
|
|
66
|
+
return _SPKillSwitch.isActivated('f34f1dc6-aefd-4c08-8530-f4ad7e7ad0d4');
|
|
110
67
|
}
|
|
111
68
|
export function isPrepareHTMLQVForMessagingKSActivated() {
|
|
112
|
-
return _SPKillSwitch.isActivated('b764e8cc-79df-4487-a967-5ade7b428b61'
|
|
113
|
-
/* '09/01/2023', 'Prepare HTML Quick View for Messaging' */
|
|
114
|
-
);
|
|
69
|
+
return _SPKillSwitch.isActivated('b764e8cc-79df-4487-a967-5ade7b428b61');
|
|
115
70
|
}
|
|
116
71
|
export function isLogBotIdAndTeamsConnectedAppIdKSActivated() {
|
|
117
|
-
return _SPKillSwitch.isActivated('7d5a70e7-3ebd-42e9-8f8b-b237c2d7f439'
|
|
118
|
-
/* '12/05/2023', 'Log bot id and teams connected app id' */
|
|
119
|
-
);
|
|
72
|
+
return _SPKillSwitch.isActivated('7d5a70e7-3ebd-42e9-8f8b-b237c2d7f439');
|
|
120
73
|
}
|
|
121
74
|
export function isSerializeConnectedTeamsAppIdKSActivated() {
|
|
122
|
-
return _SPKillSwitch.isActivated('6fd170d1-644d-432e-bc91-84c44bdca5b5'
|
|
123
|
-
/* '12/18/2023', 'Serialize connectedTeamsAppId' */
|
|
124
|
-
);
|
|
75
|
+
return _SPKillSwitch.isActivated('6fd170d1-644d-432e-bc91-84c44bdca5b5');
|
|
125
76
|
}
|
|
126
77
|
export function isKeyboardFocusViewNavChangesKSActivated() {
|
|
127
|
-
return _SPKillSwitch.isActivated('cfadd6c3-e59f-438d-ac58-b61e73a979e3'
|
|
128
|
-
/* '12/20/2023', 'Update the View Navigator architecture to allow for Keyboard Nav / Tabbing Focus between views'
|
|
129
|
-
* Once the KS is graduated, all of the type checks for the ViewNavigator `_currentView` property can be removed.
|
|
130
|
-
* e.g., the checks for `_currentView instanceof BaseView` in BaseAdaptiveCardExtension.ts can be removed.
|
|
131
|
-
*/
|
|
132
|
-
);
|
|
78
|
+
return _SPKillSwitch.isActivated('cfadd6c3-e59f-438d-ac58-b61e73a979e3');
|
|
133
79
|
}
|
|
134
80
|
export function isLogExecuteAsSubmitActionKSActivated() {
|
|
135
|
-
return _SPKillSwitch.isActivated('70037b45-a192-4a0b-a3a3-4390498abd19'
|
|
136
|
-
/* '01/10/2024', 'Log execute as submit action' */
|
|
137
|
-
);
|
|
81
|
+
return _SPKillSwitch.isActivated('70037b45-a192-4a0b-a3a3-4390498abd19');
|
|
138
82
|
}
|
|
139
83
|
export function isCorrectlyStripRenderParametersKSActivated() {
|
|
140
|
-
return _SPKillSwitch.isActivated('62a9937a-b848-4cfc-b60a-4917cd67eeef'
|
|
141
|
-
/* '01/18/2024', 'Correctly strip render parameters' */
|
|
142
|
-
);
|
|
84
|
+
return _SPKillSwitch.isActivated('62a9937a-b848-4cfc-b60a-4917cd67eeef');
|
|
143
85
|
}
|
|
144
86
|
export function isUseCardBarTitleKSActivated() {
|
|
145
|
-
return _SPKillSwitch.isActivated('40ca522b-81d0-4c01-a04c-8513f3a444a9'
|
|
146
|
-
/* '01/24/2024', 'User card bar title' */
|
|
147
|
-
);
|
|
87
|
+
return _SPKillSwitch.isActivated('40ca522b-81d0-4c01-a04c-8513f3a444a9');
|
|
148
88
|
}
|
|
149
89
|
/**
|
|
150
90
|
* @internal
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
return _SPKillSwitch.isActivated('38aebed7-6c3c-4e31-a147-b1b867960fd0'
|
|
154
|
-
/* '08/28/2024', 'Update select action id' */
|
|
155
|
-
);
|
|
91
|
+
*/ export function isUpdateSelectActionIdKSActivated() {
|
|
92
|
+
return _SPKillSwitch.isActivated('38aebed7-6c3c-4e31-a147-b1b867960fd0');
|
|
156
93
|
}
|
|
157
94
|
// cross-project KS, also used in viva-home, @msinternal/dashboard-webpart, @msinternal/sp-adaptive-card-extension-web-part
|
|
158
95
|
export function isDashboardCardDeeplinkingKSActivated() {
|
|
159
|
-
return _SPKillSwitch.isActivated('1d6ff932-e7d5-4879-8d29-6e831d610437'
|
|
160
|
-
/* 10/14/2024, 'Enable dashboard card deeplinking from ACEPilot' - lmarulanda */
|
|
161
|
-
);
|
|
96
|
+
return _SPKillSwitch.isActivated('1d6ff932-e7d5-4879-8d29-6e831d610437');
|
|
162
97
|
}
|
|
163
98
|
// cross-project kill switch (same KS as isRequestRateMonitorKSActivated in sp-http-base)
|
|
164
99
|
export function isRequestRateMonitorKSActivated() {
|
|
165
|
-
return _SPKillSwitch.isActivated('c76f25a9-9d5a-4860-8883-fcacc64a0b19'
|
|
166
|
-
/* '2/25/2026', 'tianbli - Disable request rate monitoring for web parts in HttpClientHelper' */
|
|
167
|
-
);
|
|
100
|
+
return _SPKillSwitch.isActivated('c76f25a9-9d5a-4860-8883-fcacc64a0b19');
|
|
168
101
|
}
|
|
169
102
|
export function isUpdateCardViewForQVRenderTypeKSActivated() {
|
|
170
|
-
return _SPKillSwitch.isActivated('0f3f68e8-c28d-413a-82a3-be415af23fe0'
|
|
171
|
-
/* 11/6/2024, 'Enable updating the card view even if the QV is open' - lmarulanda */
|
|
172
|
-
);
|
|
103
|
+
return _SPKillSwitch.isActivated('0f3f68e8-c28d-413a-82a3-be415af23fe0');
|
|
173
104
|
}
|
|
174
|
-
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=./Killswitches.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { _getCartesianChartLayoutProperties } from './DataVisualizationComponent';
|
|
2
|
+
/**
|
|
3
|
+
* Convert bar chart configuration to data visualization parameters.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/ export function _barConfigurationToParameters(configuration) {
|
|
7
|
+
return configuration;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Changes the value to a comparable value.
|
|
11
|
+
* @remarks If the value is a Date, it will be converted to a number.
|
|
12
|
+
*
|
|
13
|
+
* @param value - value to be converted to comparable value
|
|
14
|
+
* @returns comparable value
|
|
15
|
+
* @internal
|
|
16
|
+
*/ function _getComparableValue(value) {
|
|
17
|
+
if (value instanceof Date) {
|
|
18
|
+
return value.getTime();
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function _getBarChartXAxis(params, type, pointsCount) {
|
|
23
|
+
let labelValues = [
|
|
24
|
+
...params.xAxis?.labelValues ?? []
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* If Developer dont provide x-axis labels, then generate them from series
|
|
28
|
+
*
|
|
29
|
+
* Number and Date types - sort in ascending order and pick last (5)pointsCount labels
|
|
30
|
+
* String type
|
|
31
|
+
* - Pick from last of series - 1 followed by series - 2 and series - 3
|
|
32
|
+
* - Example: series - 1: ['A','Q','T'], series - 2: [A,B,C,Y,Z], series - 3: [A,B,X,S,H] and pointsCount = 5
|
|
33
|
+
* - we need pur xAxis labels as ['Y','Z','A','Q','T']
|
|
34
|
+
* - To achieve this we are traversing each series in reverse order and picking unique labels and then reversing the labels again
|
|
35
|
+
*/ if (labelValues.length === 0) {
|
|
36
|
+
for (const series of params.series){
|
|
37
|
+
for(let i = series.data.length - 1; i >= 0; i--){
|
|
38
|
+
if (!labelValues.find((value)=>_getComparableValue(value) === _getComparableValue(series.data[i].x))) {
|
|
39
|
+
labelValues.push(series.data[i].x);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (type === 'date') {
|
|
44
|
+
labelValues.sort((a, b)=>a.getTime() - b.getTime());
|
|
45
|
+
} else if (type === 'number') {
|
|
46
|
+
labelValues.sort((a, b)=>a - b);
|
|
47
|
+
} else {
|
|
48
|
+
labelValues.reverse();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// If x-axis labels are more than allowed points, then slice them - take last pointsCount labels
|
|
52
|
+
if (labelValues.length > pointsCount) {
|
|
53
|
+
labelValues = labelValues.slice(labelValues.length - pointsCount);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...params.xAxis,
|
|
57
|
+
labelValues
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function _getBarChartSeries(params) {
|
|
61
|
+
const labelsSet = new Set(params.xAxis?.labelValues?.map((value)=>_getComparableValue(value)));
|
|
62
|
+
return params.series.map((series)=>{
|
|
63
|
+
return {
|
|
64
|
+
...series,
|
|
65
|
+
data: series.data.filter((data)=>labelsSet.has(_getComparableValue(data.x)))
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function _getBarChartTypeByData(series) {
|
|
70
|
+
for (const singleSeries of series){
|
|
71
|
+
for (const data of singleSeries.data){
|
|
72
|
+
if (data.x instanceof Date) {
|
|
73
|
+
return 'date';
|
|
74
|
+
} else if (typeof data.x === 'string') {
|
|
75
|
+
return 'string';
|
|
76
|
+
} else if (typeof data.x === 'number') {
|
|
77
|
+
return 'number';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return 'number';
|
|
82
|
+
}
|
|
83
|
+
function _getBarChartShowDataLabels(params, isPartialHeightChart, isMediumSizedChart, cardSize) {
|
|
84
|
+
return params.showDataLabels === true && !isPartialHeightChart && !isMediumSizedChart && params.series.length === 1 && cardSize === 'Large';
|
|
85
|
+
}
|
|
86
|
+
export function _preProcessBarChartParameters(parameters, hasHeader, hasDescription, hasFooter, cardSize) {
|
|
87
|
+
const params = {
|
|
88
|
+
...parameters
|
|
89
|
+
};
|
|
90
|
+
const { isMediumSizedChart, isPartialHeightChart, showLegend, position } = _getCartesianChartLayoutProperties(params, hasHeader, hasDescription, hasFooter, cardSize);
|
|
91
|
+
// If at least one of series[].data[].x is of type Date, set type to 'date'
|
|
92
|
+
const type = _getBarChartTypeByData(params.series);
|
|
93
|
+
/**
|
|
94
|
+
* Allowed points count as per chart size
|
|
95
|
+
* Large - 5 points
|
|
96
|
+
* Medium - single series - 3 points
|
|
97
|
+
* Medium - multiple series - 2 points
|
|
98
|
+
*/ const pointsCount = isMediumSizedChart ? params.series.length > 1 ? 2 : 3 : 5;
|
|
99
|
+
params.xAxis = _getBarChartXAxis(params, type, pointsCount);
|
|
100
|
+
params.series = _getBarChartSeries(params);
|
|
101
|
+
params._metadata = {
|
|
102
|
+
type,
|
|
103
|
+
xLabelsCount: pointsCount,
|
|
104
|
+
yLabelsCount: isPartialHeightChart ? 3 : 4,
|
|
105
|
+
showLegend,
|
|
106
|
+
position,
|
|
107
|
+
showDataLabels: _getBarChartShowDataLabels(params, isPartialHeightChart, isMediumSizedChart, cardSize)
|
|
108
|
+
};
|
|
109
|
+
return params;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=./BarChartComponent.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Names of the components allowed in a card view.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/ /**
|
|
2
6
|
*
|
|
3
7
|
* Generates a unique component id or returns the id if it is already set.
|
|
4
8
|
*
|
|
@@ -8,8 +12,8 @@
|
|
|
8
12
|
* @param cardViewPart - Card View Part (header, body, footer)
|
|
9
13
|
* @param component - Component properties
|
|
10
14
|
* @param index - index of the component in the list of components in the card view part
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
return component.id || "".concat(instanceId, "-").concat(cardViewPart, "-").concat(index, "-").concat(component.componentName);
|
|
15
|
+
*/ export function generateComponentId(instanceId, cardViewPart, component, index) {
|
|
16
|
+
return component.id || `${instanceId}-${cardViewPart}-${index}-${component.componentName}`;
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=./BaseComponent.js.map
|