@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.
Files changed (171) hide show
  1. package/dist/467dc675-7cc5-4709-8aac-78e3b71bd2f6.manifest.json +136 -141
  2. package/dist/{chunk.legacy-third-party-fabric-core-localfont_none_9e84ea19c68fdc8b9094.js → chunk.legacy-third-party-fabric-core-localfont_none_b7f7978a3e90166c361b.js} +1 -1
  3. package/dist/chunk.teams-apps-client_none_27d3c7c1d01080e4f131.js +2 -0
  4. package/dist/index-internal-beta.d.ts +30 -8
  5. package/dist/index-internal-public.d.ts +30 -8
  6. package/dist/index-internal.d.ts +30 -8
  7. package/dist/sp-component-base_default_8d535b51fa18aa47002b.js +22 -0
  8. package/dist/sp-component-base_en-us_8ce25dfb69a7786caece.js +22 -0
  9. package/dist/sp-component-base_qps-ploc_4fec831895d90df8aa7a.js +22 -0
  10. package/dist/sp-component-base_qps-ploca_b80610c8dff04dcec755.js +22 -0
  11. package/dist/tsdoc-metadata.json +1 -1
  12. package/lib-commonjs/BaseComponent.js +110 -145
  13. package/lib-commonjs/BaseComponentContext.js +126 -183
  14. package/lib-commonjs/DynamicDataProvider.js +251 -268
  15. package/lib-commonjs/DynamicDataSourceManager.js +218 -241
  16. package/lib-commonjs/DynamicProperty.js +232 -280
  17. package/lib-commonjs/EnsureIsolatedDomainUrl.js +14 -14
  18. package/lib-commonjs/IComponentPosition.js +8 -3
  19. package/lib-commonjs/IComponentPropertyMetadata.js +10 -3
  20. package/lib-commonjs/ISerializedServerProcessedData.js +24 -21
  21. package/lib-commonjs/LegacyThirdPartyFabricCoreLoader.js +53 -87
  22. package/lib-commonjs/PropertyMetadataProcessor.js +117 -150
  23. package/lib-commonjs/RenderableComponentContext.js +37 -0
  24. package/lib-commonjs/ShimmerFactory.js +66 -51
  25. package/lib-commonjs/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +6 -4
  26. package/lib-commonjs/common/Flights.js +22 -10
  27. package/lib-commonjs/common/KillSwitches.js +13 -6
  28. package/lib-commonjs/dataCollector/IWebPartLoadData.js +35 -30
  29. package/lib-commonjs/dataCollector/WebPartLoadDataCollector.js +82 -91
  30. package/lib-commonjs/index.js +78 -38
  31. package/lib-commonjs/teams/DeferredTeamsAppsClient.js +30 -52
  32. package/lib-commonjs/teams/ITeamsAppCatalog.js +10 -3
  33. package/lib-commonjs/teams/TeamsAppsClient.js +189 -231
  34. package/lib-commonjs/test-api/MockComponent.js +38 -23
  35. package/lib-commonjs/test-api/MockComponentContext.js +21 -14
  36. package/lib-commonjs/test-api/index.js +21 -7
  37. package/lib-commonjs/themeProvider/ThemeProvider.js +68 -82
  38. package/lib-commonjs/themeProvider/themeInterfaces/IFontStyles.js +5 -2
  39. package/lib-commonjs/themeProvider/themeInterfaces/IPalette.js +10 -3
  40. package/lib-commonjs/themeProvider/themeInterfaces/ISemanticColors.js +59 -3
  41. package/lib-commonjs/themeProvider/themeInterfaces/ISemanticTextColors.js +10 -3
  42. package/lib-commonjs/themeProvider/themeInterfaces/ITheme.js +5 -2
  43. package/{lib → lib-dts}/BaseComponent.d.ts +8 -8
  44. package/{lib → lib-dts}/BaseComponentContext.d.ts +5 -5
  45. package/lib-dts/RenderableComponentContext.d.ts +35 -0
  46. package/{lib → lib-dts}/index.d.ts +1 -0
  47. package/lib-esm/BaseComponent.js +123 -0
  48. package/lib-esm/BaseComponentContext.js +157 -0
  49. package/lib-esm/DynamicDataProvider.js +401 -0
  50. package/lib-esm/DynamicDataSourceManager.js +358 -0
  51. package/lib-esm/DynamicProperty.js +344 -0
  52. package/{lib → lib-esm}/EnsureIsolatedDomainUrl.js +6 -6
  53. package/lib-esm/IComponentPosition.js +5 -0
  54. package/lib-esm/IComponentPropertyMetadata.js +7 -0
  55. package/lib-esm/ISerializedServerProcessedData.js +24 -0
  56. package/lib-esm/LegacyThirdPartyFabricCoreLoader.js +76 -0
  57. package/{lib → lib-esm}/PropertyMetadataProcessor.js +92 -127
  58. package/lib-esm/RenderableComponentContext.js +26 -0
  59. package/lib-esm/ShimmerFactory.js +74 -0
  60. package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +3 -3
  61. package/{lib → lib-esm}/common/Flights.js +4 -3
  62. package/{lib → lib-esm}/common/KillSwitches.js +3 -2
  63. package/lib-esm/dataCollector/IWebPartLoadData.js +33 -0
  64. package/lib-esm/dataCollector/WebPartLoadDataCollector.js +125 -0
  65. package/{lib → lib-esm}/index.js +4 -3
  66. package/lib-esm/teams/DeferredTeamsAppsClient.js +32 -0
  67. package/lib-esm/teams/ITeamsAppCatalog.js +9 -0
  68. package/lib-esm/teams/TeamsAppsClient.js +395 -0
  69. package/lib-esm/test-api/MockComponent.js +38 -0
  70. package/{lib → lib-esm}/test-api/MockComponentContext.js +10 -11
  71. package/{lib → lib-esm}/test-api/index.js +2 -1
  72. package/lib-esm/themeProvider/ThemeProvider.js +79 -0
  73. package/lib-esm/themeProvider/themeInterfaces/IFontStyles.js +7 -0
  74. package/lib-esm/themeProvider/themeInterfaces/IPalette.js +7 -0
  75. package/lib-esm/themeProvider/themeInterfaces/ISemanticColors.js +56 -0
  76. package/lib-esm/themeProvider/themeInterfaces/ISemanticTextColors.js +7 -0
  77. package/lib-esm/themeProvider/themeInterfaces/ITheme.js +7 -0
  78. package/package.json +41 -14
  79. package/dist/chunk.teams-apps-client_none_f9872389cb6ea9ad28e2.js +0 -2
  80. package/dist/sp-component-base_default_5ba07be39b0dc8968f7b.js +0 -2
  81. package/dist/sp-component-base_en-us_eb9bebb3acce0ae83f1c.js +0 -2
  82. package/dist/sp-component-base_qps-ploc_45f37623d87c3d848f2a.js +0 -2
  83. package/dist/sp-component-base_qps-ploca_b3f3b7bf97c4185b0fd6.js +0 -2
  84. package/lib/BaseComponent.d.ts.map +0 -1
  85. package/lib/BaseComponent.js +0 -161
  86. package/lib/BaseComponentContext.d.ts.map +0 -1
  87. package/lib/BaseComponentContext.js +0 -222
  88. package/lib/DynamicDataProvider.d.ts.map +0 -1
  89. package/lib/DynamicDataProvider.js +0 -420
  90. package/lib/DynamicDataSourceManager.d.ts.map +0 -1
  91. package/lib/DynamicDataSourceManager.js +0 -382
  92. package/lib/DynamicProperty.d.ts.map +0 -1
  93. package/lib/DynamicProperty.js +0 -390
  94. package/lib/EnsureIsolatedDomainUrl.d.ts.map +0 -1
  95. package/lib/IComponentPosition.d.ts.map +0 -1
  96. package/lib/IComponentPosition.js +0 -2
  97. package/lib/IComponentPropertyMetadata.d.ts.map +0 -1
  98. package/lib/IComponentPropertyMetadata.js +0 -2
  99. package/lib/ISerializedServerProcessedData.d.ts.map +0 -1
  100. package/lib/ISerializedServerProcessedData.js +0 -28
  101. package/lib/LegacyThirdPartyFabricCoreLoader.d.ts.map +0 -1
  102. package/lib/LegacyThirdPartyFabricCoreLoader.js +0 -90
  103. package/lib/PropertyMetadataProcessor.d.ts.map +0 -1
  104. package/lib/ShimmerFactory.d.ts.map +0 -1
  105. package/lib/ShimmerFactory.js +0 -62
  106. package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts.map +0 -1
  107. package/lib/common/Flights.d.ts.map +0 -1
  108. package/lib/common/KillSwitches.d.ts.map +0 -1
  109. package/lib/dataCollector/IWebPartLoadData.d.ts.map +0 -1
  110. package/lib/dataCollector/IWebPartLoadData.js +0 -40
  111. package/lib/dataCollector/WebPartLoadDataCollector.d.ts.map +0 -1
  112. package/lib/dataCollector/WebPartLoadDataCollector.js +0 -137
  113. package/lib/index.d.ts.map +0 -1
  114. package/lib/teams/DeferredTeamsAppsClient.d.ts.map +0 -1
  115. package/lib/teams/DeferredTeamsAppsClient.js +0 -39
  116. package/lib/teams/ITeamsAppCatalog.d.ts.map +0 -1
  117. package/lib/teams/ITeamsAppCatalog.js +0 -2
  118. package/lib/teams/TeamsAppsClient.d.ts.map +0 -1
  119. package/lib/teams/TeamsAppsClient.js +0 -440
  120. package/lib/test-api/MockComponent.d.ts.map +0 -1
  121. package/lib/test-api/MockComponent.js +0 -31
  122. package/lib/test-api/MockComponentContext.d.ts.map +0 -1
  123. package/lib/test-api/index.d.ts.map +0 -1
  124. package/lib/themeProvider/ThemeProvider.d.ts.map +0 -1
  125. package/lib/themeProvider/ThemeProvider.js +0 -99
  126. package/lib/themeProvider/themeInterfaces/IFontStyles.d.ts.map +0 -1
  127. package/lib/themeProvider/themeInterfaces/IFontStyles.js +0 -2
  128. package/lib/themeProvider/themeInterfaces/IPalette.d.ts.map +0 -1
  129. package/lib/themeProvider/themeInterfaces/IPalette.js +0 -2
  130. package/lib/themeProvider/themeInterfaces/ISemanticColors.d.ts.map +0 -1
  131. package/lib/themeProvider/themeInterfaces/ISemanticColors.js +0 -2
  132. package/lib/themeProvider/themeInterfaces/ISemanticTextColors.d.ts.map +0 -1
  133. package/lib/themeProvider/themeInterfaces/ISemanticTextColors.js +0 -2
  134. package/lib/themeProvider/themeInterfaces/ITheme.d.ts.map +0 -1
  135. package/lib/themeProvider/themeInterfaces/ITheme.js +0 -2
  136. /package/{lib → lib-dts}/DynamicDataProvider.d.ts +0 -0
  137. /package/{lib → lib-dts}/DynamicDataSourceManager.d.ts +0 -0
  138. /package/{lib → lib-dts}/DynamicProperty.d.ts +0 -0
  139. /package/{lib → lib-dts}/EnsureIsolatedDomainUrl.d.ts +0 -0
  140. /package/{lib → lib-dts}/IComponentPosition.d.ts +0 -0
  141. /package/{lib → lib-dts}/IComponentPropertyMetadata.d.ts +0 -0
  142. /package/{lib → lib-dts}/ISerializedServerProcessedData.d.ts +0 -0
  143. /package/{lib → lib-dts}/LegacyThirdPartyFabricCoreLoader.d.ts +0 -0
  144. /package/{lib → lib-dts}/PropertyMetadataProcessor.d.ts +0 -0
  145. /package/{lib → lib-dts}/ShimmerFactory.d.ts +0 -0
  146. /package/{lib → lib-dts}/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts +0 -0
  147. /package/{lib → lib-dts}/common/Flights.d.ts +0 -0
  148. /package/{lib → lib-dts}/common/KillSwitches.d.ts +0 -0
  149. /package/{lib → lib-dts}/dataCollector/IWebPartLoadData.d.ts +0 -0
  150. /package/{lib → lib-dts}/dataCollector/WebPartLoadDataCollector.d.ts +0 -0
  151. /package/{lib → lib-dts}/loc/Strings.resx.d.ts +0 -0
  152. /package/{lib → lib-dts}/teams/DeferredTeamsAppsClient.d.ts +0 -0
  153. /package/{lib → lib-dts}/teams/ITeamsAppCatalog.d.ts +0 -0
  154. /package/{lib → lib-dts}/teams/TeamsAppsClient.d.ts +0 -0
  155. /package/{lib → lib-dts}/test-api/MockComponent.d.ts +0 -0
  156. /package/{lib → lib-dts}/test-api/MockComponentContext.d.ts +0 -0
  157. /package/{lib → lib-dts}/test-api/index.d.ts +0 -0
  158. /package/{lib → lib-dts}/themeProvider/ThemeProvider.d.ts +0 -0
  159. /package/{lib → lib-dts}/themeProvider/themeInterfaces/IFontStyles.d.ts +0 -0
  160. /package/{lib → lib-dts}/themeProvider/themeInterfaces/IPalette.d.ts +0 -0
  161. /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticColors.d.ts +0 -0
  162. /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticTextColors.d.ts +0 -0
  163. /package/{lib → lib-dts}/themeProvider/themeInterfaces/ITheme.d.ts +0 -0
  164. /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFont.global.scss.css +0 -0
  165. /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFontKillSwitchActivated.scss.css +0 -0
  166. /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shim.global.scss.css +0 -0
  167. /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shimKillSwitchActivated.scss.css +0 -0
  168. /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/iconDefinitions.css +0 -0
  169. /package/{lib → lib-esm}/loc/Strings.resx.json +0 -0
  170. /package/{lib → lib-esm}/sp-component-base.manifest.json +0 -0
  171. /package/{lib → lib-esm}/styles/shimmer.module.scss.css +0 -0
