@microsoft/sp-component-base 1.22.0-beta.2 → 1.22.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/467dc675-7cc5-4709-8aac-78e3b71bd2f6.manifest.json +1 -1
  2. package/lib/BaseComponent.d.ts +115 -0
  3. package/lib/BaseComponent.d.ts.map +1 -0
  4. package/lib/BaseComponent.js +162 -0
  5. package/lib/BaseComponentContext.d.ts +142 -0
  6. package/lib/BaseComponentContext.d.ts.map +1 -0
  7. package/lib/BaseComponentContext.js +221 -0
  8. package/lib/DynamicDataProvider.d.ts +166 -0
  9. package/lib/DynamicDataProvider.d.ts.map +1 -0
  10. package/lib/DynamicDataProvider.js +420 -0
  11. package/lib/DynamicDataSourceManager.d.ts +160 -0
  12. package/lib/DynamicDataSourceManager.d.ts.map +1 -0
  13. package/lib/DynamicDataSourceManager.js +382 -0
  14. package/lib/DynamicProperty.d.ts +204 -0
  15. package/lib/DynamicProperty.d.ts.map +1 -0
  16. package/lib/DynamicProperty.js +390 -0
  17. package/lib/EnsureIsolatedDomainUrl.d.ts +9 -0
  18. package/lib/EnsureIsolatedDomainUrl.d.ts.map +1 -0
  19. package/lib/EnsureIsolatedDomainUrl.js +26 -0
  20. package/lib/IComponentPosition.d.ts +28 -0
  21. package/lib/IComponentPosition.d.ts.map +1 -0
  22. package/lib/IComponentPosition.js +2 -0
  23. package/lib/IComponentPropertyMetadata.d.ts +100 -0
  24. package/lib/IComponentPropertyMetadata.d.ts.map +1 -0
  25. package/lib/IComponentPropertyMetadata.js +2 -0
  26. package/lib/ISerializedServerProcessedData.d.ts +166 -0
  27. package/lib/ISerializedServerProcessedData.d.ts.map +1 -0
  28. package/lib/ISerializedServerProcessedData.js +28 -0
  29. package/lib/LegacyThirdPartyFabricCoreLoader.d.ts +40 -0
  30. package/lib/LegacyThirdPartyFabricCoreLoader.d.ts.map +1 -0
  31. package/lib/LegacyThirdPartyFabricCoreLoader.js +90 -0
  32. package/lib/PropertyMetadataProcessor.d.ts +54 -0
  33. package/lib/PropertyMetadataProcessor.d.ts.map +1 -0
  34. package/lib/PropertyMetadataProcessor.js +297 -0
  35. package/lib/ShimmerFactory.d.ts +17 -0
  36. package/lib/ShimmerFactory.d.ts.map +1 -0
  37. package/lib/ShimmerFactory.js +62 -0
  38. package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts +17 -0
  39. package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts.map +1 -0
  40. package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +17 -0
  41. package/lib/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFont.global.scss.css +9247 -0
  42. package/lib/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFontKillSwitchActivated.scss.css +11165 -0
  43. package/lib/chunks/legacy-third-party-fabric-core/fabric-core-shim.global.scss.css +2063 -0
  44. package/lib/chunks/legacy-third-party-fabric-core/fabric-core-shimKillSwitchActivated.scss.css +2164 -0
  45. package/lib/chunks/legacy-third-party-fabric-core/iconDefinitions.css +6 -0
  46. package/lib/common/Flights.d.ts +3 -0
  47. package/lib/common/Flights.d.ts.map +1 -0
  48. package/lib/common/Flights.js +10 -0
  49. package/lib/common/KillSwitches.d.ts +2 -0
  50. package/lib/common/KillSwitches.d.ts.map +1 -0
  51. package/lib/common/KillSwitches.js +5 -0
  52. package/lib/dataCollector/IWebPartLoadData.d.ts +140 -0
  53. package/lib/dataCollector/IWebPartLoadData.d.ts.map +1 -0
  54. package/lib/dataCollector/IWebPartLoadData.js +40 -0
  55. package/lib/dataCollector/WebPartLoadDataCollector.d.ts +14 -0
  56. package/lib/dataCollector/WebPartLoadDataCollector.d.ts.map +1 -0
  57. package/lib/dataCollector/WebPartLoadDataCollector.js +137 -0
  58. package/lib/index.d.ts +34 -0
  59. package/lib/index.d.ts.map +1 -0
  60. package/lib/index.js +27 -0
  61. package/lib/loc/Strings.resx.d.ts +44 -0
  62. package/lib/loc/Strings.resx.json +1 -0
  63. package/lib/sp-component-base.manifest.json +9 -0
  64. package/lib/styles/shimmer.module.scss.css +11 -0
  65. package/lib/teams/DeferredTeamsAppsClient.d.ts +17 -0
  66. package/lib/teams/DeferredTeamsAppsClient.d.ts.map +1 -0
  67. package/lib/teams/DeferredTeamsAppsClient.js +39 -0
  68. package/lib/teams/ITeamsAppCatalog.d.ts +72 -0
  69. package/lib/teams/ITeamsAppCatalog.d.ts.map +1 -0
  70. package/lib/teams/ITeamsAppCatalog.js +2 -0
  71. package/lib/teams/TeamsAppsClient.d.ts +113 -0
  72. package/lib/teams/TeamsAppsClient.d.ts.map +1 -0
  73. package/lib/teams/TeamsAppsClient.js +440 -0
  74. package/lib/test-api/MockComponent.d.ts +8 -0
  75. package/lib/test-api/MockComponent.d.ts.map +1 -0
  76. package/lib/test-api/MockComponent.js +31 -0
  77. package/lib/test-api/MockComponentContext.d.ts +6 -0
  78. package/lib/test-api/MockComponentContext.d.ts.map +1 -0
  79. package/lib/test-api/MockComponentContext.js +27 -0
  80. package/lib/test-api/index.d.ts +3 -0
  81. package/lib/test-api/index.d.ts.map +1 -0
  82. package/lib/test-api/index.js +3 -0
  83. package/lib/themeProvider/ThemeProvider.d.ts +71 -0
  84. package/lib/themeProvider/ThemeProvider.d.ts.map +1 -0
  85. package/lib/themeProvider/ThemeProvider.js +99 -0
  86. package/lib/themeProvider/themeInterfaces/IFontStyles.d.ts +26 -0
  87. package/lib/themeProvider/themeInterfaces/IFontStyles.d.ts.map +1 -0
  88. package/lib/themeProvider/themeInterfaces/IFontStyles.js +2 -0
  89. package/lib/themeProvider/themeInterfaces/IPalette.d.ts +7 -0
  90. package/lib/themeProvider/themeInterfaces/IPalette.d.ts.map +1 -0
  91. package/lib/themeProvider/themeInterfaces/IPalette.js +2 -0
  92. package/lib/themeProvider/themeInterfaces/ISemanticColors.d.ts +56 -0
  93. package/lib/themeProvider/themeInterfaces/ISemanticColors.d.ts.map +1 -0
  94. package/lib/themeProvider/themeInterfaces/ISemanticColors.js +2 -0
  95. package/lib/themeProvider/themeInterfaces/ISemanticTextColors.d.ts +7 -0
  96. package/lib/themeProvider/themeInterfaces/ISemanticTextColors.d.ts.map +1 -0
  97. package/lib/themeProvider/themeInterfaces/ISemanticTextColors.js +2 -0
  98. package/lib/themeProvider/themeInterfaces/ITheme.d.ts +16 -0
  99. package/lib/themeProvider/themeInterfaces/ITheme.d.ts.map +1 -0
  100. package/lib/themeProvider/themeInterfaces/ITheme.js +2 -0
  101. package/package.json +15 -15
