@microsoft/sp-component-base 1.23.1 → 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/467dc675-7cc5-4709-8aac-78e3b71bd2f6.manifest.json +136 -141
- package/dist/{chunk.legacy-third-party-fabric-core-localfont_none_9e84ea19c68fdc8b9094.js → chunk.legacy-third-party-fabric-core-localfont_none_b7f7978a3e90166c361b.js} +1 -1
- package/dist/chunk.teams-apps-client_none_27d3c7c1d01080e4f131.js +2 -0
- package/dist/index-internal-beta.d.ts +30 -8
- package/dist/index-internal-public.d.ts +30 -8
- package/dist/index-internal.d.ts +30 -8
- package/dist/sp-component-base_default_8d535b51fa18aa47002b.js +22 -0
- package/dist/sp-component-base_en-us_8ce25dfb69a7786caece.js +22 -0
- package/dist/sp-component-base_qps-ploc_4fec831895d90df8aa7a.js +22 -0
- package/dist/sp-component-base_qps-ploca_b80610c8dff04dcec755.js +22 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/BaseComponent.js +110 -145
- package/lib-commonjs/BaseComponentContext.js +126 -183
- package/lib-commonjs/DynamicDataProvider.js +251 -268
- package/lib-commonjs/DynamicDataSourceManager.js +218 -241
- package/lib-commonjs/DynamicProperty.js +232 -280
- package/lib-commonjs/EnsureIsolatedDomainUrl.js +14 -14
- package/lib-commonjs/IComponentPosition.js +8 -3
- package/lib-commonjs/IComponentPropertyMetadata.js +10 -3
- package/lib-commonjs/ISerializedServerProcessedData.js +24 -21
- package/lib-commonjs/LegacyThirdPartyFabricCoreLoader.js +53 -87
- package/lib-commonjs/PropertyMetadataProcessor.js +117 -150
- package/lib-commonjs/RenderableComponentContext.js +37 -0
- package/lib-commonjs/ShimmerFactory.js +66 -51
- package/lib-commonjs/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +6 -4
- package/lib-commonjs/common/Flights.js +22 -10
- package/lib-commonjs/common/KillSwitches.js +13 -6
- package/lib-commonjs/dataCollector/IWebPartLoadData.js +35 -30
- package/lib-commonjs/dataCollector/WebPartLoadDataCollector.js +82 -91
- package/lib-commonjs/index.js +78 -38
- package/lib-commonjs/teams/DeferredTeamsAppsClient.js +30 -52
- package/lib-commonjs/teams/ITeamsAppCatalog.js +10 -3
- package/lib-commonjs/teams/TeamsAppsClient.js +189 -231
- package/lib-commonjs/test-api/MockComponent.js +38 -23
- package/lib-commonjs/test-api/MockComponentContext.js +21 -14
- package/lib-commonjs/test-api/index.js +21 -7
- package/lib-commonjs/themeProvider/ThemeProvider.js +68 -82
- package/lib-commonjs/themeProvider/themeInterfaces/IFontStyles.js +5 -2
- package/lib-commonjs/themeProvider/themeInterfaces/IPalette.js +10 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ISemanticColors.js +59 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ISemanticTextColors.js +10 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ITheme.js +5 -2
- package/{lib → lib-dts}/BaseComponent.d.ts +8 -8
- package/{lib → lib-dts}/BaseComponentContext.d.ts +5 -5
- package/lib-dts/RenderableComponentContext.d.ts +35 -0
- package/{lib → lib-dts}/index.d.ts +1 -0
- package/lib-esm/BaseComponent.js +123 -0
- package/lib-esm/BaseComponentContext.js +157 -0
- package/lib-esm/DynamicDataProvider.js +401 -0
- package/lib-esm/DynamicDataSourceManager.js +358 -0
- package/lib-esm/DynamicProperty.js +344 -0
- package/{lib → lib-esm}/EnsureIsolatedDomainUrl.js +6 -6
- package/lib-esm/IComponentPosition.js +5 -0
- package/lib-esm/IComponentPropertyMetadata.js +7 -0
- package/lib-esm/ISerializedServerProcessedData.js +24 -0
- package/lib-esm/LegacyThirdPartyFabricCoreLoader.js +76 -0
- package/{lib → lib-esm}/PropertyMetadataProcessor.js +92 -127
- package/lib-esm/RenderableComponentContext.js +26 -0
- package/lib-esm/ShimmerFactory.js +74 -0
- package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +3 -3
- package/{lib → lib-esm}/common/Flights.js +4 -3
- package/{lib → lib-esm}/common/KillSwitches.js +3 -2
- package/lib-esm/dataCollector/IWebPartLoadData.js +33 -0
- package/lib-esm/dataCollector/WebPartLoadDataCollector.js +125 -0
- package/{lib → lib-esm}/index.js +4 -3
- package/lib-esm/teams/DeferredTeamsAppsClient.js +32 -0
- package/lib-esm/teams/ITeamsAppCatalog.js +9 -0
- package/lib-esm/teams/TeamsAppsClient.js +395 -0
- package/lib-esm/test-api/MockComponent.js +38 -0
- package/{lib → lib-esm}/test-api/MockComponentContext.js +10 -11
- package/{lib → lib-esm}/test-api/index.js +2 -1
- package/lib-esm/themeProvider/ThemeProvider.js +79 -0
- package/lib-esm/themeProvider/themeInterfaces/IFontStyles.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/IPalette.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/ISemanticColors.js +56 -0
- package/lib-esm/themeProvider/themeInterfaces/ISemanticTextColors.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/ITheme.js +7 -0
- package/package.json +41 -14
- package/dist/chunk.teams-apps-client_none_f9872389cb6ea9ad28e2.js +0 -2
- package/dist/sp-component-base_default_5ba07be39b0dc8968f7b.js +0 -2
- package/dist/sp-component-base_en-us_eb9bebb3acce0ae83f1c.js +0 -2
- package/dist/sp-component-base_qps-ploc_45f37623d87c3d848f2a.js +0 -2
- package/dist/sp-component-base_qps-ploca_b3f3b7bf97c4185b0fd6.js +0 -2
- package/lib/BaseComponent.d.ts.map +0 -1
- package/lib/BaseComponent.js +0 -161
- package/lib/BaseComponentContext.d.ts.map +0 -1
- package/lib/BaseComponentContext.js +0 -222
- package/lib/DynamicDataProvider.d.ts.map +0 -1
- package/lib/DynamicDataProvider.js +0 -420
- package/lib/DynamicDataSourceManager.d.ts.map +0 -1
- package/lib/DynamicDataSourceManager.js +0 -382
- package/lib/DynamicProperty.d.ts.map +0 -1
- package/lib/DynamicProperty.js +0 -390
- package/lib/EnsureIsolatedDomainUrl.d.ts.map +0 -1
- package/lib/IComponentPosition.d.ts.map +0 -1
- package/lib/IComponentPosition.js +0 -2
- package/lib/IComponentPropertyMetadata.d.ts.map +0 -1
- package/lib/IComponentPropertyMetadata.js +0 -2
- package/lib/ISerializedServerProcessedData.d.ts.map +0 -1
- package/lib/ISerializedServerProcessedData.js +0 -28
- package/lib/LegacyThirdPartyFabricCoreLoader.d.ts.map +0 -1
- package/lib/LegacyThirdPartyFabricCoreLoader.js +0 -90
- package/lib/PropertyMetadataProcessor.d.ts.map +0 -1
- package/lib/ShimmerFactory.d.ts.map +0 -1
- package/lib/ShimmerFactory.js +0 -62
- package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts.map +0 -1
- package/lib/common/Flights.d.ts.map +0 -1
- package/lib/common/KillSwitches.d.ts.map +0 -1
- package/lib/dataCollector/IWebPartLoadData.d.ts.map +0 -1
- package/lib/dataCollector/IWebPartLoadData.js +0 -40
- package/lib/dataCollector/WebPartLoadDataCollector.d.ts.map +0 -1
- package/lib/dataCollector/WebPartLoadDataCollector.js +0 -137
- package/lib/index.d.ts.map +0 -1
- package/lib/teams/DeferredTeamsAppsClient.d.ts.map +0 -1
- package/lib/teams/DeferredTeamsAppsClient.js +0 -39
- package/lib/teams/ITeamsAppCatalog.d.ts.map +0 -1
- package/lib/teams/ITeamsAppCatalog.js +0 -2
- package/lib/teams/TeamsAppsClient.d.ts.map +0 -1
- package/lib/teams/TeamsAppsClient.js +0 -440
- package/lib/test-api/MockComponent.d.ts.map +0 -1
- package/lib/test-api/MockComponent.js +0 -31
- package/lib/test-api/MockComponentContext.d.ts.map +0 -1
- package/lib/test-api/index.d.ts.map +0 -1
- package/lib/themeProvider/ThemeProvider.d.ts.map +0 -1
- package/lib/themeProvider/ThemeProvider.js +0 -99
- package/lib/themeProvider/themeInterfaces/IFontStyles.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/IFontStyles.js +0 -2
- package/lib/themeProvider/themeInterfaces/IPalette.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/IPalette.js +0 -2
- package/lib/themeProvider/themeInterfaces/ISemanticColors.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ISemanticColors.js +0 -2
- package/lib/themeProvider/themeInterfaces/ISemanticTextColors.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ISemanticTextColors.js +0 -2
- package/lib/themeProvider/themeInterfaces/ITheme.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ITheme.js +0 -2
- /package/{lib → lib-dts}/DynamicDataProvider.d.ts +0 -0
- /package/{lib → lib-dts}/DynamicDataSourceManager.d.ts +0 -0
- /package/{lib → lib-dts}/DynamicProperty.d.ts +0 -0
- /package/{lib → lib-dts}/EnsureIsolatedDomainUrl.d.ts +0 -0
- /package/{lib → lib-dts}/IComponentPosition.d.ts +0 -0
- /package/{lib → lib-dts}/IComponentPropertyMetadata.d.ts +0 -0
- /package/{lib → lib-dts}/ISerializedServerProcessedData.d.ts +0 -0
- /package/{lib → lib-dts}/LegacyThirdPartyFabricCoreLoader.d.ts +0 -0
- /package/{lib → lib-dts}/PropertyMetadataProcessor.d.ts +0 -0
- /package/{lib → lib-dts}/ShimmerFactory.d.ts +0 -0
- /package/{lib → lib-dts}/chunks/legacy-third-party-fabric-core/FabricLocalFont.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}/dataCollector/IWebPartLoadData.d.ts +0 -0
- /package/{lib → lib-dts}/dataCollector/WebPartLoadDataCollector.d.ts +0 -0
- /package/{lib → lib-dts}/loc/Strings.resx.d.ts +0 -0
- /package/{lib → lib-dts}/teams/DeferredTeamsAppsClient.d.ts +0 -0
- /package/{lib → lib-dts}/teams/ITeamsAppCatalog.d.ts +0 -0
- /package/{lib → lib-dts}/teams/TeamsAppsClient.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/MockComponent.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/MockComponentContext.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/index.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/ThemeProvider.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/IFontStyles.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/IPalette.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticColors.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticTextColors.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ITheme.d.ts +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFont.global.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFontKillSwitchActivated.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shim.global.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shimKillSwitchActivated.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/iconDefinitions.css +0 -0
- /package/{lib → lib-esm}/loc/Strings.resx.json +0 -0
- /package/{lib → lib-esm}/sp-component-base.manifest.json +0 -0
- /package/{lib → lib-esm}/styles/shimmer.module.scss.css +0 -0
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ensureIsolatedDomainUrl", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return ensureIsolatedDomainUrl;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const domainRegex = new RegExp('^https://[^/]*/');
|
|
12
12
|
function ensureIsolatedDomainUrl(isolatedDomain, absoluteUrl) {
|
|
13
13
|
if (!isolatedDomain) {
|
|
14
14
|
return absoluteUrl;
|
|
15
15
|
}
|
|
16
16
|
// replace the domain in "https://domain/path" with isolatedDomain
|
|
17
|
-
|
|
17
|
+
let slashAdded = false;
|
|
18
18
|
if (absoluteUrl.charAt(absoluteUrl.length - 1) !== '/') {
|
|
19
19
|
absoluteUrl = absoluteUrl + '/';
|
|
20
20
|
slashAdded = true;
|
|
21
21
|
}
|
|
22
|
-
absoluteUrl = absoluteUrl.replace(domainRegex,
|
|
22
|
+
absoluteUrl = absoluteUrl.replace(domainRegex, `https://${isolatedDomain}/`);
|
|
23
23
|
if (slashAdded) {
|
|
24
24
|
// Remove the ending slash
|
|
25
25
|
absoluteUrl = absoluteUrl.substr(0, absoluteUrl.length - 1);
|
|
26
26
|
}
|
|
27
27
|
return absoluteUrl;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=./EnsureIsolatedDomainUrl.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/ "use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=./IComponentPosition.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is the structure used for map values for component properties metadata.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=./IComponentPropertyMetadata.js.map
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright (c) Microsoft. All rights reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ServerProcessedDataType = void 0;
|
|
5
2
|
/**
|
|
6
3
|
* Server processed data type.
|
|
7
4
|
*
|
|
8
5
|
* @internal
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
exports
|
|
6
|
+
*/ // eslint-disable-next-line @typescript-eslint/typedef
|
|
7
|
+
"use strict";
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "ServerProcessedDataType", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return ServerProcessedDataType;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const ServerProcessedDataType = {
|
|
12
18
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
htmlString: 1,
|
|
19
|
+
* The date type is valid html string.
|
|
20
|
+
*/ htmlString: 1,
|
|
16
21
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
link: 2,
|
|
22
|
+
* The date type is a link to a resource.
|
|
23
|
+
* The link can be a SharePoint content link or non-SharePoint link.
|
|
24
|
+
*/ link: 2,
|
|
21
25
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
imageSource: 3,
|
|
26
|
+
* The date type is a link to a image.
|
|
27
|
+
* The link can be a SharePoint content link or non-SharePoint link.
|
|
28
|
+
*/ imageSource: 3,
|
|
26
29
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
searchablePlainText: 4
|
|
30
|
+
* The data type is a string that should be search indexed.
|
|
31
|
+
*/ searchablePlainText: 4
|
|
30
32
|
};
|
|
31
|
-
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=./ISerializedServerProcessedData.js.map
|
|
@@ -1,115 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
17
4
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
var sp_core_library_1 = require("@microsoft/sp-core-library");
|
|
27
|
-
// Copyright (c) Microsoft. All rights reserved.
|
|
28
|
-
/**
|
|
29
|
-
* Class to load async chunks.
|
|
30
|
-
*
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
var LegacyThirdPartyFabricCoreLoader = /** @class */ (function () {
|
|
34
|
-
function LegacyThirdPartyFabricCoreLoader() {
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return LegacyThirdPartyFabricCoreLoader;
|
|
35
9
|
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _spcorelibrary = require("@microsoft/sp-core-library");
|
|
13
|
+
class LegacyThirdPartyFabricCoreLoader {
|
|
36
14
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
LegacyThirdPartyFabricCoreLoader.load = function (isComponentInternal) {
|
|
15
|
+
* Method to dynamically load the legacy third-party fabric core styles.
|
|
16
|
+
* This method should be called only when a third-party component(web part or extension)
|
|
17
|
+
* is being loaded on to the page.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: Remove this method when the below killswitch is graduated from \@microsoft/sp-webpart-base.
|
|
20
|
+
* 'isStopLoadingLegacyFabricCSSKillSwitchActivated' - '57b771ed-2b57-41c2-aaaa-0e21c587c6dc'
|
|
21
|
+
*
|
|
22
|
+
* @param isComponentInternal - indicates whether the requesting component is internal to Microsoft or not.
|
|
23
|
+
*/ static load(isComponentInternal) {
|
|
47
24
|
if (!isComponentInternal && !LegacyThirdPartyFabricCoreLoader._isLoaded) {
|
|
48
|
-
return Promise.resolve().then(
|
|
49
|
-
/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont')); }).then(function () {
|
|
25
|
+
return Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard._(require(/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ "./chunks/legacy-third-party-fabric-core/FabricLocalFont"))).then(()=>{
|
|
50
26
|
LegacyThirdPartyFabricCoreLoader._isLoaded = true;
|
|
51
27
|
return;
|
|
52
28
|
});
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
29
|
+
} else {
|
|
55
30
|
return Promise.resolve();
|
|
56
31
|
}
|
|
57
|
-
}
|
|
32
|
+
}
|
|
58
33
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
LegacyThirdPartyFabricCoreLoader.forceLoad = function (manifest) {
|
|
34
|
+
* Method to dynamically force load the legacy third-party fabric core styles.
|
|
35
|
+
* All the below conditions are checked and needs to be true to force load the legacy css:
|
|
36
|
+
* 1. Should be third party component (web part or extension)
|
|
37
|
+
* 2. Should not be already loaded
|
|
38
|
+
* 3. Component should ask to load the legacy css or if the component is built version \< 1.8
|
|
39
|
+
*
|
|
40
|
+
* @param manifest - component's manifest
|
|
41
|
+
*/ static forceLoad(manifest) {
|
|
68
42
|
try {
|
|
69
43
|
if (LegacyThirdPartyFabricCoreLoader._shouldLoad(manifest)) {
|
|
70
|
-
return Promise.resolve().then(
|
|
71
|
-
/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont')); }).then(function () {
|
|
44
|
+
return Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard._(require(/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ "./chunks/legacy-third-party-fabric-core/FabricLocalFont"))).then(()=>{
|
|
72
45
|
LegacyThirdPartyFabricCoreLoader._isLoaded = true;
|
|
73
46
|
return;
|
|
74
47
|
});
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
48
|
+
} else {
|
|
77
49
|
return Promise.resolve();
|
|
78
50
|
}
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
51
|
+
} catch (error) {
|
|
81
52
|
return Promise.reject(error);
|
|
82
53
|
}
|
|
83
|
-
}
|
|
54
|
+
}
|
|
84
55
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss = function (manifest) {
|
|
56
|
+
* Method to check if the web part need to load the legacy css.
|
|
57
|
+
* @param manifest - component's manifest
|
|
58
|
+
*/ static needLegacyFabricCss(manifest) {
|
|
89
59
|
if (manifest.isInternal) {
|
|
90
60
|
return false;
|
|
91
61
|
}
|
|
92
62
|
/*
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return !version || version.lessThan(sp_core_library_1.Version.parse('1.8.2'));
|
|
63
|
+
* If loadLegacyFabricCss is not specified by the component, then load the css
|
|
64
|
+
* if the component is built before SPFx 1.8.2 or in some cases when we cannot get
|
|
65
|
+
* the version of the SPFx.
|
|
66
|
+
*/ if (manifest.loadLegacyFabricCss === undefined) {
|
|
67
|
+
const version = _spcorelibrary.Version._tryParseSPFxVersion(manifest);
|
|
68
|
+
return !version || version.lessThan(_spcorelibrary.Version.parse('1.8.2'));
|
|
100
69
|
}
|
|
101
70
|
// Respect 'loadLegacyFabricCss' if a real value is provided.
|
|
102
71
|
return manifest.loadLegacyFabricCss;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}());
|
|
114
|
-
exports.default = LegacyThirdPartyFabricCoreLoader;
|
|
115
|
-
//# sourceMappingURL=LegacyThirdPartyFabricCoreLoader.js.map
|
|
72
|
+
}
|
|
73
|
+
static _shouldLoad(manifest) {
|
|
74
|
+
return !LegacyThirdPartyFabricCoreLoader._isLoaded && LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss(manifest);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Indicates whether the fabric-core styles are loaded on the page or not.
|
|
79
|
+
*/ LegacyThirdPartyFabricCoreLoader._isLoaded = false;
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=./LegacyThirdPartyFabricCoreLoader.js.map
|