@@ -1,12 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var sp_core_library_1 = require("@microsoft/sp-core-library");
5
- var sp_diagnostics_1 = require("@microsoft/sp-diagnostics");
6
- var sp_page_context_1 = require("@microsoft/sp-page-context");
7
- var sp_http_1 = require("@microsoft/sp-http");
8
- var DynamicDataProvider_1 = tslib_1.__importDefault(require("./DynamicDataProvider"));
9
- var DynamicDataSourceManager_1 = tslib_1.__importDefault(require("./DynamicDataSourceManager"));
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
+ const _spcorelibrary = require("@microsoft/sp-core-library");
13
+ const _spdiagnostics = require("@microsoft/sp-diagnostics");
14
+ const _sppagecontext = require("@microsoft/sp-page-context");
15
+ const _sphttp = require("@microsoft/sp-http");
16
+ const _DynamicDataProvider = /*#__PURE__*/ _interop_require_default._(require("./DynamicDataProvider"));
17
+ const _DynamicDataSourceManager = /*#__PURE__*/ _interop_require_default._(require("./DynamicDataSourceManager"));
10
18
  /**
11
19
  * The base class for context objects for client-side components.
12
20
  *
@@ -31,54 +39,15 @@ var DynamicDataSourceManager_1 = tslib_1.__importDefault(require("./DynamicDataS
31
39
  * Never add loose functions, callbacks, or settable properties to the context.
32
40
  *
33
41
  * @public
34
- */
35
- var BaseComponentContext = /** @class */ (function () {
36
- /** @internal */
37
- function BaseComponentContext(parameters) {
38
- var _this = this;
39
- this._isDisposed = false;
40
- this._isServedFromLocalhost = false;
41
- sp_core_library_1.Validate.isNotNullOrUndefined(parameters, 'parameters');
42
- sp_core_library_1.Validate.isNotNullOrUndefined(parameters.manifest, 'manifest');
43
- this.manifest = parameters.manifest;
44
- var loaderConfig = this.manifest.loaderConfig;
45
- if (loaderConfig && loaderConfig.internalModuleBaseUrls && loaderConfig.internalModuleBaseUrls.length) {
46
- this._isServedFromLocalhost = /^http(s)?\:\/\/(localhost|127.0.0.1)/gim.test(loaderConfig.internalModuleBaseUrls[0]);
47
- }
48
- sp_core_library_1.Validate.isNotNullOrUndefined(parameters.parentServiceScope, 'parentServiceScope');
49
- this._serviceScope = parameters.parentServiceScope.startNewChild();
50
- // TODO: VSO:507790 Reconcile this with ClientSideWebPartManager._createWebPartTag()
51
- sp_core_library_1.Validate.isNotNullOrUndefined(parameters.loggingTag, 'loggingTag');
52
- this.serviceScope.provide(sp_diagnostics_1._logSourceServiceKey, sp_diagnostics_1._LogSource.create(parameters.loggingTag));
53
- sp_core_library_1.Validate.isNonemptyString(parameters.instanceId, 'instanceId');
54
- this._instanceId = parameters.instanceId;
55
- this._httpClient = this.serviceScope.createDefaultAndProvide(sp_http_1.HttpClient.serviceKey);
56
- this._spHttpClient = this.serviceScope.createDefaultAndProvide(sp_http_1.SPHttpClient.serviceKey);
57
- this._msGraphClientFactory = this.serviceScope.createDefaultAndProvide(sp_http_1.MSGraphClientFactory.serviceKey);
58
- this._aadClientFactory = this.serviceScope.createDefaultAndProvide(sp_http_1.AadHttpClientFactory.serviceKey);
59
- this._aadTokenFactory = this.serviceScope.createDefaultAndProvide(sp_http_1.AadTokenProviderFactory.serviceKey);
60
- this.serviceScope.provide(sp_core_library_1._ClientManifestData.serviceKey, new sp_core_library_1._ClientManifestData(this.serviceScope, this.manifest));
61
- // Consume services
62
- this.serviceScope.whenFinished(function () {
63
- _this._pageContext = _this.serviceScope.consume(sp_page_context_1.PageContext.serviceKey);
64
- });
65
- this._dynamicDataProvider = new DynamicDataProvider_1.default();
66
- this._dynamicDataSourceManager = new DynamicDataSourceManager_1.default();
67
- }
68
- Object.defineProperty(BaseComponentContext.prototype, "isDisposed", {
69
- /**
70
- * Returns true if the context is disposed.
71
- */
72
- get: function () {
73
- return this._isDisposed;
74
- },
75
- enumerable: false,
76
- configurable: true
77
- });
42
+ */ class BaseComponentContext {
78
43
  /**
79
- * Disposes the base component context.
80
- */
81
- BaseComponentContext.prototype.dispose = function () {
44
+ * Returns true if the context is disposed.
45
+ */ get isDisposed() {
46
+ return this._isDisposed;
47
+ }
48
+ /**
49
+ * Disposes the base component context.
50
+ */ dispose() {
82
51
  if (!this._isDisposed) {
83
52
  if (this._dynamicDataProvider) {
84
53
  this._dynamicDataProvider.dispose();
@@ -92,134 +61,108 @@ var BaseComponentContext = /** @class */ (function () {
92
61
  delete this._dynamicDataSourceManager;
93
62
  this._isDisposed = true;
94
63
  }
95
- };
96
- Object.defineProperty(BaseComponentContext.prototype, "serviceScope", {
97
- /**
98
- * The associated {@link @microsoft/sp-core-library#ServiceScope} for this component.
99
- * @remarks
100
- * A child service scope is created for each client-side component.
101
- */
102
- get: function () {
103
- return this._serviceScope;
104
- },
105
- enumerable: false,
106
- configurable: true
107
- });
108
- Object.defineProperty(BaseComponentContext.prototype, "instanceId", {
109
- /**
110
- * {@inheritDoc BaseComponent.instanceId}
111
- */
112
- get: function () {
113
- return this._instanceId;
114
- },
115
- enumerable: false,
116
- configurable: true
117
- });
118
- Object.defineProperty(BaseComponentContext.prototype, "pageContext", {
119
- /**
120
- * The page context provides standard definitions for common SharePoint objects
121
- * that need to be shared between the client-side application, web parts, and other
122
- * components.
123
- */
124
- get: function () {
125
- return this._pageContext;
126
- },
127
- enumerable: false,
128
- configurable: true
129
- });
64
+ }
65
+ /**
66
+ * The associated {@link @microsoft/sp-core-library#ServiceScope} for this component.
67
+ * @remarks
68
+ * A child service scope is created for each client-side component.
69
+ */ get serviceScope() {
70
+ return this._serviceScope;
71
+ }
72
+ /**
73
+ * {@inheritDoc BaseComponent.instanceId}
74
+ */ get instanceId() {
75
+ return this._instanceId;
76
+ }
130
77
  /**
131
- * Creates a Dynamic Data Provider for the component.
132
- *
133
- * @param component - Component tied to the Dynamic Data Provider
134
- * @param serviceScope - ServiceScope to consume the Dynamic Data Manager from. Must be finished.
135
- * @internal
136
- */
137
- BaseComponentContext.prototype._initializeDynamicData = function (component, serviceScope) {
78
+ * The page context provides standard definitions for common SharePoint objects
79
+ * that need to be shared between the client-side application, web parts, and other
80
+ * components.
81
+ */ get pageContext() {
82
+ return this._pageContext;
83
+ }
84
+ /**
85
+ * Creates a Dynamic Data Provider for the component.
86
+ *
87
+ * @param component - Component tied to the Dynamic Data Provider
88
+ * @param serviceScope - ServiceScope to consume the Dynamic Data Manager from. Must be finished.
89
+ * @internal
90
+ */ _initializeDynamicData(component, serviceScope) {
138
91
  this._dynamicDataProvider._initialize(component, serviceScope);
139
92
  this._dynamicDataSourceManager._initialize(component, serviceScope);
140
- };
141
- Object.defineProperty(BaseComponentContext.prototype, "dynamicDataProvider", {
142
- /**
143
- * Returns the Dynamic Data Provider associated with the component.
144
- */
145
- get: function () {
146
- return this._dynamicDataProvider;
147
- },
148
- enumerable: false,
149
- configurable: true
150
- });
151
- Object.defineProperty(BaseComponentContext.prototype, "dynamicDataSourceManager", {
152
- /**
153
- * Returns the Dynamic Data Source Manager associated with the component.
154
- */
155
- get: function () {
156
- return this._dynamicDataSourceManager;
157
- },
158
- enumerable: false,
159
- configurable: true
160
- });
161
- Object.defineProperty(BaseComponentContext.prototype, "aadHttpClientFactory", {
162
- /**
163
- * The instance of AadHttpClientFactory created for this instance of component
164
- */
165
- get: function () {
166
- return this._aadClientFactory;
167
- },
168
- enumerable: false,
169
- configurable: true
170
- });
171
- Object.defineProperty(BaseComponentContext.prototype, "aadTokenProviderFactory", {
172
- /**
173
- * The instance of AadTokenProviderFactory created for this instance of component
174
- */
175
- get: function () {
176
- return this._aadTokenFactory;
177
- },
178
- enumerable: false,
179
- configurable: true
180
- });
181
- Object.defineProperty(BaseComponentContext.prototype, "msGraphClientFactory", {
182
- /**
183
- * The instance of MSGraphClientFactory created for this instance of component
184
- */
185
- get: function () {
186
- return this._msGraphClientFactory;
187
- },
188
- enumerable: false,
189
- configurable: true
190
- });
191
- Object.defineProperty(BaseComponentContext.prototype, "httpClient", {
192
- /**
193
- * The instance of HttpClient created for this instance of component
194
- */
195
- get: function () {
196
- return this._httpClient;
197
- },
198
- enumerable: false,
199
- configurable: true
200
- });
201
- Object.defineProperty(BaseComponentContext.prototype, "spHttpClient", {
202
- /**
203
- * The instance of SpHttpClient created for this instance of component
204
- */
205
- get: function () {
206
- return this._spHttpClient;
207
- },
208
- enumerable: false,
209
- configurable: true
210
- });
211
- Object.defineProperty(BaseComponentContext.prototype, "isServedFromLocalhost", {
212
- /**
213
- * Returns true if the solution is being served from localhost
214
- */
215
- get: function () {
216
- return this._isServedFromLocalhost;
217
- },
218
- enumerable: false,
219
- configurable: true
220
- });
221
- return BaseComponentContext;
222
- }());
223
- (0, sp_core_library_1._ES5CompatibleClass)(BaseComponentContext);
224
- exports.default = BaseComponentContext;
225
- //# sourceMappingURL=BaseComponentContext.js.map
93
+ }
94
+ /**
95
+ * Returns the Dynamic Data Provider associated with the component.
96
+ */ get dynamicDataProvider() {
97
+ return this._dynamicDataProvider;
98
+ }
99
+ /**
100
+ * Returns the Dynamic Data Source Manager associated with the component.
101
+ */ get dynamicDataSourceManager() {
102
+ return this._dynamicDataSourceManager;
103
+ }
104
+ /**
105
+ * The instance of AadHttpClientFactory created for this instance of component
106
+ */ get aadHttpClientFactory() {
107
+ return this._aadClientFactory;
108
+ }
109
+ /**
110
+ * The instance of AadTokenProviderFactory created for this instance of component
111
+ */ get aadTokenProviderFactory() {
112
+ return this._aadTokenFactory;
113
+ }
114
+ /**
115
+ * The instance of MSGraphClientFactory created for this instance of component
116
+ */ get msGraphClientFactory() {
117
+ return this._msGraphClientFactory;
118
+ }
119
+ /**
120
+ * The instance of HttpClient created for this instance of component
121
+ */ get httpClient() {
122
+ return this._httpClient;
123
+ }
124
+ /**
125
+ * The instance of SpHttpClient created for this instance of component
126
+ */ get spHttpClient() {
127
+ return this._spHttpClient;
128
+ }
129
+ /**
130
+ * Returns true if the solution is being served from localhost
131
+ */ get isServedFromLocalhost() {
132
+ return this._isServedFromLocalhost;
133
+ }
134
+ /** @internal */ constructor(parameters){
135
+ this._isDisposed = false;
136
+ this._isServedFromLocalhost = false;
137
+ _spcorelibrary.Validate.isNotNullOrUndefined(parameters, 'parameters');
138
+ _spcorelibrary.Validate.isNotNullOrUndefined(parameters.manifest, 'manifest');
139
+ this.manifest = parameters.manifest;
140
+ const { loaderConfig } = this.manifest;
141
+ if (loaderConfig && loaderConfig.internalModuleBaseUrls && loaderConfig.internalModuleBaseUrls.length) {
142
+ this._isServedFromLocalhost = /^http(s)?\:\/\/(localhost|127.0.0.1)/gim.test(loaderConfig.internalModuleBaseUrls[0]);
143
+ }
144
+ _spcorelibrary.Validate.isNotNullOrUndefined(parameters.parentServiceScope, 'parentServiceScope');
145
+ this._serviceScope = parameters.parentServiceScope.startNewChild();
146
+ // TODO: VSO:507790 Reconcile this with ClientSideWebPartManager._createWebPartTag()
147
+ _spcorelibrary.Validate.isNotNullOrUndefined(parameters.loggingTag, 'loggingTag');
148
+ this.serviceScope.provide(_spdiagnostics._logSourceServiceKey, _spdiagnostics._LogSource.create(parameters.loggingTag));
149
+ _spcorelibrary.Validate.isNonemptyString(parameters.instanceId, 'instanceId');
150
+ this._instanceId = parameters.instanceId;
151
+ this._httpClient = this.serviceScope.createDefaultAndProvide(_sphttp.HttpClient.serviceKey);
152
+ this._spHttpClient = this.serviceScope.createDefaultAndProvide(_sphttp.SPHttpClient.serviceKey);
153
+ this._msGraphClientFactory = this.serviceScope.createDefaultAndProvide(_sphttp.MSGraphClientFactory.serviceKey);
154
+ this._aadClientFactory = this.serviceScope.createDefaultAndProvide(_sphttp.AadHttpClientFactory.serviceKey);
155
+ this._aadTokenFactory = this.serviceScope.createDefaultAndProvide(_sphttp.AadTokenProviderFactory.serviceKey);
156
+ this.serviceScope.provide(_spcorelibrary._ClientManifestData.serviceKey, new _spcorelibrary._ClientManifestData(this.serviceScope, this.manifest));
157
+ // Consume services
158
+ this.serviceScope.whenFinished(()=>{
159
+ this._pageContext = this.serviceScope.consume(_sppagecontext.PageContext.serviceKey);
160
+ });
161
+ this._dynamicDataProvider = new _DynamicDataProvider.default();
162
+ this._dynamicDataSourceManager = new _DynamicDataSourceManager.default();
163
+ }
164
+ }
165
+ (0, _spcorelibrary._ES5CompatibleClass)(BaseComponentContext);
166
+ const _default = BaseComponentContext;
167
+
168
+ //# sourceMappingURL=./BaseComponentContext.js.map