@@ -0,0 +1,100 @@
1
+ /**
2
+ * This is the structure used for map values for component properties metadata.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IComponentPropertyMetadata {
7
+ /**
8
+ * Indicates whether the property should be serialized as HTML.
9
+ *
10
+ * @remarks
11
+ * This flag instructs framework to store the value as HTML, so that SharePoint can perform the following
12
+ * services on it:
13
+ *
14
+ * - normalizing HTML encodings
15
+ *
16
+ * - stripping unsafe HTML tags (i.e. for usage with Element.innerHTML)
17
+ *
18
+ * - search indexing
19
+ *
20
+ * - SharePoint link fix-up
21
+ *
22
+ * Only enable this flag for HTML content where these modifications are acceptable. If non-HTML content is
23
+ * provided, SharePoint framework might make modifications to convert it to HTML valid. For plain text content
24
+ * that simply needs to be exposed to the search index (without any rewriting), use the `isSearchablePlainText`
25
+ * flag instead.
26
+ */
27
+ isHtmlString?: boolean;
28
+ /**
29
+ * Indicates if the property contains plain text that should be search-indexed by SharePoint.
30
+ *
31
+ * @remarks
32
+ * This flag instructs the framework to store the property in a representation that supports search indexing.
33
+ * The content will be treated as plain text; SharePoint will not modify the string in any way, and
34
+ * special HTML characters may be stored encoded and appear in search results. If your string contains
35
+ * HTML markup, use the isHtmlString setting instead.
36
+ *
37
+ * Security note: For security reasons, never assign a plain text string to `Element.innerHTML`.
38
+ */
39
+ isSearchablePlainText?: boolean;
40
+ /**
41
+ * Indicates if the property contains a link. This allows SharePoint server to treat the value as such and
42
+ * perform services like search indexing, link fix-up, loading from CDN, etc.
43
+ */
44
+ isLink?: boolean;
45
+ /**
46
+ * Indicates if the property contains a link. This allows SharePoint server to treat the value as such and
47
+ * perform services like link fix-up, search indexing, loading from CDN, etc.
48
+ */
49
+ isImageSource?: boolean;
50
+ /**
51
+ * Indicates that property value is components id, required to be loaded before this component can render or initialize.
52
+ *
53
+ * @remarks
54
+ * The component should use this property to declare dynamic runtime component dependencies, which are required only
55
+ * for specific states of the property. The framework will ensure that this component is preloaded for the component.
56
+ *
57
+ * For example, the user can select one of the multiple layouts available for a web part or component during edit mode.
58
+ * This will optimize the bundle to avoid embedding code for all layout code; instead, the framework will load the
59
+ * required layout selectively at runtime.
60
+ *
61
+ * @alpha
62
+ */
63
+ isComponentDependency?: boolean;
64
+ /**
65
+ * Indicates if the framework should persist the property on the server.
66
+ *
67
+ * @remarks
68
+ * Use this for properties that are only important in run-time, and do not need to persist on the server.
69
+ * This can reduce the size of the serialized data of the component and optimize the component load time.
70
+ * The property value will be removed from the serialized data sent to the server, but this has no effect on
71
+ * the run-time property bag. The property value will still be available in the `onBeforeSerialize()` method,
72
+ * and the value will not be cleared from the run-time property bag. The initial render of your component should
73
+ * not depend on the value of the property. Setting a default value for the property can be done in `onInit()` method.
74
+ *
75
+ * Note that if the property path refers to a property that has a complex object as the value, the whole object
76
+ * will be removed from the persisted data.
77
+ */
78
+ shouldNotPersist?: boolean;
79
+ /**
80
+ * Additional custom metadata associated with the original metadata.
81
+ *
82
+ * @remarks
83
+ * This can be used to supply additional related metadata information.
84
+ * For example, image metadata along with a URL could be provided.
85
+ *
86
+ * @privateRemarks
87
+ * We should find a way to associate type to this object before this API becomes available to 3rd
88
+ * parties. (SPPPLAT VSO bug#504028) tracks that fix. For now, we are not doing that because that will require a
89
+ * bigger public API change to exiting APIs. We do not want to change existing public APIs before we make this
90
+ * feature available to third parties.
91
+ * key is Name of the custom property name and value is path of the property.
92
+ * e.g. 'width': 'managerPhotoWidth'
93
+ *
94
+ * @alpha
95
+ */
96
+ customMetadata?: {
97
+ [key: string]: string;
98
+ };
99
+ }
100
+ //# sourceMappingURL=IComponentPropertyMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IComponentPropertyMetadata.d.ts","sourceRoot":"","sources":["../src/IComponentPropertyMetadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IComponentPropertyMetadata.js.map
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Server processed data type.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const ServerProcessedDataType: {
7
+ /**
8
+ * The date type is valid html string.
9
+ */
10
+ readonly htmlString: 1;
11
+ /**
12
+ * The date type is a link to a resource.
13
+ * The link can be a SharePoint content link or non-SharePoint link.
14
+ */
15
+ readonly link: 2;
16
+ /**
17
+ * The date type is a link to a image.
18
+ * The link can be a SharePoint content link or non-SharePoint link.
19
+ */
20
+ readonly imageSource: 3;
21
+ /**
22
+ * The data type is a string that should be search indexed.
23
+ */
24
+ readonly searchablePlainText: 4;
25
+ };
26
+ /**
27
+ * {@inheritdoc (ServerProcessedDataType:variable)}
28
+ * @internal
29
+ */
30
+ export type ServerProcessedDataType = typeof ServerProcessedDataType[keyof typeof ServerProcessedDataType];
31
+ /**
32
+ * Contains collections of data that can be processed by server side services like search index and link fixup
33
+ *
34
+ * @public
35
+ */
36
+ export interface ISerializedServerProcessedData {
37
+ /**
38
+ * A key-value map where keys are string identifiers and values are rich text with HTML format.
39
+ *
40
+ * @remarks
41
+ * SharePoint servers treat the values as HTML content and run services like safety checks, search index
42
+ * and link fixup on them.
43
+ *
44
+ * Example:
45
+ * ```
46
+ * {
47
+ * 'myRichDescription': '<div>Some standard <b>HTML content</b><a href='http://somelink'>A Link</a></div>'
48
+ * 'anotherRichText': <div class='aClass'><span style='color:red'>Some red text</div>
49
+ * }
50
+ * ```
51
+ *
52
+ */
53
+ htmlStrings?: {
54
+ [key: string]: string;
55
+ };
56
+ /**
57
+ * A key-value map where keys are string identifiers and values are strings that should be search indexed.
58
+ *
59
+ * @remarks
60
+ * The values are HTML-encoded before being sent to the server. The encoded values are visible to the search
61
+ * indexer, but are not treated as valid HTML. So, other services such as link fixup will not run on them.
62
+ *
63
+ * Example:
64
+ * ```
65
+ * {
66
+ * 'justSomeText': 'This is some plain text',
67
+ * 'anotherText': 'Can have <any> characters here: "<>&\''
68
+ * }
69
+ * ```
70
+ */
71
+ searchablePlainTexts?: {
72
+ [key: string]: string;
73
+ };
74
+ /**
75
+ * A key-value map where keys are string identifiers and values are links.
76
+ *
77
+ * @remarks
78
+ * SharePoint servers treat the values as links and run services like link fixup on them.
79
+ *
80
+ * Example:
81
+ * ```
82
+ * {
83
+ * 'myWebURL': 'http://contoso.com'
84
+ * 'myFileLink': 'https://res.contoso.com/file.docx'
85
+ * }
86
+ * ```
87
+ */
88
+ links?: {
89
+ [key: string]: string;
90
+ };
91
+ /**
92
+ * A key-value map where keys are string identifiers and values are image sources.
93
+ *
94
+ * @remarks
95
+ * SharePoint servers treat the values as image sources and run services like search index and link fixup on them.
96
+ *
97
+ * Example:
98
+ * ```
99
+ * {
100
+ * 'myImage1': 'http://res.contoso.com/path/to/file'
101
+ * 'myImage2': 'https://res.contoso.com/someName.jpg'
102
+ * }
103
+ * ```
104
+ */
105
+ imageSources?: {
106
+ [key: string]: string;
107
+ };
108
+ /**
109
+ * A key-value map where keys are string identifiers and values are component ids.
110
+ *
111
+ * @remarks
112
+ * SharePoint servers might decide to use this hint to preload the script for corresponding components for
113
+ * performance boost.
114
+ *
115
+ * Example:
116
+ * ```
117
+ * {
118
+ * 'layoutComponent': 'abfccb4d-fcbc-4720-8bcc-6183ce66c391',
119
+ * 'dataComponent': 'f0baf432-de3f-4f0f-8444-d1280b2f8cc5'
120
+ * }
121
+ * ```
122
+ * @alpha
123
+ */
124
+ componentDependencies?: {
125
+ [key: string]: string;
126
+ };
127
+ /**
128
+ * A key-value map where keys are string identifier and values are object of custom key-value pair
129
+ *
130
+ * @remarks
131
+ *
132
+ * SharePoint servers might treat custom medata values in context of the other properties like imageSources.
133
+ * E.g. When the key of imageSources and customMetadata is same, custom metadata can be used to expand information
134
+ * of image data.
135
+ *
136
+ * Example:
137
+ * ```
138
+ * ISerializedServerProcessedData {
139
+ * imageSources: {
140
+ * 'myImage1': 'http://res.contoso.com/path/to/file',
141
+ * 'myImage2': 'https://res.contoso.com/someName.jpg'
142
+ * },
143
+ *
144
+ * customMetadata: {
145
+ * 'myImage1': {'height': '100', 'width': '100'}
146
+ * 'myImage2': {'height': '400', 'width': '600'}
147
+ * }
148
+ * }
149
+ * ```
150
+ *
151
+ * @privateRemarks
152
+ *
153
+ * We should find a way to associate type to this object before this API becomes available to 3rd
154
+ * parties. (SPPPLAT VSO bug#504028) tracks that fix. For now, we are not doing that because that will require a
155
+ * bigger public API change to exiting APIs. We do not want to change existing public APIs before we make this
156
+ * feature available to third parties.
157
+ *
158
+ * @alpha
159
+ */
160
+ customMetadata?: {
161
+ [key: string]: {
162
+ [key: string]: {};
163
+ };
164
+ };
165
+ }
166
+ //# sourceMappingURL=ISerializedServerProcessedData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ISerializedServerProcessedData.d.ts","sourceRoot":"","sources":["../src/ISerializedServerProcessedData.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;CAEK,CAAC;AACX;;;GAGG;AAEH,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAE3G;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,oBAAoB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEjD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAElC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEzC;;;;;;;;;;;;;;;OAeG;IACH,qBAAqB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAC3D"}
@@ -0,0 +1,28 @@
1
+ // Copyright (c) Microsoft. All rights reserved.
2
+ /**
3
+ * Server processed data type.
4
+ *
5
+ * @internal
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/typedef
8
+ export var ServerProcessedDataType = {
9
+ /**
10
+ * The date type is valid html string.
11
+ */
12
+ htmlString: 1,
13
+ /**
14
+ * The date type is a link to a resource.
15
+ * The link can be a SharePoint content link or non-SharePoint link.
16
+ */
17
+ link: 2,
18
+ /**
19
+ * The date type is a link to a image.
20
+ * The link can be a SharePoint content link or non-SharePoint link.
21
+ */
22
+ imageSource: 3,
23
+ /**
24
+ * The data type is a string that should be search indexed.
25
+ */
26
+ searchablePlainText: 4
27
+ };
28
+ //# sourceMappingURL=ISerializedServerProcessedData.js.map
@@ -0,0 +1,40 @@
1
+ import type { IClientSideComponentManifest } from '@microsoft/sp-module-interfaces';
2
+ /**
3
+ * Class to load async chunks.
4
+ *
5
+ * @internal
6
+ */
7
+ export default class LegacyThirdPartyFabricCoreLoader {
8
+ /**
9
+ * Indicates whether the fabric-core styles are loaded on the page or not.
10
+ */
11
+ private static _isLoaded;
12
+ /**
13
+ * Method to dynamically load the legacy third-party fabric core styles.
14
+ * This method should be called only when a third-party component(web part or extension)
15
+ * is being loaded on to the page.
16
+ *
17
+ * NOTE: Remove this method when the below killswitch is graduated from \@microsoft/sp-webpart-base.
18
+ * 'isStopLoadingLegacyFabricCSSKillSwitchActivated' - '57b771ed-2b57-41c2-aaaa-0e21c587c6dc'
19
+ *
20
+ * @param isComponentInternal - indicates whether the requesting component is internal to Microsoft or not.
21
+ */
22
+ static load(isComponentInternal: boolean | undefined): Promise<void>;
23
+ /**
24
+ * Method to dynamically force load the legacy third-party fabric core styles.
25
+ * All the below conditions are checked and needs to be true to force load the legacy css:
26
+ * 1. Should be third party component (web part or extension)
27
+ * 2. Should not be already loaded
28
+ * 3. Component should ask to load the legacy css or if the component is built version \< 1.8
29
+ *
30
+ * @param manifest - component's manifest
31
+ */
32
+ static forceLoad(manifest: IClientSideComponentManifest): Promise<void>;
33
+ /**
34
+ * Method to check if the web part need to load the legacy css.
35
+ * @param manifest - component's manifest
36
+ */
37
+ static needLegacyFabricCss(manifest: IClientSideComponentManifest): boolean;
38
+ private static _shouldLoad;
39
+ }
40
+ //# sourceMappingURL=LegacyThirdPartyFabricCoreLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegacyThirdPartyFabricCoreLoader.d.ts","sourceRoot":"","sources":["../src/LegacyThirdPartyFabricCoreLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAIpF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gCAAgC;IACnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkB;IAE1C;;;;;;;;;OASG;WACW,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3E;;;;;;;;OAQG;WACW,SAAS,CAAC,QAAQ,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9E;;;OAGG;WACW,mBAAmB,CAAC,QAAQ,EAAE,4BAA4B,GAAG,OAAO;IAmBlF,OAAO,CAAC,MAAM,CAAC,WAAW;CAM3B"}
@@ -0,0 +1,90 @@
1
+ import { Version } from '@microsoft/sp-core-library';
2
+ // Copyright (c) Microsoft. All rights reserved.
3
+ /**
4
+ * Class to load async chunks.
5
+ *
6
+ * @internal
7
+ */
8
+ var LegacyThirdPartyFabricCoreLoader = /** @class */ (function () {
9
+ function LegacyThirdPartyFabricCoreLoader() {
10
+ }
11
+ /**
12
+ * Method to dynamically load the legacy third-party fabric core styles.
13
+ * This method should be called only when a third-party component(web part or extension)
14
+ * is being loaded on to the page.
15
+ *
16
+ * NOTE: Remove this method when the below killswitch is graduated from \@microsoft/sp-webpart-base.
17
+ * 'isStopLoadingLegacyFabricCSSKillSwitchActivated' - '57b771ed-2b57-41c2-aaaa-0e21c587c6dc'
18
+ *
19
+ * @param isComponentInternal - indicates whether the requesting component is internal to Microsoft or not.
20
+ */
21
+ LegacyThirdPartyFabricCoreLoader.load = function (isComponentInternal) {
22
+ if (!isComponentInternal && !LegacyThirdPartyFabricCoreLoader._isLoaded) {
23
+ return import(
24
+ /* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont').then(function () {
25
+ LegacyThirdPartyFabricCoreLoader._isLoaded = true;
26
+ return;
27
+ });
28
+ }
29
+ else {
30
+ return Promise.resolve();
31
+ }
32
+ };
33
+ /**
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
+ */
42
+ LegacyThirdPartyFabricCoreLoader.forceLoad = function (manifest) {
43
+ try {
44
+ if (LegacyThirdPartyFabricCoreLoader._shouldLoad(manifest)) {
45
+ return import(
46
+ /* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont').then(function () {
47
+ LegacyThirdPartyFabricCoreLoader._isLoaded = true;
48
+ return;
49
+ });
50
+ }
51
+ else {
52
+ return Promise.resolve();
53
+ }
54
+ }
55
+ catch (error) {
56
+ return Promise.reject(error);
57
+ }
58
+ };
59
+ /**
60
+ * Method to check if the web part need to load the legacy css.
61
+ * @param manifest - component's manifest
62
+ */
63
+ LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss = function (manifest) {
64
+ if (manifest.isInternal) {
65
+ return false;
66
+ }
67
+ /*
68
+ * If loadLegacyFabricCss is not specified by the component, then load the css
69
+ * if the component is built before SPFx 1.8.2 or in some cases when we cannot get
70
+ * the version of the SPFx.
71
+ */
72
+ if (manifest.loadLegacyFabricCss === undefined) {
73
+ var version = Version._tryParseSPFxVersion(manifest);
74
+ return !version || version.lessThan(Version.parse('1.8.2'));
75
+ }
76
+ // Respect 'loadLegacyFabricCss' if a real value is provided.
77
+ return manifest.loadLegacyFabricCss;
78
+ };
79
+ LegacyThirdPartyFabricCoreLoader._shouldLoad = function (manifest) {
80
+ return (!LegacyThirdPartyFabricCoreLoader._isLoaded &&
81
+ LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss(manifest));
82
+ };
83
+ /**
84
+ * Indicates whether the fabric-core styles are loaded on the page or not.
85
+ */
86
+ LegacyThirdPartyFabricCoreLoader._isLoaded = false;
87
+ return LegacyThirdPartyFabricCoreLoader;
88
+ }());
89
+ export default LegacyThirdPartyFabricCoreLoader;
90
+ //# sourceMappingURL=LegacyThirdPartyFabricCoreLoader.js.map
@@ -0,0 +1,54 @@
1
+ import type { IClientSideComponentManifest } from '@microsoft/sp-module-interfaces';
2
+ import type { IComponentPropertyMetadata } from './IComponentPropertyMetadata';
3
+ import type { ISerializedServerProcessedData } from './ISerializedServerProcessedData';
4
+ /**
5
+ * The processor to serialize and deserialize the server processed content and component properties
6
+ * based on component metadata.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare class PropertyMetadataProcessor {
11
+ /**
12
+ * Serialize the properties into server processed content as declared in metadata.
13
+ *
14
+ * @param propertiesMetadata - The component properties metadata.
15
+ * @param properties - The component properties. This object will be modified during serialization.
16
+ * @param serverProcessedContent - The serialized server processed content. This object will be modified.
17
+ */
18
+ static serializeServerProcessedData<TProperties extends {}>(propertiesMetadata: undefined | {
19
+ [key: string]: IComponentPropertyMetadata;
20
+ }, properties: TProperties, serverProcessedContent: ISerializedServerProcessedData): void;
21
+ /**
22
+ * Reapply the serialized server processed content on the properties based on the metadata.
23
+ * This process will result in the properties bag as it was when the serialization happened.
24
+ *
25
+ * @param propertiesMetadata - The component properties metadata.
26
+ * @param properties - The component properties. This object will be modified during serialization.
27
+ * @param serverProcessedContent - The serialized server processed content.
28
+ * @param manifest - The optional component manifest.
29
+ */
30
+ static reInstateServerProcessedData<TProperties extends {}>(propertiesMetadata: undefined | {
31
+ [key: string]: IComponentPropertyMetadata;
32
+ }, properties: TProperties, serverProcessedContent: undefined | ISerializedServerProcessedData, manifest?: IClientSideComponentManifest): void;
33
+ private static _isSafeLink;
34
+ private static _getSafeHtml;
35
+ /**
36
+ * Iterates and validates each metadata property before calling metadata processor.
37
+ *
38
+ * @param propertiesMetadata - Component properties metadata.
39
+ * @param properties - Component properties.
40
+ * @param metadataProcessor - Callback handler to to process validated metadata.
41
+ *
42
+ * @internal
43
+ */
44
+ private static _forEachPropertyWithMetaData;
45
+ /**
46
+ * Validates path and iterate over one or multiple wildcard paths
47
+ *
48
+ * @param propPath - Original property path provided in metadata
49
+ * @param properties - Properties to look for the given path.
50
+ * @param propertyPathHandler - Handler to process validated and fixed path
51
+ */
52
+ private static _validateAndIteratePath;
53
+ }
54
+ //# sourceMappingURL=PropertyMetadataProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyMetadataProcessor.d.ts","sourceRoot":"","sources":["../src/PropertyMetadataProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAEpF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAKvF;;;;;GAKG;AACH,qBAAa,yBAAyB;IACpC;;;;;;OAMG;WACW,4BAA4B,CAAC,WAAW,SAAS,EAAE,EAC/D,kBAAkB,EAAE,SAAS,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,0BAA0B,CAAA;KAAE,EAC7E,UAAU,EAAE,WAAW,EACvB,sBAAsB,EAAE,8BAA8B,GACrD,IAAI;IAoFP;;;;;;;;OAQG;WACW,4BAA4B,CAAC,WAAW,SAAS,EAAE,EAC/D,kBAAkB,EAAE,SAAS,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,0BAA0B,CAAA;KAAE,EAC7E,UAAU,EAAE,WAAW,EACvB,sBAAsB,EAAE,SAAS,GAAG,8BAA8B,EAClE,QAAQ,CAAC,EAAE,4BAA4B,GACtC,IAAI;IAsHP,OAAO,CAAC,MAAM,CAAC,WAAW;IAc1B,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAkB3C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAyCvC"}